diff --git a/CMakeLists.txt b/CMakeLists.txt index e07debb..82efe45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,4 +39,3 @@ set(CPACK_GENERATOR TBZ2) set(CPACK_SOURCE_GENERATOR TBZ2) set(CPACK_SOURCE_IGNORE_FILES /build/;.gitignore;.*~;.git;.kdev4;temp) include(CPack) - diff --git a/debian/changelog b/debian/changelog index ed412b8..e898c88 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ -lxqt-session (0.9.0+20151023-1) unstable; urgency=medium +lxqt-session (0.9.0+20151031-1) experimental; urgency=medium - * Cherry-picking upstream version 0.9.0+20151023. + * Cherry-picking upstream version 0.9.0+20151031. + * set new minimal versions for liblxqt and libqtxdg * Added upstream signing key and use it in watch file * Added lintian-overrides for invalid category + * fix some wording of debian/copyright * Fixed some copyright dates -- Alf Gaida Sat, 24 Oct 2015 13:00:16 +0200 diff --git a/debian/control b/debian/control index 93ebebf..0be6eca 100644 --- a/debian/control +++ b/debian/control @@ -8,9 +8,9 @@ Priority: optional Build-Depends: debhelper (>= 9), cmake (>= 3.0.2), libkf5windowsystem-dev, - liblxqt0-dev, + liblxqt0-dev (>= 0.9.0+20151026), libqt5x11extras5-dev, - libqt5xdg-dev, + libqt5xdg-dev (>= 1.3.0), libudev-dev, libx11-dev, pkg-config, diff --git a/debian/copyright b/debian/copyright index a1a26d0..2d097db 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,15 +3,15 @@ Upstream-Name: lxqt-session Source: https://github.com/lxde/lxqt-session Files: * -Copyright: Copyright (c) 2010-2012 Razor team - Copyright (c) 2012-2015 LXQt team +Copyright: 2010-2012 Razor team + 2012-2015 LXQt team License: LGPL-2.1+ Files: lxqt-config-session/autostartedit.* lxqt-config-session/autostartitem.* lxqt-config-session/autostartpage.* lxqt-config-session/modulemodel.* -Copyright: Copyright (C) 2011-2012 Alec Moskvin +Copyright: 2011-2012 Alec Moskvin License: LGPL-2.1+ Files: lxqt-config-session/basicsettings.* @@ -19,7 +19,7 @@ Files: lxqt-config-session/basicsettings.* lxqt-config-session/environmentpage.* lxqt-config-session/main.cpp lxqt-config-session/sessionconfigwindow.* -Copyright: Copyright 2010-2015 LxQt team +Copyright: 2010-2015 LxQt team License: LGPL-2.1+ Files: lxqt-leave/leavedialog.* @@ -31,11 +31,11 @@ Files: lxqt-session/src/UdevNotifier.* lxqt-session/src/sessiondbusadaptor.h lxqt-session/src/windowmanager.* lxqt-session/src/wmselectdialog.* -Copyright: Copyright: 2010-2015 LXQt team +Copyright: 2010-2015 LXQt team License: LGPL-2.1+ Files: lxqt-session/src/sessionapplication.* -Copyright: Copyright (C) 2014 Hong Jen Yee (PCMan) +Copyright: 2014 Hong Jen Yee (PCMan) License: LGPL-2.1+ Files: debian/* diff --git a/lxqt-config-session/CMakeLists.txt b/lxqt-config-session/CMakeLists.txt index e07db2c..0054a4b 100644 --- a/lxqt-config-session/CMakeLists.txt +++ b/lxqt-config-session/CMakeLists.txt @@ -9,8 +9,10 @@ set(lxqt-sessioncfg_HDRS autostartmodel.h autostartitem.h autostartedit.h + autostartutils.h defaultappspage.h environmentpage.h + userlocationspage.h ) set(lxqt-sessioncfg_SRCS @@ -22,8 +24,10 @@ set(lxqt-sessioncfg_SRCS autostartmodel.cpp autostartitem.cpp autostartedit.cpp + autostartutils.cpp defaultappspage.cpp environmentpage.cpp + userlocationspage.cpp ../lxqt-session/src/windowmanager.cpp ) @@ -76,3 +80,8 @@ install(FILES "${CMAKE_INSTALL_DATAROOTDIR}/applications" COMPONENT Runtime ) +install(FILES + man/lxqt-config-session.1 + DESTINATION "${CMAKE_INSTALL_MANDIR}/man1" + COMPONENT Runtime +) diff --git a/lxqt-config-session/autostartmodel.cpp b/lxqt-config-session/autostartmodel.cpp index 07d26d5..6cd9cd9 100644 --- a/lxqt-config-session/autostartmodel.cpp +++ b/lxqt-config-session/autostartmodel.cpp @@ -27,6 +27,7 @@ #include #include "autostartmodel.h" +#include "autostartutils.h" AutoStartItemModel::AutoStartItemModel(QObject* parent) : QAbstractItemModel(parent), @@ -37,7 +38,7 @@ AutoStartItemModel::AutoStartItemModel(QObject* parent) : QMap::iterator iter; for (iter = mItemMap.begin(); iter != mItemMap.end(); ++iter) { - if (!iter.value().file().value("X-LXQt-Module", false).toBool()) + if (!AutostartUtils::isLXQtModule(iter.value().file())) { if (showOnlyInLXQt(iter.value().file())) mLXQtItems.append(iter.key()); @@ -61,6 +62,20 @@ bool AutoStartItemModel::writeChanges() return true; } +QMap AutoStartItemModel::items() +{ + QMap allItems; + QString s; + + foreach(s, mLXQtItems) + allItems[s] = mItemMap.value(s); + + foreach(s, mGlobalItems) + allItems[s] = mItemMap.value(s); + + return allItems; +} + /* * Creates or replaces an autostart entry */ diff --git a/lxqt-config-session/autostartmodel.h b/lxqt-config-session/autostartmodel.h index 6e50032..1b79132 100644 --- a/lxqt-config-session/autostartmodel.h +++ b/lxqt-config-session/autostartmodel.h @@ -59,6 +59,9 @@ public: public slots: bool writeChanges(); +public: + QMap items(); + private: QMap mItemMap; QPersistentModelIndex mGlobalIndex; diff --git a/lxqt-config-session/autostartpage.cpp b/lxqt-config-session/autostartpage.cpp index d871d62..94111a2 100644 --- a/lxqt-config-session/autostartpage.cpp +++ b/lxqt-config-session/autostartpage.cpp @@ -26,6 +26,7 @@ #include "ui_autostartpage.h" #include "autostartedit.h" +#include "autostartutils.h" #include @@ -63,6 +64,64 @@ void AutoStartPage::restoreSettings() void AutoStartPage::save() { + bool doRestart = false; + + /* + * Get the previous settings + */ + QMap previousItems(AutostartItem::createItemMap()); + QMutableMapIterator i(previousItems); + while (i.hasNext()) { + i.next(); + if (AutostartUtils::isLXQtModule(i.value().file())) + i.remove(); + } + + + /* + * Get the settings from the Ui + */ + QMap currentItems = mXdgAutoStartModel->items(); + QMutableMapIterator j(currentItems); + + while (j.hasNext()) { + j.next(); + if (AutostartUtils::isLXQtModule(j.value().file())) + j.remove(); + } + + + /* Compare the settings */ + + if (previousItems.count() != currentItems.count()) + { + doRestart = true; + } + else + { + QMap::const_iterator k = currentItems.constBegin(); + while (k != currentItems.constEnd()) + { + if (previousItems.contains(k.key())) + { + if (k.value().file() != previousItems.value(k.key()).file()) + { + doRestart = true; + break; + } + } + else + { + doRestart = true; + break; + } + ++k; + } + } + + if (doRestart) + emit needRestart(); + mXdgAutoStartModel->writeChanges(); } diff --git a/lxqt-config-session/autostartpage.h b/lxqt-config-session/autostartpage.h index fb53a80..7431d4f 100644 --- a/lxqt-config-session/autostartpage.h +++ b/lxqt-config-session/autostartpage.h @@ -41,6 +41,9 @@ public: explicit AutoStartPage(QWidget* parent = 0); ~AutoStartPage(); +signals: + void needRestart(); + public slots: void save(); void restoreSettings(); diff --git a/lxqt-config-session/autostartutils.cpp b/lxqt-config-session/autostartutils.cpp new file mode 100644 index 0000000..671f4c3 --- /dev/null +++ b/lxqt-config-session/autostartutils.cpp @@ -0,0 +1,33 @@ +/* This file is part of the LXQt project. + * Copyright (C) 2015 Luís Pereira + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "autostartutils.h" +#include + +#include + +bool AutostartUtils::showOnlyInLXQt(const XdgDesktopFile &file) +{ + return file.value(QLatin1String("OnlyShowIn")) == QLatin1String("LXQt;"); +} + +bool AutostartUtils::isLXQtModule(const XdgDesktopFile& file) +{ + return file.value(QLatin1String("X-LXQt-Module"), false).toBool(); +} + diff --git a/lxqt-config-session/autostartutils.h b/lxqt-config-session/autostartutils.h new file mode 100644 index 0000000..f1cbfb2 --- /dev/null +++ b/lxqt-config-session/autostartutils.h @@ -0,0 +1,31 @@ +/* This file is part of the LXQt project. + * Copyright (C) 2015 Luís Pereira + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AUTOSTARTUTILS_H +#define AUTOSTARTUTILS_H + +class XdgDesktopFile; + +class AutostartUtils +{ +public: + static bool showOnlyInLXQt(const XdgDesktopFile& file); + static bool isLXQtModule(const XdgDesktopFile& file); +}; + +#endif // AUTOSTARTUTILS_H diff --git a/lxqt-config-session/basicsettings.cpp b/lxqt-config-session/basicsettings.cpp index f437522..254615e 100644 --- a/lxqt-config-session/basicsettings.cpp +++ b/lxqt-config-session/basicsettings.cpp @@ -30,6 +30,11 @@ #include "../lxqt-session/src/windowmanager.h" #include "sessionconfigwindow.h" +#include "autostartutils.h" + +static const QLatin1String windowManagerKey("window_manager"); +static const QLatin1String leaveConfirmationKey("leave_confirmation"); +static const QLatin1String openboxValue("openbox"); BasicSettings::BasicSettings(LXQt::Settings *settings, QWidget *parent) : QWidget(parent), @@ -41,9 +46,6 @@ BasicSettings::BasicSettings(LXQt::Settings *settings, QWidget *parent) : connect(ui->findWmButton, SIGNAL(clicked()), this, SLOT(findWmButton_clicked())); connect(ui->startButton, SIGNAL(clicked()), this, SLOT(startButton_clicked())); connect(ui->stopButton, SIGNAL(clicked()), this, SLOT(stopButton_clicked())); - connect(ui->wmComboBox, SIGNAL(currentIndexChanged(int)), parent, SLOT(setRestart())); - connect(ui->wmComboBox, SIGNAL(editTextChanged(const QString&)), SIGNAL(needRestart())); - connect(ui->leaveConfirmationCheckBox, SIGNAL(toggled(bool)), SIGNAL(needRestart())); restoreSettings(); ui->moduleView->setModel(m_moduleModel); @@ -64,25 +66,75 @@ void BasicSettings::restoreSettings() knownWMs << wm.command; } - QString wm = m_settings->value("window_manager", "openbox").toString(); + QString wm = m_settings->value(windowManagerKey, openboxValue).toString(); SessionConfigWindow::handleCfgComboBox(ui->wmComboBox, knownWMs, wm); m_moduleModel->reset(); - ui->leaveConfirmationCheckBox->setChecked(m_settings->value("leave_confirmation", false).toBool()); + ui->leaveConfirmationCheckBox->setChecked(m_settings->value(leaveConfirmationKey, false).toBool()); } void BasicSettings::save() { - m_settings->setValue("window_manager", ui->wmComboBox->currentText()); - m_moduleModel->writeChanges(); + /* If the setting actually changed: + * * Save the setting + * * Emit a needsRestart signal + */ + + bool doRestart = false; + const QString windowManager = ui->wmComboBox->currentText(); + const bool leaveConfirmation = ui->leaveConfirmationCheckBox->isChecked(); + + QMap previousItems(AutostartItem::createItemMap()); + QMutableMapIterator i(previousItems); + while (i.hasNext()) { + i.next(); + if (!AutostartUtils::isLXQtModule(i.value().file())) + i.remove(); + } + + + if (windowManager != m_settings->value(windowManagerKey, openboxValue).toString()) + { + m_settings->setValue(windowManagerKey, windowManager); + doRestart = true; + } - m_settings->setValue("leave_confirmation", ui->leaveConfirmationCheckBox->isChecked()); + + if (leaveConfirmation != m_settings->value(leaveConfirmationKey, false).toBool()) + { + m_settings->setValue(leaveConfirmationKey, leaveConfirmation); + doRestart = true; + } + + QMap currentItems = m_moduleModel->items(); + QMap::const_iterator k = currentItems.constBegin(); + while (k != currentItems.constEnd()) + { + if (previousItems.contains(k.key())) + { + if (k.value().file() != previousItems.value(k.key()).file()) + { + doRestart = true; + break; + } + } + else + { + doRestart = true; + break; + } + ++k; + } + + if (doRestart) + emit needRestart(); + + m_moduleModel->writeChanges(); } void BasicSettings::findWmButton_clicked() { SessionConfigWindow::updateCfgComboBox(ui->wmComboBox, tr("Select a window manager")); - emit needRestart(); } void BasicSettings::startButton_clicked() diff --git a/lxqt-config-session/environmentpage.cpp b/lxqt-config-session/environmentpage.cpp index e41383e..cc5b9a1 100644 --- a/lxqt-config-session/environmentpage.cpp +++ b/lxqt-config-session/environmentpage.cpp @@ -73,14 +73,33 @@ void EnvironmentPage::restoreSettings() void EnvironmentPage::save() { + bool doRestart = false; + QMap oldSettings; + m_settings->beginGroup("Environment"); + + /* We erase the Enviroment group and them write the Ui settings. To know if + they changed or not we need to save them to memory. + */ + foreach (const QString &key, m_settings->childKeys()) + oldSettings[key] = m_settings->value(key, QString()).toString(); m_settings->remove(""); + for(int i = 0; i < ui->treeWidget->topLevelItemCount(); ++i) { QTreeWidgetItem *item = ui->treeWidget->topLevelItem(i); + const QString key = item->text(0); + const QString value = item->text(1); + + if (oldSettings.value(key) != value) + doRestart = true; + m_settings->setValue(item->text(0), item->text(1)); } m_settings->endGroup(); + + if (doRestart) + emit needRestart(); } void EnvironmentPage::addButton_clicked() @@ -89,7 +108,6 @@ void EnvironmentPage::addButton_clicked() item->setFlags(item->flags() | Qt::ItemIsEditable); ui->treeWidget->addTopLevelItem(item); ui->treeWidget->setCurrentItem(item); - emit needRestart(); } void EnvironmentPage::deleteButton_clicked() @@ -99,14 +117,12 @@ void EnvironmentPage::deleteButton_clicked() emit envVarChanged(item->text(0), ""); delete item; } - emit needRestart(); } void EnvironmentPage::itemChanged(QTreeWidgetItem *item, int column) { Q_UNUSED(column); emit envVarChanged(item->text(0), item->text(1)); - emit needRestart(); } void EnvironmentPage::updateItem(const QString& var, const QString& val) @@ -127,5 +143,4 @@ void EnvironmentPage::updateItem(const QString& var, const QString& val) else delete item; } - emit needRestart(); } diff --git a/lxqt-config-session/man/lxqt-config-session.1 b/lxqt-config-session/man/lxqt-config-session.1 index 7013536..0045341 100644 --- a/lxqt-config-session/man/lxqt-config-session.1 +++ b/lxqt-config-session/man/lxqt-config-session.1 @@ -1,15 +1,15 @@ -.TH lxqt-config-session "1" "September 2012" "LXQt\ 0.7.0" "LXQt\ Application" +.TH lxqt-config-session "1" "October 2015" "LXQt\ 0.9.0" "LXQt\ Application" .SH NAME -lxqt-config-session \- Session settings of \fBLXQt\fR, the Lightweight Desktop Environment +\fBlxqt-config-session\fR \- Session settings of \fBLXQt\fR, the Lightweight Desktop Environment .SH SYNOPSIS .B lxqt-config-session .br .SH DESCRIPTION -This application handle settings and configurations around autostart applications on \fBLXQt\-qt\fR desktop environment. +This application handle settings and configuration around autostart applications on \fBLXQt\fR desktop environment. .P -Through this applicaton you can manage settings related to applications startup and LXQt modules. +Through this applicaton you can manage settings related to applications startup and \fBLXQt\fR modules. .P -\fBLXQt\-qt\fR is an advanced, easy-to-use, and fast desktop environment based on Qt +\fBLXQt\fR is an advanced, easy-to-use, and fast desktop environment based on Qt technologies, ships several core desktop components, all of which are optional: .P * Panel @@ -18,7 +18,7 @@ technologies, ships several core desktop components, all of which are optional: * Settings center * Session handler \fI(related to this)\fR * Polkit handler - * SSYH password access + * SSH password access * Display manager handler .P These components perform similar actions to those available in other desktop @@ -26,17 +26,17 @@ environments, and their names are self-descriptive. They are usually not launch by hand but automatically, when choosing a \fBLXQt\fR session in the Display Manager. .SH "REPORTING BUGS" -Report bugs to https://github.com/LXQt/LXQt/issues +Report bugs to https://github.com/lxde/lxqt/issues .SH "SEE ALSO" -LXQt it has been tailored for users who value simplicity, speed, and +\fBLXQt\fR has been tailored for users who value simplicity, speed, and an intuitive interface, also intended for less powerful machines. See: .\" any module must refers to session app, for more info on start it .P -\fBlxqt-config.1\fR LXQt application for manage configurations and settings +\fBlxqt-config(1)\fR \fBLXQt\fR application to manage configuration and settings .P -\fBlxqt-session.1\fR LXQt module for manage LXQt autostart session applications -.P -\fBstart-lxqt.1\fR LXQt display management independient starup. +\fBlxqt-session(1)\fR \fBLXQt\fR module to manage \fBLXQt\fR autostart session applications +\".P +\"\fBstart-lxqt(1)\fR \fBLXQt\fR display manager independent startup. .P .SH AUTHOR This manual page was created by \fBPICCORO Lenz McKAY\fR \fI\fR diff --git a/lxqt-config-session/modulemodel.cpp b/lxqt-config-session/modulemodel.cpp index 247e9f8..9c978e9 100644 --- a/lxqt-config-session/modulemodel.cpp +++ b/lxqt-config-session/modulemodel.cpp @@ -28,6 +28,7 @@ #include #include #include "modulemodel.h" +#include "autostartutils.h" ModuleModel::ModuleModel(QObject* parent) : QAbstractListModel(parent) @@ -51,7 +52,7 @@ void ModuleModel::reset() QMap::iterator iter; for (iter = mItemMap.begin(); iter != mItemMap.end(); ++iter) { - if (iter.value().file().value("X-LXQt-Module", false).toBool()) + if (AutostartUtils::isLXQtModule(iter.value().file())) mKeyList.append(iter.key()); } @@ -105,6 +106,17 @@ Qt::ItemFlags ModuleModel::flags(const QModelIndex& index) const return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable; } +QMap ModuleModel::items() +{ + QMap allItems; + QString s; + + foreach(s, mKeyList) + allItems[s] = mItemMap.value(s); + + return allItems; +} + int ModuleModel::rowCount(const QModelIndex& parent) const { Q_UNUSED(parent); diff --git a/lxqt-config-session/modulemodel.h b/lxqt-config-session/modulemodel.h index 922f665..db345ed 100644 --- a/lxqt-config-session/modulemodel.h +++ b/lxqt-config-session/modulemodel.h @@ -46,6 +46,8 @@ public: int columnCount(const QModelIndex&) const { return 2; } Qt::ItemFlags flags(const QModelIndex& index) const; + QMap items(); + private slots: void updateModuleState(QString moduleName, bool state); diff --git a/lxqt-config-session/sessionconfigwindow.cpp b/lxqt-config-session/sessionconfigwindow.cpp index 0659c4a..c74d936 100644 --- a/lxqt-config-session/sessionconfigwindow.cpp +++ b/lxqt-config-session/sessionconfigwindow.cpp @@ -37,6 +37,7 @@ #include "autostartpage.h" #include "defaultappspage.h" #include "environmentpage.h" +#include "userlocationspage.h" SessionConfigWindow::SessionConfigWindow() : @@ -51,8 +52,15 @@ SessionConfigWindow::SessionConfigWindow() : DefaultApps* defaultApps = new DefaultApps(this); addPage(defaultApps, tr("Default Applications"), "preferences-desktop-filetype-association"); + UserLocationsPage* userLocations = new UserLocationsPage(this); + addPage(userLocations, tr("Locations"), QStringLiteral("folder")); + connect(userLocations, SIGNAL(needRestart()), SLOT(setRestart())); + connect(this, SIGNAL(reset()), userLocations, SLOT(restoreSettings())); + connect(this, SIGNAL(save()), userLocations, SLOT(save())); + AutoStartPage* autoStart = new AutoStartPage(this); addPage(autoStart, tr("Autostart"), "preferences-desktop-launch-feedback"); + connect(autoStart, SIGNAL(needRestart()), SLOT(setRestart())); connect(this, SIGNAL(reset()), autoStart, SLOT(restoreSettings())); connect(this, SIGNAL(save()), autoStart, SLOT(save())); @@ -82,9 +90,7 @@ void SessionConfigWindow::closeEvent(QCloseEvent * event) LXQt::ConfigDialog::closeEvent(event); if (m_restart) { QMessageBox::information(this, tr("Session Restart Required"), - tr("You need to restart desktop session (lxqt-session) " - "to reload settings. Use logout from the main menu." - ) + tr("Some settings will not take effect until the next log in.") ); } } diff --git a/lxqt-config-session/translations/lxqt-config-session_cs.desktop b/lxqt-config-session/translations/lxqt-config-session_cs.desktop index c707030..9666aaa 100644 --- a/lxqt-config-session/translations/lxqt-config-session_cs.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_cs.desktop @@ -1,4 +1,4 @@ # Translations -Comment[cs]=Nastavit modul sezení LXQt-Qt -GenericName[cs]=Nastavení sezení LXQt-Qt -Name[cs]=Nastavení sezení LXQt-Qt +Comment[cs]=Nastavit modul sezení LXQt +GenericName[cs]=Nastavení sezení LXQt +Name[cs]=Nastavení sezení LXQt diff --git a/lxqt-config-session/translations/lxqt-config-session_da.desktop b/lxqt-config-session/translations/lxqt-config-session_da.desktop index 60bd17c..87dbcb0 100644 --- a/lxqt-config-session/translations/lxqt-config-session_da.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_da.desktop @@ -1,4 +1,4 @@ # Translations -Comment[da]=Indstil LXQt-Qt Sessionsmodul +Comment[da]=Indstil LXQt Sessionsmodul GenericName[da]=Indstilling af LXQt-sessioner Name[da]=Indstilling af LXQt-sessioner diff --git a/lxqt-config-session/translations/lxqt-config-session_da_DK.desktop b/lxqt-config-session/translations/lxqt-config-session_da_DK.desktop index 93ba861..8bbc4fe 100644 --- a/lxqt-config-session/translations/lxqt-config-session_da_DK.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_da_DK.desktop @@ -1,4 +1,4 @@ # Translations -Comment[da_DK]=Indstilling af LXQt-Qt sessionsmodul +Comment[da_DK]=Indstilling af LXQt sessionsmodul GenericName[da_DK]=Indstilling af LXQt Session Name[da_DK]=Indstilling af LXQt Session diff --git a/lxqt-config-session/translations/lxqt-config-session_eo.desktop b/lxqt-config-session/translations/lxqt-config-session_eo.desktop index c47afb6..3f6aeb5 100644 --- a/lxqt-config-session/translations/lxqt-config-session_eo.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_eo.desktop @@ -1,4 +1,4 @@ # Translations -Comment[eo]=Agordi modulon de seanco de LXQt-Qt +Comment[eo]=Agordi modulon de seanco de LXQt GenericName[eo]=Agordilo de seanco de LXQt Name[eo]=Agordilo de seanco de LXQt diff --git a/lxqt-config-session/translations/lxqt-config-session_es.desktop b/lxqt-config-session/translations/lxqt-config-session_es.desktop index 3b14d04..c5d7940 100644 --- a/lxqt-config-session/translations/lxqt-config-session_es.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_es.desktop @@ -1,4 +1,4 @@ # Translations -Comment[es]=Configura el módulo de sesiones de LXQt-Qt +Comment[es]=Configura el módulo de sesiones de LXQt GenericName[es]=Configuración de sesiones LXQt Name[es]=Configuración de sesiones LXQt diff --git a/lxqt-config-session/translations/lxqt-config-session_es_VE.desktop b/lxqt-config-session/translations/lxqt-config-session_es_VE.desktop index cac001e..becc22c 100644 --- a/lxqt-config-session/translations/lxqt-config-session_es_VE.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_es_VE.desktop @@ -1,4 +1,4 @@ # Translations -Comment[es_VE]=Configuracion de modulo de LXQt-Qt +Comment[es_VE]=Configuracion de modulo de LXQt GenericName[es_VE]=Configuracion de sesion de LXQt Name[es_VE]=Configuracion de sesion de LXQt diff --git a/lxqt-config-session/translations/lxqt-config-session_eu.desktop b/lxqt-config-session/translations/lxqt-config-session_eu.desktop index 5c23707..95a0d42 100644 --- a/lxqt-config-session/translations/lxqt-config-session_eu.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_eu.desktop @@ -1,4 +1,4 @@ # Translations -Comment[eu]=Konfiguratu LXQt-Qt saioaren modulua +Comment[eu]=Konfiguratu LXQt saioaren modulua GenericName[eu]=LXQt saioaren konfiguratzailea Name[eu]=LXQt saioaren konfiguratzailea diff --git a/lxqt-config-session/translations/lxqt-config-session_fi.desktop b/lxqt-config-session/translations/lxqt-config-session_fi.desktop index 017713a..28859eb 100644 --- a/lxqt-config-session/translations/lxqt-config-session_fi.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_fi.desktop @@ -1,4 +1,4 @@ # Translations -Comment[fi]=Hallinnoi LXQt-Qt:n istuntomoduulia +Comment[fi]=Hallinnoi LXQt:n istuntomoduulia GenericName[fi]=LXQtin istunnonhallinta Name[fi]=LXQtin istunnonhallinta diff --git a/lxqt-config-session/translations/lxqt-config-session_fr_FR.desktop b/lxqt-config-session/translations/lxqt-config-session_fr_FR.desktop index d36df81..9ed47cf 100644 --- a/lxqt-config-session/translations/lxqt-config-session_fr_FR.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_fr_FR.desktop @@ -1,4 +1,4 @@ # Translations -Comment[fr_FR]=Configurer le module 'session' de LXQt-Qt +Comment[fr_FR]=Configurer le module 'session' de LXQt GenericName[fr_FR]=Paramétreur de session LXQt Name[fr_FR]=Paramétreur de session LXQt diff --git a/lxqt-config-session/translations/lxqt-config-session_hu.desktop b/lxqt-config-session/translations/lxqt-config-session_hu.desktop index adb7190..0d9529e 100644 --- a/lxqt-config-session/translations/lxqt-config-session_hu.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_hu.desktop @@ -1,4 +1,4 @@ # Translations -Comment[hu]=A LXQt-Qt munkamenetmodul beállítása +Comment[hu]=A LXQt munkamenetmodul beállítása GenericName[hu]=LXQt munkamenetbeállíó Name[hu]=LXQt munkamenetbeállíó diff --git a/lxqt-config-session/translations/lxqt-config-session_id_ID.desktop b/lxqt-config-session/translations/lxqt-config-session_id_ID.desktop index 6f7d4e0..5e4f28c 100644 --- a/lxqt-config-session/translations/lxqt-config-session_id_ID.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_id_ID.desktop @@ -1,4 +1,4 @@ # Translations -Comment[id_ID]=Konfigurasi modul sesi LXQt-Qt +Comment[id_ID]=Konfigurasi modul sesi LXQt GenericName[id_ID]=Konfigurator Sesi LXQt Name[id_ID]=Konfigurator Sesi LXQt diff --git a/lxqt-config-session/translations/lxqt-config-session_ja.desktop b/lxqt-config-session/translations/lxqt-config-session_ja.desktop index 6ecbba2..6c04df4 100644 --- a/lxqt-config-session/translations/lxqt-config-session_ja.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_ja.desktop @@ -1,4 +1,4 @@ # Translations -Comment[ja]=LXQt-Qtセッションもジュールを設定 +Comment[ja]=LXQtセッションもジュールを設定 GenericName[ja]=LXQtセッションの設定 Name[ja]=LXQtセッションの設定 diff --git a/lxqt-config-session/translations/lxqt-config-session_lt.desktop b/lxqt-config-session/translations/lxqt-config-session_lt.desktop index 9d6cc4b..38f405b 100644 --- a/lxqt-config-session/translations/lxqt-config-session_lt.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_lt.desktop @@ -1,4 +1,4 @@ # Translations -Comment[lt]=Konfigūruoti LXQt-Qt sesijų modulį +Comment[lt]=Konfigūruoti LXQt sesijų modulį GenericName[lt]=LXQt sesijų konfigūravimas Name[lt]=LXQt sesijų konfigūravimas diff --git a/lxqt-config-session/translations/lxqt-config-session_nl.desktop b/lxqt-config-session/translations/lxqt-config-session_nl.desktop index f02c3ff..dd68619 100644 --- a/lxqt-config-session/translations/lxqt-config-session_nl.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_nl.desktop @@ -1,4 +1,4 @@ # Translations -Comment[nl]=Configureer LXQt-Qt sessie module +Comment[nl]=Configureer LXQt sessie module GenericName[nl]=LXQt sessie Configurator Name[nl]=LXQt sessie Configurator diff --git a/lxqt-config-session/translations/lxqt-config-session_pl.desktop b/lxqt-config-session/translations/lxqt-config-session_pl.desktop index d0ee53a..ca23381 100644 --- a/lxqt-config-session/translations/lxqt-config-session_pl.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_pl.desktop @@ -1,4 +1,4 @@ # Translations -Comment[pl]=Ustawienia sesji LXQt-Qt +Comment[pl]=Ustawienia sesji LXQt GenericName[pl]=Ustawienia sesji LXQt Name[pl]=Ustawienia sesji LXQt diff --git a/lxqt-config-session/translations/lxqt-config-session_pt_BR.desktop b/lxqt-config-session/translations/lxqt-config-session_pt_BR.desktop index cf79200..5bcd338 100644 --- a/lxqt-config-session/translations/lxqt-config-session_pt_BR.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_pt_BR.desktop @@ -1,4 +1,4 @@ # Translations -Comment[pt_BR]=Módulo de configurador de sessão do LXQt-Qt +Comment[pt_BR]=Módulo de configurador de sessão do LXQt GenericName[pt_BR]=Configurador de sessão do LXQt Name[pt_BR]=Configurador de sessão do LXQt diff --git a/lxqt-config-session/translations/lxqt-config-session_ro_RO.desktop b/lxqt-config-session/translations/lxqt-config-session_ro_RO.desktop index 2dc59c1..1568fb9 100644 --- a/lxqt-config-session/translations/lxqt-config-session_ro_RO.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_ro_RO.desktop @@ -1,4 +1,4 @@ # Translations -Comment[ro_RO]=Configurează modulul sesiune LXQt-Qt +Comment[ro_RO]=Configurează modulul sesiune LXQt GenericName[ro_RO]=Configurare sesiune LXQt Name[ro_RO]=Configurare sesiune LXQt diff --git a/lxqt-config-session/translations/lxqt-config-session_sk.desktop b/lxqt-config-session/translations/lxqt-config-session_sk.desktop index 5b8fec2..83c7e6f 100644 --- a/lxqt-config-session/translations/lxqt-config-session_sk.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_sk.desktop @@ -1,4 +1,4 @@ # Translations -Comment[sk]=Nastavenie relácie prostredia LXQt-Qt +Comment[sk]=Nastavenie relácie prostredia LXQt GenericName[sk]=Nastavenie relácie prostredia LXQt Name[sk]=Nastavenie relácie diff --git a/lxqt-config-session/translations/lxqt-config-session_th_TH.desktop b/lxqt-config-session/translations/lxqt-config-session_th_TH.desktop index 0ab5dc4..71b643f 100644 --- a/lxqt-config-session/translations/lxqt-config-session_th_TH.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_th_TH.desktop @@ -1,4 +1,4 @@ # Translations -Comment[th_TH]=ตั้งค่ามอดูลวาระงาน LXQt-Qt +Comment[th_TH]=ตั้งค่ามอดูลวาระงาน LXQt GenericName[th_TH]=ตัวตั้งค่าวาระงาน LXQt Name[th_TH]=ตัวตั้งค่าวาระงาน LXQt diff --git a/lxqt-config-session/translations/lxqt-config-session_tr.desktop b/lxqt-config-session/translations/lxqt-config-session_tr.desktop index b5e138e..a56027d 100644 --- a/lxqt-config-session/translations/lxqt-config-session_tr.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_tr.desktop @@ -1,4 +1,4 @@ # Translations -Comment[tr]=LXQt-Qt oturum modülünü yapılandır +Comment[tr]=LXQt oturum modülünü yapılandır GenericName[tr]=LXQt Oturum Yapılandırıcı Name[tr]=LXQt Oturum Yapılandırıcı diff --git a/lxqt-config-session/translations/lxqt-config-session_uk.desktop b/lxqt-config-session/translations/lxqt-config-session_uk.desktop index 2ff4741..117a689 100644 --- a/lxqt-config-session/translations/lxqt-config-session_uk.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_uk.desktop @@ -1,4 +1,4 @@ # Translations -Comment[uk]=Налаштувати модуль сеансу LXQt-Qt +Comment[uk]=Налаштувати модуль сеансу LXQt GenericName[uk]=Налаштування сеансу LXQt Name[uk]=Налаштування сеансу LXQt diff --git a/lxqt-config-session/translations/lxqt-config-session_zh_CN.desktop b/lxqt-config-session/translations/lxqt-config-session_zh_CN.desktop index db0f0b0..de094fc 100644 --- a/lxqt-config-session/translations/lxqt-config-session_zh_CN.desktop +++ b/lxqt-config-session/translations/lxqt-config-session_zh_CN.desktop @@ -1,4 +1,4 @@ # Translations -Comment[zh_CN]=配置 LXQt-Qt 会话模块 +Comment[zh_CN]=配置 LXQt 会话模块 GenericName[zh_CN]=LXQt 会话配置 Name[zh_CN]=LXQt 会话配置 diff --git a/lxqt-config-session/userlocationspage.cpp b/lxqt-config-session/userlocationspage.cpp new file mode 100644 index 0000000..8f384bb --- /dev/null +++ b/lxqt-config-session/userlocationspage.cpp @@ -0,0 +1,184 @@ +/* + * This file is part of the LXQt project. + * Copyright (C) 2015 Luís Pereira + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "userlocationspage.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +class UserLocationsPagePrivate { +public: + + UserLocationsPagePrivate(); + static const QStringList locationsName; + + QList initialLocations; + QList locations; + QSignalMapper *signalMapper; + + void getUserDirs(); + void populate(); +}; + +UserLocationsPagePrivate::UserLocationsPagePrivate() + : locations(), + signalMapper(0) +{ +} + +// This labels haveto match XdgDirs::UserDirectories +const QStringList UserLocationsPagePrivate::locationsName = QStringList() << + qApp->translate("UserLocationsPrivate", "Desktop") << + qApp->translate("UserLocationsPrivate", "Downloads") << + qApp->translate("UserLocationsPrivate", "Templates") << + qApp->translate("UserLocationsPrivate", "Public Share") << + qApp->translate("UserLocationsPrivate", "Documents") << + qApp->translate("UserLocationsPrivate", "Music") << + qApp->translate("UserLocationsPrivate", "Pictures") << + qApp->translate("UserLocationsPrivate", "Videos"); + +void UserLocationsPagePrivate::getUserDirs() +{ + const int N = locationsName.count(); + for(int i = 0; i < N; ++i) { + const QString userDir = XdgDirs::userDir(static_cast (i)); + const QDir dir(userDir); + initialLocations.append(dir.canonicalPath()); + } +} + +void UserLocationsPagePrivate::populate() +{ + const int N = initialLocations.count(); + + Q_ASSERT(N == locationsName.count()); + + for (int i = 0; i < N; ++i) { + locations.at(i)->setText(initialLocations.at(i)); + } +} + + +UserLocationsPage::UserLocationsPage(QWidget *parent) + : QWidget(parent), + d(new UserLocationsPagePrivate()) +{ + d->signalMapper = new QSignalMapper(this); + QGridLayout *gridLayout = new QGridLayout(this); + + int row = 0; + + QLabel *description = new QLabel(tr("Locations for Personal Files"), this); + QFont font; + font.setBold(true); + description->setFont(font); + + gridLayout->addWidget(description, row++, 0, 1, -1); + + for (int i = 0; i < d->locationsName.size(); ++i, ++row) { + QLabel *label = new QLabel(d->locationsName.at(i), this); + + QLineEdit *edit = new QLineEdit(this); + d->locations.append(edit); + edit->setClearButtonEnabled(true); + + QToolButton *button = new QToolButton(this); + button->setIcon(XdgIcon::fromTheme(QStringLiteral("folder"))); + connect(button, SIGNAL(clicked()), d->signalMapper, SLOT(map())); + d->signalMapper->setMapping(button, i); + + gridLayout->addWidget(label, row, 0); + gridLayout->addWidget(edit, row, 1); + gridLayout->addWidget(button, row, 2); + } + connect(d->signalMapper, SIGNAL(mapped(int)), + this, SLOT(clicked(int))); + + QSpacerItem *verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, + QSizePolicy::Expanding); + gridLayout->addItem(verticalSpacer, row++, 1, 1, 1); + setLayout(gridLayout); + + d->getUserDirs(); + d->populate(); +} + +UserLocationsPage::~UserLocationsPage() +{ + // It's fine to delete a null pointer. No need to check. + delete d; + d = 0; +} + +void UserLocationsPage::restoreSettings() +{ + d->populate(); +} + +void UserLocationsPage::save() +{ + bool restartWarn = false; + + const int N = d->locations.count(); + for (int i = 0; i < N; ++i) { + const QDir dir(d->locations.at(i)->text()); + const QString s = dir.canonicalPath(); + + if (s != d->initialLocations.at(i)) { + const bool ok = XdgDirs::setUserDir( + static_cast (i), s, true); + if (!ok) { + const int ret = QMessageBox::warning(this, + tr("LXQt Session Settings - Locations"), + tr("An error ocurred while applying the settings for the %1 location").arg(d->locationsName.at(i)), + QMessageBox::Ok); + Q_UNUSED(ret); + } + restartWarn = true; + } + } + + if (restartWarn) + emit needRestart(); +} + +void UserLocationsPage::clicked(int id) +{ + const QString& currentDir = d->locations.at(id)->text(); + const QString dir = QFileDialog::getExistingDirectory(this, + tr("Choose Location"), + currentDir, + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + if (!dir.isEmpty()) { + const QDir dd(dir); + d->locations.at(id)->setText(dd.canonicalPath()); + } +} diff --git a/lxqt-config-session/userlocationspage.h b/lxqt-config-session/userlocationspage.h new file mode 100644 index 0000000..16482a2 --- /dev/null +++ b/lxqt-config-session/userlocationspage.h @@ -0,0 +1,48 @@ +/* + * This file is part of the LXQt project. + * Copyright (C) 2015 Luís Pereira + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef USERLOCATIONSPAGE_H +#define USERLOCATIONSPAGE_H + +#include + +class UserLocationsPagePrivate; + +class UserLocationsPage : public QWidget { + Q_OBJECT + +public: + explicit UserLocationsPage(QWidget *parent = 0); + ~UserLocationsPage(); + +Q_SIGNALS: + void needRestart(); + +public Q_SLOTS: + void restoreSettings(); + void save(); + +private Q_SLOTS: + void clicked(int id); + +private: + UserLocationsPagePrivate *d; +}; + +#endif // USERLOCATIONSPAGE_H diff --git a/lxqt-leave/translations/lxqt-lockscreen_fr.desktop b/lxqt-leave/translations/lxqt-lockscreen_fr.desktop new file mode 100644 index 0000000..3da323c --- /dev/null +++ b/lxqt-leave/translations/lxqt-lockscreen_fr.desktop @@ -0,0 +1,3 @@ +Comment[fr]=Verrouillage de la session courante +GenericName[fr]=Verrouiller l’écran +Name[fr]=Verrouiller l’écran diff --git a/lxqt-session/CMakeLists.txt b/lxqt-session/CMakeLists.txt index 93743b6..cb9c0fa 100644 --- a/lxqt-session/CMakeLists.txt +++ b/lxqt-session/CMakeLists.txt @@ -4,7 +4,7 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() -if(NOT DEFINED LIBUDEV_MONITOR OR LIBUDEV_MONITOR) +if(LIBUDEV_MONITOR) set(LIBUDEV_MONITOR Yes) find_package(PkgConfig) @@ -80,3 +80,8 @@ INSTALL(TARGETS RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT Runtime ) +install(FILES + man/lxqt-session.1 + DESTINATION "${CMAKE_INSTALL_MANDIR}/man1" + COMPONENT Runtime +) diff --git a/lxqt-session/man/lxqt-session.1 b/lxqt-session/man/lxqt-session.1 index 1cfea84..d451a75 100644 --- a/lxqt-session/man/lxqt-session.1 +++ b/lxqt-session/man/lxqt-session.1 @@ -1,11 +1,11 @@ -.TH lxqt-session "1" "September 2012" "LXQt\ 0.7.0" "LXQt\ Module" +.TH lxqt-session "1" "October 2015" "LXQt\ 0.9.0" "LXQt\ Module" .SH NAME -lxqt-session \- Session manager of \fBLXQt\fR, the Lightweight Desktop Environment +\fBlxqt-session\fR \- Session manager of \fBLXQt\fR, the Lightweight Desktop Environment .SH SYNOPSIS .B lxqt-session .br .SH DESCRIPTION -This module handle session autostart application over \fBLXQt\fR desktop environment startup. +This module handles session autostart application over \fBLXQt\fR desktop environment startup. .P The \fBLXQt modules\fR are desktop independent tools, and operate as daemons for the local user for desktop specific operations. @@ -23,28 +23,28 @@ and operate as daemons for the local user for desktop specific operations. .P These components perform similar actions to those available in other desktop environments, and their names are self-descriptive. They are usually not launched -by hand but automatically, when choosing a \fBLXQt\-qt\fR session in the Display +by hand but automatically, when choosing a \fBLXQt\fR session in the Display Manager. .SH BEHAVIOR Through this application \fBLXQt\fR desktop environment manage the session desktop behavior, -module loading and related starup programs before user gets a working area. By default this module -load the panel, desktop and power modules of \fBLXQt\fR environment, such then this its a -important module for a working lxqt sesion. +module loading and related startup programs before user gets a working area. By default this module +loads the panel, desktop and power modules of \fBLXQt\fR environment, thus it is an +important module for a working \fBLXQt\fR session. .P Each of any desktop environment has any way to configure applications need or want to start at logon, -so user can manage manualy in the \fBlxqt-config-session\fR application. +so user can manage manually in the \fBlxqt-config-session\fR application. .SH "REPORTING BUGS" Report bugs to https://github.com/lxde/lxqt/issues .SH "SEE ALSO" -\fBLXQt\fR it has been tailored for users who value simplicity, speed, and +\fBLXQt\fR has been tailored for users who value simplicity, speed, and an intuitive interface, also intended for less powerful machines. See also: .\" any module must refers to session app, for more info on start it .P -\fBlxqt-config.1\fR LXQt application for manage configurations and settings +\fBlxqt-config(1)\fR \fBLXQt\fR application to manage configuration and settings .P -\fBlxqt-config-session.1\fR LXQt module for manage LXQt autostart session applications -.P -\fBstart-lxqt.1\fR LXQt display management independient starup. +\fBlxqt-config-session(1)\fR \fBLXQt\fR module to manage \fBLXQt\fR autostart session applications +\".P +\"\fBstart-lxqt(1)\fR LXQt display management independient starup. .P .SH AUTHOR This manual page was created by \fBPICCORO Lenz McKAY\fR \fI\fR