[vlmc-devel] FirstLaunch: Add a step to select media library folders

Hugo Beauzée-Luyssen git at videolan.org
Mon Jul 4 15:34:38 CEST 2016


vlmc | branch: medialibrary | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sun Jun  5 23:38:47 2016 +0200| [49272945d8b9a23d4c9034d7ab5d1782180e5048] | committer: Hugo Beauzée-Luyssen

FirstLaunch: Add a step to select media library folders

> https://code.videolan.org/videolan/vlmc/commit/49272945d8b9a23d4c9034d7ab5d1782180e5048
---

 src/CMakeLists.txt                                |  2 ++
 src/Gui/wizard/firstlaunch/FirstLaunchWizard.cpp  |  4 +++
 src/Gui/wizard/firstlaunch/MediaLibraryDirs.cpp   | 41 +++++++++++++++++++++
 src/Gui/wizard/firstlaunch/MediaLibraryDirs.h     | 44 +++++++++++++++++++++++
 src/Gui/wizard/ui/firstlaunch/MediaLibraryDirs.ui | 42 ++++++++++++++++++++++
 5 files changed, 133 insertions(+)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 10fbb11..7fbbbf3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -215,6 +215,7 @@ ELSE(NOT WITH_GUI)
         Gui/wizard/WelcomePage.cpp
         Gui/wizard/firstlaunch/FirstLaunchWizard.cpp
         Gui/wizard/firstlaunch/FirstLaunchPage.cpp
+        Gui/wizard/firstlaunch/MediaLibraryDirs.cpp
         Gui/wizard/firstlaunch/WorkspaceLocation.cpp
         Gui/wizard/firstlaunch/Done.cpp
         )
@@ -246,6 +247,7 @@ ELSE(NOT WITH_GUI)
         Gui/wizard/ui/VideoPage.ui
         Gui/wizard/ui/WelcomePage.ui
         Gui/wizard/ui/firstlaunch/FirstLaunchPage.ui
+        Gui/wizard/ui/firstlaunch/MediaLibraryDirs.ui
         Gui/wizard/ui/firstlaunch/WorkspaceLocation.ui
         Gui/wizard/ui/firstlaunch/Done.ui
         )
diff --git a/src/Gui/wizard/firstlaunch/FirstLaunchWizard.cpp b/src/Gui/wizard/firstlaunch/FirstLaunchWizard.cpp
index 039bafd..bff49ec 100644
--- a/src/Gui/wizard/firstlaunch/FirstLaunchWizard.cpp
+++ b/src/Gui/wizard/firstlaunch/FirstLaunchWizard.cpp
@@ -23,6 +23,7 @@
 #include "FirstLaunchWizard.h"
 #include "WorkspaceLocation.h"
 #include "FirstLaunchPage.h"
+#include "MediaLibraryDirs.h"
 #include "Done.h"
 #include "Settings/Settings.h"
 
@@ -35,6 +36,7 @@ FirstLaunchWizard::FirstLaunchWizard( QWidget* parent )
 
     addPage( new FirstLaunchPage( this ) );
     addPage( new WorkspaceLocation( this ) );
+    addPage( new MediaLibraryDirs( this ) );
     addPage( new Done( this ) );
 }
 
@@ -49,8 +51,10 @@ void
 FirstLaunchWizard::accept()
 {
     auto workspaceLocation = field( "workspaceLocation" );
+    auto mlDirs = field( "mlDirs" );
     Q_ASSERT( workspaceLocation.toString().isEmpty() == false );
     Core::instance()->settings()->setValue( "vlmc/WorkspaceLocation", workspaceLocation );
     Core::instance()->settings()->setValue( "private/FirstLaunchDone", true );
+    Core::instance()->settings()->setValue( "vlmc/mlDirs", mlDirs );
     QDialog::accept();
 }
diff --git a/src/Gui/wizard/firstlaunch/MediaLibraryDirs.cpp b/src/Gui/wizard/firstlaunch/MediaLibraryDirs.cpp
new file mode 100644
index 0000000..dbac96f
--- /dev/null
+++ b/src/Gui/wizard/firstlaunch/MediaLibraryDirs.cpp
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ * MediaLibraryDirs.cpp
+ *****************************************************************************
+ * Copyright (C) 2008-2016 the VLMC team
+ *
+ * Authors: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#include "MediaLibraryDirs.h"
+#include "Main/Core.h"
+#include "Settings/Settings.h"
+
+#include "ui_MediaLibraryDirs.h"
+
+MediaLibraryDirs::MediaLibraryDirs(QWidget *parent)
+    : QWizardPage(parent)
+    , m_ui( new Ui::MediaLibraryDirs )
+{
+    m_ui->setupUi( this );
+    setTitle( tr( "Media Library folders" ) );
+    registerField( "mlDirs*", m_ui->foldersList, "folders", SIGNAL( foldersChanged() ) );
+}
+
+MediaLibraryDirs::~MediaLibraryDirs()
+{
+    delete m_ui;
+}
diff --git a/src/Gui/wizard/firstlaunch/MediaLibraryDirs.h b/src/Gui/wizard/firstlaunch/MediaLibraryDirs.h
new file mode 100644
index 0000000..5234f01
--- /dev/null
+++ b/src/Gui/wizard/firstlaunch/MediaLibraryDirs.h
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * MediaLibraryDirs.h
+ *****************************************************************************
+ * Copyright (C) 2008-2016 the VLMC team
+ *
+ * Authors: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef MEDIALIBRARYDIRS_H
+#define MEDIALIBRARYDIRS_H
+
+#include <QWizardPage>
+
+namespace Ui {
+    class MediaLibraryDirs;
+}
+
+class MediaLibraryDirs : public QWizardPage
+{
+    Q_OBJECT
+
+public:
+    explicit MediaLibraryDirs( QWidget *parent = 0 );
+    virtual ~MediaLibraryDirs();
+
+private:
+    Ui::MediaLibraryDirs* m_ui;
+};
+
+#endif // MEDIALIBRARYDIRS_H
diff --git a/src/Gui/wizard/ui/firstlaunch/MediaLibraryDirs.ui b/src/Gui/wizard/ui/firstlaunch/MediaLibraryDirs.ui
new file mode 100644
index 0000000..aad909b
--- /dev/null
+++ b/src/Gui/wizard/ui/firstlaunch/MediaLibraryDirs.ui
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MediaLibraryDirs</class>
+ <widget class="QWizardPage" name="MediaLibraryDirs">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>WizardPage</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QLabel" name="label">
+     <property name="text">
+      <string><html><head/><body><p><span style=" font-weight:600;">Media Library folders</span></p><p><br/></p><p>You now need to specify where can VLMC find your media files.</p><p>You'll need at least one, but can chose as many as you want.</p></body></html></string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="FolderList" name="foldersList" native="true"/>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>FolderList</class>
+   <extends>QWidget</extends>
+   <header location="global">Gui/settings/FolderListWidget.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>



More information about the Vlmc-devel mailing list