Initial TQt conversion

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 9 years ago
parent 3566ebfc30
commit 7fdc8b30e8

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>Appearance</class> <class>Appearance</class>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>Appearance</cstring> <cstring>Appearance</cstring>
</property> </property>
@ -19,7 +19,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel" row="0" column="0" rowspan="1" colspan="3"> <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>Icons</cstring> <cstring>Icons</cstring>
</property> </property>
@ -35,7 +35,7 @@
<set>AlignBottom</set> <set>AlignBottom</set>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="12" column="2" rowspan="1" colspan="2"> <widget class="TQCheckBox" row="12" column="2" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>kcfg_ShowExpander</cstring> <cstring>kcfg_ShowExpander</cstring>
</property> </property>
@ -46,7 +46,7 @@
<string>Alt+X</string> <string>Alt+X</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="13" column="2" rowspan="1" colspan="2"> <widget class="TQCheckBox" row="13" column="2" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>kcfg_AlwaysCollapsed</cstring> <cstring>kcfg_AlwaysCollapsed</cstring>
</property> </property>
@ -60,7 +60,7 @@
<string>Alt+Y</string> <string>Alt+Y</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="10" column="1"> <widget class="TQLabel" row="10" column="1">
<property name="name"> <property name="name">
<cstring>textLabel2</cstring> <cstring>textLabel2</cstring>
</property> </property>
@ -74,7 +74,7 @@
<cstring>kcfg_MenuHeight</cstring> <cstring>kcfg_MenuHeight</cstring>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="5" column="1"> <widget class="TQLabel" row="5" column="1">
<property name="name"> <property name="name">
<cstring>textLabel1_4</cstring> <cstring>textLabel1_4</cstring>
</property> </property>
@ -102,7 +102,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QLineEdit" row="7" column="2"> <widget class="TQLineEdit" row="7" column="2">
<property name="name"> <property name="name">
<cstring>kcfg_ToolTipTitle</cstring> <cstring>kcfg_ToolTipTitle</cstring>
</property> </property>
@ -111,7 +111,7 @@
Empty means default.</string> Empty means default.</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="9" column="1"> <widget class="TQLabel" row="9" column="1">
<property name="name"> <property name="name">
<cstring>textLabel1_2</cstring> <cstring>textLabel1_2</cstring>
</property> </property>
@ -125,7 +125,7 @@ Empty means default.</string>
<cstring>kcfg_MenuWidth</cstring> <cstring>kcfg_MenuWidth</cstring>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="7" column="1"> <widget class="TQLabel" row="7" column="1">
<property name="name"> <property name="name">
<cstring>textLabel5</cstring> <cstring>textLabel5</cstring>
</property> </property>
@ -136,7 +136,7 @@ Empty means default.</string>
<set>AlignVCenter|AlignRight</set> <set>AlignVCenter|AlignRight</set>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="11" column="0" rowspan="1" colspan="3"> <widget class="TQLabel" row="11" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>ApplicationsList</cstring> <cstring>ApplicationsList</cstring>
</property> </property>
@ -152,7 +152,7 @@ Empty means default.</string>
<set>AlignBottom</set> <set>AlignBottom</set>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="9" column="3"> <widget class="TQLabel" row="9" column="3">
<property name="name"> <property name="name">
<cstring>textLabel3</cstring> <cstring>textLabel3</cstring>
</property> </property>
@ -160,7 +160,7 @@ Empty means default.</string>
<string>of the screen width</string> <string>of the screen width</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="4" column="0" rowspan="1" colspan="3"> <widget class="TQLabel" row="4" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>MenuButton</cstring> <cstring>MenuButton</cstring>
</property> </property>
@ -176,7 +176,7 @@ Empty means default.</string>
<set>AlignBottom</set> <set>AlignBottom</set>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="10" column="3"> <widget class="TQLabel" row="10" column="3">
<property name="name"> <property name="name">
<cstring>textLabel4</cstring> <cstring>textLabel4</cstring>
</property> </property>
@ -184,7 +184,7 @@ Empty means default.</string>
<string>of the screen height</string> <string>of the screen height</string>
</property> </property>
</widget> </widget>
<widget class="QButtonGroup" row="6" column="2" rowspan="1" colspan="2"> <widget class="TQButtonGroup" row="6" column="2" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>kcfg_MenuButtonIconType</cstring> <cstring>kcfg_MenuButtonIconType</cstring>
</property> </property>
@ -212,7 +212,7 @@ Empty means default.</string>
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>kcfg_Icon</cstring> <cstring>kcfg_Icon</cstring>
</property> </property>
@ -246,7 +246,7 @@ Empty means default.</string>
Empty means default.</string> Empty means default.</string>
</property> </property>
</widget> </widget>
<widget class="QLineEdit"> <widget class="TQLineEdit">
<property name="name"> <property name="name">
<cstring>kcfg_MenuButtonIcon</cstring> <cstring>kcfg_MenuButtonIcon</cstring>
</property> </property>
@ -254,7 +254,7 @@ Empty means default.</string>
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>kcfg_IconNone</cstring> <cstring>kcfg_IconNone</cstring>
</property> </property>
@ -267,7 +267,7 @@ Empty means default.</string>
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QLabel" row="8" column="0" rowspan="1" colspan="4"> <widget class="TQLabel" row="8" column="0" rowspan="1" colspan="4">
<property name="name"> <property name="name">
<cstring>menuSize</cstring> <cstring>menuSize</cstring>
</property> </property>
@ -283,7 +283,7 @@ Empty means default.</string>
<set>AlignBottom</set> <set>AlignBottom</set>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="2" column="1"> <widget class="TQLabel" row="2" column="1">
<property name="name"> <property name="name">
<cstring>textLabel1_3</cstring> <cstring>textLabel1_3</cstring>
</property> </property>
@ -297,7 +297,7 @@ Empty means default.</string>
<cstring>kcfg_ActionIconSize</cstring> <cstring>kcfg_ActionIconSize</cstring>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="3" column="2" rowspan="1" colspan="2"> <widget class="TQCheckBox" row="3" column="2" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>kcfg_DisplaySubText</cstring> <cstring>kcfg_DisplaySubText</cstring>
</property> </property>
@ -308,7 +308,7 @@ Empty means default.</string>
<string>Alt+D</string> <string>Alt+D</string>
</property> </property>
</widget> </widget>
<widget class="QButtonGroup" row="5" column="2" rowspan="1" colspan="2"> <widget class="TQButtonGroup" row="5" column="2" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>kcfg_MenuButtonLabelType</cstring> <cstring>kcfg_MenuButtonLabelType</cstring>
</property> </property>
@ -336,7 +336,7 @@ Empty means default.</string>
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>kcfg_MenuButtonText</cstring> <cstring>kcfg_MenuButtonText</cstring>
</property> </property>
@ -350,7 +350,7 @@ Empty means default.</string>
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QLineEdit"> <widget class="TQLineEdit">
<property name="name"> <property name="name">
<cstring>kcfg_MenuButtonLabel</cstring> <cstring>kcfg_MenuButtonLabel</cstring>
</property> </property>
@ -362,7 +362,7 @@ Empty means default.</string>
Empty means default.</string> Empty means default.</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>kcfg_MenuButtonNone</cstring> <cstring>kcfg_MenuButtonNone</cstring>
</property> </property>
@ -375,7 +375,7 @@ Empty means default.</string>
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QSpinBox" row="9" column="2"> <widget class="TQSpinBox" row="9" column="2">
<property name="name"> <property name="name">
<cstring>kcfg_MenuWidth</cstring> <cstring>kcfg_MenuWidth</cstring>
</property> </property>
@ -392,7 +392,7 @@ Empty means default.</string>
<number>70</number> <number>70</number>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" row="10" column="2"> <widget class="TQSpinBox" row="10" column="2">
<property name="name"> <property name="name">
<cstring>kcfg_MenuHeight</cstring> <cstring>kcfg_MenuHeight</cstring>
</property> </property>
@ -409,7 +409,7 @@ Empty means default.</string>
<number>70</number> <number>70</number>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="6" column="1"> <widget class="TQLabel" row="6" column="1">
<property name="name"> <property name="name">
<cstring>textLabel2_2</cstring> <cstring>textLabel2_2</cstring>
</property> </property>
@ -437,7 +437,7 @@ Empty means default.</string>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QLayoutWidget" row="1" column="2" rowspan="1" colspan="2"> <widget class="TQLayoutWidget" row="1" column="2" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>layout1</cstring> <cstring>layout1</cstring>
</property> </property>
@ -445,7 +445,7 @@ Empty means default.</string>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel" row="0" column="2"> <widget class="TQLabel" row="0" column="2">
<property name="name"> <property name="name">
<cstring>textLabel1_5_3</cstring> <cstring>textLabel1_5_3</cstring>
</property> </property>
@ -453,7 +453,7 @@ Empty means default.</string>
<string>third column:</string> <string>third column:</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="1"> <widget class="TQLabel" row="0" column="1">
<property name="name"> <property name="name">
<cstring>textLabel1_5_2</cstring> <cstring>textLabel1_5_2</cstring>
</property> </property>
@ -461,7 +461,7 @@ Empty means default.</string>
<string>second column:</string> <string>second column:</string>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" row="1" column="0"> <widget class="TQSpinBox" row="1" column="0">
<property name="name"> <property name="name">
<cstring>kcfg_IconSize1</cstring> <cstring>kcfg_IconSize1</cstring>
</property> </property>
@ -478,7 +478,7 @@ Empty means default.</string>
<number>22</number> <number>22</number>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" row="1" column="2"> <widget class="TQSpinBox" row="1" column="2">
<property name="name"> <property name="name">
<cstring>kcfg_IconSize3</cstring> <cstring>kcfg_IconSize3</cstring>
</property> </property>
@ -495,7 +495,7 @@ Empty means default.</string>
<number>22</number> <number>22</number>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" row="1" column="1"> <widget class="TQSpinBox" row="1" column="1">
<property name="name"> <property name="name">
<cstring>kcfg_IconSize2</cstring> <cstring>kcfg_IconSize2</cstring>
</property> </property>
@ -512,7 +512,7 @@ Empty means default.</string>
<number>22</number> <number>22</number>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="0"> <widget class="TQLabel" row="0" column="0">
<property name="name"> <property name="name">
<cstring>textLabel1_5</cstring> <cstring>textLabel1_5</cstring>
</property> </property>
@ -522,7 +522,7 @@ Empty means default.</string>
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QLabel" row="1" column="1"> <widget class="TQLabel" row="1" column="1">
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>
@ -544,7 +544,7 @@ Empty means default.</string>
<cstring>kcfg_IconSize</cstring> <cstring>kcfg_IconSize</cstring>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" row="2" column="2"> <widget class="TQSpinBox" row="2" column="2">
<property name="name"> <property name="name">
<cstring>kcfg_ActionIconSize</cstring> <cstring>kcfg_ActionIconSize</cstring>
</property> </property>
@ -589,9 +589,9 @@ Empty means default.</string>
</connection> </connection>
<connection> <connection>
<sender>MenuButtonIcon</sender> <sender>MenuButtonIcon</sender>
<signal>iconChanged(QString)</signal> <signal>iconChanged(TQString)</signal>
<receiver>Appearance</receiver> <receiver>Appearance</receiver>
<slot>iconChanged(QString)</slot> <slot>iconChanged(TQString)</slot>
</connection> </connection>
</connections> </connections>
<includes> <includes>
@ -599,7 +599,7 @@ Empty means default.</string>
</includes> </includes>
<slots> <slots>
<slot>kcfg_ShowExpander_toggled( bool status )</slot> <slot>kcfg_ShowExpander_toggled( bool status )</slot>
<slot>iconChanged( QString icon )</slot> <slot>iconChanged( TQString icon )</slot>
</slots> </slots>
<layoutdefaults spacing="6" margin="11"/> <layoutdefaults spacing="6" margin="11"/>
<includehints> <includehints>

@ -2,7 +2,7 @@
** ui.h extension file, included from the uic-generated form implementation. ** ui.h extension file, included from the uic-generated form implementation.
** **
** If you want to add, delete, or rename functions or slots, use ** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code. ** TQt Designer to update this file, preserving your code.
** **
** You should not define a constructor or destructor in this file. ** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy(). ** Instead, write your code in functions called init() and destroy().
@ -17,7 +17,7 @@ void Appearance::kcfg_ShowExpander_toggled( bool status )
} }
void Appearance::iconChanged( QString icon ) void Appearance::iconChanged( TQString icon )
{ {
kcfg_MenuButtonIcon->setText(icon); kcfg_MenuButtonIcon->setText(icon);
} }

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>Behaviour</class> <class>Behaviour</class>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>Behaviour</cstring> <cstring>Behaviour</cstring>
</property> </property>
@ -19,7 +19,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel" row="0" column="0" rowspan="1" colspan="2"> <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>GeneralBehaviour</cstring> <cstring>GeneralBehaviour</cstring>
</property> </property>
@ -52,7 +52,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QCheckBox" row="1" column="1"> <widget class="TQCheckBox" row="1" column="1">
<property name="name"> <property name="name">
<cstring>kcfg_OverrideAltF1</cstring> <cstring>kcfg_OverrideAltF1</cstring>
</property> </property>
@ -83,7 +83,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QCheckBox" row="2" column="1"> <widget class="TQCheckBox" row="2" column="1">
<property name="name"> <property name="name">
<cstring>kcfg_ShowSaveSession</cstring> <cstring>kcfg_ShowSaveSession</cstring>
</property> </property>
@ -98,7 +98,7 @@
It saves the current session informations like open applications and windows position. In order to use it you must set "Restore manually saved session" in the Session Manager Kcontrol module.</string> It saves the current session informations like open applications and windows position. In order to use it you must set "Restore manually saved session" in the Session Manager Kcontrol module.</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="4" column="1"> <widget class="TQCheckBox" row="4" column="1">
<property name="name"> <property name="name">
<cstring>kcfg_HideOneChild</cstring> <cstring>kcfg_HideOneChild</cstring>
</property> </property>
@ -112,7 +112,7 @@ It saves the current session informations like open applications and windows pos
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="5" column="1"> <widget class="TQCheckBox" row="5" column="1">
<property name="name"> <property name="name">
<cstring>kcfg_Alphabetical</cstring> <cstring>kcfg_Alphabetical</cstring>
</property> </property>
@ -123,7 +123,7 @@ It saves the current session informations like open applications and windows pos
<string>Alt+B</string> <string>Alt+B</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="6" column="0" rowspan="1" colspan="2"> <widget class="TQLabel" row="6" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>SearchFieldBehaviour</cstring> <cstring>SearchFieldBehaviour</cstring>
</property> </property>
@ -139,7 +139,7 @@ It saves the current session informations like open applications and windows pos
<set>AlignBottom</set> <set>AlignBottom</set>
</property> </property>
</widget> </widget>
<widget class="QButtonGroup" row="7" column="1"> <widget class="TQButtonGroup" row="7" column="1">
<property name="name"> <property name="name">
<cstring>buttonGroup1</cstring> <cstring>buttonGroup1</cstring>
</property> </property>
@ -156,7 +156,7 @@ It saves the current session informations like open applications and windows pos
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>simpleSearch</cstring> <cstring>simpleSearch</cstring>
</property> </property>
@ -176,7 +176,7 @@ It saves the current session informations like open applications and windows pos
<string>It displays in the first column all the applications whose name or description matches with the query you entered</string> <string>It displays in the first column all the applications whose name or description matches with the query you entered</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>kcfg_KerryIntegration</cstring> <cstring>kcfg_KerryIntegration</cstring>
</property> </property>
@ -194,7 +194,7 @@ It saves the current session informations like open applications and windows pos
It needs Kerry Beagle up and running.</string> It needs Kerry Beagle up and running.</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>kcfg_StrigiIntegration</cstring> <cstring>kcfg_StrigiIntegration</cstring>
</property> </property>
@ -214,7 +214,7 @@ It needs the Strigi Daemon up and running</string>
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QCheckBox" row="3" column="1"> <widget class="TQCheckBox" row="3" column="1">
<property name="name"> <property name="name">
<cstring>kcfg_NewAppsNotification</cstring> <cstring>kcfg_NewAppsNotification</cstring>
</property> </property>

