summaryrefslogtreecommitdiffstats
path: root/kdict/toplevel.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kdict/toplevel.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz
tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdict/toplevel.cpp')
-rw-r--r--kdict/toplevel.cpp174
1 files changed, 87 insertions, 87 deletions
diff --git a/kdict/toplevel.cpp b/kdict/toplevel.cpp
index ee334cbd..f0842512 100644
--- a/kdict/toplevel.cpp
+++ b/kdict/toplevel.cpp
@@ -14,7 +14,7 @@
------------------------------------------------------------- */
-#include <qclipboard.h>
+#include <tqclipboard.h>
#include <kstdaccel.h>
#include <kstdaction.h>
@@ -35,8 +35,8 @@
#include "toplevel.h"
-// cut a QString and add "..."
-QString getShortString(QString str,unsigned int length)
+// cut a TQString and add "..."
+TQString getShortString(TQString str,unsigned int length)
{
if (str.length()>length) {
str.truncate(length-3);
@@ -50,7 +50,7 @@ DictInterface *interface;
GlobalData *global;
-TopLevel::TopLevel(QWidget* parent, const char* name)
+TopLevel::TopLevel(TQWidget* parent, const char* name)
: DCOPObject("KDictIface"), KMainWindow(parent, name, WType_TopLevel),
optDlg(0L), setsDlg(0L), stopRef(0)
{
@@ -61,26 +61,26 @@ TopLevel::TopLevel(QWidget* parent, const char* name)
global->topLevel = this;
global->read();
interface = new DictInterface();
- connect(interface,SIGNAL(infoReady()),SLOT(stratDbChanged()));
- connect(interface,SIGNAL(started(const QString&)),SLOT(clientStarted(const QString&)));
- connect(interface,SIGNAL(stopped(const QString&)),SLOT(clientStopped(const QString&)));
+ connect(interface,TQT_SIGNAL(infoReady()),TQT_SLOT(stratDbChanged()));
+ connect(interface,TQT_SIGNAL(started(const TQString&)),TQT_SLOT(clientStarted(const TQString&)));
+ connect(interface,TQT_SIGNAL(stopped(const TQString&)),TQT_SLOT(clientStopped(const TQString&)));
queryView = new QueryView(this);
- connect(queryView,SIGNAL(defineRequested(const QString&)),SLOT(define(const QString&)));
- connect(queryView,SIGNAL(matchRequested(const QString&)),SLOT(match(const QString&)));
- connect(queryView,SIGNAL(clipboardRequested()),SLOT(defineClipboard()));
- connect(queryView,SIGNAL(enableCopy(bool)),SLOT(enableCopy(bool)));
- connect(queryView,SIGNAL(enablePrintSave()),SLOT(enablePrintSave()));
- connect(queryView,SIGNAL(renderingStarted()),SLOT(renderingStarted()));
- connect(queryView,SIGNAL(renderingStopped()),SLOT(renderingStopped()));
- connect(queryView,SIGNAL(newCaption(const QString&)),SLOT(newCaption(const QString&)));
+ connect(queryView,TQT_SIGNAL(defineRequested(const TQString&)),TQT_SLOT(define(const TQString&)));
+ connect(queryView,TQT_SIGNAL(matchRequested(const TQString&)),TQT_SLOT(match(const TQString&)));
+ connect(queryView,TQT_SIGNAL(clipboardRequested()),TQT_SLOT(defineClipboard()));
+ connect(queryView,TQT_SIGNAL(enableCopy(bool)),TQT_SLOT(enableCopy(bool)));
+ connect(queryView,TQT_SIGNAL(enablePrintSave()),TQT_SLOT(enablePrintSave()));
+ connect(queryView,TQT_SIGNAL(renderingStarted()),TQT_SLOT(renderingStarted()));
+ connect(queryView,TQT_SIGNAL(renderingStopped()),TQT_SLOT(renderingStopped()));
+ connect(queryView,TQT_SIGNAL(newCaption(const TQString&)),TQT_SLOT(newCaption(const TQString&)));
matchView = new MatchView();
- connect(matchView,SIGNAL(defineRequested(const QString&)),SLOT(define(const QString&)));
- connect(matchView,SIGNAL(matchRequested(const QString&)),SLOT(match(const QString&)));
- connect(matchView,SIGNAL(clipboardRequested()),SLOT(matchClipboard()));
- connect(matchView,SIGNAL(windowClosed()),SLOT(toggleMatchListShow()));
- connect(&resetStatusbarTimer,SIGNAL(timeout()),SLOT(resetStatusbar()));
+ connect(matchView,TQT_SIGNAL(defineRequested(const TQString&)),TQT_SLOT(define(const TQString&)));
+ connect(matchView,TQT_SIGNAL(matchRequested(const TQString&)),TQT_SLOT(match(const TQString&)));
+ connect(matchView,TQT_SIGNAL(clipboardRequested()),TQT_SLOT(matchClipboard()));
+ connect(matchView,TQT_SIGNAL(windowClosed()),TQT_SLOT(toggleMatchListShow()));
+ connect(&resetStatusbarTimer,TQT_SIGNAL(timeout()),TQT_SLOT(resetStatusbar()));
setupStatusBar();
setupActions();
@@ -89,12 +89,12 @@ TopLevel::TopLevel(QWidget* parent, const char* name)
if (global->showMatchList)
{ // show splitter, html view & match list
- splitter = new QSplitter(QSplitter::Horizontal,this);
+ splitter = new TQSplitter(TQSplitter::Horizontal,this);
splitter->setOpaqueResize( KGlobalSettings::opaqueResize() );
queryView->reparent(splitter,0,queryView->pos(),true);
matchView->reparent(splitter,0,matchView->pos(),true);
setCentralWidget(splitter);
- splitter->setResizeMode(matchView,QSplitter::KeepSize);
+ splitter->setResizeMode(matchView,TQSplitter::KeepSize);
adjustMatchViewSize();
}
else
@@ -139,7 +139,7 @@ void TopLevel::makeActiveWindow()
}
-void TopLevel::definePhrase(QString phrase)
+void TopLevel::definePhrase(TQString phrase)
{
kdDebug(5004) << "*DCOP call* TopLevel::definePhrase()" << endl;
define(phrase);
@@ -147,7 +147,7 @@ void TopLevel::definePhrase(QString phrase)
}
-void TopLevel::matchPhrase(QString phrase)
+void TopLevel::matchPhrase(TQString phrase)
{
kdDebug(5004) << "*DCOP call* TopLevel::matchPhrase()" << endl;
match(phrase);
@@ -171,35 +171,35 @@ void TopLevel::matchClipboardContent()
}
-QStringList TopLevel::getDatabases()
+TQStringList TopLevel::getDatabases()
{
kdDebug(5004) << "*DCOP call* TopLevel::getDatabases()" << endl;
return global->databases;
}
-QString TopLevel::currentDatabase()
+TQString TopLevel::currentDatabase()
{
kdDebug(5004) << "*DCOP call* TopLevel::currentDatabase()" << endl;
return global->databases[global->currentDatabase];
}
-QStringList TopLevel::getStrategies()
+TQStringList TopLevel::getStrategies()
{
kdDebug(5004) << "*DCOP call* TopLevel::getStrategies()" << endl;
return global->strategies;
}
-QString TopLevel::currentStrategy()
+TQString TopLevel::currentStrategy()
{
kdDebug(5004) << "*DCOP call* TopLevel::currentStrategy()" << endl;
return global->strategies[global->currentStrategy];
}
-bool TopLevel::setDatabase(QString db)
+bool TopLevel::setDatabase(TQString db)
{
kdDebug(5004) << "*DCOP call* TopLevel::setDatabase()" << endl;
@@ -214,7 +214,7 @@ bool TopLevel::setDatabase(QString db)
}
-bool TopLevel::setStrategy(QString strategy)
+bool TopLevel::setStrategy(TQString strategy)
{
kdDebug(5004) << "*DCOP call* TopLevel::setStrategy()" << endl;
@@ -249,7 +249,7 @@ bool TopLevel::historyGoForward()
// *******************************************************************************
-void TopLevel::define(const QString &query)
+void TopLevel::define(const TQString &query)
{
kdDebug(5004) << "TopLevel::define()" << endl;
actQueryCombo->setEditText(query);
@@ -261,7 +261,7 @@ void TopLevel::defineClipboard()
{
kdDebug(5004) << "TopLevel::defineClipboard()" << endl;
kapp->clipboard()->setSelectionMode(true);
- QString text = kapp->clipboard()->text();
+ TQString text = kapp->clipboard()->text();
if (text.isEmpty()) {
kapp->clipboard()->setSelectionMode(false);
text = kapp->clipboard()->text();
@@ -270,7 +270,7 @@ void TopLevel::defineClipboard()
}
-void TopLevel::match(const QString &query)
+void TopLevel::match(const TQString &query)
{
kdDebug(5004) << "TopLevel::match()" << endl;
actQueryCombo->setEditText(query);
@@ -282,7 +282,7 @@ void TopLevel::matchClipboard()
{
kdDebug(5004) << "TopLevel::matchClipboard()" << endl;
kapp->clipboard()->setSelectionMode(true);
- QString text = kapp->clipboard()->text();
+ TQString text = kapp->clipboard()->text();
if (text.isEmpty()) {
kapp->clipboard()->setSelectionMode(false);
text = kapp->clipboard()->text();
@@ -308,80 +308,80 @@ bool TopLevel::queryClose()
void TopLevel::setupActions()
{
// file menu...
- actSave = KStdAction::save(queryView, SLOT(saveQuery()), actionCollection());
+ actSave = KStdAction::save(queryView, TQT_SLOT(saveQuery()), actionCollection());
actSave->setText(i18n("&Save As..."));
actSave->setEnabled(false);
- actPrint = KStdAction::print(queryView, SLOT(printQuery()), actionCollection());
+ actPrint = KStdAction::print(queryView, TQT_SLOT(printQuery()), actionCollection());
actPrint->setEnabled(false);
actStartQuery = new KAction(i18n("St&art Query"),"reload", 0 , this,
- SLOT(doDefine()), actionCollection(), "start_query");
+ TQT_SLOT(doDefine()), actionCollection(), "start_query");
actStopQuery = new KAction(i18n("St&op Query"),"stop", 0 , this,
- SLOT(stopClients()), actionCollection(), "stop_query");
+ TQT_SLOT(stopClients()), actionCollection(), "stop_query");
actStopQuery->setEnabled(false);
- KStdAction::quit(kapp, SLOT(closeAllWindows()), actionCollection());
+ KStdAction::quit(kapp, TQT_SLOT(closeAllWindows()), actionCollection());
// edit menu...
- actCopy = KStdAction::copy(queryView, SLOT(copySelection()), actionCollection());
+ actCopy = KStdAction::copy(queryView, TQT_SLOT(copySelection()), actionCollection());
actCopy->setEnabled(false);
- KStdAction::selectAll(queryView, SLOT(selectAll()), actionCollection());
+ KStdAction::selectAll(queryView, TQT_SLOT(selectAll()), actionCollection());
new KAction(i18n("&Define Clipboard Content"), "define_clip", 0 , this,
- SLOT(defineClipboard()), actionCollection(), "define_clipboard");
+ TQT_SLOT(defineClipboard()), actionCollection(), "define_clipboard");
new KAction(i18n("&Match Clipboard Content"), 0 , this,
- SLOT(matchClipboard()), actionCollection(), "match_clipboard");
- KStdAction::find(queryView, SLOT(showFindDialog()), actionCollection());
+ TQT_SLOT(matchClipboard()), actionCollection(), "match_clipboard");
+ KStdAction::find(queryView, TQT_SLOT(showFindDialog()), actionCollection());
// history menu...
actBack = new KToolBarPopupAction(i18n("&Back"), "back", KStdAccel::shortcut(KStdAccel::Back),
- queryView, SLOT(browseBack()), actionCollection(),"browse_back");
+ queryView, TQT_SLOT(browseBack()), actionCollection(),"browse_back");
actBack->setDelayed(true);
actBack->setStickyMenu(false);
actBack->setEnabled(false);
actForward = new KToolBarPopupAction(i18n("&Forward"), "forward", KStdAccel::shortcut(KStdAccel::Forward),
- queryView, SLOT(browseForward()), actionCollection(),"browse_forward");
+ queryView, TQT_SLOT(browseForward()), actionCollection(),"browse_forward");
actForward->setDelayed(true);
actForward->setStickyMenu(false);
actForward->setEnabled(false);
new KAction(i18n("&Clear History"), 0 , this,
- SLOT(clearQueryHistory()), actionCollection(), "clear_history");
+ TQT_SLOT(clearQueryHistory()), actionCollection(), "clear_history");
// server menu...
new KAction(i18n("&Get Capabilities"), 0 , interface,
- SLOT(updateServer()), actionCollection(), "get_capabilities");
+ TQT_SLOT(updateServer()), actionCollection(), "get_capabilities");
new KAction(i18n("Edit &Database Sets..."), "edit", 0 , this,
- SLOT(showSetsDialog()), actionCollection(), "edit_sets");
+ TQT_SLOT(showSetsDialog()), actionCollection(), "edit_sets");
new KAction(i18n("&Summary"), 0 , interface,
- SLOT(showDatabases()), actionCollection(), "db_summary");
+ TQT_SLOT(showDatabases()), actionCollection(), "db_summary");
new KAction(i18n("S&trategy Information"), 0 , interface,
- SLOT(showStrategies()), actionCollection(), "strategy_info");
+ TQT_SLOT(showStrategies()), actionCollection(), "strategy_info");
new KAction(i18n("&Server Information"), 0 , interface,
- SLOT(showInfo()), actionCollection(), "server_info");
+ TQT_SLOT(showInfo()), actionCollection(), "server_info");
// settings menu...
createStandardStatusBarAction();
setStandardToolBarMenuEnabled(true);
actShowMatchList = new KToggleAction(i18n("Show &Match List"), 0 , this,
- SLOT(toggleMatchListShow()), actionCollection(), "show_match");
+ TQT_SLOT(toggleMatchListShow()), actionCollection(), "show_match");
actShowMatchList->setCheckedState(i18n("Hide &Match List"));
actShowMatchList->setChecked(global->showMatchList);
- KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()),
+ KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()),
actionCollection());
- KStdAction::configureToolbars(this, SLOT(slotConfToolbar()), actionCollection());
- KStdAction::preferences(this, SLOT(showOptionsDialog()), actionCollection());
+ KStdAction::configureToolbars(this, TQT_SLOT(slotConfToolbar()), actionCollection());
+ KStdAction::preferences(this, TQT_SLOT(showOptionsDialog()), actionCollection());
// toolbar...
new KAction(i18n("Clear Input Field"), "query_erase", 0 , this,
- SLOT(clearInput()), actionCollection(), "clear_query");
+ TQT_SLOT(clearInput()), actionCollection(), "clear_query");
actQueryLabel = new DictLabelAction(i18n("&Look for:"), actionCollection(), "look_label");
actQueryCombo = new DictComboAction(i18n("Query"), actionCollection(), "query_combo",true,true);
- connect(actQueryCombo,SIGNAL(activated(const QString &)), SLOT(define(const QString&)));
+ connect(actQueryCombo,TQT_SIGNAL(activated(const TQString &)), TQT_SLOT(define(const TQString&)));
actQueryCombo->setCompletionMode(global->queryComboCompletionMode);
actDbLabel = new DictLabelAction(i18n("&in"), actionCollection(), "in_label");
actDbCombo = new DictComboAction(i18n("Databases"), actionCollection(), "db_combo",false,false);
- connect(actDbCombo,SIGNAL(activated(int)),SLOT(databaseSelected(int)));
- actDefineBtn = new DictButtonAction(i18n("&Define"), this, SLOT(doDefine()), actionCollection(), "define_btn");
- actMatchBtn = new DictButtonAction(i18n("&Match"), this, SLOT(doMatch()), actionCollection(), "match_btn");
+ connect(actDbCombo,TQT_SIGNAL(activated(int)),TQT_SLOT(databaseSelected(int)));
+ actDefineBtn = new DictButtonAction(i18n("&Define"), this, TQT_SLOT(doDefine()), actionCollection(), "define_btn");
+ actMatchBtn = new DictButtonAction(i18n("&Match"), this, TQT_SLOT(doMatch()), actionCollection(), "match_btn");
queryView->setActions(actBack,actForward,actQueryCombo);
}
@@ -392,13 +392,13 @@ void TopLevel::setupStatusBar()
statusBar()->insertItem(i18n(" Ready "),0,2);
statusBar()->setItemAlignment(0,AlignLeft | AlignVCenter);
- QString serverInfo;
+ TQString serverInfo;
if (global->authEnabled)
- serverInfo = QString(" %1@%2:%3 ").arg(getShortString(global->user,50))
+ serverInfo = TQString(" %1@%2:%3 ").arg(getShortString(global->user,50))
.arg(getShortString(global->server,50))
.arg(global->port);
else
- serverInfo = QString(" %1:%3 ").arg(getShortString(global->server,50))
+ serverInfo = TQString(" %1:%3 ").arg(getShortString(global->server,50))
.arg(global->port);
statusBar()->insertItem(serverInfo, 1,3);
statusBar()->setItemAlignment(1,AlignLeft | AlignVCenter);
@@ -429,7 +429,7 @@ void TopLevel::recreateGUI()
// add text in the query-combobox to the history
void TopLevel::addCurrentInputToHistory()
{
- QString text(actQueryCombo->currentText());
+ TQString text(actQueryCombo->currentText());
// maintain queryHistory
global->queryHistory.remove(text); // no double entrys
@@ -455,7 +455,7 @@ void TopLevel::clearInput()
// define text in the combobox
void TopLevel::doDefine()
{
- QString text(actQueryCombo->currentText());
+ TQString text(actQueryCombo->currentText());
if (!text.isEmpty())
{
@@ -468,7 +468,7 @@ void TopLevel::doDefine()
void TopLevel::doMatch()
{
- QString text(actQueryCombo->currentText());
+ TQString text(actQueryCombo->currentText());
if (!text.isEmpty())
{
@@ -503,8 +503,8 @@ void TopLevel::buildHistMenu()
unsigned int i = 0;
while ((i<10)&&(i<global->queryHistory.count())) {
- historyActionList.append( new KAction(getShortString(global->queryHistory[i],70), 0, this, SLOT(queryHistMenu()),
- (QObject*)0, global->queryHistory[i].utf8().data()) );
+ historyActionList.append( new KAction(getShortString(global->queryHistory[i],70), 0, this, TQT_SLOT(queryHistMenu()),
+ (TQObject*)0, global->queryHistory[i].utf8().data()) );
i++;
}
@@ -515,9 +515,9 @@ void TopLevel::buildHistMenu()
// process a query via the history menu
void TopLevel::queryHistMenu()
{
- QCString name = sender()->name();
+ TQCString name = sender()->name();
if (!name.isEmpty())
- define(QString::fromUtf8(name));
+ define(TQString::fromUtf8(name));
}
@@ -542,8 +542,8 @@ void TopLevel::stratDbChanged()
dbActionList.clear();
for (unsigned int i=0;i<global->serverDatabases.count();i++)
- dbActionList.append( new KAction(global->serverDatabases[i], 0, this, SLOT(dbInfoMenuClicked()),
- (QObject*)0, global->serverDatabases[i].utf8().data()) );
+ dbActionList.append( new KAction(global->serverDatabases[i], 0, this, TQT_SLOT(dbInfoMenuClicked()),
+ (TQObject*)0, global->serverDatabases[i].utf8().data()) );
plugActionList("db_detail", dbActionList);
}
@@ -551,7 +551,7 @@ void TopLevel::stratDbChanged()
void TopLevel::dbInfoMenuClicked()
{
- QCString name = sender()->name();
+ TQCString name = sender()->name();
if (!name.isEmpty())
interface->showDbInfo(name);
}
@@ -576,7 +576,7 @@ void TopLevel::enablePrintSave()
}
-void TopLevel::clientStarted(const QString &message)
+void TopLevel::clientStarted(const TQString &message)
{
statusBar()->changeItem(message,0);
resetStatusbarTimer.stop();
@@ -586,7 +586,7 @@ void TopLevel::clientStarted(const QString &message)
}
-void TopLevel::clientStopped(const QString &message)
+void TopLevel::clientStopped(const TQString &message)
{
statusBar()->changeItem(message,0);
resetStatusbarTimer.start(4000);
@@ -621,7 +621,7 @@ void TopLevel::renderingStopped()
}
-void TopLevel::newCaption(const QString &s)
+void TopLevel::newCaption(const TQString &s)
{
setCaption(s);
}
@@ -641,13 +641,13 @@ void TopLevel::toggleMatchListShow()
else // list is not visible -> show it
{
global->showMatchList = true;
- splitter = new QSplitter(QSplitter::Horizontal,this);
+ splitter = new TQSplitter(TQSplitter::Horizontal,this);
splitter->setOpaqueResize( KGlobalSettings::opaqueResize() );
setCentralWidget(splitter);
splitter->show();
queryView->reparent(splitter,0,queryView->pos(),true);
matchView->reparent(splitter,0,matchView->pos(),true);
- splitter->setResizeMode(matchView,QSplitter::KeepSize);
+ splitter->setResizeMode(matchView,TQSplitter::KeepSize);
adjustMatchViewSize();
}
@@ -677,7 +677,7 @@ void TopLevel::slotConfToolbar()
{
saveMainWindowSettings(KGlobal::config(),"toplevel_options");
KEditToolbar dlg(actionCollection(), "kdictui.rc");
- connect(&dlg,SIGNAL( newToolbarConfig() ), this, SLOT( slotNewToolbarConfig() ));
+ connect(&dlg,TQT_SIGNAL( newToolbarConfig() ), this, TQT_SLOT( slotNewToolbarConfig() ));
dlg.exec();
}
@@ -695,8 +695,8 @@ void TopLevel::showSetsDialog()
{
if (!setsDlg) {
setsDlg = new DbSetsDialog(this);
- connect(setsDlg,SIGNAL(setsChanged()),this,SLOT(setsChanged()));
- connect(setsDlg,SIGNAL(dialogClosed()),this,SLOT(hideSetsDialog()));
+ connect(setsDlg,TQT_SIGNAL(setsChanged()),this,TQT_SLOT(setsChanged()));
+ connect(setsDlg,TQT_SIGNAL(dialogClosed()),this,TQT_SLOT(hideSetsDialog()));
setsDlg->show();
} else {
KWin::activateWindow(setsDlg->winId());
@@ -724,8 +724,8 @@ void TopLevel::showOptionsDialog()
{
if (!optDlg) {
optDlg = new OptionsDialog(this);
- connect(optDlg,SIGNAL(optionsChanged()),this,SLOT(optionsChanged()));
- connect(optDlg,SIGNAL(finished()),this,SLOT(hideOptionsDialog()));
+ connect(optDlg,TQT_SIGNAL(optionsChanged()),this,TQT_SLOT(optionsChanged()));
+ connect(optDlg,TQT_SIGNAL(finished()),this,TQT_SLOT(hideOptionsDialog()));
optDlg->show();
} else {
KWin::activateWindow(optDlg->winId());
@@ -744,13 +744,13 @@ void TopLevel::hideOptionsDialog()
void TopLevel::optionsChanged()
{
- QString serverInfo;
+ TQString serverInfo;
if (global->authEnabled)
- serverInfo = QString(" %1@%2:%3 ").arg(getShortString(global->user,50))
+ serverInfo = TQString(" %1@%2:%3 ").arg(getShortString(global->user,50))
.arg(getShortString(global->server,50))
.arg(global->port);
else
- serverInfo = QString(" %1:%3 ").arg(getShortString(global->server,50))
+ serverInfo = TQString(" %1:%3 ").arg(getShortString(global->server,50))
.arg(global->port);
statusBar()->changeItem(serverInfo,1);
interface->serverChanged(); // inform client