summaryrefslogtreecommitdiffstats
path: root/ksirc/dockservercontroller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ksirc/dockservercontroller.cpp')
-rw-r--r--ksirc/dockservercontroller.cpp144
1 files changed, 72 insertions, 72 deletions
diff --git a/ksirc/dockservercontroller.cpp b/ksirc/dockservercontroller.cpp
index f83f5ada..6053e5ab 100644
--- a/ksirc/dockservercontroller.cpp
+++ b/ksirc/dockservercontroller.cpp
@@ -9,12 +9,12 @@
#include "dockservercontroller.h"
-#include <qpopupmenu.h>
-#include <qwidget.h>
-#include <qapplication.h>
-#include <qregexp.h>
-#include <qtimer.h>
-#include <qcursor.h>
+#include <tqpopupmenu.h>
+#include <tqwidget.h>
+#include <tqapplication.h>
+#include <tqregexp.h>
+#include <tqtimer.h>
+#include <tqcursor.h>
#include <kpassivepopup.h>
#include <kpopupmenu.h>
#include <klocale.h>
@@ -42,7 +42,7 @@
extern DisplayMgr *displayMgr;
-dscNickInfo::dscNickInfo(QString nick, QString server) :
+dscNickInfo::dscNickInfo(TQString nick, TQString server) :
m_nick(nick),
m_server(server)
{
@@ -53,7 +53,7 @@ dscNickInfo::~dscNickInfo()
}
-dockServerController::dockServerController(servercontroller *sc, QWidget *parent, const char *_name)
+dockServerController::dockServerController(servercontroller *sc, TQWidget *parent, const char *_name)
: KSystemTray(parent, _name),
m_sc(sc)
{
@@ -63,24 +63,24 @@ dockServerController::dockServerController(servercontroller *sc, QWidget *parent
pop->setName("dockServerController_menu_pop");
#ifndef NDEBUG
- pop->insertItem(i18n("Dump Object Tree"), sc, SLOT(dump_obj()));
- pop->insertItem(i18n("Server Debug Window"), sc, SLOT(server_debug()));
+ pop->insertItem(i18n("Dump Object Tree"), sc, TQT_SLOT(dump_obj()));
+ pop->insertItem(i18n("Server Debug Window"), sc, TQT_SLOT(server_debug()));
pop->insertSeparator();
#endif
pop->insertItem(SmallIcon( "filter" ), i18n("&Filter Rule Editor..."),
- m_sc, SLOT(filter_rule_editor()));
+ m_sc, TQT_SLOT(filter_rule_editor()));
- KStdAction::preferences(m_sc, SLOT(general_prefs()),
+ KStdAction::preferences(m_sc, TQT_SLOT(general_prefs()),
m_sc->actionCollection())->plug(pop);
- KStdAction::configureNotifications(m_sc, SLOT(notification_prefs()), actionCollection())->plug(pop);
+ KStdAction::configureNotifications(m_sc, TQT_SLOT(notification_prefs()), actionCollection())->plug(pop);
pop->insertSeparator();
pop->insertItem(i18n("New &Server..."),
- m_sc, SLOT(new_connection()));
- pop->insertItem(i18n("&Do Autoconnect..."), m_sc, SLOT(start_autoconnect_check()));
- connect(this, SIGNAL(quitSelected()), m_sc, SLOT(endksirc()));
+ m_sc, TQT_SLOT(new_connection()));
+ pop->insertItem(i18n("&Do Autoconnect..."), m_sc, TQT_SLOT(start_autoconnect_check()));
+ connect(this, TQT_SIGNAL(quitSelected()), m_sc, TQT_SLOT(endksirc()));
#if KDE_IS_VERSION(3,1,92)
m_pic_dock = KSystemTray::loadIcon( "ksirc" );
@@ -96,8 +96,8 @@ dockServerController::dockServerController(servercontroller *sc, QWidget *parent
m_mainPopVisible = false;
createMainPopup();
- m_blinkTimer = new QTimer( this );
- connect( m_blinkTimer, SIGNAL(timeout()), this, SLOT( blinkDockedIcon() ) );
+ m_blinkTimer = new TQTimer( this );
+ connect( m_blinkTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT( blinkDockedIcon() ) );
m_blinkStatus = false;
m_blinkActive = false;
@@ -107,14 +107,14 @@ dockServerController::dockServerController(servercontroller *sc, QWidget *parent
i18n("If someone said your nick in a window, this action "
"will make that window active for you."),
ALT+CTRL+Key_A, KKey::QtWIN+CTRL+Key_A, this,
- SLOT(raiseLastActiveWindow()));
+ TQT_SLOT(raiseLastActiveWindow()));
servercontroller::self()
->getGlobalAccel()
->insert("Clear Blink", i18n("Clear Blinking Dock Icon"),
i18n("If the dock icon is blinking, but you don't want "
"to go to the window this will clear the blinking."),
ALT+CTRL+Key_Down, KKey::QtWIN+CTRL+Key_Down, this,
- SLOT(blinkClear()));
+ TQT_SLOT(blinkClear()));
// mainPop = new KPopupMenu(this, "dockServerController_main_pop");
// mainPop->setTitle(i18n("KSirc Dock Menu"));
@@ -130,7 +130,7 @@ kdDebug(5008) << "~dockServerController in" << endl;
kdDebug(5008) << "~dockServerController out" << endl;
}
-int dockServerController::intoPopupSorted(QString str, QPopupMenu *what)
+int dockServerController::intoPopupSorted(TQString str, TQPopupMenu *what)
{
uint i = 0;
@@ -161,15 +161,15 @@ void dockServerController::createMainPopup()
if(mainPop)
delete mainPop;
mainPop = new KPopupMenu(this, "dockservercontrller_main_pop");
- connect(mainPop, SIGNAL(activated(int)),
- this, SLOT(mainActivated(int)));
- connect(mainPop, SIGNAL(aboutToShow()),
- this, SLOT(mainPopShow()));
- connect(mainPop, SIGNAL(aboutToHide()),
- this, SLOT(mainPopHide()));
+ connect(mainPop, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(mainActivated(int)));
+ connect(mainPop, TQT_SIGNAL(aboutToShow()),
+ this, TQT_SLOT(mainPopShow()));
+ connect(mainPop, TQT_SIGNAL(aboutToHide()),
+ this, TQT_SLOT(mainPopHide()));
- QDictIterator<dscNickInfo> it( m_nicks );
+ TQDictIterator<dscNickInfo> it( m_nicks );
for( ; it.current(); ++it){
KPopupMenu *sub = new KPopupMenu(mainPop);
if(it.current()->status() == dscNickInfo::isOnline){
@@ -187,8 +187,8 @@ void dockServerController::createMainPopup()
sub->setItemParameter(cid, id);
sub->setItemParameter(wid, id);
sub->setItemParameter(dcid, id);
- connect(sub, SIGNAL(activated(int)),
- this, SLOT(subItemActivated(int)));
+ connect(sub, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(subItemActivated(int)));
}
else {
sub->insertItem(i18n("Went Offline: ") + it.current()->offline().toString("hh:mm"));
@@ -201,40 +201,40 @@ void dockServerController::createMainPopup()
}
if(m_blink_reason.count() > 0){
mainPop->insertSeparator();
- for ( QStringList::Iterator it = m_blink_reason.begin(); it != m_blink_reason.end(); ++it ) {
+ for ( TQStringList::Iterator it = m_blink_reason.begin(); it != m_blink_reason.end(); ++it ) {
mainPop->insertItem(*it);
}
}
if(mainPop->count() == 0){
- mainPop->insertItem(i18n("Help on Notify Popup..."), this, SLOT(helpNotice()));
- mainPop->insertItem(i18n("Configure Notify..."), this, SLOT(configNotify()));
+ mainPop->insertItem(i18n("Help on Notify Popup..."), this, TQT_SLOT(helpNotice()));
+ mainPop->insertItem(i18n("Configure Notify..."), this, TQT_SLOT(configNotify()));
}
}
void dockServerController::subItemActivated(int sub_id)
{
- const QPopupMenu *sub = dynamic_cast<const QPopupMenu *>(sender());
+ const TQPopupMenu *sub = dynamic_cast<const TQPopupMenu *>(sender());
if(!sub){
- kdDebug(5008) << "subItemActivated by non QPopupMenu" << endl;
+ kdDebug(5008) << "subItemActivated by non TQPopupMenu" << endl;
return;
}
int main_id = sub->itemParameter(sub_id);
- QString mainText = mainPop->text(main_id);
+ TQString mainText = mainPop->text(main_id);
if(mainText.isNull()){
kdDebug(5008) << "failed to get mainPop text" << endl;
}
- QRegExp rx("(\\S+) -> (\\S+) ");
+ TQRegExp rx("(\\S+) -> (\\S+) ");
if(rx.search(mainText) >= 0){
- QString mserver = rx.cap(1);
- QString mnick = rx.cap(2);
+ TQString mserver = rx.cap(1);
+ TQString mnick = rx.cap(2);
- QString ns = mserver + "/" + mnick;
+ TQString ns = mserver + "/" + mnick;
if(m_nicks[ns]){
kdDebug(5008) << "Got " << sub->text(sub_id) << " request for " << ns << endl;
- QString cmd = sub->text(sub_id);
- QString server = m_nicks[ns]->server();
- QString nick = m_nicks[ns]->nick();
+ TQString cmd = sub->text(sub_id);
+ TQString server = m_nicks[ns]->server();
+ TQString nick = m_nicks[ns]->nick();
if(cmd == i18n("Chat")){
servercontroller::self()->new_toplevel(KSircChannel(server, nick));
@@ -259,7 +259,7 @@ void dockServerController::subItemActivated(int sub_id)
}
-void dockServerController::mousePressEvent( QMouseEvent *e )
+void dockServerController::mousePressEvent( TQMouseEvent *e )
{
if(e->button() == LeftButton){
showPopupMenu(mainPop);
@@ -269,39 +269,39 @@ void dockServerController::mousePressEvent( QMouseEvent *e )
}
}
-void dockServerController::showPopupMenu( QPopupMenu *menu )
+void dockServerController::showPopupMenu( TQPopupMenu *menu )
{
Q_ASSERT( menu != 0L );
- menu->popup(QCursor::pos());
+ menu->popup(TQCursor::pos());
}
-void dockServerController::nickOnline(QString server, QString nick)
+void dockServerController::nickOnline(TQString server, TQString nick)
{
- QString sn = server + "/" + nick;
+ TQString sn = server + "/" + nick;
if(!m_nicks[sn])
m_nicks.insert(sn, new dscNickInfo(nick, server));
m_nicks[sn]->setOnline();
createMainPopup();
}
-void dockServerController::nickOffline(QString server, QString nick)
+void dockServerController::nickOffline(TQString server, TQString nick)
{
- QString sn = server + "/" + nick;
+ TQString sn = server + "/" + nick;
if(!m_nicks[sn])
m_nicks.insert(sn, new dscNickInfo(nick, server));
m_nicks[sn]->setOffline();
createMainPopup();
}
-void dockServerController::serverOpen(QString)
+void dockServerController::serverOpen(TQString)
{
}
-void dockServerController::serverClose(QString server)
+void dockServerController::serverClose(TQString server)
{
- QDictIterator<dscNickInfo> it( m_nicks );
+ TQDictIterator<dscNickInfo> it( m_nicks );
while(it.current()){
if(it.current()->server() == server)
m_nicks.remove(it.currentKey());
@@ -311,7 +311,7 @@ void dockServerController::serverClose(QString server)
createMainPopup();
}
-void dockServerController::startBlink(const QString& reason, const QString& text)
+void dockServerController::startBlink(const TQString& reason, const TQString& text)
{
if(m_blinkActive == false){
// change icon (to "someone's talking to you" icon)
@@ -321,12 +321,12 @@ void dockServerController::startBlink(const QString& reason, const QString& text
m_blinkTimer->start( 500 ); // half a second
}
if(!reason.isNull()){
- QString br(reason);
+ TQString br(reason);
if(text.isNull() && ksopts->runDocked && ksopts->dockPopups)
- KPassivePopup::message(QString("Notify: %1").arg(reason), this);
+ KPassivePopup::message(TQString("Notify: %1").arg(reason), this);
else {
- QStringList sl;
- QString cutup = text;
+ TQStringList sl;
+ TQString cutup = text;
int i = 0;
br = reason + " " + text.left(50);
if(text.length() > 50)
@@ -338,16 +338,16 @@ void dockServerController::startBlink(const QString& reason, const QString& text
cutup = sl.join("\n");
cutup.truncate(cutup.length()-1);
if(ksopts->runDocked && ksopts->dockPopups)
- KPassivePopup::message(QString("%1").arg(reason), cutup, this);
+ KPassivePopup::message(TQString("%1").arg(reason), cutup, this);
}
m_blink_reason.append(br);
createMainPopup();
kdDebug(5008) << "Blink reason: " << br << endl;
- QRegExp rx("(\\S+) -> (\\S+)");
+ TQRegExp rx("(\\S+) -> (\\S+)");
if(rx.search(reason) >= 0){
- QString server = rx.cap(1);
- QString nick = rx.cap(2);
+ TQString server = rx.cap(1);
+ TQString nick = rx.cap(2);
m_last_server = server;
m_last_nick = nick;
@@ -355,7 +355,7 @@ void dockServerController::startBlink(const QString& reason, const QString& text
}
}
-void dockServerController::stopBlink(const QString& reason, bool clear)
+void dockServerController::stopBlink(const TQString& reason, bool clear)
{
if(clear == true){
m_blinkActive = false;
@@ -377,10 +377,10 @@ void dockServerController::blinkClear()
void dockServerController::mainActivated(int id)
{
- QRegExp rx("(\\S+) -> (\\S+) ");
+ TQRegExp rx("(\\S+) -> (\\S+) ");
if(rx.search(mainPop->text(id)) >= 0){
- QString server = rx.cap(1);
- QString nick = rx.cap(2);
+ TQString server = rx.cap(1);
+ TQString nick = rx.cap(2);
raiseWindow(server, nick);
@@ -421,8 +421,8 @@ void dockServerController::helpNotice()
void dockServerController::configNotify()
{
KSPrefs *kp = new KSPrefs();
- connect(kp, SIGNAL(update(int)),
- m_sc, SLOT(configChange()));
+ connect(kp, TQT_SIGNAL(update(int)),
+ m_sc, TQT_SLOT(configChange()));
kp->resize(550, 450);
kp->showPage(2); /* Show auto connect page */
kp->show();
@@ -430,13 +430,13 @@ void dockServerController::configNotify()
}
-void dockServerController::raiseWindow(QString server, QString name)
+void dockServerController::raiseWindow(TQString server, TQString name)
{
- QCString txt = server.utf8() + "_" + name.utf8() + "_toplevel";
- QWidget *obj = dynamic_cast<QWidget *>( objFinder::find(txt, "KSircTopLevel"));
+ TQCString txt = server.utf8() + "_" + name.utf8() + "_toplevel";
+ TQWidget *obj = dynamic_cast<TQWidget *>( objFinder::find(txt, "KSircTopLevel"));
if(obj == 0x0){
txt = server.utf8() + "_!" + name.utf8() + "_toplevel";
- obj = dynamic_cast<QWidget *>( objFinder::find(txt, "KSircTopLevel"));
+ obj = dynamic_cast<TQWidget *>( objFinder::find(txt, "KSircTopLevel"));
}
if(obj != 0x0){