Raw Qt->TQt conversion using tde/scripts/conversions/qt3-tqt3/convert_existing_qt3_app_to_tq

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
r14.0.x
Michele Calgaro 2 years ago
parent 5a3408879d
commit 35181c8a0f
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -23,25 +23,25 @@
#include "AuthDialog.h" #include "AuthDialog.h"
#include <QtCore/QProcess> #include <TQtCore/TQProcess>
#include <QtGui/QPainter> #include <TQtGui/TQPainter>
#include <QtGui/QStandardItemModel> #include <TQtGui/TQStandardItemModel>
#include <KDebug> #include <KDebug>
#include <KToolInvocation> #include <KToolInvocation>
#include <KUser> #include <KUser>
#include <PolkitQt1/Authority> #include <PolkitTQt1/Authority>
#include <PolkitQt1/Details> #include <PolkitTQt1/Details>
#include <KWindowSystem> #include <KWindowSystem>
#include <KNotification> #include <KNotification>
AuthDialog::AuthDialog(const QString &actionId, AuthDialog::AuthDialog(const TQString &actionId,
const QString &message, const TQString &message,
const QString &iconName, const TQString &iconName,
const PolkitQt1::Details &details, const PolkitTQt1::Details &details,
const PolkitQt1::Identity::List &identities, const PolkitTQt1::Identity::List &identities,
WId parent) WId parent)
: KDialog(0) : KDialog(0)
{ {
@ -71,29 +71,29 @@ AuthDialog::AuthDialog(const QString &actionId,
} }
// loads the standard key icon // loads the standard key icon
QPixmap icon = KIconLoader::global()->loadIcon("dialog-password", TQPixmap icon = KIconLoader::global()->loadIcon("dialog-password",
KIconLoader::NoGroup, KIconLoader::NoGroup,
KIconLoader::SizeHuge, KIconLoader::SizeHuge,
KIconLoader::DefaultState); KIconLoader::DefaultState);
// create a painter to paint the action icon over the key icon // create a painter to paint the action icon over the key icon
QPainter painter(&icon); TQPainter painter(&icon);
const int iconSize = icon.size().width(); const int iconSize = icon.size().width();
// the the emblem icon to size 32 // the the emblem icon to size 32
int overlaySize = 32; int overlaySize = 32;
// try to load the action icon // try to load the action icon
const QPixmap pixmap = KIconLoader::global()->loadIcon(iconName, const TQPixmap pixmap = KIconLoader::global()->loadIcon(iconName,
KIconLoader::NoGroup, KIconLoader::NoGroup,
overlaySize, overlaySize,
KIconLoader::DefaultState, KIconLoader::DefaultState,
QStringList(), TQStringList(),
0, 0,
true); true);
// if we're able to load the action icon paint it over the // if we're able to load the action icon paint it over the
// key icon. // key icon.
if (!pixmap.isNull()) { if (!pixmap.isNull()) {
QPoint startPoint; TQPoint startPoint;
// bottom right corner // bottom right corner
startPoint = QPoint(iconSize - overlaySize - 2, startPoint = TQPoint(iconSize - overlaySize - 2,
iconSize - overlaySize - 2); iconSize - overlaySize - 2);
painter.drawPixmap(startPoint, pixmap); painter.drawPixmap(startPoint, pixmap);
} }
@ -102,7 +102,7 @@ AuthDialog::AuthDialog(const QString &actionId,
lblPixmap->setPixmap(icon); lblPixmap->setPixmap(icon);
// find action description for actionId // find action description for actionId
foreach(const PolkitQt1::ActionDescription &desc, PolkitQt1::Authority::instance()->enumerateActionsSync()) { foreach(const PolkitTQt1::ActionDescription &desc, PolkitTQt1::Authority::instance()->enumerateActionsSync()) {
if (actionId == desc.actionId()) { if (actionId == desc.actionId()) {
m_actionDescription = desc; m_actionDescription = desc;
kDebug() << "Action description has been found" ; kDebug() << "Action description has been found" ;
@ -125,7 +125,7 @@ AuthDialog::AuthDialog(const QString &actionId,
createUserCB(identities); createUserCB(identities);
} else { } else {
userCB->addItem("", QVariant(identities[0].toString())); userCB->addItem("", TQVariant(identities[0].toString()));
userCB->setCurrentIndex(0); userCB->setCurrentIndex(0);
} }
} }
@ -141,11 +141,11 @@ void AuthDialog::accept()
return; return;
} }
void AuthDialog::setRequest(const QString &request, bool requiresAdmin) void AuthDialog::setRequest(const TQString &request, bool requiresAdmin)
{ {
kDebug() << request; kDebug() << request;
PolkitQt1::Identity identity = adminUserSelected(); PolkitTQt1::Identity identity = adminUserSelected();
if (request.startsWith(QLatin1String("password:"), Qt::CaseInsensitive)) { if (request.startsWith(TQLatin1String("password:"), TQt::CaseInsensitive)) {
if (requiresAdmin) { if (requiresAdmin) {
if (!identity.isValid()) { if (!identity.isValid()) {
lblPassword->setText(i18n("Password for root:")); lblPassword->setText(i18n("Password for root:"));
@ -156,8 +156,8 @@ void AuthDialog::setRequest(const QString &request, bool requiresAdmin)
} else { } else {
lblPassword->setText(i18n("Password:")); lblPassword->setText(i18n("Password:"));
} }
} else if (request.startsWith(QLatin1String("password or swipe finger:"), } else if (request.startsWith(TQLatin1String("password or swipe finger:"),
Qt::CaseInsensitive)) { TQt::CaseInsensitive)) {
if (requiresAdmin) { if (requiresAdmin) {
if (!identity.isValid()) { if (!identity.isValid()) {
lblPassword->setText(i18n("Password or swipe finger for root:")); lblPassword->setText(i18n("Password or swipe finger for root:"));
@ -180,7 +180,7 @@ void AuthDialog::setOptions()
" Authentication is required to perform this action.")); " Authentication is required to perform this action."));
} }
void AuthDialog::createUserCB(const PolkitQt1::Identity::List &identities) void AuthDialog::createUserCB(const PolkitTQt1::Identity::List &identities)
{ {
/* if we've already built the list of admin users once, then avoid /* if we've already built the list of admin users once, then avoid
* doing it again.. (this is mainly used when the user entered the * doing it again.. (this is mainly used when the user entered the
@ -191,14 +191,14 @@ void AuthDialog::createUserCB(const PolkitQt1::Identity::List &identities)
userCB->clear(); userCB->clear();
// Adds a Dummy user // Adds a Dummy user
userCB->addItem(i18n("Select User"), qVariantFromValue<QString> (QString())); userCB->addItem(i18n("Select User"), qVariantFromValue<TQString> (TQString()));
qobject_cast<QStandardItemModel *>(userCB->model())->item(userCB->count()-1)->setEnabled(false); qobject_cast<TQStandardItemModel *>(userCB->model())->item(userCB->count()-1)->setEnabled(false);
// For each user // For each user
int index = 1; // Start at 1 because of the "Select User" entry int index = 1; // Start at 1 because of the "Select User" entry
int currentUserIndex = -1; int currentUserIndex = -1;
const KUser currentUser; const KUser currentUser;
foreach(const PolkitQt1::Identity &identity, identities) { foreach(const PolkitTQt1::Identity &identity, identities) {
// First check to see if the user is valid // First check to see if the user is valid
kDebug() << "User: " << identity.toString(); kDebug() << "User: " << identity.toString();
const KUser user(identity.toString().remove("unix-user:")); const KUser user(identity.toString().remove("unix-user:"));
@ -208,7 +208,7 @@ void AuthDialog::createUserCB(const PolkitQt1::Identity::List &identities)
} }
// Display user Full Name IF available // Display user Full Name IF available
QString display; TQString display;
if (!user.property(KUser::FullName).toString().isEmpty()) { if (!user.property(KUser::FullName).toString().isEmpty()) {
display = i18nc("%1 is the full user name, %2 is the user login name", "%1 (%2)", user.property(KUser::FullName).toString(), user.loginName()); display = i18nc("%1 is the full user name, %2 is the user login name", "%1 (%2)", user.property(KUser::FullName).toString(), user.loginName());
} else { } else {
@ -223,7 +223,7 @@ void AuthDialog::createUserCB(const PolkitQt1::Identity::List &identities)
icon = KIcon("user-identity"); icon = KIcon("user-identity");
} }
// appends the user item // appends the user item
userCB->addItem(icon, display, qVariantFromValue<QString> (identity.toString())); userCB->addItem(icon, display, qVariantFromValue<TQString> (identity.toString()));
if (user == currentUser) { if (user == currentUser) {
currentUserIndex = index; currentUserIndex = index;
@ -239,20 +239,20 @@ void AuthDialog::createUserCB(const PolkitQt1::Identity::List &identities)
} }
} }
PolkitQt1::Identity AuthDialog::adminUserSelected() const PolkitTQt1::Identity AuthDialog::adminUserSelected() const
{ {
if (userCB->currentIndex() == -1) if (userCB->currentIndex() == -1)
return PolkitQt1::Identity(); return PolkitTQt1::Identity();
QString id = userCB->itemData(userCB->currentIndex()).toString(); TQString id = userCB->itemData(userCB->currentIndex()).toString();
if (id.isEmpty()) if (id.isEmpty())
return PolkitQt1::Identity(); return PolkitTQt1::Identity();
return PolkitQt1::Identity::fromString(id); return PolkitTQt1::Identity::fromString(id);
} }
void AuthDialog::on_userCB_currentIndexChanged(int /*index*/) void AuthDialog::on_userCB_currentIndexChanged(int /*index*/)
{ {
PolkitQt1::Identity identity = adminUserSelected(); PolkitTQt1::Identity identity = adminUserSelected();
// itemData is Null when "Select user" is selected // itemData is Null when "Select user" is selected
if (!identity.isValid()) { if (!identity.isValid()) {
lePassword->setEnabled(false); lePassword->setEnabled(false);
@ -269,7 +269,7 @@ void AuthDialog::on_userCB_currentIndexChanged(int /*index*/)
} }
} }
QString AuthDialog::password() const TQString AuthDialog::password() const
{ {
return lePassword->text(); return lePassword->text();
} }
@ -277,7 +277,7 @@ QString AuthDialog::password() const
void AuthDialog::authenticationFailure() void AuthDialog::authenticationFailure()
{ {
errorMessageKTW->setText(i18n("Authentication failure, please try again."), KTitleWidget::ErrorMessage); errorMessageKTW->setText(i18n("Authentication failure, please try again."), KTitleWidget::ErrorMessage);
QFont bold = font(); TQFont bold = font();
bold.setBold(true); bold.setBold(true);
lblPassword->setFont(bold); lblPassword->setFont(bold);
lePassword->setEnabled(true); lePassword->setEnabled(true);
@ -285,7 +285,7 @@ void AuthDialog::authenticationFailure()
lePassword->setFocus(); lePassword->setFocus();
} }
void AuthDialog::showEvent(QShowEvent *event) void AuthDialog::showEvent(TQShowEvent *event)
{ {
KDialog::showEvent(event); KDialog::showEvent(event);
if (winId() != KWindowSystem::activeWindow()) if (winId() != KWindowSystem::activeWindow())
@ -294,12 +294,12 @@ void AuthDialog::showEvent(QShowEvent *event)
KNotification::Persistent | KNotification::CloseWhenWidgetActivated); KNotification::Persistent | KNotification::CloseWhenWidgetActivated);
kDebug() << "Notificate: " << notification->eventId(); kDebug() << "Notificate: " << notification->eventId();
notification->setText(m_message); notification->setText(m_message);
QPixmap icon = KIconLoader::global()->loadIcon("dialog-password", TQPixmap icon = KIconLoader::global()->loadIcon("dialog-password",
KIconLoader::NoGroup, KIconLoader::NoGroup,
KIconLoader::SizeHuge, KIconLoader::SizeHuge,
KIconLoader::DefaultState); KIconLoader::DefaultState);
notification->setPixmap(icon); notification->setPixmap(icon);
notification->setActions(QStringList() << i18n("Switch to dialog") << i18n("Cancel")); notification->setActions(TQStringList() << i18n("Switch to dialog") << i18n("Cancel"));
connect(notification, SIGNAL(activated(uint)), this, SLOT(notificationActivated(uint))); connect(notification, SIGNAL(activated(uint)), this, SLOT(notificationActivated(uint)));
notification->sendEvent(); notification->sendEvent();
@ -316,25 +316,25 @@ void AuthDialog::notificationActivated(unsigned int action)
} }
} }
AuthDetails::AuthDetails(const PolkitQt1::Details &details, AuthDetails::AuthDetails(const PolkitTQt1::Details &details,
const PolkitQt1::ActionDescription &actionDescription, const PolkitTQt1::ActionDescription &actionDescription,
const QString &appname, const TQString &appname,
QWidget *parent) TQWidget *parent)
: QWidget(parent) : TQWidget(parent)
{ {
setupUi(this); setupUi(this);
app_label->setText(appname); app_label->setText(appname);
foreach(const QString &key, details.keys()) { //krazy:exclude=foreach (Details is not a map/hash, but rather a method) foreach(const TQString &key, details.keys()) { //krazy:exclude=foreach (Details is not a map/hash, but rather a method)
int row = gridLayout->rowCount() + 1; int row = gridLayout->rowCount() + 1;
QLabel *keyLabel = new QLabel(this); TQLabel *keyLabel = new TQLabel(this);
keyLabel->setText(i18nc("%1 is the name of a detail about the current action " keyLabel->setText(i18nc("%1 is the name of a detail about the current action "
"provided by polkit", "%1:", key)); "provided by polkit", "%1:", key));
gridLayout->addWidget(keyLabel, row, 0); gridLayout->addWidget(keyLabel, row, 0);
QLabel *valueLabel = new QLabel(this); TQLabel *valueLabel = new TQLabel(this);
valueLabel->setText(details.lookup(key)); valueLabel->setText(details.lookup(key));
gridLayout->addWidget(valueLabel, row, 1); gridLayout->addWidget(valueLabel, row, 1);
} }
@ -344,8 +344,8 @@ AuthDetails::AuthDetails(const PolkitQt1::Details &details,
action_label->setTipText(i18n("Click to edit %1", actionDescription.actionId())); action_label->setTipText(i18n("Click to edit %1", actionDescription.actionId()));
action_label->setUrl(actionDescription.actionId()); action_label->setUrl(actionDescription.actionId());
QString vendor = actionDescription.vendorName(); TQString vendor = actionDescription.vendorName();
QString vendorUrl = actionDescription.vendorUrl(); TQString vendorUrl = actionDescription.vendorUrl();
if (!vendor.isEmpty()) { if (!vendor.isEmpty()) {
vendorUL->setText(vendor); vendorUL->setText(vendor);
@ -360,18 +360,18 @@ AuthDetails::AuthDetails(const PolkitQt1::Details &details,
vendorUL->hide(); vendorUL->hide();
} }
connect(vendorUL, SIGNAL(leftClickedUrl(QString)), SLOT(openUrl(QString))); connect(vendorUL, SIGNAL(leftClickedUrl(TQString)), SLOT(openUrl(TQString)));
connect(action_label, SIGNAL(leftClickedUrl(QString)), SLOT(openAction(QString))); connect(action_label, SIGNAL(leftClickedUrl(TQString)), SLOT(openAction(TQString)));
} }
void AuthDetails::openUrl(const QString& url) void AuthDetails::openUrl(const TQString& url)
{ {
KToolInvocation::invokeBrowser(url); KToolInvocation::invokeBrowser(url);
} }
void AuthDetails::openAction(const QString &url) void AuthDetails::openAction(const TQString &url)
{ {
QProcess::startDetached("polkit-kde-authorization", QStringList() << url); TQProcess::startDetached("polkit-kde-authorization", TQStringList() << url);
} }
#include "AuthDialog.moc" #include "AuthDialog.moc"

@ -26,10 +26,10 @@
#include "ui_AuthDialog.h" #include "ui_AuthDialog.h"
#include "ui_authdetails.h" #include "ui_authdetails.h"
#include <PolkitQt1/Identity> #include <PolkitTQt1/Identity>
#include <PolkitQt1/ActionDescription> #include <PolkitTQt1/ActionDescription>
namespace PolkitQt1 namespace PolkitTQt1
{ {
class Details; class Details;
} }
@ -38,25 +38,25 @@ class AuthDialog : public KDialog, private Ui::AuthDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
AuthDialog(const QString &actionId, AuthDialog(const TQString &actionId,
const QString &message, const TQString &message,
const QString &iconName, const TQString &iconName,
const PolkitQt1::Details &details, const PolkitTQt1::Details &details,
const PolkitQt1::Identity::List &identities, const PolkitTQt1::Identity::List &identities,
WId parent); WId parent);
~AuthDialog(); ~AuthDialog();
void setRequest(const QString &request, bool requiresAdmin); void setRequest(const TQString &request, bool requiresAdmin);
void setOptions(); void setOptions();
QString password() const; TQString password() const;
void authenticationFailure(); void authenticationFailure();
PolkitQt1::Identity adminUserSelected() const; PolkitTQt1::Identity adminUserSelected() const;
PolkitQt1::ActionDescription m_actionDescription; PolkitTQt1::ActionDescription m_actionDescription;
signals: signals:
void adminUserSelected(PolkitQt1::Identity); void adminUserSelected(PolkitTQt1::Identity);
public slots: public slots:
virtual void accept(); virtual void accept();
@ -66,25 +66,25 @@ private slots:
void notificationActivated(unsigned int action); void notificationActivated(unsigned int action);
private: private:
QString m_appname; TQString m_appname;
QString m_message; TQString m_message;
void createUserCB(const PolkitQt1::Identity::List &identities); void createUserCB(const PolkitTQt1::Identity::List &identities);
void showEvent(QShowEvent *); void showEvent(TQShowEvent *);
}; };
class AuthDetails : public QWidget, private Ui::AuthDetails class AuthDetails : public TQWidget, private Ui::AuthDetails
{ {
Q_OBJECT Q_OBJECT
public: public:
AuthDetails(const PolkitQt1::Details &details, AuthDetails(const PolkitTQt1::Details &details,
const PolkitQt1::ActionDescription &actionDescription, const PolkitTQt1::ActionDescription &actionDescription,
const QString &appname, const TQString &appname,
QWidget *parent); TQWidget *parent);
private slots: private slots:
void openUrl(const QString&); void openUrl(const TQString&);
void openAction(const QString&); void openAction(const TQString&);
}; };
#endif // AUTHDIALOG_H #endif // AUTHDIALOG_H

@ -1,6 +1,6 @@
<ui version="4.0" > <ui version="4.0" >
<class>AuthDialog</class> <class>AuthDialog</class>
<widget class="QWidget" name="AuthDialog" > <widget class="TQWidget" name="AuthDialog" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
@ -15,11 +15,11 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<layout class="QGridLayout" name="gridLayout" > <layout class="TQGridLayout" name="gridLayout" >
<item rowspan="6" row="0" column="0" > <item rowspan="6" row="0" column="0" >
<layout class="QVBoxLayout" name="verticalLayout" > <layout class="TQVBoxLayout" name="verticalLayout" >
<item> <item>
<widget class="QLabel" name="lblPixmap" > <widget class="TQLabel" name="lblPixmap" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" > <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -40,7 +40,7 @@
<item> <item>
<spacer name="verticalSpacer" > <spacer name="verticalSpacer" >
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>TQt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0" > <property name="sizeHint" stdset="0" >
<size> <size>
@ -53,9 +53,9 @@
</layout> </layout>
</item> </item>
<item row="0" column="1" colspan="3" > <item row="0" column="1" colspan="3" >
<layout class="QVBoxLayout" name="verticalLayout_2" > <layout class="TQVBoxLayout" name="verticalLayout_2" >
<item> <item>
<widget class="QLabel" name="lblHeader" > <widget class="TQLabel" name="lblHeader" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" > <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -74,7 +74,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="lblContent" > <widget class="TQLabel" name="lblContent" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" > <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -95,7 +95,7 @@
<widget class="KTitleWidget" name="errorMessageKTW" /> <widget class="KTitleWidget" name="errorMessageKTW" />
</item> </item>
<item row="3" column="1" colspan="2" > <item row="3" column="1" colspan="2" >
<widget class="QLabel" name="lblPassword" > <widget class="TQLabel" name="lblPassword" >
<property name="text" > <property name="text" >
<string>Password:</string> <string>Password:</string>
</property> </property>
@ -107,7 +107,7 @@
<item row="3" column="3" > <item row="3" column="3" >
<widget class="KLineEdit" name="lePassword" > <widget class="KLineEdit" name="lePassword" >
<property name="echoMode" > <property name="echoMode" >
<enum>QLineEdit::Password</enum> <enum>TQLineEdit::Password</enum>
</property> </property>
<property name="passwordMode" > <property name="passwordMode" >
<bool>true</bool> <bool>true</bool>
@ -129,17 +129,17 @@
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>KComboBox</class> <class>KComboBox</class>
<extends>QComboBox</extends> <extends>TQComboBox</extends>
<header>kcombobox.h</header> <header>kcombobox.h</header>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>KLineEdit</class> <class>KLineEdit</class>
<extends>QLineEdit</extends> <extends>TQLineEdit</extends>
<header>klineedit.h</header> <header>klineedit.h</header>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>KTitleWidget</class> <class>KTitleWidget</class>
<extends>QWidget</extends> <extends>TQWidget</extends>
<header>ktitlewidget.h</header> <header>ktitlewidget.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>

@ -1,6 +1,6 @@
<ui version="4.0" > <ui version="4.0" >
<class>AuthDetails</class> <class>AuthDetails</class>
<widget class="QWidget" name="AuthDetails" > <widget class="TQWidget" name="AuthDetails" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
@ -15,23 +15,23 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<layout class="QGridLayout" name="gridLayout" > <layout class="TQGridLayout" name="gridLayout" >
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QLabel" name="label" > <widget class="TQLabel" name="label" >
<property name="text" > <property name="text" >
<string>Application:</string> <string>Application:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" > <item row="2" column="0" >
<widget class="QLabel" name="label_3" > <widget class="TQLabel" name="label_3" >
<property name="text" > <property name="text" >
<string>Action:</string> <string>Action:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" > <item row="3" column="0" >
<widget class="QLabel" name="vendorL" > <widget class="TQLabel" name="vendorL" >
<property name="text" > <property name="text" >
<string>Vendor:</string> <string>Vendor:</string>
</property> </property>
@ -66,12 +66,12 @@
<item row="0" column="0" colspan="4" > <item row="0" column="0" colspan="4" >
<widget class="Line" name="line" > <widget class="Line" name="line" >
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>TQt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" colspan="3" > <item row="1" column="1" colspan="3" >
<widget class="QLabel" name="app_label" > <widget class="TQLabel" name="app_label" >
<property name="text" > <property name="text" >
<string>Application:</string> <string>Application:</string>
</property> </property>
@ -82,7 +82,7 @@
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>KUrlLabel</class> <class>KUrlLabel</class>
<extends>QLabel</extends> <extends>TQLabel</extends>
<header>kurllabel.h</header> <header>kurllabel.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>

@ -36,7 +36,7 @@ int main(int argc, char *argv[])
KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineArgs::init(argc, argv, &aboutData);
if (!PolicyKitKDE::start()) { if (!PolicyKitKDE::start()) {
qWarning("PolicyKitKDE is already running!\n"); tqWarning("PolicyKitKDE is already running!\n");
return 0; return 0;
} }

@ -21,14 +21,14 @@
#include "policykitkde.h" #include "policykitkde.h"
#include <KDebug> #include <KDebug>
#include <PolkitQt1/Subject> #include <PolkitTQt1/Subject>
PolicyKitKDE::PolicyKitKDE() PolicyKitKDE::PolicyKitKDE()
: m_listener(new PolicyKitListener(this)) : m_listener(new PolicyKitListener(this))
{ {
setQuitOnLastWindowClosed(false); setQuitOnLastWindowClosed(false);
PolkitQt1::UnixSessionSubject session(getpid()); PolkitTQt1::UnixSessionSubject session(getpid());
bool result = m_listener->registerListener(session, "/org/kde/PolicyKit1/AuthenticationAgent"); bool result = m_listener->registerListener(session, "/org/kde/PolicyKit1/AuthenticationAgent");

@ -24,26 +24,26 @@
#include <KDebug> #include <KDebug>
#include <KWindowSystem> #include <KWindowSystem>
#include <PolkitQt1/Agent/Listener> #include <PolkitTQt1/Agent/Listener>
#include <PolkitQt1/Agent/Session> #include <PolkitTQt1/Agent/Session>
#include <PolkitQt1/Subject> #include <PolkitTQt1/Subject>
#include <PolkitQt1/Identity> #include <PolkitTQt1/Identity>
#include <PolkitQt1/Details> #include <PolkitTQt1/Details>
#include <QtDBus/QDBusConnection> #include <TQtDBus/TQDBusConnection>
#include "polkit1authagentadaptor.h" #include "polkit1authagentadaptor.h"
PolicyKitListener::PolicyKitListener(QObject *parent) PolicyKitListener::PolicyKitListener(TQObject *parent)
: Listener(parent) : Listener(parent)
, m_inProgress(false) , m_inProgress(false)
, m_selectedUser(0) , m_selectedUser(0)
{ {
(void) new Polkit1AuthAgentAdaptor(this); (void) new Polkit1AuthAgentAdaptor(this);
if (!QDBusConnection::sessionBus().registerObject("/org/kde/Polkit1AuthAgent", this, if (!TQDBusConnection::sessionBus().registerObject("/org/kde/Polkit1AuthAgent", this,
QDBusConnection::ExportScriptableSlots | TQDBusConnection::ExportScriptableSlots |
QDBusConnection::ExportScriptableProperties | TQDBusConnection::ExportScriptableProperties |
QDBusConnection::ExportAdaptors)) { TQDBusConnection::ExportAdaptors)) {
kWarning() << "Could not initiate DBus helper!"; kWarning() << "Could not initiate DBus helper!";
} }
@ -54,19 +54,19 @@ PolicyKitListener::~PolicyKitListener()
{ {
} }
void PolicyKitListener::setWIdForAction(const QString& action, qulonglong wID) void PolicyKitListener::setWIdForAction(const TQString& action, qulonglong wID)
{ {
kDebug() << "On to the handshake"; kDebug() << "On to the handshake";
m_actionsToWID[action] = wID; m_actionsToWID[action] = wID;
} }
void PolicyKitListener::initiateAuthentication(const QString &actionId, void PolicyKitListener::initiateAuthentication(const TQString &actionId,
const QString &message, const TQString &message,
const QString &iconName, const TQString &iconName,
const PolkitQt1::Details &details, const PolkitTQt1::Details &details,
const QString &cookie, const TQString &cookie,
const PolkitQt1::Identity::List &identities, const PolkitTQt1::Identity::List &identities,
PolkitQt1::Agent::AsyncResult* result) PolkitTQt1::Agent::AsyncResult* result)
{ {
kDebug() << "Initiating authentication"; kDebug() << "Initiating authentication";
@ -93,7 +93,7 @@ void PolicyKitListener::initiateAuthentication(const QString &actionId,
m_dialog = new AuthDialog(actionId, message, iconName, details, identities, parentId); m_dialog = new AuthDialog(actionId, message, iconName, details, identities, parentId);
connect(m_dialog.data(), SIGNAL(okClicked()), SLOT(dialogAccepted())); connect(m_dialog.data(), SIGNAL(okClicked()), SLOT(dialogAccepted()));
connect(m_dialog.data(), SIGNAL(cancelClicked()), SLOT(dialogCanceled())); connect(m_dialog.data(), SIGNAL(cancelClicked()), SLOT(dialogCanceled()));
connect(m_dialog.data(), SIGNAL(adminUserSelected(PolkitQt1::Identity)), SLOT(userSelected(PolkitQt1::Identity))); 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(); kDebug() << "WinId of the dialog is " << m_dialog.data()->winId() << m_dialog.data()->effectiveWinId();
m_dialog.data()->setOptions(); m_dialog.data()->setOptions();
@ -120,9 +120,9 @@ void PolicyKitListener::tryAgain()
// We will create new session only when some user is selected // We will create new session only when some user is selected
if (m_selectedUser.isValid()) { if (m_selectedUser.isValid()) {
m_session = new Session(m_selectedUser, m_cookie, m_result); m_session = new Session(m_selectedUser, m_cookie, m_result);
connect(m_session.data(), SIGNAL(request(QString,bool)), this, SLOT(request(QString,bool))); 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(completed(bool)), this, SLOT(completed(bool)));
connect(m_session.data(), SIGNAL(showError(QString)), this, SLOT(showError(QString))); connect(m_session.data(), SIGNAL(showError(TQString)), this, SLOT(showError(TQString)));
m_session.data()->initiate(); m_session.data()->initiate();
} }
@ -180,7 +180,7 @@ void PolicyKitListener::cancelAuthentication()
finishObtainPrivilege(); finishObtainPrivilege();
} }
void PolicyKitListener::request(const QString &request, bool echo) void PolicyKitListener::request(const TQString &request, bool echo)
{ {
Q_UNUSED(echo); Q_UNUSED(echo);
kDebug() << "Request: " << request; kDebug() << "Request: " << request;
@ -200,7 +200,7 @@ void PolicyKitListener::completed(bool gainedAuthorization)
finishObtainPrivilege(); finishObtainPrivilege();
} }
void PolicyKitListener::showError(const QString &text) void PolicyKitListener::showError(const TQString &text)
{ {
kDebug() << "Error: " << text; kDebug() << "Error: " << text;
} }
@ -226,7 +226,7 @@ void PolicyKitListener::dialogCanceled()
finishObtainPrivilege(); finishObtainPrivilege();
} }
void PolicyKitListener::userSelected(const PolkitQt1::Identity &identity) void PolicyKitListener::userSelected(const PolkitTQt1::Identity &identity)
{ {
m_selectedUser = identity; m_selectedUser = identity;
// If some user is selected we must destroy existing session // If some user is selected we must destroy existing session

@ -21,60 +21,60 @@
*/ */
#include <PolkitQt1/Agent/Listener> #include <PolkitTQt1/Agent/Listener>
#include <QtCore/QWeakPointer> #include <TQtCore/TQWeakPointer>
#include <QtCore/QHash> #include <TQtCore/TQHash>
class AuthDialog; class AuthDialog;
using namespace PolkitQt1::Agent; using namespace PolkitTQt1::Agent;
class PolicyKitListener : public Listener class PolicyKitListener : public Listener
{ {
Q_OBJECT Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.Polkit1AuthAgent") TQ_CLASSINFO("D-Bus Interface", "org.kde.Polkit1AuthAgent")
public: public:
PolicyKitListener(QObject *parent = 0); PolicyKitListener(TQObject *parent = 0);
virtual ~PolicyKitListener(); virtual ~PolicyKitListener();
public slots: public slots:
void initiateAuthentication(const QString &actionId, void initiateAuthentication(const TQString &actionId,
const QString &message, const TQString &message,
const QString &iconName, const TQString &iconName,
const PolkitQt1::Details &details, const PolkitTQt1::Details &details,
const QString &cookie, const TQString &cookie,
const PolkitQt1::Identity::List &identities, const PolkitTQt1::Identity::List &identities,
PolkitQt1::Agent::AsyncResult* result); PolkitTQt1::Agent::AsyncResult* result);
bool initiateAuthenticationFinish(); bool initiateAuthenticationFinish();
void cancelAuthentication(); void cancelAuthentication();
void tryAgain(); void tryAgain();
void finishObtainPrivilege(); void finishObtainPrivilege();
void request(const QString &request, bool echo); void request(const TQString &request, bool echo);
void completed(bool gainedAuthorization); void completed(bool gainedAuthorization);
void showError(const QString &text); void showError(const TQString &text);
void setWIdForAction(const QString &action, qulonglong wID); void setWIdForAction(const TQString &action, qulonglong wID);
/* void showInfo(const QString &text); */ /* void showInfo(const TQString &text); */
private: private:
QWeakPointer<AuthDialog> m_dialog; TQWeakPointer<AuthDialog> m_dialog;
QWeakPointer<Session> m_session; TQWeakPointer<Session> m_session;
bool m_inProgress; bool m_inProgress;
bool m_gainedAuthorization; bool m_gainedAuthorization;
bool m_wasCancelled; bool m_wasCancelled;
int m_numTries; int m_numTries;
PolkitQt1::Identity::List m_identities; PolkitTQt1::Identity::List m_identities;
PolkitQt1::Agent::AsyncResult* m_result; PolkitTQt1::Agent::AsyncResult* m_result;
QString m_cookie; TQString m_cookie;
PolkitQt1::Identity m_selectedUser; PolkitTQt1::Identity m_selectedUser;
QHash< QString, qulonglong > m_actionsToWID; TQHash< TQString, qulonglong > m_actionsToWID;
private slots: private slots:
void dialogAccepted(); void dialogAccepted();
void dialogCanceled(); void dialogCanceled();
void userSelected(const PolkitQt1::Identity &identity); void userSelected(const PolkitTQt1::Identity &identity);
}; };
#endif #endif

Loading…
Cancel
Save