update to upstream version 3.0.6-1
This commit is contained in:
parent
7aeda13099
commit
342f6415a9
@ -1,65 +0,0 @@
|
|||||||
From 6e6f2d46c03b255062c8fdb6f64f0e587445a6ef Mon Sep 17 00:00:00 2001
|
|
||||||
From: myshow <296570182@qq.com>
|
|
||||||
Date: Thu, 3 Dec 2020 11:05:51 +0800
|
|
||||||
Subject: [PATCH] fix-poweroff
|
|
||||||
|
|
||||||
---
|
|
||||||
ukui-session/sessiondbusadaptor.h | 27 +++++++++++++++++++++++----
|
|
||||||
1 file changed, 23 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/ukui-session/sessiondbusadaptor.h b/ukui-session/sessiondbusadaptor.h
|
|
||||||
index c005702..4da2b55 100644
|
|
||||||
--- a/ukui-session/sessiondbusadaptor.h
|
|
||||||
+++ b/ukui-session/sessiondbusadaptor.h
|
|
||||||
@@ -21,6 +21,7 @@
|
|
||||||
#define SESSIONDBUSADAPTOR_H
|
|
||||||
|
|
||||||
#include <QtDBus>
|
|
||||||
+#include <QMessageBox>
|
|
||||||
#include "../tools/ukuipower.h"
|
|
||||||
#include "modulemanager.h"
|
|
||||||
|
|
||||||
@@ -54,7 +55,16 @@ public slots:
|
|
||||||
|
|
||||||
bool canPowerOff()
|
|
||||||
{
|
|
||||||
- return mPower->canAction(UkuiPower::PowerShutdown);
|
|
||||||
+ QProcess p;
|
|
||||||
+ p.start("bash", QStringList() <<"-c" << "who | wc -l");
|
|
||||||
+ p.waitForFinished();
|
|
||||||
+ QString ret = p.readAllStandardOutput();
|
|
||||||
+ int user = ret.toInt();
|
|
||||||
+ if (user > 1)
|
|
||||||
+ return false;
|
|
||||||
+ else
|
|
||||||
+ return true;
|
|
||||||
+ // return mPower->canAction(UkuiPower::PowerShutdown);
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_NOREPLY void logout()
|
|
||||||
@@ -74,10 +84,19 @@ public slots:
|
|
||||||
Q_NOREPLY void powerOff()
|
|
||||||
{
|
|
||||||
if(mPower->canAction(UkuiPower::PowerShutdown)){
|
|
||||||
- mManager->logout(false);
|
|
||||||
- mPower->doAction(UkuiPower::PowerShutdown);
|
|
||||||
+ // mManager->logout(false);
|
|
||||||
+ // mPower->doAction(UkuiPower::PowerShutdown);
|
|
||||||
+ QProcess::execute("shutdown -h now");
|
|
||||||
+ // QProcess::execute("poweroff");
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ //弹框提示无法生效?
|
|
||||||
+ QMessageBox msg;
|
|
||||||
+ msg.setWindowTitle(tr("Error"));
|
|
||||||
+ msg.setText(tr("The computer could not be shut down!"));
|
|
||||||
+ msg.addButton(tr("Ok"), QMessageBox::AcceptRole);
|
|
||||||
+ msg.exec();
|
|
||||||
}
|
|
||||||
- //QCoreApplication::exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// QDBusVariant listModules()
|
|
||||||
--
|
|
||||||
2.29.2.windows.2
|
|
||||||
|
|
||||||
Binary file not shown.
BIN
ukui-session-manager-3.0.6.tar.gz
Normal file
BIN
ukui-session-manager-3.0.6.tar.gz
Normal file
Binary file not shown.
@ -1,8 +1,8 @@
|
|||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
|
|
||||||
Name: ukui-session-manager
|
Name: ukui-session-manager
|
||||||
Version: 3.0.2
|
Version: 3.0.6
|
||||||
Release: 2
|
Release: 1
|
||||||
Summary: Session manager of the UKUI desktop environment
|
Summary: Session manager of the UKUI desktop environment
|
||||||
License: LGPL-2.1+ GPL-3+
|
License: LGPL-2.1+ GPL-3+
|
||||||
URL: http://www.ukui.org
|
URL: http://www.ukui.org
|
||||||
@ -22,7 +22,6 @@ Recommends: ukui-settings-daemon
|
|||||||
|
|
||||||
Provides: x-session-manager
|
Provides: x-session-manager
|
||||||
|
|
||||||
patch0: 0001-fix-poweroff.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package contains a session that can be started from a display
|
This package contains a session that can be started from a display
|
||||||
@ -32,7 +31,6 @@ patch0: 0001-fix-poweroff.patch
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch0 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
mkdir cmake-build
|
mkdir cmake-build
|
||||||
@ -66,6 +64,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
#%%{_datadir}/man/man1/ukui-session-tools.1.gz
|
#%%{_datadir}/man/man1/ukui-session-tools.1.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Oct 26 2020 huayadong <huayadong@kylinos.cn> - 3.0.6-1
|
||||||
|
- update to upstream version 3.0.6-1
|
||||||
|
|
||||||
* Thu Dec 3 2020 lvhan <lvhan@kylinos.cn> - 3.0.2-2
|
* Thu Dec 3 2020 lvhan <lvhan@kylinos.cn> - 3.0.2-2
|
||||||
- fix poweroff
|
- fix poweroff
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user