diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:22:56 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:22:56 +0000 |
commit | 7346aee26bf190a7e70333c40fab4caca847cd27 (patch) | |
tree | 4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /kate/insertcommand/plugin_kateinsertcommand.cpp | |
parent | 23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff) | |
download | tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.tar.gz tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kate/insertcommand/plugin_kateinsertcommand.cpp')
-rw-r--r-- | kate/insertcommand/plugin_kateinsertcommand.cpp | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/kate/insertcommand/plugin_kateinsertcommand.cpp b/kate/insertcommand/plugin_kateinsertcommand.cpp index eadbc02..fb42c3f 100644 --- a/kate/insertcommand/plugin_kateinsertcommand.cpp +++ b/kate/insertcommand/plugin_kateinsertcommand.cpp @@ -18,17 +18,17 @@ #include "plugin_kateinsertcommand.h" #include "plugin_kateinsertcommand.moc" -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qdir.h> -#include <qfile.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qspinbox.h> -#include <qstringlist.h> -#include <qwhatsthis.h> -#include <qwidget.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqspinbox.h> +#include <tqstringlist.h> +#include <tqwhatsthis.h> +#include <tqwidget.h> #include <kaction.h> #include <kanimwidget.h> @@ -57,7 +57,7 @@ class PluginView : public KXMLGUIClient //END //BEGIN PluginKateInsertCommand -PluginKateInsertCommand::PluginKateInsertCommand( QObject* parent, const char* name, const QStringList& ) +PluginKateInsertCommand::PluginKateInsertCommand( TQObject* parent, const char* name, const TQStringList& ) : Kate::Plugin ( (Kate::Application *)parent, name ), kv ( 0 ), sh ( 0 ) @@ -65,7 +65,7 @@ PluginKateInsertCommand::PluginKateInsertCommand( QObject* parent, const char* n config = new KConfig("kateinsertcommandpluginrc"); cmdhist = config->readListEntry("Command History"); wdlg = 0; - workingdir = QDir::currentDirPath(); + workingdir = TQDir::currentDirPath(); } PluginKateInsertCommand::~PluginKateInsertCommand() @@ -84,7 +84,7 @@ void PluginKateInsertCommand::addView(Kate::MainWindow *win) PluginView *view = new PluginView (); (void) new KAction ( i18n("Insert Command..."), "", 0, this, - SLOT( slotInsertCommand() ), view->actionCollection(), + TQT_SLOT( slotInsertCommand() ), view->actionCollection(), "edit_insert_command" ); view->setInstance (new KInstance("kate")); @@ -124,12 +124,12 @@ void PluginKateInsertCommand::slotInsertCommand() kv = application()->activeMainWindow()->viewManager()->activeView(); - QString dir = workingdir; - QString docdir; + TQString dir = workingdir; + TQString docdir; KURL docurl = kv->getDoc()->url(); if (docurl.isLocalFile()) docdir = docurl.directory(); - QString lwd( config->readPathEntry("Last WD") ); + TQString lwd( config->readPathEntry("Last WD") ); switch ( (int)config->readNumEntry("Start In", 0) ) { case 1: @@ -142,18 +142,18 @@ void PluginKateInsertCommand::slotInsertCommand() break; } dialogSettings = config->readNumEntry("Dialog Settings", 0); - CmdPrompt *d = new CmdPrompt((QWidget*)kv, 0, cmdhist, dir, + CmdPrompt *d = new CmdPrompt((TQWidget*)kv, 0, cmdhist, dir, docdir, dialogSettings); if ( d->exec() && ! d->command().isEmpty() ) { if ( ! sh ) { sh = new KShellProcess; - connect ( sh, SIGNAL(receivedStdout(KProcess*, char*, int)), - this, SLOT(slotReceivedStdout(KProcess*, char*, int)) ); - connect ( sh, SIGNAL(receivedStderr(KProcess*, char*, int)), - this, SLOT(slotReceivedStderr(KProcess*, char*, int)) ); - connect ( sh, SIGNAL(processExited(KProcess*)), - this, SLOT(slotProcessExited(KProcess*)) ) ; + connect ( sh, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStdout(KProcess*, char*, int)) ); + connect ( sh, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), + this, TQT_SLOT(slotReceivedStderr(KProcess*, char*, int)) ); + connect ( sh, TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(slotProcessExited(KProcess*)) ) ; } sh->clearArguments(); @@ -169,7 +169,7 @@ void PluginKateInsertCommand::slotInsertCommand() *sh << "cd" << d->wd() << "&&"; config->writePathEntry("Last WD", d->wd()); } - *sh << QFile::encodeName(d->command()); + *sh << TQFile::encodeName(d->command()); sh->start( KProcess::NotifyOnExit, KProcess::All ); // add command to history @@ -207,9 +207,9 @@ void PluginKateInsertCommand::slotAbort() void PluginKateInsertCommand::slotShowWaitDlg() { if ( sh->isRunning() ) { - wdlg = new WaitDlg( (QWidget*)kv, i18n( + wdlg = new WaitDlg( (TQWidget*)kv, i18n( "Executing command:\n%1\n\nPress 'Cancel' to abort.").arg(cmd) ); - connect(wdlg, SIGNAL(cancelClicked()), this, SLOT(slotAbort()) ); + connect(wdlg, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(slotAbort()) ); } if ( sh->isRunning() ) // we may have finished while creating the dialog. wdlg->show(); @@ -222,7 +222,7 @@ void PluginKateInsertCommand::slotShowWaitDlg() void PluginKateInsertCommand::slotReceivedStdout( KProcess* /*p*/, char* text, int len ) { - QString t = QString::fromLocal8Bit ( text ); + TQString t = TQString::fromLocal8Bit ( text ); t.truncate(len); kv->insertText( t ); } @@ -250,12 +250,12 @@ void PluginKateInsertCommand::slotProcessExited( KProcess* p ) //BEGIN PluginConfigPage Kate::PluginConfigPage* PluginKateInsertCommand::configPage (uint, - QWidget *w, const char */*name*/) + TQWidget *w, const char */*name*/) { InsertCommandConfigPage* p = new InsertCommandConfigPage(this, w); initConfigPage( p ); - connect( p, SIGNAL(configPageApplyRequest(InsertCommandConfigPage*)), - this, SLOT(applyConfig(InsertCommandConfigPage*)) ); + connect( p, TQT_SIGNAL(configPageApplyRequest(InsertCommandConfigPage*)), + this, TQT_SLOT(applyConfig(InsertCommandConfigPage*)) ); return (Kate::PluginConfigPage*)p; } @@ -277,20 +277,20 @@ void PluginKateInsertCommand::applyConfig( InsertCommandConfigPage *p ) //BEGIN CmdPrompt // This is a simple dialog to retrieve a command and decide if // stdErr should be included in the text inserted. -CmdPrompt::CmdPrompt(QWidget* parent, +CmdPrompt::CmdPrompt(TQWidget* parent, const char* name, - const QStringList& cmdhist, - const QString& dir, - const QString& /*docdir*/, + const TQStringList& cmdhist, + const TQString& dir, + const TQString& /*docdir*/, int settings) : KDialogBase (parent, name, true, i18n("Insert Command"), Ok|Cancel, Ok, true) { - QWidget *page = new QWidget( this ); + TQWidget *page = new TQWidget( this ); setMainWidget(page); - QVBoxLayout *lo = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *lo = new TQVBoxLayout( page, 0, spacingHint() ); - QLabel *l = new QLabel( i18n("Enter &command:"), page ); + TQLabel *l = new TQLabel( i18n("Enter &command:"), page ); lo->addWidget( l ); cmb_cmd = new KHistoryCombo(true, page); cmb_cmd->setHistoryItems(cmdhist, true); @@ -299,10 +299,10 @@ CmdPrompt::CmdPrompt(QWidget* parent, l->setBuddy(cmb_cmd); cmb_cmd->setFocus(); lo->addWidget(cmb_cmd); - connect( cmb_cmd->lineEdit(),SIGNAL(textChanged ( const QString & )), - this, SLOT( slotTextChanged(const QString &))); + connect( cmb_cmd->lineEdit(),TQT_SIGNAL(textChanged ( const TQString & )), + this, TQT_SLOT( slotTextChanged(const TQString &))); - QLabel *lwd = new QLabel( i18n("Choose &working folder:"), page ); + TQLabel *lwd = new TQLabel( i18n("Choose &working folder:"), page ); lo->addWidget( lwd ); wdreq = new KURLRequester( page ); if ( ! dir.isEmpty() ) @@ -312,23 +312,23 @@ CmdPrompt::CmdPrompt(QWidget* parent, lo->addWidget( wdreq ); //kdDebug()<<"settings: "<<settings<<endl; - cb_insStdErr = new QCheckBox( i18n("Insert Std&Err messages"), page ); + cb_insStdErr = new TQCheckBox( i18n("Insert Std&Err messages"), page ); cb_insStdErr->setChecked(settings & 1); lo->addWidget( cb_insStdErr ); - cb_printCmd = new QCheckBox( i18n("&Print command name"), page ); + cb_printCmd = new TQCheckBox( i18n("&Print command name"), page ); cb_printCmd->setChecked(settings & 2); lo->addWidget( cb_printCmd ); - QWhatsThis::add( cmb_cmd, i18n( + TQWhatsThis::add( cmb_cmd, i18n( "Enter the shell command, the output of which you want inserted into your " "document. Feel free to use a pipe or two if you wish.") ); - QWhatsThis::add( wdreq, i18n( + TQWhatsThis::add( wdreq, i18n( "Sets the working folder of the command. The command executed is 'cd <dir> " "&& <command>'") ); - QWhatsThis::add( cb_insStdErr, i18n( + TQWhatsThis::add( cb_insStdErr, i18n( "Check this if you want the error output from <command> inserted as well.\n" "Some commands, such as locate, print everything to STDERR") ); - QWhatsThis::add( cb_printCmd, i18n( + TQWhatsThis::add( cb_printCmd, i18n( "If you check this, the command string will be printed followed by a " "newline before the output.") ); slotTextChanged(cmb_cmd->lineEdit()->text()); @@ -336,7 +336,7 @@ CmdPrompt::CmdPrompt(QWidget* parent, CmdPrompt::~CmdPrompt() {} -void CmdPrompt::slotTextChanged(const QString &text) +void CmdPrompt::slotTextChanged(const TQString &text) { enableButtonOK( !text.isEmpty()); } @@ -345,16 +345,16 @@ void CmdPrompt::slotTextChanged(const QString &text) //BEGIN WaitDlg implementation // This is a dialog that is displayed while a command is running, // with a cancel button to allow the user to kill the command -WaitDlg::WaitDlg(QWidget* parent, const QString& text, const QString& title) +WaitDlg::WaitDlg(TQWidget* parent, const TQString& text, const TQString& title) : KDialogBase( parent, "wait dialog", true, title, Cancel, Cancel, true ) { - QWidget *page = new QWidget( this ); + TQWidget *page = new TQWidget( this ); setMainWidget( page ); - QHBoxLayout *lo = new QHBoxLayout( page, 0, spacingHint() ); + TQHBoxLayout *lo = new TQHBoxLayout( page, 0, spacingHint() ); - KAnimWidget *aw = new KAnimWidget( QString::fromLatin1("kde"), 48, page ); + KAnimWidget *aw = new KAnimWidget( TQString::fromLatin1("kde"), 48, page ); lo->addWidget(aw); - QLabel *l = new QLabel( text, page ); + TQLabel *l = new TQLabel( text, page ); lo->addWidget( l ); aw->start(); @@ -366,40 +366,40 @@ WaitDlg::~WaitDlg() //BEGIN InsertCommandConfigPage // This is the config page for this plugin. -InsertCommandConfigPage::InsertCommandConfigPage(QObject* /*parent*/, - QWidget *parentWidget) +InsertCommandConfigPage::InsertCommandConfigPage(TQObject* /*parent*/, + TQWidget *parentWidget) : Kate::PluginConfigPage( parentWidget ) { - QVBoxLayout* lo = new QVBoxLayout( this ); + TQVBoxLayout* lo = new TQVBoxLayout( this ); lo->setSpacing(KDialogBase::spacingHint()); // command history length - QHBox *hb1 = new QHBox( this ); + TQHBox *hb1 = new TQHBox( this ); hb1->setSpacing(KDialogBase::spacingHint()); - (void) new QLabel( i18n("Remember"), hb1 ); - sb_cmdhistlen = new QSpinBox( hb1 ); - QLabel *l1 = new QLabel( sb_cmdhistlen, i18n("Co&mmands"), hb1); + (void) new TQLabel( i18n("Remember"), hb1 ); + sb_cmdhistlen = new TQSpinBox( hb1 ); + TQLabel *l1 = new TQLabel( sb_cmdhistlen, i18n("Co&mmands"), hb1); hb1->setStretchFactor(l1, 1); lo->addWidget( hb1 ); // dir history length // initial dir choice - rg_startin = new QButtonGroup( 1, Qt::Horizontal, i18n("Start In"), this ); + rg_startin = new TQButtonGroup( 1, Qt::Horizontal, i18n("Start In"), this ); rg_startin->setRadioButtonExclusive( true ); - (void) new QRadioButton( i18n("Application &working folder"), rg_startin); - (void) new QRadioButton( i18n("&Document folder"), rg_startin); - (void) new QRadioButton( i18n("&Latest used working folder"), rg_startin); + (void) new TQRadioButton( i18n("Application &working folder"), rg_startin); + (void) new TQRadioButton( i18n("&Document folder"), rg_startin); + (void) new TQRadioButton( i18n("&Latest used working folder"), rg_startin); lo->addWidget( rg_startin ); // other? lo->addStretch(1); // look nice // Be helpfull! - QWhatsThis::add( sb_cmdhistlen, i18n( + TQWhatsThis::add( sb_cmdhistlen, i18n( "Sets the number of commands to remember. The command history is saved " "over sessions.") ); - QWhatsThis::add( rg_startin, i18n( + TQWhatsThis::add( rg_startin, i18n( "<qt><p>Decides what is suggested as <em>working folder</em> for the " "command.</p><p><strong>Application Working Folder (default):</strong> " "The folder from which you launched the application hosting the plugin, " |