diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-18 17:00:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-18 17:00:31 +0000 |
commit | 395a904bff7b4d6ead445c342f7ac0c5fbf29121 (patch) | |
tree | 9829cadb79d2cc7c29a940627fadb28b11e54150 /kicker-applets/kbinaryclock | |
parent | 399f47c376fdf4d19192732a701ea9578d11619d (diff) | |
download | tdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.tar.gz tdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.zip |
TQt4 port kdeaddons
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1237404 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker-applets/kbinaryclock')
-rw-r--r-- | kicker-applets/kbinaryclock/datepicker.cpp | 6 | ||||
-rw-r--r-- | kicker-applets/kbinaryclock/datepicker.h | 4 | ||||
-rw-r--r-- | kicker-applets/kbinaryclock/kbinaryclock.cpp | 56 | ||||
-rw-r--r-- | kicker-applets/kbinaryclock/kbinaryclock.h | 10 | ||||
-rw-r--r-- | kicker-applets/kbinaryclock/kbinaryclock.kcfg | 2 | ||||
-rw-r--r-- | kicker-applets/kbinaryclock/settings.ui | 68 |
6 files changed, 74 insertions, 72 deletions
diff --git a/kicker-applets/kbinaryclock/datepicker.cpp b/kicker-applets/kbinaryclock/datepicker.cpp index c87e11a..7adef9e 100644 --- a/kicker-applets/kbinaryclock/datepicker.cpp +++ b/kicker-applets/kbinaryclock/datepicker.cpp @@ -29,8 +29,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <klocale.h> #include <kwin.h> -DatePicker::DatePicker(TQWidget *parent, const TQDate& date) - : TQVBox( parent, 0, WType_TopLevel | WDestructiveClose | +DatePicker::DatePicker(TQWidget *tqparent, const TQDate& date) + : TQVBox( tqparent, 0, WType_TopLevel | WDestructiveClose | WStyle_Customize | WStyle_StaysOnTop | WStyle_NoBorder ) { setFrameStyle( TQFrame::PopupPanel | TQFrame::Raised ); @@ -46,6 +46,6 @@ DatePicker::DatePicker(TQWidget *parent, const TQDate& date) void DatePicker::keyReleaseEvent(TQKeyEvent *e) { DATEPICKER_INHERITED::keyReleaseEvent(e); - if (e->key() == Qt::Key_Escape) + if (e->key() == TQt::Key_Escape) close(); } diff --git a/kicker-applets/kbinaryclock/datepicker.h b/kicker-applets/kbinaryclock/datepicker.h index b21cafe..d83b8a0 100644 --- a/kicker-applets/kbinaryclock/datepicker.h +++ b/kicker-applets/kbinaryclock/datepicker.h @@ -29,8 +29,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. class TQDate; class KDatePicker; -#define DATEPICKER_INHERITED QVBox -class DatePicker : public QVBox +#define DATEPICKER_INHERITED TQVBox +class DatePicker : public TQVBox { public: DatePicker(TQWidget*, const TQDate&); diff --git a/kicker-applets/kbinaryclock/kbinaryclock.cpp b/kicker-applets/kbinaryclock/kbinaryclock.cpp index 30682e4..2e46273 100644 --- a/kicker-applets/kbinaryclock/kbinaryclock.cpp +++ b/kicker-applets/kbinaryclock/kbinaryclock.cpp @@ -41,15 +41,15 @@ extern "C" { - KDE_EXPORT KPanelApplet* init( TQWidget *parent, const TQString& configFile ) { + KDE_EXPORT KPanelApplet* init( TQWidget *tqparent, const TQString& configFile ) { KGlobal::locale()->insertCatalogue( "kbinaryclock"); return new KBinaryClock( configFile, KPanelApplet::Normal, - KPanelApplet::Preferences, parent, "kbinaryclock"); + KPanelApplet::Preferences, tqparent, "kbinaryclock"); } } -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) +KConfigDialogImp::KConfigDialogImp( TQWidget *tqparent, const char *name, KConfigSkeleton *prefs, KDialogBase::DialogType dialogType, KDialogBase::ButtonCode defaultButton, bool modal) : + KConfigDialog(tqparent, 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 // applets name so KDialogBase gets the right info. @@ -61,14 +61,14 @@ KConfigDialogImp::KConfigDialogImp( TQWidget *parent, const char *name, KConfigS connect(this, TQT_SIGNAL(widgetModified()), settings, TQT_SLOT(updatePreview())); } -SettingsImp::SettingsImp(TQWidget* parent, const char* name, WFlags fl): Settings(parent, name, fl){ +SettingsImp::SettingsImp(TQWidget* tqparent, const char* name, WFlags fl): Settings(tqparent, name, fl){ } /** * Update the preview */ void SettingsImp::updatePreview(){ - int shape = Shape_Circular->isChecked() ? Prefs::EnumShape::Circular : Prefs::EnumShape::Rectangular; + int tqshape = Shape_Circular->isChecked() ? Prefs::EnumShape::Circular : Prefs::EnumShape::Rectangular; int look = KLed::Raised; look = Look_Flat->isChecked() ? Prefs::EnumLook::Flat : look; look = Look_Sunken->isChecked() ? Prefs::EnumLook::Sunken : look; @@ -84,12 +84,12 @@ void SettingsImp::updatePreview(){ kLed5->setBackgroundColor(backgroundColor); kLed6->setBackgroundColor(backgroundColor); - kLed1->setShape((KLed::Shape)shape); - kLed2->setShape((KLed::Shape)shape); - kLed3->setShape((KLed::Shape)shape); - kLed4->setShape((KLed::Shape)shape); - kLed5->setShape((KLed::Shape)shape); - kLed6->setShape((KLed::Shape)shape); + kLed1->setShape((KLed::Shape)tqshape); + kLed2->setShape((KLed::Shape)tqshape); + kLed3->setShape((KLed::Shape)tqshape); + kLed4->setShape((KLed::Shape)tqshape); + kLed5->setShape((KLed::Shape)tqshape); + kLed6->setShape((KLed::Shape)tqshape); kLed1->setColor(color); kLed2->setColor(color); @@ -116,8 +116,8 @@ void SettingsImp::updatePreview(){ /** * Constructor, create LED's */ -KBinaryClock::KBinaryClock(const TQString& configFile, Type type, int actions, TQWidget *parent, const char *name) - : KPanelApplet(configFile, type, actions, parent, name), ledWidth(6), +KBinaryClock::KBinaryClock(const TQString& configFile, Type type, int actions, TQWidget *tqparent, const char *name) + : KPanelApplet(configFile, type, actions, tqparent, name), ledWidth(6), _calendar(NULL), _disableCalendar(false), prefs( new Prefs(sharedConfig())), m_tooltip(this) { @@ -173,14 +173,14 @@ void KBinaryClock::resizeEvent( TQResizeEvent *e ) { * Load the settings for the clock. */ void KBinaryClock::loadSettings(){ - int shape = prefs->shape(); + int tqshape = prefs->shape(); int look = prefs->look(); TQColor color = prefs->color(); int darkFactor = prefs->darkFactor(); TQColor backgroundColor = prefs->background(); bool modifyBackground = false; - if(backgroundColor != KApplication::palette().active().background()){ + if(backgroundColor != KApplication::tqpalette().active().background()){ setPaletteBackgroundColor(backgroundColor); modifyBackground = true; } @@ -197,7 +197,7 @@ void KBinaryClock::loadSettings(){ } for(int i=0; i < 4; i++){ for(int j=0; j < ledWidth;j++){ - ledMatrix[j][i]->setShape((KLed::Shape)shape); + ledMatrix[j][i]->setShape((KLed::Shape)tqshape); ledMatrix[j][i]->setColor(color); ledMatrix[j][i]->setLook((KLed::Look)look); ledMatrix[j][i]->setDarkFactor(darkFactor); @@ -264,15 +264,15 @@ void KBinaryClock::updateClock(){ */ void KBinaryClock::mousePressEvent(TQMouseEvent *event) { switch (event->button()) { - case TQMouseEvent::RightButton: + case Qt::RightButton: TQToolTip::remove(this); openContextMenu(); break; - case TQMouseEvent::LeftButton: + case Qt::LeftButton: toggleCalendar(); TQToolTip::remove(this); break; - case TQMouseEvent::MidButton: + case Qt::MidButton: TQToolTip::remove(this); break; default: @@ -290,7 +290,7 @@ void KBinaryClock::openContextMenu() { menu->insertTitle( SmallIcon( "clock" ), i18n( "KBinaryClock" ) ); KLocale *loc = KGlobal::locale(); - TQDateTime dt = TQDateTime::currentDateTime(); + TQDateTime dt = TQDateTime::tqcurrentDateTime(); KPopupMenu *copyMenu = new KPopupMenu( menu ); copyMenu->insertItem(loc->formatDateTime(dt), 201); @@ -329,8 +329,8 @@ void KBinaryClock::openContextMenu() { proc << locate("exe", "kdesu"); proc << "--nonewdcop"; proc << TQString("%1 clock --lang %2") - .arg(locate("exe", "kcmshell")) - .arg(KGlobal::locale()->language()); + .tqarg(locate("exe", "kcmshell")) + .tqarg(KGlobal::locale()->language()); proc.start(KProcess::DontCare); break; case 104: @@ -348,7 +348,7 @@ void KBinaryClock::openContextMenu() { void KBinaryClock::slotCopyMenuActivated( int id ) { TQPopupMenu *m = (TQPopupMenu *) sender(); TQString s = m->text(id); - TQApplication::clipboard()->setText(s); + TQApplication::tqclipboard()->setText(s); } void KBinaryClock::toggleCalendar() @@ -361,15 +361,15 @@ void KBinaryClock::toggleCalendar() if (_calendar || _disableCalendar){ return; } - _calendar = new DatePicker(this, TQDateTime::currentDateTime().date()); + _calendar = new DatePicker(this, TQDateTime::tqcurrentDateTime().date()); connect( _calendar, TQT_SIGNAL( destroyed() ), TQT_SLOT( slotCalendarDeleted() )); // some extra spacing is included if aligned on a desktop edge TQPoint c = mapToGlobal(TQPoint(0,0)); - int w = _calendar->sizeHint().width() + 28; + int w = _calendar->tqsizeHint().width() + 28; // Added 28 px. to size poperly as said in API - int h = _calendar->sizeHint().height(); + int h = _calendar->tqsizeHint().height(); switch (position()) { case KPanelApplet::pLeft: c.setX(c.x()+width()+2); break; @@ -405,7 +405,7 @@ ClockAppletToolTip::ClockAppletToolTip( KBinaryClock *clock ) : TQToolTip( clock void ClockAppletToolTip::maybeTip( const TQPoint & /*point*/ ) { - tip(m_clock->geometry(), KGlobal::locale()->formatDate(TQDateTime::currentDateTime().date(), false)); + tip(m_clock->tqgeometry(), KGlobal::locale()->formatDate(TQDateTime::tqcurrentDateTime().date(), false)); } #include "kbinaryclock.moc" diff --git a/kicker-applets/kbinaryclock/kbinaryclock.h b/kicker-applets/kbinaryclock/kbinaryclock.h index 387288d..cfa8422 100644 --- a/kicker-applets/kbinaryclock/kbinaryclock.h +++ b/kicker-applets/kbinaryclock/kbinaryclock.h @@ -38,8 +38,9 @@ class KBinaryClock; class SettingsImp : public Settings { Q_OBJECT + TQ_OBJECT public: - SettingsImp(TQWidget* parent=0, + SettingsImp(TQWidget* tqparent=0, const char* name=0, WFlags fl=0); public slots: @@ -49,7 +50,7 @@ public slots: class KConfigDialogImp : public KConfigDialog { public: - KConfigDialogImp(TQWidget *parent, const char *name, + KConfigDialogImp(TQWidget *tqparent, const char *name, KConfigSkeleton *prefs, KDialogBase::DialogType dialogType = KDialogBase::IconList, KDialogBase::ButtonCode defaultButton = Ok, @@ -57,7 +58,7 @@ public: SettingsImp *settings; }; -class ClockAppletToolTip : public QToolTip +class ClockAppletToolTip : public TQToolTip { public: ClockAppletToolTip( KBinaryClock* clock ); @@ -71,8 +72,9 @@ class ClockAppletToolTip : public QToolTip class KBinaryClock : public KPanelApplet { Q_OBJECT + TQ_OBJECT public: - KBinaryClock(const TQString& configFile, Type t = Normal, int actions = 0, TQWidget *parent = 0, const char *name = 0); + KBinaryClock(const TQString& configFile, Type t = Normal, int actions = 0, TQWidget *tqparent = 0, const char *name = 0); ~KBinaryClock(); virtual int widthForHeight (int height) const; diff --git a/kicker-applets/kbinaryclock/kbinaryclock.kcfg b/kicker-applets/kbinaryclock/kbinaryclock.kcfg index b5a5fb3..84f35c3 100644 --- a/kicker-applets/kbinaryclock/kbinaryclock.kcfg +++ b/kicker-applets/kbinaryclock/kbinaryclock.kcfg @@ -35,7 +35,7 @@ </entry> <entry name="Background" type="Color"> <label>Background color</label> - <default code="true">KApplication::palette().active().background()</default> + <default code="true">KApplication::tqpalette().active().background()</default> </entry> <entry name="Show_Seconds" type="Bool"> <label>Whether to show seconds</label> diff --git a/kicker-applets/kbinaryclock/settings.ui b/kicker-applets/kbinaryclock/settings.ui index 43462af..0b94ee9 100644 --- a/kicker-applets/kbinaryclock/settings.ui +++ b/kicker-applets/kbinaryclock/settings.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>Settings</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>Settings</cstring> </property> @@ -16,7 +16,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox" row="2" column="0" rowspan="1" colspan="2"> + <widget class="TQGroupBox" row="2" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>groupBox6</cstring> </property> @@ -41,7 +41,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel5</cstring> </property> @@ -49,7 +49,7 @@ <string>Light</string> </property> </widget> - <widget class="QSlider" row="0" column="0" rowspan="1" colspan="3"> + <widget class="TQSlider" row="0" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>kcfg_DarkFactor</cstring> </property> @@ -96,27 +96,27 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>21</width> <height>20</height> </size> </property> </spacer> - <widget class="QLabel" row="1" column="2"> + <widget class="TQLabel" row="1" column="2"> <property name="name"> <cstring>textLabel6</cstring> </property> <property name="text"> <string>Dark</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> </grid> </widget> - <widget class="QGroupBox" row="1" column="0" rowspan="1" colspan="2"> + <widget class="TQGroupBox" row="1" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -127,7 +127,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -135,7 +135,7 @@ <string>Background:</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -169,7 +169,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> @@ -178,7 +178,7 @@ </spacer> </grid> </widget> - <widget class="QButtonGroup" row="2" column="2"> + <widget class="TQButtonGroup" row="2" column="2"> <property name="name"> <cstring>kcfg_Shape</cstring> </property> @@ -189,7 +189,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>Shape_Rectangular</cstring> </property> @@ -197,7 +197,7 @@ <string>&Rectangular</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>Shape_Circular</cstring> </property> @@ -210,7 +210,7 @@ </widget> </vbox> </widget> - <widget class="QButtonGroup" row="1" column="2"> + <widget class="TQButtonGroup" row="1" column="2"> <property name="name"> <cstring>kcfg_Look</cstring> </property> @@ -221,7 +221,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>Look_Flat</cstring> </property> @@ -229,7 +229,7 @@ <string>&Flat</string> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>Look_Raised</cstring> </property> @@ -240,7 +240,7 @@ <bool>true</bool> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>Look_Sunken</cstring> </property> @@ -250,15 +250,15 @@ </widget> </vbox> </widget> - <widget class="QLayoutWidget" row="0" column="4" rowspan="3" colspan="1"> + <widget class="TQLayoutWidget" row="0" column="4" rowspan="3" colspan="1"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>preview</cstring> </property> @@ -287,14 +287,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QFrame"> + <widget class="TQFrame"> <property name="name"> <cstring>frame1</cstring> </property> @@ -332,7 +332,7 @@ <property name="name"> <cstring>kLed1</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>32</width> <height>32</height> @@ -346,7 +346,7 @@ <property name="name"> <cstring>kLed2</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>32</width> <height>32</height> @@ -357,7 +357,7 @@ <property name="name"> <cstring>kLed4</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>32</width> <height>32</height> @@ -368,7 +368,7 @@ <property name="name"> <cstring>kLed3</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>32</width> <height>32</height> @@ -382,7 +382,7 @@ <property name="name"> <cstring>kLed6</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>32</width> <height>32</height> @@ -396,7 +396,7 @@ <property name="name"> <cstring>kLed5</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>32</width> <height>32</height> @@ -415,7 +415,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>21</width> <height>20</height> @@ -434,7 +434,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>84</height> @@ -443,7 +443,7 @@ </spacer> </vbox> </widget> - <widget class="QCheckBox" row="0" column="0"> + <widget class="TQCheckBox" row="0" column="0"> <property name="name"> <cstring>kcfg_Show_Seconds</cstring> </property> @@ -451,7 +451,7 @@ <string>Show seconds</string> </property> </widget> - <widget class="QCheckBox" row="0" column="1" rowspan="1" colspan="2"> + <widget class="TQCheckBox" row="0" column="1" rowspan="1" colspan="2"> <property name="name"> <cstring>kcfg_Hide_Off_Leds</cstring> </property> @@ -475,7 +475,7 @@ </widget> </grid> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kcolorbutton.h</includehint> <includehint>kled.h</includehint> |