Commit 2123f3cb authored by Matthieu Gallien's avatar Matthieu Gallien

Merge branch 'fixConfig' into 'release/19.12'

convert KCM based configuration dialog to a simple dialog

See merge request !42
parents 0f7e8b7d 1e328cd9
......@@ -28,7 +28,8 @@ set(elisaLib_SOURCES
models/trackmetadatamodel.cpp
models/trackcontextmetadatamodel.cpp
models/viewsmodel.cpp
)
localFileConfiguration/elisaconfigurationdialog.cpp
)
ecm_qt_declare_logging_category(elisaLib_SOURCES
HEADER "indexersManager.h"
......@@ -402,6 +403,8 @@ if (Qt5Quick_FOUND AND Qt5Widgets_FOUND)
qml/ScrollHelper.qml
qml/FlatButtonWithToolTip.qml
qml/HeaderFooterToolbar.qml
qml/ElisaConfigurationDialog.qml
)
qt5_add_resources(elisa_SOURCES resources.qrc)
......@@ -461,10 +464,6 @@ if (Qt5Quick_FOUND AND Qt5Widgets_FOUND)
install(TARGETS elisa ${INSTALL_TARGETS_DEFAULT_ARGS})
endif()
if (KF5ConfigWidgets_FOUND AND KF5Declarative_FOUND)
add_subdirectory(localFileConfiguration)
endif()
set(elisaImport_SOURCES
elisaimport.cpp
elisaimportapplication.cpp
......
......@@ -48,6 +48,7 @@
#include <KCoreAddons/KAboutData>
#include <QQmlApplicationEngine>
#include <QCoreApplication>
#include <QDesktopServices>
#include <QDialog>
......@@ -98,6 +99,8 @@ public:
std::unique_ptr<ManageHeaderBar> mManageHeaderBar;
QQmlApplicationEngine *mEngine = nullptr;
};
ElisaApplication::ElisaApplication(QObject *parent) : QObject(parent), d(std::make_unique<ElisaApplicationPrivate>(this))
......@@ -265,13 +268,12 @@ void ElisaApplication::configureShortcuts()
void ElisaApplication::configureElisa()
{
#if defined KF5KCMUtils_FOUND && KF5KCMUtils_FOUND
KCMultiDialog configurationDialog;
if (!d->mEngine)
{
return;
}
configurationDialog.addModule(QStringLiteral("kcm_elisa_local_file"));
configurationDialog.setModal(true);
configurationDialog.exec();
#endif
d->mEngine->load(QUrl(QStringLiteral("qrc:/qml/ElisaConfigurationDialog.qml")));
}
void ElisaApplication::goBack() {}
......@@ -325,6 +327,11 @@ void ElisaApplication::initialize()
Q_EMIT initializationDone();
}
void ElisaApplication::setQmlEngine(QQmlApplicationEngine *engine)
{
d->mEngine = engine;
}
void ElisaApplication::initializeModels()
{
d->mMusicManager = std::make_unique<MusicListenersManager>();
......
......@@ -37,6 +37,7 @@ class AudioWrapper;
class ManageAudioPlayer;
class ManageMediaPlayerControl;
class ManageHeaderBar;
class QQmlApplicationEngine;
class ElisaApplicationPrivate;
class ELISALIB_EXPORT ElisaApplication : public QObject
......@@ -145,6 +146,10 @@ public Q_SLOTS:
void initialize();
public:
void setQmlEngine(QQmlApplicationEngine *engine);
private Q_SLOTS:
void goBack();
......
......@@ -52,6 +52,7 @@
#include "models/gridviewproxymodel.h"
#include "models/alltracksproxymodel.h"
#include "models/singlealbumproxymodel.h"
#include "localFileConfiguration/elisaconfigurationdialog.h"
#if defined KF5FileMetaData_FOUND && KF5FileMetaData_FOUND
#include "embeddedcoverageimageprovider.h"
......@@ -178,6 +179,7 @@ void ElisaQmlTestPlugin::registerTypes(const char *uri)
qRegisterMetaType<TracksListener::TrackDataType>("TracksListener::TrackDataType");
qRegisterMetaType<ViewManager::ViewsType>("ViewManager::ViewsType");
qRegisterMetaType<ViewManager::SortOrder>("ViewManager::SortOrder");
qmlRegisterUncreatableType<ElisaConfigurationDialog>(uri, 1, 0, "ElisaConfigurationDialog", QStringLiteral("only one and done in c++"));
qmlRegisterUncreatableType<ElisaApplication>(uri, 1, 0, "ElisaApplication", QStringLiteral("only one and done in c++"));
qmlRegisterUncreatableMetaObject(ElisaUtils::staticMetaObject, uri, 1, 0, "ElisaUtils", QStringLiteral("Namespace ElisaUtils"));
......
set(KCM_ELISA_LOCAL_FILE_SRCS
localfileconfiguration.cpp
kcm_elisa_local_file.desktop
package/contents/ui/main.qml
package/metadata.desktop
)
kconfig_add_kcfg_files(KCM_ELISA_LOCAL_FILE_SRCS ../elisa_settings.kcfgc )
set(KCM_ELISA_LOCAL_FILE_SRCS
${KCM_ELISA_LOCAL_FILE_SRCS}
../elisa_core.kcfg
)
add_library(kcm_elisa_local_file MODULE ${KCM_ELISA_LOCAL_FILE_SRCS})
target_link_libraries(kcm_elisa_local_file
Qt5::Core
KF5::ConfigCore
KF5::I18n
KF5::CoreAddons
)
if (KF5Declarative_FOUND)
target_link_libraries(kcm_elisa_local_file
KF5::Declarative
KF5::QuickAddons
)
endif()
if (KF5ConfigWidgets_FOUND)
target_link_libraries(kcm_elisa_local_file
KF5::ConfigWidgets
)
endif()
kcoreaddons_desktop_to_json(kcm_elisa_local_file "kcm_elisa_local_file.desktop")
install(FILES kcm_elisa_local_file.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
install(TARGETS kcm_elisa_local_file DESTINATION ${KDE_INSTALL_PLUGINDIR}/kcms)
if (KF5Package_FOUND)
kpackage_install_bundled_package(package kcm_elisa_local_file kcms)
endif()
#!/usr/bin/env bash
$XGETTEXT $(find . -name \*.qml -o -name \*.cpp) -o $podir/kcm_elisa_local_file.pot
......@@ -15,39 +15,24 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "localfileconfiguration.h"
#include "elisaconfigurationdialog.h"
#include "elisa-version.h"
#include "elisa_settings.h"
#include <KPluginFactory>
#include <KAboutData>
#include <KLocalizedString>
#include <QStandardPaths>
#include <QFileInfo>
K_PLUGIN_CLASS_WITH_JSON(KCMElisaLocalFile, "kcm_elisa_local_file.json")
KCMElisaLocalFile::KCMElisaLocalFile(QObject* parent, const QVariantList &args)
: ConfigModule(parent, args)
ElisaConfigurationDialog::ElisaConfigurationDialog(QObject* parent)
: QObject(parent)
{
KAboutData *about = new KAboutData(QStringLiteral("kcm_elisa_local_file"),
i18n("Elisa Local Files Indexer Configuration"),
QStringLiteral(ELISA_VERSION_STRING), {}, KAboutLicense::LGPL_V3,
i18n("Copyright 2017-2019 Matthieu Gallien <matthieu_gallien@yahoo.fr>"));
about->addAuthor(i18n("Matthieu Gallien"),i18n("Author"), QStringLiteral("mgallien@mgallien.fr"));
setAboutData(about);
auto configurationFileName = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
configurationFileName += QStringLiteral("/elisarc");
Elisa::ElisaConfiguration::instance(configurationFileName);
connect(Elisa::ElisaConfiguration::self(), &Elisa::ElisaConfiguration::configChanged,
this, &KCMElisaLocalFile::configChanged);
this, &ElisaConfigurationDialog::configChanged);
connect(&mConfigFileWatcher, &QFileSystemWatcher::fileChanged,
this, &KCMElisaLocalFile::configChanged);
this, &ElisaConfigurationDialog::configChanged);
setRootPath(Elisa::ElisaConfiguration::rootPath());
......@@ -57,31 +42,15 @@ KCMElisaLocalFile::KCMElisaLocalFile(QObject* parent, const QVariantList &args)
mConfigFileWatcher.addPath(Elisa::ElisaConfiguration::self()->config()->name());
}
KCMElisaLocalFile::~KCMElisaLocalFile()
ElisaConfigurationDialog::~ElisaConfigurationDialog()
= default;
QStringList KCMElisaLocalFile::rootPath() const
QStringList ElisaConfigurationDialog::rootPath() const
{
return mRootPath;
}
void KCMElisaLocalFile::defaults()
{
setRootPath(QStandardPaths::standardLocations(QStandardPaths::MusicLocation));
}
void KCMElisaLocalFile::load()
{
setRootPath(Elisa::ElisaConfiguration::rootPath());
}
void KCMElisaLocalFile::save()
{
Elisa::ElisaConfiguration::setRootPath(mRootPath);
Elisa::ElisaConfiguration::self()->save();
}
void KCMElisaLocalFile::setRootPath(const QStringList &rootPath)
void ElisaConfigurationDialog::setRootPath(const QStringList &rootPath)
{
if (mRootPath == rootPath && !mRootPath.isEmpty()) {
return;
......@@ -110,15 +79,18 @@ void KCMElisaLocalFile::setRootPath(const QStringList &rootPath)
}
Q_EMIT rootPathChanged(mRootPath);
}
setNeedsSave(true);
Q_EMIT needsSaveChanged();
void ElisaConfigurationDialog::save()
{
Elisa::ElisaConfiguration::setRootPath(mRootPath);
Elisa::ElisaConfiguration::self()->save();
}
void KCMElisaLocalFile::configChanged()
void ElisaConfigurationDialog::configChanged()
{
setRootPath(Elisa::ElisaConfiguration::rootPath());
}
#include "localfileconfiguration.moc"
#include "moc_elisaconfigurationdialog.cpp"
......@@ -15,14 +15,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined LOCALFILECONFIGURATION_H_
#define LOCALFILECONFIGURATION_H_
#if !defined ELISACONFIGURATIONDIALOG_H_
#define ELISACONFIGURATIONDIALOG_H_
#include "elisaLib_export.h"
#include <KQuickAddons/ConfigModule>
#include <QStringList>
#include <QFileSystemWatcher>
class KCMElisaLocalFile : public KQuickAddons::ConfigModule
class ELISALIB_EXPORT ElisaConfigurationDialog : public QObject
{
Q_OBJECT
......@@ -34,9 +35,9 @@ class KCMElisaLocalFile : public KQuickAddons::ConfigModule
public:
explicit KCMElisaLocalFile(QObject *parent, const QVariantList &args);
explicit ElisaConfigurationDialog(QObject *parent = nullptr);
~KCMElisaLocalFile() override;
~ElisaConfigurationDialog() override;
QStringList rootPath() const;
......@@ -46,14 +47,10 @@ Q_SIGNALS:
public Q_SLOTS:
void defaults() override final;
void load() override final;
void save() override final;
void setRootPath(const QStringList &rootPath);
void save();
private Q_SLOTS:
void configChanged();
......
[Desktop Entry]
Type=Service
Icon=elisa
Exec=kcmshell5 kcm_elisa_local_file
X-KDE-Library=kcm_elisa_local_file
X-KDE-ServiceTypes=KCModule
X-KDE-ParentComponents=elisa
X-KDE-PluginKeyword=kcm_elisa_local_file
Name=Elisa Local Files Indexer
Name[ar]=مفهرس الملفّات المحليّة إليسّا
Name[ca]=Indexador de fitxers locals de l'Elisa
Name[ca@valencia]=Indexador de fitxers locals de l'Elisa
Name[cs]=Indexer místních souborů Elisa
Name[da]=Elisa, indeksering af lokale filer
Name[de]=Lokale Dateiindizierung von Elisa
Name[el]=Πρόγραμμα δεικτοδότησης τοπικών αρχείων της Elisa
Name[en_GB]=Elisa Local Files Indexer
Name[es]=Indexador de archivos locales de Elisa
Name[eu]=Elisa fitxategi lokalen indexatzailea
Name[fi]=Elisan paikallisten tiedostojen indeksoija
Name[fr]=Indexeur de fichiers locaux pour Elisa
Name[gl]=Indexador de ficheiros locais de Elisa
Name[hu]=Elisa helyifájl-indexelő
Name[id]=Pengindeks File Lokal Elisa
Name[it]=Indicizzatore di file locali di Elisa
Name[ko]=Elisa 로컬 파일 인덱서
Name[nl]=Lokale bestanden van Elisa indexeerder
Name[nn]=Indeksering av lokale filer for Elisa
Name[pl]=Indeksowanie plików lokalnych Elisy
Name[pt]=Indexação de Ficheiros Locais do Elisa
Name[pt_BR]=Indexador de arquivos locais do Elisa
Name[ru]=Индексирование файлов для Elisa
Name[sk]=Indexer miestnych súborov Elisa
Name[sv]=Elisa lokal filindexering
Name[tr]=Elias Yerel Dosya İndeksleyici
Name[uk]=Засіб індексування локальних файлів Elisa
Name[x-test]=xxElisa Local Files Indexerxx
Name[zh_CN]=Elisa 本地文件索引器
Name[zh_TW]=Elisa 本機檔案索引器
Comment=A configuration tool for Elisa music player local files indexer
Comment[ar]=أداة يمكن تطويعها لمفهرس ملفّات «مشغّل الموسيقى إليسّا» المحليّة
Comment[ca]=Una eina de configuració per a l'indexador de fitxers locals del reproductor de música Elisa
Comment[ca@valencia]=Una eina de configuració per a l'indexador de fitxers locals del reproductor de música Elisa
Comment[cs]=Konfigurační nástroj pro indexer místních souborů pro přehrávač Elisa
Comment[da]=Et konfigurationsværktøj til Elisa, musikafspilleren til indeksering af lokale filer
Comment[de]=Einstellungen für die lokale Dateiindizierung der Elisa-Musikwiedergabe
Comment[el]=Ένα εργαλείο διαμόρφωσης για το πρόγραμμα δεικτοδότησης τοπικών αρχείων της συσκευής αναπαραγωγής μουσικής Elisa
Comment[en_GB]=A configuration tool for Elisa music player local files indexer
Comment[es]=Una herramienta de configuración para el indexador de archivos locales del reproductor de música Elisa
Comment[eu]=Elisa musika jotzailearen fitxategi lokalen indexatzailea konfiguratzeko tresna bat
Comment[fi]=Asetustyökalu Elisa-musiikkisoittimen paikallisten tiedostojen indeksoijalle
Comment[fr]=Un outil de configuration pour l'indexeur de fichiers locaux pour Elisa
Comment[gl]=Unha ferramenta de configuración para o indexador de ficheiros locais do reprodutor de música Elisa.
Comment[hu]=Beállítóeszköz az Elisa zenelejátszó helyifájl-indexelő szolgáltatásához
Comment[id]=Sebuah alat konfigurasi untuk pengindeks file lokal pemutar musik Elisa
Comment[it]=Uno strumento di configurazione l'indicizzatore di file locali del lettore musicale Elisa
Comment[ko]=Elisa 음악 재생기의 로컬 파일 인덱서를 위한 구성 도구
Comment[nl]=Een configuratiehulpmiddel voor de indexeerder van lokale bestanden van de muziekspeler Elisa
Comment[nn]=Oppsettverktøy for indeksering av lokale filer for musikkspelaren Elisa
Comment[pl]=Narzędzie ustawień indeksowania plików lokalnych Elisy
Comment[pt]=Uma ferramenta de configuração para a indexação de ficheiros locais no leitor de música Elisa
Comment[pt_BR]=Uma ferramenta de configuração para indexar os arquivos locais do reprodutor de músicas Elisa
Comment[ru]=Настройка индексирования файлов для проигрывателя Elisa
Comment[sk]=Konfiguračný nástroj pre indexer miestnych súborov hudobného prehrávača Elisa
Comment[sv]=Ett inställningsverktyg för lokal filindexering i Elisa musikspelare
Comment[tr]=Elisa müzik çalar yerel dosya indeksleyicisi için bir yapılandırma aracı
Comment[uk]=Інструмент налаштовування засобу індексування локальних файлів музичного програвача Elisa
Comment[x-test]=xxA configuration tool for Elisa music player local files indexerxx
Comment[zh_CN]=Elisa 音乐播放器本地文件索引器的配置工具
Comment[zh_TW]=一個 Elisa 音樂播放器的本機檔案索引器的設定工具
X-KDE-Keywords=Elisa
X-KDE-Keywords[ar]=إليسّا
X-KDE-Keywords[ca]=Elisa
X-KDE-Keywords[ca@valencia]=Elisa
X-KDE-Keywords[cs]=Elisa
X-KDE-Keywords[da]=Elisa
X-KDE-Keywords[de]=Elisa
X-KDE-Keywords[el]=Elisa
X-KDE-Keywords[en_GB]=Elisa
X-KDE-Keywords[es]=Elisa
X-KDE-Keywords[eu]=Elisa
X-KDE-Keywords[fi]=Elisa
X-KDE-Keywords[fr]=Elisa
X-KDE-Keywords[gl]=Elisa
X-KDE-Keywords[hu]=Elisa
X-KDE-Keywords[id]=Elisa
X-KDE-Keywords[it]=Elisa
X-KDE-Keywords[ko]=Elisa
X-KDE-Keywords[nl]=Elisa
X-KDE-Keywords[nn]=Elisa
X-KDE-Keywords[pl]=Elisa
X-KDE-Keywords[pt]=Elisa
X-KDE-Keywords[pt_BR]=Elisa
X-KDE-Keywords[ru]=Elisa
X-KDE-Keywords[sk]=Elisa
X-KDE-Keywords[sv]=Elisa
X-KDE-Keywords[tr]=Elisa
X-KDE-Keywords[uk]=Elisa
X-KDE-Keywords[x-test]=xxElisaxx
X-KDE-Keywords[zh_CN]=Elisa
X-KDE-Keywords[zh_TW]=Elisa
X-DocPath=elisa/index.html
[Desktop Entry]
Name=Elisa
Name[ar]=إليسّا
Name[ca]=Elisa
Name[ca@valencia]=Elisa
Name[cs]=Elisa
Name[da]=Elisa
Name[de]=Elisa
Name[el]=Elisa
Name[en_GB]=Elisa
Name[es]=Elisa
Name[eu]=Elisa
Name[fi]=Elisa
Name[fr]=Elisa
Name[gl]=Elisa
Name[hu]=Elisa
Name[id]=Elisa
Name[it]=Elisa
Name[ko]=Elisa
Name[nl]=Elisa
Name[nn]=Elisa
Name[pl]=Elisa
Name[pt]=Elisa
Name[pt_BR]=Elisa
Name[ru]=Elisa
Name[sk]=Elisa
Name[sv]=Elisa
Name[tr]=Elisa
Name[uk]=Elisa
Name[x-test]=xxElisaxx
Name[zh_CN]=Elisa
Name[zh_TW]=Elisa
Comment=Configure Local Files Indexer of Elisa Music Player
Comment[ar]=اضبط مفهرس ملفّات «مشغّل الموسيقى إليسّا» المحليّة
Comment[ca]=Configura l'indexador de fitxers locals del reproductor de música Elisa
Comment[ca@valencia]=Configura l'indexador de fitxers locals del reproductor de música Elisa
Comment[cs]=Nastavit indexer místních souborů pro přehrávač Elisa
Comment[da]=Indstil Elisa-musikafspilleren til indeksering af lokale filer
Comment[de]=Lokale Dateiindizierung von Elisa einrichten
Comment[el]=Διαμόρφωση της δεικτοδότησης τοπικών αρχείων της συσκευής αναπαραγωγής μουσικής Elisa
Comment[en_GB]=Configure Local Files Indexer of Elisa Music Player
Comment[es]=Configurar el indexador de archivos locales del reproductor de música Elisa
Comment[eu]=Konfiguratu Elisa musika jotzailearen fitxategi lokalen indexatzailea
Comment[fi]=Elisa-musiikkisoittimen paikallisten tiedostojen indeksoijan asetukset
Comment[fr]=Configurer l'indexeur de fichiers locaux du lecteur de musique Elisa
Comment[gl]=Configurar o indexador de ficheiros locais do reprodutor de música Elisa
Comment[hu]=Állítsa be az Elisa zenelejátszó helyifájl-indexelő szolgáltatását
Comment[id]=Konfigurasikan Pengindeks File Lokal untuk Pemutar Musik Elisa
Comment[it]=Configura l'indicizzatore di file locali del lettore musicale Elisa
Comment[ko]=Elisa 음악 재생기의 로컬 파일 인덱서 설정
Comment[nl]=Indexeerder van lokale bestanden van de muziekspeler Elisa configureren
Comment[nn]=Set opp indeksering av lokale filer for musikkspelaren Elisa
Comment[pl]=Ustawieni indeksowania plików lokalnych odtwarzacza Elisa
Comment[pt]=Configurar a Indexação de Ficheiros Locais no Leitor de Música Elisa
Comment[pt_BR]=Configurar o indexador de arquivos locais do reprodutor de músicas Elisa
Comment[ru]=Настройка индексирования файлов для проигрывателя Elisa
Comment[sk]=Nastaviť indexer miestnych súborov hudobného prehrávača Elisa
Comment[sv]=Anpassa lokal filindexering för musikspelaren Elisa
Comment[tr]=Elisa Müzik Çalar'ın Yerel Dosya İndeksleyicisini Yapılandır
Comment[uk]=Налаштувати індексування локальних файлів для музичного програвача Elisa
Comment[x-test]=xxConfigure Local Files Indexer of Elisa Music Playerxx
Comment[zh_CN]=配置 Elisa 音乐播放器的本地文件索引器
Comment[zh_TW]=設定 Elisa 音樂播放器的本機檔案索引器
Icon=elisa
Encoding=UTF-8
Keywords=
Type=Service
X-KDE-ParentApp=
X-KDE-PluginInfo-Author=Matthieu Gallien
X-KDE-PluginInfo-Email=matthieu_gallien@yahoo.fr
X-KDE-PluginInfo-License=LGPLv3
X-KDE-PluginInfo-Name=kcm_elisa_local_file
X-KDE-PluginInfo-Version=
X-KDE-PluginInfo-Website=
X-KDE-ServiceTypes=KPackage/GenericQML
X-Plasma-MainScript=ui/main.qml
X-Plasma-RemoteLocation=
......@@ -21,6 +21,8 @@
#include "elisaapplication.h"
#include "elisa_settings.h"
#include "localFileConfiguration/elisaconfigurationdialog.h"
//#define QT_QML_DEBUG
#if defined KF5Declarative_FOUND && KF5Declarative_FOUND
......@@ -162,6 +164,8 @@ int main(int argc, char *argv[])
std::unique_ptr<ElisaApplication> myApp = std::make_unique<ElisaApplication>();
myApp->setQmlEngine(&engine);
#if defined KF5DBusAddons_FOUND && KF5DBusAddons_FOUND
QObject::connect(&elisaService, &KDBusService::activateActionRequested, myApp.get(), &ElisaApplication::activateActionRequested);
QObject::connect(&elisaService, &KDBusService::activateRequested, myApp.get(), &ElisaApplication::activateRequested);
......@@ -178,6 +182,7 @@ int main(int argc, char *argv[])
myApp->setArguments(arguments);
engine.rootContext()->setContextProperty(QStringLiteral("elisa"), myApp.release());
engine.rootContext()->setContextProperty(QStringLiteral("config"), new ElisaConfigurationDialog);
engine.load(QUrl(QStringLiteral("qrc:/qml/ElisaMainWindow.qml")));
......
......@@ -15,23 +15,19 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
import QtQuick.Controls 2.3
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.2
import QtQuick.Dialogs 1.2 as Dialogs
import QtQml.Models 2.3
import org.kde.kcm 1.0
Item {
//implicitWidth and implicitHeight will be used as initial size
//when loaded in kcmshell5
implicitWidth: 400
implicitHeight: 200
Dialogs.Dialog {
id: dialog
title: 'Configure'
LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
LayoutMirroring.childrenInherit: true
ConfigModule.buttons: ConfigModule.Help|ConfigModule.Apply
visible: true
modality: Qt.ApplicationModal
standardButtons: Dialogs.StandardButton.Ok | Dialogs.StandardButton.Apply | Dialogs.StandardButton.Cancel
SystemPalette {
id: myPalette
......@@ -86,9 +82,9 @@ Item {
onClicked:
{
var oldPaths = kcm.rootPath
var oldPaths = config.rootPath
oldPaths.splice(delegateItem.DelegateModel.itemsIndex, 1)
kcm.rootPath = oldPaths
config.rootPath = oldPaths
}
}
}
......@@ -99,7 +95,13 @@ Item {
RowLayout {
spacing: 0
anchors.fill: parent
LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
LayoutMirroring.childrenInherit: true
height: 400
width: 600
implicitHeight: 400
implicitWidth: 600
ListView {
id:pathList
......@@ -109,7 +111,7 @@ Item {
boundsBehavior: Flickable.StopAtBounds
model: DelegateModel {
model: kcm.rootPath
model: config.rootPath
delegate: pathDelegate
}
......@@ -134,7 +136,7 @@ Item {
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
FileDialog {
Dialogs.FileDialog {
id: fileDialog
title: i18n("Choose a Folder")
folder: shortcuts.home
......@@ -143,9 +145,9 @@ Item {
visible: false
onAccepted: {
var oldPaths = kcm.rootPath
var oldPaths = config.rootPath
oldPaths.push(fileDialog.fileUrls)
kcm.rootPath = oldPaths
config.rootPath = oldPaths
}
}
}
......@@ -155,4 +157,11 @@ Item {
}
}
}
onAccepted: {
config.save()
close()
}
onApply: config.save()
}
......@@ -39,6 +39,7 @@
<file>qml/HeaderFooterToolbar.qml</file>
<file>qml/TracksDiscHeader.qml</file>
<file>qml/NativeApplicationMenu.qml</file>
<file>qml/ElisaConfigurationDialog.qml</file>
</qresource>
<qresource prefix="/qml/+windows">
<file alias="Theme.qml">windows/WindowsTheme.qml</file>
......
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