patch to bring polkit auth dialog to front

patch restart polkit-kde on crash
patch to remove unimplimented 'remember authorization' checkbox
epel9
Rex Dieter 13 years ago
parent 3dd4f3c622
commit 39266139cd

@ -0,0 +1,34 @@
From 0701f84a57156f8f584bb4fe928811a26ceefcf0 Mon Sep 17 00:00:00 2001
From: Jonathan Thomas <echidnaman@kubuntu.org>
Date: Wed, 19 Jan 2011 10:21:53 -0500
Subject: [PATCH 05/20] Bring the auth dialog to the front when it is shown.
Otherwise it pops up behind the app requesting it and
the user never sees it.
---
policykitlistener.cpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/policykitlistener.cpp b/policykitlistener.cpp
index 68185bc..bb95f1d 100644
--- a/policykitlistener.cpp
+++ b/policykitlistener.cpp
@@ -22,6 +22,7 @@
#include "AuthDialog.h"
#include <KDebug>
+#include <KWindowSystem>
#include <PolkitQt1/Agent/Listener>
#include <PolkitQt1/Agent/Session>
@@ -100,6 +101,7 @@ void PolicyKitListener::initiateAuthentication(const QString &actionId,
kDebug() << "WinId of the dialog is " << m_dialog.data()->winId() << m_dialog.data()->effectiveWinId();
m_dialog.data()->setOptions();
m_dialog.data()->show();
+ KWindowSystem::forceActiveWindow(m_dialog.data()->winId());
kDebug() << "WinId of the shown dialog is " << m_dialog.data()->winId() << m_dialog.data()->effectiveWinId();
m_numTries = 0;
--
1.7.7.4

@ -0,0 +1,35 @@
From 34b6e24316e83bb13bb1b420616bc986783bb249 Mon Sep 17 00:00:00 2001
From: Jonathan Thomas <echidnaman@kubuntu.org>
Date: Sat, 22 Oct 2011 19:31:55 -0400
Subject: [PATCH 16/20] Autorestart when we crash. This way a polkit-kde-1
crash won't prevent polkit auth from working until
the next login.
---
main.cpp | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/main.cpp b/main.cpp
index e197cee..2fa928f 100644
--- a/main.cpp
+++ b/main.cpp
@@ -21,6 +21,7 @@
#include <KCmdLineArgs>
#include <KAboutData>
#include <KLocale>
+#include <KCrash>
#include "policykitkde.h"
@@ -32,6 +33,8 @@ int main(int argc, char *argv[])
aboutData.addAuthor(ki18n("Jaroslav Reznik"), ki18n("Maintainer"), "jreznik@redhat.com");
aboutData.setProductName("policykit-kde/polkit-kde-authentication-agent-1");
+ KCrash::setFlags(KCrash::AutoRestart);
+
KCmdLineArgs::init(argc, argv, &aboutData);
if (!PolicyKitKDE::start()) {
--
1.7.7.4

@ -0,0 +1,30 @@
From 599b36eddd2ae4d8d2967255c503a680002dabf7 Mon Sep 17 00:00:00 2001
From: Jonathan Thomas <echidnaman@kubuntu.org>
Date: Tue, 25 Oct 2011 17:28:38 -0400
Subject: [PATCH 17/20] Of course, we can only set KCrash flags after
KCmdLineArgs::init() has been called
---
main.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/main.cpp b/main.cpp
index 2fa928f..ab359b7 100644
--- a/main.cpp
+++ b/main.cpp
@@ -33,10 +33,10 @@ int main(int argc, char *argv[])
aboutData.addAuthor(ki18n("Jaroslav Reznik"), ki18n("Maintainer"), "jreznik@redhat.com");
aboutData.setProductName("policykit-kde/polkit-kde-authentication-agent-1");
- KCrash::setFlags(KCrash::AutoRestart);
-
KCmdLineArgs::init(argc, argv, &aboutData);
+ KCrash::setFlags(KCrash::AutoRestart);
+
if (!PolicyKitKDE::start()) {
qWarning("PolicyKitKDE is already running!\n");
return 0;
--
1.7.7.4

@ -0,0 +1,58 @@
From 27cfdc75084e57f22ba93c54f2387a7c47378d90 Mon Sep 17 00:00:00 2001
From: Felix Geyer <debfx-kde@fobos.de>
Date: Tue, 8 Nov 2011 20:44:05 +0100
Subject: [PATCH 19/20] Remove unused "Remember authorization" checkboxes.
The checkboxes were visible in the UI but the feature
isn't actually implemented.
---
AuthDialog.ui | 33 ---------------------------------
1 files changed, 0 insertions(+), 33 deletions(-)
diff --git a/AuthDialog.ui b/AuthDialog.ui
index 27480ff..3b9bbc6 100644
--- a/AuthDialog.ui
+++ b/AuthDialog.ui
@@ -114,39 +114,6 @@
</property>
</widget>
</item>
- <item row="4" column="1" colspan="3" >
- <widget class="QCheckBox" name="cbRemember" >
- <property name="text" >
- <string>Remember authorization</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="5" column="2" colspan="2" >
- <widget class="QCheckBox" name="cbSessionOnly" >
- <property name="text" >
- <string>For this session only</string>
- </property>
- </widget>
- </item>
- <item row="5" column="1" >
- <spacer name="horizontalSpacer" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>15</width>
- <height>10</height>
- </size>
- </property>
- </spacer>
- </item>
<item row="1" column="1" colspan="3" >
<widget class="KComboBox" name="userCB" />
</item>
--
1.7.7.4

@ -0,0 +1,37 @@
From 3a9906d2b5d1c504670442277906ed53cd9686e8 Mon Sep 17 00:00:00 2001
From: Dario Freddi <drf@kde.org>
Date: Fri, 25 Nov 2011 23:08:07 +0100
Subject: [PATCH 20/20] CCMAIL: echidnaman@kubuntu.org
KCrash must be initialized after KUniqueApplication is started, to avoid KCmdLine to parse its arguments before that.
P.S.: While I do appreciate the contribution and I think the patch was really useful,
it would be awesome if those changes went through review first. If they went through and I forgot
about it and didn't spot the problem earlier, feel free to hit me with a stick instead.
---
main.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/main.cpp b/main.cpp
index ab359b7..33ef236 100644
--- a/main.cpp
+++ b/main.cpp
@@ -35,13 +35,13 @@ int main(int argc, char *argv[])
KCmdLineArgs::init(argc, argv, &aboutData);
- KCrash::setFlags(KCrash::AutoRestart);
-
if (!PolicyKitKDE::start()) {
qWarning("PolicyKitKDE is already running!\n");
return 0;
}
+ KCrash::setFlags(KCrash::AutoRestart);
+
PolicyKitKDE agent;
agent.disableSessionManagement();
agent.exec();
--
1.7.7.4

@ -1,6 +1,6 @@
Name: polkit-kde
Version: 0.99.0
Release: 2%{?dist}
Release: 3%{?dist}
Summary: PolicyKit integration for KDE Desktop
Group: Applications/System
@ -10,6 +10,13 @@ URL: http://www.kde.org/
Source0: ftp://ftp.kde.org/pub/kde/stable/apps/KDE4.x/admin/polkit-kde-agent-1-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
## upstream patches
Patch05: 0005-Bring-the-auth-dialog-to-the-front-when-it-is-shown..patch
Patch16: 0016-Autorestart-when-we-crash.-This-way-a-polkit-kde-1-c.patch
Patch17: 0017-Of-course-we-can-only-set-KCrash-flags-after-KCmdLin.patch
Patch19: 0019-Remove-unused-Remember-authorization-checkboxes.patch
Patch20: 0020-CCMAIL-echidnaman-kubuntu.org.patch
BuildRequires: kdelibs4-devel
BuildRequires: polkit-qt-devel >= 0.99.0
BuildRequires: cmake
@ -28,6 +35,12 @@ Provides Policy Kit Authentication Agent that nicely fits to KDE.
%prep
%setup -q -n polkit-kde-agent-1-%{version}
%patch05 -p1 -b .0005
%patch16 -p1 -b .0016
%patch17 -p1 -b .0017
%patch19 -p1 -b .0019
%patch20 -p1 -b .0020
%build
mkdir -p %{_target_platform}
@ -35,15 +48,16 @@ pushd %{_target_platform}
%{cmake_kde4} ..
popd
make %{?_smp_mflags} -C %{_target_platform} VERBOSE=1
make %{?_smp_mflags} -C %{_target_platform}
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} -C %{_target_platform}
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
%find_lang polkit-kde-authentication-agent-1
%clean
rm -rf %{buildroot}
@ -55,7 +69,13 @@ rm -rf %{buildroot}
%{_datadir}/autostart/polkit-kde-authentication-agent-1.desktop
%{_kde4_appsdir}/policykit1-kde/policykit1-kde.notifyrc
%changelog
* Mon Dec 12 2011 Rex Dieter <rdieter@fedoraproject.org> 0.99.0-3
- patch to bring polkit auth dialog to front
- patch restart polkit-kde on crash
- patch to remove unimplimented 'remember authorization' checkbox
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.99.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

Loading…
Cancel
Save