[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/PolicyKit-kde/src
From: Dirk Mueller <mueller () kde ! org>
Date: 2008-04-12 0:06:14
Message-ID: 1207958774.406005.25104.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 795940 by mueller:
slightly nicer dialog. just when I learned about KPasswordEdit..
I'll switch to that one tomorrow.
M +0 -2 CMakeLists.txt
M +9 -11 authdialog.cpp
M +1 -2 authdialog.h
M +1 -112 authdialogui.ui
--- trunk/playground/base/PolicyKit-kde/src/CMakeLists.txt #795939:795940
@@ -1,7 +1,5 @@
find_package(KDE4 REQUIRED)
-add_definitions (-DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS)
-
include_directories(
${KDE4_INCLUDES}
${POLKIT_INCLUDE_DIRS}
--- trunk/playground/base/PolicyKit-kde/src/authdialog.cpp #795939:795940
@@ -20,7 +20,6 @@
*/
#include "authdialog.h"
-#include "authdialog.moc"
#include <qlabel.h>
#include <qstring.h>
@@ -44,10 +43,15 @@
*/
AuthDialog::AuthDialog( const QString &header,
PolKitResult type)
- : QDialog(0), AuthDialogUI()
+ : KDialog(0), AuthDialogUI()
{
- setupUi(this);
+ setButtons(Ok|Cancel);
+ setCaption(header);
+ QWidget* w = new QWidget(this);
+ setupUi(w);
+ setMainWidget(w);
+
if (type == POLKIT_RESULT_UNKNOWN || \
type == POLKIT_RESULT_NO || \
type == POLKIT_RESULT_YES || \
@@ -55,9 +59,8 @@
kDebug() << "Unexpected PolkitResult type sent: " << \
polkit_result_to_string_representation(type);
KIconLoader* iconloader = KIconLoader::global();
- lblPixmap->setPixmap(iconloader->loadIcon("lock", KIconLoader::Desktop));
- pbOK->setIconSet(iconloader->loadIconSet("ok", KIconLoader::Small, 0, false));
- pbCancel->setIconSet(iconloader->loadIconSet("cancel", KIconLoader::Small, 0, \
false)); + lblPixmap->setPixmap(iconloader->loadIcon("dialog-password", \
KIconLoader::NoGroup, + KIconLoader::SizeHuge));
cbUsers->hide();
@@ -122,11 +125,6 @@
lblPassword->setText(i18n("Password") + ":");
}
-const char* AuthDialog::getPass()
-{
- return lePassword->text();
-}
-
void AuthDialog::setType(PolKitResult res)
{
if (res == POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH || \
--- trunk/playground/base/PolicyKit-kde/src/authdialog.h #795939:795940
@@ -27,12 +27,11 @@
#include "ui_authdialogui.h"
-class AuthDialog : public QDialog, public Ui::AuthDialogUI
+class AuthDialog : public KDialog, public Ui::AuthDialogUI
{
public:
AuthDialog( const QString &header, PolKitResult type);
~AuthDialog();
- const char* getPass();
void setType(PolKitResult type);
void setContent(const QString &);
void setContent();
--- trunk/playground/base/PolicyKit-kde/src/authdialogui.ui #795939:795940
@@ -1,6 +1,6 @@
<ui version="4.0" >
<class>AuthDialogUI</class>
- <widget class="QDialog" name="AuthDialogUI" >
+ <widget class="QWidget" name="AuthDialogUI" >
<property name="geometry" >
<rect>
<x>0</x>
@@ -12,9 +12,6 @@
<property name="windowTitle" >
<string>Authentication Required</string>
</property>
- <property name="sizeGripEnabled" >
- <bool>false</bool>
- </property>
<layout class="QGridLayout" >
<property name="margin" >
<number>5</number>
@@ -120,80 +117,6 @@
</item>
</layout>
</item>
- <item row="5" column="0" colspan="2" >
- <layout class="QHBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <spacer name="Horizontal Spacing2" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>267</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="pbOK" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>&OK</string>
- </property>
- <property name="shortcut" >
- <string>Alt+O</string>
- </property>
- <property name="autoDefault" >
- <bool>true</bool>
- </property>
- <property name="default" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="pbCancel" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>&Cancel</string>
- </property>
- <property name="shortcut" >
- <string>Ctrl+S</string>
- </property>
- <property name="autoDefault" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="4" column="0" colspan="2" >
- <widget class="Line" name="line" >
- <property name="frameShape" >
- <enum>QFrame::HLine</enum>
- </property>
- <property name="frameShadow" >
- <enum>QFrame::Sunken</enum>
- </property>
- </widget>
- </item>
<item row="1" column="1" >
<widget class="KComboBox" name="cbUsers" >
<property name="toolTip" >
@@ -247,8 +170,6 @@
<tabstop>cbUsers</tabstop>
<tabstop>cbRemember</tabstop>
<tabstop>cbSession</tabstop>
- <tabstop>pbOK</tabstop>
- <tabstop>pbCancel</tabstop>
</tabstops>
<includes>
<include location="local" >kcombobox.h</include>
@@ -271,37 +192,5 @@
</hint>
</hints>
</connection>
- <connection>
- <sender>pbCancel</sender>
- <signal>clicked()</signal>
- <receiver>AuthDialogUI</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>20</x>
- <y>20</y>
- </hint>
- <hint type="destinationlabel" >
- <x>20</x>
- <y>20</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>pbOK</sender>
- <signal>clicked()</signal>
- <receiver>AuthDialogUI</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>20</x>
- <y>20</y>
- </hint>
- <hint type="destinationlabel" >
- <x>20</x>
- <y>20</y>
- </hint>
- </hints>
- </connection>
</connections>
</ui>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic