diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:22:56 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:22:56 +0000 |
commit | 7346aee26bf190a7e70333c40fab4caca847cd27 (patch) | |
tree | 4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /kicker-applets/kbinaryclock/kbinaryclock.cpp | |
parent | 23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff) | |
download | tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.tar.gz tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker-applets/kbinaryclock/kbinaryclock.cpp')
-rw-r--r-- | kicker-applets/kbinaryclock/kbinaryclock.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/kicker-applets/kbinaryclock/kbinaryclock.cpp b/kicker-applets/kbinaryclock/kbinaryclock.cpp index 33e8ced..30682e4 100644 --- a/kicker-applets/kbinaryclock/kbinaryclock.cpp +++ b/kicker-applets/kbinaryclock/kbinaryclock.cpp @@ -25,30 +25,30 @@ #include <kiconloader.h> #include <kglobalsettings.h> -#include <qradiobutton.h> +#include <tqradiobutton.h> #include <kcolorbutton.h> #include <kpopupmenu.h> -#include <qslider.h> -#include <qcursor.h> -#include <qtimer.h> -#include <qtooltip.h> -#include <qlabel.h> +#include <tqslider.h> +#include <tqcursor.h> +#include <tqtimer.h> +#include <tqtooltip.h> +#include <tqlabel.h> #include <kprocess.h> #include <kstandarddirs.h> -#include <qclipboard.h> +#include <tqclipboard.h> #include <kled.h> extern "C" { - KDE_EXPORT KPanelApplet* init( QWidget *parent, const QString& configFile ) { + KDE_EXPORT KPanelApplet* init( TQWidget *parent, const TQString& configFile ) { KGlobal::locale()->insertCatalogue( "kbinaryclock"); return new KBinaryClock( configFile, KPanelApplet::Normal, KPanelApplet::Preferences, parent, "kbinaryclock"); } } -KConfigDialogImp::KConfigDialogImp( QWidget *parent, const char *name, KConfigSkeleton *prefs, KDialogBase::DialogType dialogType, KDialogBase::ButtonCode defaultButton, bool modal) : +KConfigDialogImp::KConfigDialogImp( TQWidget *parent, const char *name, KConfigSkeleton *prefs, KDialogBase::DialogType dialogType, KDialogBase::ButtonCode defaultButton, bool modal) : KConfigDialog(parent, name, prefs, dialogType,(KDialogBase::ButtonCode) (KDialogBase::Default | KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel ), defaultButton, modal) { // As a temporary mesure until the kicker applet's app name is set to the @@ -58,10 +58,10 @@ KConfigDialogImp::KConfigDialogImp( QWidget *parent, const char *name, KConfigSk settings = new SettingsImp(0, "General"); addPage(settings, i18n("General"), "package_settings"); - connect(this, SIGNAL(widgetModified()), settings, SLOT(updatePreview())); + connect(this, TQT_SIGNAL(widgetModified()), settings, TQT_SLOT(updatePreview())); } -SettingsImp::SettingsImp(QWidget* parent, const char* name, WFlags fl): Settings(parent, name, fl){ +SettingsImp::SettingsImp(TQWidget* parent, const char* name, WFlags fl): Settings(parent, name, fl){ } /** @@ -72,9 +72,9 @@ void SettingsImp::updatePreview(){ int look = KLed::Raised; look = Look_Flat->isChecked() ? Prefs::EnumLook::Flat : look; look = Look_Sunken->isChecked() ? Prefs::EnumLook::Sunken : look; - QColor color = kcfg_Color->color(); + TQColor color = kcfg_Color->color(); int darkFactor = kcfg_DarkFactor->value(); - QColor backgroundColor = kcfg_Background->color(); + TQColor backgroundColor = kcfg_Background->color(); frame1->setBackgroundColor(backgroundColor); kLed1->setBackgroundColor(backgroundColor); @@ -116,7 +116,7 @@ void SettingsImp::updatePreview(){ /** * Constructor, create LED's */ -KBinaryClock::KBinaryClock(const QString& configFile, Type type, int actions, QWidget *parent, const char *name) +KBinaryClock::KBinaryClock(const TQString& configFile, Type type, int actions, TQWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name), ledWidth(6), _calendar(NULL), _disableCalendar(false), prefs( new Prefs(sharedConfig())), m_tooltip(this) @@ -137,8 +137,8 @@ KBinaryClock::KBinaryClock(const QString& configFile, Type type, int actions, QW updateClock(); loadSettings(); - QTimer *timer=new QTimer(this); - connect (timer, SIGNAL (timeout()), this, SLOT (updateClock())); + TQTimer *timer=new TQTimer(this); + connect (timer, TQT_SIGNAL (timeout()), this, TQT_SLOT (updateClock())); timer->start(500,false); } @@ -162,11 +162,11 @@ int KBinaryClock::heightForWidth( int width ) const { return (width/ledWidth)*4; } -void KBinaryClock::resizeEvent( QResizeEvent *e ) { +void KBinaryClock::resizeEvent( TQResizeEvent *e ) { int width = e->size().width(); for (int i=0; i < ledWidth; i++) for (int j=0; j < 4; j++) - ledMatrix[i][j]->setGeometry( QRect( (width/ledWidth)*i, (width/ledWidth)*j, width/ledWidth, width/ledWidth) ); + ledMatrix[i][j]->setGeometry( TQRect( (width/ledWidth)*i, (width/ledWidth)*j, width/ledWidth, width/ledWidth) ); } /** @@ -175,10 +175,10 @@ void KBinaryClock::resizeEvent( QResizeEvent *e ) { void KBinaryClock::loadSettings(){ int shape = prefs->shape(); int look = prefs->look(); - QColor color = prefs->color(); + TQColor color = prefs->color(); int darkFactor = prefs->darkFactor(); - QColor backgroundColor = prefs->background(); + TQColor backgroundColor = prefs->background(); bool modifyBackground = false; if(backgroundColor != KApplication::palette().active().background()){ setPaletteBackgroundColor(backgroundColor); @@ -217,7 +217,7 @@ void KBinaryClock::preferences(){ return; KConfigDialogImp *dialog = new KConfigDialogImp(this, "settings", prefs, KDialogBase::Swallow); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings())); dialog->show(); dialog->settings->updatePreview(); } @@ -226,11 +226,11 @@ void KBinaryClock::preferences(){ * Get the time and update the LED's */ void KBinaryClock::updateClock(){ - QString time = "hhmmss"; + TQString time = "hhmmss"; if(KGlobal::locale()->use12Clock()) time += "ap"; - QString currentTime = (QTime::currentTime()).toString(time); + TQString currentTime = (TQTime::currentTime()).toString(time); int splice[6]; splice[0] = currentTime.mid( 0, 1 ).toInt(); splice[1] = currentTime.mid( 1, 1 ).toInt(); @@ -262,18 +262,18 @@ void KBinaryClock::updateClock(){ /** * Catch the right click press */ - void KBinaryClock::mousePressEvent(QMouseEvent *event) { + void KBinaryClock::mousePressEvent(TQMouseEvent *event) { switch (event->button()) { - case QMouseEvent::RightButton: - QToolTip::remove(this); + case TQMouseEvent::RightButton: + TQToolTip::remove(this); openContextMenu(); break; - case QMouseEvent::LeftButton: + case TQMouseEvent::LeftButton: toggleCalendar(); - QToolTip::remove(this); + TQToolTip::remove(this); break; - case QMouseEvent::MidButton: - QToolTip::remove(this); + case TQMouseEvent::MidButton: + TQToolTip::remove(this); break; default: break; @@ -290,7 +290,7 @@ void KBinaryClock::openContextMenu() { menu->insertTitle( SmallIcon( "clock" ), i18n( "KBinaryClock" ) ); KLocale *loc = KGlobal::locale(); - QDateTime dt = QDateTime::currentDateTime(); + TQDateTime dt = TQDateTime::currentDateTime(); KPopupMenu *copyMenu = new KPopupMenu( menu ); copyMenu->insertItem(loc->formatDateTime(dt), 201); @@ -301,7 +301,7 @@ void KBinaryClock::openContextMenu() { copyMenu->insertItem(dt.date().toString(), 206); copyMenu->insertItem(dt.time().toString(), 207); copyMenu->insertItem(dt.toString(), 208); - connect( copyMenu, SIGNAL( activated(int) ), this, SLOT( slotCopyMenuActivated(int) ) ); + connect( copyMenu, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( slotCopyMenuActivated(int) ) ); if (!bImmutable) { @@ -318,7 +318,7 @@ void KBinaryClock::openContextMenu() { menu->insertSeparator(7); menu->insertItem(SmallIcon("configure"), i18n("&Configure KBinaryClock..."), 102, 8); } - int result = menu->exec( QCursor::pos() ); + int result = menu->exec( TQCursor::pos() ); KProcess proc; switch (result) { @@ -328,7 +328,7 @@ void KBinaryClock::openContextMenu() { case 103: proc << locate("exe", "kdesu"); proc << "--nonewdcop"; - proc << QString("%1 clock --lang %2") + proc << TQString("%1 clock --lang %2") .arg(locate("exe", "kcmshell")) .arg(KGlobal::locale()->language()); proc.start(KProcess::DontCare); @@ -346,9 +346,9 @@ void KBinaryClock::openContextMenu() { } void KBinaryClock::slotCopyMenuActivated( int id ) { - QPopupMenu *m = (QPopupMenu *) sender(); - QString s = m->text(id); - QApplication::clipboard()->setText(s); + TQPopupMenu *m = (TQPopupMenu *) sender(); + TQString s = m->text(id); + TQApplication::clipboard()->setText(s); } void KBinaryClock::toggleCalendar() @@ -361,11 +361,11 @@ void KBinaryClock::toggleCalendar() if (_calendar || _disableCalendar){ return; } - _calendar = new DatePicker(this, QDateTime::currentDateTime().date()); - connect( _calendar, SIGNAL( destroyed() ), SLOT( slotCalendarDeleted() )); + _calendar = new DatePicker(this, TQDateTime::currentDateTime().date()); + connect( _calendar, TQT_SIGNAL( destroyed() ), TQT_SLOT( slotCalendarDeleted() )); // some extra spacing is included if aligned on a desktop edge - QPoint c = mapToGlobal(QPoint(0,0)); + TQPoint c = mapToGlobal(TQPoint(0,0)); int w = _calendar->sizeHint().width() + 28; // Added 28 px. to size poperly as said in API @@ -379,7 +379,7 @@ void KBinaryClock::toggleCalendar() } // make calendar fully visible - QRect deskR = KGlobalSettings::desktopGeometry(QPoint(0,0)); + TQRect deskR = KGlobalSettings::desktopGeometry(TQPoint(0,0)); if (c.y()+h > deskR.bottom()) c.setY(deskR.bottom()-h-1); if (c.x()+w > deskR.right()) c.setX(deskR.right()-w-1); @@ -393,7 +393,7 @@ void KBinaryClock::slotCalendarDeleted() _calendar = 0L; // don't reopen the calendar immediately ... _disableCalendar = true; - QTimer::singleShot(100, this, SLOT(slotEnableCalendar())); + TQTimer::singleShot(100, this, TQT_SLOT(slotEnableCalendar())); } void KBinaryClock::slotEnableCalendar() @@ -401,11 +401,11 @@ void KBinaryClock::slotEnableCalendar() _disableCalendar = false; } -ClockAppletToolTip::ClockAppletToolTip( KBinaryClock *clock ) : QToolTip( clock ), m_clock( clock ) {} +ClockAppletToolTip::ClockAppletToolTip( KBinaryClock *clock ) : TQToolTip( clock ), m_clock( clock ) {} -void ClockAppletToolTip::maybeTip( const QPoint & /*point*/ ) +void ClockAppletToolTip::maybeTip( const TQPoint & /*point*/ ) { - tip(m_clock->geometry(), KGlobal::locale()->formatDate(QDateTime::currentDateTime().date(), false)); + tip(m_clock->geometry(), KGlobal::locale()->formatDate(TQDateTime::currentDateTime().date(), false)); } #include "kbinaryclock.moc" |