@ -24,7 +24,7 @@
#include <klocale.h> #include <klocale.h>
#include <dcopclient.h> #include <dcopclient.h>
#include <qregexp.h> #include <tqregexp.h>
#include <X11/Xauth.h> #include <X11/Xauth.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
@ -83,7 +83,7 @@ DM::DM() : fd( -1 )
break; break;
case OldKDM: case OldKDM:
{ {
QString tf( ctl ); TQString tf( ctl );
tf.truncate( tf.find( ',' ) ); tf.truncate( tf.find( ',' ) );
fd = ::open( tf.latin1(), O_WRONLY ); fd = ::open( tf.latin1(), O_WRONLY );
} }
@ -100,7 +100,7 @@ DM::~DM()
bool bool
DM::exec( const char *cmd ) DM::exec( const char *cmd )
{ {
QCString buf; TQCString buf;
return exec( cmd, buf ); return exec( cmd, buf );
} }
@ -118,7 +118,7 @@ DM::exec( const char *cmd )
* from KDM. * from KDM.
*/ */
bool bool
DM::exec( const char *cmd, QCString &buf ) DM::exec( const char *cmd, TQCString &buf )
{ {
bool ret = false; bool ret = false;
int tl; int tl;
@ -167,7 +167,7 @@ DM::canShutdown()
if (DMType == OldKDM) if (DMType == OldKDM)
return strstr( ctl, ",maysd" ) != 0; return strstr( ctl, ",maysd" ) != 0;
QCString re; TQCString re;
if (DMType == GDM) if (DMType == GDM)
return exec( "QUERY_LOGOUT_ACTION\n", re ) && re.find("HALT") >= 0; return exec( "QUERY_LOGOUT_ACTION\n", re ) && re.find("HALT") >= 0;
@ -178,14 +178,14 @@ DM::canShutdown()
void void
DM::shutdown( KApplication::ShutdownType shutdownType, DM::shutdown( KApplication::ShutdownType shutdownType,
KApplication::ShutdownMode shutdownMode, /* NOT Default */ KApplication::ShutdownMode shutdownMode, /* NOT Default */
const QString &bootOption ) const TQString &bootOption )
{ {
if (shutdownType == KApplication::ShutdownTypeNone) if (shutdownType == KApplication::ShutdownTypeNone)
return; return;
bool cap_ask; bool cap_ask;
if (DMType == NewKDM) { if (DMType == NewKDM) {
QCString re; TQCString re;
cap_ask = exec( "caps\n", re ) && re.find( "\tshutdown ask" ) >= 0; cap_ask = exec( "caps\n", re ) && re.find( "\tshutdown ask" ) >= 0;
} else { } else {
if (!bootOption.isEmpty()) if (!bootOption.isEmpty())
@ -195,7 +195,7 @@ DM::shutdown( KApplication::ShutdownType shutdownType,
if (!cap_ask && shutdownMode == KApplication::ShutdownModeInteractive) if (!cap_ask && shutdownMode == KApplication::ShutdownModeInteractive)
shutdownMode = KApplication::ShutdownModeForceNow; shutdownMode = KApplication::ShutdownModeForceNow;
QCString cmd; TQCString cmd;
if (DMType == GDM) { if (DMType == GDM) {
cmd.append( shutdownMode == KApplication::ShutdownModeForceNow ? cmd.append( shutdownMode == KApplication::ShutdownModeForceNow ?
"SET_LOGOUT_ACTION " : "SET_SAFE_LOGOUT_ACTION " ); "SET_LOGOUT_ACTION " : "SET_SAFE_LOGOUT_ACTION " );
@ -218,16 +218,16 @@ DM::shutdown( KApplication::ShutdownType shutdownType,
} }
bool bool
DM::bootOptions( QStringList &opts, int &defopt, int &current ) DM::bootOptions( TQStringList &opts, int &defopt, int &current )
{ {
if (DMType != NewKDM) if (DMType != NewKDM)
return false; return false;
QCString re; TQCString re;
if (!exec( "listbootoptions\n", re )) if (!exec( "listbootoptions\n", re ))
return false; return false;
opts = QStringList::split( '\t', QString::fromLocal8Bit( re.data() ) ); opts = TQStringList::split( '\t', TQString::fromLocal8Bit( re.data() ) );
if (opts.size() < 4) if (opts.size() < 4)
return false; return false;
@ -239,8 +239,8 @@ DM::bootOptions( QStringList &opts, int &defopt, int &current )
if (!ok) if (!ok)
return false; return false;
opts = QStringList::split( ' ', opts[1] ); opts = TQStringList::split( ' ', opts[1] );
for (QStringList::Iterator it = opts.begin(); it != opts.end(); ++it) for (TQStringList::Iterator it = opts.begin(); it != opts.end(); ++it)
(*it).replace( "\\s", " " ); (*it).replace( "\\s", " " );
return true; return true;
@ -262,7 +262,7 @@ DM::isSwitchable()
if (DMType == GDM) if (DMType == GDM)
return exec( "QUERY_VT\n" ); return exec( "QUERY_VT\n" );
QCString re; TQCString re;
return exec( "caps\n", re ) && re.find( "\tlocal" ) >= 0; return exec( "caps\n", re ) && re.find( "\tlocal" ) >= 0;
} }
@ -276,7 +276,7 @@ DM::numReserve()
if (DMType == OldKDM) if (DMType == OldKDM)
return strstr( ctl, ",rsvd" ) ? 1 : -1; return strstr( ctl, ",rsvd" ) ? 1 : -1;
QCString re; TQCString re;
int p; int p;
if (!(exec( "caps\n", re ) && (p = re.find( "\treserve " )) >= 0)) if (!(exec( "caps\n", re ) && (p = re.find( "\treserve " )) >= 0))
@ -299,14 +299,14 @@ DM::localSessions( SessList &list )
if (DMType == OldKDM) if (DMType == OldKDM)
return false; return false;
QCString re; TQCString re;
if (DMType == GDM) { if (DMType == GDM) {
if (!exec( "CONSOLE_SERVERS\n", re )) if (!exec( "CONSOLE_SERVERS\n", re ))
return false; return false;
QStringList sess = QStringList::split( QChar(';'), re.data() + 3 ); TQStringList sess = TQStringList::split( TQChar(';'), re.data() + 3 );
for (QStringList::ConstIterator it = sess.begin(); it != sess.end(); ++it) { for (TQStringList::ConstIterator it = sess.begin(); it != sess.end(); ++it) {
QStringList ts = QStringList::split( QChar(','), *it, true ); TQStringList ts = TQStringList::split( TQChar(','), *it, true );
SessEnt se; SessEnt se;
se.display = ts[0]; se.display = ts[0];
se.user = ts[1]; se.user = ts[1];
@ -319,9 +319,9 @@ DM::localSessions( SessList &list )
} else { } else {
if (!exec( "list\talllocal\n", re )) if (!exec( "list\talllocal\n", re ))
return false; return false;
QStringList sess = QStringList::split( QChar('\t'), re.data() + 3 ); TQStringList sess = TQStringList::split( TQChar('\t'), re.data() + 3 );
for (QStringList::ConstIterator it = sess.begin(); it != sess.end(); ++it) { for (TQStringList::ConstIterator it = sess.begin(); it != sess.end(); ++it) {
QStringList ts = QStringList::split( QChar(','), *it, true ); TQStringList ts = TQStringList::split( TQChar(','), *it, true );
SessEnt se; SessEnt se;
se.display = ts[0]; se.display = ts[0];
if (ts[1][0] == '@') if (ts[1][0] == '@')
@ -339,11 +339,11 @@ DM::localSessions( SessList &list )
} }
void void
DM::sess2Str2( const SessEnt &se, QString &user, QString &loc ) DM::sess2Str2( const SessEnt &se, TQString &user, TQString &loc )
{ {
if (se.tty) { if (se.tty) {
user = i18n("user: ...", "%1: TTY login").arg( se.user ); user = i18n("user: ...", "%1: TTY login").arg( se.user );
loc = se.vt ? QString("vt%1").arg( se.vt ) : se.display ; loc = se.vt ? TQString("vt%1").arg( se.vt ) : se.display ;
} else { } else {
user = user =
se.user.isEmpty() ? se.user.isEmpty() ?
@ -358,15 +358,15 @@ DM::sess2Str2( const SessEnt &se, QString &user, QString &loc )
.arg( se.user ).arg( se.session ); .arg( se.user ).arg( se.session );
loc = loc =
se.vt ? se.vt ?
QString("%1, vt%2").arg( se.display ).arg( se.vt ) : TQString("%1, vt%2").arg( se.display ).arg( se.vt ) :
se.display; se.display;
} }
} }
QString TQString
DM::sess2Str( const SessEnt &se ) DM::sess2Str( const SessEnt &se )
{ {
QString user, loc; TQString user, loc;
sess2Str2( se, user, loc ); sess2Str2( se, user, loc );
return i18n("session (location)", "%1 (%2)").arg( user ).arg( loc ); return i18n("session (location)", "%1 (%2)").arg( user ).arg( loc );
@ -376,9 +376,9 @@ bool
DM::switchVT( int vt ) DM::switchVT( int vt )
{ {
if (DMType == GDM) if (DMType == GDM)
return exec( QString("SET_VT %1\n").arg(vt).latin1() ); return exec( TQString("SET_VT %1\n").arg(vt).latin1() );
return exec( QString("activate\tvt%1\n").arg(vt).latin1() ); return exec( TQString("activate\tvt%1\n").arg(vt).latin1() );
} }
void void
@ -396,7 +396,7 @@ DM::GDMAuthenticate()
int dnl; int dnl;
Xauth *xau; Xauth *xau;
dpy = DisplayString( QPaintDevice::x11AppDisplay() ); dpy = DisplayString( TQPaintDevice::x11AppDisplay() );
if (!dpy) { if (!dpy) {
dpy = ::getenv( "DISPLAY" ); dpy = ::getenv( "DISPLAY" );
if (!dpy) if (!dpy)
@ -416,9 +416,9 @@ DM::GDMAuthenticate()
xau->data_length == 16 && xau->data_length == 16 &&
xau->name_length == 18 && !memcmp( xau->name, "MIT-MAGIC-COOKIE-1", 18 )) xau->name_length == 18 && !memcmp( xau->name, "MIT-MAGIC-COOKIE-1", 18 ))
{ {
QString cmd( "AUTH_LOCAL " ); TQString cmd( "AUTH_LOCAL " );
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
cmd += QString::number( (uchar)xau->data[i], 16 ).rightJustify( 2, '0'); cmd += TQString::number( (uchar)xau->data[i], 16 ).rightJustify( 2, '0');
cmd += "\n"; cmd += "\n";
if (exec( cmd.latin1() )) { if (exec( cmd.latin1() )) {
XauDisposeAuth( xau ); XauDisposeAuth( xau );

@ -24,12 +24,12 @@
#include <kapplication.h> #include <kapplication.h>
struct SessEnt { struct SessEnt {
QString display, from, user, session; TQString display, from, user, session;
int vt; int vt;
bool self:1, tty:1; bool self:1, tty:1;
}; };
typedef QValueList<SessEnt> SessList; typedef TQValueList<SessEnt> SessList;
class DM { class DM {
@ -42,7 +42,7 @@ public:
bool canShutdown(); bool canShutdown();
void shutdown( KApplication::ShutdownType shutdownType, void shutdown( KApplication::ShutdownType shutdownType,
KApplication::ShutdownMode shutdownMode, KApplication::ShutdownMode shutdownMode,
const QString &bootOption = QString::null ); const TQString &bootOption = TQString::null );
void setLock( bool on ); void setLock( bool on );
@ -53,15 +53,15 @@ public:
bool switchVT( int vt ); bool switchVT( int vt );
void lockSwitchVT( int vt ); void lockSwitchVT( int vt );
bool bootOptions( QStringList &opts, int &dflt, int &curr ); bool bootOptions( TQStringList &opts, int &dflt, int &curr );
static QString sess2Str( const SessEnt &se ); static TQString sess2Str( const SessEnt &se );
static void sess2Str2( const SessEnt &se, QString &user, QString &loc ); static void sess2Str2( const SessEnt &se, TQString &user, TQString &loc );
private: private:
int fd; int fd;
bool exec( const char *cmd, QCString &ret ); bool exec( const char *cmd, TQCString &ret );
bool exec( const char *cmd ); bool exec( const char *cmd );
void GDMAuthenticate(); void GDMAuthenticate();
@ -74,7 +74,7 @@ public:
bool canShutdown() { return false; } bool canShutdown() { return false; }
void shutdown( KApplication::ShutdownType shutdownType, void shutdown( KApplication::ShutdownType shutdownType,
KApplication::ShutdownMode shutdownMode, KApplication::ShutdownMode shutdownMode,
const QString &bootOption = QString::null ) {} const TQString &bootOption = TQString::null ) {}
void setLock( bool ) {} void setLock( bool ) {}
@ -84,7 +84,7 @@ public:
bool localSessions( SessList &list ) { return false; } bool localSessions( SessList &list ) { return false; }
void switchVT( int vt ) {} void switchVT( int vt ) {}
bool bootOptions( QStringList &opts, int &dflt, int &curr ); bool bootOptions( TQStringList &opts, int &dflt, int &curr );
#endif // Q_WS_X11 #endif // Q_WS_X11

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>Menu</class> <class>Menu</class>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>Menu</cstring> <cstring>Menu</cstring>
</property> </property>
@ -25,7 +25,7 @@
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QFrame"> <widget class="TQFrame">
<property name="name"> <property name="name">
<cstring>frame9</cstring> <cstring>frame9</cstring>
</property> </property>
@ -39,7 +39,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QFrame" row="0" column="0" rowspan="2" colspan="1"> <widget class="TQFrame" row="0" column="0" rowspan="2" colspan="1">
<property name="name"> <property name="name">
<cstring>leftFrame</cstring> <cstring>leftFrame</cstring>
</property> </property>
@ -76,7 +76,7 @@
<cstring>dynamicList</cstring> <cstring>dynamicList</cstring>
</property> </property>
</widget> </widget>
<widget class="QPushButton" row="3" column="0" rowspan="1" colspan="3"> <widget class="TQPushButton" row="3" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>clearRecentButton</cstring> <cstring>clearRecentButton</cstring>
</property> </property>
@ -87,7 +87,7 @@
<string>Alt+C</string> <string>Alt+C</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="0"> <widget class="TQLabel" row="0" column="0">
<property name="name"> <property name="name">
<cstring>searchLabel</cstring> <cstring>searchLabel</cstring>
</property> </property>
@ -101,7 +101,7 @@
<cstring>searchLine</cstring> <cstring>searchLine</cstring>
</property> </property>
</widget> </widget>
<widget class="QComboBox" row="1" column="1" rowspan="1" colspan="2"> <widget class="TQComboBox" row="1" column="1" rowspan="1" colspan="2">
<item> <item>
<property name="text"> <property name="text">
<string>Favourite applications</string> <string>Favourite applications</string>
@ -153,7 +153,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
</widget> </widget>
<widget class="QToolButton" row="0" column="2"> <widget class="TQToolButton" row="0" column="2">
<property name="name"> <property name="name">
<cstring>clearButton</cstring> <cstring>clearButton</cstring>
</property> </property>
@ -161,7 +161,7 @@
<string>...</string> <string>...</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="1" column="0"> <widget class="TQLabel" row="1" column="0">
<property name="name"> <property name="name">
<cstring>showLabel</cstring> <cstring>showLabel</cstring>
</property> </property>
@ -196,7 +196,7 @@
</size> </size>
</property> </property>
</widget> </widget>
<widget class="QFrame" row="0" column="1" rowspan="1" colspan="2"> <widget class="TQFrame" row="0" column="1" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>allAppsFrame</cstring> <cstring>allAppsFrame</cstring>
</property> </property>
@ -221,7 +221,7 @@
<property name="margin"> <property name="margin">
<number>2</number> <number>2</number>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>
@ -237,7 +237,7 @@
<set>AlignCenter</set> <set>AlignCenter</set>
</property> </property>
</widget> </widget>
<widget class="QToolButton"> <widget class="TQToolButton">
<property name="name"> <property name="name">
<cstring>detachButton</cstring> <cstring>detachButton</cstring>
</property> </property>
@ -261,7 +261,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="3"> <widget class="TQLayoutWidget" row="2" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>layout6</cstring> <cstring>layout6</cstring>
</property> </property>

@ -25,10 +25,10 @@
#include <kuser.h> #include <kuser.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <kmimetype.h> #include <kmimetype.h>
#include <qfocusdata.h> #include <tqfocusdata.h>
#include <qstyle.h> #include <tqstyle.h>
#include <qfile.h> #include <tqfile.h>
#include <qcursor.h> #include <tqcursor.h>
#include <kpopupmenu.h> #include <kpopupmenu.h>
#include <kdebug.h> #include <kdebug.h>
@ -36,8 +36,8 @@
#include "menuhandler.h" #include "menuhandler.h"
#include "buttons.h" #include "buttons.h"
MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) MenuHandler::MenuHandler( TQWidget *parent, Prefs *prefs, char *name, WFlags fl)
:QFrame(parent, name, fl ), searchMode(false) :TQFrame(parent, name, fl ), searchMode(false)
{ {
prefSkel = prefs; prefSkel = prefs;
@ -46,14 +46,14 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl)
KServiceGroup::Ptr service = KServiceGroup::root(); KServiceGroup::Ptr service = KServiceGroup::root();
//Kicker config //Kicker config
QString kickerConfPath = locate("config", "kickerrc"); TQString kickerConfPath = locate("config", "kickerrc");
kickerConf = new KConfig(kickerConfPath); kickerConf = new KConfig(kickerConfPath);
kickerConfWatch = new KDirWatch( this ); kickerConfWatch = new KDirWatch( this );
kickerConfWatch->addFile(kickerConfPath); kickerConfWatch->addFile(kickerConfPath);
connect( kickerConfWatch, SIGNAL(dirty(const QString&)), this, connect( kickerConfWatch, SIGNAL(dirty(const TQString&)), this,
SLOT(slotModKickerConf()) ); SLOT(slotModKickerConf()) );
connect( kickerConfWatch, SIGNAL(dirty(const QString&)), this, connect( kickerConfWatch, SIGNAL(dirty(const TQString&)), this,
SIGNAL(kickerConfChanged()) ); SIGNAL(kickerConfChanged()) );
if( _newAppsNotification = prefSkel->newAppsNotification() ) if( _newAppsNotification = prefSkel->newAppsNotification() )
@ -76,7 +76,7 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl)
//Main widget initialization //Main widget initialization
menu = new Menu(this, "tastyMenu"); menu = new Menu(this, "tastyMenu");
MenuHandlerLayout = new QVBoxLayout( this, 0, 0, "MenuHandlerLayout"); MenuHandlerLayout = new TQVBoxLayout( this, 0, 0, "MenuHandlerLayout");
MenuHandlerLayout->addWidget(menu); MenuHandlerLayout->addWidget(menu);
readConfig(); readConfig();
@ -84,8 +84,8 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl)
//Searchline... //Searchline...
iconLoader = KGlobal::iconLoader(); iconLoader = KGlobal::iconLoader();
QPixmap icon; TQPixmap icon;
if( QApplication::reverseLayout() ) if( TQApplication::reverseLayout() )
icon = iconLoader->loadIcon("locationbar_erase", KIcon::Small); icon = iconLoader->loadIcon("locationbar_erase", KIcon::Small);
else else
icon = iconLoader->loadIcon("clear_left", KIcon::Small); icon = iconLoader->loadIcon("clear_left", KIcon::Small);
@ -93,7 +93,7 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl)
connect(menu->clearButton, SIGNAL(clicked()), menu->searchLine, SLOT (clear()) ); connect(menu->clearButton, SIGNAL(clicked()), menu->searchLine, SLOT (clear()) );
menu->detachButton->setIconSet(QPixmap(uic_findImage("detach.png"))); menu->detachButton->setIconSet(TQPixmap(uic_findImage("detach.png")));
connect(menu->detachButton, SIGNAL(clicked()), this, SLOT (switchWindowMode()) ); connect(menu->detachButton, SIGNAL(clicked()), this, SLOT (switchWindowMode()) );
menu->searchLine->setContextMenuEnabled(false); menu->searchLine->setContextMenuEnabled(false);
@ -125,17 +125,17 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl)
//user icon and login //user icon and login
KUser *user = new KUser (); KUser *user = new KUser ();
QString loginName (user->loginName ()); TQString loginName (user->loginName ());
QImage TQImage
userImage (locate userImage (locate
("data", "/home/" + loginName + "/.face.icon")); ("data", "/home/" + loginName + "/.face.icon"));
if( !userImage.isNull() ) if( !userImage.isNull() )
{ {
userImage = userImage.smoothScale (KIcon::SizeSmallMedium, KIcon::SizeSmallMedium); userImage = userImage.smoothScale (KIcon::SizeSmallMedium, KIcon::SizeSmallMedium);
menu->switchButton->setIconSet(QPixmap(userImage)); menu->switchButton->setIconSet(TQPixmap(userImage));
} }
menu->switchButton->setText(loginName); menu->switchButton->setText(loginName);
sessionsMenu = new QPopupMenu(); sessionsMenu = new TQPopupMenu();
menu->switchButton->setPopup(sessionsMenu); menu->switchButton->setPopup(sessionsMenu);
@ -145,25 +145,25 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl)
//left/middle mouse button //left/middle mouse button
connect (menu->dynamicList, connect (menu->dynamicList,
SIGNAL (activated(QListViewItem *, const QPoint & , int )), this, SIGNAL (activated(TQListViewItem *, const TQPoint & , int )), this,
SLOT (dynListClicked(QListViewItem *, const QPoint &, int))); SLOT (dynListClicked(TQListViewItem *, const TQPoint &, int)));
connect (menu->rootList, connect (menu->rootList,
SIGNAL (activated(QListViewItem *, const QPoint & , int )), this, SIGNAL (activated(TQListViewItem *, const TQPoint & , int )), this,
SLOT (rootListClicked(QListViewItem *, const QPoint &, int))); SLOT (rootListClicked(TQListViewItem *, const TQPoint &, int)));
connect (menu->childList, connect (menu->childList,
SIGNAL (activated(QListViewItem *, const QPoint & , int )), this, SIGNAL (activated(TQListViewItem *, const TQPoint & , int )), this,
SLOT (childListClicked(QListViewItem *, const QPoint &, int))); SLOT (childListClicked(TQListViewItem *, const TQPoint &, int)));
//right mouse button //right mouse button
connect (menu->dynamicList, connect (menu->dynamicList,
SIGNAL (contextMenuRequested(QListViewItem *, const QPoint & , int )), this, SIGNAL (contextMenuRequested(TQListViewItem *, const TQPoint & , int )), this,
SLOT (slotContextMenu(QListViewItem *, const QPoint &, int))); SLOT (slotContextMenu(TQListViewItem *, const TQPoint &, int)));
connect (menu->rootList, connect (menu->rootList,
SIGNAL (contextMenuRequested(QListViewItem *, const QPoint & , int )), this, SIGNAL (contextMenuRequested(TQListViewItem *, const TQPoint & , int )), this,
SLOT (slotContextMenu(QListViewItem *, const QPoint &, int))); SLOT (slotContextMenu(TQListViewItem *, const TQPoint &, int)));
connect (menu->childList, connect (menu->childList,
SIGNAL (contextMenuRequested(QListViewItem *, const QPoint & , int )), this, SIGNAL (contextMenuRequested(TQListViewItem *, const TQPoint & , int )), this,
SLOT (slotContextMenu(QListViewItem *, const QPoint &, int))); SLOT (slotContextMenu(TQListViewItem *, const TQPoint &, int)));
//don't open categories on mouseover on childlist //don't open categories on mouseover on childlist
//menu->childList->setEasyOpen( true ); //menu->childList->setEasyOpen( true );
@ -191,15 +191,15 @@ void MenuHandler::loadNewInstalledApps()
//Notification for newly installed apps //Notification for newly installed apps
xdgMenuLister = new KDirLister( ); xdgMenuLister = new KDirLister( );
KStandardDirs *standardDir=new KStandardDirs(); KStandardDirs *standardDir=new KStandardDirs();
QStringList appDirs = standardDir->findDirs("xdgdata-apps", "."); TQStringList appDirs = standardDir->findDirs("xdgdata-apps", ".");
firstListing = 0; firstListing = 0;
for(QStringList::Iterator it = appDirs.begin(); it != appDirs.end(); ++it) for(TQStringList::Iterator it = appDirs.begin(); it != appDirs.end(); ++it)
{ {
xdgMenuLister->openURL(*it, true); xdgMenuLister->openURL(*it, true);
/*HACK: links to kde programs are often installed in a kde subdirectory /*HACK: links to kde programs are often installed in a kde subdirectory
of one of these, so i duplicate all the entries with entry+"kde/"*/ of one of these, so i duplicate all the entries with entry+"kde/"*/
QString appDirWithKde = (*it)+"kde/"; TQString appDirWithKde = (*it)+"kde/";
if( QFile::exists(appDirWithKde) ) if( TQFile::exists(appDirWithKde) )
{ {
xdgMenuLister->openURL(appDirWithKde, true); xdgMenuLister->openURL(appDirWithKde, true);
firstListing++; firstListing++;
@ -215,7 +215,7 @@ void MenuHandler::loadNewInstalledApps()
xdgMenuWatch = new KDirWatch(this); xdgMenuWatch = new KDirWatch(this);
xdgMenuWatch->addFile(locateLocal("xdgconf-menu", "applications-kmenuedit.menu")); xdgMenuWatch->addFile(locateLocal("xdgconf-menu", "applications-kmenuedit.menu"));
//connect with slotApplicationRemoved() because we need to wait a while... //connect with slotApplicationRemoved() because we need to wait a while...
connect( xdgMenuWatch, SIGNAL(dirty(const QString&)), this, connect( xdgMenuWatch, SIGNAL(dirty(const TQString&)), this,
SLOT(slotApplicationRemoved()) ); SLOT(slotApplicationRemoved()) );
newInstalledList = prefSkel->newInstalledApps(); newInstalledList = prefSkel->newInstalledApps();
@ -236,12 +236,12 @@ void MenuHandler::loadNewInstalledApps()
void MenuHandler::setupColumns() void MenuHandler::setupColumns()
{ {
menu->dynamicList->header()->hide(); menu->dynamicList->header()->hide();
menu->dynamicList->setResizeMode(QListView::AllColumns); menu->dynamicList->setResizeMode(TQListView::AllColumns);
menu->dynamicList->addColumn("name"); menu->dynamicList->addColumn("name");
menu->dynamicList->setShowToolTips(true); menu->dynamicList->setShowToolTips(true);
menu->dynamicList->setSortColumn(-1); menu->dynamicList->setSortColumn(-1);
menu->dynamicList->header()->setResizeEnabled(false); menu->dynamicList->header()->setResizeEnabled(false);
menu->dynamicList->setHScrollBarMode(QScrollView::AlwaysOff); menu->dynamicList->setHScrollBarMode(TQScrollView::AlwaysOff);
menu->dynamicList->setActionIconSize( _actionIconSize ); menu->dynamicList->setActionIconSize( _actionIconSize );
menu->dynamicList->setRootIsDecorated( _showExpander ); menu->dynamicList->setRootIsDecorated( _showExpander );
//manage drag'n drop //manage drag'n drop
@ -251,21 +251,21 @@ void MenuHandler::setupColumns()
this, SLOT(dynListElemMoved()) ); this, SLOT(dynListElemMoved()) );
menu->rootList->header()->hide(); menu->rootList->header()->hide();
menu->rootList->setResizeMode(QListView::AllColumns); menu->rootList->setResizeMode(TQListView::AllColumns);
menu->rootList->addColumn("name"); menu->rootList->addColumn("name");
menu->rootList->setSortColumn(-1); menu->rootList->setSortColumn(-1);
menu->rootList->header()->setResizeEnabled(false); menu->rootList->header()->setResizeEnabled(false);
menu->rootList->setHScrollBarMode(QScrollView::AlwaysOff); menu->rootList->setHScrollBarMode(TQScrollView::AlwaysOff);
menu->rootList->setHighLightGroups( false ); menu->rootList->setHighLightGroups( false );
menu->rootList->setActionIconSize( _actionIconSize ); menu->rootList->setActionIconSize( _actionIconSize );
menu->rootList->setDragEnabled(true); menu->rootList->setDragEnabled(true);
menu->childList->header()->hide(); menu->childList->header()->hide();
menu->childList->setResizeMode(QListView::AllColumns); menu->childList->setResizeMode(TQListView::AllColumns);
menu->childList->addColumn("name"); menu->childList->addColumn("name");
menu->childList->setSortColumn(_alphabetical?0:-1); menu->childList->setSortColumn(_alphabetical?0:-1);
menu->childList->header()->setResizeEnabled(false); menu->childList->header()->setResizeEnabled(false);
menu->childList->setHScrollBarMode(QScrollView::AlwaysOff); menu->childList->setHScrollBarMode(TQScrollView::AlwaysOff);
menu->childList->setActionIconSize( _actionIconSize ); menu->childList->setActionIconSize( _actionIconSize );
menu->childList->setRootIsDecorated( _showExpander ); menu->childList->setRootIsDecorated( _showExpander );
menu->childList->setDragEnabled(true); menu->childList->setDragEnabled(true);
@ -276,7 +276,7 @@ void MenuHandler::dynListElemMoved( )
{ {
//very stupid: iterate the entire list and rewrite the favouriteList //very stupid: iterate the entire list and rewrite the favouriteList
favouriteList.clear(); favouriteList.clear();
QListViewItemIterator it( menu->dynamicList ); TQListViewItemIterator it( menu->dynamicList );
while ( it.current() ) while ( it.current() )
{ {
@ -294,31 +294,31 @@ void MenuHandler::dynListElemMoved( )
} }
bool MenuHandler::eventFilter( QObject *o, QEvent * e ) bool MenuHandler::eventFilter( TQObject *o, TQEvent * e )
{ {
if ( e->type() == QEvent::KeyPress ) if ( e->type() == TQEvent::KeyPress )
{ {
QKeyEvent *keyEvent = (QKeyEvent *)e; TQKeyEvent *keyEvent = (TQKeyEvent *)e;
QFocusData *fData = focusData(); TQFocusData *fData = focusData();
fData->home(); fData->home();
switch( keyEvent->key() ) switch( keyEvent->key() )
{ {
case Qt::Key_Up: case TQt::Key_Up:
if( dynamic_cast<QComboBox *>(o) ) if( dynamic_cast<TQComboBox *>(o) )
return false; return false;
fData->prev()->setFocus(); fData->prev()->setFocus();
break; break;
case Qt::Key_Down: case TQt::Key_Down:
{ {
if( dynamic_cast<QComboBox *>(o) ) if( dynamic_cast<TQComboBox *>(o) )
return false; return false;
//this is a workaround in order to set the focus on the //this is a workaround in order to set the focus on the
//right widget when the combobox is disabled //right widget when the combobox is disabled
QWidget *nextWidget = fData->next(); TQWidget *nextWidget = fData->next();
if( nextWidget->isEnabled() ) if( nextWidget->isEnabled() )
nextWidget->setFocus(); nextWidget->setFocus();
else else
@ -326,29 +326,29 @@ bool MenuHandler::eventFilter( QObject *o, QEvent * e )
} }
break; break;
case Qt::Key_Right: case TQt::Key_Right:
if( dynamic_cast<KListViewSearchLine *>(o) ) if( dynamic_cast<KListViewSearchLine *>(o) )
return false; return false;
fData->next()->setFocus(); fData->next()->setFocus();
break; break;
case Qt::Key_Left: case TQt::Key_Left:
if( dynamic_cast<KListViewSearchLine *>(o) ) if( dynamic_cast<KListViewSearchLine *>(o) )
return false; return false;
fData->prev()->setFocus(); fData->prev()->setFocus();
break; break;
case Qt::Key_Enter: case TQt::Key_Enter:
case Qt::Key_Return: case TQt::Key_Return:
{ {
//only filter enter on search line //only filter enter on search line
if( o != menu->searchLine ) if( o != menu->searchLine )
return false; return false;
QListViewItem *listItem = NULL; TQListViewItem *listItem = NULL;
//execute the only list item when there is exactly one //execute the only list item when there is exactly one
QListViewItemIterator it( menu->dynamicList, TQListViewItemIterator it( menu->dynamicList,
QListViewItemIterator::Visible); TQListViewItemIterator::Visible);
//listItem = it.current(); //listItem = it.current();
int count = 0; int count = 0;
//ensure the first level have only one result //ensure the first level have only one result
@ -367,7 +367,7 @@ bool MenuHandler::eventFilter( QObject *o, QEvent * e )
if( listItem ) if( listItem )
{ {
dynListClicked(listItem, QPoint(0,0), 0); dynListClicked(listItem, TQPoint(0,0), 0);
menu->searchLine->clear(); menu->searchLine->clear();
} }
@ -381,11 +381,11 @@ bool MenuHandler::eventFilter( QObject *o, QEvent * e )
return true; return true;
} }
//for some reasons clicking with the right mouse button on the searchline everything crashes... //for some reasons clicking with the right mouse button on the searchline everything crashes...
/* else if( e->type() == QEvent::MouseButtonPress && o == menu->searchLine ) /* else if( e->type() == TQEvent::MouseButtonPress && o == menu->searchLine )
{return true; {return true;
QMouseEvent *mouseEvent = (QMouseEvent *)e; TQMouseEvent *mouseEvent = (TQMouseEvent *)e;
if( mouseEvent->button() != QMouseEvent::RightButton ) if( mouseEvent->button() != TQMouseEvent::RightButton )
return true; return true;
if( menu->searchLine->text().length() < 4 ) if( menu->searchLine->text().length() < 4 )
@ -443,7 +443,7 @@ void MenuHandler::readConfig()
//menu size //menu size
_menuWidth = 100.0/prefSkel->menuWidth(); _menuWidth = 100.0/prefSkel->menuWidth();
_menuHeight = 100.0/prefSkel->menuHeight(); _menuHeight = 100.0/prefSkel->menuHeight();
QRect r = QDesktopWidget().screenGeometry(this); TQRect r = TQDesktopWidget().screenGeometry(this);
int w = (int)(r.width()/_menuWidth); int w = (int)(r.width()/_menuWidth);
int h = (int)(r.height()/_menuHeight); int h = (int)(r.height()/_menuHeight);
resize(w,h); resize(w,h);
@ -454,48 +454,48 @@ void MenuHandler::readConfig()
_isNormalWindow = prefSkel->isNormalWindow(); _isNormalWindow = prefSkel->isNormalWindow();
if( _isNormalWindow ) if( _isNormalWindow )
{ {
menu->detachButton->setIconSet(QPixmap(uic_findImage("attach.png"))); menu->detachButton->setIconSet(TQPixmap(uic_findImage("attach.png")));
QToolTip::add( menu->detachButton, tr2i18n( "Make this window a popup menu" ) ); TQToolTip::add( menu->detachButton, tr2i18n( "Make this window a popup menu" ) );
} }
else else
{ {
menu->detachButton->setIconSet(QPixmap(uic_findImage("detach.png"))); menu->detachButton->setIconSet(TQPixmap(uic_findImage("detach.png")));
QToolTip::add( menu->detachButton, tr2i18n( "Make this menu a normal window" ) ); TQToolTip::add( menu->detachButton, tr2i18n( "Make this menu a normal window" ) );
} }
// disconnect(menu->searchLine, 0, 0, 0); // disconnect(menu->searchLine, 0, 0, 0);
if( !_kerryIntegration && !_strigiIntegration ) if( !_kerryIntegration && !_strigiIntegration )
{ {
//menu->searchLine->setListView((KListView *)(menu->dynamicList)); //menu->searchLine->setListView((KListView *)(menu->dynamicList));
disconnect(menu->searchLine, SIGNAL(returnPressed( const QString &)), disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)),
this, SLOT (kerrySearch( const QString &)) ); this, SLOT (kerrySearch( const TQString &)) );
disconnect(menu->searchLine, SIGNAL(returnPressed( const QString &)), disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)),
this, SLOT (strigiSearch( const QString &)) ); this, SLOT (strigiSearch( const TQString &)) );
connect(menu->searchLine, SIGNAL(textChanged( const QString &)), connect(menu->searchLine, SIGNAL(textChanged( const TQString &)),
this, SLOT (initializeSearch( const QString &)) ); this, SLOT (initializeSearch( const TQString &)) );
} }
else if( _kerryIntegration ) else if( _kerryIntegration )
{ {
menu->searchLine->setListView(NULL); menu->searchLine->setListView(NULL);
menu->searchLine->setEnabled(true); menu->searchLine->setEnabled(true);
disconnect(menu->searchLine, SIGNAL(textChanged( const QString &)), disconnect(menu->searchLine, SIGNAL(textChanged( const TQString &)),
this, SLOT (initializeSearch( const QString &)) ); this, SLOT (initializeSearch( const TQString &)) );
disconnect(menu->searchLine, SIGNAL(returnPressed( const QString &)), disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)),
this, SLOT (strigiSearch( const QString &)) ); this, SLOT (strigiSearch( const TQString &)) );
connect(menu->searchLine, SIGNAL(returnPressed( const QString &)), connect(menu->searchLine, SIGNAL(returnPressed( const TQString &)),
this, SLOT (kerrySearch( const QString &)) ); this, SLOT (kerrySearch( const TQString &)) );
menu->searchLine->setContextMenuEnabled(false); menu->searchLine->setContextMenuEnabled(false);
} }
else //strigi else //strigi
{ {
menu->searchLine->setListView(NULL); menu->searchLine->setListView(NULL);
menu->searchLine->setEnabled(true); menu->searchLine->setEnabled(true);
disconnect(menu->searchLine, SIGNAL(textChanged( const QString &)), disconnect(menu->searchLine, SIGNAL(textChanged( const TQString &)),
this, SLOT (initializeSearch( const QString &)) ); this, SLOT (initializeSearch( const TQString &)) );
disconnect(menu->searchLine, SIGNAL(returnPressed( const QString &)), disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)),
this, SLOT (kerrySearch( const QString &)) ); this, SLOT (kerrySearch( const TQString &)) );
connect(menu->searchLine, SIGNAL(returnPressed( const QString &)), connect(menu->searchLine, SIGNAL(returnPressed( const TQString &)),
this, SLOT (strigiSearch( const QString &)) ); this, SLOT (strigiSearch( const TQString &)) );
menu->searchLine->setContextMenuEnabled(false); menu->searchLine->setContextMenuEnabled(false);
} }
} }
@ -518,20 +518,20 @@ void MenuHandler::updateConfig()
} }
void MenuHandler::mousePressEvent( QMouseEvent *e) void MenuHandler::mousePressEvent( TQMouseEvent *e)
{ {
if(static_cast<QWidget *>(parent())->hasMouse()) if(static_cast<TQWidget *>(parent())->hasMouse())
{ {
close(); close();
} }
else if(!_isNormalWindow && !(rect().contains(e->pos())) ) else if(!_isNormalWindow && !(rect().contains(e->pos())) )
{ {
hide(); hide();
QTimer::singleShot(200, this,SLOT(close())); TQTimer::singleShot(200, this,SLOT(close()));
} }
} }
void MenuHandler::closeEvent ( QCloseEvent *e) void MenuHandler::closeEvent ( TQCloseEvent *e)
{ {
e=e; e=e;
@ -546,11 +546,11 @@ void MenuHandler::closeEvent ( QCloseEvent *e)
//HACK: I wait a little bit to permit closing the menu //HACK: I wait a little bit to permit closing the menu
// when user clicks on the menu button again // when user clicks on the menu button again
QTimer::singleShot(50, this, SLOT(hide())); TQTimer::singleShot(50, this, SLOT(hide()));
emit(hidden()); emit(hidden());
} }
void MenuHandler::popup(QPoint pos) void MenuHandler::popup(TQPoint pos)
{ {
if(isVisible()) if(isVisible())
{ {
@ -564,7 +564,7 @@ void MenuHandler::popup(QPoint pos)
int h; int h;
if( !_isNormalWindow ) if( !_isNormalWindow )
{ {
QRect r = QDesktopWidget().screenGeometry(this); TQRect r = TQDesktopWidget().screenGeometry(this);
w = (int)(r.width()/_menuWidth); w = (int)(r.width()/_menuWidth);
h = (int)(r.height()/_menuHeight); h = (int)(r.height()/_menuHeight);
} }
@ -642,7 +642,7 @@ void MenuHandler::initNewInstalledApps(KServiceGroup::Ptr group)
KService *s = static_cast < KService * > ( p ); KService *s = static_cast < KService * > ( p );
QString path(s->desktopEntryPath()); TQString path(s->desktopEntryPath());
if( oldInstalledList.findIndex(path) == -1 && if( oldInstalledList.findIndex(path) == -1 &&
newInstalledList.findIndex(path) == -1 ) newInstalledList.findIndex(path) == -1 )
{ {
@ -695,7 +695,7 @@ bool MenuHandler::searchNewItems(KServiceGroup::Ptr group)
/*KServiceGroup::List MenuHandler::getServiceGroupList( KServiceGroup *serviceGroup ) /*KServiceGroup::List MenuHandler::getServiceGroupList( KServiceGroup *serviceGroup )
{ {
QString key(serviceGroup->directoryEntryPath()); TQString key(serviceGroup->directoryEntryPath());
if( sListMap.contains(key) ) if( sListMap.contains(key) )
return sListMap[key]; return sListMap[key];
@ -709,7 +709,7 @@ bool MenuHandler::searchNewItems(KServiceGroup::Ptr group)
void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *listView, void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *listView,
TastyListViewItem *listItemFather, TastyListViewItem *listItemFather,
bool recursive, const QString & query ) bool recursive, const TQString & query )
{ {
if( !serviceGroup || !serviceGroup->isValid() ) if( !serviceGroup || !serviceGroup->isValid() )
return; return;
@ -749,15 +749,15 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list
if(numChilds == 0) if(numChilds == 0)
continue; continue;
QPixmap iconPix = iconLoader->loadIcon(g->icon(), KIcon::Toolbar,iconSize); TQPixmap iconPix = iconLoader->loadIcon(g->icon(), KIcon::Toolbar,iconSize);
if ( iconPix.height () != iconSize) if ( iconPix.height () != iconSize)
{ {
QImage img = iconPix.convertToImage(); TQImage img = iconPix.convertToImage();
if( !img.isNull() ) if( !img.isNull() )
{ {
img = img.smoothScale ( iconSize, iconSize); img = img.smoothScale ( iconSize, iconSize);
iconPix = QPixmap (img); iconPix = TQPixmap (img);
} }
} }
@ -792,8 +792,8 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list
if( _currentCategory == listItem->text(0) && listView == menu->rootList ) if( _currentCategory == listItem->text(0) && listView == menu->rootList )
{ {
listView->setCurrentItem(listItem); listView->setCurrentItem(listItem);
listView->setOpenItem(static_cast<QListViewItem *>(listItem)); listView->setOpenItem(static_cast<TQListViewItem *>(listItem));
rootListClicked(listItem, QPoint(0,0), 0); rootListClicked(listItem, TQPoint(0,0), 0);
} }
if(searchNewItems(g)) if(searchNewItems(g))
listItem->setHighLight(true); listItem->setHighLight(true);
@ -841,8 +841,8 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list
//Name and comment //Name and comment
QString itemName = s->name(); TQString itemName = s->name();
QString subText= QString(); TQString subText= TQString();
if( !isSeparator ) if( !isSeparator )
{ {
if( s->comment() != NULL && !s->comment().isEmpty() ) if( s->comment() != NULL && !s->comment().isEmpty() )
@ -899,14 +899,14 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list
prevListItem = listItem; prevListItem = listItem;
QPixmap iconPix = s->pixmap( KIcon::Toolbar, iconSize ); TQPixmap iconPix = s->pixmap( KIcon::Toolbar, iconSize );
if ( iconPix.height () != iconSize) if ( iconPix.height () != iconSize)
{ {
QImage img = iconPix.convertToImage(); TQImage img = iconPix.convertToImage();
if( !img.isNull() ) if( !img.isNull() )
{ {
img = img.smoothScale ( iconSize, iconSize); img = img.smoothScale ( iconSize, iconSize);
iconPix = QPixmap (img); iconPix = TQPixmap (img);
} }
} }
listItem->setPixmap(0, iconPix); listItem->setPixmap(0, iconPix);
@ -936,15 +936,15 @@ void MenuHandler::initializeRecentlyUsed( )
kickerConf->reparseConfiguration(); kickerConf->reparseConfiguration();
kickerConf->setGroup("menus"); kickerConf->setGroup("menus");
QStringList recentUsedList = QStringList::split(',',kickerConf->readEntry("RecentAppsStat")); TQStringList recentUsedList = TQStringList::split(',',kickerConf->readEntry("RecentAppsStat"));
for (QStringList::ConstIterator it = recentUsedList.begin(); for (TQStringList::ConstIterator it = recentUsedList.begin();
it != recentUsedList.end(); ++it ) it != recentUsedList.end(); ++it )
{ {
QString item = (*it); TQString item = (*it);
QString desktopPath = item.section(' ',2,2); TQString desktopPath = item.section(' ',2,2);
if(desktopPath.isEmpty() || !QFile::exists(desktopPath)) if(desktopPath.isEmpty() || !TQFile::exists(desktopPath))
continue; continue;
recentlyUsedMap[-item.section(' ',1,1).toULong()] = desktopPath; recentlyUsedMap[-item.section(' ',1,1).toULong()] = desktopPath;
@ -973,14 +973,14 @@ void MenuHandler::fillRecentDocuments( )
menu->dynamicList->clear(); menu->dynamicList->clear();
setupDynList( RecentDocuments ); setupDynList( RecentDocuments );
QStringList recentDocsList = KRecentDocument::recentDocuments(); TQStringList recentDocsList = KRecentDocument::recentDocuments();
TastyListViewItem *listItem = NULL; TastyListViewItem *listItem = NULL;
if( recentDocsList.isEmpty() ) if( recentDocsList.isEmpty() )
return; return;
for (QStringList::Iterator it = recentDocsList.begin(); for (TQStringList::Iterator it = recentDocsList.begin();
it != recentDocsList.end(); ++it ) it != recentDocsList.end(); ++it )
{ {
KDesktopFile *f= new KDesktopFile(*it, true /* read only */); KDesktopFile *f= new KDesktopFile(*it, true /* read only */);
@ -994,14 +994,14 @@ void MenuHandler::fillRecentDocuments( )
listItem->setDeskopEntryPath(*it); listItem->setDeskopEntryPath(*it);
listItem->setType( TastyListViewItem::DesktopFile ); listItem->setType( TastyListViewItem::DesktopFile );
QPixmap iconPix = iconLoader->loadIcon(f->readIcon(), KIcon::Panel, _iconSize1); TQPixmap iconPix = iconLoader->loadIcon(f->readIcon(), KIcon::Panel, _iconSize1);
if ( iconPix.height () > _iconSize1) if ( iconPix.height () > _iconSize1)
{ {
QImage img = iconPix.convertToImage(); TQImage img = iconPix.convertToImage();
if( !img.isNull() ) if( !img.isNull() )
{ {
img = img.smoothScale ( _iconSize1, _iconSize1); img = img.smoothScale ( _iconSize1, _iconSize1);
iconPix = QPixmap (img); iconPix = TQPixmap (img);
} }
} }
listItem->setPixmap(0, iconPix); listItem->setPixmap(0, iconPix);
@ -1021,7 +1021,7 @@ void MenuHandler::fillMoreUsed( )
TastyListViewItem *listItem = NULL; TastyListViewItem *listItem = NULL;
for (QStringList::Iterator it = moreUsedList.begin(); for (TQStringList::Iterator it = moreUsedList.begin();
it != moreUsedList.end(); ++it ) it != moreUsedList.end(); ++it )
{ {
//FIXME: yeah, I know, this is U G L Y :-) //FIXME: yeah, I know, this is U G L Y :-)
@ -1041,16 +1041,16 @@ void MenuHandler::fillMoreUsed( )
listItem->setDisplaySubText(_displaySubText); listItem->setDisplaySubText(_displaySubText);
QPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); TQPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 );
if( !iconPix.isNull() ) if( !iconPix.isNull() )
{ {
if ( iconPix.height () != _iconSize1) if ( iconPix.height () != _iconSize1)
{ {
QImage img = iconPix.convertToImage(); TQImage img = iconPix.convertToImage();
if( !img.isNull() ) if( !img.isNull() )
{ {
img = img.smoothScale ( _iconSize1, _iconSize1); img = img.smoothScale ( _iconSize1, _iconSize1);
iconPix = QPixmap (img); iconPix = TQPixmap (img);
} }
} }
listItem->setPixmap(0, iconPix); listItem->setPixmap(0, iconPix);
@ -1090,16 +1090,16 @@ void MenuHandler::fillRecentlyUsed( )
listItem->setDisplaySubText(_displaySubText); listItem->setDisplaySubText(_displaySubText);
QPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); TQPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 );
if( !iconPix.isNull() ) if( !iconPix.isNull() )
{ {
if ( iconPix.height () != _iconSize1) if ( iconPix.height () != _iconSize1)
{ {
QImage img = iconPix.convertToImage(); TQImage img = iconPix.convertToImage();
if( !img.isNull() ) if( !img.isNull() )
{ {
img = img.smoothScale ( _iconSize1, _iconSize1); img = img.smoothScale ( _iconSize1, _iconSize1);
iconPix = QPixmap (img); iconPix = TQPixmap (img);
} }
} }
listItem->setPixmap(0, iconPix); listItem->setPixmap(0, iconPix);
@ -1119,7 +1119,7 @@ void MenuHandler::fillFavourites( )
TastyListViewItem *listItem = NULL; TastyListViewItem *listItem = NULL;
for (QStringList::Iterator it = favouriteList.begin(); for (TQStringList::Iterator it = favouriteList.begin();
it != favouriteList.end(); ++it ) it != favouriteList.end(); ++it )
{ {
@ -1135,14 +1135,14 @@ void MenuHandler::fillFavourites( )
listItem->setDisplaySubText(_displaySubText); listItem->setDisplaySubText(_displaySubText);
QPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); TQPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 );
if ( iconPix.height () > _iconSize1) if ( iconPix.height () > _iconSize1)
{ {
QImage img = iconPix.convertToImage(); TQImage img = iconPix.convertToImage();
if( !img.isNull() ) if( !img.isNull() )
{ {
img = img.smoothScale ( _iconSize1, _iconSize1); img = img.smoothScale ( _iconSize1, _iconSize1);
iconPix = QPixmap (img); iconPix = TQPixmap (img);
} }
} }
listItem->setPixmap(0, iconPix); listItem->setPixmap(0, iconPix);
@ -1181,7 +1181,7 @@ void MenuHandler::slotApplicationsAdded(const KFileItemList & newItems)
for(KFileItemListIterator it(newItems); it.current(); ++it) for(KFileItemListIterator it(newItems); it.current(); ++it)
{ {
KFileItem *item = (*it); KFileItem *item = (*it);
QString path(item->url().path()); TQString path(item->url().path());
kdDebug() << "new item: " << item->name() << endl; kdDebug() << "new item: " << item->name() << endl;
//ignore items already here //ignore items already here
@ -1202,13 +1202,13 @@ void MenuHandler::slotApplicationsAdded(const KFileItemList & newItems)
//It's necessary to wait some seconds, otherwise apps won't be listed //It's necessary to wait some seconds, otherwise apps won't be listed
//I do it two times for being sure, because I still haven't the clear idea //I do it two times for being sure, because I still haven't the clear idea
//where the right files to watch are... //where the right files to watch are...
QTimer::singleShot(15000, this, SLOT(slotUpdateApplications())); TQTimer::singleShot(15000, this, SLOT(slotUpdateApplications()));
} }
void MenuHandler::slotApplicationRemoved() void MenuHandler::slotApplicationRemoved()
{ {
QTimer::singleShot(15000, this, SLOT(slotUpdateApplications())); TQTimer::singleShot(15000, this, SLOT(slotUpdateApplications()));
slotUpdateApplications(); slotUpdateApplications();
} }
@ -1222,7 +1222,7 @@ void MenuHandler::slotUpdateApplications()
populateList( service, menu->rootList, NULL, false ); populateList( service, menu->rootList, NULL, false );
} }
void MenuHandler::listClicked( TastyListViewItem * listItem, const QPoint & coord ) void MenuHandler::listClicked( TastyListViewItem * listItem, const TQPoint & coord )
{ {
if( !listItem ) if( !listItem )
return; return;
@ -1234,7 +1234,7 @@ void MenuHandler::listClicked( TastyListViewItem * listItem, const QPoint & coor
int x = coord.x(); int x = coord.x();
QString servicePath = listItem->getDeskopEntryPath(); TQString servicePath = listItem->getDeskopEntryPath();
switch( listItem->getType() ) switch( listItem->getType() )
{ {
@ -1291,7 +1291,7 @@ void MenuHandler::listClicked( TastyListViewItem * listItem, const QPoint & coor
{ {
DCOPRef kickerKMenuIface ("kicker", "KMenu"); DCOPRef kickerKMenuIface ("kicker", "KMenu");
kickerKMenuIface.call("slotServiceStartedByStorageId(QString,QString)", "tastymenu", servicePath); kickerKMenuIface.call("slotServiceStartedByStorageId(TQString,TQString)", "tastymenu", servicePath);
if( (currentMenuMode == MoreUsed if( (currentMenuMode == MoreUsed
|| currentMenuMode == RecentlyUsed) || currentMenuMode == RecentlyUsed)
&& !searchMode) && !searchMode)
@ -1349,7 +1349,7 @@ void MenuHandler::listClicked( TastyListViewItem * listItem, const QPoint & coor
} }
void MenuHandler::dynListClicked( QListViewItem * listItem, const QPoint & coord, int c ) void MenuHandler::dynListClicked( TQListViewItem * listItem, const TQPoint & coord, int c )
{ {
c=c; c=c;
if( !listItem ) if( !listItem )
@ -1362,7 +1362,7 @@ void MenuHandler::dynListClicked( QListViewItem * listItem, const QPoint & coord
listClicked( static_cast<TastyListViewItem *>(listItem), coord ); listClicked( static_cast<TastyListViewItem *>(listItem), coord );
} }
void MenuHandler::childListClicked( QListViewItem * listItem, const QPoint & coord, int c ) void MenuHandler::childListClicked( TQListViewItem * listItem, const TQPoint & coord, int c )
{ {
c=c; c=c;
if( !listItem ) if( !listItem )
@ -1382,7 +1382,7 @@ void MenuHandler::childListClicked( QListViewItem * listItem, const QPoint & coo
listClicked( static_cast<TastyListViewItem *>(listItem), coord ); listClicked( static_cast<TastyListViewItem *>(listItem), coord );
} }
void MenuHandler::rootListClicked( QListViewItem * listItem, const QPoint & coord, int c ) void MenuHandler::rootListClicked( TQListViewItem * listItem, const TQPoint & coord, int c )
{ {
c=c; c=c;
if( !listItem ) if( !listItem )
@ -1408,7 +1408,7 @@ void MenuHandler::rootListClicked( QListViewItem * listItem, const QPoint & coor
menu->childList->setSorting(0); menu->childList->setSorting(0);
} }
void MenuHandler::slotContextMenu(QListViewItem *listItem, const QPoint &coord, int c) void MenuHandler::slotContextMenu(TQListViewItem *listItem, const TQPoint &coord, int c)
{ {
if( !listItem ) if( !listItem )
@ -1454,7 +1454,7 @@ void MenuHandler::slotContextMenu(QListViewItem *listItem, const QPoint &coord,
break; break;
case 2: case 2:
listClicked( tastyListItem, QPoint(tastyListItem->listView()->width(), 0) ); listClicked( tastyListItem, TQPoint(tastyListItem->listView()->width(), 0) );
break; break;
case 3: case 3:
@ -1590,7 +1590,7 @@ void MenuHandler::doNewSession( bool lock )
} }
void MenuHandler::initializeSearch( const QString & query ) void MenuHandler::initializeSearch( const TQString & query )
{ {
if( !searchMode && query.length() > 2 ) if( !searchMode && query.length() > 2 )
{ {
@ -1600,9 +1600,9 @@ void MenuHandler::initializeSearch( const QString & query )
menu->menuModes->setEnabled(false); menu->menuModes->setEnabled(false);
KServiceGroup::Ptr service = KServiceGroup::root(); KServiceGroup::Ptr service = KServiceGroup::root();
menu->dynamicList->clear(); menu->dynamicList->clear();
setCursor(QCursor(Qt::BusyCursor)); setCursor(TQCursor(TQt::BusyCursor));
populateList( service, menu->dynamicList, NULL, true, query ); populateList( service, menu->dynamicList, NULL, true, query );
setCursor(QCursor(Qt::ArrowCursor)); setCursor(TQCursor(TQt::ArrowCursor));
} }
else if( query.length() < 3 ) else if( query.length() < 3 )
{ {
@ -1620,14 +1620,14 @@ void MenuHandler::initializeSearch( const QString & query )
} }
} }
void MenuHandler::kerrySearch( const QString & query ) void MenuHandler::kerrySearch( const TQString & query )
{ {
close(); close();
DCOPRef kdesktopKScreensaverIface ("kerry", "search"); DCOPRef kdesktopKScreensaverIface ("kerry", "search");
kdesktopKScreensaverIface.call ("search(QString)", query); kdesktopKScreensaverIface.call ("search(TQString)", query);
} }
void MenuHandler::strigiSearch( const QString & query ) void MenuHandler::strigiSearch( const TQString & query )
{ {
close(); close();
KRun::runCommand ("konqueror strigi:/?q="+query); KRun::runCommand ("konqueror strigi:/?q="+query);
@ -1685,23 +1685,23 @@ void MenuHandler::menuModeChanged( int index )
void MenuHandler::switchWindowMode() void MenuHandler::switchWindowMode()
{ {
if( !_isNormalWindow /*testWFlags(Qt::WType_Popup)*/ ) if( !_isNormalWindow /*testWFlags(TQt::WType_Popup)*/ )
{ {
_isNormalWindow = true; _isNormalWindow = true;
hide(); hide();
reparent(static_cast<QWidget *>(parent()),Qt::WType_Dialog, pos(), true); reparent(static_cast<TQWidget *>(parent()),TQt::WType_Dialog, pos(), true);
menu->detachButton->setIconSet(QPixmap(uic_findImage("attach.png"))); menu->detachButton->setIconSet(TQPixmap(uic_findImage("attach.png")));
prefSkel->setIsNormalWindow(true); prefSkel->setIsNormalWindow(true);
} }
else else
{ {
hide(); hide();
reparent(static_cast<QWidget *>(parent()), reparent(static_cast<TQWidget *>(parent()),
Qt::WType_Popup|Qt::WNoAutoErase, TQt::WType_Popup|TQt::WNoAutoErase,
pos(), true); pos(), true);
menu->detachButton->setIconSet(QPixmap(uic_findImage("detach.png"))); menu->detachButton->setIconSet(TQPixmap(uic_findImage("detach.png")));
prefSkel->setIsNormalWindow(false); prefSkel->setIsNormalWindow(false);
_isNormalWindow = false; _isNormalWindow = false;
} }

@ -32,14 +32,14 @@
#include <krecentdocument.h> #include <krecentdocument.h>
#include <krun.h> #include <krun.h>
#include <dcopref.h> #include <dcopref.h>
#include <qheader.h> #include <tqheader.h>
#include <qimage.h> #include <tqimage.h>
#include <qtoolbutton.h> #include <tqtoolbutton.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qcombobox.h> #include <tqcombobox.h>
#include <kdirwatch.h> #include <kdirwatch.h>
#include <kdirlister.h> #include <kdirlister.h>
#include <qlayout.h> #include <tqlayout.h>
#include <kfileitem.h> #include <kfileitem.h>
#include "dmctl.h" #include "dmctl.h"
@ -50,16 +50,16 @@
/** /**
@author Marco Martin <notmart@gmail.com> @author Marco Martin <notmart@gmail.com>
*/ */
class MenuHandler : public QFrame{ class MenuHandler : public TQFrame{
Q_OBJECT Q_OBJECT
public: public:
MenuHandler( QWidget *parent, Prefs *prefs, char *name=0, WFlags fl=WType_TopLevel ); MenuHandler( TQWidget *parent, Prefs *prefs, char *name=0, WFlags fl=WType_TopLevel );
~MenuHandler(); ~MenuHandler();
void readConfig(); void readConfig();
void popup(QPoint pos); void popup(TQPoint pos);
void updateConfig(); void updateConfig();
void focusNextChild(){focusNextPrevChild(true);} void focusNextChild(){focusNextPrevChild(true);}
void focusPrevChild(){focusNextPrevChild(false);} void focusPrevChild(){focusNextPrevChild(false);}
@ -74,15 +74,15 @@ signals:
void hidden(); void hidden();
protected: protected:
virtual bool eventFilter( QObject *o, QEvent * e ); virtual bool eventFilter( TQObject *o, TQEvent * e );
virtual void closeEvent ( QCloseEvent *e); virtual void closeEvent ( TQCloseEvent *e);
virtual void resizeEvent ( QResizeEvent *e) virtual void resizeEvent ( TQResizeEvent *e)
{ QWidget::resizeEvent(e); menu->leftFrame->setMaximumWidth( (int)((width()-24)/3) ); } { TQWidget::resizeEvent(e); menu->leftFrame->setMaximumWidth( (int)((width()-24)/3) ); }
virtual void mousePressEvent( QMouseEvent *e); virtual void mousePressEvent( TQMouseEvent *e);
private: private:
typedef QMap<ulong, QString> RecentlyUsedMap; typedef TQMap<ulong, TQString> RecentlyUsedMap;
typedef enum typedef enum
{ {
Favourites = 0, Favourites = 0,
@ -93,12 +93,12 @@ private:
RecentlyUsedMap recentlyUsedMap; RecentlyUsedMap recentlyUsedMap;
QStringList moreUsedList, favouriteList; TQStringList moreUsedList, favouriteList;
Menu * menu; Menu * menu;
MenuMode currentMenuMode; MenuMode currentMenuMode;
KIconLoader *iconLoader; KIconLoader *iconLoader;
QPopupMenu *sessionsMenu; TQPopupMenu *sessionsMenu;
bool searchMode; bool searchMode;
Prefs *prefSkel; Prefs *prefSkel;
KConfig *kickerConf; KConfig *kickerConf;
@ -107,15 +107,15 @@ private:
KDirWatch *xdgMenuWatch; KDirWatch *xdgMenuWatch;
KDirLister *xdgMenuLister; KDirLister *xdgMenuLister;
int firstListing; int firstListing;
QStringList oldInstalledList, newInstalledList; TQStringList oldInstalledList, newInstalledList;
QValueList<int> newInstalledTimeStamps; TQValueList<int> newInstalledTimeStamps;
QPixmap bookMarkPix; TQPixmap bookMarkPix;
QVBoxLayout * MenuHandlerLayout; TQVBoxLayout * MenuHandlerLayout;
//configuration items //configuration items
int _menuMode; int _menuMode;
QString _currentCategory; TQString _currentCategory;
int _numRecentEntries; int _numRecentEntries;
int _iconSize1; int _iconSize1;
int _iconSize2; int _iconSize2;
@ -133,7 +133,7 @@ private:
bool _hideOneChild; bool _hideOneChild;
bool _alphabetical; bool _alphabetical;
typedef QMap<QString, KServiceGroup::List> SListMap; typedef TQMap<TQString, KServiceGroup::List> SListMap;
SListMap sListMap; SListMap sListMap;
//KServiceGroup::List getServiceGroupList( KServiceGroup *serviceGroup ); //KServiceGroup::List getServiceGroupList( KServiceGroup *serviceGroup );
void setupColumns(); void setupColumns();
@ -143,9 +143,9 @@ private:
void populateList( KServiceGroup *serviceGroup, void populateList( KServiceGroup *serviceGroup,
TastyListView *listView, TastyListView *listView,
TastyListViewItem *listItemFather, TastyListViewItem *listItemFather,
bool recursive, const QString & query = NULL ); bool recursive, const TQString & query = NULL );
void listClicked( TastyListViewItem * listItem, const QPoint & coord ); void listClicked( TastyListViewItem * listItem, const TQPoint & coord );
void fillRecentDocuments( ); void fillRecentDocuments( );
void fillMoreUsed( ); void fillMoreUsed( );
void fillRecentlyUsed( ); void fillRecentlyUsed( );
@ -159,23 +159,23 @@ public slots:
private slots: private slots:
void dynListElemMoved( ); void dynListElemMoved( );
void dynListClicked( QListViewItem * listItem, const QPoint & coord, int c ); void dynListClicked( TQListViewItem * listItem, const TQPoint & coord, int c );
void slotContextMenu(QListViewItem *listItem, const QPoint &coord, int c ); void slotContextMenu(TQListViewItem *listItem, const TQPoint &coord, int c );
void initializeRecentlyUsed( ); void initializeRecentlyUsed( );
void slotModKickerConf(); void slotModKickerConf();
void slotApplicationsAdded(const KFileItemList & newItems); void slotApplicationsAdded(const KFileItemList & newItems);
void slotApplicationRemoved(); void slotApplicationRemoved();
void childListClicked( QListViewItem * listItem, const QPoint & coord, int c ); void childListClicked( TQListViewItem * listItem, const TQPoint & coord, int c );
void rootListClicked( QListViewItem * listItem, const QPoint & coord, int c ); void rootListClicked( TQListViewItem * listItem, const TQPoint & coord, int c );
void doLogout(); void doLogout();
void doLock(); void doLock();
void slotPopulateSessions(); void slotPopulateSessions();
void slotSessionActivated( int ent ); void slotSessionActivated( int ent );
void doNewSession( bool lock ); void doNewSession( bool lock );
void runDialog(); void runDialog();
void initializeSearch( const QString & query ); void initializeSearch( const TQString & query );
void kerrySearch( const QString & query ); void kerrySearch( const TQString & query );
void strigiSearch( const QString & query ); void strigiSearch( const TQString & query );
void clearDynList(); void clearDynList();
void menuModeChanged( int index ); void menuModeChanged( int index );
void switchWindowMode(); void switchWindowMode();

@ -16,23 +16,23 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include <qcolor.h> #include <tqcolor.h>
#include "misc.h" #include "misc.h"
QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a) TQColor alphaBlendColors(const TQColor &bgColor, const TQColor &fgColor, const int a)
{ {
// normal button... // normal button...
QRgb rgb = bgColor.rgb(); TQRgb rgb = bgColor.rgb();
QRgb rgb_b = fgColor.rgb(); TQRgb rgb_b = fgColor.rgb();
int alpha = a; int alpha = a;
if(alpha>255) alpha = 255; if(alpha>255) alpha = 255;
if(alpha<0) alpha = 0; if(alpha<0) alpha = 0;
int inv_alpha = 255 - alpha; int inv_alpha = 255 - alpha;
QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255, TQColor result = TQColor( tqRgb(tqRed(rgb_b)*inv_alpha/255 + tqRed(rgb)*alpha/255,
qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255, tqGreen(rgb_b)*inv_alpha/255 + tqGreen(rgb)*alpha/255,
qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) ); tqBlue(rgb_b)*inv_alpha/255 + tqBlue(rgb)*alpha/255) );
return result; return result;
} }

@ -19,6 +19,6 @@
#ifndef __MISC_H #ifndef __MISC_H
#define __MISC_H #define __MISC_H
QColor alphaBlendColors(const QColor &backgroundColor, const QColor &foregroundColor, const int alpha); TQColor alphaBlendColors(const TQColor &backgroundColor, const TQColor &foregroundColor, const int alpha);
#endif // __MISC_H #endif // __MISC_H

@ -19,14 +19,14 @@
***************************************************************************/ ***************************************************************************/
#include "tastybutton.h" #include "tastybutton.h"
#include <qimage.h> #include <tqimage.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qpalette.h> #include <tqpalette.h>
#include <qcolor.h> #include <tqcolor.h>
#include <kimageeffect.h> #include <kimageeffect.h>
TastyButton::TastyButton(QWidget *parent) TastyButton::TastyButton(TQWidget *parent)
: QToolButton(parent) : TQToolButton(parent)
{ {
iconEffect = new KIconEffect(); iconEffect = new KIconEffect();
iconEffect->init(); iconEffect->init();
@ -37,17 +37,17 @@ TastyButton::~TastyButton()
{ {
} }
void TastyButton::drawButton( QPainter * p ) void TastyButton::drawButton( TQPainter * p )
{ {
//background image or pseudo transparency //background image or pseudo transparency
if( parentWidget()->erasePixmap() ) if( parentWidget()->erasePixmap() )
{ {
const QPixmap erasePix(size()); const TQPixmap erasePix(size());
QPainter buffPainter(&erasePix); TQPainter buffPainter(&erasePix);
buffPainter.drawPixmap(QPoint(0, 0), *parentWidget()->erasePixmap(), geometry()); buffPainter.drawPixmap(TQPoint(0, 0), *parentWidget()->erasePixmap(), geometry());
buffPainter.end(); buffPainter.end();
QImage eraseImg = erasePix.convertToImage(); TQImage eraseImg = erasePix.convertToImage();
if( isDown() ) if( isDown() )
{ {
KImageEffect::fade(eraseImg, 0.25, black); KImageEffect::fade(eraseImg, 0.25, black);
@ -73,7 +73,7 @@ void TastyButton::drawButton( QPainter * p )
x=++y; x=++y;
//deciding the text color to use //deciding the text color to use
int h,s,v; int h,s,v;
QColor(eraseImg.pixel(x,y)).getHsv( h, s, v ); TQColor(eraseImg.pixel(x,y)).getHsv( h, s, v );
// is purely empirical :) // is purely empirical :)
if( v > 140) lightScore++; if( v > 140) lightScore++;
else lightScore--; else lightScore--;
@ -103,14 +103,14 @@ void TastyButton::drawButton( QPainter * p )
drawButtonLabel(p); drawButtonLabel(p);
} }
void TastyButton::setIconSet( QIconSet is ) void TastyButton::setIconSet( TQIconSet is )
{ {
is.setPixmap(iconEffect->apply(is.pixmap(), is.setPixmap(iconEffect->apply(is.pixmap(),
(int)KIcon::Panel, (int)KIcon::Panel,
(int)KIcon::ActiveState), (int)KIcon::ActiveState),
QIconSet::Automatic, TQIconSet::Automatic,
QIconSet::Active); TQIconSet::Active);
QToolButton::setIconSet( is ); TQToolButton::setIconSet( is );
} }

@ -22,26 +22,26 @@
#include <kiconeffect.h> #include <kiconeffect.h>
#include <kicontheme.h> #include <kicontheme.h>
#include <qiconset.h> #include <tqiconset.h>
#include <qtoolbutton.h> #include <tqtoolbutton.h>
/** /**
@author Marco Martin <notmart@gmail.com> @author Marco Martin <notmart@gmail.com>
*/ */
class TastyButton : public QToolButton class TastyButton : public TQToolButton
{ {
public: public:
TastyButton(QWidget *parent); TastyButton(TQWidget *parent);
~TastyButton(); ~TastyButton();
void setIconSet( QIconSet is ); void setIconSet( TQIconSet is );
protected: protected:
void drawButton( QPainter * p ); void drawButton( TQPainter * p );
private: private:
QPixmap highLightedIcon; TQPixmap highLightedIcon;
KIconEffect *iconEffect; KIconEffect *iconEffect;
}; };

@ -24,19 +24,19 @@
#include <kdeversion.h> #include <kdeversion.h>
#include <kstringhandler.h> #include <kstringhandler.h>
#include <qimage.h> #include <tqimage.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qheader.h> #include <tqheader.h>
#include <klocale.h> #include <klocale.h>
#include <kurldrag.h> #include <kurldrag.h>
#include <qapplication.h> #include <tqapplication.h>
TastyListView::TastyListView( QWidget * parent, const char * name) TastyListView::TastyListView( TQWidget * parent, const char * name)
: KListView(parent, name), highLightGroups(true), easyOpen(true) : KListView(parent, name), highLightGroups(true), easyOpen(true)
{ {
onItemTimer = new QTimer(this, "onItemTimer"); onItemTimer = new TQTimer(this, "onItemTimer");
underCursorItem = openItem = NULL; underCursorItem = openItem = NULL;
mouseDown = false; mouseDown = false;
actionIconSize = 16; actionIconSize = 16;
@ -44,7 +44,7 @@ TastyListView::TastyListView( QWidget * parent, const char * name)
listItemTip = new TastyListViewToolTip(viewport(), this); listItemTip = new TastyListViewToolTip(viewport(), this);
connect(this, SIGNAL(onItem(QListViewItem *) ), SLOT(slotOnItem(QListViewItem *) ) ); connect(this, SIGNAL(onItem(TQListViewItem *) ), SLOT(slotOnItem(TQListViewItem *) ) );
connect(onItemTimer, SIGNAL(timeout()), this, SLOT(slotTimeout()) ); connect(onItemTimer, SIGNAL(timeout()), this, SLOT(slotTimeout()) );
} }
@ -61,7 +61,7 @@ void TastyListView::startDrag()
if( !item ) if( !item )
return; return;
QDragObject *d = new KURLDrag( KURL(item->getDeskopEntryPath()) , viewport() ); TQDragObject *d = new KURLDrag( KURL(item->getDeskopEntryPath()) , viewport() );
if(!d) if(!d)
return; return;
@ -69,7 +69,7 @@ void TastyListView::startDrag()
emit moved(); emit moved();
} }
void TastyListView::contentsMouseReleaseEvent( QMouseEvent * e ) void TastyListView::contentsMouseReleaseEvent( TQMouseEvent * e )
{ {
int x = e->x(); int x = e->x();
if( x > width() || x < 0) if( x > width() || x < 0)
@ -84,7 +84,7 @@ void TastyListView::contentsMouseReleaseEvent( QMouseEvent * e )
if( e->button() == RightButton ) if( e->button() == RightButton )
emit(contextMenuRequested( currentItem(), e->globalPos(), 0) ); emit(contextMenuRequested( currentItem(), e->globalPos(), 0) );
else else
emit(activated( currentItem(), QPoint(x, e->y()), 0) ); emit(activated( currentItem(), TQPoint(x, e->y()), 0) );
if(item && (item->getType() == TastyListViewItem::ServiceGroup)) if(item && (item->getType() == TastyListViewItem::ServiceGroup))
{ {
@ -104,16 +104,16 @@ void TastyListView::contentsMouseReleaseEvent( QMouseEvent * e )
KListView::contentsMouseReleaseEvent(e); KListView::contentsMouseReleaseEvent(e);
} }
void TastyListView::contentsMouseMoveEvent( QMouseEvent * e ) void TastyListView::contentsMouseMoveEvent( TQMouseEvent * e )
{ {
KListView::contentsMouseMoveEvent(e); KListView::contentsMouseMoveEvent(e);
mouseDown = (e->state() & Qt::LeftButton); mouseDown = (e->state() & TQt::LeftButton);
if( itemAt( contentsToViewport(QPoint(e->x(), e->y()))) == 0 ) if( itemAt( contentsToViewport(TQPoint(e->x(), e->y()))) == 0 )
underCursorItem = NULL; underCursorItem = NULL;
} }
void TastyListView::leaveEvent( QEvent * e ) void TastyListView::leaveEvent( TQEvent * e )
{ {
KListView::leaveEvent( e ); KListView::leaveEvent( e );
onItemTimer->stop(); onItemTimer->stop();
@ -122,16 +122,16 @@ void TastyListView::leaveEvent( QEvent * e )
} }
void TastyListView::keyPressEvent( QKeyEvent * e ) void TastyListView::keyPressEvent( TQKeyEvent * e )
{ {
switch(e->key()) switch(e->key())
{ {
case Qt::Key_Enter: case TQt::Key_Enter:
case Qt::Key_Return: case TQt::Key_Return:
case Qt::Key_Space: case TQt::Key_Space:
{ {
emit(activated(currentItem(), QPoint(0,0), 0)); emit(activated(currentItem(), TQPoint(0,0), 0));
if(!currentItem()) if(!currentItem())
return; return;
TastyListViewItem *item = dynamic_cast<TastyListViewItem *>(currentItem()); TastyListViewItem *item = dynamic_cast<TastyListViewItem *>(currentItem());
@ -152,19 +152,19 @@ void TastyListView::keyPressEvent( QKeyEvent * e )
} }
break; break;
case Qt::Key_Up: case TQt::Key_Up:
case Qt::Key_Down: case TQt::Key_Down:
KListView::keyPressEvent( e ); KListView::keyPressEvent( e );
break; break;
case Qt::Key_Right: case TQt::Key_Right:
{ {
if(!currentItem()) if(!currentItem())
return; return;
TastyListViewItem *item = dynamic_cast<TastyListViewItem *>(currentItem()); TastyListViewItem *item = dynamic_cast<TastyListViewItem *>(currentItem());
if(item && easyOpen && !QApplication::reverseLayout() && item->getType() == TastyListViewItem::ServiceGroup) if(item && easyOpen && !TQApplication::reverseLayout() && item->getType() == TastyListViewItem::ServiceGroup)
{ {
emit( activated( currentItem(), QPoint(0,0), 0)); emit( activated( currentItem(), TQPoint(0,0), 0));
if( !openItem ) if( !openItem )
{ {
openItem = currentItem(); openItem = currentItem();
@ -177,17 +177,17 @@ void TastyListView::keyPressEvent( QKeyEvent * e )
oldOpenItem->repaint(); oldOpenItem->repaint();
} }
focusNextPrevChild(!QApplication::reverseLayout()); focusNextPrevChild(!TQApplication::reverseLayout());
break; break;
} }
case Qt::Key_Left: case TQt::Key_Left:
{ {
if( !currentItem() ) if( !currentItem() )
return; return;
TastyListViewItem *item = dynamic_cast<TastyListViewItem *>(currentItem()); TastyListViewItem *item = dynamic_cast<TastyListViewItem *>(currentItem());
if(item && easyOpen && QApplication::reverseLayout() && item->getType() == TastyListViewItem::ServiceGroup) if(item && easyOpen && TQApplication::reverseLayout() && item->getType() == TastyListViewItem::ServiceGroup)
{ {
emit( activated( currentItem(), QPoint(0,0), 0)); emit( activated( currentItem(), TQPoint(0,0), 0));
if( !openItem ) if( !openItem )
{ {
openItem = currentItem(); openItem = currentItem();
@ -200,10 +200,10 @@ void TastyListView::keyPressEvent( QKeyEvent * e )
oldOpenItem->repaint(); oldOpenItem->repaint();
} }
focusNextPrevChild(QApplication::reverseLayout()); focusNextPrevChild(TQApplication::reverseLayout());
break; break;
} }
case Qt::Key_Tab: case TQt::Key_Tab:
KListView::keyPressEvent( e ); KListView::keyPressEvent( e );
break; break;
@ -213,7 +213,7 @@ void TastyListView::keyPressEvent( QKeyEvent * e )
} }
void TastyListView::slotOnItem( QListViewItem * listItem ) void TastyListView::slotOnItem( TQListViewItem * listItem )
{ {
if( !listItem || listItem->listView() != this ) if( !listItem || listItem->listView() != this )
return; return;
@ -239,7 +239,7 @@ void TastyListView::slotTimeout( )
if( easyOpen && tastyUnderCursorItem && if( easyOpen && tastyUnderCursorItem &&
tastyUnderCursorItem->getType() == TastyListViewItem::ServiceGroup ) tastyUnderCursorItem->getType() == TastyListViewItem::ServiceGroup )
{ {
emit(activated(underCursorItem, QPoint(underCursorItem->listView()->width()/2,1), 0)); emit(activated(underCursorItem, TQPoint(underCursorItem->listView()->width()/2,1), 0));
TastyListViewItem *oldOpenItem = dynamic_cast<TastyListViewItem *>(openItem); TastyListViewItem *oldOpenItem = dynamic_cast<TastyListViewItem *>(openItem);
openItem = currentItem(); openItem = currentItem();
if( !oldOpenItem || !oldOpenItem->listView() ) if( !oldOpenItem || !oldOpenItem->listView() )
@ -250,18 +250,18 @@ void TastyListView::slotTimeout( )
} }
///////////TASTYLISTVIEWTOOLTIP ///////////TASTYLISTVIEWTOOLTIP
TastyListViewToolTip::TastyListViewToolTip( QWidget *parent, TastyListView *tListView ) TastyListViewToolTip::TastyListViewToolTip( TQWidget *parent, TastyListView *tListView )
: QToolTip( parent ), listView( tListView ) : TQToolTip( parent ), listView( tListView )
{ {
} }
void TastyListViewToolTip::maybeTip( const QPoint &pos ) void TastyListViewToolTip::maybeTip( const TQPoint &pos )
{ {
if( !parentWidget() || !listView || !listView->showToolTips() ) if( !parentWidget() || !listView || !listView->showToolTips() )
return; return;
TastyListViewItem *item = static_cast<TastyListViewItem *>(listView->itemAt( pos )); TastyListViewItem *item = static_cast<TastyListViewItem *>(listView->itemAt( pos ));
QPoint contentsPos = listView->viewportToContents( pos ); TQPoint contentsPos = listView->viewportToContents( pos );
if( !item || !listView->columns() ) if( !item || !listView->columns() )
return; return;
@ -273,7 +273,7 @@ void TastyListViewToolTip::maybeTip( const QPoint &pos )
int column = listView->header()->sectionAt( contentsPos.x() ); int column = listView->header()->sectionAt( contentsPos.x() );
QRect r = listView->itemRect( item ); TQRect r = listView->itemRect( item );
int headerPos = listView->header()->sectionPos( column ); int headerPos = listView->header()->sectionPos( column );
r.setLeft( headerPos ); r.setLeft( headerPos );
r.setRight( headerPos + listView->header()->sectionSize( column ) ); r.setRight( headerPos + listView->header()->sectionSize( column ) );
@ -330,19 +330,19 @@ TastyListViewItem::TastyListViewItem( TastyListViewItem * parent )
: KListViewItem(parent) : KListViewItem(parent)
{commonConstructor();} {commonConstructor();}
TastyListViewItem::TastyListViewItem( TastyListView * parent, TastyListViewItem * after, QString label1 ) TastyListViewItem::TastyListViewItem( TastyListView * parent, TastyListViewItem * after, TQString label1 )
: KListViewItem(parent, after, label1) : KListViewItem(parent, after, label1)
{commonConstructor();cellText = label1;} {commonConstructor();cellText = label1;}
TastyListViewItem::TastyListViewItem( TastyListViewItem * parent, TastyListViewItem * after, QString label1 ) TastyListViewItem::TastyListViewItem( TastyListViewItem * parent, TastyListViewItem * after, TQString label1 )
: KListViewItem(parent, after, label1) : KListViewItem(parent, after, label1)
{commonConstructor();cellText = label1;} {commonConstructor();cellText = label1;}
TastyListViewItem::TastyListViewItem( TastyListView * parent, QString label1 ) TastyListViewItem::TastyListViewItem( TastyListView * parent, TQString label1 )
: KListViewItem(parent, label1) : KListViewItem(parent, label1)
{commonConstructor();cellText = label1;} {commonConstructor();cellText = label1;}
TastyListViewItem::TastyListViewItem( TastyListViewItem * parent, QString label1 ) TastyListViewItem::TastyListViewItem( TastyListViewItem * parent, TQString label1 )
: KListViewItem(parent, label1) : KListViewItem(parent, label1)
{commonConstructor();cellText = label1;} {commonConstructor();cellText = label1;}
@ -357,11 +357,11 @@ void TastyListViewItem::commonConstructor()
actionType = NoAction; actionType = NoAction;
actionPix = QPixmap(); actionPix = TQPixmap();
menuId = QString(); menuId = TQString();
desktopEntryPath = QString(); desktopEntryPath = TQString();
path = QString(); path = TQString();
ellipsis = false; ellipsis = false;
highLight = false; highLight = false;
@ -371,7 +371,7 @@ void TastyListViewItem::commonConstructor()
void TastyListViewItem::loadPixmap() void TastyListViewItem::loadPixmap()
{ {
QString iconFile = ""; TQString iconFile = "";
iconLoader = KGlobal::iconLoader(); iconLoader = KGlobal::iconLoader();
if( !listView() ) if( !listView() )
@ -392,7 +392,7 @@ void TastyListViewItem::loadPixmap()
break; break;
case OpenGroup: case OpenGroup:
if( QApplication::reverseLayout() ) if( TQApplication::reverseLayout() )
actionPix = iconLoader->loadIcon("1leftarrow", KIcon::Small, lv->getActionIconSize()); actionPix = iconLoader->loadIcon("1leftarrow", KIcon::Small, lv->getActionIconSize());
else else
actionPix = iconLoader->loadIcon("1rightarrow", KIcon::Small, lv->getActionIconSize()); actionPix = iconLoader->loadIcon("1rightarrow", KIcon::Small, lv->getActionIconSize());
@ -413,19 +413,19 @@ void TastyListViewItem::loadPixmap()
if ( actionPix.height () > lv->getActionIconSize()) if ( actionPix.height () > lv->getActionIconSize())
{ {
QImage img = actionPix.convertToImage(); TQImage img = actionPix.convertToImage();
if( !img.isNull() ) if( !img.isNull() )
{ {
img = img.smoothScale ( lv->getActionIconSize(), lv->getActionIconSize()); img = img.smoothScale ( lv->getActionIconSize(), lv->getActionIconSize());
actionPix = QPixmap (img); actionPix = TQPixmap (img);
} }
} }
} }
QString TastyListViewItem::key( int column, bool ascending ) const TQString TastyListViewItem::key( int column, bool ascending ) const
{ {
ascending = ascending; ascending = ascending;
QString prefix; TQString prefix;
//ensure all the categories are before the leaf items //ensure all the categories are before the leaf items
if( itemType == ServiceGroup ) if( itemType == ServiceGroup )
@ -440,7 +440,7 @@ void TastyListViewItem::setup ( )
//KListViewItem::setup(); //KListViewItem::setup();
//calculate listitem height //calculate listitem height
QFontMetrics fm( listView()->font() ); TQFontMetrics fm( listView()->font() );
int pixmapHeight = 5; int pixmapHeight = 5;
if( pixmap(0) ) if( pixmap(0) )
@ -457,14 +457,14 @@ void TastyListViewItem::setup ( )
/*Adapted from Amarok's Statistic listView Copyright (c) 2006 Seb Ruiz*/ /*Adapted from Amarok's Statistic listView Copyright (c) 2006 Seb Ruiz*/
void TastyListViewItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) void TastyListViewItem::paintCell ( TQPainter * p, const TQColorGroup & cg, int column, int width, int align )
{ {
int textHeight = height(); int textHeight = height();
QString name = cellText; TQString name = cellText;
int textX = 0; int textX = 0;
QColor fillColor, textColor; TQColor fillColor, textColor;
# if KDE_VERSION < KDE_MAKE_VERSION(3,3,91) # if KDE_VERSION < KDE_MAKE_VERSION(3,3,91)
# define BackgroundColor backgroundColor() # define BackgroundColor backgroundColor()
@ -483,7 +483,7 @@ void TastyListViewItem::paintCell ( QPainter * p, const QColorGroup & cg, int co
if( !lv ) if( !lv )
return; return;
QFont font( lv->font() ); TQFont font( lv->font() );
if( !isSelected() && (lv->getOpenItem() == this|| if( !isSelected() && (lv->getOpenItem() == this||
(lv->getHighLightGroups() && itemType == ServiceGroup)) ) (lv->getHighLightGroups() && itemType == ServiceGroup)) )
@ -500,17 +500,17 @@ void TastyListViewItem::paintCell ( QPainter * p, const QColorGroup & cg, int co
else if( isSelected() && !lv->hasFocus() ) else if( isSelected() && !lv->hasFocus() )
fillColor = alphaBlendColors( fillColor, BackgroundColor, 150); fillColor = alphaBlendColors( fillColor, BackgroundColor, 150);
QFontMetrics fm( font ); TQFontMetrics fm( font );
widthChanged(column); widthChanged(column);
QPixmap buffer(width*2, textHeight); TQPixmap buffer(width*2, textHeight);
if( buffer.isNull() ) if( buffer.isNull() )
return; return;
buffer.fill( fillColor ); buffer.fill( fillColor );
QPainter pBuf(&buffer); TQPainter pBuf(&buffer);
if( pixmap( column ) ) if( pixmap( column ) )
@ -557,8 +557,8 @@ void TastyListViewItem::paintCell ( QPainter * p, const QColorGroup & cg, int co
font.setPointSize( max((int)(font.pointSize()/1.2), 7) ); font.setPointSize( max((int)(font.pointSize()/1.2), 7) );
pBuf.setFont( font ); pBuf.setFont( font );
QString subTextCopy = subText; TQString subTextCopy = subText;
QFontMetrics sfm( font ); TQFontMetrics sfm( font );
//Calculate the ellipsis for the subtext //Calculate the ellipsis for the subtext
int extraSpace = fm.width("...") + textX + lv->getActionIconSpace(); int extraSpace = fm.width("...") + textX + lv->getActionIconSpace();

@ -27,10 +27,10 @@
#include <kservice.h> #include <kservice.h>
#include <kservicegroup.h> #include <kservicegroup.h>
#include <kdesktopfile.h> #include <kdesktopfile.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <qtooltip.h> #include <tqtooltip.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qheader.h> #include <tqheader.h>
class TastyListView; class TastyListView;
@ -39,12 +39,12 @@ class TastyListView;
/** /**
@author Marco Martin <notmart@gmail.com> @author Marco Martin <notmart@gmail.com>
*/ */
class TastyListViewToolTip: public QToolTip class TastyListViewToolTip: public TQToolTip
{ {
public: public:
TastyListViewToolTip( QWidget *parent, TastyListView *tListView ); TastyListViewToolTip( TQWidget *parent, TastyListView *tListView );
void maybeTip( const QPoint &pos ); void maybeTip( const TQPoint &pos );
private: private:
TastyListView *listView; TastyListView *listView;
@ -58,9 +58,9 @@ class TastyListView : public KListView
Q_OBJECT Q_OBJECT
private: private:
bool highLightGroups; bool highLightGroups;
QTimer *onItemTimer; TQTimer *onItemTimer;
QListViewItem *underCursorItem; TQListViewItem *underCursorItem;
QListViewItem *openItem; TQListViewItem *openItem;
bool mouseDown; bool mouseDown;
bool easyOpen; bool easyOpen;
int actionIconSize; int actionIconSize;
@ -69,7 +69,7 @@ private:
TastyListViewToolTip *listItemTip; TastyListViewToolTip *listItemTip;
public: public:
TastyListView( QWidget * parent = 0, const char * name = 0); TastyListView( TQWidget * parent = 0, const char * name = 0);
~TastyListView(); ~TastyListView();
@ -84,27 +84,27 @@ public:
int getActionIconSize(){return actionIconSize;} int getActionIconSize(){return actionIconSize;}
int getActionIconSpace(){return actionIconSpace;} int getActionIconSpace(){return actionIconSpace;}
QListViewItem * getOpenItem(){ return openItem;} TQListViewItem * getOpenItem(){ return openItem;}
void setOpenItem( QListViewItem * listItem ){openItem = listItem;} void setOpenItem( TQListViewItem * listItem ){openItem = listItem;}
public slots: public slots:
virtual void clear(){openItem = underCursorItem = NULL; KListView::clear();} virtual void clear(){openItem = underCursorItem = NULL; KListView::clear();}
protected: protected:
virtual void leaveEvent( QEvent * e ); virtual void leaveEvent( TQEvent * e );
virtual void contentsMouseMoveEvent( QMouseEvent * e ); virtual void contentsMouseMoveEvent( TQMouseEvent * e );
virtual void contentsMouseReleaseEvent( QMouseEvent * e ); virtual void contentsMouseReleaseEvent( TQMouseEvent * e );
virtual void keyPressEvent( QKeyEvent * e ); virtual void keyPressEvent( TQKeyEvent * e );
private slots: private slots:
void slotOnItem( QListViewItem * listItem ); void slotOnItem( TQListViewItem * listItem );
void slotTimeout(); void slotTimeout();
signals: signals:
//Using own signal instead of clicked() in order to avoid launching two times the same app :-) //Using own signal instead of clicked() in order to avoid launching two times the same app :-)
void activated(QListViewItem *, const QPoint &, int ); void activated(TQListViewItem *, const TQPoint &, int );
}; };
@ -137,20 +137,20 @@ friend class TastyListView;
TastyListViewItem( TastyListView * parent ); TastyListViewItem( TastyListView * parent );
TastyListViewItem( TastyListViewItem * parent ); TastyListViewItem( TastyListViewItem * parent );
TastyListViewItem( TastyListView * parent, TastyListViewItem * after, QString label1 ); TastyListViewItem( TastyListView * parent, TastyListViewItem * after, TQString label1 );
TastyListViewItem( TastyListViewItem * parent, TastyListViewItem * after, QString label1 ); TastyListViewItem( TastyListViewItem * parent, TastyListViewItem * after, TQString label1 );
TastyListViewItem( TastyListView * parent, TastyListViewItem * after ); TastyListViewItem( TastyListView * parent, TastyListViewItem * after );
TastyListViewItem( TastyListViewItem * parent, TastyListViewItem * after ); TastyListViewItem( TastyListViewItem * parent, TastyListViewItem * after );
TastyListViewItem( TastyListView * parent, QString label1 ); TastyListViewItem( TastyListView * parent, TQString label1 );
TastyListViewItem( TastyListViewItem * parent, QString label1 ); TastyListViewItem( TastyListViewItem * parent, TQString label1 );
~TastyListViewItem(); ~TastyListViewItem();
//QString text(int column) const {return cellText;} //TQString text(int column) const {return cellText;}
QString getCellText(int column) const {return cellText;} TQString getCellText(int column) const {return cellText;}
//TastyListViewItem *parent(); //TastyListViewItem *parent();
void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ); void paintCell ( TQPainter * p, const TQColorGroup & cg, int column, int width, int align );
Type getType(){return itemType;} Type getType(){return itemType;}
void setType( Type newItemType ){itemType = newItemType;} void setType( Type newItemType ){itemType = newItemType;}
@ -159,24 +159,24 @@ friend class TastyListView;
void setActionType( ActionType newActionType ){ actionType = newActionType;loadPixmap();} void setActionType( ActionType newActionType ){ actionType = newActionType;loadPixmap();}
void loadPixmap(); void loadPixmap();
void setPath( QString newPath){ path = newPath;} void setPath( TQString newPath){ path = newPath;}
QString getPath(){return path;} TQString getPath(){return path;}
void setDeskopEntryPath( QString newPath){ desktopEntryPath = newPath;} void setDeskopEntryPath( TQString newPath){ desktopEntryPath = newPath;}
QString getDeskopEntryPath(){return desktopEntryPath;} TQString getDeskopEntryPath(){return desktopEntryPath;}
QString getSubText(){return subText;} TQString getSubText(){return subText;}
bool xOnDecoration( int x ) bool xOnDecoration( int x )
{ QListView *lv = listView(); { TQListView *lv = listView();
if( !lv ) return false; if( !lv ) return false;
return !( x > lv->header()->sectionPos( lv->header()->mapToIndex( 0 ) ) + return !( x > lv->header()->sectionPos( lv->header()->mapToIndex( 0 ) ) +
lv->treeStepSize() * ( depth() + ( lv->rootIsDecorated() ? 1 : 0) ) + lv->itemMargin() || lv->treeStepSize() * ( depth() + ( lv->rootIsDecorated() ? 1 : 0) ) + lv->itemMargin() ||
x < lv->header()->sectionPos( lv->header()->mapToIndex( 0 ) ) );} x < lv->header()->sectionPos( lv->header()->mapToIndex( 0 ) ) );}
void setSubText(QString text) //FIXME: add the column void setSubText(TQString text) //FIXME: add the column
{if(cellText.isEmpty())cellText=KListViewItem::text(0); {if(cellText.isEmpty())cellText=KListViewItem::text(0);
KListViewItem::setText(0,cellText+text);subText = QString(text);} KListViewItem::setText(0,cellText+text);subText = TQString(text);}
void setText(int column, const QString & text ) void setText(int column, const TQString & text )
{KListViewItem::setText(column, cellText+text); cellText = text;} {KListViewItem::setText(column, cellText+text); cellText = text;}
void setDisplaySubText( bool display ){ displaySubText = display; } void setDisplaySubText( bool display ){ displaySubText = display; }
@ -184,12 +184,12 @@ friend class TastyListView;
void setHighLight( bool newHighLight ){highLight=newHighLight;} void setHighLight( bool newHighLight ){highLight=newHighLight;}
bool isHighLight(){return highLight;} bool isHighLight(){return highLight;}
void setMenuId( QString newMenuId ){ menuId = newMenuId;} void setMenuId( TQString newMenuId ){ menuId = newMenuId;}
QString getMenuId(){ return menuId; } TQString getMenuId(){ return menuId; }
QString key( int column, bool ascending ) const; TQString key( int column, bool ascending ) const;
int width( const QFontMetrics & fm, const QListView * lv, int c ) int width( const TQFontMetrics & fm, const TQListView * lv, int c )
{ TastyListView *tlv = dynamic_cast<TastyListView *>( listView() ); { TastyListView *tlv = dynamic_cast<TastyListView *>( listView() );
if( tlv ) if( tlv )
return KListViewItem::width(fm, lv, c) + tlv->getActionIconSpace(); return KListViewItem::width(fm, lv, c) + tlv->getActionIconSpace();
@ -204,16 +204,16 @@ private:
Type itemType; Type itemType;
ActionType actionType; ActionType actionType;
QString path; TQString path;
QString desktopEntryPath; TQString desktopEntryPath;
QString cellText; TQString cellText;
QString subText; TQString subText;
QString menuId; TQString menuId;
bool ellipsis; bool ellipsis;
bool highLight; bool highLight;
bool displaySubText; bool displaySubText;
QPixmap actionPix; TQPixmap actionPix;
KIconLoader *iconLoader; KIconLoader *iconLoader;
void commonConstructor(); void commonConstructor();

@ -33,7 +33,7 @@
#include <kuser.h> #include <kuser.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <kdebug.h> #include <kdebug.h>
#include <qstyle.h> #include <tqstyle.h>
#include "tastymenu.h" #include "tastymenu.h"
@ -42,7 +42,7 @@
TastyMenu::TastyMenu(const QString& configFile, Type type, int actions, QWidget *parent, const char *name) TastyMenu::TastyMenu(const TQString& configFile, Type type, int actions, TQWidget *parent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name), numNewApplications(0) : KPanelApplet(configFile, type, actions, parent, name), numNewApplications(0)
{ {
@ -59,8 +59,8 @@ TastyMenu::TastyMenu(const QString& configFile, Type type, int actions, QWidget
menuHandler = new MenuHandler(this, prefSkel, "MenuHandler", menuHandler = new MenuHandler(this, prefSkel, "MenuHandler",
prefSkel->isNormalWindow() ? prefSkel->isNormalWindow() ?
Qt::WType_Dialog : TQt::WType_Dialog :
Qt::WType_Popup|Qt::WNoAutoErase); TQt::WType_Popup|TQt::WNoAutoErase);
connect (button, SIGNAL (pressed()), this, SLOT (clickSlot ())); connect (button, SIGNAL (pressed()), this, SLOT (clickSlot ()));
connect (menuHandler, SIGNAL(hidden()), this, SLOT(setButtonUp())); connect (menuHandler, SIGNAL(hidden()), this, SLOT(setButtonUp()));
@ -72,7 +72,7 @@ TastyMenu::TastyMenu(const QString& configFile, Type type, int actions, QWidget
button -> setUsesTextLabel(prefSkel->menuButtonLabelType() button -> setUsesTextLabel(prefSkel->menuButtonLabelType()
!= Prefs::EnumMenuButtonLabelType::MenuButtonNone); != Prefs::EnumMenuButtonLabelType::MenuButtonNone);
button -> setTextPosition(QToolButton::BesideIcon); button -> setTextPosition(TQToolButton::BesideIcon);
menuTip = new TastyToolTip(button); menuTip = new TastyToolTip(button);
_toolTipTitle = prefSkel->toolTipTitle(); _toolTipTitle = prefSkel->toolTipTitle();
@ -120,7 +120,7 @@ void TastyMenu::loadMenuButtonIcon()
if( prefSkel->menuButtonIconType() if( prefSkel->menuButtonIconType()
== Prefs::EnumMenuButtonIconType::IconNone ) == Prefs::EnumMenuButtonIconType::IconNone )
{ {
button->setIconSet(QIconSet()); button->setIconSet(TQIconSet());
return; return;
} }
@ -129,7 +129,7 @@ void TastyMenu::loadMenuButtonIcon()
else if(position() == pLeft || position() == pRight) else if(position() == pLeft || position() == pRight)
_iconsize = width(); _iconsize = width();
QPixmap btnPixmap(iconLoader->loadIcon(_menuButtonIcon, KIcon::Panel, _iconsize)); TQPixmap btnPixmap(iconLoader->loadIcon(_menuButtonIcon, KIcon::Panel, _iconsize));
if( !btnPixmap.isNull() ) if( !btnPixmap.isNull() )
button->setIconSet(btnPixmap); button->setIconSet(btnPixmap);
else else
@ -139,31 +139,31 @@ void TastyMenu::loadMenuButtonIcon()
} }
} }
QPoint TastyMenu::menupos(QWidget *widget) TQPoint TastyMenu::menupos(TQWidget *widget)
{ {
//now should look decent on all positions //now should look decent on all positions
switch( position() ) switch( position() )
{ {
case pLeft: case pLeft:
{ {
return QPoint( this->mapToGlobal( this->geometry().topRight() )); return TQPoint( this->mapToGlobal( this->geometry().topRight() ));
break; break;
} }
case pRight: case pRight:
{ {
QPoint buttonCoord = this->mapToGlobal(this->geometry().topLeft()); TQPoint buttonCoord = this->mapToGlobal(this->geometry().topLeft());
return QPoint( buttonCoord.x()-widget->width(), buttonCoord.y() ); return TQPoint( buttonCoord.x()-widget->width(), buttonCoord.y() );
break; break;
} }
case pTop: case pTop:
{ {
return QPoint( this->mapToGlobal( this->geometry().bottomLeft() )); return TQPoint( this->mapToGlobal( this->geometry().bottomLeft() ));
break; break;
} }
default: //pBottom or floating default: //pBottom or floating
{ {
QPoint buttonCoord = this->mapToGlobal(this->geometry().topLeft()); TQPoint buttonCoord = this->mapToGlobal(this->geometry().topLeft());
return QPoint( buttonCoord.x(), buttonCoord.y()-widget->height() ); return TQPoint( buttonCoord.x(), buttonCoord.y()-widget->height() );
break; break;
} }
} }
@ -175,7 +175,7 @@ void TastyMenu::clickSlot()
menuHandler->popup(menupos(menuHandler)); menuHandler->popup(menupos(menuHandler));
//QTimer::singleShot( 10000, this, SLOT(setButtonUp()) ); //TQTimer::singleShot( 10000, this, SLOT(setButtonUp()) );
} }
void TastyMenu::about() void TastyMenu::about()
@ -287,10 +287,10 @@ void TastyMenu::setGlobalAccel( bool global )
kickerConf = KGlobal::config(); kickerConf = KGlobal::config();
kickerConf->setGroup("Global Shortcuts"); kickerConf->setGroup("Global Shortcuts");
QString kmenuShortcut = kickerConf->readEntry("Popup Launch Menu", "default(Alt+F1)"); TQString kmenuShortcut = kickerConf->readEntry("Popup Launch Menu", "default(Alt+F1)");
if( kmenuShortcut=="none" ) if( kmenuShortcut=="none" )
return; return;
QString tastyMenuShortcut = kickerConf->readEntry("Toggle Tasty Menu", ""); TQString tastyMenuShortcut = kickerConf->readEntry("Toggle Tasty Menu", "");
KShortcut shortCutKey(tastyMenuShortcut); KShortcut shortCutKey(tastyMenuShortcut);
kickerConf->writeEntry("Popup Launch Menu", "none"); kickerConf->writeEntry("Popup Launch Menu", "none");
kickerConf->writeEntry("Toggle Tasty Menu", kmenuShortcut); kickerConf->writeEntry("Toggle Tasty Menu", kmenuShortcut);
@ -347,7 +347,7 @@ void TastyMenu::setNewApplicationsMessage( int number )
/*else if( number == 1) /*else if( number == 1)
menuTip ->setMessage(i18n("There is one new installed application")); menuTip ->setMessage(i18n("There is one new installed application"));
else else
menuTip ->setMessage(i18n("There are")+" " + QString().setNum(number) +" "+ i18n("new installed applications"));*/ menuTip ->setMessage(i18n("There are")+" " + TQString().setNum(number) +" "+ i18n("new installed applications"));*/
if( _showBigToolTip && number > numNewApplications ) if( _showBigToolTip && number > numNewApplications )
menuTip->notify( menupos( menuTip ) ); menuTip->notify( menupos( menuTip ) );
@ -361,7 +361,7 @@ int TastyMenu::widthForHeight(int height) const
int buttonWidth = width(); int buttonWidth = width();
if( position() == pTop || position() == pBottom ) if( position() == pTop || position() == pBottom )
{ {
button -> setTextPosition(QToolButton::BesideIcon); button -> setTextPosition(TQToolButton::BesideIcon);
if( prefSkel->menuButtonLabelType() if( prefSkel->menuButtonLabelType()
!= Prefs::EnumMenuButtonLabelType::MenuButtonNone ) != Prefs::EnumMenuButtonLabelType::MenuButtonNone )
return ((button->fontMetrics()).width(button->textLabel())) + _iconsize + 10; return ((button->fontMetrics()).width(button->textLabel())) + _iconsize + 10;
@ -380,7 +380,7 @@ int TastyMenu::heightForWidth(int width) const
if( prefSkel->menuButtonLabelType() if( prefSkel->menuButtonLabelType()
!= Prefs::EnumMenuButtonLabelType::MenuButtonNone ) != Prefs::EnumMenuButtonLabelType::MenuButtonNone )
{ {
button -> setTextPosition(QToolButton::BelowIcon); button -> setTextPosition(TQToolButton::BelowIcon);
return ((button->fontMetrics()).height()) + _iconsize + 10; return ((button->fontMetrics()).height()) + _iconsize + 10;
} }
else else
@ -390,7 +390,7 @@ int TastyMenu::heightForWidth(int width) const
return buttonHeight; return buttonHeight;
} }
void TastyMenu::resizeEvent(QResizeEvent *e) void TastyMenu::resizeEvent(TQResizeEvent *e)
{ {
int newHeight = e->size().height(); int newHeight = e->size().height();
button->setFixedHeight(newHeight); button->setFixedHeight(newHeight);
@ -405,7 +405,7 @@ void TastyMenu::resizeEvent(QResizeEvent *e)
loadMenuButtonIcon(); loadMenuButtonIcon();
} }
void TastyMenu::mousePressEvent(QMouseEvent *e) void TastyMenu::mousePressEvent(TQMouseEvent *e)
{ {
menuTip->hideTip(); menuTip->hideTip();
@ -463,7 +463,7 @@ void TastyMenu::mousePressEvent(QMouseEvent *e)
} }
} }
void TastyMenu::enterEvent( QEvent * e ) void TastyMenu::enterEvent( TQEvent * e )
{ {
e=e; e=e;
if( _showBigToolTip && !menuHandler->isVisible() ) if( _showBigToolTip && !menuHandler->isVisible() )
@ -472,7 +472,7 @@ void TastyMenu::enterEvent( QEvent * e )
KPanelApplet::enterEvent(e); KPanelApplet::enterEvent(e);
} }
void TastyMenu::leaveEvent( QEvent * e ) void TastyMenu::leaveEvent( TQEvent * e )
{ {
e=e; e=e;
menuTip->hideTip(); menuTip->hideTip();
@ -482,7 +482,7 @@ void TastyMenu::leaveEvent( QEvent * e )
extern "C" extern "C"
{ {
KPanelApplet* init( QWidget *parent, const QString& configFile) KPanelApplet* init( TQWidget *parent, const TQString& configFile)
{ {
KGlobal::locale()->insertCatalogue("tastymenu"); KGlobal::locale()->insertCatalogue("tastymenu");
return new TastyMenu(configFile, KPanelApplet::Normal, return new TastyMenu(configFile, KPanelApplet::Normal,

@ -29,12 +29,12 @@
#include <kpanelapplet.h> #include <kpanelapplet.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <qstring.h> #include <tqstring.h>
#include <kconfig.h> #include <kconfig.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <kconfigskeleton.h> #include <kconfigskeleton.h>
#include <kglobalaccel.h> #include <kglobalaccel.h>
#include <qpainter.h> #include <tqpainter.h>
#include "menuhandler.h" #include "menuhandler.h"
#include "prefs.h" #include "prefs.h"
@ -53,10 +53,10 @@ public:
* @param Type The applet @ref type(). * @param Type The applet @ref type().
* @param actions Standard RMB menu actions supported by the applet (see @ref action() ). * @param actions Standard RMB menu actions supported by the applet (see @ref action() ).
* @param parent The pointer to the parent widget handed over in the factory function. * @param parent The pointer to the parent widget handed over in the factory function.
* @param name A Qt object name for your applet. * @param name A TQt object name for your applet.
**/ **/
TastyMenu(const QString& configFile, Type t = Normal, int actions = 0, TastyMenu(const TQString& configFile, Type t = Normal, int actions = 0,
QWidget *parent = 0, const char *name = 0); TQWidget *parent = 0, const char *name = 0);
/** destructor */ /** destructor */
~TastyMenu(); ~TastyMenu();
@ -126,10 +126,10 @@ public:
virtual void preferences(); virtual void preferences();
protected: protected:
virtual void resizeEvent(QResizeEvent *); virtual void resizeEvent(TQResizeEvent *);
virtual void mousePressEvent(QMouseEvent *e); virtual void mousePressEvent(TQMouseEvent *e);
virtual void enterEvent( QEvent * e ); virtual void enterEvent( TQEvent * e );
virtual void leaveEvent( QEvent * e ); virtual void leaveEvent( TQEvent * e );
private: private:
KSharedConfig *kConfig; KSharedConfig *kConfig;
@ -138,15 +138,15 @@ private:
MenuHandler *menuHandler; MenuHandler *menuHandler;
TastyButton *button; TastyButton *button;
TastyToolTip *menuTip; TastyToolTip *menuTip;
QPoint menupos(QWidget *widget); TQPoint menupos(TQWidget *widget);
KGlobalAccel *globalAccel; KGlobalAccel *globalAccel;
KIconLoader *iconLoader; KIconLoader *iconLoader;
int numNewApplications; int numNewApplications;
QString _menuButtonLabel; TQString _menuButtonLabel;
QString _menuButtonIcon; TQString _menuButtonIcon;
QString _toolTipTitle; TQString _toolTipTitle;
bool _newAppsNotification; bool _newAppsNotification;
int _iconsize; int _iconsize;
bool _showBigToolTip; bool _showBigToolTip;

@ -19,28 +19,28 @@
***************************************************************************/ ***************************************************************************/
#include "tastytooltip.h" #include "tastytooltip.h"
#include <qlabel.h> #include <tqlabel.h>
#include <qtimer.h> #include <tqtimer.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kdebug.h> #include <kdebug.h>
#include <qbutton.h> #include <tqbutton.h>
TastyToolTip::TastyToolTip( QWidget * parent,const char * name, WFlags fl) TastyToolTip::TastyToolTip( TQWidget * parent,const char * name, WFlags fl)
: QWidget(parent, name, fl|WX11BypassWM ) : TQWidget(parent, name, fl|WX11BypassWM )
{ {
iconName = "kmenu"; iconName = "kmenu";
tastyToolTipLayout = new QVBoxLayout( this, 0, 0, "tastyToolTipLayout"); tastyToolTipLayout = new TQVBoxLayout( this, 0, 0, "tastyToolTipLayout");
toolTipWidget = new TastyToolTipWidget(this); toolTipWidget = new TastyToolTipWidget(this);
tastyToolTipLayout->addWidget(toolTipWidget); tastyToolTipLayout->addWidget(toolTipWidget);
} }
void TastyToolTip::loadIcon( QString icon ) void TastyToolTip::loadIcon( TQString icon )
{ {
iconName = icon; iconName = icon;
KIconLoader *iconLoader = KGlobal::iconLoader(); KIconLoader *iconLoader = KGlobal::iconLoader();
QPixmap btnPixmap(iconLoader->loadIcon(icon, KIcon::Panel, KIcon::SizeHuge)); TQPixmap btnPixmap(iconLoader->loadIcon(icon, KIcon::Panel, KIcon::SizeHuge));
if( !btnPixmap.isNull() ) if( !btnPixmap.isNull() )
toolTipWidget->iconPixmap->setPixmap(btnPixmap); toolTipWidget->iconPixmap->setPixmap(btnPixmap);
@ -56,32 +56,32 @@ TastyToolTip::~TastyToolTip()
} }
void TastyToolTip::showTip(const QPoint & point) void TastyToolTip::showTip(const TQPoint & point)
{ {
move(point); move(point);
QTimer::singleShot(250, this, SLOT(show())); TQTimer::singleShot(250, this, SLOT(show()));
} }
void TastyToolTip::show() void TastyToolTip::show()
{ {
QButton *button = dynamic_cast<QButton *>(parent()); TQButton *button = dynamic_cast<TQButton *>(parent());
if(button && button->hasMouse() && !button->isDown()) if(button && button->hasMouse() && !button->isDown())
QWidget::show(); TQWidget::show();
} }
void TastyToolTip::hideTip( ) void TastyToolTip::hideTip( )
{ {
QTimer::singleShot(250, this, SLOT(hide())); TQTimer::singleShot(250, this, SLOT(hide()));
} }
void TastyToolTip::notify(const QPoint & point ) void TastyToolTip::notify(const TQPoint & point )
{ {
move(point); move(point);
show(); show();
QTimer::singleShot(5000, this, SLOT(hide())); TQTimer::singleShot(5000, this, SLOT(hide()));
} }
void TastyToolTip::setMessage( QString message ) void TastyToolTip::setMessage( TQString message )
{ {
KIconLoader *iconLoader = KGlobal::iconLoader(); KIconLoader *iconLoader = KGlobal::iconLoader();
toolTipWidget->MessageLabel->setText(message); toolTipWidget->MessageLabel->setText(message);
@ -92,7 +92,7 @@ void TastyToolTip::setMessage( QString message )
loadIcon(iconName); loadIcon(iconName);
} }
void TastyToolTip::setTitle( QString title ) void TastyToolTip::setTitle( TQString title )
{ {
if( !title.isEmpty() ) if( !title.isEmpty() )
toolTipWidget->appNameLabel->setText( title ); toolTipWidget->appNameLabel->setText( title );

@ -20,36 +20,36 @@
#ifndef TASTYTOOLTIP_H #ifndef TASTYTOOLTIP_H
#define TASTYTOOLTIP_H #define TASTYTOOLTIP_H
#include <qwidget.h> #include <tqwidget.h>
#include <qlayout.h> #include <tqlayout.h>
#include "tastytooltipwidget.h" #include "tastytooltipwidget.h"
/** /**
@author Marco Martin <notmart@gmail.com> @author Marco Martin <notmart@gmail.com>
*/ */
class TastyToolTip : public QWidget class TastyToolTip : public TQWidget
{ {
public: public:
TastyToolTip( QWidget * parent=0,const char * name=0, WFlags fl=WType_TopLevel); TastyToolTip( TQWidget * parent=0,const char * name=0, WFlags fl=WType_TopLevel);
~TastyToolTip(); ~TastyToolTip();
void showTip(const QPoint & point); void showTip(const TQPoint & point);
void hideTip( ); void hideTip( );
void loadIcon( QString iconName ); void loadIcon( TQString iconName );
void notify(const QPoint & point ); void notify(const TQPoint & point );
void setMessage( QString message ); void setMessage( TQString message );
void setTitle( QString title ); void setTitle( TQString title );
protected: protected:
virtual void mousePressEvent( QMouseEvent * e ){e=e;hide();} virtual void mousePressEvent( TQMouseEvent * e ){e=e;hide();}
private: private:
QString iconName; TQString iconName;
TastyToolTipWidget * toolTipWidget; TastyToolTipWidget * toolTipWidget;
QVBoxLayout *tastyToolTipLayout; TQVBoxLayout *tastyToolTipLayout;
public slots: public slots:
virtual void show(); virtual void show();

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>TastyToolTipWidget</class> <class>TastyToolTipWidget</class>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>TastyToolTipWidget</cstring> <cstring>TastyToolTipWidget</cstring>
</property> </property>
@ -25,7 +25,7 @@
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QFrame"> <widget class="TQFrame">
<property name="name"> <property name="name">
<cstring>frame5</cstring> <cstring>frame5</cstring>
</property> </property>
@ -39,7 +39,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>iconPixmap</cstring> <cstring>iconPixmap</cstring>
</property> </property>
@ -61,7 +61,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout2</cstring> <cstring>layout2</cstring>
</property> </property>
@ -69,7 +69,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>appNameLabel</cstring> <cstring>appNameLabel</cstring>
</property> </property>
@ -83,7 +83,7 @@
<string>&lt;b&gt;Tasty Menu&lt;/b&gt;</string> <string>&lt;b&gt;Tasty Menu&lt;/b&gt;</string>
</property> </property>
</widget> </widget>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>DescLabel</cstring> <cstring>DescLabel</cstring>
</property> </property>
@ -91,7 +91,7 @@
<string>Applications, tasks and desktop sessions</string> <string>Applications, tasks and desktop sessions</string>
</property> </property>
</widget> </widget>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>MessageLabel</cstring> <cstring>MessageLabel</cstring>
</property> </property>

Loading…
Cancel
Save