diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kdict/toplevel.cpp | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip |
TQt4 port kdenetwork
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdict/toplevel.cpp')
-rw-r--r-- | kdict/toplevel.cpp | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/kdict/toplevel.cpp b/kdict/toplevel.cpp index f0842512..48a5c30a 100644 --- a/kdict/toplevel.cpp +++ b/kdict/toplevel.cpp @@ -3,7 +3,7 @@ toplevel.cpp (part of The KDE Dictionary Client) Copyright (C) 2000-2001 Christian Gebauer <[email protected]> - (C) by Matthias H�lzer 1998 + (C) by Matthias H�lzer 1998 This file is distributed under the Artistic License. See LICENSE for details. @@ -50,8 +50,8 @@ DictInterface *interface; GlobalData *global; -TopLevel::TopLevel(TQWidget* parent, const char* name) - : DCOPObject("KDictIface"), KMainWindow(parent, name, WType_TopLevel), +TopLevel::TopLevel(TQWidget* tqparent, const char* name) + : DCOPObject("KDictIface"), KMainWindow(tqparent, name, WType_TopLevel), optDlg(0L), setsDlg(0L), stopRef(0) { kapp->dcopClient()->setDefaultObject(objId()); @@ -89,7 +89,7 @@ TopLevel::TopLevel(TQWidget* parent, const char* name) if (global->showMatchList) { // show splitter, html view & match list - splitter = new TQSplitter(TQSplitter::Horizontal,this); + splitter = new TQSplitter(Qt::Horizontal,this); splitter->setOpaqueResize( KGlobalSettings::opaqueResize() ); queryView->reparent(splitter,0,queryView->pos(),true); matchView->reparent(splitter,0,matchView->pos(),true); @@ -203,7 +203,7 @@ bool TopLevel::setDatabase(TQString db) { kdDebug(5004) << "*DCOP call* TopLevel::setDatabase()" << endl; - int newCurrent = global->databases.findIndex(db); + int newCurrent = global->databases.tqfindIndex(db); if (newCurrent == -1) return false; else { @@ -260,11 +260,11 @@ void TopLevel::define(const TQString &query) void TopLevel::defineClipboard() { kdDebug(5004) << "TopLevel::defineClipboard()" << endl; - kapp->clipboard()->setSelectionMode(true); - TQString text = kapp->clipboard()->text(); + kapp->tqclipboard()->setSelectionMode(true); + TQString text = kapp->tqclipboard()->text(); if (text.isEmpty()) { - kapp->clipboard()->setSelectionMode(false); - text = kapp->clipboard()->text(); + kapp->tqclipboard()->setSelectionMode(false); + text = kapp->tqclipboard()->text(); } define(text); } @@ -281,11 +281,11 @@ void TopLevel::match(const TQString &query) void TopLevel::matchClipboard() { kdDebug(5004) << "TopLevel::matchClipboard()" << endl; - kapp->clipboard()->setSelectionMode(true); - TQString text = kapp->clipboard()->text(); + kapp->tqclipboard()->setSelectionMode(true); + TQString text = kapp->tqclipboard()->text(); if (text.isEmpty()) { - kapp->clipboard()->setSelectionMode(false); - text = kapp->clipboard()->text(); + kapp->tqclipboard()->setSelectionMode(false); + text = kapp->tqclipboard()->text(); } match(text); } @@ -308,46 +308,46 @@ bool TopLevel::queryClose() void TopLevel::setupActions() { // file menu... - actSave = KStdAction::save(queryView, TQT_SLOT(saveQuery()), actionCollection()); + actSave = KStdAction::save(TQT_TQOBJECT(queryView), TQT_SLOT(saveQuery()), actionCollection()); actSave->setText(i18n("&Save As...")); actSave->setEnabled(false); - actPrint = KStdAction::print(queryView, TQT_SLOT(printQuery()), actionCollection()); + actPrint = KStdAction::print(TQT_TQOBJECT(queryView), TQT_SLOT(printQuery()), actionCollection()); actPrint->setEnabled(false); - actStartQuery = new KAction(i18n("St&art Query"),"reload", 0 , this, + actStartQuery = new KAction(i18n("St&art Query"),"reload", 0 , TQT_TQOBJECT(this), TQT_SLOT(doDefine()), actionCollection(), "start_query"); - actStopQuery = new KAction(i18n("St&op Query"),"stop", 0 , this, + actStopQuery = new KAction(i18n("St&op Query"),"stop", 0 , TQT_TQOBJECT(this), TQT_SLOT(stopClients()), actionCollection(), "stop_query"); actStopQuery->setEnabled(false); - KStdAction::quit(kapp, TQT_SLOT(closeAllWindows()), actionCollection()); + KStdAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(closeAllWindows()), actionCollection()); // edit menu... - actCopy = KStdAction::copy(queryView, TQT_SLOT(copySelection()), actionCollection()); + actCopy = KStdAction::copy(TQT_TQOBJECT(queryView), TQT_SLOT(copySelection()), actionCollection()); actCopy->setEnabled(false); - KStdAction::selectAll(queryView, TQT_SLOT(selectAll()), actionCollection()); - new KAction(i18n("&Define Clipboard Content"), "define_clip", 0 , this, + KStdAction::selectAll(TQT_TQOBJECT(queryView), TQT_SLOT(selectAll()), actionCollection()); + new KAction(i18n("&Define Clipboard Content"), "define_clip", 0 , TQT_TQOBJECT(this), TQT_SLOT(defineClipboard()), actionCollection(), "define_clipboard"); - new KAction(i18n("&Match Clipboard Content"), 0 , this, + new KAction(i18n("&Match Clipboard Content"), 0 , TQT_TQOBJECT(this), TQT_SLOT(matchClipboard()), actionCollection(), "match_clipboard"); - KStdAction::find(queryView, TQT_SLOT(showFindDialog()), actionCollection()); + KStdAction::find(TQT_TQOBJECT(queryView), TQT_SLOT(showFindDialog()), actionCollection()); // history menu... actBack = new KToolBarPopupAction(i18n("&Back"), "back", KStdAccel::shortcut(KStdAccel::Back), - queryView, TQT_SLOT(browseBack()), actionCollection(),"browse_back"); + TQT_TQOBJECT(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, TQT_SLOT(browseForward()), actionCollection(),"browse_forward"); + TQT_TQOBJECT(queryView), TQT_SLOT(browseForward()), actionCollection(),"browse_forward"); actForward->setDelayed(true); actForward->setStickyMenu(false); actForward->setEnabled(false); - new KAction(i18n("&Clear History"), 0 , this, + new KAction(i18n("&Clear History"), 0 , TQT_TQOBJECT(this), TQT_SLOT(clearQueryHistory()), actionCollection(), "clear_history"); // server menu... new KAction(i18n("&Get Capabilities"), 0 , interface, TQT_SLOT(updateServer()), actionCollection(), "get_capabilities"); - new KAction(i18n("Edit &Database Sets..."), "edit", 0 , this, + new KAction(i18n("Edit &Database Sets..."), "edit", 0 , TQT_TQOBJECT(this), TQT_SLOT(showSetsDialog()), actionCollection(), "edit_sets"); new KAction(i18n("&Summary"), 0 , interface, TQT_SLOT(showDatabases()), actionCollection(), "db_summary"); @@ -360,17 +360,17 @@ void TopLevel::setupActions() createStandardStatusBarAction(); setStandardToolBarMenuEnabled(true); - actShowMatchList = new KToggleAction(i18n("Show &Match List"), 0 , this, + actShowMatchList = new KToggleAction(i18n("Show &Match List"), 0 , TQT_TQOBJECT(this), TQT_SLOT(toggleMatchListShow()), actionCollection(), "show_match"); actShowMatchList->setCheckedState(i18n("Hide &Match List")); actShowMatchList->setChecked(global->showMatchList); KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); - KStdAction::configureToolbars(this, TQT_SLOT(slotConfToolbar()), actionCollection()); - KStdAction::preferences(this, TQT_SLOT(showOptionsDialog()), actionCollection()); + KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(slotConfToolbar()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showOptionsDialog()), actionCollection()); // toolbar... - new KAction(i18n("Clear Input Field"), "query_erase", 0 , this, + new KAction(i18n("Clear Input Field"), "query_erase", 0 , TQT_TQOBJECT(this), TQT_SLOT(clearInput()), actionCollection(), "clear_query"); actQueryLabel = new DictLabelAction(i18n("&Look for:"), actionCollection(), "look_label"); @@ -380,8 +380,8 @@ actionCollection()); actDbLabel = new DictLabelAction(i18n("&in"), actionCollection(), "in_label"); actDbCombo = new DictComboAction(i18n("Databases"), actionCollection(), "db_combo",false,false); 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"); + actDefineBtn = new DictButtonAction(i18n("&Define"), TQT_TQOBJECT(this), TQT_SLOT(doDefine()), actionCollection(), "define_btn"); + actMatchBtn = new DictButtonAction(i18n("&Match"), TQT_TQOBJECT(this), TQT_SLOT(doMatch()), actionCollection(), "match_btn"); queryView->setActions(actBack,actForward,actQueryCombo); } @@ -394,12 +394,12 @@ void TopLevel::setupStatusBar() TQString serverInfo; if (global->authEnabled) - serverInfo = TQString(" %1@%2:%3 ").arg(getShortString(global->user,50)) - .arg(getShortString(global->server,50)) - .arg(global->port); + serverInfo = TQString(" %1@%2:%3 ").tqarg(getShortString(global->user,50)) + .tqarg(getShortString(global->server,50)) + .tqarg(global->port); else - serverInfo = TQString(" %1:%3 ").arg(getShortString(global->server,50)) - .arg(global->port); + serverInfo = TQString(" %1:%3 ").tqarg(getShortString(global->server,50)) + .tqarg(global->port); statusBar()->insertItem(serverInfo, 1,3); statusBar()->setItemAlignment(1,AlignLeft | AlignVCenter); } @@ -503,7 +503,7 @@ 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, TQT_SLOT(queryHistMenu()), + historyActionList.append( new KAction(getShortString(global->queryHistory[i],70), 0, TQT_TQOBJECT(this), TQT_SLOT(queryHistMenu()), (TQObject*)0, global->queryHistory[i].utf8().data()) ); i++; } @@ -515,7 +515,7 @@ void TopLevel::buildHistMenu() // process a query via the history menu void TopLevel::queryHistMenu() { - TQCString name = sender()->name(); + TQCString name = TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name(); if (!name.isEmpty()) define(TQString::fromUtf8(name)); } @@ -542,7 +542,7 @@ void TopLevel::stratDbChanged() dbActionList.clear(); for (unsigned int i=0;i<global->serverDatabases.count();i++) - dbActionList.append( new KAction(global->serverDatabases[i], 0, this, TQT_SLOT(dbInfoMenuClicked()), + dbActionList.append( new KAction(global->serverDatabases[i], 0, TQT_TQOBJECT(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() { - TQCString name = sender()->name(); + TQCString name = TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name(); if (!name.isEmpty()) interface->showDbInfo(name); } @@ -641,7 +641,7 @@ void TopLevel::toggleMatchListShow() else // list is not visible -> show it { global->showMatchList = true; - splitter = new TQSplitter(TQSplitter::Horizontal,this); + splitter = new TQSplitter(Qt::Horizontal,this); splitter->setOpaqueResize( KGlobalSettings::opaqueResize() ); setCentralWidget(splitter); splitter->show(); @@ -746,12 +746,12 @@ void TopLevel::optionsChanged() { TQString serverInfo; if (global->authEnabled) - serverInfo = TQString(" %1@%2:%3 ").arg(getShortString(global->user,50)) - .arg(getShortString(global->server,50)) - .arg(global->port); + serverInfo = TQString(" %1@%2:%3 ").tqarg(getShortString(global->user,50)) + .tqarg(getShortString(global->server,50)) + .tqarg(global->port); else - serverInfo = TQString(" %1:%3 ").arg(getShortString(global->server,50)) - .arg(global->port); + serverInfo = TQString(" %1:%3 ").tqarg(getShortString(global->server,50)) + .tqarg(global->port); statusBar()->changeItem(serverInfo,1); interface->serverChanged(); // inform client queryView->optionsChanged(); // inform html-view |