!59 update to upstream version 3.0.4-1
From: @hua_yadong Reviewed-by: @dou33 Signed-off-by: @dou33
This commit is contained in:
commit
2fdff63c47
@ -1,82 +0,0 @@
|
||||
From 28369c2426ec8ed4c3e8dad596a1e24ade5161de Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Thu, 8 Jul 2021 09:58:50 +0800
|
||||
Subject: [PATCH] add judgment when Bluetooth does not exist
|
||||
|
||||
---
|
||||
shell/mainwindow.cpp | 30 +++++++++++++++++++-----------
|
||||
shell/mainwindow.h | 2 +-
|
||||
2 files changed, 20 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/shell/mainwindow.cpp b/shell/mainwindow.cpp
|
||||
index ed872de..a85b68a 100755
|
||||
--- a/shell/mainwindow.cpp
|
||||
+++ b/shell/mainwindow.cpp
|
||||
@@ -547,7 +547,6 @@ void MainWindow::loadPlugins(){
|
||||
pluginsDir = QDir(qApp->applicationDirPath() + "/plugins");
|
||||
}
|
||||
|
||||
- bool isExistCloud = isExitsCloudAccount();
|
||||
foreach (QString fileName, pluginsDir.entryList(QDir::Files)){
|
||||
//三权分立开启
|
||||
#ifdef WITHKYSEC
|
||||
@@ -558,17 +557,17 @@ void MainWindow::loadPlugins(){
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
-
|
||||
- if (!fileName.endsWith(".so"))
|
||||
- continue;
|
||||
- if (fileName == "libexperienceplan.so")
|
||||
- continue;
|
||||
- if ("libnetworkaccount.so" == fileName && !isExistCloud) {
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- if (!QGSettings::isSchemaInstalled(kVinoSchemas) && "libvino.so" == fileName) {
|
||||
+
|
||||
+ if (!fileName.endsWith(".so")) {
|
||||
continue;
|
||||
+ } else if (fileName == "libexperienceplan.so") {
|
||||
+ continue;
|
||||
+ } else if ("libnetworkaccount.so" == fileName && !isExitsCloudAccount()) {
|
||||
+ continue;
|
||||
+ } else if (!QGSettings::isSchemaInstalled(kVinoSchemas) && "libvino.so" == fileName) {
|
||||
+ continue;
|
||||
+ } else if ("libbluetooth.so" == fileName && !isExitBluetooth()) {
|
||||
+ continue;
|
||||
}
|
||||
|
||||
qDebug() << "Scan Plugin: " << fileName;
|
||||
@@ -822,6 +821,15 @@ void MainWindow::initStyleSheet() {
|
||||
"QPushButton:hover:pressed#closeBtn{background: #E54A50; border-radius: 4px;width:32px;height:32px;}");
|
||||
}
|
||||
|
||||
+bool MainWindow::isExitBluetooth() {
|
||||
+ QProcess process;
|
||||
+ process.start("rfkill list");
|
||||
+ process.waitForFinished();
|
||||
+ QByteArray output = process.readAllStandardOutput();
|
||||
+ QString str_output = output;
|
||||
+ return str_output.contains(QString("bluetooth"), Qt::CaseInsensitive);
|
||||
+}
|
||||
+
|
||||
void MainWindow::setModuleBtnHightLight(int id) {
|
||||
leftBtnGroup->button(id)->setChecked(true);
|
||||
leftMicBtnGroup->button(id)->setChecked(true);
|
||||
diff --git a/shell/mainwindow.h b/shell/mainwindow.h
|
||||
index d14f1ef..bb44d7e 100755
|
||||
--- a/shell/mainwindow.h
|
||||
+++ b/shell/mainwindow.h
|
||||
@@ -107,7 +107,7 @@ private:
|
||||
|
||||
bool dblOnEdge(QMouseEvent *event);
|
||||
void initStyleSheet();
|
||||
-
|
||||
+ bool isExitBluetooth();
|
||||
public slots:
|
||||
void functionBtnClicked(QObject * plugin);
|
||||
void sltMessageReceived(const QString &msg);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
From 32fe5a8b9b8e31e396e52a8121fb1286f838e39a Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Thu, 29 Jul 2021 19:46:40 +0800
|
||||
Subject: [PATCH] fix compile extern C error
|
||||
|
||||
---
|
||||
plugins/account/userinfo/run-passwd.cpp | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/plugins/account/userinfo/run-passwd.cpp b/plugins/account/userinfo/run-passwd.cpp
|
||||
index 6407929..80da0d0 100755
|
||||
--- a/plugins/account/userinfo/run-passwd.cpp
|
||||
+++ b/plugins/account/userinfo/run-passwd.cpp
|
||||
@@ -7,7 +7,6 @@
|
||||
#undef signals
|
||||
#endif
|
||||
|
||||
-extern "C" {
|
||||
#include <glib.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
@@ -16,7 +15,6 @@ extern "C" {
|
||||
#include <errno.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
-}
|
||||
|
||||
#include "run-passwd.h"
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,257 +0,0 @@
|
||||
From e64005deb039312a914ce8dcb9f93f1f4ac6cf7c Mon Sep 17 00:00:00 2001
|
||||
From: myshow <296570182@qq.com>
|
||||
Date: Wed, 25 Nov 2020 17:34:20 +0800
|
||||
Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=B3=E4=BA=8E?=
|
||||
=?UTF-8?q?=E7=95=8C=E9=9D=A2=20=E5=86=85=E6=A0=B8=20cpu=20=E5=86=85?=
|
||||
=?UTF-8?q?=E5=AD=98=20=E7=A1=AC=E7=9B=98=20=E4=BF=A1=E6=81=AF=E6=98=BE?=
|
||||
=?UTF-8?q?=E7=A4=BA=E7=A9=BA=E7=99=BD=E7=9A=84=E9=97=AE=E9=A2=98?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
---
|
||||
plugins/messages-task/about/about.cpp | 53 +++++----------------
|
||||
plugins/messages-task/about/about.pro | 8 ++--
|
||||
plugins/messages-task/about/cpuinfo.cpp | 34 +++++++++++++
|
||||
plugins/messages-task/about/cpuinfo.h | 15 ++++++
|
||||
plugins/messages-task/about/memoryentry.cpp | 32 ++++++++++---
|
||||
plugins/messages-task/about/memoryentry.h | 1 +
|
||||
6 files changed, 92 insertions(+), 51 deletions(-)
|
||||
create mode 100644 plugins/messages-task/about/cpuinfo.cpp
|
||||
create mode 100644 plugins/messages-task/about/cpuinfo.h
|
||||
|
||||
diff --git a/plugins/messages-task/about/about.cpp b/plugins/messages-task/about/about.cpp
|
||||
index 9e8c290..a2dc766 100644
|
||||
--- a/plugins/messages-task/about/about.cpp
|
||||
+++ b/plugins/messages-task/about/about.cpp
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "about.h"
|
||||
#include "ui_about.h"
|
||||
#include "memoryentry.h"
|
||||
+#include "cpuinfo.h"
|
||||
|
||||
#include <QProcess>
|
||||
#include <QFile>
|
||||
@@ -99,54 +100,22 @@ void About::setupDesktopComponent() {
|
||||
|
||||
void About::setupKernelCompenent() {
|
||||
QString kernal = QSysInfo::kernelType() + " " + QSysInfo::kernelVersion();
|
||||
- QString diskSize;
|
||||
- QString memorySize;
|
||||
- QString cpuType;
|
||||
-
|
||||
- //ubuntukylin youker DBus interface
|
||||
- QDBusInterface *youkerInterface;
|
||||
- for (int i = 0; i < 2; i++) {
|
||||
- youkerInterface = new QDBusInterface("com.kylin.assistant.systemdaemon",
|
||||
- "/com/kylin/assistant/systemdaemon",
|
||||
- "com.kylin.assistant.systemdaemon",
|
||||
- QDBusConnection::systemBus(), this);
|
||||
- }
|
||||
- if (!youkerInterface->isValid()) {
|
||||
- qCritical() << "Create youker Interface Failed When Get Computer info: " << QDBusConnection::systemBus().lastError();
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- QDBusReply<QMap<QString, QVariant>> diskinfo;
|
||||
- diskinfo = youkerInterface ->call("get_harddisk_info");
|
||||
- if (!diskinfo.isValid()) {
|
||||
- qDebug() << "diskinfo is invalid" << endl;
|
||||
- } else {
|
||||
- QMap<QString, QVariant> res = diskinfo.value();
|
||||
- diskSize = res["DiskCapacity"].toString();
|
||||
- if (diskSize.contains("<1_1>")) {
|
||||
- int index = diskSize.indexOf("<1_1>");
|
||||
- QString disk1 = diskSize.left(index);
|
||||
- diskSize = tr("Disk:") + disk1;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- QDBusReply<QMap<QString, QVariant>> cpuinfo;
|
||||
- cpuinfo = youkerInterface ->call("get_cpu_info");
|
||||
- if (!diskinfo.isValid()) {
|
||||
- qDebug() << "cpuinfo is invalid" << endl;
|
||||
- } else {
|
||||
- QMap<QString, QVariant> res = cpuinfo.value();
|
||||
- cpuType = res["CpuVersion"].toString();
|
||||
- }
|
||||
+ QString memorySize = "N/A";
|
||||
+ QString cpuType = "N/A";
|
||||
+ QString diskSize = "N/A";
|
||||
|
||||
MemoryEntry memoryInfo;
|
||||
QStringList memory = memoryInfo.totalMemory();
|
||||
- memorySize = memorySize + memory.at(0) + "(" + memory.at(1) + tr(" available") + ")";
|
||||
+ memorySize = memory.at(0) + "(" + memory.at(1) + tr(" available") + ")";
|
||||
|
||||
- ui->cpuContent->setText(cpuType);
|
||||
- ui->diskContent->setText(diskSize);
|
||||
ui->kernalContent->setText(kernal);
|
||||
ui->memoryContent->setText(memorySize);
|
||||
+
|
||||
+ ui->cpuContent->setText(cpuinfo::getCpuName());
|
||||
+
|
||||
+ QStorageInfo storage = QStorageInfo::root();
|
||||
+ diskSize = QString("%1").arg(storage.bytesTotal()/1024.0f/1024/1024, 0, 'f', 1) + " GB";
|
||||
+ ui->diskContent->setText(diskSize);
|
||||
}
|
||||
|
||||
void About::setupVersionCompenent() {
|
||||
diff --git a/plugins/messages-task/about/about.pro b/plugins/messages-task/about/about.pro
|
||||
index b9898f6..cd789e1 100644
|
||||
--- a/plugins/messages-task/about/about.pro
|
||||
+++ b/plugins/messages-task/about/about.pro
|
||||
@@ -17,12 +17,14 @@ INCLUDEPATH += \
|
||||
HEADERS += \
|
||||
about.h \
|
||||
entry.h \
|
||||
- memoryentry.h
|
||||
+ memoryentry.h \
|
||||
+ cpuinfo.h
|
||||
|
||||
SOURCES += \
|
||||
about.cpp \
|
||||
entry.cpp \
|
||||
- memoryentry.cpp
|
||||
+ memoryentry.cpp \
|
||||
+ cpuinfo.cpp
|
||||
|
||||
FORMS += \
|
||||
about.ui
|
||||
@@ -30,4 +32,4 @@ FORMS += \
|
||||
RESOURCES += \
|
||||
res/img.qrc
|
||||
|
||||
-INSTALLS += target
|
||||
\ No newline at end of file
|
||||
+INSTALLS += target
|
||||
diff --git a/plugins/messages-task/about/cpuinfo.cpp b/plugins/messages-task/about/cpuinfo.cpp
|
||||
new file mode 100644
|
||||
index 0000000..ee24a95
|
||||
--- /dev/null
|
||||
+++ b/plugins/messages-task/about/cpuinfo.cpp
|
||||
@@ -0,0 +1,34 @@
|
||||
+#include <QFile>
|
||||
+#include <QDebug>
|
||||
+
|
||||
+#include "cpuinfo.h"
|
||||
+
|
||||
+cpuinfo::cpuinfo(QObject *parent) : QObject(parent)
|
||||
+{
|
||||
+
|
||||
+}
|
||||
+
|
||||
+QString cpuinfo::getCpuName()
|
||||
+{
|
||||
+ QString name = "";
|
||||
+#ifdef Q_OS_LINUX
|
||||
+ QFile file("/proc/cpuinfo");
|
||||
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
+ return "no cpuinfo";
|
||||
+
|
||||
+ QString line = "N/A";
|
||||
+ QTextStream in(&file);
|
||||
+ line = in.readLine();
|
||||
+ while (!in.atEnd()) {
|
||||
+ line = in.readLine();
|
||||
+ if (line.contains("model name"))
|
||||
+ break;
|
||||
+ }
|
||||
+ //openEuler /proc/cpuinfo
|
||||
+ //model name : Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
|
||||
+ name = QString(line).right(line.length() - (line.indexOf(":") + 2));
|
||||
+#elif defined(Q_OS_FREEBSD)
|
||||
+
|
||||
+#endif
|
||||
+ return name;
|
||||
+}
|
||||
diff --git a/plugins/messages-task/about/cpuinfo.h b/plugins/messages-task/about/cpuinfo.h
|
||||
new file mode 100644
|
||||
index 0000000..2253ea6
|
||||
--- /dev/null
|
||||
+++ b/plugins/messages-task/about/cpuinfo.h
|
||||
@@ -0,0 +1,15 @@
|
||||
+#ifndef CPUINFO_H
|
||||
+#define CPUINFO_H
|
||||
+
|
||||
+#include <QObject>
|
||||
+
|
||||
+class cpuinfo : public QObject
|
||||
+{
|
||||
+ Q_OBJECT
|
||||
+public:
|
||||
+ explicit cpuinfo(QObject *parent = nullptr);
|
||||
+
|
||||
+ static QString getCpuName();
|
||||
+};
|
||||
+
|
||||
+#endif // CPUINFO_H
|
||||
diff --git a/plugins/messages-task/about/memoryentry.cpp b/plugins/messages-task/about/memoryentry.cpp
|
||||
index 4d93a3b..f1b1bef 100644
|
||||
--- a/plugins/messages-task/about/memoryentry.cpp
|
||||
+++ b/plugins/messages-task/about/memoryentry.cpp
|
||||
@@ -22,6 +22,27 @@ MemoryEntry::MemoryEntry() : Entry(ki18n("Memory:"), totalMemory().at(1))
|
||||
}
|
||||
|
||||
qlonglong MemoryEntry::calculateTotalRam()
|
||||
+{
|
||||
+ qlonglong ret = -1;
|
||||
+#ifdef Q_OS_LINUX
|
||||
+ struct sysinfo info;
|
||||
+ if (sysinfo(&info) == 0)
|
||||
+ // manpage "sizes are given as multiples of mem_unit bytes"
|
||||
+ ret = qlonglong(info.totalswap) * info.mem_unit;
|
||||
+#elif defined(Q_OS_FREEBSD)
|
||||
+ /* Stuff for sysctl */
|
||||
+ size_t len;
|
||||
+
|
||||
+ unsigned long memory;
|
||||
+ len = sizeof(memory);
|
||||
+ sysctlbyname("hw.physmem", &memory, &len, NULL, 0);
|
||||
+
|
||||
+ ret = memory;
|
||||
+#endif
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+qlonglong MemoryEntry::calculateavAilableRam()
|
||||
{
|
||||
qlonglong ret = -1;
|
||||
#ifdef Q_OS_LINUX
|
||||
@@ -46,16 +67,15 @@ QStringList MemoryEntry::totalMemory()
|
||||
{
|
||||
QStringList res;
|
||||
const qlonglong totalRam = calculateTotalRam();
|
||||
+ const qlonglong availableRam = calculateavAilableRam();
|
||||
|
||||
if (totalRam > 0) {
|
||||
- QString total = KFormat().formatByteSize(totalRam, 0);
|
||||
- QString available = KFormat().formatByteSize(totalRam, 1);
|
||||
- if (total.toDouble() > available.toDouble()) {
|
||||
- qSwap(total, available);
|
||||
- }
|
||||
+ QString total = KFormat().formatByteSize(totalRam);
|
||||
+ QString available = KFormat().formatByteSize(availableRam);
|
||||
+
|
||||
res << total << available;
|
||||
return res;
|
||||
}
|
||||
-// return ki18n("Unknown amount of RAM", "Unknown");
|
||||
+
|
||||
return res;
|
||||
}
|
||||
diff --git a/plugins/messages-task/about/memoryentry.h b/plugins/messages-task/about/memoryentry.h
|
||||
index d992a30..3ef792a 100644
|
||||
--- a/plugins/messages-task/about/memoryentry.h
|
||||
+++ b/plugins/messages-task/about/memoryentry.h
|
||||
@@ -15,6 +15,7 @@ class MemoryEntry : public Entry
|
||||
public:
|
||||
MemoryEntry();
|
||||
static qlonglong calculateTotalRam();
|
||||
+ static qlonglong calculateavAilableRam();
|
||||
static QStringList totalMemory();
|
||||
};
|
||||
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
@ -1,89 +0,0 @@
|
||||
From 024f7bebf163348518ebbdf443c185dc66595a53 Mon Sep 17 00:00:00 2001
|
||||
From: myshow <296570182@qq.com>
|
||||
Date: Fri, 27 Nov 2020 17:34:23 +0800
|
||||
Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=8A=A8?=
|
||||
=?UTF-8?q?=E7=99=BB=E5=BD=95=E4=B8=8E=E5=85=8D=E5=AF=86=E7=99=BB=E5=BD=95?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
---
|
||||
plugins/account/userinfo/userinfo.cpp | 3 ++-
|
||||
plugins/account/userinfo/userinfo.ui | 2 +-
|
||||
registeredQDbus/main.cpp | 2 +-
|
||||
registeredQDbus/sysdbusregister.cpp | 9 ++++++---
|
||||
4 files changed, 10 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/plugins/account/userinfo/userinfo.cpp b/plugins/account/userinfo/userinfo.cpp
|
||||
index 49744f6..09183a4 100644
|
||||
--- a/plugins/account/userinfo/userinfo.cpp
|
||||
+++ b/plugins/account/userinfo/userinfo.cpp
|
||||
@@ -355,8 +355,9 @@ void UserInfo::initComponent(){
|
||||
if (!getuid()){
|
||||
ui->changeTypeBtn->setEnabled(false);
|
||||
ui->changeGroupBtn->setEnabled(false);
|
||||
+ ui->changeValidBtn->setEnabled(false);
|
||||
ui->autoLoginFrame->setVisible(false);
|
||||
- ui->autoLoginFrame_2->setVisible(false);
|
||||
+ ui->noPasswdFrame->setVisible(false);
|
||||
}
|
||||
//样式表
|
||||
// pluginWidget->setStyleSheet("background: #ffffff;");
|
||||
diff --git a/plugins/account/userinfo/userinfo.ui b/plugins/account/userinfo/userinfo.ui
|
||||
index 4793f7b..c6d0da8 100644
|
||||
--- a/plugins/account/userinfo/userinfo.ui
|
||||
+++ b/plugins/account/userinfo/userinfo.ui
|
||||
@@ -471,7 +471,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
- <widget class="QFrame" name="autoLoginFrame_2">
|
||||
+ <widget class="QFrame" name="noPasswdFrame">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>550</width>
|
||||
diff --git a/registeredQDbus/main.cpp b/registeredQDbus/main.cpp
|
||||
index e6b1340..c2db36e 100644
|
||||
--- a/registeredQDbus/main.cpp
|
||||
+++ b/registeredQDbus/main.cpp
|
||||
@@ -29,7 +29,7 @@ int main(int argc, char *argv[]){
|
||||
|
||||
QCoreApplication app(argc, argv);
|
||||
app.setOrganizationName("Kylin Team");
|
||||
- app.setApplicationName("ukcc-service");
|
||||
+ app.setApplicationName("ukui-service");
|
||||
|
||||
|
||||
QDBusConnection systemBus = QDBusConnection::systemBus();
|
||||
diff --git a/registeredQDbus/sysdbusregister.cpp b/registeredQDbus/sysdbusregister.cpp
|
||||
index 2985c57..670e5e5 100644
|
||||
--- a/registeredQDbus/sysdbusregister.cpp
|
||||
+++ b/registeredQDbus/sysdbusregister.cpp
|
||||
@@ -87,7 +87,7 @@ QString SysdbusRegister::getNoPwdLoginStatus(){
|
||||
|
||||
//设置免密登录状态
|
||||
void SysdbusRegister::setNoPwdLoginStatus(bool status,QString username){
|
||||
-
|
||||
+ systemRun("groupadd -r nopasswdlogin");
|
||||
QString cmd;
|
||||
if(true == status){
|
||||
cmd = QString("gpasswd -a %1 nopasswdlogin").arg(username);
|
||||
@@ -102,10 +102,13 @@ void SysdbusRegister::setAutoLoginStatus(QString username)
|
||||
{
|
||||
QString filename = "/etc/lightdm/lightdm.conf";
|
||||
QSharedPointer<QSettings> autoSettings = QSharedPointer<QSettings>(new QSettings(filename, QSettings::IniFormat));
|
||||
- autoSettings->beginGroup("SeatDefaults");
|
||||
- autoSettings->clear();
|
||||
|
||||
+ autoSettings->beginGroup("SeatDefaults");
|
||||
autoSettings->setValue("autologin-user", username);
|
||||
+ autoSettings->setValue("autologin-session", "ukui");
|
||||
autoSettings->endGroup();
|
||||
autoSettings->sync();
|
||||
+
|
||||
+ systemRun("groupadd -r autologin");
|
||||
+ systemRun(QString("gpasswd -a %1 autologin").arg(username));
|
||||
}
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
From bb73b40db7489201f2d5237a675cfd2ff7ae01bc Mon Sep 17 00:00:00 2001
|
||||
From: myshow <296570182@qq.com>
|
||||
Date: Tue, 1 Dec 2020 14:45:48 +0800
|
||||
Subject: [PATCH 4/5] =?UTF-8?q?fix-dialog-pop-twice-after-modifying-resolu?=
|
||||
=?UTF-8?q?tion-bug=20=E4=BF=AE=E5=A4=8D=E4=BF=AE=E6=94=B9=E5=88=86?=
|
||||
=?UTF-8?q?=E8=BE=A8=E7=8E=87=E4=B9=8B=E5=90=8E=E5=AF=B9=E8=AF=9D=E6=A1=86?=
|
||||
=?UTF-8?q?=E5=BC=B9=E5=87=BA=E4=B8=A4=E6=AC=A1=E7=9A=84=E9=97=AE=E9=A2=98?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
---
|
||||
plugins/system/display/widget.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plugins/system/display/widget.cpp b/plugins/system/display/widget.cpp
|
||||
index 7055733..7c175ed 100644
|
||||
--- a/plugins/system/display/widget.cpp
|
||||
+++ b/plugins/system/display/widget.cpp
|
||||
@@ -78,7 +78,7 @@ Widget::Widget(QWidget *parent)
|
||||
ui->monitorLabel->setStyleSheet("QLabel{font-size: 18px; color: palette(windowText);}");
|
||||
ui->quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||
|
||||
-#if QT_VERSION <= QT_VERSION_CHECK(5, 12, 0)
|
||||
+#if QT_VERSION <= QT_VERSION_CHECK(5, 6, 0)
|
||||
oriApply = true;
|
||||
#else
|
||||
oriApply = false;
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
From d0e9549cf4c08d0566bd3656b49a3c9e73d72383 Mon Sep 17 00:00:00 2001
|
||||
From: myshow <296570182@qq.com>
|
||||
Date: Tue, 1 Dec 2020 15:31:10 +0800
|
||||
Subject: [PATCH 5/5] =?UTF-8?q?fix-effects-mode-not-available-bug=20?=
|
||||
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=89=B9=E6=95=88=E6=A8=A1=E5=BC=8F=E4=B8=8D?=
|
||||
=?UTF-8?q?=E5=8F=AF=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
---
|
||||
plugins/personalized/theme/theme.cpp | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/plugins/personalized/theme/theme.cpp b/plugins/personalized/theme/theme.cpp
|
||||
index a62cf4a..5e9d066 100644
|
||||
--- a/plugins/personalized/theme/theme.cpp
|
||||
+++ b/plugins/personalized/theme/theme.cpp
|
||||
@@ -536,6 +536,7 @@ void Theme::initConnection() {
|
||||
connect(effectSwitchBtn, &SwitchButton::checkedChanged, [this](bool checked) {
|
||||
if (!checked) {
|
||||
personliseGsettings->set(PERSONALSIE_TRAN_KEY, 1.0);
|
||||
+ ui->tranSlider->setValue(100);
|
||||
}
|
||||
// 提供给外部监听特效接口
|
||||
personliseGsettings->set(PERSONALSIE_EFFECT_KEY, checked);
|
||||
@@ -657,7 +658,7 @@ void Theme::writeKwinSettings(bool change, QString theme, bool effect) {
|
||||
kwinSettings->setValue("kwin4_effect_translucencyEnabled", false);
|
||||
kwinSettings->setValue("zoomEnabled", false);
|
||||
kwinSettings->endGroup();
|
||||
-#if QT_VERSION <= QT_VERSION_CHECK(5, 12, 0)
|
||||
+#if QT_VERSION <= QT_VERSION_CHECK(5, 6, 0)
|
||||
|
||||
#else
|
||||
for (int i = 0; i < effectList.length(); i++) {
|
||||
@@ -676,7 +677,7 @@ void Theme::writeKwinSettings(bool change, QString theme, bool effect) {
|
||||
kwinSettings->setValue("kwin4_effect_translucencyEnabled", true);
|
||||
kwinSettings->setValue("zoomEnabled", true);
|
||||
kwinSettings->endGroup();
|
||||
-#if QT_VERSION <= QT_VERSION_CHECK(5, 12, 0)
|
||||
+#if QT_VERSION <= QT_VERSION_CHECK(5, 6, 0)
|
||||
|
||||
#else
|
||||
// 开启模糊特效:
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
@ -1,83 +0,0 @@
|
||||
From afa96c48b685bfe217014954aa6ef976cb2df418 Mon Sep 17 00:00:00 2001
|
||||
From: lvhan <lvhan@kylinos.cn>
|
||||
Date: Thu, 21 Jan 2021 11:30:52 +0800
|
||||
Subject: [PATCH] fix blueman tray and groupadd autologin
|
||||
|
||||
---
|
||||
plugins/personalized/desktop/desktop.cpp | 5 ++---
|
||||
registeredQDbus/sysdbusregister.cpp | 28 ++++++++++++++----------
|
||||
2 files changed, 19 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/plugins/personalized/desktop/desktop.cpp b/plugins/personalized/desktop/desktop.cpp
|
||||
index d33d2de..2846244 100644
|
||||
--- a/plugins/personalized/desktop/desktop.cpp
|
||||
+++ b/plugins/personalized/desktop/desktop.cpp
|
||||
@@ -146,14 +146,13 @@ void Desktop::initTranslation() {
|
||||
iconMap.insert("ukui-flash-disk", "drive-removable-media");
|
||||
iconMap.insert("ukui-power-manager-tray", "cs-power");
|
||||
iconMap.insert("fcitx", "fcitx");
|
||||
- iconMap.insert("blueman", "preferences-system-bluetooth");
|
||||
+ iconMap.insert("blueman-tray", "preferences-system-bluetooth");
|
||||
iconMap.insert("kylin-video", "kylin-video");
|
||||
iconMap.insert("kylin-screenshoot", "kylin-screenshoot");
|
||||
iconMap.insert("Onboard", "onboard");
|
||||
|
||||
disList<<"ukui-sidebar"<<"kylin-nm"<<"ukui-volume-control-applet-qt"<<"update-notifier"<<"software-update-available"
|
||||
- <<"blueman-tray"<<"ukui-power-manager"<<"ukui-settings-daemon"<<"blueman-applet"
|
||||
- <<"ErrorApplication"<<"livepatch";
|
||||
+ <<"ukui-power-manager"<<"ukui-settings-daemon"<<"ErrorApplication"<<"livepatch";
|
||||
}
|
||||
|
||||
void Desktop::setupComponent() {
|
||||
diff --git a/registeredQDbus/sysdbusregister.cpp b/registeredQDbus/sysdbusregister.cpp
|
||||
index 670e5e5..58d31db 100644
|
||||
--- a/registeredQDbus/sysdbusregister.cpp
|
||||
+++ b/registeredQDbus/sysdbusregister.cpp
|
||||
@@ -87,12 +87,19 @@ QString SysdbusRegister::getNoPwdLoginStatus(){
|
||||
|
||||
//设置免密登录状态
|
||||
void SysdbusRegister::setNoPwdLoginStatus(bool status,QString username){
|
||||
- systemRun("groupadd -r nopasswdlogin");
|
||||
+ QString filename = "/etc/lightdm/lightdm.conf";
|
||||
+ QSettings Settings(filename, QSettings::IniFormat);
|
||||
+
|
||||
+ Settings.beginGroup("SeatDefaults");
|
||||
+ Settings.setValue("greeter-show-manual-login", "true");
|
||||
+ Settings.endGroup();
|
||||
+
|
||||
+ systemRun("sudo groupadd -r nopasswdlogin");
|
||||
QString cmd;
|
||||
if(true == status){
|
||||
- cmd = QString("gpasswd -a %1 nopasswdlogin").arg(username);
|
||||
+ cmd = QString("sudo gpasswd -a %1 nopasswdlogin").arg(username);
|
||||
} else{
|
||||
- cmd = QString("gpasswd -d %1 nopasswdlogin").arg(username);
|
||||
+ cmd = QString("sudo gpasswd -d %1 nopasswdlogin").arg(username);
|
||||
}
|
||||
systemRun(cmd);
|
||||
}
|
||||
@@ -101,14 +108,13 @@ void SysdbusRegister::setNoPwdLoginStatus(bool status,QString username){
|
||||
void SysdbusRegister::setAutoLoginStatus(QString username)
|
||||
{
|
||||
QString filename = "/etc/lightdm/lightdm.conf";
|
||||
- QSharedPointer<QSettings> autoSettings = QSharedPointer<QSettings>(new QSettings(filename, QSettings::IniFormat));
|
||||
+ QSettings Settings(filename, QSettings::IniFormat);
|
||||
|
||||
- autoSettings->beginGroup("SeatDefaults");
|
||||
- autoSettings->setValue("autologin-user", username);
|
||||
- autoSettings->setValue("autologin-session", "ukui");
|
||||
- autoSettings->endGroup();
|
||||
- autoSettings->sync();
|
||||
+ Settings.beginGroup("SeatDefaults");
|
||||
+ Settings.setValue("autologin-user", username);
|
||||
+ Settings.setValue("autologin-session", "ukui");
|
||||
+ Settings.endGroup();
|
||||
|
||||
- systemRun("groupadd -r autologin");
|
||||
- systemRun(QString("gpasswd -a %1 autologin").arg(username));
|
||||
+ systemRun("sudo groupadd -r autologin");
|
||||
+ systemRun(QString("sudo gpasswd -a %1 autologin").arg(username));
|
||||
}
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
@ -1,248 +0,0 @@
|
||||
From 1113ae6574950d672514621e0f8090d1f1241a72 Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Thu, 8 Jul 2021 13:46:27 +0800
|
||||
Subject: [PATCH] Fix Group members are not displayed
|
||||
|
||||
---
|
||||
.../account/userinfo/creategroupdialog.cpp | 61 +++++++++++++++++-
|
||||
plugins/account/userinfo/creategroupdialog.h | 22 ++++++-
|
||||
plugins/account/userinfo/editgroupdialog.cpp | 62 ++++++++++++++++++-
|
||||
plugins/account/userinfo/editgroupdialog.h | 19 +++++-
|
||||
4 files changed, 155 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/plugins/account/userinfo/creategroupdialog.cpp b/plugins/account/userinfo/creategroupdialog.cpp
|
||||
index 56f7b2c..4507260 100755
|
||||
--- a/plugins/account/userinfo/creategroupdialog.cpp
|
||||
+++ b/plugins/account/userinfo/creategroupdialog.cpp
|
||||
@@ -70,12 +70,67 @@ void CreateGroupDialog::refreshCertainBtnStatus(){
|
||||
ui->certainBtn->setEnabled(_nameHasModified || _idHasModified);
|
||||
}
|
||||
|
||||
+UserInfomationss CreateGroupDialog::_acquireUserInfo(QString objpath){
|
||||
+ UserInfomationss user;
|
||||
+
|
||||
+ //默认值
|
||||
+ user.current = false;
|
||||
+ user.logined = false;
|
||||
+ user.autologin = false;
|
||||
+
|
||||
+ QDBusInterface * iproperty = new QDBusInterface("org.freedesktop.Accounts",
|
||||
+ objpath,
|
||||
+ "org.freedesktop.DBus.Properties",
|
||||
+ QDBusConnection::systemBus());
|
||||
+ QDBusReply<QMap<QString, QVariant> > reply = iproperty->call("GetAll", "org.freedesktop.Accounts.User");
|
||||
+ if (reply.isValid()){
|
||||
+ QMap<QString, QVariant> propertyMap;
|
||||
+ propertyMap = reply.value();
|
||||
+ user.username = propertyMap.find("UserName").value().toString();
|
||||
+ if (user.username == QString(g_get_user_name())) {
|
||||
+ user.current = true;
|
||||
+ user.logined = true;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ qDebug() << "reply failed";
|
||||
+
|
||||
+ delete iproperty;
|
||||
+
|
||||
+ return user;
|
||||
+}
|
||||
+
|
||||
void CreateGroupDialog::getUsersList()
|
||||
{
|
||||
qDebug() << "当前文件 :" << __FILE__ << "当前函数 :" << __FUNCTION__ << "当前行号 :" << __LINE__;
|
||||
- UserInfo * userinfo = new UserInfo;
|
||||
- QStringList usersList = userinfo->getUsersList();
|
||||
-// qDebug() << "CreateGroupDialog::getUsersList" << usersList.at(0) << usersList.at(1);
|
||||
+ QStringList allUsers;
|
||||
+ sysdispatcher = new SystemDbusDispatcher(this);
|
||||
+
|
||||
+ QStringList objectpaths = sysdispatcher->list_cached_users();
|
||||
+ allUserInfoMap.clear();
|
||||
+ //root
|
||||
+ if (!getuid()){
|
||||
+ UserInfomationss root;
|
||||
+ root.username = g_get_user_name();
|
||||
+ root.current = true;
|
||||
+ root.logined = true;
|
||||
+ root.autologin = false;
|
||||
+ root.uid = 0;
|
||||
+ root.accounttype = ADMINISTRATOR;
|
||||
+ // root.iconfile = DEFAULTFACE;
|
||||
+ allUserInfoMap.insert(root.username, root);
|
||||
+ }
|
||||
+ for (QString objectpath : objectpaths){
|
||||
+ UserInfomationss user;
|
||||
+ user = _acquireUserInfo(objectpath);
|
||||
+ allUserInfoMap.insert(user.username, user);
|
||||
+ }
|
||||
+ for (QVariant tmp : allUserInfoMap.keys()){
|
||||
+ allUsers << tmp.toString();
|
||||
+
|
||||
+ }
|
||||
+ QStringList usersList = allUsers;
|
||||
+
|
||||
for(int i = 0; i < usersList.size(); i++){
|
||||
QListWidgetItem * item = new QListWidgetItem(ui->listWidget);
|
||||
item->setSizeHint(QSize(ui->listWidget->width(), 36));
|
||||
diff --git a/plugins/account/userinfo/creategroupdialog.h b/plugins/account/userinfo/creategroupdialog.h
|
||||
index e0432fc..1ca0225 100755
|
||||
--- a/plugins/account/userinfo/creategroupdialog.h
|
||||
+++ b/plugins/account/userinfo/creategroupdialog.h
|
||||
@@ -30,7 +30,22 @@
|
||||
#include <QLineEdit>
|
||||
#include <QListWidget>
|
||||
|
||||
-class UserInfo;
|
||||
+#include "qtdbus/systemdbusdispatcher.h"
|
||||
+
|
||||
+typedef struct _UserInfomationss {
|
||||
+ QString objpath;
|
||||
+ QString username;
|
||||
+ QString iconfile;
|
||||
+ QString passwd;
|
||||
+ int accounttype;
|
||||
+ int passwdtype;
|
||||
+ bool current;
|
||||
+ bool logined;
|
||||
+ bool autologin;
|
||||
+ bool noPwdLogin;
|
||||
+ qint64 uid;
|
||||
+}UserInfomationss;
|
||||
+
|
||||
class ChangeGroupDialog;
|
||||
namespace Ui {
|
||||
class CreateGroupDialog;
|
||||
@@ -62,9 +77,12 @@ private:
|
||||
bool _nameHasModified;
|
||||
bool _idHasModified;
|
||||
bool _boxModified;
|
||||
-
|
||||
+ QMap<QString, UserInfomationss> allUserInfoMap;
|
||||
+ SystemDbusDispatcher * sysdispatcher;
|
||||
+
|
||||
void setupInit();
|
||||
void signalsBind();
|
||||
+ UserInfomationss _acquireUserInfo(QString objpath);
|
||||
};
|
||||
|
||||
#endif // CREATEGROUPDIALOG_H
|
||||
diff --git a/plugins/account/userinfo/editgroupdialog.cpp b/plugins/account/userinfo/editgroupdialog.cpp
|
||||
index a90b9cd..d3971cd 100755
|
||||
--- a/plugins/account/userinfo/editgroupdialog.cpp
|
||||
+++ b/plugins/account/userinfo/editgroupdialog.cpp
|
||||
@@ -73,11 +73,67 @@ void EditGroupDialog::refreshCertainBtnStatus(){
|
||||
ui->certainBtn->setEnabled(_nameHasModified || _idHasModified || _boxModified);
|
||||
}
|
||||
|
||||
+UserInfomations EditGroupDialog::_acquireUserInfo(QString objpath){
|
||||
+ UserInfomations user;
|
||||
+
|
||||
+ //默认值
|
||||
+ user.current = false;
|
||||
+ user.logined = false;
|
||||
+ user.autologin = false;
|
||||
+
|
||||
+ QDBusInterface * iproperty = new QDBusInterface("org.freedesktop.Accounts",
|
||||
+ objpath,
|
||||
+ "org.freedesktop.DBus.Properties",
|
||||
+ QDBusConnection::systemBus());
|
||||
+ QDBusReply<QMap<QString, QVariant> > reply = iproperty->call("GetAll", "org.freedesktop.Accounts.User");
|
||||
+ if (reply.isValid()){
|
||||
+ QMap<QString, QVariant> propertyMap;
|
||||
+ propertyMap = reply.value();
|
||||
+ user.username = propertyMap.find("UserName").value().toString();
|
||||
+ if (user.username == QString(g_get_user_name())) {
|
||||
+ user.current = true;
|
||||
+ user.logined = true;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ qDebug() << "reply failed";
|
||||
+
|
||||
+ delete iproperty;
|
||||
+
|
||||
+ return user;
|
||||
+}
|
||||
+
|
||||
+
|
||||
void EditGroupDialog::getUsersList(QString usergroup)
|
||||
{
|
||||
- UserInfo * userinfo = new UserInfo;
|
||||
- QStringList usersList = userinfo->getUsersList();
|
||||
- qDebug() << "EditGroupDialog::getUsersList";
|
||||
+ QStringList usergroupList = usergroup.split(",");
|
||||
+ QStringList allUsers;
|
||||
+ sysdispatcher = new SystemDbusDispatcher(this);
|
||||
+
|
||||
+ QStringList objectpaths = sysdispatcher->list_cached_users();
|
||||
+ allUserInfoMap.clear();
|
||||
+ //root
|
||||
+ if (!getuid()){
|
||||
+ UserInfomations root;
|
||||
+ root.username = g_get_user_name();
|
||||
+ root.current = true;
|
||||
+ root.logined = true;
|
||||
+ root.autologin = false;
|
||||
+ root.uid = 0;
|
||||
+ root.accounttype = ADMINISTRATOR;
|
||||
+ // root.iconfile = DEFAULTFACE;
|
||||
+ allUserInfoMap.insert(root.username, root);
|
||||
+ }
|
||||
+ for (QString objectpath : objectpaths){
|
||||
+ UserInfomations user;
|
||||
+ user = _acquireUserInfo(objectpath);
|
||||
+ allUserInfoMap.insert(user.username, user);
|
||||
+ }
|
||||
+ for (QVariant tmp : allUserInfoMap.keys()){
|
||||
+ allUsers << tmp.toString();
|
||||
+
|
||||
+ }
|
||||
+ QStringList usersList = allUsers;
|
||||
QStringList usergroupList = usergroup.split(",");
|
||||
|
||||
for(int i = 0; i < usersList.size(); i++){
|
||||
diff --git a/plugins/account/userinfo/editgroupdialog.h b/plugins/account/userinfo/editgroupdialog.h
|
||||
index 9a065fb..b66ea55 100755
|
||||
--- a/plugins/account/userinfo/editgroupdialog.h
|
||||
+++ b/plugins/account/userinfo/editgroupdialog.h
|
||||
@@ -29,8 +29,22 @@
|
||||
#include <QRegExpValidator>
|
||||
#include <QLineEdit>
|
||||
#include <QListWidget>
|
||||
+#include "qtdbus/systemdbusdispatcher.h"
|
||||
+
|
||||
+typedef struct _UserInfomations {
|
||||
+ QString objpath;
|
||||
+ QString username;
|
||||
+ QString iconfile;
|
||||
+ QString passwd;
|
||||
+ int accounttype;
|
||||
+ int passwdtype;
|
||||
+ bool current;
|
||||
+ bool logined;
|
||||
+ bool autologin;
|
||||
+ bool noPwdLogin;
|
||||
+ qint64 uid;
|
||||
+}UserInfomations;
|
||||
|
||||
-class UserInfo;
|
||||
class ChangeGroupDialog;
|
||||
namespace Ui {
|
||||
class EditGroupDialog;
|
||||
@@ -63,9 +77,12 @@ private:
|
||||
bool _boxModified;
|
||||
QString userGroup;
|
||||
QString groupId;
|
||||
+ QMap<QString, UserInfomations> allUserInfoMap;
|
||||
+ SystemDbusDispatcher * sysdispatcher;
|
||||
|
||||
void setupInit();
|
||||
void signalsBind();
|
||||
+ UserInfomations _acquireUserInfo(QString objpath);
|
||||
|
||||
signals:
|
||||
void needRefresh();
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,86 +0,0 @@
|
||||
From 575c32022d326eb391054c0608d5fc82cebb9281 Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Fri, 9 Jul 2021 16:55:22 +0800
|
||||
Subject: [PATCH] fix vnc crashed
|
||||
|
||||
---
|
||||
plugins/system/display/display.cpp | 30 ++++++++++++++++++++++++++++++
|
||||
plugins/system/display/display.h | 4 +++-
|
||||
2 files changed, 33 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plugins/system/display/display.cpp b/plugins/system/display/display.cpp
|
||||
index de931b6..383c564 100755
|
||||
--- a/plugins/system/display/display.cpp
|
||||
+++ b/plugins/system/display/display.cpp
|
||||
@@ -25,6 +25,8 @@
|
||||
#include <KF5/KScreen/kscreen/getconfigoperation.h>
|
||||
#include <KF5/KScreen/kscreen/output.h>
|
||||
#include <QDebug>
|
||||
+#include <QDBusInterface>
|
||||
+#include <QDBusConnection>
|
||||
|
||||
DisplaySet::DisplaySet(){
|
||||
pluginWidget = new Widget;
|
||||
@@ -43,6 +45,15 @@ DisplaySet::~DisplaySet(){
|
||||
}
|
||||
|
||||
QWidget *DisplaySet::get_plugin_ui(){
|
||||
+ if (mFirstLoad) {
|
||||
+ requestBackend();
|
||||
+ mFirstLoad = false;
|
||||
+ pluginWidget = new Widget;
|
||||
+ QObject::connect(new KScreen::GetConfigOperation(), &KScreen::GetConfigOperation::finished,
|
||||
+ [&](KScreen::ConfigOperation *op) {
|
||||
+ pluginWidget->setConfig(qobject_cast<KScreen::GetConfigOperation*>(op)->config());
|
||||
+ });
|
||||
+ }
|
||||
return pluginWidget;
|
||||
}
|
||||
|
||||
@@ -63,3 +74,22 @@ const QString DisplaySet::name() const {
|
||||
return QStringLiteral("display");
|
||||
}
|
||||
|
||||
+void DisplaySet::requestBackend() {
|
||||
+
|
||||
+ QDBusInterface screenIft("org.kde.KScreen",
|
||||
+ "/",
|
||||
+ "org.kde.KScreen",
|
||||
+ QDBusConnection::sessionBus());
|
||||
+ if (!screenIft.isValid()) {
|
||||
+ QProcess process;
|
||||
+ process.start("uname -m");
|
||||
+ process.waitForFinished();
|
||||
+ QString output = process.readAll();
|
||||
+ output = output.simplified();
|
||||
+
|
||||
+ QString command = "/usr/lib/" + output + "-linux-gnu" +"/libexec/kf5/kscreen_backend_launcher";
|
||||
+ QProcess::startDetached(command);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
diff --git a/plugins/system/display/display.h b/plugins/system/display/display.h
|
||||
index e4f4fbd..b30e9bb 100755
|
||||
--- a/plugins/system/display/display.h
|
||||
+++ b/plugins/system/display/display.h
|
||||
@@ -47,13 +47,15 @@ public:
|
||||
void plugin_delay_control() Q_DECL_OVERRIDE;
|
||||
const QString name() const Q_DECL_OVERRIDE;
|
||||
|
||||
-
|
||||
+private:
|
||||
+ void requestBackend();
|
||||
private:
|
||||
Ui::DisplayWindow * ui;
|
||||
QString pluginName;
|
||||
int pluginType;
|
||||
Widget * pluginWidget;
|
||||
|
||||
+ bool mFirstLoad;
|
||||
};
|
||||
|
||||
#endif // DISPLAYSET_H
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From 56214c5b07f2917c6128b3d923d80af49f1b05c3 Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Fri, 9 Jul 2021 17:44:31 +0800
|
||||
Subject: [PATCH] fix redeclaration of 'QStringList usergroupList in
|
||||
editgroupdialog.cpp
|
||||
|
||||
---
|
||||
plugins/account/userinfo/editgroupdialog.cpp | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/plugins/account/userinfo/editgroupdialog.cpp b/plugins/account/userinfo/editgroupdialog.cpp
|
||||
index d3971cd..4cc3bc6 100755
|
||||
--- a/plugins/account/userinfo/editgroupdialog.cpp
|
||||
+++ b/plugins/account/userinfo/editgroupdialog.cpp
|
||||
@@ -134,7 +134,6 @@ void EditGroupDialog::getUsersList(QString usergroup)
|
||||
|
||||
}
|
||||
QStringList usersList = allUsers;
|
||||
- QStringList usergroupList = usergroup.split(",");
|
||||
|
||||
for(int i = 0; i < usersList.size(); i++){
|
||||
QListWidgetItem * item = new QListWidgetItem(ui->listWidget);
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
From d5fb1fd93c7733ca0a2111c349149a8fe44926d2 Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Mon, 12 Jul 2021 09:26:23 +0800
|
||||
Subject: [PATCH] fix layout optimization
|
||||
|
||||
---
|
||||
plugins/system/autoboot/addautoboot.ui | 20 ++------------------
|
||||
1 file changed, 2 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/plugins/system/autoboot/addautoboot.ui b/plugins/system/autoboot/addautoboot.ui
|
||||
index 4e04bfa..e778c84 100755
|
||||
--- a/plugins/system/autoboot/addautoboot.ui
|
||||
+++ b/plugins/system/autoboot/addautoboot.ui
|
||||
@@ -255,8 +255,8 @@
|
||||
<widget class="QLineEdit" name="execLineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
- <width>182</width>
|
||||
- <height>28</height>
|
||||
+ <width>190</width>
|
||||
+ <height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
@@ -346,22 +346,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
- <item>
|
||||
- <spacer name="verticalSpacer">
|
||||
- <property name="orientation">
|
||||
- <enum>Qt::Vertical</enum>
|
||||
- </property>
|
||||
- <property name="sizeType">
|
||||
- <enum>QSizePolicy::Fixed</enum>
|
||||
- </property>
|
||||
- <property name="sizeHint" stdset="0">
|
||||
- <size>
|
||||
- <width>20</width>
|
||||
- <height>48</height>
|
||||
- </size>
|
||||
- </property>
|
||||
- </spacer>
|
||||
- </item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
--
|
||||
2.23.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,453 +0,0 @@
|
||||
From 1ed0391590fb670596523e2ce1df224c1f105769 Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Mon, 12 Jul 2021 13:59:08 +0800
|
||||
Subject: [PATCH] power add sleep function
|
||||
|
||||
---
|
||||
commonComponent/ComboxFrame/comboxframe.cpp | 21 ++++++
|
||||
commonComponent/ComboxFrame/comboxframe.h | 29 ++++++++
|
||||
commonComponent/comboxframe.pri | 7 ++
|
||||
plugins/system/power/power.cpp | 78 ++++++++++++++++++++-
|
||||
plugins/system/power/power.h | 16 +++++
|
||||
plugins/system/power/power.pro | 3 +-
|
||||
plugins/system/power/power.ui | 15 +---
|
||||
plugins/system/power/powermacrodata.h | 1 +
|
||||
registeredQDbus/sysdbusregister.cpp | 44 ++++++++----
|
||||
registeredQDbus/sysdbusregister.h | 13 ++--
|
||||
10 files changed, 193 insertions(+), 34 deletions(-)
|
||||
create mode 100644 commonComponent/ComboxFrame/comboxframe.cpp
|
||||
create mode 100644 commonComponent/ComboxFrame/comboxframe.h
|
||||
create mode 100644 commonComponent/comboxframe.pri
|
||||
|
||||
diff --git a/commonComponent/ComboxFrame/comboxframe.cpp b/commonComponent/ComboxFrame/comboxframe.cpp
|
||||
new file mode 100644
|
||||
index 0000000..aba3553
|
||||
--- /dev/null
|
||||
+++ b/commonComponent/ComboxFrame/comboxframe.cpp
|
||||
@@ -0,0 +1,21 @@
|
||||
+#include "comboxframe.h"
|
||||
+
|
||||
+ComboxFrame::ComboxFrame(QString labelStr, QWidget *parent) : mTitleName(labelStr), QFrame(parent) {
|
||||
+
|
||||
+ this->setMinimumSize(550, 50);
|
||||
+ this->setMaximumSize(960, 50);
|
||||
+ this->setFrameShape(QFrame::Shape::Box);
|
||||
+
|
||||
+ mTitleLabel = new QLabel(mTitleName, this);
|
||||
+ mCombox = new QComboBox(this);
|
||||
+
|
||||
+ mHLayout = new QHBoxLayout(this);
|
||||
+ mHLayout->addWidget(mTitleLabel);
|
||||
+ mHLayout->addWidget(mCombox);
|
||||
+
|
||||
+ this->setLayout(mHLayout);
|
||||
+}
|
||||
+
|
||||
+ComboxFrame::~ComboxFrame() {
|
||||
+
|
||||
+}
|
||||
diff --git a/commonComponent/ComboxFrame/comboxframe.h b/commonComponent/ComboxFrame/comboxframe.h
|
||||
new file mode 100644
|
||||
index 0000000..d6f2679
|
||||
--- /dev/null
|
||||
+++ b/commonComponent/ComboxFrame/comboxframe.h
|
||||
@@ -0,0 +1,29 @@
|
||||
+#ifndef COMBOXFRAME_H
|
||||
+#define COMBOXFRAME_H
|
||||
+
|
||||
+#include <QWidget>
|
||||
+#include <QObject>
|
||||
+#include <QLabel>
|
||||
+#include <QComboBox>
|
||||
+#include <QFrame>
|
||||
+#include <QHBoxLayout>
|
||||
+
|
||||
+class ComboxFrame : public QFrame
|
||||
+{
|
||||
+ Q_OBJECT
|
||||
+public:
|
||||
+ ComboxFrame(QString labelStr, QWidget *parent = nullptr);
|
||||
+ ~ComboxFrame();
|
||||
+
|
||||
+public:
|
||||
+ QComboBox *mCombox;
|
||||
+
|
||||
+private:
|
||||
+ QLabel *mTitleLabel;
|
||||
+ QHBoxLayout *mHLayout;
|
||||
+ QString mTitleName;
|
||||
+
|
||||
+signals:
|
||||
+};
|
||||
+
|
||||
+#endif // COMBOXFRAME_H
|
||||
diff --git a/commonComponent/comboxframe.pri b/commonComponent/comboxframe.pri
|
||||
new file mode 100644
|
||||
index 0000000..e1399d5
|
||||
--- /dev/null
|
||||
+++ b/commonComponent/comboxframe.pri
|
||||
@@ -0,0 +1,7 @@
|
||||
+#LIBINTERFACE_NAME = $$qtLibraryTarget(comboxframe)
|
||||
+
|
||||
+SOURCES += \
|
||||
+ $$PWD/ComboxFrame/comboxframe.cpp \
|
||||
+
|
||||
+HEADERS += \
|
||||
+ $$PWD/ComboxFrame/comboxframe.h \
|
||||
diff --git a/plugins/system/power/power.cpp b/plugins/system/power/power.cpp
|
||||
index ac35f93..52d1168 100755
|
||||
--- a/plugins/system/power/power.cpp
|
||||
+++ b/plugins/system/power/power.cpp
|
||||
@@ -22,6 +22,10 @@
|
||||
#include "powermacrodata.h"
|
||||
|
||||
#include <QDebug>
|
||||
+#include <QDBusInterface>
|
||||
+#include <QDBusReply>
|
||||
+#include <QDBusConnection>
|
||||
+#include <QSettings>
|
||||
|
||||
typedef enum {
|
||||
BALANCE,
|
||||
@@ -45,6 +49,9 @@ const int COMPUTER_BALANCE = 30 * 60;
|
||||
const int DISPLAY_SAVING = 20 * 60;
|
||||
const int COMPUTER_SAVING = 2 * 60 * 60;
|
||||
|
||||
+const QStringList kHibernate { QObject::tr("Never"),QObject::tr("10min"), QObject::tr("20min"),
|
||||
+ QObject::tr("40min"), QObject::tr("80min")};
|
||||
+
|
||||
Power::Power() {
|
||||
ui = new Ui::Power;
|
||||
pluginWidget = new QWidget;
|
||||
@@ -59,11 +66,17 @@ Power::Power() {
|
||||
|
||||
const QByteArray id(POWERMANAGER_SCHEMA);
|
||||
|
||||
+ initDbus();
|
||||
setupComponent();
|
||||
isPowerSupply();
|
||||
if (QGSettings::isSchemaInstalled(id)) {
|
||||
settings = new QGSettings(id, QByteArray(), this);
|
||||
- initModeStatus();
|
||||
+
|
||||
+ mPowerKeys = settings->keys();
|
||||
+
|
||||
+ initGeneralSet();
|
||||
+
|
||||
+ initModeStatus();
|
||||
setupConnect();
|
||||
initPowerOtherStatus();
|
||||
} else {
|
||||
@@ -126,6 +139,7 @@ void Power::isPowerSupply() {
|
||||
ui->closeLidFrame->setVisible(false);
|
||||
ui->title2Label->setVisible(false);
|
||||
ui->iconFrame->setVisible(false);
|
||||
+ ui->verticalSpacer_2->changeSize(0, 0);
|
||||
} else {
|
||||
qDebug() << "brightness info is valid";
|
||||
isExitsPower = true ;
|
||||
@@ -134,6 +148,10 @@ void Power::isPowerSupply() {
|
||||
}
|
||||
}
|
||||
|
||||
+void Power::setHibernateTime(QString hibernate) {
|
||||
+ mUkccInterface->call("setSuspendThenHibernate", hibernate);
|
||||
+}
|
||||
+
|
||||
void Power::setupComponent() {
|
||||
//
|
||||
ui->powerModeBtnGroup->setId(ui->balanceRadioBtn, BALANCE);
|
||||
@@ -453,3 +471,61 @@ void Power::refreshUI() {
|
||||
// ui->customWidget->setStyleSheet("QWidget{background: #F4F4F4; border-top-left-radius: 6px; border-top-right-radius: 6px;}");
|
||||
}
|
||||
}
|
||||
+
|
||||
+void Power::initGeneralSet() {
|
||||
+ if (getHibernateStatus() && mPowerKeys.contains("afterIdleAction")) {
|
||||
+ mHibernate = new ComboxFrame(tr("After suspending this time, the system will go to sleep:"), pluginWidget);
|
||||
+
|
||||
+ ui->powerLayout->addWidget(new QLabel(tr("General Settings")));
|
||||
+ ui->powerLayout->addWidget(mHibernate);
|
||||
+
|
||||
+ ui->powerLayout->addStretch();
|
||||
+
|
||||
+ for(int i = 0; i < kHibernate.length(); i++) {
|
||||
+ mHibernate->mCombox->addItem(kHibernate.at(i));
|
||||
+ }
|
||||
+
|
||||
+ if (getHibernateTime().isEmpty()) {
|
||||
+ mHibernate->mCombox->setCurrentIndex(0);
|
||||
+ } else {
|
||||
+ mHibernate->mCombox->setCurrentText(getHibernateTime());
|
||||
+ }
|
||||
+
|
||||
+ connect(mHibernate->mCombox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](int index) {
|
||||
+ setHibernateTime(mHibernate->mCombox->currentText());
|
||||
+ if (index) {
|
||||
+ settings->set(HIBERNATE_KEY, "suspend-then-hibernate");
|
||||
+ } else {
|
||||
+ settings->set(HIBERNATE_KEY, "suspend");
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+bool Power::getHibernateStatus() {
|
||||
+
|
||||
+ QDBusInterface loginInterface("org.freedesktop.login1",
|
||||
+ "/org/freedesktop/login1",
|
||||
+ "org.freedesktop.login1.Manager",
|
||||
+ QDBusConnection::systemBus());
|
||||
+
|
||||
+ if (loginInterface.isValid()) {
|
||||
+ QDBusReply<QString> reply = loginInterface.call("CanSuspendThenHibernate");
|
||||
+ return reply.value() == "yes" ? true : false;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+QString Power::getHibernateTime() {
|
||||
+ QDBusReply<QString> hibernateTime = mUkccInterface->call("getSuspendThenHibernate");
|
||||
+ if (hibernateTime.isValid()) {
|
||||
+ return hibernateTime.value();
|
||||
+ }
|
||||
+ return "";
|
||||
+}
|
||||
+
|
||||
+void Power::initDbus() {
|
||||
+ mUkccInterface = new QDBusInterface("com.control.center.qt.systemdbus",
|
||||
+ "/",
|
||||
+ "com.control.center.interface",
|
||||
+ QDBusConnection::systemBus());
|
||||
+}
|
||||
diff --git a/plugins/system/power/power.h b/plugins/system/power/power.h
|
||||
index d6d5d1d..b4da6e4 100755
|
||||
--- a/plugins/system/power/power.h
|
||||
+++ b/plugins/system/power/power.h
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#include "shell/interface.h"
|
||||
|
||||
+#include "commonComponent/ComboxFrame/comboxframe.h"
|
||||
+
|
||||
namespace Ui {
|
||||
class Power;
|
||||
}
|
||||
@@ -78,9 +80,23 @@ private:
|
||||
QStringList lidStringList;
|
||||
QStringList buttonStringList;
|
||||
QStringList iconShowList;
|
||||
+
|
||||
+ QStringList mPowerKeys;
|
||||
|
||||
bool settingsCreate;
|
||||
bool isExitsPower;
|
||||
+
|
||||
+ ComboxFrame *mHibernate;
|
||||
+ QDBusInterface *mUkccInterface;
|
||||
+
|
||||
+private:
|
||||
+ void initGeneralSet();
|
||||
+ bool getHibernateStatus();
|
||||
+ QString getHibernateTime();
|
||||
+ void initDbus();
|
||||
+
|
||||
+private slots:
|
||||
+ void setHibernateTime(QString hibernate);
|
||||
};
|
||||
|
||||
#endif // POWER_H
|
||||
diff --git a/plugins/system/power/power.pro b/plugins/system/power/power.pro
|
||||
index f417bc4..795ac94 100755
|
||||
--- a/plugins/system/power/power.pro
|
||||
+++ b/plugins/system/power/power.pro
|
||||
@@ -1,8 +1,9 @@
|
||||
+include(../../../env.pri)
|
||||
QT += widgets dbus
|
||||
TEMPLATE = lib
|
||||
CONFIG += plugin
|
||||
|
||||
-include(../../../env.pri)
|
||||
+include($$PROJECT_COMPONENTSOURCE/comboxframe.pri)
|
||||
|
||||
TARGET = $$qtLibraryTarget(power)
|
||||
DESTDIR = ../..
|
||||
diff --git a/plugins/system/power/power.ui b/plugins/system/power/power.ui
|
||||
index aea2b2a..e8be31d 100755
|
||||
--- a/plugins/system/power/power.ui
|
||||
+++ b/plugins/system/power/power.ui
|
||||
@@ -72,7 +72,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
- <layout class="QVBoxLayout" name="verticalLayout">
|
||||
+ <layout class="QVBoxLayout" name="powerLayout">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
@@ -1127,19 +1127,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
- <item>
|
||||
- <spacer name="verticalSpacer_3">
|
||||
- <property name="orientation">
|
||||
- <enum>Qt::Vertical</enum>
|
||||
- </property>
|
||||
- <property name="sizeHint" stdset="0">
|
||||
- <size>
|
||||
- <width>20</width>
|
||||
- <height>40</height>
|
||||
- </size>
|
||||
- </property>
|
||||
- </spacer>
|
||||
- </item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
diff --git a/plugins/system/power/powermacrodata.h b/plugins/system/power/powermacrodata.h
|
||||
index 65fc099..208d8c7 100755
|
||||
--- a/plugins/system/power/powermacrodata.h
|
||||
+++ b/plugins/system/power/powermacrodata.h
|
||||
@@ -32,6 +32,7 @@
|
||||
#define BUTTON_SUSPEND_KEY "button-suspend"
|
||||
#define BUTTON_POWER_KEY "button-power"
|
||||
#define IDLE_DIM_TIME_KEY "idle-dim-time"
|
||||
+#define HIBERNATE_KEY "after-idle-action"
|
||||
|
||||
#define PRESENT_VALUE "present"
|
||||
#define ALWAYS_VALUE "always"
|
||||
diff --git a/registeredQDbus/sysdbusregister.cpp b/registeredQDbus/sysdbusregister.cpp
|
||||
index 58d31db..54c2509 100755
|
||||
--- a/registeredQDbus/sysdbusregister.cpp
|
||||
+++ b/registeredQDbus/sysdbusregister.cpp
|
||||
@@ -20,30 +20,26 @@
|
||||
#include "sysdbusregister.h"
|
||||
|
||||
#include <QDebug>
|
||||
-#include <QSettings>
|
||||
#include <QSharedPointer>
|
||||
+#include <QRegExp>
|
||||
+#include <stdlib.h>
|
||||
|
||||
SysdbusRegister::SysdbusRegister()
|
||||
{
|
||||
+ mHibernateFile = "/etc/systemd/sleep.conf";
|
||||
+ mHibernateSet = new QSettings(mHibernateFile, QSettings::IniFormat, this);
|
||||
+ mHibernateSet->setIniCodec("UTF-8");
|
||||
}
|
||||
|
||||
SysdbusRegister::~SysdbusRegister()
|
||||
{
|
||||
}
|
||||
|
||||
-//QString SysdbusRegister::name () const{
|
||||
-// return m_name;
|
||||
-//}
|
||||
-
|
||||
-//void SysdbusRegister::SetName(QString name){
|
||||
-// m_name = name;
|
||||
-//}
|
||||
-
|
||||
-void SysdbusRegister::exitService(){
|
||||
+void SysdbusRegister::exitService() {
|
||||
qApp->exit(0);
|
||||
}
|
||||
|
||||
-QString SysdbusRegister::GetComputerInfo(){
|
||||
+QString SysdbusRegister::GetComputerInfo() {
|
||||
QByteArray ba;
|
||||
FILE * fp = NULL;
|
||||
char cmd[128];
|
||||
@@ -86,7 +82,7 @@ QString SysdbusRegister::getNoPwdLoginStatus(){
|
||||
}
|
||||
|
||||
//设置免密登录状态
|
||||
-void SysdbusRegister::setNoPwdLoginStatus(bool status,QString username){
|
||||
+void SysdbusRegister::setNoPwdLoginStatus(bool status,QString username) {
|
||||
QString filename = "/etc/lightdm/lightdm.conf";
|
||||
QSettings Settings(filename, QSettings::IniFormat);
|
||||
|
||||
@@ -105,8 +101,7 @@ void SysdbusRegister::setNoPwdLoginStatus(bool status,QString username){
|
||||
}
|
||||
|
||||
// 设置自动登录状态
|
||||
-void SysdbusRegister::setAutoLoginStatus(QString username)
|
||||
-{
|
||||
+void SysdbusRegister::setAutoLoginStatus(QString username) {
|
||||
QString filename = "/etc/lightdm/lightdm.conf";
|
||||
QSettings Settings(filename, QSettings::IniFormat);
|
||||
|
||||
@@ -118,3 +113,24 @@ void SysdbusRegister::setAutoLoginStatus(QString username)
|
||||
systemRun("sudo groupadd -r autologin");
|
||||
systemRun(QString("sudo gpasswd -a %1 autologin").arg(username));
|
||||
}
|
||||
+
|
||||
+
|
||||
+QString SysdbusRegister::getSuspendThenHibernate() {
|
||||
+ mHibernateSet->beginGroup("Sleep");
|
||||
+
|
||||
+ QString time = mHibernateSet->value("HibernateDelaySec").toString();
|
||||
+
|
||||
+ mHibernateSet->endGroup();
|
||||
+ mHibernateSet->sync();
|
||||
+
|
||||
+ return time;
|
||||
+}
|
||||
+
|
||||
+void SysdbusRegister::setSuspendThenHibernate(QString time) {
|
||||
+ mHibernateSet->beginGroup("Sleep");
|
||||
+
|
||||
+ mHibernateSet->setValue("HibernateDelaySec", time);
|
||||
+
|
||||
+ mHibernateSet->endGroup();
|
||||
+ mHibernateSet->sync();
|
||||
+}
|
||||
diff --git a/registeredQDbus/sysdbusregister.h b/registeredQDbus/sysdbusregister.h
|
||||
index 8bfc94f..df75d2d 100755
|
||||
--- a/registeredQDbus/sysdbusregister.h
|
||||
+++ b/registeredQDbus/sysdbusregister.h
|
||||
@@ -23,8 +23,8 @@
|
||||
#include <QObject>
|
||||
#include <QCoreApplication>
|
||||
#include <QProcess>
|
||||
-
|
||||
#include <QFile>
|
||||
+#include <QSettings>
|
||||
|
||||
class SysdbusRegister : public QObject
|
||||
{
|
||||
@@ -37,15 +37,15 @@ public:
|
||||
~SysdbusRegister();
|
||||
|
||||
private:
|
||||
-// QString m_name;
|
||||
+ QString mHibernateFile;
|
||||
+
|
||||
+ QSettings *mHibernateSet;
|
||||
|
||||
signals:
|
||||
Q_SCRIPTABLE void nameChanged(QString);
|
||||
Q_SCRIPTABLE void computerinfo(QString);
|
||||
|
||||
public slots:
|
||||
-// Q_SCRIPTABLE QString name() const;
|
||||
-// Q_SCRIPTABLE void SetName(QString name);
|
||||
|
||||
Q_SCRIPTABLE void exitService();
|
||||
Q_SCRIPTABLE QString GetComputerInfo();
|
||||
@@ -59,7 +59,12 @@ public slots:
|
||||
|
||||
//设置自动登录状态
|
||||
Q_SCRIPTABLE void setAutoLoginStatus(QString username);
|
||||
+
|
||||
+ // 获取挂起到休眠时间
|
||||
+ Q_SCRIPTABLE QString getSuspendThenHibernate();
|
||||
|
||||
+ // 设置挂起到休眠时间
|
||||
+ Q_SCRIPTABLE void setSuspendThenHibernate(QString time);
|
||||
};
|
||||
|
||||
#endif // SYSDBUSREGISTER_H
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,230 +0,0 @@
|
||||
From 4488d85f9e7326a021ed2bed6811bd20c3c05dba Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
Date: Tue, 13 Jul 2021 09:50:49 +0800
|
||||
Subject: [PATCH] window add title icon
|
||||
|
||||
---
|
||||
shell/customstyle.cpp | 10 +++++++++-
|
||||
shell/mainwindow.cpp | 44 +++++++++++++++++++++++++------------------
|
||||
shell/mainwindow.h | 1 +
|
||||
shell/mainwindow.ui | 4 ++--
|
||||
shell/prescene.cpp | 14 +++++++++++++-
|
||||
shell/prescene.h | 1 +
|
||||
6 files changed, 52 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/shell/customstyle.cpp b/shell/customstyle.cpp
|
||||
index 0718c2e..82ae674 100755
|
||||
--- a/shell/customstyle.cpp
|
||||
+++ b/shell/customstyle.cpp
|
||||
@@ -138,7 +138,6 @@ void InternalStyle::drawComplexControl(QStyle::ComplexControl control, const QSt
|
||||
void InternalStyle::polish(QPalette &pal)
|
||||
{
|
||||
QProxyStyle::polish(pal);
|
||||
- pal.setColor(QPalette::Window, pal.base().color());
|
||||
pal.setColor(QPalette::Inactive, QPalette::Base, pal.base().color());
|
||||
// pal.setColor(QPalette::Button, pal.alternateBase().color());
|
||||
}
|
||||
@@ -151,4 +150,13 @@ void InternalStyle::polish(QWidget *widget)
|
||||
pal.setColor(QPalette::Base, pal.alternateBase().color());
|
||||
widget->setPalette(pal);
|
||||
}
|
||||
+
|
||||
+ // 跳过左侧边栏处理
|
||||
+ if (widget && widget->objectName() == "leftsidebarWidget") {
|
||||
+
|
||||
+ } else if (widget){
|
||||
+ QPalette paltte = widget->palette();
|
||||
+ paltte.setColor(QPalette::Window, paltte.base().color());
|
||||
+ widget->setPalette(paltte);
|
||||
+ }
|
||||
}
|
||||
diff --git a/shell/mainwindow.cpp b/shell/mainwindow.cpp
|
||||
index a85b68a..9a602ef 100755
|
||||
--- a/shell/mainwindow.cpp
|
||||
+++ b/shell/mainwindow.cpp
|
||||
@@ -368,6 +368,7 @@ void MainWindow::initUI() {
|
||||
//左上角显示字符/返回按钮
|
||||
backBtn->setVisible(index);
|
||||
titleLabel->setHidden(index);
|
||||
+ mTitleIcon->setHidden(index);
|
||||
|
||||
if (index){ //首页部分组件样式
|
||||
//中部内容区域
|
||||
@@ -416,7 +417,8 @@ void MainWindow::initUI() {
|
||||
|
||||
void MainWindow::initTileBar() {
|
||||
|
||||
- ui->titleLayout->setContentsMargins(9, 9, 9, 0);
|
||||
+ ui->titleLayout->setContentsMargins(4, 4, 4, 0);
|
||||
+ ui->titleLayout->setSpacing(0);
|
||||
m_searchWidget = new SearchWidget(this);
|
||||
// char style[100];
|
||||
// sprintf(style, "SearchWidget{border:0px;background-color:palette(base);border-radius:8px;}",
|
||||
@@ -428,10 +430,9 @@ void MainWindow::initTileBar() {
|
||||
m_queryWid=new QWidget;
|
||||
m_queryWid->setParent(m_searchWidget);
|
||||
m_queryWid->setFocusPolicy(Qt::NoFocus);
|
||||
-// m_queryWid->setStyleSheet("border:0px;background:transparent");
|
||||
|
||||
QHBoxLayout* queryWidLayout = new QHBoxLayout;
|
||||
- queryWidLayout->setContentsMargins(4,4,0,0);
|
||||
+ queryWidLayout->setContentsMargins(0, 0, 0, 0);
|
||||
queryWidLayout->setAlignment(Qt::AlignJustify);
|
||||
queryWidLayout->setSpacing(0);
|
||||
m_queryWid->setLayout(queryWidLayout);
|
||||
@@ -463,22 +464,29 @@ void MainWindow::initTileBar() {
|
||||
backBtn = new QPushButton(this);
|
||||
minBtn = new QPushButton(this);
|
||||
maxBtn = new QPushButton(this);
|
||||
- closeBtn = new QPushButton(this);
|
||||
+ closeBtn = new QPushButton(this);
|
||||
+ mTitleIcon = new QLabel(this);
|
||||
titleLabel = new QLabel(tr("UKCC"), this);
|
||||
|
||||
- backBtn->setFixedSize(32, 32);
|
||||
- minBtn->setFixedSize(32, 32);
|
||||
- maxBtn->setFixedSize(32, 32);
|
||||
// titleLabel->setFixedSize(32, 32);
|
||||
- titleLabel->setFixedHeight(32);
|
||||
- titleLabel->setMinimumWidth(32);
|
||||
+ backBtn->setFixedSize(30, 30);
|
||||
+ minBtn->setFixedSize(30, 30);
|
||||
+ maxBtn->setFixedSize(30, 30);
|
||||
+ closeBtn->setFixedSize(30, 30);
|
||||
+ mTitleIcon->setFixedSize(30, 30);
|
||||
+
|
||||
+ QIcon titleIcon = QIcon::fromTheme("ukui-control-center");
|
||||
+ mTitleIcon->setPixmap(titleIcon.pixmap(titleIcon.actualSize(QSize(24, 24))));
|
||||
+
|
||||
+ titleLabel->setFixedSize(30, 30);
|
||||
titleLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||
m_searchWidget->setMinimumWidth(350);
|
||||
- m_searchWidget->setMinimumHeight(40);
|
||||
+ m_searchWidget->setMinimumHeight(35);
|
||||
m_searchWidget->setMaximumWidth(350);
|
||||
- m_searchWidget->setMaximumHeight(40);
|
||||
-
|
||||
- ui->titleLayout->addSpacing(9);
|
||||
+ m_searchWidget->setMaximumHeight(35);
|
||||
+
|
||||
+ ui->titleLayout->addWidget(mTitleIcon);
|
||||
+ ui->titleLayout->addSpacing(8);
|
||||
ui->titleLayout->addWidget(titleLabel);
|
||||
ui->titleLayout->addWidget(backBtn);
|
||||
ui->titleLayout->addStretch();
|
||||
@@ -621,7 +629,7 @@ void MainWindow::initLeftsideBar(){
|
||||
connect(hBtn, &QPushButton::clicked, this, [=]{
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
});
|
||||
- hBtn->setStyleSheet("QPushButton#homepage{background: palette(button); border: none;}");
|
||||
+ hBtn->setStyleSheet("QPushButton#homepage{background: palette(window); border: none;}");
|
||||
// hBtn->setStyleSheet("QPushButton#homepage{background: palette(base);}");
|
||||
ui->leftsidebarVerLayout->addStretch();
|
||||
ui->leftsidebarVerLayout->addWidget(hBtn);
|
||||
@@ -646,7 +654,7 @@ void MainWindow::initLeftsideBar(){
|
||||
// button->setStyleSheet("QPushButton::checked{background: palette(button); border: none; border-image: url('://img/primaryleftmenu/checked.png');}"
|
||||
// "QPushButton::!checked{background: palette(button);border: none;}");
|
||||
button->setStyleSheet("QPushButton::checked{background: palette(base); border-top-left-radius: 6px;border-bottom-left-radius: 6px;}"
|
||||
- "QPushButton::!checked{background: palette(button);border: none;}");
|
||||
+ "QPushButton::!checked{background: palette(window);border: none;}");
|
||||
|
||||
connect(button, &QPushButton::clicked, this, [=]{
|
||||
QPushButton * btn = dynamic_cast<QPushButton *>(QObject::sender());
|
||||
@@ -688,9 +696,9 @@ QPushButton * MainWindow::buildLeftsideBtn(QString bname,QString tipName){
|
||||
iconBtn->setFocusPolicy(Qt::NoFocus);
|
||||
|
||||
|
||||
- QString iconHomePageBtnQss = QString("QPushButton{background: palette(button); border: none;}");
|
||||
+ QString iconHomePageBtnQss = QString("QPushButton{background: palette(window); border: none;}");
|
||||
QString iconBtnQss = QString("QPushButton:checked{background: palette(base); border: none;}"
|
||||
- "QPushButton:!checked{background: palette(button); border: none;}");
|
||||
+ "QPushButton:!checked{background: palette(window); border: none;}");
|
||||
QString path = QString("://img/primaryleftmenu/%1.svg").arg(iname);
|
||||
QPixmap pix = ImageUtil::loadSvg(path, "default");
|
||||
//单独设置HomePage按钮样式
|
||||
@@ -806,7 +814,7 @@ void MainWindow::initStyleSheet() {
|
||||
closeBtn->setFlat(true);
|
||||
closeBtn->installEventFilter(this);
|
||||
|
||||
- ui->leftsidebarWidget->setStyleSheet("QWidget#leftsidebarWidget{background-color: palette(button);border: none; border-top-left-radius: 6px; border-bottom-left-radius: 6px;}");
|
||||
+ ui->leftsidebarWidget->setStyleSheet("QWidget#leftsidebarWidget{background-color: palette(window);border: none; border-top-left-radius: 6px; border-bottom-left-radius: 6px;}");
|
||||
|
||||
// 设置左上角按钮图标
|
||||
backBtn->setIcon(QIcon("://img/titlebar/back.svg"));
|
||||
diff --git a/shell/mainwindow.h b/shell/mainwindow.h
|
||||
index bb44d7e..d01158f 100755
|
||||
--- a/shell/mainwindow.h
|
||||
+++ b/shell/mainwindow.h
|
||||
@@ -88,6 +88,7 @@ private:
|
||||
QPushButton * maxBtn;
|
||||
QPushButton * closeBtn;
|
||||
QLabel * titleLabel;
|
||||
+ QLabel * mTitleIcon;
|
||||
QTimer * timer;
|
||||
QLabel * logoLabel;
|
||||
QLabel *m_queryIcon;
|
||||
diff --git a/shell/mainwindow.ui b/shell/mainwindow.ui
|
||||
index e1d9b44..1a6cd22 100755
|
||||
--- a/shell/mainwindow.ui
|
||||
+++ b/shell/mainwindow.ui
|
||||
@@ -66,8 +66,8 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
- <number>3</number>
|
||||
- </property>
|
||||
+ <number>0</number>
|
||||
+ </property>
|
||||
<property name="topMargin">
|
||||
<number>30</number>
|
||||
</property>
|
||||
diff --git a/shell/prescene.cpp b/shell/prescene.cpp
|
||||
index 7451c2c..dd04531 100755
|
||||
--- a/shell/prescene.cpp
|
||||
+++ b/shell/prescene.cpp
|
||||
@@ -15,6 +15,14 @@ PreScene::PreScene(QLabel *label, QSize size, QWidget *parent) : titleLabel(labe
|
||||
m_vlayout = new QVBoxLayout;
|
||||
m_logoLayout = new QHBoxLayout;
|
||||
|
||||
+ mTitleIcon = new QLabel(this);
|
||||
+ QIcon titleIcon = QIcon::fromTheme("ukui-control-center");
|
||||
+ mTitleIcon->setPixmap(titleIcon.pixmap(titleIcon.actualSize(QSize(24, 24))));
|
||||
+
|
||||
+ mTitleIcon->setFixedSize(30, 30);
|
||||
+ titleLabel->setFixedSize(28, 28);
|
||||
+
|
||||
+
|
||||
titlebar = new QWidget(this);
|
||||
logoLabel = new QLabel(this);
|
||||
logoLabel->setFixedSize(200,200);
|
||||
@@ -23,10 +31,14 @@ PreScene::PreScene(QLabel *label, QSize size, QWidget *parent) : titleLabel(labe
|
||||
m_logoLayout->addWidget(logoLabel);
|
||||
|
||||
m_hlayout = new QHBoxLayout;
|
||||
- m_hlayout->setContentsMargins(9, 9, 9, 0);
|
||||
+ m_hlayout->setContentsMargins(4, 6, 0, 0);
|
||||
+ m_hlayout->addWidget(mTitleIcon);
|
||||
m_hlayout->addWidget(titleLabel);
|
||||
+ m_hlayout->addStretch();
|
||||
titlebar->setLayout(m_hlayout);
|
||||
|
||||
+ m_vlayout->setSpacing(0);
|
||||
+ m_vlayout->setContentsMargins(0, 0, 0, 0);
|
||||
m_vlayout->addWidget(titlebar);
|
||||
m_vlayout->addLayout(m_logoLayout);
|
||||
m_vlayout->addStretch();
|
||||
diff --git a/shell/prescene.h b/shell/prescene.h
|
||||
index 49e497a..d02650e 100755
|
||||
--- a/shell/prescene.h
|
||||
+++ b/shell/prescene.h
|
||||
@@ -23,6 +23,7 @@ private:
|
||||
QVBoxLayout * m_vlayout;
|
||||
QWidget * titlebar;
|
||||
|
||||
+ QLabel * mTitleIcon;
|
||||
QLabel * titleLabel;
|
||||
QLabel * logoLabel;
|
||||
QHBoxLayout * m_logoLayout = nullptr;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,68 +0,0 @@
|
||||
From b225b7a8b8cb4421fcfa81e4fc985bcf6ec1c59d Mon Sep 17 00:00:00 2001
|
||||
From: peijiankang <peijiankang@kylinos.cn>
|
||||
Date: Sat, 11 Sep 2021 15:29:44 +0800
|
||||
Subject: [PATCH] cpuinfo in arm system is null
|
||||
|
||||
---
|
||||
plugins/messages-task/about/cpuinfo.cpp | 37 +++++++++++++------------
|
||||
1 file changed, 19 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/plugins/messages-task/about/cpuinfo.cpp b/plugins/messages-task/about/cpuinfo.cpp
|
||||
index ee24a95..d208453 100644
|
||||
--- a/plugins/messages-task/about/cpuinfo.cpp
|
||||
+++ b/plugins/messages-task/about/cpuinfo.cpp
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <QFile>
|
||||
#include <QDebug>
|
||||
-
|
||||
+#include <QProcess>
|
||||
#include "cpuinfo.h"
|
||||
|
||||
cpuinfo::cpuinfo(QObject *parent) : QObject(parent)
|
||||
@@ -10,25 +10,26 @@ cpuinfo::cpuinfo(QObject *parent) : QObject(parent)
|
||||
|
||||
QString cpuinfo::getCpuName()
|
||||
{
|
||||
- QString name = "";
|
||||
+ QString name = "";
|
||||
#ifdef Q_OS_LINUX
|
||||
- QFile file("/proc/cpuinfo");
|
||||
- if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
- return "no cpuinfo";
|
||||
+ QProcess process;
|
||||
+ process.start("lscpu");
|
||||
+ process.waitForFinished();
|
||||
+ QString output = process.readAll();
|
||||
+ QStringList outputlist = output.split("\n");
|
||||
|
||||
- QString line = "N/A";
|
||||
- QTextStream in(&file);
|
||||
- line = in.readLine();
|
||||
- while (!in.atEnd()) {
|
||||
- line = in.readLine();
|
||||
- if (line.contains("model name"))
|
||||
- break;
|
||||
- }
|
||||
- //openEuler /proc/cpuinfo
|
||||
- //model name : Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
|
||||
- name = QString(line).right(line.length() - (line.indexOf(":") + 2));
|
||||
+ for (QString str : outputlist) {
|
||||
+ if (str.contains("型号名称")){
|
||||
+ name = QString(str).right(str.length() - 28);
|
||||
+ break;
|
||||
+ }
|
||||
+ else if(str.contains("Model name")) {
|
||||
+ name = QString(str).right(str.length() - 33);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
#elif defined(Q_OS_FREEBSD)
|
||||
|
||||
#endif
|
||||
- return name;
|
||||
-}
|
||||
+ return name;
|
||||
+}
|
||||
--
|
||||
2.30.0
|
||||
|
||||
@ -1,64 +0,0 @@
|
||||
From cd42ab432e63ec38e0339c9d075499b2b628db7b Mon Sep 17 00:00:00 2001
|
||||
From: pei-jiankang <peijiankang@kylinos.cn>
|
||||
Date: Fri, 15 Oct 2021 14:10:28 +0800
|
||||
Subject: [PATCH] modify the error of ukui-control-center open
|
||||
|
||||
---
|
||||
plugins/messages-task/about/about.cpp | 5 +++--
|
||||
plugins/messages-task/about/cpuinfo.cpp | 5 +++--
|
||||
plugins/messages-task/about/memoryentry.cpp | 2 +-
|
||||
3 files changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/plugins/messages-task/about/about.cpp b/plugins/messages-task/about/about.cpp
|
||||
index a2dc766..77f99da 100755
|
||||
--- a/plugins/messages-task/about/about.cpp
|
||||
+++ b/plugins/messages-task/about/about.cpp
|
||||
@@ -106,8 +106,9 @@ void About::setupKernelCompenent() {
|
||||
|
||||
MemoryEntry memoryInfo;
|
||||
QStringList memory = memoryInfo.totalMemory();
|
||||
- memorySize = memory.at(0) + "(" + memory.at(1) + tr(" available") + ")";
|
||||
-
|
||||
+ if(memory.size() >=2) {
|
||||
+ memorySize = memory.at(0) + "(" + memory.at(1) + tr(" available") + ")";
|
||||
+ }
|
||||
ui->kernalContent->setText(kernal);
|
||||
ui->memoryContent->setText(memorySize);
|
||||
|
||||
diff --git a/plugins/messages-task/about/cpuinfo.cpp b/plugins/messages-task/about/cpuinfo.cpp
|
||||
index d208453..0fb1461 100644
|
||||
--- a/plugins/messages-task/about/cpuinfo.cpp
|
||||
+++ b/plugins/messages-task/about/cpuinfo.cpp
|
||||
@@ -20,14 +20,15 @@ QString cpuinfo::getCpuName()
|
||||
|
||||
for (QString str : outputlist) {
|
||||
if (str.contains("型号名称")){
|
||||
- name = QString(str).right(str.length() - 28);
|
||||
+ name = QString(str).right(str.length() - (str.indexOf(":") + 1));
|
||||
break;
|
||||
}
|
||||
else if(str.contains("Model name")) {
|
||||
- name = QString(str).right(str.length() - 33);
|
||||
+ name = QString(str).right(str.length() - (str.indexOf(":") + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
+ name.remove(QRegExp("^ +\\s*"));
|
||||
#elif defined(Q_OS_FREEBSD)
|
||||
|
||||
#endif
|
||||
diff --git a/plugins/messages-task/about/memoryentry.cpp b/plugins/messages-task/about/memoryentry.cpp
|
||||
index f1b1bef..b48b9b7 100755
|
||||
--- a/plugins/messages-task/about/memoryentry.cpp
|
||||
+++ b/plugins/messages-task/about/memoryentry.cpp
|
||||
@@ -76,6 +76,6 @@ QStringList MemoryEntry::totalMemory()
|
||||
res << total << available;
|
||||
return res;
|
||||
}
|
||||
-
|
||||
+ res << "N/A" << "N/A";
|
||||
return res;
|
||||
}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
diff -Naur ukui-control-center-3.0.1/group-manager-server/group_manager_server.cpp ukui-control-center-3.0.1~/group-manager-server/group_manager_server.cpp
|
||||
--- ukui-control-center-3.0.1/group-manager-server/group_manager_server.cpp 2019-05-27 15:48:18.000000000 +0800
|
||||
+++ ukui-control-center-3.0.1~/group-manager-server/group_manager_server.cpp 2021-09-02 14:35:55.436486626 +0800
|
||||
@@ -66,8 +66,8 @@
|
||||
QString groupadd = "/usr/sbin/groupadd";
|
||||
QString addgroup = "/usr/sbin/addgroup";
|
||||
QString command;
|
||||
- QFile groupaddFile("/usr/sbin/addgroup");
|
||||
- QFile addgroupFile("/usr/sbin/groupadd");
|
||||
+ QFile groupaddFile("/usr/sbin/groupadd");
|
||||
+ QFile addgroupFile("/usr/sbin/addgroup");
|
||||
|
||||
QProcess p(0);
|
||||
QStringList args;
|
||||
@ -1,26 +0,0 @@
|
||||
diff -Naur ukui-control-center-3.0.1/plugins/system/display/display.cpp ukui-control-center-3.0.1~/plugins/system/display/display.cpp
|
||||
--- ukui-control-center-3.0.1/plugins/system/display/display.cpp 2021-09-01 16:38:36.839491260 +0800
|
||||
+++ ukui-control-center-3.0.1~/plugins/system/display/display.cpp 2021-09-01 16:42:42.542192296 +0800
|
||||
@@ -29,6 +29,10 @@
|
||||
#include <QDBusConnection>
|
||||
|
||||
DisplaySet::DisplaySet(){
|
||||
+ mFirstLoad = true;
|
||||
+ //make sure backend start
|
||||
+ requestBackend();
|
||||
+
|
||||
pluginWidget = new Widget;
|
||||
pluginName = tr("Display");
|
||||
QObject::connect(new KScreen::GetConfigOperation(), &KScreen::GetConfigOperation::finished,
|
||||
@@ -87,8 +91,9 @@
|
||||
QString output = process.readAll();
|
||||
output = output.simplified();
|
||||
|
||||
- QString command = "/usr/lib/" + output + "-linux-gnu" +"/libexec/kf5/kscreen_backend_launcher";
|
||||
- QProcess::startDetached(command);
|
||||
+ //QString command = "/usr/lib/" + output + "-linux-gnu" +"/libexec/kf5/kscreen_backend_launcher";
|
||||
+ QString command = "/usr/libexec/kf5/kscreen_backend_launcher";
|
||||
+ QProcess::startDetached(command);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
diff -Naur ukui-control-center-3.0.1/plugins/account/userinfo/changevaliddialog.cpp ukui-control-center-3.0.1~/plugins/account/userinfo/changevaliddialog.cpp
|
||||
--- ukui-control-center-3.0.1/plugins/account/userinfo/changevaliddialog.cpp 2021-09-16 15:20:36.911428472 +0800
|
||||
+++ ukui-control-center-3.0.1~/plugins/account/userinfo/changevaliddialog.cpp 2021-09-16 15:24:43.754446704 +0800
|
||||
@@ -143,7 +143,7 @@
|
||||
|
||||
void ChangeValidDialog::_getCurrentPwdStatus(){
|
||||
//
|
||||
- QString cmd = "passwd -S " + _name;
|
||||
+ QString cmd = "pkexec passwd -S " + _name;
|
||||
|
||||
QProcess * process = new QProcess;
|
||||
process->start(cmd);
|
||||
@ -1,23 +0,0 @@
|
||||
diff -Naur ukui-control-center-3.0.1/plugins/account/userinfo/changevaliddialog.cpp ukui-control-center-3.0.1~/plugins/account/userinfo/changevaliddialog.cpp
|
||||
--- ukui-control-center-3.0.1/plugins/account/userinfo/changevaliddialog.cpp 2019-05-27 15:48:18.000000000 +0800
|
||||
+++ ukui-control-center-3.0.1~/plugins/account/userinfo/changevaliddialog.cpp 2021-09-03 18:48:22.196993408 +0800
|
||||
@@ -155,8 +155,8 @@
|
||||
if (valid.startsWith(_name)){
|
||||
QStringList validList = valid.split(" ");
|
||||
QString lastChangeStr = validList.at(2);
|
||||
- QStringList lastChangeList = lastChangeStr.split("/");
|
||||
- lastChangeDate = QDate(QString(lastChangeList.at(2)).toInt(), QString(lastChangeList.at(0)).toInt(), QString(lastChangeList.at(1)).toInt());
|
||||
+ QStringList lastChangeList = lastChangeStr.split("-");
|
||||
+ lastChangeDate = QDate(QString(lastChangeList.at(0)).toInt(), QString(lastChangeList.at(1)).toInt(), QString(lastChangeList.at(2)).toInt());
|
||||
delayDays = QString(validList.at(4)).toInt();
|
||||
} else {
|
||||
delayDays = -1;
|
||||
@@ -201,7 +201,7 @@
|
||||
ui->yearCombox->clear();
|
||||
|
||||
QDate begin = QDate::currentDate().addDays(1);
|
||||
- QDate canSelect = lastChangeDate.addYears(26);
|
||||
+ QDate canSelect = lastChangeDate.addYears(70);
|
||||
|
||||
ui->yearCombox->addItem(QObject::tr("Never"), 0);
|
||||
for (int year = begin.year(); year <= canSelect.year(); year++){
|
||||
Binary file not shown.
BIN
ukui-control-center-3.0.4.tar.gz
Normal file
BIN
ukui-control-center-3.0.4.tar.gz
Normal file
Binary file not shown.
@ -1,12 +1,11 @@
|
||||
%define debug_package %{nil}
|
||||
Name: ukui-control-center
|
||||
Version: 3.0.1
|
||||
Release: 20
|
||||
Version: 3.0.4
|
||||
Release: 1
|
||||
Summary: utilities to configure the UKUI desktop
|
||||
License: GPL-2+
|
||||
URL: http://www.ukui.org
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Source1: ukui-group-manager.desktop
|
||||
|
||||
BuildRequires: qt5-qtsvg-devel
|
||||
BuildRequires: qt5-qtbase-devel
|
||||
@ -20,7 +19,6 @@ BuildRequires: kf5-kwidgetsaddons-devel
|
||||
BuildRequires: kf5-kconfig-devel
|
||||
BuildRequires: kf5-kconfigwidgets-devel
|
||||
BuildRequires: kf5-ki18n-devel
|
||||
#BuildRequires: libkscreen
|
||||
BuildRequires: libkscreen-qt5-devel
|
||||
BuildRequires: qt5-qtdeclarative-devel
|
||||
BuildRequires: dconf-devel
|
||||
@ -41,6 +39,18 @@ BuildRequires: boost-devel
|
||||
BuildRequires: libxcb-devel
|
||||
BuildRequires: qt5-linguist
|
||||
BuildRequires: polkit-qt5-1-devel
|
||||
BuildRequires: pam-devel
|
||||
BuildRequires: systemd-devel
|
||||
|
||||
BuildRequires: kf5-kxmlgui-devel
|
||||
BuildRequires: kf5-kglobalaccel-devel
|
||||
BuildRequires: kf5-bluez-qt-devel
|
||||
BuildRequires: opencv
|
||||
BuildRequires: libddcutil-devel
|
||||
BuildRequires: upower-devel
|
||||
BuildRequires: libpwquality-devel
|
||||
|
||||
|
||||
|
||||
Requires: dconf
|
||||
Requires: qt5-qtimageformats
|
||||
@ -55,7 +65,6 @@ Requires: kf5-kwidgetsaddons-devel
|
||||
Requires: kf5-kconfig-devel
|
||||
Requires: kf5-kconfigwidgets-devel
|
||||
Requires: kf5-ki18n-devel
|
||||
#Requires: libkscreen
|
||||
Requires: libkscreen-qt5-devel
|
||||
Requires: qt5-qtdeclarative-devel
|
||||
Requires: dconf-devel
|
||||
@ -70,26 +79,9 @@ Requires: libcanberra-devel
|
||||
Requires: qt5-qtgraphicaleffects
|
||||
Requires: qt5-qtquickcontrols
|
||||
|
||||
patch0: 0001-fix-system-overview-failed.patch
|
||||
patch1: 0002-fix-autologin-nopasswdlogin-failed.patch
|
||||
patch2: 0003-fix-dialog-pop-twice-after-modifying-resolution-bug.patch
|
||||
patch3: 0004-fix-effects-mode-not-available-bug.patch
|
||||
patch4: 0005-fix-blueman-tray-and-groupadd-autologin.patch
|
||||
patch5: 0001-add-judgment-when-Bluetooth-does-not-exist.patch
|
||||
patch6: 0006-fix-Group-members-are-not-displayed.patch
|
||||
patch7: 0007-fix-vnc-crashed.patch
|
||||
patch8: 0008-fix-redeclaration-of-QStringList-usergroupList-in-ed.patch
|
||||
patch9: 0009-fix-layout-optimization.patch
|
||||
patch10: 0010-Added-translation-using-Weblate-Tibetan.patch
|
||||
patch11: 0011-power-add-sleep-function.patch
|
||||
patch12: 0012-window-add-title-icon.patch
|
||||
patch13: 0001-fix-compile-extern-C-error.patch
|
||||
patch14: fix_arm_root_user_crash.patch
|
||||
patch15: fix_add_group_failed_issue.patch
|
||||
patch16: fix_user_passwd_valid_time_setting_failed_issue.patch
|
||||
patch17: 0013-cpuinfo-in-arm-system-is-null.patch
|
||||
patch18: fix_user_passwd_valid_issue.patch
|
||||
patch19: 0014-modify-the-error-of-ukui-control-center-open.patch
|
||||
Requires: ddcutil
|
||||
Requires: glib2
|
||||
|
||||
|
||||
Recommends: qt5-qtquickcontrols
|
||||
|
||||
@ -110,37 +102,16 @@ Suggests: ukui-settings-daemon
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch18 -p1
|
||||
%patch19 -p1
|
||||
|
||||
%build
|
||||
qmake-qt5
|
||||
make
|
||||
make -j24
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make INSTALL_ROOT=%{buildroot} install
|
||||
|
||||
mkdir -p %{buildroot}/etc/xdg/autostart/
|
||||
cp -r %{SOURCE1} %{buildroot}/etc/xdg/autostart/
|
||||
|
||||
%post
|
||||
set -e
|
||||
@ -156,7 +127,6 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_sysconfdir}/dbus-1/system.d/*
|
||||
%{_bindir}/launchSysDbus
|
||||
%{_bindir}/ukui-control-center
|
||||
#%%{_prefix}/lib/control-center/*
|
||||
%{_libdir}/ukui-control-center/*
|
||||
%{_datadir}/applications/*
|
||||
%{_datadir}/dbus-1/system-services/*
|
||||
@ -165,12 +135,24 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_datadir}/ukui/faces/*
|
||||
%{_datadir}/ukui-control-center/shell/res/i18n
|
||||
%{_bindir}/group-manager-server
|
||||
%{_bindir}/checkuserpwd
|
||||
%{_unitdir}/ukui-group-manager.service
|
||||
%{_bindir}/checkUserPwd
|
||||
%{_datadir}/polkit-1/actions/org.ukui.groupmanager.policy
|
||||
%{_sysconfdir}/xdg/autostart/ukui-group-manager.desktop
|
||||
%{_sysconfdir}/pam.d/control-center
|
||||
/lib/systemd/system/ukui-group-manager.service
|
||||
%{_bindir}/changeotheruserpwd
|
||||
%{_bindir}/changeuserpwd
|
||||
%{_bindir}/childCheckpwdwithPAM
|
||||
%{_bindir}/ukui-control-center-session
|
||||
%{_datadir}/dbus-1/services/org.ukui.ukcc.session.service
|
||||
%{_datadir}/kylin-user-guide/data/*
|
||||
%{_datadir}/polkit-1/actions/com.control.center.qt.systemdbus.policy
|
||||
%{_datadir}/ukui-control-center/shell/res/search.xml
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jan 26 2022 huayadong <huayadong@kylinos.cn> - 3.0.4-1
|
||||
- update to upstream version 3.0.4-1
|
||||
|
||||
* Tue Oct 19 2021 peijiankang <peijiankang@kylinos.cn> - 3.0.1-20
|
||||
- add 0014-modify-the-error-of-ukui-control-center-open.patch
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user