Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>r14.0.x
parent
ab12cfe230
commit
eb684d7fa3
@ -0,0 +1,17 @@
|
|||||||
|
kde4_add_executable(polkit-kde-authentication-agent-1 ${policykit_SRCS})
|
||||||
|
|
||||||
|
target_link_libraries(polkit-kde-authentication-agent-1
|
||||||
|
${KDE4_TDEUI_LIBS}
|
||||||
|
${POLKITQT-1_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
configure_file(polkit-kde-authentication-agent-1.desktop.in ${CMAKE_BINARY_DIR}/polkit-kde-authentication-agent-1.desktop)
|
||||||
|
|
||||||
|
install(TARGETS polkit-kde-authentication-agent-1 DESTINATION ${LIBEXEC_INSTALL_DIR})
|
||||||
|
|
||||||
|
install(FILES ${CMAKE_BINARY_DIR}/polkit-kde-authentication-agent-1.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
|
||||||
|
|
||||||
|
install(FILES policykit1-kde.notifyrc DESTINATION ${DATA_INSTALL_DIR}/policykit1-kde)
|
||||||
|
|
||||||
|
include(MacroOptionalAddSubdirectory)
|
||||||
|
macro_optional_add_subdirectory( po )
|
@ -0,0 +1,94 @@
|
|||||||
|
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||||
|
<class>AuthDetailsWidget</class>
|
||||||
|
<widget class="TQWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>AuthDetailsWidget</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>273</width>
|
||||||
|
<height>80</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>3</hsizetype>
|
||||||
|
<vsizetype>3</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<grid>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>gridLayout</cstring>
|
||||||
|
</property>
|
||||||
|
<widget class="TQLabel" row="1" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>label</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Application:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="TQLabel" row="2" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>label_3</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Action:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="TQLabel" row="3" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>vendorL</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Vendor:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="TQLabel" row="2" column="1" colspan="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>action_label</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Action:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="KURLLabel" row="3" column="1" colspan="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>vendorUL</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Vendor:</string>
|
||||||
|
</property>
|
||||||
|
<property name="tipText">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="useTips">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="Line" row="0" column="0" colspan="4">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>line</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="TQLabel" row="1" column="1" colspan="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>app_label</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Application:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</grid>
|
||||||
|
</widget>
|
||||||
|
<includes>
|
||||||
|
<include location="global" impldecl="in implementation">kurllabel.h</include>
|
||||||
|
</includes>
|
||||||
|
</UI>
|
@ -1,171 +0,0 @@
|
|||||||
<ui version="4.0" >
|
|
||||||
<class>AuthDialog</class>
|
|
||||||
<widget class="TQWidget" name="AuthDialog" >
|
|
||||||
<property name="geometry" >
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>335</width>
|
|
||||||
<height>193</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<layout class="TQGridLayout" name="gridLayout" >
|
|
||||||
<item rowspan="6" row="0" column="0" >
|
|
||||||
<layout class="TQVBoxLayout" name="verticalLayout" >
|
|
||||||
<item>
|
|
||||||
<widget class="TQLabel" name="lblPixmap" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string notr="true">Lock Icon here</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap" >
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="buddy" >
|
|
||||||
<cstring>lePassword</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer" >
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>TQt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0" >
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>92</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" colspan="3" >
|
|
||||||
<layout class="TQVBoxLayout" name="verticalLayout_2" >
|
|
||||||
<item>
|
|
||||||
<widget class="TQLabel" name="lblHeader" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string notr="true"><b>Header is here!</b></string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="buddy" >
|
|
||||||
<cstring>lePassword</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="TQLabel" name="lblContent" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string notr="true"><i>Content</i></string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1" colspan="3" >
|
|
||||||
<widget class="KTitleWidget" name="errorMessageKTW" />
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1" colspan="2" >
|
|
||||||
<widget class="TQLabel" name="lblPassword" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Password:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy" >
|
|
||||||
<cstring>lePassword</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="3" >
|
|
||||||
<widget class="KLineEdit" name="lePassword" >
|
|
||||||
<property name="echoMode" >
|
|
||||||
<enum>TQLineEdit::Password</enum>
|
|
||||||
</property>
|
|
||||||
<property name="passwordMode" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1" colspan="3" >
|
|
||||||
<widget class="KComboBox" name="userCB" />
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
<zorder>errorMessageKTW</zorder>
|
|
||||||
<zorder>lblPassword</zorder>
|
|
||||||
<zorder>lePassword</zorder>
|
|
||||||
<zorder>cbRemember</zorder>
|
|
||||||
<zorder>cbSessionOnly</zorder>
|
|
||||||
<zorder>horizontalSpacer</zorder>
|
|
||||||
<zorder>userCB</zorder>
|
|
||||||
</widget>
|
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>KComboBox</class>
|
|
||||||
<extends>TQComboBox</extends>
|
|
||||||
<header>kcombobox.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
|
||||||
<class>KLineEdit</class>
|
|
||||||
<extends>TQLineEdit</extends>
|
|
||||||
<header>klineedit.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
|
||||||
<class>KTitleWidget</class>
|
|
||||||
<extends>TQWidget</extends>
|
|
||||||
<header>ktitlewidget.h</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<tabstops>
|
|
||||||
<tabstop>userCB</tabstop>
|
|
||||||
<tabstop>lePassword</tabstop>
|
|
||||||
<tabstop>cbRemember</tabstop>
|
|
||||||
<tabstop>cbSessionOnly</tabstop>
|
|
||||||
</tabstops>
|
|
||||||
<resources/>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>cbRemember</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>cbSessionOnly</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel" >
|
|
||||||
<x>259</x>
|
|
||||||
<y>161</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel" >
|
|
||||||
<x>161</x>
|
|
||||||
<y>169</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
|
@ -0,0 +1,168 @@
|
|||||||
|
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||||
|
<class>AuthDialogWidget</class>
|
||||||
|
<widget class="TQWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>AuthDialogWidget</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>335</width>
|
||||||
|
<height>193</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>3</hsizetype>
|
||||||
|
<vsizetype>3</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<grid>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>gridLayout</cstring>
|
||||||
|
</property>
|
||||||
|
<widget class="TQLayoutWidget" rowspan="6" row="0" column="0">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>verticalLayout</cstring>
|
||||||
|
</property>
|
||||||
|
<vbox>
|
||||||
|
<widget class="TQLabel">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>lblPixmap</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>5</hsizetype>
|
||||||
|
<vsizetype>5</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Lock Icon here</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>WordBreak</set>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>lePassword</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<spacer>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>verticalSpacer</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>92</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</vbox>
|
||||||
|
</widget>
|
||||||
|
<widget class="TQLayoutWidget" row="0" column="1" colspan="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>verticalLayout_2</cstring>
|
||||||
|
</property>
|
||||||
|
<vbox>
|
||||||
|
<widget class="TQLabel">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>lblHeader</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>3</hsizetype>
|
||||||
|
<vsizetype>3</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><b>Header is here!</b></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>WordBreak</set>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>lePassword</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="TQLabel">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>lblContent</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>3</hsizetype>
|
||||||
|
<vsizetype>3</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"><i>Content</i></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>WordBreak</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</vbox>
|
||||||
|
</widget>
|
||||||
|
<widget class="TQLabel" row="2" column="1" colspan="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>errorMessageKTW</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy>
|
||||||
|
<hsizetype>3</hsizetype>
|
||||||
|
<vsizetype>3</vsizetype>
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="TQLabel" row="3" column="1" colspan="2">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>lblPassword</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Password:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>lePassword</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="KLineEdit" row="3" column="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>lePassword</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="echoMode">
|
||||||
|
<enum>Password</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="KComboBox" row="1" column="1" colspan="3">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>userCB</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</grid>
|
||||||
|
</widget>
|
||||||
|
<!--customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>KTitleWidget</class>
|
||||||
|
<extends>TQWidget</extends>
|
||||||
|
<header>ktitlewidget.h</header>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets-->
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>userCB</tabstop>
|
||||||
|
<tabstop>lePassword</tabstop>
|
||||||
|
</tabstops>
|
||||||
|
</UI>
|
@ -1,91 +0,0 @@
|
|||||||
<ui version="4.0" >
|
|
||||||
<class>AuthDetails</class>
|
|
||||||
<widget class="TQWidget" name="AuthDetails" >
|
|
||||||
<property name="geometry" >
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>273</width>
|
|
||||||
<height>80</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<layout class="TQGridLayout" name="gridLayout" >
|
|
||||||
<item row="1" column="0" >
|
|
||||||
<widget class="TQLabel" name="label" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Application:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" >
|
|
||||||
<widget class="TQLabel" name="label_3" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Action:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" >
|
|
||||||
<widget class="TQLabel" name="vendorL" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Vendor:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1" colspan="3" >
|
|
||||||
<widget class="KUrlLabel" name="vendorUL" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Vendor:</string>
|
|
||||||
</property>
|
|
||||||
<property name="tipText" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="useTips" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1" colspan="3" >
|
|
||||||
<widget class="KUrlLabel" name="action_label" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Action:</string>
|
|
||||||
</property>
|
|
||||||
<property name="tipText" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="useTips" >
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="4" >
|
|
||||||
<widget class="Line" name="line" >
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>TQt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1" colspan="3" >
|
|
||||||
<widget class="TQLabel" name="app_label" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Application:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>KUrlLabel</class>
|
|
||||||
<extends>TQLabel</extends>
|
|
||||||
<header>kurllabel.h</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
@ -1,10 +0,0 @@
|
|||||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
|
||||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
|
||||||
<node>
|
|
||||||
<interface name="org.kde.Polkit1AuthAgent">
|
|
||||||
<method name="setWIdForAction">
|
|
||||||
<arg type="s" direction="in" />
|
|
||||||
<arg type="t" direction="in" />
|
|
||||||
</method>
|
|
||||||
</interface>
|
|
||||||
</node>
|
|
@ -1,237 +0,0 @@
|
|||||||
/* This file is part of the KDE project
|
|
||||||
Copyright (C) 2009 Jaroslav Reznik <jreznik@redhat.com>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public License
|
|
||||||
along with this library; see the file COPYING.LIB. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "policykitlistener.h"
|
|
||||||
#include "AuthDialog.h"
|
|
||||||
|
|
||||||
#include <KDebug>
|
|
||||||
#include <KWindowSystem>
|
|
||||||
|
|
||||||
#include <PolkitTQt1/Agent/Listener>
|
|
||||||
#include <PolkitTQt1/Agent/Session>
|
|
||||||
#include <PolkitTQt1/Subject>
|
|
||||||
#include <PolkitTQt1/Identity>
|
|
||||||
#include <PolkitTQt1/Details>
|
|
||||||
#include <TQtDBus/TQDBusConnection>
|
|
||||||
|
|
||||||
#include "polkit1authagentadaptor.h"
|
|
||||||
|
|
||||||
PolicyKitListener::PolicyKitListener(TQObject *parent)
|
|
||||||
: Listener(parent)
|
|
||||||
, m_inProgress(false)
|
|
||||||
, m_selectedUser(0)
|
|
||||||
{
|
|
||||||
(void) new Polkit1AuthAgentAdaptor(this);
|
|
||||||
|
|
||||||
if (!TQDBusConnection::sessionBus().registerObject("/org/kde/Polkit1AuthAgent", this,
|
|
||||||
TQDBusConnection::ExportScriptableSlots |
|
|
||||||
TQDBusConnection::ExportScriptableProperties |
|
|
||||||
TQDBusConnection::ExportAdaptors)) {
|
|
||||||
kWarning() << "Could not initiate DBus helper!";
|
|
||||||
}
|
|
||||||
|
|
||||||
kDebug() << "Listener online";
|
|
||||||
}
|
|
||||||
|
|
||||||
PolicyKitListener::~PolicyKitListener()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void PolicyKitListener::setWIdForAction(const TQString& action, qulonglong wID)
|
|
||||||
{
|
|
||||||
kDebug() << "On to the handshake";
|
|
||||||
m_actionsToWID[action] = wID;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PolicyKitListener::initiateAuthentication(const TQString &actionId,
|
|
||||||
const TQString &message,
|
|
||||||
const TQString &iconName,
|
|
||||||
const PolkitTQt1::Details &details,
|
|
||||||
const TQString &cookie,
|
|
||||||
const PolkitTQt1::Identity::List &identities,
|
|
||||||
PolkitTQt1::Agent::AsyncResult* result)
|
|
||||||
{
|
|
||||||
kDebug() << "Initiating authentication";
|
|
||||||
|
|
||||||
if (m_inProgress) {
|
|
||||||
result->setError(i18n("Another client is already authenticating, please try again later."));
|
|
||||||
result->setCompleted();
|
|
||||||
kDebug() << "Another client is already authenticating, please try again later.";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_identities = identities;
|
|
||||||
m_cookie = cookie;
|
|
||||||
m_result = result;
|
|
||||||
m_session.clear();
|
|
||||||
|
|
||||||
m_inProgress = true;
|
|
||||||
|
|
||||||
WId parentId = 0;
|
|
||||||
|
|
||||||
if (m_actionsToWID.contains(actionId)) {
|
|
||||||
parentId = m_actionsToWID[actionId];
|
|
||||||
}
|
|
||||||
|
|
||||||
m_dialog = new AuthDialog(actionId, message, iconName, details, identities, parentId);
|
|
||||||
connect(m_dialog.data(), SIGNAL(okClicked()), SLOT(dialogAccepted()));
|
|
||||||
connect(m_dialog.data(), SIGNAL(cancelClicked()), SLOT(dialogCanceled()));
|
|
||||||
connect(m_dialog.data(), SIGNAL(adminUserSelected(PolkitTQt1::Identity)), SLOT(userSelected(PolkitTQt1::Identity)));
|
|
||||||
|
|
||||||
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();
|
|
||||||
|
|
||||||
if (identities.length() == 1) {
|
|
||||||
m_selectedUser = identities[0];
|
|
||||||
} else {
|
|
||||||
m_selectedUser = m_dialog.data()->adminUserSelected();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_numTries = 0;
|
|
||||||
tryAgain();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PolicyKitListener::tryAgain()
|
|
||||||
{
|
|
||||||
kDebug() << "Trying again";
|
|
||||||
// test!!!
|
|
||||||
m_wasCancelled = false;
|
|
||||||
|
|
||||||
// We will create new session only when some user is selected
|
|
||||||
if (m_selectedUser.isValid()) {
|
|
||||||
m_session = new Session(m_selectedUser, m_cookie, m_result);
|
|
||||||
connect(m_session.data(), SIGNAL(request(TQString,bool)), this, SLOT(request(TQString,bool)));
|
|
||||||
connect(m_session.data(), SIGNAL(completed(bool)), this, SLOT(completed(bool)));
|
|
||||||
connect(m_session.data(), SIGNAL(showError(TQString)), this, SLOT(showError(TQString)));
|
|
||||||
|
|
||||||
m_session.data()->initiate();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void PolicyKitListener::finishObtainPrivilege()
|
|
||||||
{
|
|
||||||
kDebug() << "Finishing obtaining privileges";
|
|
||||||
|
|
||||||
// Number of tries increase only when some user is selected
|
|
||||||
if (m_selectedUser.isValid()) {
|
|
||||||
m_numTries++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_gainedAuthorization && !m_wasCancelled && !m_dialog.isNull()) {
|
|
||||||
m_dialog.data()->authenticationFailure();
|
|
||||||
|
|
||||||
if (m_numTries < 3) {
|
|
||||||
m_session.data()->deleteLater();
|
|
||||||
|
|
||||||
tryAgain();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_session.isNull()) {
|
|
||||||
m_session.data()->result()->setCompleted();
|
|
||||||
} else {
|
|
||||||
m_result->setCompleted();
|
|
||||||
}
|
|
||||||
m_session.data()->deleteLater();
|
|
||||||
|
|
||||||
if (!m_dialog.isNull()) {
|
|
||||||
m_dialog.data()->hide();
|
|
||||||
m_dialog.data()->deleteLater();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_inProgress = false;
|
|
||||||
|
|
||||||
kDebug() << "Finish obtain authorization:" << m_gainedAuthorization;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PolicyKitListener::initiateAuthenticationFinish()
|
|
||||||
{
|
|
||||||
kDebug() << "Finishing authentication";
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PolicyKitListener::cancelAuthentication()
|
|
||||||
{
|
|
||||||
kDebug() << "Cancelling authentication";
|
|
||||||
|
|
||||||
m_wasCancelled = true;
|
|
||||||
finishObtainPrivilege();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PolicyKitListener::request(const TQString &request, bool echo)
|
|
||||||
{
|
|
||||||
Q_UNUSED(echo);
|
|
||||||
kDebug() << "Request: " << request;
|
|
||||||
|
|
||||||
if (!m_dialog.isNull()) {
|
|
||||||
m_dialog.data()->setRequest(request, m_selectedUser.isValid() &&
|
|
||||||
m_selectedUser.toString() == "unix-user:root");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PolicyKitListener::completed(bool gainedAuthorization)
|
|
||||||
{
|
|
||||||
kDebug() << "Completed: " << gainedAuthorization;
|
|
||||||
|
|
||||||
m_gainedAuthorization = gainedAuthorization;
|
|
||||||
|
|
||||||
finishObtainPrivilege();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PolicyKitListener::showError(const TQString &text)
|
|
||||||
{
|
|
||||||
kDebug() << "Error: " << text;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PolicyKitListener::dialogAccepted()
|
|
||||||
{
|
|
||||||
kDebug() << "Dialog accepted";
|
|
||||||
|
|
||||||
if (!m_dialog.isNull()) {
|
|
||||||
m_session.data()->setResponse(m_dialog.data()->password());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PolicyKitListener::dialogCanceled()
|
|
||||||
{
|
|
||||||
kDebug() << "Dialog cancelled";
|
|
||||||
|
|
||||||
m_wasCancelled = true;
|
|
||||||
if (!m_session.isNull()) {
|
|
||||||
m_session.data()->cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
finishObtainPrivilege();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PolicyKitListener::userSelected(const PolkitTQt1::Identity &identity)
|
|
||||||
{
|
|
||||||
m_selectedUser = identity;
|
|
||||||
// If some user is selected we must destroy existing session
|
|
||||||
if (!m_session.isNull()) {
|
|
||||||
m_session.data()->deleteLater();
|
|
||||||
}
|
|
||||||
tryAgain();
|
|
||||||
}
|
|
@ -1,80 +0,0 @@
|
|||||||
#ifndef POLICYKITLISTENER_H
|
|
||||||
#define POLICYKITLISTENER_H
|
|
||||||
|
|
||||||
/* This file is part of the KDE project
|
|
||||||
Copyright (C) 2009 Jaroslav Reznik <jreznik@redhat.com>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public License
|
|
||||||
along with this library; see the file COPYING.LIB. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <PolkitTQt1/Agent/Listener>
|
|
||||||
|
|
||||||
#include <TQtCore/TQWeakPointer>
|
|
||||||
#include <TQtCore/TQHash>
|
|
||||||
|
|
||||||
class AuthDialog;
|
|
||||||
|
|
||||||
using namespace PolkitTQt1::Agent;
|
|
||||||
|
|
||||||
class PolicyKitListener : public Listener
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
TQ_CLASSINFO("D-Bus Interface", "org.kde.Polkit1AuthAgent")
|
|
||||||
public:
|
|
||||||
PolicyKitListener(TQObject *parent = 0);
|
|
||||||
virtual ~PolicyKitListener();
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void initiateAuthentication(const TQString &actionId,
|
|
||||||
const TQString &message,
|
|
||||||
const TQString &iconName,
|
|
||||||
const PolkitTQt1::Details &details,
|
|
||||||
const TQString &cookie,
|
|
||||||
const PolkitTQt1::Identity::List &identities,
|
|
||||||
PolkitTQt1::Agent::AsyncResult* result);
|
|
||||||
bool initiateAuthenticationFinish();
|
|
||||||
void cancelAuthentication();
|
|
||||||
|
|
||||||
void tryAgain();
|
|
||||||
void finishObtainPrivilege();
|
|
||||||
|
|
||||||
void request(const TQString &request, bool echo);
|
|
||||||
void completed(bool gainedAuthorization);
|
|
||||||
void showError(const TQString &text);
|
|
||||||
|
|
||||||
void setWIdForAction(const TQString &action, qulonglong wID);
|
|
||||||
/* void showInfo(const TQString &text); */
|
|
||||||
private:
|
|
||||||
TQWeakPointer<AuthDialog> m_dialog;
|
|
||||||
TQWeakPointer<Session> m_session;
|
|
||||||
bool m_inProgress;
|
|
||||||
bool m_gainedAuthorization;
|
|
||||||
bool m_wasCancelled;
|
|
||||||
int m_numTries;
|
|
||||||
PolkitTQt1::Identity::List m_identities;
|
|
||||||
PolkitTQt1::Agent::AsyncResult* m_result;
|
|
||||||
TQString m_cookie;
|
|
||||||
PolkitTQt1::Identity m_selectedUser;
|
|
||||||
TQHash< TQString, qulonglong > m_actionsToWID;
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void dialogAccepted();
|
|
||||||
void dialogCanceled();
|
|
||||||
void userSelected(const PolkitTQt1::Identity &identity);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
@ -0,0 +1,226 @@
|
|||||||
|
/* This file is part of the KDE project
|
||||||
|
Copyright (C) 2009 Jaroslav Reznik <jreznik@redhat.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public License
|
||||||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||||||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "polkit-listener.h"
|
||||||
|
#include "AuthDialog.h"
|
||||||
|
|
||||||
|
#include <kdebug.h>
|
||||||
|
#include <tdelocale.h>
|
||||||
|
|
||||||
|
#include <PolkitTQt/Agent/Listener>
|
||||||
|
#include <PolkitTQt/Agent/Session>
|
||||||
|
#include <PolkitTQt/Subject>
|
||||||
|
#include <PolkitTQt/Identity>
|
||||||
|
#include <PolkitTQt/Details>
|
||||||
|
|
||||||
|
using namespace PolkitTQt;
|
||||||
|
using namespace PolkitTQt::Agent;
|
||||||
|
|
||||||
|
PolkitListener::PolkitListener(TQObject *parent) : Listener(parent), m_inProgress(false),
|
||||||
|
m_selectedUser(0), m_result(nullptr), m_session(nullptr)
|
||||||
|
{
|
||||||
|
PolkitTQt::UnixSessionSubject session(getpid());
|
||||||
|
if (!registerListener(session, "/org/trinitydesktop/PolKit1AuthAgent"))
|
||||||
|
{
|
||||||
|
kdWarning() << "Could not initiate DBus listener!" << endl;
|
||||||
|
}
|
||||||
|
kdDebug() << "Listener online" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PolkitListener::clearSession()
|
||||||
|
{
|
||||||
|
if (m_session)
|
||||||
|
{
|
||||||
|
m_session->deleteLater();
|
||||||
|
m_session = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PolkitListener::initiateAuthentication(const TQString &actionId, const TQString &message,
|
||||||
|
const TQString &iconName, const PolkitTQt::Details &details,
|
||||||
|
const TQString &cookie, const Identity::List &identities, AsyncResult* result)
|
||||||
|
{
|
||||||
|
kdDebug() << "Initiating authentication" << endl;
|
||||||
|
|
||||||
|
if (m_inProgress)
|
||||||
|
{
|
||||||
|
result->setError(i18n("Another client is already authenticating, please try again later."));
|
||||||
|
result->setCompleted();
|
||||||
|
kdDebug() << "Another client is already authenticating, please try again later." << endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_identities = identities;
|
||||||
|
m_cookie = cookie;
|
||||||
|
m_result = result;
|
||||||
|
clearSession();
|
||||||
|
|
||||||
|
m_inProgress = true;
|
||||||
|
|
||||||
|
m_dialog = new AuthDialog(actionId, message, iconName, details, identities);
|
||||||
|
connect(m_dialog, TQT_SIGNAL(okClicked()), TQT_SLOT(dialogAccepted()));
|
||||||
|
connect(m_dialog, TQT_SIGNAL(cancelClicked()), TQT_SLOT(dialogCanceled()));
|
||||||
|
connect(m_dialog, TQT_SIGNAL(adminUserSelected(const PolkitTQt::Identity&)),
|
||||||
|
TQT_SLOT(userSelected(const PolkitTQt::Identity&)));
|
||||||
|
|
||||||
|
m_dialog->setOptions();
|
||||||
|
m_dialog->show();
|
||||||
|
|
||||||
|
if (identities.count() == 1)
|
||||||
|
{
|
||||||
|
m_selectedUser = identities[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_selectedUser = m_dialog->adminUserSelected();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_numTries = 0;
|
||||||
|
tryAgain();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PolkitListener::tryAgain()
|
||||||
|
{
|
||||||
|
kdDebug() << "Trying again" << endl;
|
||||||
|
// test!!!
|
||||||
|
m_wasCancelled = false;
|
||||||
|
|
||||||
|
// We will create new session only when some user is selected
|
||||||
|
if (m_selectedUser.isValid())
|
||||||
|
{
|
||||||
|
m_session = new Session(m_selectedUser, m_cookie, m_result);
|
||||||
|
connect(m_session, TQT_SIGNAL(request(const TQString&, bool)), this,
|
||||||
|
TQT_SLOT(request(const TQString&, bool)));
|
||||||
|
connect(m_session, TQT_SIGNAL(completed(bool)), this, TQT_SLOT(completed(bool)));
|
||||||
|
connect(m_session, TQT_SIGNAL(showError(const TQString&)), this,
|
||||||
|
TQT_SLOT(showError(const TQString&)));
|
||||||
|
m_session->initiate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PolkitListener::finishObtainPrivilege()
|
||||||
|
{
|
||||||
|
kdDebug() << "Finishing obtaining privileges" << endl;
|
||||||
|
|
||||||
|
// Number of tries increase only when some user is selected
|
||||||
|
if (m_selectedUser.isValid())
|
||||||
|
{
|
||||||
|
m_numTries++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_gainedAuthorization && !m_wasCancelled && m_dialog)
|
||||||
|
{
|
||||||
|
m_dialog->authenticationFailure();
|
||||||
|
|
||||||
|
if (m_numTries < 3)
|
||||||
|
{
|
||||||
|
clearSession();
|
||||||
|
tryAgain();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_session)
|
||||||
|
{
|
||||||
|
m_session->result()->setCompleted();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_result->setCompleted();
|
||||||
|
}
|
||||||
|
clearSession();
|
||||||
|
|
||||||
|
if (m_dialog)
|
||||||
|
{
|
||||||
|
m_dialog->hide();
|
||||||
|
m_dialog->deleteLater();
|
||||||
|
m_dialog = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_inProgress = false;
|
||||||
|
|
||||||
|
kdDebug() << "Finish obtain authorization:" << m_gainedAuthorization << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PolkitListener::initiateAuthenticationFinish()
|
||||||
|
{
|
||||||
|
kdDebug() << "Finishing authentication" << endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PolkitListener::cancelAuthentication()
|
||||||
|
{
|
||||||
|
kdDebug() << "Cancelling authentication" << endl;
|
||||||
|
m_wasCancelled = true;
|
||||||
|
finishObtainPrivilege();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PolkitListener::request(const TQString &request, bool _)
|
||||||
|
{
|
||||||
|
kdDebug() << "Request: " << request << endl;
|
||||||
|
if (m_dialog)
|
||||||
|
{
|
||||||
|
m_dialog->setRequest(request, m_selectedUser.isValid() &&
|
||||||
|
m_selectedUser.toString() == "unix-user:root");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PolkitListener::completed(bool gainedAuthorization)
|
||||||
|
{
|
||||||
|
kdDebug() << "Completed: " << gainedAuthorization << endl;
|
||||||
|
m_gainedAuthorization = gainedAuthorization;
|
||||||
|
finishObtainPrivilege();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PolkitListener::showError(const TQString &text)
|
||||||
|
{
|
||||||
|
kdDebug() << "Error: " << text << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PolkitListener::dialogAccepted()
|
||||||
|
{
|
||||||
|
kdDebug() << "Dialog accepted" << endl;
|
||||||
|
if (m_session)
|
||||||
|
{
|
||||||
|
m_session->setResponse(m_dialog->password());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PolkitListener::dialogCanceled()
|
||||||
|
{
|
||||||
|
kdDebug() << "Dialog cancelled" << endl;
|
||||||
|
m_wasCancelled = true;
|
||||||
|
if (m_session)
|
||||||
|
{
|
||||||
|
m_session->cancel();
|
||||||
|
}
|
||||||
|
finishObtainPrivilege();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PolkitListener::userSelected(const PolkitTQt::Identity &identity)
|
||||||
|
{
|
||||||
|
m_selectedUser = identity;
|
||||||
|
// If some user is selected we must destroy existing session
|
||||||
|
clearSession();
|
||||||
|
tryAgain();
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "polkit-listener.moc"
|
||||||
|
|
@ -0,0 +1,71 @@
|
|||||||
|
/* This file is part of the TDE project
|
||||||
|
Copyright (C) 2009 Jaroslav Reznik <jreznik@redhat.com>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public License
|
||||||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||||||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef POLKIT_LISTENER_H
|
||||||
|
#define POLKIT_LISTENER_H
|
||||||
|
|
||||||
|
#include <PolkitTQt/Agent/Listener>
|
||||||
|
|
||||||
|
class AuthDialog;
|
||||||
|
|
||||||
|
class PolkitListener : public PolkitTQt::Agent::Listener
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
PolkitListener(TQObject *parent = 0);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void initiateAuthentication(const TQString &actionId, const TQString &message,
|
||||||
|
const TQString &iconName, const PolkitTQt::Details &details,
|
||||||
|
const TQString &cookie, const PolkitTQt::Identity::List &identities,
|
||||||
|
PolkitTQt::Agent::AsyncResult* result);
|
||||||
|
bool initiateAuthenticationFinish();
|
||||||
|
void cancelAuthentication();
|
||||||
|
|
||||||
|
void tryAgain();
|
||||||
|
void finishObtainPrivilege();
|
||||||
|
|
||||||
|
void request(const TQString &request, bool _);
|
||||||
|
void completed(bool gainedAuthorization);
|
||||||
|
void showError(const TQString &text);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void clearSession();
|
||||||
|
|
||||||
|
AuthDialog *m_dialog;
|
||||||
|
bool m_inProgress;
|
||||||
|
bool m_gainedAuthorization;
|
||||||
|
bool m_wasCancelled;
|
||||||
|
int m_numTries;
|
||||||
|
TQString m_cookie;
|
||||||
|
PolkitTQt::Identity::List m_identities;
|
||||||
|
PolkitTQt::Identity m_selectedUser;
|
||||||
|
PolkitTQt::Agent::AsyncResult* m_result;
|
||||||
|
PolkitTQt::Agent::Session *m_session;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void dialogAccepted();
|
||||||
|
void dialogCanceled();
|
||||||
|
void userSelected(const PolkitTQt::Identity &identity);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in new issue