From 968af1d235ac30d737991b269156bee5dc99d318 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 30 Jun 2011 19:37:06 +0000 Subject: TQt4 port knutclient This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knutclient@1238881 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/knutrwvar.cpp | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/knutrwvar.cpp') diff --git a/src/knutrwvar.cpp b/src/knutrwvar.cpp index 20e45bc..3c13400 100755 --- a/src/knutrwvar.cpp +++ b/src/knutrwvar.cpp @@ -28,16 +28,16 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include //#include -KNutRWVar::KNutRWVar(QString* userName, QString* userPassword, const QString uName, const QString password, KNutNet* const initUpsNet, QWidget* parent, const char* name, const bool modal) -: KDialogBase(Plain, i18n("RW variables"),Ok|Cancel|Default,Ok, parent, name, modal, true), m_upsNet(initUpsNet){ +KNutRWVar::KNutRWVar(TQString* userName, TQString* userPassword, const TQString uName, const TQString password, KNutNet* const initUpsNet, TQWidget* tqparent, const char* name, const bool modal) +: KDialogBase(Plain, i18n("RW variables"),Ok|Cancel|Default,Ok, tqparent, name, modal, true), m_upsNet(initUpsNet){ upsVarDef upsVar; // int error; @@ -51,24 +51,24 @@ KNutRWVar::KNutRWVar(QString* userName, QString* userPassword, const QString uNa m_oldUserPassword = userPassword; m_upsConnectOk = true; - QFrame *page = plainPage(); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); - QLabel *label1 = new QLabel (i18n("SET RW VARIABLE"),page,"label1"); - label1->setAlignment(Qt::AlignHCenter); + TQFrame *page = plainPage(); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() ); + TQLabel *label1 = new TQLabel (i18n("SET RW VARIABLE"),page,"label1"); + label1->tqsetAlignment(TQt::AlignHCenter); topLayout->addWidget(label1); - QLabel *label2 = new QLabel (i18n("Variable:"),page,"label2"); + TQLabel *label2 = new TQLabel (i18n("Variable:"),page,"label2"); m_rWVarBox = new KComboBox(page,"rwvarbox"); - QLabel *label3 = new QLabel (i18n("Value:"),page,"label2"); + TQLabel *label3 = new TQLabel (i18n("Value:"),page,"label2"); m_valueVarBox = new KComboBox(page,"valuevarbox"); m_valueVarLine = new KLineEdit(page,"valuevarLine"); m_valueVarLine->hide(); - m_passLayout = new QGridLayout (4,2,5,"passLayout"); - QLabel *labelName = new QLabel (i18n("User name:"),page,"labelName"); - QLabel *labelPassword = new QLabel (i18n("Password:"),page,"labelPassword"); + m_passLayout = new TQGridLayout (4,2,5,"passLayout"); + TQLabel *labelName = new TQLabel (i18n("User name:"),page,"labelName"); + TQLabel *labelPassword = new TQLabel (i18n("Password:"),page,"labelPassword"); m_lineEditName = new KLineEdit( page, "LineEditName" ); m_lineEditPassword = new KLineEdit( page, "LineEditName" ); @@ -87,7 +87,7 @@ KNutRWVar::KNutRWVar(QString* userName, QString* userPassword, const QString uNa m_lineEditPassword->setDisabled(true); } - m_lineEditPassword->setEchoMode(QLineEdit::Password); + m_lineEditPassword->setEchoMode(TQLineEdit::Password); topLayout->addLayout(m_passLayout); @@ -116,11 +116,11 @@ KNutRWVar::KNutRWVar(QString* userName, QString* userPassword, const QString uNa m_valueVarLine->show(); m_upsValueType=true; } - connect (m_rWVarBox,SIGNAL(activated(int)),this,SLOT(slotChangeVar(int))); + connect (m_rWVarBox,TQT_SIGNAL(activated(int)),this,TQT_SLOT(slotChangeVar(int))); } } -int KNutRWVar::findItem(const KComboBox *myBox, const QString text) { +int KNutRWVar::findItem(const KComboBox *myBox, const TQString text) { int n; if ((n=myBox->count())) { @@ -135,7 +135,7 @@ void KNutRWVar::slotDefault () { upsVarDef upsVar; int error; - QString varName = m_rWVarBox->currentText(); + TQString varName = m_rWVarBox->currentText(); if (!( error = m_upsNet->readVars(varName,upsVar))) { if (upsVar.upsValueType) m_valueVarLine->setText(upsVar.upsValue); else m_valueVarBox->setCurrentItem(upsVar.upsValue); @@ -147,7 +147,7 @@ void KNutRWVar::slotDefault () { void KNutRWVar::slotChangeVar(int item) { upsVarDef upsVar; - QString varName = m_rWVarBox->text(item); + TQString varName = m_rWVarBox->text(item); int error = m_upsNet->readVars(varName,upsVar); m_upsValueType=upsVar.upsValueType; if (error || (upsVar.upsValueType)) { @@ -180,7 +180,7 @@ bool KNutRWVar::upsOk (void) { return m_upsConnectOk; } void KNutRWVar::slotOk() { - QString value; + TQString value; int error =0; if (m_upsValueType) value=m_valueVarLine->text(); else value=m_valueVarBox->currentText(); @@ -191,7 +191,7 @@ void KNutRWVar::slotOk() { if (!(error = m_upsNet->setVariable(m_rWVarBox->currentText(), value, m_lineEditName->text(),m_lineEditPassword->text(),false))) { // vzhledem k asynchronimu spracovani asi zbytecne // myUpsNet->getUpsValues(true); - emit signalChangeRWVars(m_rWVarBox->currentText());//emits command for loading of variable and repaint of panel + emit signalChangeRWVars(m_rWVarBox->currentText());//emits command for loading of variable and tqrepaint of panel (*m_oldUserName) = m_lineEditName->text(); (*m_oldUserPassword) = m_lineEditPassword->text(); @@ -204,7 +204,7 @@ void KNutRWVar::slotOk() { // next line isn't needed, maybe // vzhledem k asynchronimu spracovani asi zbytecne // myUpsNet->getUpsValues(true); - emit signalChangeRWVars(m_rWVarBox->currentText()); //emits command for loading of variable and repaint of panel + emit signalChangeRWVars(m_rWVarBox->currentText()); //emits command for loading of variable and tqrepaint of panel accept(); } } -- cgit v1.2.1