From 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 13 Apr 2011 00:46:47 +0000 Subject: Initial conversion of kdepim to TQt This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kalarm/traywindow.cpp | 52 +++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'kalarm/traywindow.cpp') diff --git a/kalarm/traywindow.cpp b/kalarm/traywindow.cpp index 41fd9e4db..190cb5384 100644 --- a/kalarm/traywindow.cpp +++ b/kalarm/traywindow.cpp @@ -50,10 +50,10 @@ #include "traywindow.moc" -class TrayTooltip : public QToolTip +class TrayTooltip : public TQToolTip { public: - TrayTooltip(TQWidget* parent) : TQToolTip(parent) { } + TrayTooltip(TQWidget* tqparent) : TQToolTip(tqparent) { } virtual ~TrayTooltip() {} protected: virtual void maybeTip(const TQPoint&); @@ -71,9 +71,9 @@ struct TipItem = The KDE system tray window. =============================================================================*/ -TrayWindow::TrayWindow(MainWindow* parent, const char* name) - : KSystemTray((theApp()->wantRunInSystemTray() ? parent : 0), name), - mAssocMainWindow(parent) +TrayWindow::TrayWindow(MainWindow* tqparent, const char* name) + : KSystemTray((theApp()->wantRunInSystemTray() ? tqparent : 0), name), + mAssocMainWindow(tqparent) { kdDebug(5950) << "TrayWindow::TrayWindow()\n"; // Set up GUI icons @@ -87,7 +87,7 @@ TrayWindow::TrayWindow(MainWindow* parent, const char* name) KActionCollection* actcol = actionCollection(); AlarmEnableAction* a = Daemon::createAlarmEnableAction(actcol, "tAlarmEnable"); a->plug(contextMenu()); - connect(a, TQT_SIGNAL(switched(bool)), TQT_SLOT(setEnabledStatus(bool))); + connect(a, TQT_SIGNAL(switched(bool)), TQT_SLOT(setEnabledtqStatus(bool))); KAlarm::createNewAlarmAction(i18n("&New Alarm..."), this, TQT_SLOT(slotNewAlarm()), actcol, "tNew")->plug(contextMenu()); KAlarm::createNewFromTemplateAction(i18n("New Alarm From &Template"), this, TQT_SLOT(slotNewFromTemplate(const KAEvent&)), actcol, "tNewFromTempl")->plug(contextMenu()); KStdAction::preferences(this, TQT_SLOT(slotPreferences()), actcol)->plug(contextMenu()); @@ -99,8 +99,8 @@ TrayWindow::TrayWindow(MainWindow* parent, const char* name) KStdAction::quit(this, TQT_SLOT(slotQuit()), actcol); // Set icon to correspond with the alarms enabled menu status - Daemon::checkStatus(); - setEnabledStatus(Daemon::monitoringAlarms()); + Daemon::checktqStatus(); + setEnabledtqStatus(Daemon::monitoringAlarms()); mTooltip = new TrayTooltip(this); } @@ -121,7 +121,7 @@ TrayWindow::~TrayWindow() void TrayWindow::contextMenuAboutToShow(KPopupMenu* menu) { KSystemTray::contextMenuAboutToShow(menu); // needed for KDE <= 3.1 compatibility - Daemon::checkStatus(); + Daemon::checktqStatus(); } /****************************************************************************** @@ -160,9 +160,9 @@ void TrayWindow::slotQuit() * Called when the Alarms Enabled action status has changed. * Updates the alarms enabled menu item check state, and the icon pixmap. */ -void TrayWindow::setEnabledStatus(bool status) +void TrayWindow::setEnabledtqStatus(bool status) { - kdDebug(5950) << "TrayWindow::setEnabledStatus(" << (int)status << ")\n"; + kdDebug(5950) << "TrayWindow::setEnabledtqStatus(" << (int)status << ")\n"; setPixmap(status ? mPixmapEnabled : mPixmapDisabled); } @@ -316,7 +316,7 @@ void TrayWindow::removeWindow(MainWindow* win) /****************************************************************************** * Check whether the widget is in the system tray. * Note that it is only sometime AFTER the show event that the system tray -* becomes the widget's parent. So for a definitive status, call this method +* becomes the widget's tqparent. So for a definitive status, call this method * only after waiting a bit... * Reply = true if the widget is in the system tray, or its status can't be determined. * = false if it is not currently in the system tray. @@ -324,18 +324,18 @@ void TrayWindow::removeWindow(MainWindow* win) bool TrayWindow::inSystemTray() const { #ifdef HAVE_X11_HEADERS - Window xParent; // receives parent window + Window xParent; // receives tqparent window Window root; - Window* children = 0; - unsigned int nchildren; - // Find the X parent window of the widget. This is not the same as the Qt parent widget. - if (!XQueryTree(qt_xdisplay(), winId(), &root, &xParent, &children, &nchildren)) - return true; // error determining its parent X window - if (children) - XFree(children); - - // If it is in the system tray, the system tray window will be its X parent. - // Otherwise, the root window will be its X parent. + Window* tqchildren = 0; + unsigned int ntqchildren; + // Find the X tqparent window of the widget. This is not the same as the TQt tqparent widget. + if (!XQueryTree(qt_xdisplay(), winId(), &root, &xParent, &tqchildren, &ntqchildren)) + return true; // error determining its tqparent X window + if (tqchildren) + XFree(tqchildren); + + // If it is in the system tray, the system tray window will be its X tqparent. + // Otherwise, the root window will be its X tqparent. return xParent != root; #else return true; @@ -348,7 +348,7 @@ bool TrayWindow::inSystemTray() const */ void TrayTooltip::maybeTip(const TQPoint&) { - TrayWindow* parent = (TrayWindow*)tqparentWidget(); + TrayWindow* tqparent = (TrayWindow*)tqparentWidget(); TQString text; if (Daemon::monitoringAlarms()) text = kapp->aboutData()->programName(); @@ -356,6 +356,6 @@ void TrayTooltip::maybeTip(const TQPoint&) text = i18n("%1 - disabled").arg(kapp->aboutData()->programName()); kdDebug(5950) << "TrayTooltip::maybeTip(): " << text << endl; if (Preferences::tooltipAlarmCount()) - parent->tooltipAlarmText(text); - tip(parent->rect(), text); + tqparent->tooltipAlarmText(text); + tip(tqparent->rect(), text); } -- cgit v1.2.1