Commit 7f60d0c8 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

FirstLaunch: Add a step to select media library folders

parent 93616b44
......@@ -229,6 +229,7 @@ vlmc_SOURCES += \
src/Gui/wizard/firstlaunch/FirstLaunchPage.cpp \
src/Gui/wizard/firstlaunch/WorkspaceLocation.cpp \
src/Gui/wizard/firstlaunch/Done.cpp \
src/Gui/wizard/firstlaunch/MediaLibraryDirs.cpp \
$(NULL)
if HAVE_DARWIN
......@@ -255,6 +256,7 @@ vlmc_SOURCES += \
src/Gui/wizard/firstlaunch/WorkspaceLocation.h \
src/Gui/wizard/firstlaunch/Done.h \
src/Gui/wizard/OpenPage.h \
src/Gui/wizard/firstlaunch/MediaLibraryDirs.h \
src/Gui/timeline/Timeline.h \
src/Gui/timeline/ThumbnailImageProvider.h \
src/Gui/About.h \
......@@ -382,6 +384,7 @@ vlmc_UI = \
src/Gui/ui/VideoPage.ui \
src/Gui/ui/WelcomePage.ui \
src/Gui/ui/FirstLaunchPage.ui \
src/Gui/ui/MediaLibraryDirs.ui \
src/Gui/ui/WorkspaceLocation.ui \
src/Gui/ui/Done.ui \
$(NULL)
......
<?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>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Media Library folders&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;You now need to specify where can VLMC find your media files.&lt;/p&gt;&lt;p&gt;You'll need at least one, but can chose as many as you want.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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>
......@@ -27,6 +27,7 @@
#include "FirstLaunchWizard.h"
#include "WorkspaceLocation.h"
#include "FirstLaunchPage.h"
#include "MediaLibraryDirs.h"
#include "Done.h"
#include "Settings/Settings.h"
......@@ -39,6 +40,7 @@ FirstLaunchWizard::FirstLaunchWizard( QWidget* parent )
addPage( new FirstLaunchPage( this ) );
addPage( new WorkspaceLocation( this ) );
addPage( new MediaLibraryDirs( this ) );
addPage( new Done( this ) );
}
......@@ -53,8 +55,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();
}
/*****************************************************************************
* MediaLibraryDirs.cpp
*****************************************************************************
* Copyright (C) 2008-2016 the VLMC team
*
* Authors: Hugo Beauzée-Luyssen <hugo@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;
}
/*****************************************************************************
* MediaLibraryDirs.h
*****************************************************************************
* Copyright (C) 2008-2016 the VLMC team
*
* Authors: Hugo Beauzée-Luyssen <hugo@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
{
public:
explicit MediaLibraryDirs( QWidget *parent = 0 );
virtual ~MediaLibraryDirs();
private:
Ui::MediaLibraryDirs* m_ui;
};
#endif // MEDIALIBRARYDIRS_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment