summaryrefslogtreecommitdiffstats
path: root/starter/menu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'starter/menu.cpp')
-rw-r--r--starter/menu.cpp720
1 files changed, 360 insertions, 360 deletions
diff --git a/starter/menu.cpp b/starter/menu.cpp
index 81611d0..5e33a71 100644
--- a/starter/menu.cpp
+++ b/starter/menu.cpp
@@ -1,14 +1,14 @@
-#include <qcheckbox.h>
-#include <qcursor.h>
-#include <qdatetime.h>
-#include <qdir.h>
+#include <tqcheckbox.h>
+#include <tqcursor.h>
+#include <tqdatetime.h>
+#include <tqdir.h>
#include <kpopupmenu.h>
-#include <qobjectlist.h>
-#include <qpainter.h>
-#include <qptrlist.h>
-#include <qstrlist.h>
-#include <qstringlist.h>
-#include <qvbox.h>
+#include <tqobjectlist.h>
+#include <tqpainter.h>
+#include <tqptrlist.h>
+#include <tqstrlist.h>
+#include <tqstringlist.h>
+#include <tqvbox.h>
#include <dcopclient.h>
#include <kapplication.h>
#include <kconfig.h>
@@ -61,15 +61,15 @@
//TODO: sort functions alphabetically, split files by classes... refactoring sucks ;)
-static QColor commentColor;
-static QColor infoColor;
+static TQColor commentColor;
+static TQColor infoColor;
static KConfig *config;
static bool useKTTS;
-QString spell(const QString text)
+TQString spell(const TQString text)
{
- QString result;
+ TQString result;
for (uint i = 0; i < text.length(); i++)
{
result += " "; result += text[i];
@@ -78,52 +78,52 @@ QString spell(const QString text)
}
/*
- Internal class to get access to protected QBoxLayout-members
+ Internal class to get access to protected TQBoxLayout-members
*/
-class MyVBoxLayout : public QVBoxLayout
+class MyVBoxLayout : public TQVBoxLayout
{
friend class AppList;
public:
- MyVBoxLayout( QLayout * parentLayout, int spacing = -1, const char * name = 0 )
- : QVBoxLayout( parentLayout, spacing, name ) {}
+ MyVBoxLayout( TQLayout * parentLayout, int spacing = -1, const char * name = 0 )
+ : TQVBoxLayout( parentLayout, spacing, name ) {}
};
-StartMenuButton::StartMenuButton( int size, QString icon, QString title, QString command, Orientation orientation, QWidget* parent, const char * name) : QWidget(parent, name), m_title(title), m_command(command), m_icon(icon), m_orientation(orientation), _moving(false)
+StartMenuButton::StartMenuButton( int size, TQString icon, TQString title, TQString command, Orientation orientation, TQWidget* parent, const char * name) : TQWidget(parent, name), m_title(title), m_command(command), m_icon(icon), m_orientation(orientation), _moving(false)
{
- setBackgroundOrigin(QWidget::ParentOrigin);
+ setBackgroundOrigin(TQWidget::ParentOrigin);
int bigSize = _BIGSIZE_(size);
m_pix = KGlobal::iconLoader()->loadIcon(icon, KIcon::Desktop, size);
m_hoverPix = KGlobal::iconLoader()->loadIcon(icon, KIcon::Desktop, bigSize);
- m_pixmapLabel = new QLabel(this, name);
+ m_pixmapLabel = new TQLabel(this, name);
m_pixmapLabel->setPixmap(m_pix);
- m_pixmapLabel->setBackgroundOrigin(QWidget::AncestorOrigin);
- QBoxLayout* layout;
+ m_pixmapLabel->setBackgroundOrigin(TQWidget::AncestorOrigin);
+ TQBoxLayout* layout;
if (orientation == Horizontal)
{
- m_titleLabel = new QLabel("<qt><b>" + title + "</b></qt>", this, name);
- m_titleLabel->setBackgroundOrigin(QWidget::AncestorOrigin);
- m_titleLabel->setTextFormat( Qt::RichText );
- m_titleLabel->setAlignment ( Qt::AlignLeft | Qt::AlignVCenter );
+ m_titleLabel = new TQLabel("<qt><b>" + title + "</b></qt>", this, name);
+ m_titleLabel->setBackgroundOrigin(TQWidget::AncestorOrigin);
+ m_titleLabel->setTextFormat( TQt::RichText );
+ m_titleLabel->setAlignment ( TQt::AlignLeft | TQt::AlignVCenter );
m_pixmapLabel->setFixedSize(bigSize+2,bigSize+2);
- m_pixmapLabel->setAlignment ( Qt::AlignCenter );
- layout = new QHBoxLayout ( this );
+ m_pixmapLabel->setAlignment ( TQt::AlignCenter );
+ layout = new TQHBoxLayout ( this );
layout->addSpacing ( 5 );
- layout->addWidget(m_pixmapLabel,0,Qt::AlignCenter);
+ layout->addWidget(m_pixmapLabel,0,TQt::AlignCenter);
layout->addSpacing ( 2 );
layout->addWidget(m_titleLabel,1);
layout->addSpacing ( 5 );
}
else if (orientation == Vertical)
{
- m_titleLabel = new QLabel("<qt><b>" + title + "</b></qt>", this, name);
- m_titleLabel->setBackgroundOrigin(QWidget::AncestorOrigin);
- m_titleLabel->setTextFormat( Qt::RichText );
- m_titleLabel->setAlignment ( Qt::AlignHCenter | Qt::AlignTop );
+ m_titleLabel = new TQLabel("<qt><b>" + title + "</b></qt>", this, name);
+ m_titleLabel->setBackgroundOrigin(TQWidget::AncestorOrigin);
+ m_titleLabel->setTextFormat( TQt::RichText );
+ m_titleLabel->setAlignment ( TQt::AlignHCenter | TQt::AlignTop );
m_pixmapLabel->setFixedSize(bigSize+2,bigSize+2);
- m_pixmapLabel->setAlignment ( Qt::AlignCenter );
- layout = new QVBoxLayout ( this );
+ m_pixmapLabel->setAlignment ( TQt::AlignCenter );
+ layout = new TQVBoxLayout ( this );
layout->addSpacing ( 5 );
- layout->addWidget(m_pixmapLabel,0,Qt::AlignCenter);
+ layout->addWidget(m_pixmapLabel,0,TQt::AlignCenter);
layout->addSpacing ( 2 );
layout->addWidget(m_titleLabel,1);
layout->addSpacing ( 5 );
@@ -131,10 +131,10 @@ StartMenuButton::StartMenuButton( int size, QString icon, QString title, QString
else
{
setFixedSize(bigSize+2,bigSize+2);
- m_pixmapLabel->setAlignment ( Qt::AlignCenter );
+ m_pixmapLabel->setAlignment ( TQt::AlignCenter );
m_pixmapLabel->setFixedSize(bigSize+2,bigSize+2);
}
- setCursor(Qt::PointingHandCursor);
+ setCursor(TQt::PointingHandCursor);
}
void StartMenuButton::reloadIcon(int size)
@@ -148,7 +148,7 @@ void StartMenuButton::reloadIcon(int size)
m_pixmapLabel->setPixmap(m_pix);
}
-void StartMenuButton::smartMove(QPoint &pt)
+void StartMenuButton::smartMove(TQPoint &pt)
{
}
@@ -157,16 +157,16 @@ void StartMenuButton::smartMove(int x, int y)
if (!dynamic_cast<Panel*>(parentWidget()))
return;
StartMenuButton *bt = 0L;
- QObjectList *kids = const_cast<QObjectList*>(parentWidget()->children());
- QRect dRect(QPoint(x,y), size());
- QRect bRect;
+ TQObjectList *kids = const_cast<TQObjectList*>(parentWidget()->children());
+ TQRect dRect(TQPoint(x,y), size());
+ TQRect bRect;
if (kids && !kids->isEmpty())
{
- QObject *o;
+ TQObject *o;
for ( o = kids->first(); o; o = kids->next() )
if ((o != this) && (bt = (dynamic_cast<StartMenuButton*>(o))))
{
- bRect = QRect(bt->pos(), bt->size());
+ bRect = TQRect(bt->pos(), bt->size());
if (dRect.intersects(bRect))
break;
bt = 0L;
@@ -176,7 +176,7 @@ void StartMenuButton::smartMove(int x, int y)
{
move(dRect.topLeft());
int dst;
- if (((Panel*)parentWidget())->orientation() == Qt::Horizontal)
+ if (((Panel*)parentWidget())->orientation() == TQt::Horizontal)
{
dst = pos().x() + width() - parentWidget()->width();
if (dst > 0)
@@ -205,21 +205,21 @@ void StartMenuButton::smartMove(int x, int y)
(dRect.y() < bRect.y() && dRect.bottom() > bRect.y() + bRect.height() / 2)
)
{
- QPoint bPt = bt->pos();
+ TQPoint bPt = bt->pos();
bt->move(pos());
move(bPt);
}
}
-void StartMenuButton::mouseReleaseEvent ( QMouseEvent * mre)
+void StartMenuButton::mouseReleaseEvent ( TQMouseEvent * mre)
{
- if (mre->state() & Qt::LeftButton)
+ if (mre->state() & TQt::LeftButton)
{
if (_moving) { _moving = false; return; }
emit pressed(m_command);
return;
}
- if (mre->state() & Qt::RightButton)
+ if (mre->state() & TQt::RightButton)
{
if (!dynamic_cast<Panel*>(parentWidget()))
return;
@@ -261,29 +261,29 @@ void Panel::addIcon()
addIcon ( linkConfigDialog->icon->icon(), linkConfigDialog->title->text(), linkConfigDialog->command->text(), iconAddPosition );
}
-void StartMenuButton::mouseMoveEvent ( QMouseEvent * mme )
+void StartMenuButton::mouseMoveEvent ( TQMouseEvent * mme )
{
if (!dynamic_cast<Panel*>(parentWidget()))
return;
- if (mme->state() & Qt::LeftButton)
+ if (mme->state() & TQt::LeftButton)
{
_moving = true;
- QPoint pt = mapToParent(mme->pos());
- if (!(mme->state() & Qt::ShiftButton))
+ TQPoint pt = mapToParent(mme->pos());
+ if (!(mme->state() & TQt::ShiftButton))
{
if (pt.y() < -5 || pt.y() > parentWidget()->height() + 5 || pt.x() < -5 || pt.x() > parentWidget()->width() + 5)
{
BaghiraLinkDrag *d = new BaghiraLinkDrag( m_title, m_command, m_icon, -1, parentWidget() );
- d->setPixmap(m_hoverPix, QPoint(m_hoverPix.width()/2, m_hoverPix.height()/2));
+ d->setPixmap(m_hoverPix, TQPoint(m_hoverPix.width()/2, m_hoverPix.height()/2));
d->drag();
- if ((mme->state() & Qt::ControlButton) || BaghiraLinkDrag::accepted())
+ if ((mme->state() & TQt::ControlButton) || BaghiraLinkDrag::accepted())
return;
((Panel*)parentWidget())->poof();
// do NOT delete d.
return;
}
}
- if (((Panel*)parentWidget())->orientation() == Qt::Horizontal)
+ if (((Panel*)parentWidget())->orientation() == TQt::Horizontal)
smartMove(pt.x() - width()/2, pos().y());
else
smartMove(pos().x(), pt.y() - height()/2);
@@ -293,32 +293,32 @@ void StartMenuButton::mouseMoveEvent ( QMouseEvent * mme )
}
-void StartMenuButton::enterEvent( QEvent * )
+void StartMenuButton::enterEvent( TQEvent * )
{
if (m_orientation == Status) emit hovered(m_title);
m_pixmapLabel->setPixmap(m_hoverPix);
}
-void StartMenuButton::leaveEvent( QEvent * )
+void StartMenuButton::leaveEvent( TQEvent * )
{
if (m_orientation == Status) emit unhovered();
m_pixmapLabel->setPixmap(m_pix);
}
-StartMenuEntry::StartMenuEntry(KService * service, QString relPath, int size, bool newbie, QWidget * parent) : QWidget(parent)
+StartMenuEntry::StartMenuEntry(KService * service, TQString relPath, int size, bool newbie, TQWidget * parent) : TQWidget(parent)
{
groupPath = relPath;
forNewbie = newbie;
if (config) // might be first use ever...
{
- QString tmpString = config->readEntry(service->desktopEntryName());
- if (tmpString != QString::null)
+ TQString tmpString = config->readEntry(service->desktopEntryName());
+ if (tmpString != TQString::null)
{
usage = tmpString.section ( ' ', 0, 0 ).toUInt();
- lastUse = QDate::fromString(tmpString.section ( ' ', 1, 1 ), Qt::ISODate);
+ lastUse = TQDate::fromString(tmpString.section ( ' ', 1, 1 ), TQt::ISODate);
// ranking is naiv but hopefully usefull for the beginning: often usage increases rank, time to the last usage decreases. "8" is just a "random" offset - the idea is that apps that have been used within the last week should have a higher rank than apps that don't appear in the list - setting these to - infinity isn't a good idea as well, as they might be brand new
- rank = 8 + usage - lastUse.daysTo(QDate::currentDate());
+ rank = 8 + usage - lastUse.daysTo(TQDate::currentDate());
}
else
{
@@ -328,7 +328,7 @@ StartMenuEntry::StartMenuEntry(KService * service, QString relPath, int size, bo
}
else
{
- qWarning("no valid config!");
+ tqWarning("no valid config!");
usage = 0;
rank = 0; // neutral rank
}
@@ -339,27 +339,27 @@ StartMenuEntry::StartMenuEntry(KService * service, QString relPath, int size, bo
display = false;
m_pix = m_service->pixmap( KIcon::Desktop, size );
m_hoverPix = m_service->pixmap( KIcon::Desktop, bigSize );
- m_titleLabel = new QLabel("<qt><h3>" + m_service->name() + "</h3></qt>", this);
- m_titleLabel->setTextFormat( Qt::RichText );
- m_commentLabel = new QLabel(m_service->comment(), this);
+ m_titleLabel = new TQLabel("<qt><h3>" + m_service->name() + "</h3></qt>", this);
+ m_titleLabel->setTextFormat( TQt::RichText );
+ m_commentLabel = new TQLabel(m_service->comment(), this);
m_commentLabel->setPaletteForegroundColor(commentColor);
- m_commentLabel->setTextFormat( Qt::RichText );
- m_pixmapLabel = new QLabel(this);
+ m_commentLabel->setTextFormat( TQt::RichText );
+ m_pixmapLabel = new TQLabel(this);
m_pixmapLabel->setFixedSize ( bigSize+2, bigSize+2 );
- m_pixmapLabel->setAlignment(Qt::AlignCenter);
+ m_pixmapLabel->setAlignment(TQt::AlignCenter);
m_pixmapLabel->setPixmap(m_pix);
- QVBoxLayout* spacer = new QVBoxLayout ( this );
+ TQVBoxLayout* spacer = new TQVBoxLayout ( this );
spacer->addSpacing ( 1 );
- QHBoxLayout* layout = new QHBoxLayout ( spacer );
+ TQHBoxLayout* layout = new TQHBoxLayout ( spacer );
layout->addWidget(m_pixmapLabel);
layout->addSpacing ( 2 );
- QVBoxLayout* textLayout = new QVBoxLayout ( layout );
+ TQVBoxLayout* textLayout = new TQVBoxLayout ( layout );
layout->setStretchFactor ( textLayout, 1 );
textLayout->addWidget(m_titleLabel);
textLayout->addWidget(m_commentLabel);
layout->addStretch();
spacer->addSpacing ( 1 );
- setCursor(Qt::PointingHandCursor);
+ setCursor(TQt::PointingHandCursor);
}
void StartMenuEntry::reloadIcon(int size)
@@ -379,7 +379,7 @@ StartMenuEntry::~StartMenuEntry()
void StartMenuEntry::saveStats()
{
if (usage > 0)
- config->writeEntry(m_service->desktopEntryName(), QString::number(usage) + " " + lastUse.toString(Qt::ISODate));
+ config->writeEntry(m_service->desktopEntryName(), TQString::number(usage) + " " + lastUse.toString(TQt::ISODate));
}
bool StartMenuEntry::operator==( const StartMenuEntry& se ) const
@@ -425,54 +425,54 @@ bool StartMenuEntry::operator>( const double& d ) const
return rank < d; // to have descending sort order (we could also use a negative ranking...)
}
-void StartMenuEntry::mouseReleaseEvent ( QMouseEvent * e )
+void StartMenuEntry::mouseReleaseEvent ( TQMouseEvent * e )
//TODO: do funny stuff with other buttons (e.g. provide edit dialog)
{
- if (e->button() == Qt::LeftButton)
+ if (e->button() == TQt::LeftButton)
{
m_pixmapLabel->setPixmap(m_pix);
execute();
- if (!(e->state() & Qt::ControlButton))
+ if (!(e->state() & TQt::ControlButton))
emit pressed();
}
- if (e->button() == Qt::RightButton)
+ if (e->button() == TQt::RightButton)
{
emit popup(this);
}
}
-void StartMenuEntry::mouseMoveEvent ( QMouseEvent * mme )
+void StartMenuEntry::mouseMoveEvent ( TQMouseEvent * mme )
{
- if (mme->state() & Qt::LeftButton && (mme->pos().y() < 0 || mme->pos().y() > height() || mme->pos().x() < 0 || mme->pos().x() > width()))
+ if (mme->state() & TQt::LeftButton && (mme->pos().y() < 0 || mme->pos().y() > height() || mme->pos().x() < 0 || mme->pos().x() > width()))
{
BaghiraLinkDrag *d = new BaghiraLinkDrag( m_service->name(), m_service->exec(), m_service->icon(), -1, parentWidget() );
- d->setPixmap(m_hoverPix, QPoint(m_hoverPix.width()/2, m_hoverPix.height()/2));
+ d->setPixmap(m_hoverPix, TQPoint(m_hoverPix.width()/2, m_hoverPix.height()/2));
d->dragCopy();
// do NOT delete d.
}
}
-void StartMenuEntry::keyPressEvent ( QKeyEvent * e )
+void StartMenuEntry::keyPressEvent ( TQKeyEvent * e )
{
switch (e->key())
{
- case Qt::Key_Escape:
+ case TQt::Key_Escape:
emit closeMenu();
break;
- case Qt::Key_Return:
- case Qt::Key_Enter:
+ case TQt::Key_Return:
+ case TQt::Key_Enter:
execute();
- if (!(e->state() & Qt::ControlButton))
+ if (!(e->state() & TQt::ControlButton))
emit pressed();
break;
- case Qt::Key_Down:
+ case TQt::Key_Down:
emit appDown();
break;
- case Qt::Key_Up:
+ case TQt::Key_Up:
emit appUp();
break;
- case Qt::Key_Home: // ->searchline + select
- case Qt::Key_Left:
+ case TQt::Key_Home: // ->searchline + select
+ case TQt::Key_Left:
emit appLeft();
break;
default:
@@ -480,18 +480,18 @@ void StartMenuEntry::keyPressEvent ( QKeyEvent * e )
}
}
-QString StartMenuEntry::title()
+TQString StartMenuEntry::title()
{
return m_titleLabel->text();
}
-void StartMenuEntry::focusInEvent ( QFocusEvent * )
+void StartMenuEntry::focusInEvent ( TQFocusEvent * )
{
isCurrent = true;
emit hovered("[ " + groupPath + " ] " + exec);
if (useKTTS)
{
- QString text = i18n("for TTS output, telling which item is focussed (keyboard) and than reads the comment", "%1 focussed. %2").arg(m_titleLabel->text()).arg(m_commentLabel->text());
+ TQString text = i18n("for TTS output, telling which item is focussed (keyboard) and than reads the comment", "%1 focussed. %2").arg(m_titleLabel->text()).arg(m_commentLabel->text());
emit sayText(text);
}
setPaletteBackgroundColor(KGlobalSettings::highlightColor());
@@ -500,7 +500,7 @@ void StartMenuEntry::focusInEvent ( QFocusEvent * )
m_commentLabel->setPaletteForegroundColor(KGlobalSettings::highlightedTextColor());
}
-void StartMenuEntry::focusOutEvent ( QFocusEvent * )
+void StartMenuEntry::focusOutEvent ( TQFocusEvent * )
{
emit unhovered();
isCurrent = false;
@@ -518,12 +518,12 @@ void StartMenuEntry::focusOutEvent ( QFocusEvent * )
}
}
-void StartMenuEntry::enterEvent( QEvent * )
+void StartMenuEntry::enterEvent( TQEvent * )
{
emit hovered("[ " + groupPath + " ] " + exec);
if (useKTTS)
{
- QString text = i18n("for TTS output, telling which item is hovered (mouse) and than reads the comment", "%1 hovered. %2").arg(m_titleLabel->text()).arg(m_commentLabel->text());
+ TQString text = i18n("for TTS output, telling which item is hovered (mouse) and than reads the comment", "%1 hovered. %2").arg(m_titleLabel->text()).arg(m_commentLabel->text());
emit sayText(text);
}
if (!isCurrent)
@@ -534,7 +534,7 @@ void StartMenuEntry::enterEvent( QEvent * )
m_pixmapLabel->setPixmap(m_hoverPix);
}
-void StartMenuEntry::leaveEvent( QEvent * )
+void StartMenuEntry::leaveEvent( TQEvent * )
{
emit unhovered();
if (!isCurrent)
@@ -548,33 +548,33 @@ void StartMenuEntry::leaveEvent( QEvent * )
void StartMenuEntry::execute()
{
usage++;
- lastUse = QDate::currentDate();
+ lastUse = TQDate::currentDate();
rank = 8 + usage;
- KApplication::startServiceByDesktopPath(m_service->desktopEntryPath(), QStringList(), 0, 0, 0, "", true);
+ KApplication::startServiceByDesktopPath(m_service->desktopEntryPath(), TQStringList(), 0, 0, 0, "", true);
emit executed();
}
-Panel::Panel(int size, QWidget * parent, const char * name) : QWidget(parent, name), _size(size), _draggedMe(false), _count(0), _orientation(Qt::Horizontal), _poof(0), _poofIndex(0), _poofAnimPix(0), _poofPix(0)
+Panel::Panel(int size, TQWidget * parent, const char * name) : TQWidget(parent, name), _size(size), _draggedMe(false), _count(0), _orientation(TQt::Horizontal), _poof(0), _poofIndex(0), _poofAnimPix(0), _poofPix(0)
{
linkConfigDialog = new LinkConfig();
- setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
// setPaletteBackgroundColor(KGlobalSettings::highlightColor());
setAcceptDrops(true);
config->setGroup("Panel");
- QStringList commands = config->readListEntry("Commands", '§');
- QStringList icons = config->readListEntry("Icons", '§');
- QStringList offsets = config->readListEntry("Offsets", '§');
- QStringList titles = config->readListEntry("Titles", '§');
- QStringList::Iterator it1 = commands.begin();
- QStringList::Iterator it2 = icons.begin();
- QStringList::Iterator it3 = offsets.begin();
- QStringList::Iterator it4 = titles.begin();
+ TQStringList commands = config->readListEntry("Commands", '§');
+ TQStringList icons = config->readListEntry("Icons", '§');
+ TQStringList offsets = config->readListEntry("Offsets", '§');
+ TQStringList titles = config->readListEntry("Titles", '§');
+ TQStringList::Iterator it1 = commands.begin();
+ TQStringList::Iterator it2 = icons.begin();
+ TQStringList::Iterator it3 = offsets.begin();
+ TQStringList::Iterator it4 = titles.begin();
while (it1 != commands.end() &&
it2 != icons.end() &&
it3 != offsets.end() &&
it4 != titles.end())
{
- addIcon(*it2, *it4, *it1, QPoint((*it3).toInt(),0));
+ addIcon(*it2, *it4, *it1, TQPoint((*it3).toInt(),0));
++it1;
++it2;
++it3;
@@ -585,24 +585,24 @@ Panel::Panel(int size, QWidget * parent, const char * name) : QWidget(parent, na
void Panel::save(KConfig *config)
{
config->setGroup("Panel");
- QObjectList *kids = const_cast<QObjectList*>(children());
+ TQObjectList *kids = const_cast<TQObjectList*>(children());
StartMenuButton *bt = 0;
if (kids && !kids->isEmpty())
{
- QStringList icons;
- QStringList titles;
- QStringList commands;
- QStringList offsets;
- QObject *o;
+ TQStringList icons;
+ TQStringList titles;
+ TQStringList commands;
+ TQStringList offsets;
+ TQObject *o;
for ( o = kids->first(); o; o = kids->next() )
if (bt = (dynamic_cast<StartMenuButton*>(o)))
{
icons.append(bt->icon());
titles.append(bt->title());
commands.append(bt->command());
- _orientation == Qt::Horizontal ?
- offsets.append(QString::number(bt->x())) :
- offsets.append(QString::number(bt->y()));
+ _orientation == TQt::Horizontal ?
+ offsets.append(TQString::number(bt->x())) :
+ offsets.append(TQString::number(bt->y()));
}
config->writeEntry("Commands", commands, '§');
config->writeEntry("Icons", icons, '§');
@@ -614,23 +614,23 @@ void Panel::save(KConfig *config)
void Panel::reloadIcons( int size)
{
_size = size;
- if (_orientation == Qt::Horizontal)
+ if (_orientation == TQt::Horizontal)
{
- setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
setFixedHeight(_BIGSIZE_(_size)+4);
setMaximumWidth(32767);
}
else
{
- setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
+ setSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding);
setFixedWidth(_BIGSIZE_(_size)+4);
setMaximumHeight(32767);
}
- QObjectList *kids = const_cast<QObjectList*>(children());
+ TQObjectList *kids = const_cast<TQObjectList*>(children());
StartMenuButton *bt = 0;
if (kids && !kids->isEmpty())
{
- QObject *o;
+ TQObject *o;
for ( o = kids->first(); o; o = kids->next() )
if (bt = (dynamic_cast<StartMenuButton*>(o)))
{
@@ -639,7 +639,7 @@ void Panel::reloadIcons( int size)
}
}
-void Panel::ensureVisible(QRect & rect)
+void Panel::ensureVisible(TQRect & rect)
{
int dx = 0; int dy = 0;
if (rect.width() > clipRegion().boundingRect().width())
@@ -661,7 +661,7 @@ void Panel::updateSize(int dst)
{
if (dst > 0)
{
- if (_orientation == Qt::Horizontal)
+ if (_orientation == TQt::Horizontal)
{
resize(width()+dst, height());
}
@@ -672,32 +672,32 @@ void Panel::updateSize(int dst)
}
else // more complex: resize and reposition all children, so first one is on (0,0)
{
- QObjectList *kids = const_cast<QObjectList*>(children());
+ TQObjectList *kids = const_cast<TQObjectList*>(children());
if (kids && !kids->isEmpty())
{
- QObject *o;
+ TQObject *o;
StartMenuButton *bt;
- if (_orientation == Qt::Horizontal)
+ if (_orientation == TQt::Horizontal)
{
resize(width()-dst, height());
for ( o = kids->first(); o; o = kids->next() )
if (bt = (dynamic_cast<StartMenuButton*>(o)))
- bt->move(QPoint(bt->x()-dst, bt->y()));
+ bt->move(TQPoint(bt->x()-dst, bt->y()));
}
else
{
resize(width(), height()-dst);
for ( o = kids->first(); o; o = kids->next() )
if (bt = (dynamic_cast<StartMenuButton*>(o)))
- bt->move(QPoint(bt->x(), bt->y()-dst));
+ bt->move(TQPoint(bt->x(), bt->y()-dst));
}
}
}
}
-void Panel::wheelEvent ( QWheelEvent * we )
+void Panel::wheelEvent ( TQWheelEvent * we )
{
- if (_orientation == Qt::Vertical)
+ if (_orientation == TQt::Vertical)
{
if (we->delta() > 0)
{
@@ -745,45 +745,45 @@ void Panel::wheelEvent ( QWheelEvent * we )
}
}
-void Panel::resizeEvent ( QResizeEvent * e)
+void Panel::resizeEvent ( TQResizeEvent * e)
{
- if (_orientation == Qt::Horizontal)
+ if (_orientation == TQt::Horizontal)
{
if (e->size().height() != e->oldSize().height())
{
int h = e->size().height();
- KPixmap bgPix = QPixmap(32, h);
- KPixmap bgPix1 = QPixmap(32, h/2);
- KPixmap bgPix2 = QPixmap(32, h - bgPix1.height());
- QColor color = palette().color(QPalette::Active, QColorGroup::Background);
+ KPixmap bgPix = TQPixmap(32, h);
+ KPixmap bgPix1 = TQPixmap(32, h/2);
+ KPixmap bgPix2 = TQPixmap(32, h - bgPix1.height());
+ TQColor color = palette().color(TQPalette::Active, TQColorGroup::Background);
KPixmapEffect::gradient( bgPix1, color.light(130), color.dark(105), KPixmapEffect::VerticalGradient, 0);
KPixmapEffect::gradient( bgPix2, color.dark(120), color.light(110), KPixmapEffect::VerticalGradient, 0);
- QPainter p(&bgPix);
+ TQPainter p(&bgPix);
p.drawPixmap(0,0,bgPix1);
p.drawPixmap(0,bgPix1.height(),bgPix2);
p.end();
setPaletteBackgroundPixmap( bgPix );
}
}
- else if (_orientation == Qt::Vertical)
+ else if (_orientation == TQt::Vertical)
{
if (e->size().width() != e->oldSize().width())
{
int w = e->size().width();
- KPixmap bgPix = QPixmap(w, 32);
- KPixmap bgPix1 = QPixmap(w/2, 32);
- KPixmap bgPix2 = QPixmap(w - bgPix1.width(), 32);
- QColor color = palette().color(QPalette::Active, QColorGroup::Background);
+ KPixmap bgPix = TQPixmap(w, 32);
+ KPixmap bgPix1 = TQPixmap(w/2, 32);
+ KPixmap bgPix2 = TQPixmap(w - bgPix1.width(), 32);
+ TQColor color = palette().color(TQPalette::Active, TQColorGroup::Background);
KPixmapEffect::gradient( bgPix1, color.light(110), color.dark(120), KPixmapEffect::HorizontalGradient, 0);
KPixmapEffect::gradient( bgPix2, color.dark(105), color.light(130), KPixmapEffect::HorizontalGradient, 0);
- QPainter p(&bgPix);
+ TQPainter p(&bgPix);
p.drawPixmap(0,0,bgPix1);
p.drawPixmap(bgPix1.width(),0,bgPix2);
p.end();
setPaletteBackgroundPixmap( bgPix );
}
}
- QWidget::resizeEvent( e );
+ TQWidget::resizeEvent( e );
}
void Panel::poof()
@@ -793,10 +793,10 @@ void Panel::poof()
_draggedMe = false;
return;
}*/
- QObjectList *kids = const_cast<QObjectList*>(children());
+ TQObjectList *kids = const_cast<TQObjectList*>(children());
if (kids && !kids->isEmpty())
{
- QObject *o;
+ TQObject *o;
StartMenuButton *bt = 0L;
for ( o = kids->first(); o; o = kids->next() )
{
@@ -808,20 +808,20 @@ void Panel::poof()
}
}
_poofIndex = 0;
- _poofPix = new QPixmap(locateLocal("data", "baghira/poof.png"), "png");
- _poofAnimPix = new QPixmap(_poofPix->width(), _poofPix->width());
+ _poofPix = new TQPixmap(locateLocal("data", "baghira/poof.png"), "png");
+ _poofAnimPix = new TQPixmap(_poofPix->width(), _poofPix->width());
if (!_poof)
- _poof = new QWidget(0,0, Qt::WType_TopLevel | Qt::WStyle_NoBorder | Qt::WStyle_StaysOnTop | Qt::WX11BypassWM);
+ _poof = new TQWidget(0,0, TQt::WType_TopLevel | TQt::WStyle_NoBorder | TQt::WStyle_StaysOnTop | TQt::WX11BypassWM);
#if KDE_IS_VERSION(3,3,91) //3.4 beta
KWin::setShadowSize(_poof->winId(), 0);
#endif
_poof->setFixedSize(_poofPix->width(), _poofPix->width());
- int x = QCursor::pos().x() - _poof->width()/2;
- int y = QCursor::pos().y() - _poof->height()/2;
- QPixmap bgPix = QPixmap::grabWindow( qt_xrootwin(), x, y, _poofPix->width(), _poofPix->width());
+ int x = TQCursor::pos().x() - _poof->width()/2;
+ int y = TQCursor::pos().y() - _poof->height()/2;
+ TQPixmap bgPix = TQPixmap::grabWindow( tqt_xrootwin(), x, y, _poofPix->width(), _poofPix->width());
_poof->move(x,y);
_poof->show();
- _poof->setBackgroundOrigin(QWidget::WidgetOrigin);
+ _poof->setBackgroundOrigin(TQWidget::WidgetOrigin);
_poof->setPaletteBackgroundPixmap( bgPix );
runPoof();
}
@@ -842,14 +842,14 @@ void Panel::runPoof()
return;
}
_poof->erase();
- bitBlt(_poof, 0 ,0, _poofPix, 0, _poofIndex * _poofPix->width(), _poofPix->width(), _poofPix->width(), Qt::AndROP);
+ bitBlt(_poof, 0 ,0, _poofPix, 0, _poofIndex * _poofPix->width(), _poofPix->width(), _poofPix->width(), TQt::AndROP);
++_poofIndex;
- QTimer::singleShot ( 70, this, SLOT(runPoof()) ); // around 15 fps
+ TQTimer::singleShot ( 70, this, SLOT(runPoof()) ); // around 15 fps
}
-void Panel::mouseReleaseEvent ( QMouseEvent * mre )
+void Panel::mouseReleaseEvent ( TQMouseEvent * mre )
{
- if (mre->state() & Qt::RightButton)
+ if (mre->state() & TQt::RightButton)
{
iconAddPosition = mre->pos();
linkConfigDialog->setCaption ( i18n("New Link") );
@@ -863,48 +863,48 @@ void Panel::mouseReleaseEvent ( QMouseEvent * mre )
}
}
-void Panel::dragEnterEvent ( QDragEnterEvent *dee )
+void Panel::dragEnterEvent ( TQDragEnterEvent *dee )
{
if (BaghiraLinkDrag::canDecode(dee))
{
- QObjectList *kids = const_cast<QObjectList*>(children());
+ TQObjectList *kids = const_cast<TQObjectList*>(children());
if (kids && !kids->isEmpty())
{
- QObject *o;
+ TQObject *o;
StartMenuButton *bt = 0L;
for ( o = kids->first(); o; o = kids->next() )
if ((bt = (dynamic_cast<StartMenuButton*>(o))) && bt->isMoving())
// this is just some icon the user drags around ad that accidently left the panel
{
BaghiraLinkDrag::setAccepted();
- // as we cannot access Qts dragmanager and qdragobject doesn't provide a function to cancel the drag, we just emit a virtual escape key...
+ // as we cannot access TQts dragmanager and qdragobject doesn't provide a function to cancel the drag, we just emit a virtual escape key...
_draggedMe = true; // ensure to please not poof ;P
- XTestFakeKeyEvent(qt_xdisplay(),XKeysymToKeycode(qt_xdisplay(), XK_Escape), true, 0);
- XTestFakeKeyEvent(qt_xdisplay(),XKeysymToKeycode(qt_xdisplay(), XK_Escape), false, 0);
- XFlush(qt_xdisplay());
+ XTestFakeKeyEvent(tqt_xdisplay(),XKeysymToKeycode(tqt_xdisplay(), XK_Escape), true, 0);
+ XTestFakeKeyEvent(tqt_xdisplay(),XKeysymToKeycode(tqt_xdisplay(), XK_Escape), false, 0);
+ XFlush(tqt_xdisplay());
repositionIcon(bt, mapFromGlobal(dee->pos()));
return;
}
}
dee->accept(TRUE);
}
- else if (QUriDrag::canDecode(dee) || QTextDrag::canDecode(dee))
+ else if (TQUriDrag::canDecode(dee) || TQTextDrag::canDecode(dee))
dee->accept(TRUE);
}
-void Panel::dropEvent ( QDropEvent *de )
+void Panel::dropEvent ( TQDropEvent *de )
{
- QStrList list;
- QString title;
- QString command;
- QString icon;
+ TQStrList list;
+ TQString title;
+ TQString command;
+ TQString icon;
int index;
if ( BaghiraLinkDrag::decode(de, &title, &command, &icon, &index) )
{
- addIcon ( icon, title, command, QPoint(de->pos().x() - (_BIGSIZE_(_size)/2), de->pos().y() - (_BIGSIZE_(_size)/2)));
+ addIcon ( icon, title, command, TQPoint(de->pos().x() - (_BIGSIZE_(_size)/2), de->pos().y() - (_BIGSIZE_(_size)/2)));
BaghiraLinkDrag::setAccepted();
}
- else if ( QUriDrag::decode(de, list) )
+ else if ( TQUriDrag::decode(de, list) )
{
char *uri;
KURL url;
@@ -912,7 +912,7 @@ void Panel::dropEvent ( QDropEvent *de )
{
url = KURL(uri);
if (url.protocol() == "http")
- addIcon ( "html", url.host()+(url.path()=="/"?QString(""):url.path()), uri, de->pos() );
+ addIcon ( "html", url.host()+(url.path()=="/"?TQString(""):url.path()), uri, de->pos() );
else
{
KFileItem item = KFileItem(KFileItem::Unknown, KFileItem::Unknown, url, true);
@@ -920,13 +920,13 @@ void Panel::dropEvent ( QDropEvent *de )
}
}
}
- else if (QTextDrag::decode(de, command))
+ else if (TQTextDrag::decode(de, command))
{
KURL url(command);
if (url.isValid())
{
if (url.protocol() == "http")
- addIcon ( "html", url.host()+(url.path()=="/"?QString(""):url.path()), command, de->pos() );
+ addIcon ( "html", url.host()+(url.path()=="/"?TQString(""):url.path()), command, de->pos() );
else
{
KFileItem item = KFileItem(KFileItem::Unknown, KFileItem::Unknown, url, true);
@@ -951,23 +951,23 @@ void Panel::dropEvent ( QDropEvent *de )
}
}
-void Panel::repositionIcon(StartMenuButton *button, QPoint pt)
+void Panel::repositionIcon(StartMenuButton *button, TQPoint pt)
{
- QObjectList *kids = const_cast<QObjectList*>(children());
+ TQObjectList *kids = const_cast<TQObjectList*>(children());
if (!kids || kids->isEmpty()) // the easy one ;)
return;
if (kids->count() == 1) // button's for certain the only child ;)
{
- if (_orientation == Qt::Horizontal)
+ if (_orientation == TQt::Horizontal)
button->move(pt.x(),0);
else
button->move(0,pt.y());
return;
}
- QObject *o;
+ TQObject *o;
StartMenuButton *bt = 0L;
int xy = 0;
- if (_orientation == Qt::Horizontal)
+ if (_orientation == TQt::Horizontal)
{
if (pt.x() < 0) // append horizontally
{
@@ -981,7 +981,7 @@ void Panel::repositionIcon(StartMenuButton *button, QPoint pt)
// first find possible icon under the position
for ( o = kids->first(); o; o = kids->next() )
{
- if ((bt = dynamic_cast<StartMenuButton*>(o)) && QRect(bt->pos(), bt->size()).contains(pt))
+ if ((bt = dynamic_cast<StartMenuButton*>(o)) && TQRect(bt->pos(), bt->size()).contains(pt))
break;
else
bt = 0l;
@@ -1021,7 +1021,7 @@ void Panel::repositionIcon(StartMenuButton *button, QPoint pt)
// first find possible icon under the position
for ( o = kids->first(); o; o = kids->next() )
{
- if ((bt = dynamic_cast<StartMenuButton*>(o)) && QRect(bt->pos(), bt->size()).contains(pt))
+ if ((bt = dynamic_cast<StartMenuButton*>(o)) && TQRect(bt->pos(), bt->size()).contains(pt))
break;
else
bt = 0l;
@@ -1043,17 +1043,17 @@ void Panel::repositionIcon(StartMenuButton *button, QPoint pt)
}
}
-StartMenuButton* Panel::addIcon ( QString icon, QString title, QString command, QPoint pt )
+StartMenuButton* Panel::addIcon ( TQString icon, TQString title, TQString command, TQPoint pt )
{
StartMenuButton *tmpButton = new StartMenuButton(_size, icon, title, command, StartMenuButton::Status, this);
// reposition icon
repositionIcon(tmpButton, pt);
// connections
- connect (tmpButton, SIGNAL(hovered(const QString &)), this, SIGNAL(message(const QString &)));
+ connect (tmpButton, SIGNAL(hovered(const TQString &)), this, SIGNAL(message(const TQString &)));
connect (tmpButton, SIGNAL(unhovered()), this, SIGNAL(clearStatus()));
connect (tmpButton, SIGNAL(updateSize(int)), this, SLOT(updateSize(int)));
- connect (tmpButton, SIGNAL(pressed(const QString &)), parent(), SLOT(execute(const QString &)));
- connect (tmpButton, SIGNAL(pressed(const QString &)), parent(), SLOT(close()));
+ connect (tmpButton, SIGNAL(pressed(const TQString &)), parent(), SLOT(execute(const TQString &)));
+ connect (tmpButton, SIGNAL(pressed(const TQString &)), parent(), SLOT(close()));
// done
// inc counter
_count++;
@@ -1066,37 +1066,37 @@ void Panel::setOrientation ( Orientation ori )
if (_orientation == ori)
return;
_orientation = ori;
- QObjectList *kids = const_cast<QObjectList*>(children());
+ TQObjectList *kids = const_cast<TQObjectList*>(children());
if (!kids || kids->isEmpty())
return;
- QObject *o;
+ TQObject *o;
StartMenuButton *bt = 0L;
for ( o = kids->first(); o; o = kids->next() )
if (bt = (dynamic_cast<StartMenuButton*>(o)))
- bt->move(QPoint(bt->pos().y(), bt->pos().x()));
+ bt->move(TQPoint(bt->pos().y(), bt->pos().x()));
}
-AppList::AppList(int size, QWidget * parent) : QScrollView(parent), _size(size)
+AppList::AppList(int size, TQWidget * parent) : TQScrollView(parent), _size(size)
{
popupBlocked_ = false;
enableClipper( true );
- setFrameStyle(QFrame::LineEditPanel | QFrame::Sunken );
+ setFrameStyle(TQFrame::LineEditPanel | TQFrame::Sunken );
configDialog_ = new ConfigDialog;
helpDialog_ = new HelpDialog;
- connect (((QObject*)configDialog_->buttonHelp), SIGNAL(clicked()), ((QObject*)helpDialog_), SLOT(exec()));
- connect (((QObject*)configDialog_->buttonCancel), SIGNAL(clicked()), this, SLOT(unblockPopup()));
- m_widget = new QFrame(viewport());
- m_widget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+ connect (((TQObject*)configDialog_->buttonHelp), SIGNAL(clicked()), ((TQObject*)helpDialog_), SLOT(exec()));
+ connect (((TQObject*)configDialog_->buttonCancel), SIGNAL(clicked()), this, SLOT(unblockPopup()));
+ m_widget = new TQFrame(viewport());
+ m_widget->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum);
m_widget->setPaletteBackgroundColor(KGlobalSettings::baseColor());
addChild(m_widget,0,0);
- setResizePolicy(QScrollView::AutoOneFit);
+ setResizePolicy(TQScrollView::AutoOneFit);
m_widget->show();
- infoLayout = new QVBoxLayout(m_widget);
- infoLabel = new QLabel(m_widget);
+ infoLayout = new TQVBoxLayout(m_widget);
+ infoLabel = new TQLabel(m_widget);
infoLabel->setPaletteBackgroundColor(infoColor);
- infoLabel->setTextFormat( Qt::RichText );
+ infoLabel->setTextFormat( TQt::RichText );
infoLayout->addWidget(infoLabel);
- m_VLayout = new QVBoxLayout(infoLayout);
+ m_VLayout = new TQVBoxLayout(infoLayout);
m_iconLoader = KGlobal::iconLoader();
m_popup = new KPopupMenu(this);
m_popup->insertItem(i18n("Edit Entry"), this, SLOT(editDialog()));
@@ -1106,9 +1106,9 @@ AppList::AppList(int size, QWidget * parent) : QScrollView(parent), _size(size)
init();
}
-void AppList::mouseReleaseEvent ( QMouseEvent * e )
+void AppList::mouseReleaseEvent ( TQMouseEvent * e )
{
- if (e->button() == Qt::RightButton)
+ if (e->button() == TQt::RightButton)
addDialog();
}
@@ -1116,13 +1116,13 @@ void AppList::windowActivationChange ( bool oldActive )
{
if (isActiveWindow() && entryList.current())
entryList.current()->setFocus();
- QScrollView::windowActivationChange ( oldActive );
+ TQScrollView::windowActivationChange ( oldActive );
}
void AppList::reloadIcons( int size)
{
_size = size;
- QPtrListIterator<StartMenuEntry> it(entryList);
+ TQPtrListIterator<StartMenuEntry> it(entryList);
StartMenuEntry *runner;
while( (runner = it.current()) != 0 )
{
@@ -1133,8 +1133,8 @@ void AppList::reloadIcons( int size)
void AppList::addDialog()
{
- disconnect (((QObject*)configDialog_->buttonOk), SIGNAL(clicked()), this, 0);
- connect (((QObject*)configDialog_->buttonOk), SIGNAL(clicked()), this, SLOT(addEntry()));
+ disconnect (((TQObject*)configDialog_->buttonOk), SIGNAL(clicked()), this, 0);
+ connect (((TQObject*)configDialog_->buttonOk), SIGNAL(clicked()), this, SLOT(addEntry()));
configDialog_->appName->clear();
configDialog_->category->clearEdit();
configDialog_->command->clear();
@@ -1152,7 +1152,7 @@ void AppList::addDialog()
configDialog_->shortcut->setShortcut(KShortcut::null(), false);
configDialog_->setCaption ( i18n("New Entry") );
- ((QWidget*)(configDialog_->extendedGroup))->hide();
+ ((TQWidget*)(configDialog_->extendedGroup))->hide();
configDialog_->buttonDetail->setDown ( false );
configDialog_->adjustSize();
configDialog_->show();
@@ -1160,16 +1160,16 @@ void AppList::addDialog()
void AppList::addEntry()
{
- QString fullpath = configDialog_->category->currentText();
+ TQString fullpath = configDialog_->category->currentText();
while (fullpath[0] == '/') // remove leading "/"'s
{
fullpath.remove(0,1);
}
fullpath = KService::newServicePath(true, fullpath + configDialog_->appName->text());
-//qWarning("%s",fullpath.ascii());
+//tqWarning("%s",fullpath.ascii());
writeEntry(fullpath);
KService *s = new KService(fullpath);
- QStringList list(KServiceGroup::group(configDialog_->category->currentText())->caption());
+ TQStringList list(KServiceGroup::group(configDialog_->category->currentText())->caption());
StartMenuEntry *sme = addApp(s, list, configDialog_->category->currentText());
sme->rank = 0xFFFFFF; // hype rank to max, i.e. keep this entry on top of everything - for this session or until first use
sme->show();
@@ -1181,7 +1181,7 @@ void AppList::removeEntry()
popupBlocked_ = true;
if (KMessageBox::questionYesNo (this, i18n("<qt>Are you sure you want to remove<br> %1</qt>").arg(handledEntry->title()), i18n("Remove ALI entry")) == KMessageBox::Yes)
{
- qWarning("gonna delete!");
+ tqWarning("gonna delete!");
writeEntry(handledEntry->m_service->locateLocal(), true);
handledEntry->hide();
entryList.removeRef(handledEntry);
@@ -1196,8 +1196,8 @@ void AppList::editDialog()
if (!handledEntry)
return;
popupBlocked_ = true;
- disconnect (((QObject*)configDialog_->buttonOk), SIGNAL(clicked()), this, 0);
- connect (((QObject*)configDialog_->buttonOk), SIGNAL(clicked()), this, SLOT(editEntry()));
+ disconnect (((TQObject*)configDialog_->buttonOk), SIGNAL(clicked()), this, 0);
+ connect (((TQObject*)configDialog_->buttonOk), SIGNAL(clicked()), this, SLOT(editEntry()));
configDialog_->appName->setText(handledEntry->m_service->name());
configDialog_->category->setCurrentItem (handledEntry->groupPath, false);
configDialog_->showInSystray->setChecked( handledEntry->m_service->exec().contains("ksystraycmd ") );
@@ -1218,7 +1218,7 @@ void AppList::editDialog()
// KKeyButton* shortcut;
configDialog_->setCaption ( i18n("Edit Entry") );
- ((QWidget*)(configDialog_->extendedGroup))->hide();
+ ((TQWidget*)(configDialog_->extendedGroup))->hide();
configDialog_->buttonDetail->setDown ( false );
configDialog_->adjustSize();
configDialog_->show();
@@ -1226,7 +1226,7 @@ void AppList::editDialog()
void AppList::editEntry()
{
- QString fullpath;
+ TQString fullpath;
if (handledEntry->groupPath == configDialog_->category->currentText()) // group not changed
fullpath = handledEntry->m_service->locateLocal(); // find a local replacement path
else // more complex: remove (del/shadow) entry from old group and create one in the new group
@@ -1239,17 +1239,17 @@ void AppList::editEntry()
}
writeEntry(fullpath);
handledEntry->hide();
- QDate lu = handledEntry->lastUse;
+ TQDate lu = handledEntry->lastUse;
uint u = handledEntry->usage;
entryList.removeRef(handledEntry);
delete handledEntry;
handledEntry = 0L;
KService *s = new KService(fullpath);
- QStringList list(KServiceGroup::group(configDialog_->category->currentText())->caption());
+ TQStringList list(KServiceGroup::group(configDialog_->category->currentText())->caption());
StartMenuEntry *sme = addApp(s, list, configDialog_->category->currentText());
sme->lastUse = lu;
sme->usage = u;
- sme->rank = 8 + u - lu.daysTo(QDate::currentDate());
+ sme->rank = 8 + u - lu.daysTo(TQDate::currentDate());
if (!config) config = new KConfig("bStarter", false, false);
config->setGroup("Statistics");
sme->saveStats();
@@ -1260,7 +1260,7 @@ void AppList::editEntry()
popupBlocked_ = false;
}
-void AppList::writeEntry(QString path, bool hidden )
+void AppList::writeEntry(TQString path, bool hidden )
{
KConfig *config = new KConfig(path);
config->setDesktopGroup();
@@ -1281,7 +1281,7 @@ void AppList::writeEntry(QString path, bool hidden )
if (!configDialog_->iconButton->icon().isNull())
config->writeEntry("Icon", configDialog_->iconButton->icon());
if (!configDialog_->keywords->text().isEmpty())
- config->writeEntry("Keywords", QStringList::split(',', configDialog_->keywords->text()));
+ config->writeEntry("Keywords", TQStringList::split(',', configDialog_->keywords->text()));
if (!configDialog_->appName->text().isEmpty())
config->writeEntry("Name", configDialog_->appName->text());
if (!configDialog_->workingDir->url().isEmpty())
@@ -1312,13 +1312,13 @@ void AppList::popup(StartMenuEntry* entry)
if (popupBlocked_ && configDialog_->isShown())
return;
handledEntry = entry;
- m_popup->popup(QCursor::pos());
+ m_popup->popup(TQCursor::pos());
}
void AppList::sort()
{
- // first clean the layout (i assume that QLayout::remove() will search from beginning so removing over the current order will be quite fast)
- QPtrListIterator<StartMenuEntry> it(entryList);
+ // first clean the layout (i assume that TQLayout::remove() will search from beginning so removing over the current order will be quite fast)
+ TQPtrListIterator<StartMenuEntry> it(entryList);
StartMenuEntry *runner;
while( (runner = it.current()) != 0 )
{
@@ -1340,11 +1340,11 @@ void AppList::sort()
void AppList::init()
{
- m_root = KServiceGroup::group(QString::null);
+ m_root = KServiceGroup::group(TQString::null);
if (!m_root || !m_root->isValid())
{
- qWarning("ROOT NOT FOUND");
+ tqWarning("ROOT NOT FOUND");
return;
}
favItemAmount = config->readNumEntry("FavItemAmount", 10);
@@ -1360,7 +1360,7 @@ void AppList::init()
infoLabel->setText ( i18n("<qt><b>Favorite Applications</b><br></qt>") );
}
config->setGroup("Statistics");
- QStringList captions, paths;
+ TQStringList captions, paths;
insertGroup(m_root, captions, paths);
paths.sort();
configDialog_->category->insertStringList(paths);
@@ -1374,7 +1374,7 @@ void AppList::init()
void AppList::save(KConfig *config)
{
config->setGroup("Statistics");
- QPtrListIterator<StartMenuEntry> it(entryList);
+ TQPtrListIterator<StartMenuEntry> it(entryList);
StartMenuEntry *runner;
while( (runner = it.current()) != 0 )
{
@@ -1383,7 +1383,7 @@ void AppList::save(KConfig *config)
}
}
-void AppList::insertGroup(KServiceGroup *g, QStringList & captions, QStringList & paths)
+void AppList::insertGroup(KServiceGroup *g, TQStringList & captions, TQStringList & paths)
{
KServiceGroup::List list = g->entries(true, true, false, false);
@@ -1423,14 +1423,14 @@ void AppList::insertGroup(KServiceGroup *g, QStringList & captions, QStringList
}
}
-StartMenuEntry* AppList::addApp(KService * s, QStringList & captions, QString relPath)
+StartMenuEntry* AppList::addApp(KService * s, TQStringList & captions, TQString relPath)
{
StartMenuEntry * tmp = new StartMenuEntry(s, relPath, _size, neewbieApps.find(s->desktopEntryName()) != neewbieApps.end(), m_widget);
connect (tmp, SIGNAL(appUp()), this, SLOT(appUp()));
connect (tmp, SIGNAL(appDown()), this, SLOT(appDown()));
connect (tmp, SIGNAL(appLeft()), this, SLOT(appLeft()));
- connect (tmp, SIGNAL(hovered(const QString&)), this, SIGNAL(message(const QString&)));
- if (useKTTS) connect (tmp, SIGNAL(sayText(const QString&)), this, SIGNAL(sayText(const QString&)));
+ connect (tmp, SIGNAL(hovered(const TQString&)), this, SIGNAL(message(const TQString&)));
+ if (useKTTS) connect (tmp, SIGNAL(sayText(const TQString&)), this, SIGNAL(sayText(const TQString&)));
connect (tmp, SIGNAL(unhovered()), this, SIGNAL(clearStatus()));
connect (tmp, SIGNAL(pressed()), parent(), SLOT(close()));
connect (tmp, SIGNAL(popup(StartMenuEntry*)), this, SLOT(popup(StartMenuEntry*)));
@@ -1445,12 +1445,12 @@ StartMenuEntry* AppList::addApp(KService * s, QStringList & captions, QString re
it = m_keywordList.insert(s->name(), StartMenuEntryList(), false);
it.data().append( tmp );
}
- QStringList kw;
+ TQStringList kw;
#if 0
kw = s->categories(); // THIS IS ****IMPORTANT***** kicker will crash on init if you try to grep through the pointers!
if (!kw.isEmpty())
{
- QStringList::Iterator key;
+ TQStringList::Iterator key;
for ( key = kw.begin(); key != kw.end(); ++key )
{
if (!((*key).isNull() || (*key).isEmpty()))
@@ -1464,7 +1464,7 @@ StartMenuEntry* AppList::addApp(KService * s, QStringList & captions, QString re
kw = s->keywords(); // THIS IS ****IMPORTANT***** kicker will crash on init if you try to grep through the pointers!
if (!kw.isEmpty())
{
- for ( QStringList::Iterator key = kw.begin(); key != kw.end(); ++key )
+ for ( TQStringList::Iterator key = kw.begin(); key != kw.end(); ++key )
{
if (!((*key).isNull() || (*key).isEmpty()))
{
@@ -1476,7 +1476,7 @@ StartMenuEntry* AppList::addApp(KService * s, QStringList & captions, QString re
// group captions (so Games/IDSoftware/Quake3 will appear in Games and IDSoftware)
if (!captions.isEmpty())
{
- for ( QStringList::Iterator key = captions.begin(); key != captions.end(); ++key )
+ for ( TQStringList::Iterator key = captions.begin(); key != captions.end(); ++key )
{
if (!((*key).isNull() || (*key).isEmpty()))
{
@@ -1513,7 +1513,7 @@ void AppList::appDown()
{
if (save) save->clearFocus();
runner->setFocus();
- QPoint pt(0,runner->height());
+ TQPoint pt(0,runner->height());
pt = runner->mapToParent(pt);
ensureVisible ( pt.x(), pt.y());
return;
@@ -1542,7 +1542,7 @@ void AppList::appUp()
{
if (save) save->clearFocus();
runner->setFocus();
- QPoint pt(0,0);
+ TQPoint pt(0,0);
pt = runner->mapToParent(pt);
ensureVisible ( pt.x(), pt.y());
return;
@@ -1553,7 +1553,7 @@ void AppList::appUp()
if (runner->isShown())
{
runner->setFocus();
- QPoint pt(0,0);
+ TQPoint pt(0,0);
pt = runner->mapToParent(pt);
ensureVisible ( pt.x(), pt.y());
}
@@ -1574,7 +1574,7 @@ void AppList::appLeft()
emit looseKey();
}
-void AppList::showCategory(const QString & string)
+void AppList::showCategory(const TQString & string)
{
infoLabel->setText(string);
infoLabel->show();
@@ -1607,15 +1607,15 @@ void AppList::showCategory(const QString & string)
}
if (useKTTS && visibleItems == 0)
{
- QString text = i18n("for TTS output, informs the user that no entries are in the currently selected group", "Warning! No Applications in group %1").arg(string);
+ TQString text = i18n("for TTS output, informs the user that no entries are in the currently selected group", "Warning! No Applications in group %1").arg(string);
emit sayText(text);
}
}
-void AppList::search(const QString & string)
+void AppList::search(const TQString & string)
{
StartMenuEntry *it2;
- if (string == QString::null || string == "") // empty line - remove all and exit
+ if (string == TQString::null || string == "") // empty line - remove all and exit
{
infoLabel->setText ( i18n("<qt><b>Favorite Applications</b><br></qt>") );
infoLabel->show();
@@ -1674,7 +1674,7 @@ void AppList::search(const QString & string)
}
if (useKTTS && visibleItems == 0)
{
- QString text = i18n("for TTS output, no entries match the current search text", "Warning! No more Applications left. The entered Text is %1").arg(spell(string));
+ TQString text = i18n("for TTS output, no entries match the current search text", "Warning! No more Applications left. The entered Text is %1").arg(spell(string));
emit sayText(text);
}
}
@@ -1710,10 +1710,10 @@ void AppList::reset()
setContentsPos(0, 0);
}
-StartMenu::StartMenu( int size, QWidget * parent, WFlags f ) : QWidget(parent, "StartMenu", f), _size(size), inMove(false)
+StartMenu::StartMenu( int size, TQWidget * parent, WFlags f ) : TQWidget(parent, "StartMenu", f), _size(size), inMove(false)
{
m_panelPos = StartMenu::Nowhere;
- panelLayout = new QGridLayout ( this, 3, 3 );
+ panelLayout = new TQGridLayout ( this, 3, 3 );
config = new KConfig("bStarter", true, false);
config->setGroup("Shell");
history = config->readListEntry("History");
@@ -1727,40 +1727,40 @@ StartMenu::StartMenu( int size, QWidget * parent, WFlags f ) : QWidget(parent, "
commentColor.setRgb((r+r2)/2,(g+g2)/2,(b+b2)/2);
infoColor.setRgb((3*r+r2)/4,(3*g+g2)/4,(3*b+b2)/4);
currentHistoryItem = history.end();
- header = new QWidget(this, "_B_ALI_HEADER");
+ header = new TQWidget(this, "_B_ALI_HEADER");
header->installEventFilter(this);
- QHBoxLayout *headerLayout = new QHBoxLayout(header, 5, 3);
- userButton = new StartMenuButton(_size, "folder_home", QString(getenv("USER")), "~", StartMenuButton::Status, header, "_B_ALI_HEADER");
+ TQHBoxLayout *headerLayout = new TQHBoxLayout(header, 5, 3);
+ userButton = new StartMenuButton(_size, "folder_home", TQString(getenv("USER")), "~", StartMenuButton::Status, header, "_B_ALI_HEADER");
headerLayout->addWidget(userButton);
header->setPaletteBackgroundColor(KGlobalSettings::highlightColor());
- connect (userButton, SIGNAL(pressed(const QString &)), this, SLOT(execute(const QString &)));
- connect (userButton, SIGNAL(pressed(const QString &)), this, SLOT(close()));
- QBoxLayout *mainLayout = new QVBoxLayout();
+ connect (userButton, SIGNAL(pressed(const TQString &)), this, SLOT(execute(const TQString &)));
+ connect (userButton, SIGNAL(pressed(const TQString &)), this, SLOT(close()));
+ TQBoxLayout *mainLayout = new TQVBoxLayout();
panelLayout->addLayout(mainLayout, 1, 1);
mainLayout->addWidget(header);
mainLayout->addSpacing ( 3 );
- QBoxLayout *centerLayout = new QHBoxLayout( mainLayout );
+ TQBoxLayout *centerLayout = new TQHBoxLayout( mainLayout );
centerLayout->addSpacing ( 3 );
appList = new AppList(_size, this);
- appList->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
+ appList->setSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Expanding);
appList->finish();
searchLine = new SearchLine(header);
- categoryCombo = new QComboBox(header, "_B_ALI_HEADER");
+ categoryCombo = new TQComboBox(header, "_B_ALI_HEADER");
headerLayout->addWidget(categoryCombo);
categoryCombo->setLineEdit ( searchLine );
categoryCombo->insertStringList(appList->categories);
categoryCombo->setEditable ( true );
- categoryCombo->setInsertionPolicy(QComboBox::NoInsertion);
+ categoryCombo->setInsertionPolicy(TQComboBox::NoInsertion);
searchLine->installEventFilter(this);
searchLine->setCompletionMode(KGlobalSettings::CompletionAuto);
config->setGroup("Shortcuts");
// read shortcuts...
- QStringList cuts = config->readListEntry ("Shortcuts", ',');
- QStringList cats = config->readListEntry ("Categories", ',');
- QStringList::Iterator it;
- QStringList::Iterator it2 = cats.begin();
+ TQStringList cuts = config->readListEntry ("Shortcuts", ',');
+ TQStringList cats = config->readListEntry ("Categories", ',');
+ TQStringList::Iterator it;
+ TQStringList::Iterator it2 = cats.begin();
for ( it = cuts.begin(); it != cuts.end(); ++it )
{
if (it2 == cats.end()) break;
@@ -1768,23 +1768,23 @@ StartMenu::StartMenu( int size, QWidget * parent, WFlags f ) : QWidget(parent, "
it2++;
}
//---
- QString PATH(getenv("PATH"));
+ TQString PATH(getenv("PATH"));
int n = PATH.contains(':', false);
- QStringList list;
+ TQStringList list;
for (int i = 0; i < n; i++)
{
- QDir execDir(PATH.section(':', i, i));
- list = execDir.entryList(QDir::Files | QDir::Executable, QDir::Name | QDir::IgnoreCase );
+ TQDir execDir(PATH.section(':', i, i));
+ list = execDir.entryList(TQDir::Files | TQDir::Executable, TQDir::Name | TQDir::IgnoreCase );
searchLine->completionObject()->insertItems(list);
}
- connect (categoryCombo, SIGNAL(activated( const QString &)), appList, SLOT(showCategory(const QString &)));
- connect (searchLine, SIGNAL(typedTextChanged(const QString &)), appList, SLOT(search(const QString &)));
- connect (searchLine, SIGNAL(textChanged(const QString &)), this, SLOT(endHistory()));
+ connect (categoryCombo, SIGNAL(activated( const TQString &)), appList, SLOT(showCategory(const TQString &)));
+ connect (searchLine, SIGNAL(typedTextChanged(const TQString &)), appList, SLOT(search(const TQString &)));
+ connect (searchLine, SIGNAL(textChanged(const TQString &)), this, SLOT(endHistory()));
connect (appList, SIGNAL(looseKey()), searchLine, SLOT(setFocus()));
connect (appList, SIGNAL(looseKey()), searchLine, SLOT(selectAll() ));
connect (kapp, SIGNAL(shutDown()), this, SLOT(save() ));
- if (useKTTS) connect (appList, SIGNAL(sayText(const QString&)), this, SLOT(sayText(const QString&) ));
+ if (useKTTS) connect (appList, SIGNAL(sayText(const TQString&)), this, SLOT(sayText(const TQString&) ));
centerLayout->addWidget(appList,10);
centerLayout->addSpacing ( 3 );
@@ -1794,12 +1794,12 @@ StartMenu::StartMenu( int size, QWidget * parent, WFlags f ) : QWidget(parent, "
m_panel->setFixedHeight(_BIGSIZE_(_size)+4);
statusBar = new KSqueezedTextLabel(this);
- QFont tmpFnt = statusBar->font();
+ TQFont tmpFnt = statusBar->font();
tmpFnt.setBold(true);
statusBar->setFont(tmpFnt);
- connect (appList, SIGNAL(message(const QString&)), this, SLOT(message(const QString&) ));
+ connect (appList, SIGNAL(message(const TQString&)), this, SLOT(message(const TQString&) ));
connect (appList, SIGNAL(clearStatus()), this, SLOT(clearStatus() ));
- connect (m_panel, SIGNAL(message(const QString&)), this, SLOT(centerMessage(const QString&) ));
+ connect (m_panel, SIGNAL(message(const TQString&)), this, SLOT(centerMessage(const TQString&) ));
connect (m_panel, SIGNAL(clearStatus()), this, SLOT(clearStatus() ));
mainLayout->addSpacing ( 3 );
@@ -1815,8 +1815,8 @@ void StartMenu::save()
{
config = new KConfig("bStarter", false, false);
config->setGroup("Shell");
- QStringList lst;
- for ( QStringList::Iterator it = history.begin(); it != history.end(); ++it )
+ TQStringList lst;
+ for ( TQStringList::Iterator it = history.begin(); it != history.end(); ++it )
lst.prepend(*it);
config->writeEntry("History", lst);
config->setGroup("Settings");
@@ -1830,7 +1830,7 @@ extern int kicker_screen_number;
void StartMenu::slotLock()
{
- QCString appname( "kdesktop" );
+ TQCString appname( "kdesktop" );
// if ( kicker_screen_number )
// appname.sprintf("kdesktop-screen-%d", kicker_screen_number);
kapp->dcopClient()->send(appname, "KScreensaverIface", "lock()", "");
@@ -1844,9 +1844,9 @@ void StartMenu::reloadIcons( int size)
appList->reloadIcons(size);
}
-void StartMenu::setCategory(const QString & category)
+void StartMenu::setCategory(const TQString & category)
{
- categoryCombo->setCurrentItem ( categoryCombo->listBox()->index(categoryCombo->listBox()->findItem(category, Qt::ExactMatch)));
+ categoryCombo->setCurrentItem ( categoryCombo->listBox()->index(categoryCombo->listBox()->findItem(category, TQt::ExactMatch)));
//emit categoryCombo->activated ( category ); // dunno if i'll need that once, needs protected access
appList->showCategory(category);
}
@@ -1862,31 +1862,31 @@ void StartMenu::toggleKTTS(bool on)
if (useKTTS)
{
m_spokenText = 0;
- QPtrListIterator<StartMenuEntry> it(appList->entryList);
+ TQPtrListIterator<StartMenuEntry> it(appList->entryList);
StartMenuEntry *runner;
while( (runner = it.current()) != 0 )
{
++it;
- connect (runner, SIGNAL(sayText(const QString&)), this, SIGNAL(sayText(const QString&)));
+ connect (runner, SIGNAL(sayText(const TQString&)), this, SIGNAL(sayText(const TQString&)));
}
- connect (appList, SIGNAL(sayText(const QString&)), this, SLOT(sayText(const QString&) ));
+ connect (appList, SIGNAL(sayText(const TQString&)), this, SLOT(sayText(const TQString&) ));
}
else
{
- QPtrListIterator<StartMenuEntry> it(appList->entryList);
+ TQPtrListIterator<StartMenuEntry> it(appList->entryList);
StartMenuEntry *runner;
while( (runner = it.current()) != 0 )
{
++it;
- disconnect (runner, SIGNAL(sayText(const QString&)), this, SIGNAL(sayText(const QString&)));
+ disconnect (runner, SIGNAL(sayText(const TQString&)), this, SIGNAL(sayText(const TQString&)));
}
- disconnect (appList, SIGNAL(sayText(const QString&)), this, SLOT(sayText(const QString&) ));
+ disconnect (appList, SIGNAL(sayText(const TQString&)), this, SLOT(sayText(const TQString&) ));
}
}
-SearchLine::SearchLine( QWidget * parent ) : KLineEdit(parent){blocked = false;};
+SearchLine::SearchLine( TQWidget * parent ) : KLineEdit(parent){blocked = false;};
-void SearchLine::makeCompletion (const QString & string)
+void SearchLine::makeCompletion (const TQString & string)
{
if (blocked) {blocked = false; return;}
emit typedTextChanged(string);
@@ -1898,10 +1898,10 @@ StartMenu::~StartMenu()
// appList->save();
}
-void StartMenu::sayText(const QString &text)
+void StartMenu::sayText(const TQString &text)
{
// strip tags
- QString cleanText;
+ TQString cleanText;
bool copy = true;
for (uint i = 0; i < text.length(); i++)
{
@@ -1919,37 +1919,37 @@ void StartMenu::sayText(const QString &text)
cleanText += text[i];
}
// done
- QByteArray data1;
- QDataStream arg1(data1, IO_WriteOnly);
+ TQByteArray data1;
+ TQDataStream arg1(data1, IO_WriteOnly);
arg1 << m_spokenText; // stop what we messaged before (if)
if (!kapp->dcopClient()->send("kttsd", "kspeech", "stopText(uint)", data1))
- qDebug("there was some error using DCOP.");
+ tqDebug("there was some error using DCOP.");
- QByteArray data, replyData;
- QCString replyType;
- QDataStream arg(data, IO_WriteOnly);
+ TQByteArray data, replyData;
+ TQCString replyType;
+ TQDataStream arg(data, IO_WriteOnly);
arg << cleanText << ""; // ask for the full list
- if (!kapp->dcopClient()->call("kttsd", "kspeech", "sayText(QString, QString)", data, replyType, replyData))
- qDebug("there was some error using DCOP.");
+ if (!kapp->dcopClient()->call("kttsd", "kspeech", "sayText(TQString, TQString)", data, replyType, replyData))
+ tqDebug("there was some error using DCOP.");
else
{
- QDataStream reply(replyData, IO_ReadOnly);
+ TQDataStream reply(replyData, IO_ReadOnly);
if (replyType == "uint")
reply >> m_spokenText;
else
- qWarning("properties() returned an unexpected type of reply (%s)!",QString(replyType).ascii());
+ tqWarning("properties() returned an unexpected type of reply (%s)!",TQString(replyType).ascii());
}
}
void StartMenu::show()
{
- m_panel->setBackgroundOrigin(QWidget::WidgetOrigin);
- statusBar->setBackgroundOrigin(QWidget::ParentOrigin);
+ m_panel->setBackgroundOrigin(TQWidget::WidgetOrigin);
+ statusBar->setBackgroundOrigin(TQWidget::ParentOrigin);
searchLine->setText(i18n("Type to search or enter a command"));
searchLine->selectAll();
searchLine->setFocus();
// KWin::setOpacity(winId(), 80);
- QWidget::show();
+ TQWidget::show();
}
void StartMenu::hide()
@@ -1957,18 +1957,18 @@ void StartMenu::hide()
emit aboutToHide();
searchLine->clear();
appList->reset();
- QWidget::hide();
+ TQWidget::hide();
}
-void StartMenu::message(const QString &text)
+void StartMenu::message(const TQString &text)
{
- statusBar->setAlignment ( Qt::AlignAuto | Qt::AlignVCenter );
+ statusBar->setAlignment ( TQt::AlignAuto | TQt::AlignVCenter );
statusBar->setText(text);
}
-void StartMenu::centerMessage(const QString &text)
+void StartMenu::centerMessage(const TQString &text)
{
- statusBar->setAlignment ( Qt::AlignCenter );
+ statusBar->setAlignment ( TQt::AlignCenter );
statusBar->setText(text);
}
@@ -1988,9 +1988,9 @@ void StartMenu::setPanelPosition(PanelPosition p)
m_panel->show();
if (m_panelPos == StartMenu::Nowhere || m_panelPos == StartMenu::West || m_panelPos == StartMenu::East )
{
-// m_panel->set2SizePolicies(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
- m_panel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- m_panel->setOrientation ( Qt::Horizontal );
+// m_panel->set2SizePolicies(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed);
+ m_panel->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
+ m_panel->setOrientation ( TQt::Horizontal );
m_panel->setFixedHeight(_BIGSIZE_(_size)+4);
m_panel->setMaximumWidth(32767);
}
@@ -2000,9 +2000,9 @@ void StartMenu::setPanelPosition(PanelPosition p)
m_panel->show();
if (m_panelPos == StartMenu::Nowhere || m_panelPos == StartMenu::South || m_panelPos == StartMenu::North )
{
-// m_panel->set2SizePolicies(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
- m_panel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
- m_panel->setOrientation ( Qt::Vertical );
+// m_panel->set2SizePolicies(TQSizePolicy::Fixed, TQSizePolicy::MinimumExpanding);
+ m_panel->setSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding);
+ m_panel->setOrientation ( TQt::Vertical );
m_panel->setFixedWidth(_BIGSIZE_(_size)+4);
m_panel->setMaximumHeight(32767);
}
@@ -2012,9 +2012,9 @@ void StartMenu::setPanelPosition(PanelPosition p)
m_panel->show();
if (m_panelPos == StartMenu::Nowhere || m_panelPos == StartMenu::South || m_panelPos == StartMenu::North )
{
-// m_panel->set2SizePolicies(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
- m_panel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
- m_panel->setOrientation ( Qt::Vertical );
+// m_panel->set2SizePolicies(TQSizePolicy::Fixed, TQSizePolicy::MinimumExpanding);
+ m_panel->setSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Expanding);
+ m_panel->setOrientation ( TQt::Vertical );
m_panel->setFixedWidth(_BIGSIZE_(_size)+4);
m_panel->setMaximumHeight(32767);
}
@@ -2024,9 +2024,9 @@ void StartMenu::setPanelPosition(PanelPosition p)
m_panel->show();
if (m_panelPos == StartMenu::Nowhere || m_panelPos == StartMenu::West || m_panelPos == StartMenu::East )
{
-// m_panel->set2SizePolicies(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
- m_panel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- m_panel->setOrientation ( Qt::Horizontal );
+// m_panel->set2SizePolicies(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed);
+ m_panel->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
+ m_panel->setOrientation ( TQt::Horizontal );
m_panel->setFixedHeight(_BIGSIZE_(_size)+4);
m_panel->setMaximumWidth(32767);
}
@@ -2039,21 +2039,21 @@ void StartMenu::setPanelPosition(PanelPosition p)
m_panelPos = p;
}
-void StartMenu::execute(const QString& command)
+void StartMenu::execute(const TQString& command)
// adapted from kicker run applet - far more convenient ;)
{
history.remove(command);
history.append(command); // all - the list is not stored and the user may want to easily correct mistypes of LOOOOOOOOOOOOOOOOOOOONG commands with a lot of "\ "... ;P
- QString exec;
+ TQString exec;
kapp->propagateSessionManager();
_filterData->setData( command.stripWhiteSpace() );
- QStringList filters;
+ TQStringList filters;
filters << "kurisearchfilter" << "kshorturifilter";
KURIFilter::self()->filterURI( *(_filterData), filters );
- QString cmd = (_filterData->uri().isLocalFile() ? _filterData->uri().path():_filterData->uri().url());
+ TQString cmd = (_filterData->uri().isLocalFile() ? _filterData->uri().path():_filterData->uri().url());
// Nothing interesting. Quit!
if ( cmd.isEmpty() )
@@ -2101,63 +2101,63 @@ void StartMenu::endHistory()
currentHistoryItem = history.end();
}
-void StartMenu::search(const QString & string)
+void StartMenu::search(const TQString & string)
{
- disconnect (searchLine, SIGNAL(textChanged ( const QString & )), this, SLOT(search(const QString &)));
+ disconnect (searchLine, SIGNAL(textChanged ( const TQString & )), this, SLOT(search(const TQString &)));
appList->search(string);
}
-bool StartMenu::eventFilter ( QObject * o, QEvent * e )
+bool StartMenu::eventFilter ( TQObject * o, TQEvent * e )
{
if (o == header)
{
- if (e->type() == QEvent::MouseButtonPress && ((QMouseEvent*)e)->button() == Qt::LeftButton)
+ if (e->type() == TQEvent::MouseButtonPress && ((TQMouseEvent*)e)->button() == TQt::LeftButton)
{
inMove = true;
- movePoint = ((QMouseEvent*)e)->pos();
- header->grabMouse(Qt::SizeAllCursor);
+ movePoint = ((TQMouseEvent*)e)->pos();
+ header->grabMouse(TQt::SizeAllCursor);
return true;
}
- else if (e->type() == QEvent::MouseButtonRelease && ((QMouseEvent*)e)->button() == Qt::LeftButton)
+ else if (e->type() == TQEvent::MouseButtonRelease && ((TQMouseEvent*)e)->button() == TQt::LeftButton)
{
inMove = false;
header->releaseMouse();
return true;
}
- else if (e->type() == QEvent::MouseMove && inMove)
+ else if (e->type() == TQEvent::MouseMove && inMove)
{
- move(((QMouseEvent*)e)->globalPos() - movePoint);
+ move(((TQMouseEvent*)e)->globalPos() - movePoint);
return true;
}
- else if (e->type() == QEvent::Resize && ((QResizeEvent*)e)->size().height() != ((QResizeEvent*)e)->oldSize().height())
+ else if (e->type() == TQEvent::Resize && ((TQResizeEvent*)e)->size().height() != ((TQResizeEvent*)e)->oldSize().height())
{
- int height = ((QResizeEvent*)e)->size().height();
- KPixmap bgPix = QPixmap(32, height);
- KPixmap bgPix1 = QPixmap(32, height/2);
- KPixmap bgPix2 = QPixmap(32, height - bgPix1.height());
- QColor buttonColor = ((QWidget*)o)->palette().color(QPalette::Active, QColorGroup::Button);
+ int height = ((TQResizeEvent*)e)->size().height();
+ KPixmap bgPix = TQPixmap(32, height);
+ KPixmap bgPix1 = TQPixmap(32, height/2);
+ KPixmap bgPix2 = TQPixmap(32, height - bgPix1.height());
+ TQColor buttonColor = ((TQWidget*)o)->palette().color(TQPalette::Active, TQColorGroup::Button);
KPixmapEffect::gradient( bgPix1, buttonColor.light(130), buttonColor, KPixmapEffect::VerticalGradient, 0);
KPixmapEffect::gradient( bgPix2, buttonColor.dark(120), buttonColor.light(110), KPixmapEffect::VerticalGradient, 0);
- QPainter p(&bgPix);
+ TQPainter p(&bgPix);
p.drawPixmap(0,0,bgPix1);
p.drawPixmap(0,bgPix1.height(),bgPix2);
p.end();
- ((QWidget*)o)->setPaletteBackgroundPixmap( bgPix );
+ ((TQWidget*)o)->setPaletteBackgroundPixmap( bgPix );
}
return false;
}
if (o != searchLine)
return false;
- QLineEdit *le = (QLineEdit *)o;
- if (e->type() == QEvent::KeyPress)
+ TQLineEdit *le = (TQLineEdit *)o;
+ if (e->type() == TQEvent::KeyPress)
{
- QKeyEvent *ke = (QKeyEvent*)e;
- if (ke->state() & Qt::ControlButton || ke->state() & Qt::AltButton)
+ TQKeyEvent *ke = (TQKeyEvent*)e;
+ if (ke->state() & TQt::ControlButton || ke->state() & TQt::AltButton)
// might be shortcut, set category
{
- if (ke->state() == Qt::ControlButton)
+ if (ke->state() == TQt::ControlButton)
{
- if (ke->key() == Qt::Key_Up)
+ if (ke->key() == TQt::Key_Up)
{
if (categoryCombo->currentItem() > 0)
{
@@ -2166,7 +2166,7 @@ bool StartMenu::eventFilter ( QObject * o, QEvent * e )
}
return true;
}
- if (ke->key() == Qt::Key_Down)
+ if (ke->key() == TQt::Key_Down)
{
if (categoryCombo->currentItem() < categoryCombo->count())
{
@@ -2176,7 +2176,7 @@ bool StartMenu::eventFilter ( QObject * o, QEvent * e )
return true;
}
}
- if (ke->key() == Qt::Key_Shift || ke->key() == Qt::Key_Control || ke->key() == Qt::Key_Alt)
+ if (ke->key() == TQt::Key_Shift || ke->key() == TQt::Key_Control || ke->key() == TQt::Key_Alt)
return false;
ShortcutList::Iterator it;
for ( it = shortcutList.begin(); it != shortcutList.end(); ++it )
@@ -2188,21 +2188,21 @@ bool StartMenu::eventFilter ( QObject * o, QEvent * e )
}
switch(ke->key())
{
- case Qt::Key_Return:
- case Qt::Key_Enter:
+ case TQt::Key_Return:
+ case TQt::Key_Enter:
{
execute(le->text());
- if (!(ke->state() & Qt::ControlButton))
+ if (!(ke->state() & TQt::ControlButton))
close(); //bye
return true; //don't do anything else
}
- case Qt::Key_Backspace:
- case Qt::Key_Delete:
+ case TQt::Key_Backspace:
+ case TQt::Key_Delete:
{
- connect (le, SIGNAL(textChanged ( const QString & )), this, SLOT(search(const QString &)));
+ connect (le, SIGNAL(textChanged ( const TQString & )), this, SLOT(search(const TQString &)));
break;
}
- case Qt::Key_Down:
+ case TQt::Key_Down:
{
if (history.isEmpty() || currentHistoryItem == history.end())
{
@@ -2219,7 +2219,7 @@ bool StartMenu::eventFilter ( QObject * o, QEvent * e )
}
return true; //don't scroll the categories
}
- case Qt::Key_Up:
+ case TQt::Key_Up:
{
if (!(history.isEmpty() || currentHistoryItem == history.begin()))
{
@@ -2230,7 +2230,7 @@ bool StartMenu::eventFilter ( QObject * o, QEvent * e )
}
return true; //don't scroll the categories
}
- case Qt::Key_Escape:
+ case TQt::Key_Escape:
{
close(); //bye
break;
@@ -2240,9 +2240,9 @@ bool StartMenu::eventFilter ( QObject * o, QEvent * e )
}
return false;
}
- else if (isVisible() && useKTTS && e->type() == QEvent::FocusIn)
+ else if (isVisible() && useKTTS && e->type() == TQEvent::FocusIn)
{
- QString text = i18n("TTS output", "The searchline has now the focus.");
+ TQString text = i18n("TTS output", "The searchline has now the focus.");
sayText(text);
}
return false;