diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 3c23d28..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -build -lxqt-admin.kdev4 -*/translations/lxqt-admin diff --git a/CHANGELOG b/CHANGELOG index 15f5264..f3173a7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,16 @@ -lxqt-admin-0.11.0 / 2016-09-24 +lxqt-admin-0.11.1 / 2017-01-01 ============================== + * lxqt-admin-user: Add FreeBSD support + * Added *da.desktop + * Add French translation + * Remove cpack (#40) + +0.11.0 / 2016-09-24 +=================== + + * Release 0.11.0: Add changelog * user: Add failure message box * user: Provide icon name in polkit policy * Update README.md diff --git a/CMakeLists.txt b/CMakeLists.txt index eec38e0..2ee1436 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,15 +14,13 @@ find_package(KF5WindowSystem REQUIRED QUIET) include(LXQtCompilerSettings NO_POLICY_SCOPE) include(LXQtTranslate) -add_subdirectory(lxqt-admin-time) -add_subdirectory(lxqt-admin-user) - -# building tarball with CPack ------------------------------------------------- -include(InstallRequiredSystemLibraries) -set(CPACK_PACKAGE_VERSION_MAJOR ${LXQT_MAJOR_VERSION}) -set(CPACK_PACKAGE_VERSION_MINOR ${LXQT_MINOR_VERSION}) -set(CPACK_PACKAGE_VERSION_PATCH ${LXQT_PATCH_VERSION}) -set(CPACK_GENERATOR TBZ2) -set(CPACK_SOURCE_GENERATOR TBZ2) -set(CPACK_SOURCE_IGNORE_FILES /build/;.gitignore;.*~;.git;.kdev4;temp) -include(CPack) +if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") + message(WARNING "${CMAKE_SYSTEM_NAME} is not supported by lxqt-admin-user") + message(WARNING "${CMAKE_SYSTEM_NAME} is not supported by lxqt-admin-time") +elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + add_subdirectory(lxqt-admin-user) + message(WARNING "${CMAKE_SYSTEM_NAME} is not supported by lxqt-admin-time") +else() + add_subdirectory(lxqt-admin-user) + add_subdirectory(lxqt-admin-time) +endif() diff --git a/debian/changelog b/debian/changelog index f99e014..43f5e79 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +lxqt-admin (0.11.1-1) unstable; urgency=medium + + * Cherry-picking new upstream version 0.11.1 + * Removed some build dependencies: + -cmake + -libqt5xdg-dev + -libqt5xdgiconloader-dev + -pkg-config + -qttools5-dev + -qttools5-dev-tools + * Bumped build dependency liblxqt0-dev (>= 0.11.1) + * Bumped years in d/copyright + * Fixed d/gbp.conf + + -- Alf Gaida Mon, 02 Jan 2017 12:11:04 +0100 + lxqt-admin (0.11.0-2) unstable; urgency=medium * Cherry-picking new upstream version 0.11.0 diff --git a/debian/control b/debian/control index e14ff61..c7c62b0 100644 --- a/debian/control +++ b/debian/control @@ -6,17 +6,11 @@ Uploaders: Alf Gaida , Section: x11 Priority: optional Build-Depends: debhelper (>= 10), - cmake (>= 3.0.2), libkf5windowsystem-dev, - liblxqt0-dev (>= 0.11.0), + liblxqt0-dev (>= 0.11.1), libqt5svg5-dev, libqt5x11extras5-dev, - libqt5xdg-dev (>= 2.0.0), - libqt5xdgiconloader-dev (>= 2.0.0), - libx11-dev, - pkg-config, - qttools5-dev, - qttools5-dev-tools + libx11-dev Standards-Version: 3.9.8 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/lxqt-admin.git/?h=debian/sid Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/lxqt-admin.git -b debian/sid diff --git a/debian/copyright b/debian/copyright index eb0eb7b..8441a1c 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,12 +3,12 @@ Upstream-Name: lxqt-admin Source: https://github.com/lxde/lxqt-admin Files: * -Copyright: 2014-2016 LXQt team +Copyright: 2014-2017 LXQt team 2014 Hong Jen Yee (PCMan) License: LGPL-2.1+ Files: debian/* -Copyright: 2014-2016 Alf Gaida +Copyright: 2014-2017 Alf Gaida 2015 Andrew Lee (李健秋) License: LGPL-2.1+ diff --git a/debian/gbp.conf b/debian/gbp.conf index 9737966..04ac689 100644 --- a/debian/gbp.conf +++ b/debian/gbp.conf @@ -1,5 +1,5 @@ [DEFAULT] -debian-branch = debian +debian-branch = debian/sid pristine-tar = True [import-orig] diff --git a/lxqt-admin-time/translations/lxqt-admin-time_da.desktop b/lxqt-admin-time/translations/lxqt-admin-time_da.desktop new file mode 100644 index 0000000..855a796 --- /dev/null +++ b/lxqt-admin-time/translations/lxqt-admin-time_da.desktop @@ -0,0 +1,3 @@ +Name[da]=Dato og klokkeslæt +GenericName[da]=Indstillinger for dato og klokkeslæt +Comment[da]=Konfigurér datoen og klokkeslættet på dit system diff --git a/lxqt-admin-time/translations/lxqt-admin-time_fr.desktop b/lxqt-admin-time/translations/lxqt-admin-time_fr.desktop new file mode 100644 index 0000000..b7e99e0 --- /dev/null +++ b/lxqt-admin-time/translations/lxqt-admin-time_fr.desktop @@ -0,0 +1,4 @@ +#TRANSLATIONS +Name[fr]=Date et heure +GenericName[fr]=Paramétrer la date et l'heure +Comment[fr]=Paramétrer la date et l'heure du système diff --git a/lxqt-admin-user/CMakeLists.txt b/lxqt-admin-user/CMakeLists.txt index 5619363..4bcfd03 100644 --- a/lxqt-admin-user/CMakeLists.txt +++ b/lxqt-admin-user/CMakeLists.txt @@ -82,5 +82,10 @@ configure_file( "${CMAKE_CURRENT_BINARY_DIR}/org.lxqt.lxqt-admin-user.policy" @ONLY ) -install(PROGRAMS "lxqt-admin-user-helper" DESTINATION bin) + +if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + install(PROGRAMS "lxqt-admin-user-helper.freebsd" DESTINATION bin RENAME lxqt-admin-user-helper) +else() + install(PROGRAMS "lxqt-admin-user-helper.default" DESTINATION bin RENAME lxqt-admin-user-helper) +endif() install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.lxqt.lxqt-admin-user.policy" DESTINATION "share/polkit-1/actions") diff --git a/lxqt-admin-user/lxqt-admin-user-helper b/lxqt-admin-user/lxqt-admin-user-helper.default similarity index 100% rename from lxqt-admin-user/lxqt-admin-user-helper rename to lxqt-admin-user/lxqt-admin-user-helper.default diff --git a/lxqt-admin-user/lxqt-admin-user-helper.freebsd b/lxqt-admin-user/lxqt-admin-user-helper.freebsd new file mode 100755 index 0000000..4eb2785 --- /dev/null +++ b/lxqt-admin-user/lxqt-admin-user-helper.freebsd @@ -0,0 +1,15 @@ +#!/bin/sh +case "$1" in +useradd|usermod|userdel|groupadd|groupmod|groupdel) + export LC_ALL=C + exec "pw" "${@}" + ;; +passwd) + export LC_ALL=C + exec "$@" + ;; +*) + echo "Command '$1' is not allowed!" + exit 1 + ;; +esac diff --git a/lxqt-admin-user/mainwindow.cpp b/lxqt-admin-user/mainwindow.cpp index 62428f1..8c1a79a 100644 --- a/lxqt-admin-user/mainwindow.cpp +++ b/lxqt-admin-user/mainwindow.cpp @@ -40,6 +40,15 @@ MainWindow::MainWindow(): connect(ui.actionChangePasswd, SIGNAL(triggered(bool)), SLOT(onChangePasswd())); connect(ui.actionRefresh, SIGNAL(triggered(bool)), SLOT(reload())); +#ifdef Q_OS_FREEBSD //Disable group gpasswd for FreeBSD + connect(ui.tabWidget, &QTabWidget::currentChanged, [this](int index) { + if(index==1) { + ui.actionChangePasswd->setEnabled(false); + } else { + ui.actionChangePasswd->setEnabled(true); + } + }); +#endif connect(ui.userList, &QListWidget::activated, this, &MainWindow::onRowActivated); connect(ui.groupList, &QListWidget::activated, this, &MainWindow::onRowActivated); diff --git a/lxqt-admin-user/translations/lxqt-admin-user_da.desktop b/lxqt-admin-user/translations/lxqt-admin-user_da.desktop new file mode 100644 index 0000000..d26a4c4 --- /dev/null +++ b/lxqt-admin-user/translations/lxqt-admin-user_da.desktop @@ -0,0 +1,3 @@ +Name[da]=Brugere og grupper +GenericName[da]=Indstillinger for brugere og grupper +Comment[da]=Konfigurér systemets brugere og grupper diff --git a/lxqt-admin-user/translations/lxqt-admin-user_fr.desktop b/lxqt-admin-user/translations/lxqt-admin-user_fr.desktop new file mode 100644 index 0000000..f89d72f --- /dev/null +++ b/lxqt-admin-user/translations/lxqt-admin-user_fr.desktop @@ -0,0 +1,4 @@ +#TRANSLATIONS +Name[fr]=Utilisateurs et groupes +GenericName[fr]=Paramétrage des utilisateurs et des groupes +Comment[fr]=Paramétrage des utilisateurs et des groupes du système diff --git a/lxqt-admin-user/userdialog.cpp b/lxqt-admin-user/userdialog.cpp index 7dbd770..cd8d4b0 100644 --- a/lxqt-admin-user/userdialog.cpp +++ b/lxqt-admin-user/userdialog.cpp @@ -46,7 +46,7 @@ UserDialog::UserDialog(UserManager* userManager, UserInfo* user, QWidget* parent item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsUserCheckable|Qt::ItemIsSelectable); if(!isNewUser) { - if(group->hasMember(user->name()) || user->gid() == group->gid()) // the user is in this group + if(group->hasMember(user->name())) // the user is in this group item->setCheckState(Qt::Checked); else item->setCheckState(Qt::Unchecked); diff --git a/lxqt-admin-user/usermanager.cpp b/lxqt-admin-user/usermanager.cpp index 0238948..3722cf4 100644 --- a/lxqt-admin-user/usermanager.cpp +++ b/lxqt-admin-user/usermanager.cpp @@ -246,6 +246,9 @@ bool UserManager::addUser(UserInfo* user) { if(!user->groups().isEmpty()) { // set group membership command << QStringLiteral("-G") << user->groups().join(','); } +#ifdef Q_OS_FREEBSD + command << QStringLiteral("-n"); +#endif command << user->name(); return pkexec(command); } @@ -254,33 +257,46 @@ bool UserManager::modifyUser(UserInfo* user, UserInfo* newSettings) { if(!user || user->name().isEmpty() || !newSettings) return false; + bool isDirty = false; QStringList command; command << QStringLiteral("usermod"); - if(newSettings->uid() != user->uid()) + if(newSettings->uid() != user->uid()) { command << QStringLiteral("-u") << QString::number(newSettings->uid()); - + isDirty=true; + } if(newSettings->homeDir() != user->homeDir()) { command << QStringLiteral("-d") << newSettings->homeDir(); - // command << QStringLiteral("-m"); // create the user's home directory if it does not exist. + isDirty=true; } if(newSettings->shell() != user->shell()) { command << QStringLiteral("-s") << newSettings->shell(); + isDirty=true; } - if(newSettings->fullName() != user->fullName()) + if(newSettings->fullName() != user->fullName()) { command << QStringLiteral("-c") << newSettings->fullName(); - if(newSettings->gid() != user->gid()) + isDirty=true; + } + if(newSettings->gid() != user->gid()) { command << QStringLiteral("-g") << QString::number(newSettings->gid()); - - if(newSettings->name() != user->name()) // change login name + isDirty=true; + } + if(newSettings->name() != user->name()) { // change login name command << QStringLiteral("-l") << newSettings->name(); - + isDirty=true; + } if(newSettings->groups() != user->groups()) { // change group membership command << QStringLiteral("-G") << newSettings->groups().join(','); + isDirty=true; } - +#ifdef Q_OS_FREEBSD + command << QStringLiteral("-n"); +#endif command << user->name(); - return pkexec(command); + if(isDirty) { + return pkexec(command); + } + return true; //No changes } bool UserManager::deleteUser(UserInfo* user) { @@ -332,24 +348,51 @@ bool UserManager::modifyGroup(GroupInfo* group, GroupInfo* newSettings) { if(!group || group->name().isEmpty() || !newSettings) return false; QStringList command; + bool isDirty = false; command << QStringLiteral("groupmod"); - if(newSettings->gid() != group->gid()) + if(newSettings->gid() != group->gid()) { command << QStringLiteral("-g") << QString::number(newSettings->gid()); - if(newSettings->name() != group->name()) - command << QStringLiteral("-n") << newSettings->name(); + isDirty = true; + } + if(newSettings->name() != group->name()) { + isDirty = true; +#ifdef Q_OS_FREEBSD + command << QStringLiteral("-l"); +#else + command << QStringLiteral("-n"); +#endif + command << newSettings->name(); + } +#ifdef Q_OS_FREEBSD + if(newSettings->members() != group->members()) { + isDirty = true; + command << QStringLiteral("-M"); // Set the list of group members. + command << newSettings->members().join(','); + } + command << QStringLiteral("-n"); +#endif command << group->name(); - if(!pkexec(command)) + + if(isDirty && !pkexec(command)) return false; - // if group members are changed, use gpasswd to reset members + // if group members are changed, use gpasswd to reset members on linux +#ifndef Q_OS_FREEBSD //This is already done with pw groupmod -M earlier. if(newSettings->members() != group->members()) { command.clear(); command << QStringLiteral("gpasswd"); command << QStringLiteral("-M"); // Set the list of group members. command << newSettings->members().join(','); - command << group->name(); + //if the group name changed the group->name() is still the old setting. + if(newSettings->name() != group->name()) { + command << newSettings->name(); + } else { + command << group->name(); + } + return pkexec(command); } +#endif return true; }