diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c23d28 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build +lxqt-admin.kdev4 +*/translations/lxqt-admin diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..15f5264 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,99 @@ + +lxqt-admin-0.11.0 / 2016-09-24 +============================== + + * user: Add failure message box + * user: Provide icon name in polkit policy + * Update README.md + * Add Catalan translations + * Add copyright headers + * Add Arabic Translations for Desktop Files + * lxqt-admin-user: Fix a change password crash + * lxqt-admin-user: Makes the Refresh toolbar button visible + * lxqt-admin-time: Adjust dialog size on startup + * Update openSUSE section in README + * Update README.md + * Support NTP and Local RTC settings with timedated provided by systemd. Code cleanup. + * Replace calling timedatectl command with calling its dbus interface instead and provide proper error messages. + * Use dbus interface of timedate systemd daemon instead of timedatectl command. + * Add the ability to update group members. + * Support changing of user password. + * Show group members. + * Try to use a helper script and polkit policy configurations to do user admin. + * Remove liboobs dependency from lxqt-admin-time and use timedatectl to handle all time configurations. + * Try to handle timezones with timedatectl provided by systemd instead of liboobs. + * Add groupmod + * Try to remove liboobs dependency. + * Add README.md + * build: Use external translations + * ts-files removal (#32) + * Bump years to 2016 + * Don't track IDE settings + * Italian translation update + * Russian translations update Remove duplicated ru_RU translations + * updated: *_hu.ts + +0.10.0 / 2015-10-31 +=================== + + * Fix license file + * Add Greek (el) translation + * Rename LxQt to LXQt everywhere + * Removed invisible dialog titles. Updated template. Added german translation. + * Handles CMake policy CMP0063 + * Initialize in the same order of declaration in the class definition + * Use the LXQtCompilerSettings CMake module + * Updates the build system to use the Targets infrastructure + * Remove trailing whitespaces + * Create lxqt-admin-time_hr.ts + * Create lxqt-admin-user_hr.ts + * Hungarian translations added + * Create lxqt-admin-time_it.desktop + * Create lxqt-admin-user_it.desktop + * Initial Polish translation + * Create lxqt-admin-user_it.desktop + * lxqt-admin-user: set minimum default GID value for new group to 1000 + * Initial Polish translation + +0.9.0 / 2015-01-25 +================== + + * Create lxqt-admin-user_it.desktop + * Create lxqt-admin-user_it.ts + * Create lxqt-admin-time_it.ts + * Add Portuguese language + * Added Japanese translation + * Unify naming for a unique lxqt. No more suffixes + * Update Russian translation + * Updates translations sources + * Whole GUI of time/date setup has been rewritten from scratch the app has now style of LXQT config dialogs based on LxQt::ConfigDialog the time and date setting is divided into one configuration widget and timezone selection is divided into second config widget + * Add icon to config window + * Add .gitignore + * Make use of QApplication::exec() + * Use the new LxQt::SingleApplication + * CMakeLists.txt maintenance. + * Update translation a little more + * Add Russian translation + * updates Translations + * Updates the translations infrastructure + * Drop Qt4 support in CMakeLists.txt in subfolders + * Drop Qt4 support in code + * Clean up CMakeLists.txt and drop Qt 4 + +0.8.0 / 2014-06-21 +================== + + * simplify Qt version switching + * Support build with Qt5. + * Use new LXQt header files. + * Update copyright notice. + * Support changing group members. + * Support adding/removing/editing users and groups. + * Redesign the UI. + * Add a group configuration dialog. + * Improve user dialog. + * Add a user config dialog. + * Update time every seconds unless it's changed manually by the user. + * Add basic skeleton for lxqt-admin-user tool. + * Add a very basic time config tool, lxqt-admin-time. + * Initial commit. diff --git a/README.md b/README.md index 64d9e3c..ca9083b 100644 --- a/README.md +++ b/README.md @@ -4,42 +4,37 @@ This repository is providing two GUI tools to adjust settings of the operating system LXQt is running on. -"Time and date configuration", binary `lxqt-admin-time`, can adjust system time and timezone. +Both are using [polkit](https://www.freedesktop.org/wiki/Software/polkit/) to handle permissions. +In contrast to the specific backends described below earlier versions of lxqt-admin were relying on [system-tools-backends](http://system-tools-backends.freedesktop.org) and their wrapper [liboobs](https://github.com/GNOME/liboobs). These were replaced as both go unmaintained for years and were hence dropped from many distributions heavily restricting the usage of lxqt-admin. As long as they can be built it should still be possible to compile lxqt-admin release ≤ 0.10 against them in order to make use of it on platforms lacking systemd like BSD. + +### Time and date configuration + +Adjusts time and date. Binary is `lxqt-admin-time`. ![lxqt-admin-time](lxqt-admin-time.png) It is using `systemd-timedated` as backend which is accessed by its D-Bus interface. Among other this means the option to sync the system time by NTP is relying on `systemd-timesyncd` as backend. -In "User and Group Settings", binary `lxqt-admin-user`, users and groups of the operating system can be modified. +### User and Group Settings + +Management of users and groups. Binary is `lxqt-admin-user`. ![lxqt-admin-user](lxqt-admin-user.png) The backend is a script `lxqt-admin-user-helper`. By default it is in turn using the shadow tools to do the actual work. The script can be modified to use different tools, though. -Both are using [polkit](https://www.freedesktop.org/wiki/Software/polkit/) to handle permissions. So polkit and a corresponding -authentication agent are needed at runtime. As for LXQt sessions [lxqt-policykit](https://github.com/lxde/lxqt-policykit/) -is the first choice. - -Earlier versions of lxqt-admin were relying on [system-tools-backends](http://system-tools-backends.freedesktop.org) -and their wrapper [liboobs](https://github.com/GNOME/liboobs). These were replaced as both go unmaintained for years and -were hence dropped from many distributions heavily restricting the usage of lxqt-admin. -As long as they can be built it should still be possible to compile lxqt-admin release ≤ 0.10 against them in order -to make use of it on platforms lacking systemd like BSD. - ## Installing ### Compiling sources -Build dependencies are Git, CMake, qttools to handle localization as well as library [liblxqt](https://github.com/lxde/liblxqt) -and its dependency [libqtxdg](https://github.com/lxde/libqtxdg). -By default lxqt-admin is pulling translations from repository [translations](https://github.com/lxde/translations/) at -compile time, see file README.md of the latter. +Runtime dependencies are polkit and [liblxqt](https://github.com/lxde/liblxqt). A polkit agent should be available with [lxqt-policykit](https://github.com/lxde/lxqt-policykit/) representing the first choice in LXQt. +Additional build dependencies are CMake and optionally Git to pull latest VCS checkouts. The localization files were outsourced to repository [lxqt-l10n](https://github.com/lxde/lxqt-l10n) so the corresponding dependencies are needed, too. Please refer to this repository's `README.md` for further information. + +Code configuration is handled by CMake. CMake variable `CMAKE_INSTALL_PREFIX` will normally have to be set to `/usr`. -To compile, run `cmake`, `make` and `make install`. -`cmake` can be invoked in an out of source build directory and will normally need variable `-DCMAKE_INSTALL_PREFIX=/usr`. -`make install` can be invoked with `DESTDIR=`. +To build run `make`, to install `make install` which accepts variable `DESTDIR` as usual. ### Binary packages @@ -66,8 +61,7 @@ However it is still possible to install it on openSUSE. The package and its depe ## Usage -Both GUIs can be launched from GUI "Configuration Center" of [lxqt-config](https://github.com/lxde/lxqt-config) and are available -in LXQt panel's main menu at Preferences - LXQt settings as well. +Much like similar tools provided by [lxqt-config](https://github.com/lxde/lxqt-config) the tools of lxqt-admin can be launched from the [Configuration Center](https://github.com/lxde/lxqt-config#configuration-center) as well as from the panel's main menu - Preferences - LXQt settings. The actual usage should be self-explanatory. To apply settings the GUI of the polkit authentication agent that's in use is launched to acquire the root password. diff --git a/lxqt-admin-time/timedatectl.cpp b/lxqt-admin-time/timedatectl.cpp index 18fb748..adb8ff6 100644 --- a/lxqt-admin-time/timedatectl.cpp +++ b/lxqt-admin-time/timedatectl.cpp @@ -1,3 +1,30 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2016 LXQt team + * Authors: + * Hong Jen Yee (PCMan) + * + * This program or 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + #include "timedatectl.h" #include #include diff --git a/lxqt-admin-time/timedatectl.h b/lxqt-admin-time/timedatectl.h index 759ce2e..2c25e88 100644 --- a/lxqt-admin-time/timedatectl.h +++ b/lxqt-admin-time/timedatectl.h @@ -1,3 +1,30 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2016 LXQt team + * Authors: + * Hong Jen Yee (PCMan) + * + * This program or 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + #ifndef TIMEDATECTL_H #define TIMEDATECTL_H diff --git a/lxqt-admin-time/translations/lxqt-admin-time_ar.desktop b/lxqt-admin-time/translations/lxqt-admin-time_ar.desktop new file mode 100644 index 0000000..cb6847b --- /dev/null +++ b/lxqt-admin-time/translations/lxqt-admin-time_ar.desktop @@ -0,0 +1,4 @@ +#TRANSLATIONS +Name[ar]=التّاريخ والوقت +GenericName[ar]=إعدادات التّاريخ والوقت +Comment[ar]=اضبط تاريخ النّظام ووقته diff --git a/lxqt-admin-time/translations/lxqt-admin-time_ca.desktop b/lxqt-admin-time/translations/lxqt-admin-time_ca.desktop new file mode 100644 index 0000000..cb225de --- /dev/null +++ b/lxqt-admin-time/translations/lxqt-admin-time_ca.desktop @@ -0,0 +1,3 @@ +Name[ca]=Data i hora +GenericName[ca]=Ajusts de la data i l'hora +Comment[ca]=Configureu la data i l'hora del vostre sistema diff --git a/lxqt-admin-user/org.lxqt.lxqt-admin-user.policy.in b/lxqt-admin-user/org.lxqt.lxqt-admin-user.policy.in index 7aca401..b479b86 100644 --- a/lxqt-admin-user/org.lxqt.lxqt-admin-user.policy.in +++ b/lxqt-admin-user/org.lxqt.lxqt-admin-user.policy.in @@ -6,7 +6,7 @@ Authentication is required for user administration - + preferences-system auth_admin auth_admin diff --git a/lxqt-admin-user/translations/lxqt-admin-user_ar.desktop b/lxqt-admin-user/translations/lxqt-admin-user_ar.desktop new file mode 100644 index 0000000..713e07e --- /dev/null +++ b/lxqt-admin-user/translations/lxqt-admin-user_ar.desktop @@ -0,0 +1,4 @@ +#TRANSLATIONS +Name[ar]=المستخدمون والمجموعات +GenericName[ar]=إعدادات المستخدمون والمجموعات +Comment[ar]=اضبط مستخدمو النّظام ومجموعاته diff --git a/lxqt-admin-user/translations/lxqt-admin-user_ca.desktop b/lxqt-admin-user/translations/lxqt-admin-user_ca.desktop new file mode 100644 index 0000000..e8ed741 --- /dev/null +++ b/lxqt-admin-user/translations/lxqt-admin-user_ca.desktop @@ -0,0 +1,3 @@ +Name[ca]=Usuaris i grups +GenericName[ca]=Ajusts dels usuaris i dels grups +Comment[ca]=Configureu els usuaris i els grups del vostre sistema diff --git a/lxqt-admin-user/usermanager.cpp b/lxqt-admin-user/usermanager.cpp index a745000..0238948 100644 --- a/lxqt-admin-user/usermanager.cpp +++ b/lxqt-admin-user/usermanager.cpp @@ -1,3 +1,30 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2016 LXQt team + * Authors: + * Hong Jen Yee (PCMan) + * + * This program or 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + #include "usermanager.h" #include #include @@ -5,6 +32,7 @@ #include #include #include +#include #include static const QString PASSWD_FILE = QStringLiteral("/etc/passwd"); @@ -166,6 +194,7 @@ void UserManager::onFileChanged(const QString &path) { } bool UserManager::pkexec(const QStringList& command, const QByteArray& stdinData) { + Q_ASSERT(!command.isEmpty()); QProcess process; qDebug() << command; QStringList args; @@ -180,8 +209,17 @@ bool UserManager::pkexec(const QStringList& command, const QByteArray& stdinData process.closeWriteChannel(); } process.waitForFinished(-1); - qDebug() << process.readAllStandardError(); - return process.exitCode() == 0; + QByteArray pkexec_error = process.readAllStandardError(); + qDebug() << pkexec_error; + const bool succeeded = process.exitCode() == 0; + if (!succeeded) + { + QMessageBox * msg = new QMessageBox{QMessageBox::Critical, tr("lxqt-admin-user") + , tr("Action (%1) failed:
%2
").arg(command[0]).arg(pkexec_error.constData())}; + msg->setAttribute(Qt::WA_DeleteOnClose, true); + msg->show(); + } + return succeeded; } bool UserManager::addUser(UserInfo* user) { diff --git a/lxqt-admin-user/usermanager.h b/lxqt-admin-user/usermanager.h index 0b5f0d2..648a609 100644 --- a/lxqt-admin-user/usermanager.h +++ b/lxqt-admin-user/usermanager.h @@ -1,3 +1,30 @@ +/* BEGIN_COMMON_COPYRIGHT_HEADER + * (c)LGPL2+ + * + * LXQt - a lightweight, Qt based, desktop toolset + * http://lxqt.org + * + * Copyright: 2016 LXQt team + * Authors: + * Hong Jen Yee (PCMan) + * + * This program or 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 + * + * END_COMMON_COPYRIGHT_HEADER */ + #ifndef USERMANAGER_H #define USERMANAGER_H