diff options
Diffstat (limited to 'src/modules/reguser/wizard.cpp')
-rw-r--r-- | src/modules/reguser/wizard.cpp | 198 |
1 files changed, 99 insertions, 99 deletions
diff --git a/src/modules/reguser/wizard.cpp b/src/modules/reguser/wizard.cpp index 1777621d..8d61617e 100644 --- a/src/modules/reguser/wizard.cpp +++ b/src/modules/reguser/wizard.cpp @@ -32,23 +32,23 @@ #include "kvi_regusersdb.h" #include "kvi_iconmanager.h" #ifdef COMPILE_USE_QT4 -#include <QDesktopWidget> +#include <TQDesktopWidget> #endif -#include <qcheckbox.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qpushbutton.h> -#include <qwidget.h> -#include <qlayout.h> -#include <qvariant.h> -#include <qframe.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqpushbutton.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqvariant.h> +#include <tqframe.h> extern KVIRC_API KviRegisteredUserDataBase * g_pRegisteredUserDataBase; extern KviPointerList<KviRegistrationWizard> * g_pRegistrationWizardList; -KviRegistrationWizard::KviRegistrationWizard(const char * startMask,KviRegisteredUserDataBase * db,QWidget * par,bool bModal) +KviRegistrationWizard::KviRegistrationWizard(const char * startMask,KviRegisteredUserDataBase * db,TQWidget * par,bool bModal) : KviTalWizard(par) { m_pDb = db; @@ -57,22 +57,22 @@ KviRegistrationWizard::KviRegistrationWizard(const char * startMask,KviRegistere m_bModal = bModal; - KviIrcMask mask(startMask ? startMask : "*!*@*"); + KviIrcMask tqmask(startMask ? startMask : "*!*@*"); g_pRegistrationWizardList->append(this); - QGridLayout* m_pPage1Layout; - QGridLayout* m_pPage2Layout; - QGridLayout* m_pPage3Layout; - QGridLayout* m_pPage4Layout; - QGridLayout* m_pPage5Layout; + TQGridLayout* m_pPage1Layout; + TQGridLayout* m_pPage2Layout; + TQGridLayout* m_pPage3Layout; + TQGridLayout* m_pPage4Layout; + TQGridLayout* m_pPage5Layout; - QLabel* TextLabel10_2; - QLabel* TextLabel10; - QLabel* TextLabel10_3; - QLabel* TextLabel10_3_2; + TQLabel* TextLabel10_2; + TQLabel* TextLabel10; + TQLabel* TextLabel10_3; + TQLabel* TextLabel10_3_2; - QFrame * f; + TQFrame * f; // resize( 490, 456 ); setCaption(__tr2qs("User Registration Wizard - KVIrc")); @@ -80,91 +80,91 @@ KviRegistrationWizard::KviRegistrationWizard(const char * startMask,KviRegistere setSizeGripEnabled( TRUE ); - m_pPage1 = new QWidget(this); - m_pPage1Layout = new QGridLayout(m_pPage1); + m_pPage1 = new TQWidget(this); + m_pPage1Layout = new TQGridLayout(m_pPage1); m_pPage1Layout->setSpacing(4); m_pPage1Layout->setMargin(8); - m_pLabel1 = new QLabel(m_pPage1); + m_pLabel1 = new TQLabel(m_pPage1); m_pLabel1->setText(__tr2qs("<p>Welcome to the user registration wizard.<br>This process allows you to add an IRC user to the database and set properties for that user. KVIrc will be (hopefully) able to recognize the user, add him to the notify list, and display the associated avatar.<br><br>First of all, you must insert an <b>entry name or real name</b> for the user you're going to register. The name will be used to identify the database entry and has no specific requirements, it can be a given name, nickname, or just some text to remind you of the real person.<br>Examples: \"George W Bush\", \"Dubya\".\n</p>" )); m_pPage1Layout->addWidget(m_pLabel1, 0, 0); - m_pEditRealName = new QLineEdit(m_pPage1); - //m_pEditRealName->setAlignment(int(QLineEdit::AlignHCenter)); + m_pEditRealName = new TQLineEdit(m_pPage1); + //m_pEditRealName->tqsetAlignment(int(TQLineEdit::AlignHCenter)); m_pPage1Layout->addWidget(m_pEditRealName,1,0); addPage( m_pPage1,__tr2qs("Step 1: Entry Name")); - if(mask.nick() != "*")m_pEditRealName->setText(mask.nick()); + if(tqmask.nick() != "*")m_pEditRealName->setText(tqmask.nick()); - connect(m_pEditRealName,SIGNAL(textChanged(const QString &)),this,SLOT(realNameChanged(const QString &))); + connect(m_pEditRealName,TQT_SIGNAL(textChanged(const TQString &)),this,TQT_SLOT(realNameChanged(const TQString &))); // PAGE 2 - m_pPage2 = new QWidget(this); - m_pPage2Layout = new QGridLayout( m_pPage2 ); + m_pPage2 = new TQWidget(this); + m_pPage2Layout = new TQGridLayout( m_pPage2 ); m_pPage2Layout->setSpacing( 4 ); m_pPage2Layout->setMargin( 8 ); - m_pLabel2 = new QLabel( m_pPage2); - m_pLabel2->setText(__tr2qs("<p>A registered user is identified by one or more <b>IRC masks</b>.<br>A mask must be in the following form:<br><b>nickname!username@hostname</b><br>and can contain wildcard characters '*' and '?'. Be careful in choosing the masks, as they are the only way to verify the identity of a registered user.<br><br>You can enter at most two masks here, if you wish to add more masks, use the \"<b>Edit</b>\" button in the Registered Users dialog. You must enter at least one mask.</p>")); + m_pLabel2 = new TQLabel( m_pPage2); + m_pLabel2->setText(__tr2qs("<p>A registered user is identified by one or more <b>IRC tqmasks</b>.<br>A tqmask must be in the following form:<br><b>nickname!username@hostname</b><br>and can contain wildcard characters '*' and '?'. Be careful in choosing the tqmasks, as they are the only way to verify the identity of a registered user.<br><br>You can enter at most two tqmasks here, if you wish to add more tqmasks, use the \"<b>Edit</b>\" button in the Registered Users dialog. You must enter at least one tqmask.</p>")); m_pPage2Layout->addMultiCellWidget(m_pLabel2,0,0,0,4); //KviStr szMask; - //mask.mask(szMask,11); + //tqmask.tqmask(szMask,11); - //KviIrcMask masktempl(szMask.ptr()); + //KviIrcMask tqmasktempl(szMask.ptr()); - m_pNicknameEdit1 = new QLineEdit(m_pPage2); - m_pNicknameEdit1->setAlignment(Qt::AlignRight); - if(mask.nick() != "*")m_pNicknameEdit1->setText(mask.nick()); - connect(m_pNicknameEdit1,SIGNAL(textChanged(const QString &)),this,SLOT(maskChanged(const QString &))); + m_pNicknameEdit1 = new TQLineEdit(m_pPage2); + m_pNicknameEdit1->tqsetAlignment(TQt::AlignRight); + if(tqmask.nick() != "*")m_pNicknameEdit1->setText(tqmask.nick()); + connect(m_pNicknameEdit1,TQT_SIGNAL(textChanged(const TQString &)),this,TQT_SLOT(tqmaskChanged(const TQString &))); m_pPage2Layout->addWidget( m_pNicknameEdit1, 1, 0 ); - m_pUsernameEdit1 = new QLineEdit(m_pPage2); - m_pUsernameEdit1->setAlignment(Qt::AlignHCenter); - if(mask.hasUser())m_pUsernameEdit1->setText(mask.user()); - connect(m_pUsernameEdit1,SIGNAL(textChanged(const QString &)),this,SLOT(maskChanged(const QString &))); + m_pUsernameEdit1 = new TQLineEdit(m_pPage2); + m_pUsernameEdit1->tqsetAlignment(TQt::AlignHCenter); + if(tqmask.hasUser())m_pUsernameEdit1->setText(tqmask.user()); + connect(m_pUsernameEdit1,TQT_SIGNAL(textChanged(const TQString &)),this,TQT_SLOT(tqmaskChanged(const TQString &))); m_pPage2Layout->addWidget(m_pUsernameEdit1,1,2); - m_pHostEdit1 = new QLineEdit(m_pPage2); - if(mask.hasHost())m_pHostEdit1->setText(mask.host()); - connect(m_pHostEdit1,SIGNAL(textChanged(const QString &)),this,SLOT(maskChanged(const QString &))); + m_pHostEdit1 = new TQLineEdit(m_pPage2); + if(tqmask.hasHost())m_pHostEdit1->setText(tqmask.host()); + connect(m_pHostEdit1,TQT_SIGNAL(textChanged(const TQString &)),this,TQT_SLOT(tqmaskChanged(const TQString &))); m_pPage2Layout->addWidget(m_pHostEdit1,1,4); - m_pNicknameEdit2 = new QLineEdit(m_pPage2); - m_pNicknameEdit2->setAlignment(Qt::AlignRight); + m_pNicknameEdit2 = new TQLineEdit(m_pPage2); + m_pNicknameEdit2->tqsetAlignment(TQt::AlignRight); m_pPage2Layout->addWidget(m_pNicknameEdit2,2,0); - m_pUsernameEdit2 = new QLineEdit(m_pPage2); - m_pUsernameEdit2->setAlignment(Qt::AlignHCenter); + m_pUsernameEdit2 = new TQLineEdit(m_pPage2); + m_pUsernameEdit2->tqsetAlignment(TQt::AlignHCenter); m_pPage2Layout->addWidget(m_pUsernameEdit2,2,2); - m_pHostEdit2 = new QLineEdit(m_pPage2); + m_pHostEdit2 = new TQLineEdit(m_pPage2); m_pPage2Layout->addWidget(m_pHostEdit2,2,4); - TextLabel10_2 = new QLabel(m_pPage2); + TextLabel10_2 = new TQLabel(m_pPage2); TextLabel10_2->setText("<center><b>!</b></center>"); - TextLabel10_2->setAlignment(int(Qt::AlignCenter)); + TextLabel10_2->tqsetAlignment(int(TQt::AlignCenter)); m_pPage2Layout->addWidget(TextLabel10_2,2,1); - TextLabel10 = new QLabel(m_pPage2); + TextLabel10 = new TQLabel(m_pPage2); TextLabel10->setText("<center><b>!</b></center>"); - TextLabel10->setAlignment(int(Qt::AlignCenter)); + TextLabel10->tqsetAlignment(int(TQt::AlignCenter)); m_pPage2Layout->addWidget(TextLabel10,1,1); - TextLabel10_3 = new QLabel(m_pPage2); + TextLabel10_3 = new TQLabel(m_pPage2); TextLabel10_3->setText("<center><b>@</b></center>"); - TextLabel10_3->setAlignment(int(Qt::AlignCenter)); + TextLabel10_3->tqsetAlignment(int(TQt::AlignCenter)); m_pPage2Layout->addWidget(TextLabel10_3,1,3); - TextLabel10_3_2 = new QLabel(m_pPage2); + TextLabel10_3_2 = new TQLabel(m_pPage2); TextLabel10_3_2->setText("<center><b>@</b></center>"); - TextLabel10_3_2->setAlignment(int(Qt::AlignCenter)); + TextLabel10_3_2->tqsetAlignment(int(TQt::AlignCenter)); m_pPage2Layout->addWidget(TextLabel10_3_2,2,3); addPage(m_pPage2,__tr2qs("Step 2: Mask Selection")); @@ -173,17 +173,17 @@ KviRegistrationWizard::KviRegistrationWizard(const char * startMask,KviRegistere - m_pPage3 = new QWidget(this); - m_pPage3Layout = new QGridLayout(m_pPage3); + m_pPage3 = new TQWidget(this); + m_pPage3Layout = new TQGridLayout(m_pPage3); m_pPage3Layout->setSpacing(4); m_pPage3Layout->setMargin(8); - m_pLabel3 = new QLabel(m_pPage3); + m_pLabel3 = new TQLabel(m_pPage3); m_pLabel3->setText(__tr2qs("<p>If you want to store an avatar image for this user, you can set it here. KVIrc will show the avatar in the userlist next to the user's nickname.<br>An avatar can be in any supported image format (PNG is recommended). Keep in mind that KVIrc stores avatars in memory and has to resize them to fit in the userlist, thus it's better to use small, low-resolution images.</p>")); m_pPage3Layout->addWidget(m_pLabel3,0,0); - f = new QFrame(m_pPage3); - f->setFrameStyle(QFrame::HLine | QFrame::Sunken); + f = new TQFrame(m_pPage3); + f->setFrameStyle(TQFrame::HLine | TQFrame::Sunken); m_pPage3Layout->addWidget(f,1,0); m_pAvatar = new KviPixmap(); @@ -197,41 +197,41 @@ KviRegistrationWizard::KviRegistrationWizard(const char * startMask,KviRegistere - m_pPage4 = new QWidget(this); - m_pPage4Layout = new QGridLayout(m_pPage4); + m_pPage4 = new TQWidget(this); + m_pPage4Layout = new TQGridLayout(m_pPage4); m_pPage4Layout->setSpacing(4); m_pPage4Layout->setMargin(8); - m_pLabel4 = new QLabel(m_pPage4); + m_pLabel4 = new TQLabel(m_pPage4); m_pLabel4->setText(__tr2qs("<p>If you want to be notified when this user is online or goes offline, you must specify the list of nicknames that KVIrc will look for.<br><br>You can enter at most two nicknames here, if you wish to add more nicknames, use the \"<b>Edit</b>\" button in the Registered Users dialog.</p>")); m_pPage4Layout->addMultiCellWidget(m_pLabel4,0,0,0,1); - f = new QFrame(m_pPage4); - f->setFrameStyle(QFrame::HLine | QFrame::Sunken); + f = new TQFrame(m_pPage4); + f->setFrameStyle(TQFrame::HLine | TQFrame::Sunken); m_pPage4Layout->addMultiCellWidget(f,1,1,0,1); - m_pNotifyCheck = new QCheckBox(m_pPage4); + m_pNotifyCheck = new TQCheckBox(m_pPage4); m_pNotifyCheck->setText(__tr2qs("Add this user to the notify list")); m_pNotifyCheck->setChecked(false); - connect(m_pNotifyCheck,SIGNAL(toggled(bool)),this,SLOT(notifyCheckToggled(bool))); + connect(m_pNotifyCheck,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(notifyCheckToggled(bool))); m_pPage4Layout->addMultiCellWidget(m_pNotifyCheck,2,2,0,1); - m_pNotifyNickLabel1 = new QLabel(m_pPage4); + m_pNotifyNickLabel1 = new TQLabel(m_pPage4); m_pNotifyNickLabel1->setText(__tr2qs("Nickname:")); m_pPage4Layout->addWidget(m_pNotifyNickLabel1,3,0); - m_pNotifyNickLabel2 = new QLabel(m_pPage4); + m_pNotifyNickLabel2 = new TQLabel(m_pPage4); m_pNotifyNickLabel2->setText(__tr2qs("Nickname 2:")); m_pPage4Layout->addWidget(m_pNotifyNickLabel2,4,0); - m_pNotifyNickEdit1 = new QLineEdit(m_pPage4); - if(mask.nick() != "*")m_pNotifyNickEdit1->setText(mask.nick()); - connect(m_pNotifyNickEdit1,SIGNAL(textChanged(const QString &)),this,SLOT(notifyNickChanged(const QString &))); + m_pNotifyNickEdit1 = new TQLineEdit(m_pPage4); + if(tqmask.nick() != "*")m_pNotifyNickEdit1->setText(tqmask.nick()); + connect(m_pNotifyNickEdit1,TQT_SIGNAL(textChanged(const TQString &)),this,TQT_SLOT(notifyNickChanged(const TQString &))); m_pPage4Layout->addWidget(m_pNotifyNickEdit1,3,1); - m_pNotifyNickEdit2 = new QLineEdit(m_pPage4); - connect(m_pNotifyNickEdit2,SIGNAL(textChanged(const QString &)),this,SLOT(notifyNickChanged(const QString &))); + m_pNotifyNickEdit2 = new TQLineEdit(m_pPage4); + connect(m_pNotifyNickEdit2,TQT_SIGNAL(textChanged(const TQString &)),this,TQT_SLOT(notifyNickChanged(const TQString &))); m_pPage4Layout->addWidget(m_pNotifyNickEdit2,4,1); m_pPage4Layout->setRowStretch(0,1); @@ -242,24 +242,24 @@ KviRegistrationWizard::KviRegistrationWizard(const char * startMask,KviRegistere - m_pPage5 = new QWidget(this); - m_pPage5Layout = new QGridLayout(m_pPage5); + m_pPage5 = new TQWidget(this); + m_pPage5Layout = new TQGridLayout(m_pPage5); m_pPage5Layout->setSpacing(4); m_pPage5Layout->setMargin(8); - m_pTextLabel5 = new QLabel(m_pPage5); + m_pTextLabel5 = new TQLabel(m_pPage5); m_pTextLabel5->setText(__tr2qs("<p>That's it. The user registration has been completed.<br><br>Click \"<b>Finish</b>\" to close this dialog.</p>")); m_pPage5Layout->addWidget(m_pTextLabel5,0,0); addPage(m_pPage5,__tr2qs("Registration Complete")); setFinishEnabled(m_pPage5,true); - QString dummy; - maskChanged(dummy); + TQString dummy; + tqmaskChanged(dummy); realNameChanged(dummy); notifyCheckToggled(false); - setMinimumSize(QSize(350,420)); + setMinimumSize(TQSize(350,420)); // signals and slots connections } @@ -289,7 +289,7 @@ void KviRegistrationWizard::accept() m_pDb = g_pRegisteredUserDataBase; } - QString szName = m_pEditRealName->text(); + TQString szName = m_pEditRealName->text(); KviRegisteredUser * u; @@ -297,7 +297,7 @@ void KviRegistrationWizard::accept() { if(szName.isEmpty()) szName = "user"; - QString szNameOk = szName; + TQString szNameOk = szName; int idx = 1; @@ -305,7 +305,7 @@ void KviRegistrationWizard::accept() u = m_pDb->findUserByName(szNameOk); if(u) { - KviQString::sprintf(szNameOk,"%Q%d",&szNameOk,idx); + KviTQString::sprintf(szNameOk,"%Q%d",&szNameOk,idx); idx++; } } while(u); @@ -326,9 +326,9 @@ void KviRegistrationWizard::accept() return; } - QString m1 = m_pNicknameEdit1->text(); - QString m2 = m_pUsernameEdit1->text(); - QString m3 = m_pHostEdit1->text(); + TQString m1 = m_pNicknameEdit1->text(); + TQString m2 = m_pUsernameEdit1->text(); + TQString m3 = m_pHostEdit1->text(); KviIrcMask * mk = new KviIrcMask(m1,m2,m3); m_pDb->removeMask(*mk); m_pDb->addMask(u,mk); @@ -350,7 +350,7 @@ void KviRegistrationWizard::accept() if(!m_pAvatar->isNull()) { - QString szPath = m_pAvatar->path(); + TQString szPath = m_pAvatar->path(); u->setProperty("avatar",szPath); bSetAvatar = true; } @@ -384,14 +384,14 @@ void KviRegistrationWizard::accept() } -void KviRegistrationWizard::showEvent(QShowEvent *e) +void KviRegistrationWizard::showEvent(TQShowEvent *e) { if(height() < 420)resize(width(),420); move((g_pApp->desktop()->width() - width())/2,(g_pApp->desktop()->height() - height())/2); KviTalWizard::showEvent(e); } -void KviRegistrationWizard::maskChanged(const QString &) +void KviRegistrationWizard::tqmaskChanged(const TQString &) { KviStr tmp1 = m_pNicknameEdit1->text(); KviStr tmp2 = m_pUsernameEdit1->text(); @@ -415,20 +415,20 @@ void KviRegistrationWizard::maskChanged(const QString &) return; } - KviStr mask(KviStr::Format,"%s!%s@%s",tmp1.ptr(),tmp2.ptr(),tmp3.ptr()); + KviStr tqmask(KviStr::Format,"%s!%s@%s",tmp1.ptr(),tmp2.ptr(),tmp3.ptr()); - //KviIrcMask m(mask.ptr()); + //KviIrcMask m(tqmask.ptr()); - setNextEnabled(m_pPage2,mask!="*!*@*"); + setNextEnabled(m_pPage2,tqmask!="*!*@*"); } -void KviRegistrationWizard::realNameChanged(const QString &) +void KviRegistrationWizard::realNameChanged(const TQString &) { - QString tmp = m_pEditRealName->text(); + TQString tmp = m_pEditRealName->text(); setNextEnabled(m_pPage1,!(tmp.isEmpty() || tmp.isNull())); } -void KviRegistrationWizard::notifyNickChanged(const QString &) +void KviRegistrationWizard::notifyNickChanged(const TQString &) { bool bYes = !m_pNotifyCheck->isChecked(); @@ -457,7 +457,7 @@ void KviRegistrationWizard::notifyCheckToggled(bool) m_pNotifyNickLabel1->setEnabled(bYes); m_pNotifyNickLabel2->setEnabled(bYes); - QString dummy; + TQString dummy; notifyNickChanged(dummy); } |