Initial TQt conversion

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

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

@ -2,7 +2,7 @@
** ui.h extension file, included from the uic-generated form implementation.
**
** 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.
** 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);
}

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>Behaviour</class>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>Behaviour</cstring>
</property>
@ -19,7 +19,7 @@
<property name="name">
<cstring>unnamed</cstring>
</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">
<cstring>GeneralBehaviour</cstring>
</property>
@ -52,7 +52,7 @@
</size>
</property>
</spacer>
<widget class="QCheckBox" row="1" column="1">
<widget class="TQCheckBox" row="1" column="1">
<property name="name">
<cstring>kcfg_OverrideAltF1</cstring>
</property>
@ -83,7 +83,7 @@
</size>
</property>
</spacer>
<widget class="QCheckBox" row="2" column="1">
<widget class="TQCheckBox" row="2" column="1">
<property name="name">
<cstring>kcfg_ShowSaveSession</cstring>
</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>
</property>
</widget>
<widget class="QCheckBox" row="4" column="1">
<widget class="TQCheckBox" row="4" column="1">
<property name="name">
<cstring>kcfg_HideOneChild</cstring>
</property>
@ -112,7 +112,7 @@ It saves the current session informations like open applications and windows pos
<bool>true</bool>
</property>
</widget>
<widget class="QCheckBox" row="5" column="1">
<widget class="TQCheckBox" row="5" column="1">
<property name="name">
<cstring>kcfg_Alphabetical</cstring>
</property>
@ -123,7 +123,7 @@ It saves the current session informations like open applications and windows pos
<string>Alt+B</string>
</property>
</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">
<cstring>SearchFieldBehaviour</cstring>
</property>
@ -139,7 +139,7 @@ It saves the current session informations like open applications and windows pos
<set>AlignBottom</set>
</property>
</widget>
<widget class="QButtonGroup" row="7" column="1">
<widget class="TQButtonGroup" row="7" column="1">
<property name="name">
<cstring>buttonGroup1</cstring>
</property>
@ -156,7 +156,7 @@ It saves the current session informations like open applications and windows pos
<property name="margin">
<number>0</number>
</property>
<widget class="QRadioButton">
<widget class="TQRadioButton">
<property name="name">
<cstring>simpleSearch</cstring>
</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>
</property>
</widget>
<widget class="QRadioButton">
<widget class="TQRadioButton">
<property name="name">
<cstring>kcfg_KerryIntegration</cstring>
</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>
</property>
</widget>
<widget class="QRadioButton">
<widget class="TQRadioButton">
<property name="name">
<cstring>kcfg_StrigiIntegration</cstring>
</property>
@ -214,7 +214,7 @@ It needs the Strigi Daemon up and running</string>
</widget>
</vbox>
</widget>
<widget class="QCheckBox" row="3" column="1">
<widget class="TQCheckBox" row="3" column="1">
<property name="name">
<cstring>kcfg_NewAppsNotification</cstring>
</property>

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

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

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

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

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

@ -16,23 +16,23 @@
* Boston, MA 02111-1307, USA.
*/
#include <qcolor.h>
#include <tqcolor.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...
QRgb rgb = bgColor.rgb();
QRgb rgb_b = fgColor.rgb();
TQRgb rgb = bgColor.rgb();
TQRgb rgb_b = fgColor.rgb();
int alpha = a;
if(alpha>255) alpha = 255;
if(alpha<0) alpha = 0;
int inv_alpha = 255 - alpha;
QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255,
qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255,
qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) );
TQColor result = TQColor( tqRgb(tqRed(rgb_b)*inv_alpha/255 + tqRed(rgb)*alpha/255,
tqGreen(rgb_b)*inv_alpha/255 + tqGreen(rgb)*alpha/255,
tqBlue(rgb_b)*inv_alpha/255 + tqBlue(rgb)*alpha/255) );
return result;
}

@ -19,6 +19,6 @@
#ifndef __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

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

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

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

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

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

@ -29,12 +29,12 @@
#include <kpanelapplet.h>
#include <kiconloader.h>
#include <qstring.h>
#include <tqstring.h>
#include <kconfig.h>
#include <qpopupmenu.h>
#include <tqpopupmenu.h>
#include <kconfigskeleton.h>
#include <kglobalaccel.h>
#include <qpainter.h>
#include <tqpainter.h>
#include "menuhandler.h"
#include "prefs.h"
@ -53,10 +53,10 @@ public:
* @param Type The applet @ref type().
* @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 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,
QWidget *parent = 0, const char *name = 0);
TastyMenu(const TQString& configFile, Type t = Normal, int actions = 0,
TQWidget *parent = 0, const char *name = 0);
/** destructor */
~TastyMenu();
@ -126,10 +126,10 @@ public:
virtual void preferences();
protected:
virtual void resizeEvent(QResizeEvent *);
virtual void mousePressEvent(QMouseEvent *e);
virtual void enterEvent( QEvent * e );
virtual void leaveEvent( QEvent * e );
virtual void resizeEvent(TQResizeEvent *);
virtual void mousePressEvent(TQMouseEvent *e);
virtual void enterEvent( TQEvent * e );
virtual void leaveEvent( TQEvent * e );
private:
KSharedConfig *kConfig;
@ -138,15 +138,15 @@ private:
MenuHandler *menuHandler;
TastyButton *button;
TastyToolTip *menuTip;
QPoint menupos(QWidget *widget);
TQPoint menupos(TQWidget *widget);
KGlobalAccel *globalAccel;
KIconLoader *iconLoader;
int numNewApplications;
QString _menuButtonLabel;
QString _menuButtonIcon;
QString _toolTipTitle;
TQString _menuButtonLabel;
TQString _menuButtonIcon;
TQString _toolTipTitle;
bool _newAppsNotification;
int _iconsize;
bool _showBigToolTip;

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

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

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

Loading…
Cancel
Save