summaryrefslogtreecommitdiffstats
path: root/kate/insertcommand
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
commit7346aee26bf190a7e70333c40fab4caca847cd27 (patch)
tree4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /kate/insertcommand
parent23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff)
downloadtdeaddons-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')
-rw-r--r--kate/insertcommand/plugin_kateinsertcommand.cpp132
-rw-r--r--kate/insertcommand/plugin_kateinsertcommand.h52
2 files changed, 92 insertions, 92 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, "
diff --git a/kate/insertcommand/plugin_kateinsertcommand.h b/kate/insertcommand/plugin_kateinsertcommand.h
index c948b38..aa0f904 100644
--- a/kate/insertcommand/plugin_kateinsertcommand.h
+++ b/kate/insertcommand/plugin_kateinsertcommand.h
@@ -33,7 +33,7 @@
#include <klibloader.h>
#include <klocale.h>
#include <kurlrequester.h>
-#include <qcheckbox.h>
+#include <tqcheckbox.h>
class InsertCommandConfigPage;
@@ -57,7 +57,7 @@ class PluginKateInsertCommand : public Kate::Plugin,
Q_OBJECT
public:
- PluginKateInsertCommand( QObject* parent = 0, const char* name = 0, const QStringList& = QStringList() );
+ PluginKateInsertCommand( TQObject* parent = 0, const char* name = 0, const TQStringList& = TQStringList() );
virtual ~PluginKateInsertCommand();
void addView (Kate::MainWindow *win);
@@ -66,14 +66,14 @@ class PluginKateInsertCommand : public Kate::Plugin,
Kate::View *kv;
WaitDlg *wdlg;
- QPtrList<class PluginView> m_views;
+ TQPtrList<class PluginView> m_views;
uint configPages () const { return 1; }
- Kate::PluginConfigPage *configPage (uint , QWidget *w, const char *name=0);
- QString configPageName(uint) const { return i18n("Insert Command"); }
- QString configPageFullName(uint) const {
+ Kate::PluginConfigPage *configPage (uint , TQWidget *w, const char *name=0);
+ TQString configPageName(uint) const { return i18n("Insert Command"); }
+ TQString configPageFullName(uint) const {
return i18n("Configure Insert Command Plugin"); }
- QPixmap configPagePixmap (uint /*number = 0*/,
+ TQPixmap configPagePixmap (uint /*number = 0*/,
int /*size = KIcon::SizeSmall*/) const
{ return 0L; }
@@ -81,9 +81,9 @@ class PluginKateInsertCommand : public Kate::Plugin,
void initConfigPage( InsertCommandConfigPage* );
KShellProcess *sh;
- QString workingdir;
- QString cmd;
- QStringList cmdhist;
+ TQString workingdir;
+ TQString cmd;
+ TQStringList cmdhist;
bool bInsStdErr;
int dialogSettings;
KConfig *config;
@@ -104,35 +104,35 @@ class CmdPrompt : public KDialogBase
{
Q_OBJECT
public:
- CmdPrompt(QWidget* parent=0,
+ CmdPrompt(TQWidget* parent=0,
const char* name=0,
- const QStringList& cmdhist=QStringList(),
- const QString& dir=QString::null,
- const QString& docdir=QString::null,
+ const TQStringList& cmdhist=TQStringList(),
+ const TQString& dir=TQString::null,
+ const TQString& docdir=TQString::null,
int settings=0);
~CmdPrompt();
- QString command()const { return cmb_cmd->currentText(); }
+ TQString command()const { return cmb_cmd->currentText(); }
bool insertStdErr()const { return cb_insStdErr->isChecked(); }
bool printCmd()const { return cb_printCmd->isChecked(); }
- QString wd()const { return wdreq->url(); }
+ TQString wd()const { return wdreq->url(); }
private slots:
- void slotTextChanged(const QString &text);
+ void slotTextChanged(const TQString &text);
private:
KHistoryCombo *cmb_cmd;
KURLRequester *wdreq;
- QCheckBox *cb_insStdErr;
- QCheckBox *cb_printCmd;
+ TQCheckBox *cb_insStdErr;
+ TQCheckBox *cb_printCmd;
};
class WaitDlg : public KDialogBase
{
public:
- WaitDlg(QWidget* parent,
- const QString& text=QString::null,
- const QString& title=i18n("Please Wait"));
+ WaitDlg(TQWidget* parent,
+ const TQString& text=TQString::null,
+ const TQString& title=i18n("Please Wait"));
~WaitDlg();
};
@@ -143,7 +143,7 @@ class InsertCommandConfigPage : public Kate::PluginConfigPage
friend class PluginKateInsertCommand;
public:
- InsertCommandConfigPage(QObject* parent = 0L, QWidget *parentWidget = 0L);
+ InsertCommandConfigPage(TQObject* parent = 0L, TQWidget *parentWidget = 0L);
~InsertCommandConfigPage() {}
/** Reimplemented from Kate::PluginConfigPage
@@ -161,9 +161,9 @@ class InsertCommandConfigPage : public Kate::PluginConfigPage
void configPageInitRequest( InsertCommandConfigPage* );
protected:
- QSpinBox *sb_cmdhistlen;
- //QCheckBox *cb_startindocdir;
- QButtonGroup *rg_startin;
+ TQSpinBox *sb_cmdhistlen;
+ //TQCheckBox *cb_startindocdir;
+ TQButtonGroup *rg_startin;
};
#endif // _PLUGIN_KATE_INSERT_COMMAND_H_