commit
7aeda13099
65
0001-fix-poweroff.patch
Normal file
65
0001-fix-poweroff.patch
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
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
|
||||||
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
diff -ur ukui-session-manager-2.0.2/ukui-session-manager-2.0.2/ukui-session/modulemanager.cpp ukui-session-manager-2.0.2/ukui-session-manager-2.0.2~/ukui-session/modulemanager.cpp
|
|
||||||
--- ukui-session-manager-2.0.2/ukui-session-manager-2.0.2/ukui-session/modulemanager.cpp 2020-06-19 14:09:56.000000000 +0800
|
|
||||||
+++ ukui-session-manager-2.0.2/ukui-session-manager-2.0.2~/ukui-session/modulemanager.cpp 2020-07-01 09:42:48.000000000 +0800
|
|
||||||
@@ -195,7 +195,7 @@
|
|
||||||
qDebug() << "wait for ukui-settings-daemon start-up";
|
|
||||||
timer = new QTimer();
|
|
||||||
connect(timer,SIGNAL(timeout()),this,SLOT(timerUpdate()));
|
|
||||||
- timer->start(1000);
|
|
||||||
+ timer->start(6000);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ModuleManager::timerUpdate(){
|
|
||||||
Binary file not shown.
BIN
ukui-session-manager-3.0.2.tar.gz
Normal file
BIN
ukui-session-manager-3.0.2.tar.gz
Normal file
Binary file not shown.
@ -1,15 +1,17 @@
|
|||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
|
|
||||||
Name: ukui-session-manager
|
Name: ukui-session-manager
|
||||||
Version: 2.0.2
|
Version: 3.0.2
|
||||||
Release: 1
|
Release: 2
|
||||||
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
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
|
|
||||||
BuildRequires: cmake,libXtst-devel,libX11-devel,xdg-user-dirs,kf5-kidletime-devel,qt5-qtx11extras-devel,qt5-qtbase-devel,systemd-devel,qt5-qttools-devel,qt5-qtmultimedia-devel,gsettings-qt-devel,
|
BuildRequires: cmake,libXtst-devel,libX11-devel,xdg-user-dirs,kf5-kidletime-devel,qt5-qtx11extras-devel,qt5-qtbase-devel,systemd-devel,qt5-qttools-devel,qt5-qtmultimedia-devel,gsettings-qt-devel,pkgconf
|
||||||
Requires: ukui-themes
|
Requires: ukui-themes
|
||||||
|
Requires: glib2
|
||||||
|
Requires: qt5-qtmultimedia
|
||||||
|
|
||||||
Recommends: peony
|
Recommends: peony
|
||||||
Recommends: ukwm
|
Recommends: ukwm
|
||||||
@ -20,17 +22,17 @@ Recommends: ukui-settings-daemon
|
|||||||
|
|
||||||
Provides: x-session-manager
|
Provides: x-session-manager
|
||||||
|
|
||||||
patch0: delay-other-program.patch
|
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
|
||||||
manager such as lightdm. It will load all necessary applications for
|
manager such as lightdm. It will load all necessary applications for
|
||||||
a full-featured user session.
|
a full-featured user session.
|
||||||
.
|
|
||||||
This package contain the session manager component.
|
This package contain the session manager component.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch0 -p2
|
%patch0 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
mkdir cmake-build
|
mkdir cmake-build
|
||||||
@ -43,9 +45,11 @@ popd
|
|||||||
pushd cmake-build
|
pushd cmake-build
|
||||||
%make_install INSTALL_ROOT=%{buildroot}
|
%make_install INSTALL_ROOT=%{buildroot}
|
||||||
popd
|
popd
|
||||||
mkdir -p %{buildroot}/etc/X11/Xsession.d/ %{buildroot}/usr/share/man/man1/
|
#mkdir -p %{buildroot}/etc/X11/Xsession.d/ %{buildroot}/usr/share/man/man1/
|
||||||
install -m644 debian/99ukui-environment %{buildroot}/etc/X11/Xsession.d/99ukui-environment
|
#install -m644 debian/99ukui-environment %{buildroot}/etc/X11/Xsession.d/99ukui-environment
|
||||||
gzip -c man/ukui-session.1 > %{buildroot}/usr/share/man/man1/ukui-session.1.gz
|
install -d %{buildroot}/usr/share/man/man1/ %{buildroot}/etc/polkit-1/localauthority/50-local.d/
|
||||||
|
install -m644 data/com.ubuntu.enable-hibernate.pkla %{buildroot}/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
|
||||||
|
gzip -c man/ukui-session.1 > %{buildroot}/usr/share/man/man1/ukui-session.1.gz
|
||||||
gzip -c man/ukui-session-tools.1 > %{buildroot}/usr/share/man/man1/ukui-session-tools.1.gz
|
gzip -c man/ukui-session-tools.1 > %{buildroot}/usr/share/man/man1/ukui-session-tools.1.gz
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
@ -53,13 +57,20 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
%files
|
%files
|
||||||
%doc debian/changelog debian/copyright
|
%doc debian/changelog debian/copyright
|
||||||
%{_sysconfdir}/X11/Xsession.d/99ukui-environment
|
#%%{_sysconfdir}/X11/Xsession.d/99ukui-environment
|
||||||
|
%{_sysconfdir}/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
|
||||||
%{_datadir}/*
|
%{_datadir}/*
|
||||||
%{_prefix}/bin/ukui-session
|
%{_prefix}/bin/ukui-session
|
||||||
%{_prefix}/bin/ukui-session-tools
|
%{_prefix}/bin/ukui-session-tools
|
||||||
#%%{_datadir}/man/man1/ukui-session.1.gz
|
#%%{_datadir}/man/man1/ukui-session.1.gz
|
||||||
#%%{_datadir}/man/man1/ukui-session-tools.1.gz
|
#%%{_datadir}/man/man1/ukui-session-tools.1.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Dec 3 2020 lvhan <lvhan@kylinos.cn> - 3.0.2-2
|
||||||
|
- fix poweroff
|
||||||
|
|
||||||
|
* Mon Oct 26 2020 douyan <douyan@kylinos.cn> - 3.0.2-1
|
||||||
|
- update to upstream version 3.0.1
|
||||||
|
|
||||||
* Thu Jul 9 2020 douyan <douyan@kylinos.cn> - 2.0.2-1
|
* Thu Jul 9 2020 douyan <douyan@kylinos.cn> - 2.0.2-1
|
||||||
- Init package for openEuler
|
- Init package for openEuler
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user