diff options
Diffstat (limited to 'ksysv/TopWidget.cpp')
-rw-r--r-- | ksysv/TopWidget.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/ksysv/TopWidget.cpp b/ksysv/TopWidget.cpp index 6b2e675..7f33abc 100644 --- a/ksysv/TopWidget.cpp +++ b/ksysv/TopWidget.cpp @@ -1,5 +1,5 @@ /* - Requires the Qt widget libraries, available at no cost at + Requires the TQt widget libraries, available at no cost at http://www.troll.no Copyright (C) 1997-2000 Peter Putzer @@ -87,12 +87,12 @@ #include <tqlabel.h> #include <kstatusbar.h> -namespace Status +namespace tqStatus { enum { Changed, Checklist, Writable }; -} // namespace Status +} // namespace tqStatus KSVTopLevel::KSVTopLevel() : KMainWindow(0, 0L, WStyle_ContextHelp|WDestructiveClose), @@ -113,8 +113,8 @@ KSVTopLevel::KSVTopLevel() mOpenWith (0L), mOpenDefault (0L), - mUndoList (new ActionList (this, "UndoList")), - mRedoList (new ActionList (this, "RedoList")), + mUndoList (new ActionList (TQT_TQOBJECT(this), "UndoList")), + mRedoList (new ActionList (TQT_TQOBJECT(this), "RedoList")), mStartDlg (new ServiceDlg (i18n("Start Service"), i18n("&Choose which service to start:"), this)), @@ -211,18 +211,18 @@ void KSVTopLevel::initActions () KActionCollection* coll = actionCollection(); // setup File menu - mFileRevert = KStdAction::revert (this, TQT_SLOT (slotClearChanges()), coll); + mFileRevert = KStdAction::revert (TQT_TQOBJECT(this), TQT_SLOT (slotClearChanges()), coll); mFileRevert->setText (i18n("Re&vert Configuration")); - mFileLoad = KStdAction::open (this, TQT_SLOT (load()), coll); + mFileLoad = KStdAction::open (TQT_TQOBJECT(this), TQT_SLOT (load()), coll); mFileLoad->setText (i18n ("&Open...")); - mFileSave = KStdAction::save(this, TQT_SLOT(slotAcceptChanges()), coll); + mFileSave = KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(slotAcceptChanges()), coll); mFileSave->setText (i18n("&Save Configuration")); - mFileSaveAs = KStdAction::saveAs (this, TQT_SLOT (saveAs ()), coll); + mFileSaveAs = KStdAction::saveAs (TQT_TQOBJECT(this), TQT_SLOT (saveAs ()), coll); - mFileSaveLog = KStdAction::save (this, TQT_SLOT(slotSaveLog()), coll, "ksysv_save_log"); + mFileSaveLog = KStdAction::save (TQT_TQOBJECT(this), TQT_SLOT(slotSaveLog()), coll, "ksysv_save_log"); mFileSaveLog->setText (i18n("Save &Log...")); mFileSaveLog->setShortcut (Key_L+CTRL); mFileSaveLog->setEnabled (false); @@ -230,29 +230,29 @@ void KSVTopLevel::initActions () // disabled due to complexity // mFilePrint = KStdAction::print (this, TQT_SLOT (print()), coll); - mFilePrintLog = KStdAction::print(this, TQT_SLOT(printLog()), coll, "ksysv_print_log"); + mFilePrintLog = KStdAction::print(TQT_TQOBJECT(this), TQT_SLOT(printLog()), coll, "ksysv_print_log"); mFilePrintLog->setText( i18n("&Print Log...")); mFilePrintLog->setEnabled (false); - mFileQuit = KStdAction::quit(this, TQT_SLOT(close()), coll); + mFileQuit = KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), coll); // setup Edit menu - mEditUndo = KStdAction::undo(this, TQT_SLOT(editUndo()), coll); + mEditUndo = KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(editUndo()), coll); mEditUndo->setEnabled (false); - mEditRedo = KStdAction::redo(this, TQT_SLOT(editRedo()), coll); + mEditRedo = KStdAction::redo(TQT_TQOBJECT(this), TQT_SLOT(editRedo()), coll); mEditUndo->setEnabled (false); - mEditCut = KStdAction::cut(this, TQT_SLOT(editCut()), coll); - mEditCopy = KStdAction::copy(this, TQT_SLOT(editCopy()), coll); - mEditPaste = KStdAction::paste(this, TQT_SLOT(editPaste()), coll); - mPasteAppend = KStdAction::paste (this, TQT_SLOT (pasteAppend()), + mEditCut = KStdAction::cut(TQT_TQOBJECT(this), TQT_SLOT(editCut()), coll); + mEditCopy = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(editCopy()), coll); + mEditPaste = KStdAction::paste(TQT_TQOBJECT(this), TQT_SLOT(editPaste()), coll); + mPasteAppend = KStdAction::paste (TQT_TQOBJECT(this), TQT_SLOT (pasteAppend()), coll, "ksysv_paste_append"); mEditProperties = new KAction (i18n("P&roperties"), 0, - this, TQT_SLOT(properties()), + TQT_TQOBJECT(this), TQT_SLOT(properties()), coll, "ksysv_properties"); mOpenDefault = new KAction (i18n ("&Open"), 0, - this, TQT_SLOT (editService()), + TQT_TQOBJECT(this), TQT_SLOT (editService()), coll, "ksysv_open_service"); mOpenWith = new KActionMenu (i18n ("Open &With"), coll, "ksysv_open_with"); @@ -260,30 +260,30 @@ void KSVTopLevel::initActions () // setup Settings menu createStandardStatusBarAction(); setStandardToolBarMenuEnabled(true); - KStdAction::keyBindings (this, TQT_SLOT(configureKeys()), coll); - KStdAction::configureToolbars (this, TQT_SLOT(configureToolbars()), coll); - KStdAction::saveOptions(this, TQT_SLOT(saveOptions()), coll); - KStdAction::preferences(this, TQT_SLOT(slotShowConfig()), coll); + KStdAction::keyBindings (TQT_TQOBJECT(this), TQT_SLOT(configureKeys()), coll); + KStdAction::configureToolbars (TQT_TQOBJECT(this), TQT_SLOT(configureToolbars()), coll); + KStdAction::saveOptions(TQT_TQOBJECT(this), TQT_SLOT(saveOptions()), coll); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotShowConfig()), coll); mOptionsToggleLog = new KToggleAction (i18n("Show &Log"), "toggle_log", 0, - this, TQT_SLOT (toggleLog()), + TQT_TQOBJECT(this), TQT_SLOT (toggleLog()), coll, "ksysv_toggle_log"); mOptionsToggleLog->setCheckedState(i18n("Hide &Log")); // setup Tools menu mToolsStartService = new KToggleAction (i18n("&Start Service..."), "ksysv_start", 0, - mStartDlg, TQT_SLOT (toggle()), + TQT_TQOBJECT(mStartDlg), TQT_SLOT (toggle()), coll, "ksysv_start_service"); mToolsStopService = new KToggleAction (i18n("&Stop Service..."), "ksysv_stop", 0, - mStopDlg, TQT_SLOT (toggle()), + TQT_TQOBJECT(mStopDlg), TQT_SLOT (toggle()), coll, "ksysv_stop_service"); mToolsRestartService = new KToggleAction (i18n("&Restart Service..."), 0, - mRestartDlg, TQT_SLOT (toggle()), + TQT_TQOBJECT(mRestartDlg), TQT_SLOT (toggle()), coll, "ksysv_restart_service"); mToolsEditService = new KToggleAction (i18n("&Edit Service..."), 0, - mEditDlg, TQT_SLOT (toggle()), + TQT_TQOBJECT(mEditDlg), TQT_SLOT (toggle()), coll, "ksysv_edit_service"); createGUI(xmlFile()); @@ -426,16 +426,16 @@ void KSVTopLevel::initStatusBar() "or ask your sysadmin to install %1 <em>suid</em> or " \ "<em>sgid</em>.</p><p>The latter way is <strong>not</strong> "\ "recommended though, due to security issues.</p>") - .arg (kapp->aboutData()->programName()).arg(kapp->aboutData()->programName())); + .tqarg (kapp->aboutData()->programName()).tqarg(kapp->aboutData()->programName())); - authIconBox->setMinimumSize (authIconBox->minimumSizeHint()); - visBox->setMinimumSize (visBox->minimumSizeHint()); + authIconBox->setMinimumSize (authIconBox->tqminimumSizeHint()); + visBox->setMinimumSize (visBox->tqminimumSizeHint()); status->addWidget (authIconBox, 0, false); - status->insertItem ("", Status::Changed, 100); + status->insertItem ("", tqStatus::Changed, 100); status->addWidget (visBox, 0, true); - status->setItemAlignment (Status::Changed, AlignLeft|AlignVCenter); + status->setItemAlignment (tqStatus::Changed, AlignLeft|AlignVCenter); } void KSVTopLevel::slotShowConfig() @@ -454,7 +454,7 @@ void KSVTopLevel::slotShowConfig() this, TQT_SLOT (updateRunlevelsPath ())); connect (mPreferences, TQT_SIGNAL (updateFonts ()), - mView, TQT_SLOT (repaintRunlevels ())); + mView, TQT_SLOT (tqrepaintRunlevels ())); } // mPreferences->setInitialSize (TQSize (400,300), true); @@ -499,7 +499,7 @@ void KSVTopLevel::saveOptions() void KSVTopLevel::slotUpdateRunning (const TQString& text) { - statusBar()->changeItem(text, Status::Changed); + statusBar()->changeItem(text, tqStatus::Changed); } void KSVTopLevel::editCut() { @@ -508,7 +508,7 @@ void KSVTopLevel::editCut() { if (list && list->currentItem()) { KSVDrag* mime = new KSVDrag (*list->currentItem()->data(), 0L, 0L); - kapp->clipboard()->setData (mime); + kapp->tqclipboard()->setData (mime); KSVData data = *list->currentItem()->data(); delete list->currentItem(); @@ -525,7 +525,7 @@ void KSVTopLevel::editCopy() if (list) { KSVDrag* mime = new KSVDrag (*static_cast<KSVItem*> (list->currentItem()), 0L, 0L); - kapp->clipboard()->setData (mime); + kapp->tqclipboard()->setData (mime); } } @@ -537,7 +537,7 @@ void KSVTopLevel::editPaste() { KSVData data; - if (KSVDrag::decodeNative (kapp->clipboard()->data(), data)) + if (KSVDrag::decodeNative (kapp->tqclipboard()->data(), data)) { KSVAction* action = 0L; @@ -563,7 +563,7 @@ void KSVTopLevel::setChanged (bool val) mFileSave->setEnabled (val); // update statusbar - statusBar()->changeItem(val ? i18n(" Changed") : TQString::null, Status::Changed); + statusBar()->changeItem(val ? i18n(" Changed") : TQString(), tqStatus::Changed); // clear messages statusBar()->clear(); @@ -651,7 +651,7 @@ void KSVTopLevel::print() // .arg (ksv::hostname())); // y += fm.lineSpacing(); -// p.drawText (10, y, TQDateTime::currentDateTime().toString()); +// p.drawText (10, y, TQDateTime::tqcurrentDateTime().toString()); // y += fm.lineSpacing() * 2; // an extra empty line // for (int i = 0; i < ksv::runlevelNumber; ++i) @@ -659,7 +659,7 @@ void KSVTopLevel::print() // p.setFont (TQFont("courier", 16, TQFont::Bold)); // TQFontMetrics fm = p.fontMetrics(); -// p.drawText (10, y, i18n ("Runlevel %1").arg(i)); +// p.drawText (10, y, i18n ("Runlevel %1").tqarg(i)); // y += fm.lineSpacing(); // checkPage @@ -725,7 +725,7 @@ void KSVTopLevel::print() // // if (line.isNull()) // // line = " "; -// // line.replace( TQRegExp("\t"), " " ); +// // line.tqreplace( TQRegExp("\t"), " " ); // // strncpy(buf,line.data(),160); @@ -766,22 +766,22 @@ void KSVTopLevel::printLog() { TQSimpleRichText rheading (i18n("<h1>KDE Sys-V Init Editor Log</h1>"), - TQFont("times"), TQString::null, ksv::styleSheet(), + TQFont("times"), TQString(), ksv::styleSheet(), TQMimeSourceFactory::defaultFactory()); rheading.setWidth (&p, width); int tmp_h = rheading.height(); TQRegion region (0, y, width, tmp_h); - rheading.draw (&p, 0, y, region, colorGroup(), 0L); + rheading.draw (&p, 0, y, region, tqcolorGroup(), 0L); y += tmp_h; - TQSimpleRichText rdate (i18n("<h3>Printed on %1</h3><br/><br/>").arg(KGlobal::locale()->formatDateTime(TQDateTime::currentDateTime())), - TQFont("times"), TQString::null, ksv::styleSheet(), + TQSimpleRichText rdate (i18n("<h3>Printed on %1</h3><br/><br/>").tqarg(KGlobal::locale()->formatDateTime(TQDateTime::tqcurrentDateTime())), + TQFont("times"), TQString(), ksv::styleSheet(), TQMimeSourceFactory::defaultFactory()); rdate.setWidth (&p, width); tmp_h = rdate.height(); TQRegion r2 (0, y, width, tmp_h); - rdate.draw (&p, 0, y, r2, colorGroup(), 0L); + rdate.draw (&p, 0, y, r2, tqcolorGroup(), 0L); y += tmp_h; } @@ -790,7 +790,7 @@ void KSVTopLevel::printLog() { while (y < height) { - TQSimpleRichText rich (*line, TQFont("times"), TQString::null, ksv::styleSheet(), + TQSimpleRichText rich (*line, TQFont("times"), TQString(), ksv::styleSheet(), TQMimeSourceFactory::defaultFactory()); rich.setWidth (&p, width); @@ -799,7 +799,7 @@ void KSVTopLevel::printLog() break; TQRegion region (0, y, width, tmp_h); - rich.draw (&p, 0, y, region, colorGroup(), 0L); + rich.draw (&p, 0, y, region, tqcolorGroup(), 0L); y += tmp_h; ++line; @@ -890,7 +890,7 @@ void KSVTopLevel::dispatchEdit () } else { - TQMimeSource* mime = kapp->clipboard()->data(); + TQMimeSource* mime = kapp->tqclipboard()->data(); if (mime && mime->provides ("application/x-ksysv")) setPaste (true); @@ -938,7 +938,7 @@ void KSVTopLevel::slotSaveLog() s << "KDE System V Init Editor" << endl - << TQDateTime::currentDateTime().toString() + << TQDateTime::tqcurrentDateTime().toString() << endl << endl << mView->log() << endl; |