summaryrefslogtreecommitdiffstats
path: root/kommander/widgets/popupmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/widgets/popupmenu.cpp')
-rw-r--r--kommander/widgets/popupmenu.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/kommander/widgets/popupmenu.cpp b/kommander/widgets/popupmenu.cpp
index 696bd0be..48bb4474 100644
--- a/kommander/widgets/popupmenu.cpp
+++ b/kommander/widgets/popupmenu.cpp
@@ -12,7 +12,7 @@
#include "popupmenu.h"
#include "specials.h"
-#include <qcursor.h>
+#include <tqcursor.h>
#include <kglobal.h>
#include <kiconloader.h>
@@ -32,17 +32,17 @@
#define INSERTSUBMENU 109
#define LAST_FUNCTION INSERTSUBMENU
-PopupMenu::PopupMenu(QWidget *parent, const char *name)
- : QLabel(parent, name), KommanderWidget(this)
+PopupMenu::PopupMenu(TQWidget *parent, const char *name)
+ : TQLabel(parent, name), KommanderWidget(this)
{
- QStringList states;
+ TQStringList states;
states << "default";
setStates(states);
setDisplayStates(states);
if (KommanderWidget::inEditor)
{
setPixmap(KGlobal::iconLoader()->loadIcon("contents", KIcon::NoGroup, KIcon::SizeMedium));
- setFrameStyle(QFrame::Box | QFrame::Plain);
+ setFrameStyle(TQFrame::Box | TQFrame::Plain);
setLineWidth(1);
setFixedSize(pixmap()->size());
}
@@ -50,19 +50,19 @@ PopupMenu::PopupMenu(QWidget *parent, const char *name)
setHidden(true);
m_menu = new KPopupMenu(this);
- connect(m_menu, SIGNAL(activated(int)), this, SLOT(slotMenuItemActivated(int)));
+ connect(m_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotMenuItemActivated(int)));
KommanderPlugin::setDefaultGroup(Group::DCOP);
- KommanderPlugin::registerFunction(INSERTMENUITEM, "insertMenuItem(QString widget, QString text, QString executeWidget, int index, QString icon)", i18n("Insert an item into the popup menu. The executeWidget's execute method will be run when this item is selected. Returns the id of the inserted item. Use -1 for index to insert to the end. The icon is optional."), 4, 5);
- KommanderPlugin::registerFunction(INSERTSEPARATOR, "insertSeparator(QString widget, int index)", i18n("Insert a separator item into the popup menu. Use -1 for index to insert to the end."), 2);
- KommanderPlugin::registerFunction(CHANGEMENUITEM, "changeMenuItem(QString widget, int id, QString text, QString executeWidget, QString icon)", i18n("Change an item specified by id in the popup menu. The executeWidget's execute method will be run when this item is selected."), 4, 5);
- KommanderPlugin::registerFunction(SETITEMENABLED, "setItemEnabled(QString widget, int id, bool enable)", i18n("Enable the item specified by id in the popup menu."), 3);
- KommanderPlugin::registerFunction(ITEMENABLED, "itemEnabled(QString widget, int id)", i18n("Check if the item specified by id is enabled."), 2);
- KommanderPlugin::registerFunction(SETITEMVISIBLE, "setItemVisible(QString widget, int id, bool enable)", i18n("Make the item specified by id visible."), 3);
- KommanderPlugin::registerFunction(SETITEMCHECKED, "setItemChecked(QString widget, int id, bool enable)", i18n("Apply checked status for the item specified by id."), 3);
- KommanderPlugin::registerFunction(ITEMVISIBLE, "itemVisible(QString widget, int id)", i18n("Check if the item specified by id is visible."), 2);
- KommanderPlugin::registerFunction(ITEMCHECKED, "itemChecked(QString widget, int id)", i18n("Verify if the item specified by id is checked."), 2);
- KommanderPlugin::registerFunction(INSERTSUBMENU, "insertSubmenu(QString widget, QString text, QString menuWidget, int index, QString icon)", i18n("Insert submenu widget into the popup menu. Use -1 for index to insert to the end. The icon is optional."), 4, 5);
+ KommanderPlugin::registerFunction(INSERTMENUITEM, "insertMenuItem(TQString widget, TQString text, TQString executeWidget, int index, TQString icon)", i18n("Insert an item into the popup menu. The executeWidget's execute method will be run when this item is selected. Returns the id of the inserted item. Use -1 for index to insert to the end. The icon is optional."), 4, 5);
+ KommanderPlugin::registerFunction(INSERTSEPARATOR, "insertSeparator(TQString widget, int index)", i18n("Insert a separator item into the popup menu. Use -1 for index to insert to the end."), 2);
+ KommanderPlugin::registerFunction(CHANGEMENUITEM, "changeMenuItem(TQString widget, int id, TQString text, TQString executeWidget, TQString icon)", i18n("Change an item specified by id in the popup menu. The executeWidget's execute method will be run when this item is selected."), 4, 5);
+ KommanderPlugin::registerFunction(SETITEMENABLED, "setItemEnabled(TQString widget, int id, bool enable)", i18n("Enable the item specified by id in the popup menu."), 3);
+ KommanderPlugin::registerFunction(ITEMENABLED, "itemEnabled(TQString widget, int id)", i18n("Check if the item specified by id is enabled."), 2);
+ KommanderPlugin::registerFunction(SETITEMVISIBLE, "setItemVisible(TQString widget, int id, bool enable)", i18n("Make the item specified by id visible."), 3);
+ KommanderPlugin::registerFunction(SETITEMCHECKED, "setItemChecked(TQString widget, int id, bool enable)", i18n("Apply checked status for the item specified by id."), 3);
+ KommanderPlugin::registerFunction(ITEMVISIBLE, "itemVisible(TQString widget, int id)", i18n("Check if the item specified by id is visible."), 2);
+ KommanderPlugin::registerFunction(ITEMCHECKED, "itemChecked(TQString widget, int id)", i18n("Verify if the item specified by id is checked."), 2);
+ KommanderPlugin::registerFunction(INSERTSUBMENU, "insertSubmenu(TQString widget, TQString text, TQString menuWidget, int index, TQString icon)", i18n("Insert submenu widget into the popup menu. Use -1 for index to insert to the end. The icon is optional."), 4, 5);
}
@@ -71,9 +71,9 @@ PopupMenu::~PopupMenu()
delete m_menu;
}
-QString PopupMenu::currentState() const
+TQString PopupMenu::currentState() const
{
- return QString("default");
+ return TQString("default");
}
bool PopupMenu::isKommanderWidget() const
@@ -81,40 +81,40 @@ bool PopupMenu::isKommanderWidget() const
return true;
}
-QStringList PopupMenu::associatedText() const
+TQStringList PopupMenu::associatedText() const
{
return KommanderWidget::associatedText();
}
-void PopupMenu::setAssociatedText(const QStringList& a_at)
+void PopupMenu::setAssociatedText(const TQStringList& a_at)
{
KommanderWidget::setAssociatedText(a_at);
}
-void PopupMenu::setWidgetText(const QString& a_text)
+void PopupMenu::setWidgetText(const TQString& a_text)
{
KommanderWidget::setAssociatedText(a_text);
}
-void PopupMenu::setPopulationText(const QString& a_text)
+void PopupMenu::setPopulationText(const TQString& a_text)
{
KommanderWidget::setPopulationText(a_text);
}
-QString PopupMenu::populationText() const
+TQString PopupMenu::populationText() const
{
return KommanderWidget::populationText();
}
void PopupMenu::popup(int x, int y)
{
- m_menu->exec(QPoint(x, y));
+ m_menu->exec(TQPoint(x, y));
}
void PopupMenu::slotMenuItemActivated(int id)
{
- QString widget = m_associations[id];
- KommanderWidget::evalAssociatedText(QString("#!kommander\n%1.execute(%2)").arg(widget).arg(id));
+ TQString widget = m_associations[id];
+ KommanderWidget::evalAssociatedText(TQString("#!kommander\n%1.execute(%2)").arg(widget).arg(id));
}
void PopupMenu::populate()
@@ -122,17 +122,17 @@ void PopupMenu::populate()
setAssociatedText(KommanderWidget::evalAssociatedText( populationText()));
}
-QString PopupMenu::insertSubmenu(const QString& title, const QString &menuWidget, int index, const QString& icon)
+TQString PopupMenu::insertSubmenu(const TQString& title, const TQString &menuWidget, int index, const TQString& icon)
{
KommanderWidget *w = widgetByName(menuWidget);
if (dynamic_cast<PopupMenu*>(w))
{
if (icon.isEmpty())
- return QString::number(m_menu->insertItem(title, dynamic_cast<PopupMenu*>(w)->menu(), index));
+ return TQString::number(m_menu->insertItem(title, dynamic_cast<PopupMenu*>(w)->menu(), index));
else
- return QString::number( m_menu->insertItem(KGlobal::iconLoader()->loadIcon(icon, KIcon::NoGroup, KIcon::SizeMedium), title, dynamic_cast<PopupMenu*>(w)->menu(), index));
+ return TQString::number( m_menu->insertItem(KGlobal::iconLoader()->loadIcon(icon, KIcon::NoGroup, KIcon::SizeMedium), title, dynamic_cast<PopupMenu*>(w)->menu(), index));
}
- return QString();
+ return TQString();
}
@@ -141,7 +141,7 @@ bool PopupMenu::isFunctionSupported(int f)
return f == DCOP::clear || f == DCOP::execute || f == DCOP::item || (f >= INSERTMENUITEM && f <= LAST_FUNCTION) || f == DCOP::count || f == DCOP::geometry;
}
-QString PopupMenu::handleDCOP(int function, const QStringList& args)
+TQString PopupMenu::handleDCOP(int function, const TQStringList& args)
{
switch (function) {
case DCOP::clear:
@@ -161,7 +161,7 @@ QString PopupMenu::handleDCOP(int function, const QStringList& args)
else
id = m_menu->insertItem(KGlobal::iconLoader()->loadIcon(args[3], KIcon::NoGroup, KIcon::SizeMedium), args[0], index);
m_associations[id] = args[1];
- return QString::number(id);
+ return TQString::number(id);
break;
}
case INSERTSUBMENU:
@@ -223,22 +223,22 @@ QString PopupMenu::handleDCOP(int function, const QStringList& args)
case DCOP::item:
{
uint index = args[0].toInt();
- return index < m_params.count() ? m_params[index] : QString::null;
+ return index < m_params.count() ? m_params[index] : TQString::null;
break;
}
case DCOP::count:
- return QString::number(m_menu->count());
+ return TQString::number(m_menu->count());
break;
case DCOP::geometry:
{
- QString geo = QString::number(this->x())+" "+QString::number(this->y())+" "+QString::number(this->width())+" "+QString::number(this->height());
+ TQString geo = TQString::number(this->x())+" "+TQString::number(this->y())+" "+TQString::number(this->width())+" "+TQString::number(this->height());
return geo;
break;
}
default:
return KommanderWidget::handleDCOP(function, args);
}
- return QString();
+ return TQString();
}