diff options
Diffstat (limited to 'krusader/RemoteMan')
-rw-r--r-- | krusader/RemoteMan/remoteman.cpp | 148 | ||||
-rw-r--r-- | krusader/RemoteMan/remoteman.h | 19 | ||||
-rw-r--r-- | krusader/RemoteMan/remotemanbase.cpp | 184 | ||||
-rw-r--r-- | krusader/RemoteMan/remotemanbase.h | 103 |
4 files changed, 228 insertions, 226 deletions
diff --git a/krusader/RemoteMan/remoteman.cpp b/krusader/RemoteMan/remoteman.cpp index 848bba6..b17be0f 100644 --- a/krusader/RemoteMan/remoteman.cpp +++ b/krusader/RemoteMan/remoteman.cpp @@ -34,43 +34,43 @@ #include "../kicons.h" #include "../resources.h" #include "../krusader.h" -#include <qlineedit.h> +#include <tqlineedit.h> #include <klocale.h> -#include <qpixmap.h> -#include <qspinbox.h> -#include <qmultilineedit.h> -#include <qpushbutton.h> -#include <qstringlist.h> -#include <qmessagebox.h> -#include <qcheckbox.h> +#include <tqpixmap.h> +#include <tqspinbox.h> +#include <tqmultilineedit.h> +#include <tqpushbutton.h> +#include <tqstringlist.h> +#include <tqmessagebox.h> +#include <tqcheckbox.h> #include <kstandarddirs.h> -QString remoteMan::url=QString::null; +TQString remoteMan::url=TQString(); remoteMan::remoteMan() : remoteManBase(0,0,true), currentItem(0) { // Read the connection list from the configuration file and re-create the tree config2tree(); sessions->setCurrentItem(sessions->firstChild()); // some minor fixes, left out of the designer - do again in next version ! - password->setEchoMode(QLineEdit::Password); + password->setEchoMode(TQLineEdit::Password); // ===> should be moved to remoteManBase <===== - connect( hostName, SIGNAL( textChanged(const QString&) ), - this, SLOT( updateConnect(const QString&) ) ); - connect( sessions, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(connection())); - connect( sessions, SIGNAL(returnPressed(QListViewItem *)), this, SLOT(connection())); + connect( hostName, TQT_SIGNAL( textChanged(const TQString&) ), + this, TQT_SLOT( updateConnect(const TQString&) ) ); + connect( sessions, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(connection())); + connect( sessions, TQT_SIGNAL(returnPressed(TQListViewItem *)), this, TQT_SLOT(connection())); // execute the main dialog exec(); } -void remoteMan::expandDecos(QListViewItem* i) { +void remoteMan::expandDecos(TQListViewItem* i) { if (i->text(1)!="SESSION") i->setPixmap(0,LOADICON("folder_open")); } -void remoteMan::collapseDecos(QListViewItem* i) { +void remoteMan::collapseDecos(TQListViewItem* i) { if (i->text(1)!="SESSION") i->setPixmap(0,LOADICON("folder_open")); } // This is the static memeber, you'd want to call this directly ! -QString remoteMan::getHost() { +TQString remoteMan::getHost() { remoteMan *p=new remoteMan(); delete p; return url; @@ -78,13 +78,13 @@ QString remoteMan::getHost() { // adds a new group submenu void remoteMan::addGroup() { - QListViewItem *i=0,*current; + TQListViewItem *i=0,*current; current=sessions->currentItem(); if (!current) // no item is current, or the list is empty (shouldn't happen) - i=new QListViewItem(sessions,i18n("New group"),"GROUP"); // insert into the backplane + i=new TQListViewItem(sessions,i18n("New group"),"GROUP"); // insert into the backplane else if (current->text(1).left(5)=="GROUP") - i=new QListViewItem(current,i18n("New group"),"GROUP"); // insert under the current item + i=new TQListViewItem(current,i18n("New group"),"GROUP"); // insert under the current item else return; // cannot create a new group under an item // set an open folder pixmap for the group i->setPixmap(0,LOADICON("folder_open")); @@ -94,13 +94,13 @@ void remoteMan::addGroup() { // add an actual session void remoteMan::addSession() { - QListViewItem *i=0,*current; + TQListViewItem *i=0,*current; current=sessions->currentItem(); // if we are pointing to a session, then the new session will be - // created under the current session's parent group - if (current->text(1)=="SESSION") current=current->parent(); + // created under the current session's tqparent group + if (current->text(1)=="SESSION") current=current->tqparent(); // create a new item and give it the appropriate pixmap - i=new QListViewItem(current,i18n("New session"),"SESSION"); + i=new TQListViewItem(current,i18n("New session"),"SESSION"); i->setPixmap(0,LOADICON("kr_ftp_new")); // make the new item current and refresh the view sessions->setCurrentItem(i); sessions->ensureItemVisible(i); @@ -119,28 +119,28 @@ void remoteMan::refreshData() { currentItem->setText(8,protocol->currentText()); // we have to check if there's another brother-session with // the same name, if so, we add a <2> to it - QListViewItem *i; - if (currentItem->parent()) i=currentItem->parent()->firstChild(); + TQListViewItem *i; + if (currentItem->tqparent()) i=currentItem->tqparent()->firstChild(); else i=sessions->firstChild(); while (i) { if (i->text(0)==currentItem->text(0) && i!=currentItem) { - QString temp=currentItem->text(0).right(4); + TQString temp=currentItem->text(0).right(4); if (temp.left(1)=="<" && temp.right(1)==">") { int h=temp.mid(1,1).toInt(); int l=temp.mid(2,1).toInt(); if ((++l)==10) { ++h; l=0; } - temp=QString("<%1%2>").arg(h).arg(l); - temp=currentItem->text(0).replace(currentItem->text(0).length()-4,4,temp); + temp=TQString("<%1%2>").tqarg(h).tqarg(l); + temp=currentItem->text(0).tqreplace(currentItem->text(0).length()-4,4,temp); currentItem->setText(0,temp); } else currentItem->setText(0,currentItem->text(0)+"<02>"); - i=currentItem->parent()->firstChild(); + i=currentItem->tqparent()->firstChild(); } else i=i->nextSibling(); } } // here begins the actual function removeBtn->setEnabled(true); // just incase we turned it off last time connectBtn->setEnabled(true); - QListViewItem *current=sessions->currentItem(); + TQListViewItem *current=sessions->currentItem(); if (!current) return; // if no item is current yet if (current->text(1).left(5)=="GROUP") { // disable all that don't belong to a group // first, disable all the fields a user cannot change @@ -188,12 +188,12 @@ void remoteMan::refreshData() { // called when we are changing the session/group name, so that remoteMan // is able to change it in the corrosponding listview at the same time -void remoteMan::updateName(const QString &text) { - QListViewItem *i=sessions->currentItem(); +void remoteMan::updateName(const TQString &text) { + TQListViewItem *i=sessions->currentItem(); i->setText(0,text); } -void remoteMan::updateConnect(const QString &) { +void remoteMan::updateConnect(const TQString &) { // disable connect button if no host name is defined if (hostName->text().simplifyWhiteSpace().isEmpty()) connectBtn->setEnabled(false); @@ -202,39 +202,39 @@ void remoteMan::updateConnect(const QString &) { // take an item, and create a "connection", built of the full // path of folders to the item, seperated by the ` character -QString item2connection(QListViewItem *item) { - QString con=item->text(0); - QListViewItem *iterator=item->parent(); +TQString item2connection(TQListViewItem *item) { + TQString con=item->text(0); + TQListViewItem *iterator=item->tqparent(); while (iterator!=0) { //////////////////////// explanation: /////////////////////////// // since the` char is special to us, we use it to seperate items // in the connection, we cannot allow it to be inside a name, so // we find it (if it exists) and replace it with a ' character - QString temp=iterator->text(0); - int i=temp.find('`'); // are there any ` in the name ? + TQString temp=iterator->text(0); + int i=temp.tqfind('`'); // are there any ` in the name ? while (i>-1) { // if so, change them until none are left - temp.replace(i,1,QChar('\'')); - i=temp.find('`'); + temp.tqreplace(i,1,TQChar('\'')); + i=temp.tqfind('`'); } con=temp+'`'+con; - iterator=iterator->parent(); + iterator=iterator->tqparent(); } return con; } // find an item with a specific path - if the path doesn't exist, create it -QListViewItem* remoteMan::findItem(const QString &name, QListViewItem *p) { - QListViewItem *it; +TQListViewItem* remoteMan::findItem(const TQString &name, TQListViewItem *p) { + TQListViewItem *it; if (name.isEmpty()) return p; // the end of the recursion has been reached!!! if (p==0) it=sessions->firstChild(); else it=p->firstChild(); - int loc=name.find('`'); + int loc=name.tqfind('`'); while (it) { if (it->text(0)==name.left(loc)) break; it=it->nextSibling(); } if (!it) // item has not been found, create it - if (!p) it=new QListViewItem(sessions,name.left(loc),"GROUP"); - else it=new QListViewItem(p,name.left(loc),"GROUP"); + if (!p) it=new TQListViewItem(sessions,name.left(loc),"GROUP"); + else it=new TQListViewItem(p,name.left(loc),"GROUP"); // now, it points to the item we want, so let's go down one level it=findItem(name.mid(loc+1),it); return it; @@ -244,40 +244,40 @@ QListViewItem* remoteMan::findItem(const QString &name, QListViewItem *p) { void remoteMan::config2tree() { // attempt to read the tree from krusader's config file krConfig->setGroup("RemoteMan"); - QStringList lst=krConfig->readListEntry("Connections"); + TQStringList lst=krConfig->readListEntry("Connections"); if (lst.count()<1) { // no such list in the config file - create the basics // add the default groups - QListViewItem *i; - i=new QListViewItem(sessions,i18n("Sessions"),"GROUP!"); + TQListViewItem *i; + i=new TQListViewItem(sessions,i18n("Sessions"),"GROUP!"); // the GROUP text signifies a group (duh), the GROUP! signifies a group // that the user cannot change i->setPixmap(0,LOADICON("folder_open")); sessions->setCurrentItem(i); -//# i=new QListViewItem(sessions,i18n("Samba sessions (comming soon)"),"GROUP!"); +//# i=new TQListViewItem(sessions,i18n("Samba sessions (comming soon)"),"GROUP!"); //# i->setPixmap(0,LOADICON("folder")); return; } // if we got here, we have a connection entry in the config file // let's work on it... - QStringList::Iterator it; - QListViewItem *item=0; + TQStringList::Iterator it; + TQListViewItem *item=0; for( it = lst.begin(); it != lst.end(); ++it ) { - QString t=(*it); // easier to work with + TQString t=(*it); // easier to work with // this part creates the path to the session - int loc=t.findRev('`'); + int loc=t.tqfindRev('`'); if (loc>-1) item=findItem(t.left(loc+1),0); // at this point we have the complete path to the object // let's keep only the item's name t=t.mid(loc+1); // now, we are left with only the session name itself // so, we create it as a son of the active item - QStringList newLst=krConfig->readListEntry(*it); // and fill in + TQStringList newLst=krConfig->readListEntry(*it); // and fill in bool group=(newLst[1]!="SESSION"); - QListViewItem *newItem; + TQListViewItem *newItem; if (item==0) // if this item originating from the backplane - newItem=new QListViewItem(sessions,t,group ? "GROUP" : "SESSION"); + newItem=new TQListViewItem(sessions,t,group ? "GROUP" : "SESSION"); else - newItem=new QListViewItem(item,t,group ? "GROUP" : "SESSION"); + newItem=new TQListViewItem(item,t,group ? "GROUP" : "SESSION"); newItem->setPixmap(0,group ? LOADICON("folder") : LOADICON("kr_ftp_new")); // update a pixmap newItem->setText(0,t); // expand the item, if needed @@ -291,14 +291,14 @@ void remoteMan::config2tree() { void remoteMan::tree2config() { // first, set the stage krConfig->setGroup("RemoteMan"); - QStringList lst; - QListViewItemIterator it(sessions); + TQStringList lst; + TQListViewItemIterator it(sessions); while (it.current()) { // while there are still items in the tree - QString temp=item2connection((it.current())); + TQString temp=item2connection((it.current())); lst.append(temp); // write the connection into the "connection-index" if (it.current()->isOpen()) lst.append("expanded"); else lst.append("collapsed"); - QStringList data; + TQStringList data; for (int i=0; i<9; ++i) data.append((it.current())->text(i)); // write the specific entry into the config file krConfig->writeEntry(temp,data); @@ -311,15 +311,15 @@ void remoteMan::tree2config() { void remoteMan::connection() { // if clicked on a group... - QListViewItem *i=sessions->currentItem(); + TQListViewItem *i=sessions->currentItem(); if (i->text(1)!="SESSION") { i->setOpen(i->isOpen()); return; } // build a url if (anonymous->isChecked()) { - userName->setText(QString::null); - password->setText(QString::null); + userName->setText(TQString()); + password->setText(TQString()); } else { userName->setText(userName->text().simplifyWhiteSpace()); password->setText(password->text().simplifyWhiteSpace()); @@ -331,7 +331,7 @@ void remoteMan::connection() { if ( !remoteDir->text().isEmpty() && remoteDir->text().left(1)!="/") remoteDir->setText("/"+remoteDir->text()); - QString port=""; + TQString port=""; if (protocol->currentText()=="ftp://" && portNum->value()!=21 ) port=":"+portNum->cleanText(); @@ -354,13 +354,13 @@ void remoteMan::connection() { // remove a connection or a group of connections void remoteMan::removeSession() { - QListViewItem *it=sessions->currentItem(); + TQListViewItem *it=sessions->currentItem(); if (!it) return; // don't do anything if no item is selected - switch( QMessageBox::warning( this, i18n("RemoteMan"), + switch( TQMessageBox::warning( this, i18n("RemoteMan"), i18n("Are you sure you want to delete this item ???"), - QMessageBox::Yes, - QMessageBox::No | QMessageBox::Default | QMessageBox::Escape)) { - case QMessageBox::No : return; + TQMessageBox::Yes, + TQMessageBox::No | TQMessageBox::Default | TQMessageBox::Escape)) { + case TQMessageBox::No : return; } // since we're here, the user must have pressed YES, let's delete delete it; @@ -371,14 +371,14 @@ void remoteMan::removeSession() { void remoteMan::accept() { refreshData(); // make sure all is updated tree2config(); // write the sessions to a configuration file - url=QString::null; // this signals getHost() we didn't click CONNECT + url=TQString(); // this signals getHost() we didn't click CONNECT remoteManBase::accept(); // tidy up } void remoteMan::reject() { refreshData(); // make sure all is updated tree2config(); // write the sessions to a configuration file - url=QString::null; // this signals getHost() we didn't click CONNECT + url=TQString(); // this signals getHost() we didn't click CONNECT remoteManBase::reject(); } diff --git a/krusader/RemoteMan/remoteman.h b/krusader/RemoteMan/remoteman.h index 385ef86..9e19347 100644 --- a/krusader/RemoteMan/remoteman.h +++ b/krusader/RemoteMan/remoteman.h @@ -34,37 +34,38 @@ #define REMOTEMAN_H #include "remotemanbase.h" -#include <qlistview.h> +#include <tqlistview.h> class remoteMan : public remoteManBase { Q_OBJECT + TQ_OBJECT public: remoteMan(); - static QString getHost(); // we call remoteMan mainly with this function + static TQString getHost(); // we call remoteMan mainly with this function protected: void config2tree(); // internal void tree2config(); // internal - QListViewItem *findItem(const QString &name, QListViewItem *p); + TQListViewItem *findItem(const TQString &name, TQListViewItem *p); public slots: void addGroup(); void refreshData() ; // called whenver the current session changes - void updateName(const QString&); // update the session/group name in real-time - void updateConnect(const QString&); // enable/disable the connect button in real-time + void updateName(const TQString&); // update the session/group name in real-time + void updateConnect(const TQString&); // enable/disable the connect button in real-time void addSession(); void connection(); void removeSession(); - void expandDecos(QListViewItem*); - void collapseDecos(QListViewItem*); + void expandDecos(TQListViewItem*); + void collapseDecos(TQListViewItem*); protected slots: void accept(); void reject(); private: - QListViewItem *currentItem; - static QString url; + TQListViewItem *currentItem; + static TQString url; }; #endif diff --git a/krusader/RemoteMan/remotemanbase.cpp b/krusader/RemoteMan/remotemanbase.cpp index 2baf3d6..c9256f2 100644 --- a/krusader/RemoteMan/remotemanbase.cpp +++ b/krusader/RemoteMan/remotemanbase.cpp @@ -9,67 +9,67 @@ #include "remotemanbase.h" #include <klocale.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qheader.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qlistview.h> -#include <qmultilineedit.h> -#include <qpushbutton.h> -#include <qspinbox.h> -#include <qlayout.h> -#include <qvariant.h> -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqheader.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqlistview.h> +#include <tqmultilineedit.h> +#include <tqpushbutton.h> +#include <tqspinbox.h> +#include <tqlayout.h> +#include <tqvariant.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> #include <kprotocolinfo.h> /* - * Constructs a remoteManBase which is a child of 'parent', with the + * Constructs a remoteManBase which is a child of 'tqparent', with the * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ -remoteManBase::remoteManBase( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, fl ) +remoteManBase::remoteManBase( TQWidget* tqparent, const char* name, bool modal, WFlags fl ) + : TQDialog( tqparent, name, modal, fl ) { if ( !name ) setName( "remoteManBase" ); resize( 670, 502 ); setCaption( i18n( "RemoteMan: Connection Manager" ) ); setSizeGripEnabled( TRUE ); - remoteManBaseLayout = new QGridLayout( this ); + remoteManBaseLayout = new TQGridLayout( this ); remoteManBaseLayout->setSpacing( 6 ); remoteManBaseLayout->setMargin( 11 ); - Layout23 = new QVBoxLayout; + Layout23 = new TQVBoxLayout; Layout23->setSpacing( 6 ); Layout23->setMargin( 0 ); - TextLabel1 = new QLabel( this, "TextLabel1" ); + TextLabel1 = new TQLabel( this, "TextLabel1" ); TextLabel1->setText( i18n( "Session name:" ) ); Layout23->addWidget( TextLabel1 ); - sessionName = new QLineEdit( this, "sessionName" ); + sessionName = new TQLineEdit( this, "sessionName" ); Layout23->addWidget( sessionName ); remoteManBaseLayout->addLayout( Layout23, 0, 1 ); - Layout12 = new QHBoxLayout; + Layout12 = new TQHBoxLayout; Layout12->setSpacing( 6 ); Layout12->setMargin( 0 ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); Layout12->addItem( spacer ); - moreBtn = new QPushButton( this, "moreBtn" ); + moreBtn = new TQPushButton( this, "moreBtn" ); moreBtn->setText( i18n( "&More" ) ); moreBtn->setAutoDefault( FALSE ); moreBtn->setDefault( FALSE ); Layout12->addWidget( moreBtn ); - closeBtn = new QPushButton( this, "closeBtn" ); + closeBtn = new TQPushButton( this, "closeBtn" ); closeBtn->setText( i18n( "&Close" ) ); closeBtn->setAutoDefault( FALSE ); closeBtn->setDefault( FALSE ); @@ -77,182 +77,182 @@ remoteManBase::remoteManBase( QWidget* parent, const char* name, bool modal, WF remoteManBaseLayout->addMultiCellLayout( Layout12, 7, 7, 0, 1 ); - sessions = new QListView( this, "sessions" ); + sessions = new TQListView( this, "sessions" ); sessions->addColumn( i18n( "Sessions" ) ); sessions->header()->setClickEnabled( FALSE, sessions->header()->count() - 1 ); sessions->header()->setResizeEnabled( FALSE, sessions->header()->count() - 1 ); - sessions->setMinimumSize( QSize( 300, 400 ) ); - sessions->setVScrollBarMode( QListView::AlwaysOn ); - sessions->setHScrollBarMode( QListView::Auto ); + sessions->setMinimumSize( TQSize( 300, 400 ) ); + sessions->setVScrollBarMode( TQListView::AlwaysOn ); + sessions->setHScrollBarMode( TQListView::Auto ); sessions->setRootIsDecorated( TRUE ); remoteManBaseLayout->addMultiCellWidget( sessions, 0, 6, 0, 0 ); - Layout9 = new QVBoxLayout; + Layout9 = new TQVBoxLayout; Layout9->setSpacing( 6 ); Layout9->setMargin( 0 ); - Layout10 = new QGridLayout; + Layout10 = new TQGridLayout; Layout10->setSpacing( 6 ); Layout10->setMargin( 0 ); - TextLabel1_3_3 = new QLabel( this, "TextLabel1_3_3" ); + TextLabel1_3_3 = new TQLabel( this, "TextLabel1_3_3" ); TextLabel1_3_3->setText( i18n( "Password:" ) ); Layout10->addWidget( TextLabel1_3_3, 0, 1 ); - password = new QLineEdit( this, "password" ); + password = new TQLineEdit( this, "password" ); Layout10->addWidget( password, 1, 1 ); - TextLabel1_3 = new QLabel( this, "TextLabel1_3" ); + TextLabel1_3 = new TQLabel( this, "TextLabel1_3" ); TextLabel1_3->setText( i18n( "User name:" ) ); Layout10->addWidget( TextLabel1_3, 0, 0 ); - userName = new QLineEdit( this, "userName" ); + userName = new TQLineEdit( this, "userName" ); Layout10->addWidget( userName, 1, 0 ); Layout9->addLayout( Layout10 ); - anonymous = new QCheckBox( this, "anonymous" ); + anonymous = new TQCheckBox( this, "anonymous" ); anonymous->setText( i18n( "Anonymous" ) ); Layout9->addWidget( anonymous ); remoteManBaseLayout->addLayout( Layout9, 2, 1 ); - Layout26 = new QVBoxLayout; + Layout26 = new TQVBoxLayout; Layout26->setSpacing( 6 ); Layout26->setMargin( 0 ); - TextLabel1_3_2 = new QLabel( this, "TextLabel1_3_2" ); + TextLabel1_3_2 = new TQLabel( this, "TextLabel1_3_2" ); TextLabel1_3_2->setText( i18n( "Remote directory:" ) ); Layout26->addWidget( TextLabel1_3_2 ); - remoteDir = new QLineEdit( this, "remoteDir" ); + remoteDir = new TQLineEdit( this, "remoteDir" ); Layout26->addWidget( remoteDir ); remoteManBaseLayout->addLayout( Layout26, 4, 1 ); - Layout27 = new QVBoxLayout; + Layout27 = new TQVBoxLayout; Layout27->setSpacing( 6 ); Layout27->setMargin( 0 ); - TextLabel1_3_2_2 = new QLabel( this, "TextLabel1_3_2_2" ); + TextLabel1_3_2_2 = new TQLabel( this, "TextLabel1_3_2_2" ); TextLabel1_3_2_2->setText( i18n( "Description:" ) ); Layout27->addWidget( TextLabel1_3_2_2 ); - description = new QMultiLineEdit( this, "description" ); + description = new TQMultiLineEdit( this, "description" ); Layout27->addWidget( description ); remoteManBaseLayout->addLayout( Layout27, 5, 1 ); - layout = new QGridLayout; - layout->setSpacing( 6 ); - layout->setMargin( 0 ); + tqlayout = new TQGridLayout; + tqlayout->setSpacing( 6 ); + tqlayout->setMargin( 0 ); - removeBtn = new QPushButton( this, "removeBtn" ); + removeBtn = new TQPushButton( this, "removeBtn" ); removeBtn->setText( i18n( "&Remove" ) ); removeBtn->setAutoDefault( FALSE ); removeBtn->setDefault( FALSE ); - layout->addWidget( removeBtn, 0, 2 ); + tqlayout->addWidget( removeBtn, 0, 2 ); - connectBtn = new QPushButton( this, "connectBtn" ); + connectBtn = new TQPushButton( this, "connectBtn" ); connectBtn->setText( i18n( "Co&nnect" ) ); connectBtn->setAutoDefault( FALSE ); connectBtn->setDefault( FALSE ); - layout->addMultiCellWidget( connectBtn, 1, 1, 0, 2 ); + tqlayout->addMultiCellWidget( connectBtn, 1, 1, 0, 2 ); - newGroupBtn = new QPushButton( this, "newGroupBtn" ); + newGroupBtn = new TQPushButton( this, "newGroupBtn" ); newGroupBtn->setEnabled( TRUE ); newGroupBtn->setText( i18n( "New &Group" ) ); newGroupBtn->setAutoDefault( FALSE ); newGroupBtn->setDefault( FALSE ); newGroupBtn->setFlat( FALSE ); - layout->addWidget( newGroupBtn, 0, 0 ); + tqlayout->addWidget( newGroupBtn, 0, 0 ); - addBtn = new QPushButton( this, "addBtn" ); + addBtn = new TQPushButton( this, "addBtn" ); addBtn->setEnabled( TRUE ); addBtn->setText( i18n( "New Connec&tion" ) ); addBtn->setAutoDefault( FALSE ); addBtn->setDefault( FALSE ); addBtn->setFlat( FALSE ); - layout->addWidget( addBtn, 0, 1 ); + tqlayout->addWidget( addBtn, 0, 1 ); - remoteManBaseLayout->addLayout( layout, 6, 1 ); + remoteManBaseLayout->addLayout( tqlayout, 6, 1 ); - Layout11 = new QGridLayout; + Layout11 = new TQGridLayout; Layout11->setSpacing( 6 ); Layout11->setMargin( 0 ); - TextLabel1_2 = new QLabel( this, "TextLabel1_2" ); + TextLabel1_2 = new TQLabel( this, "TextLabel1_2" ); TextLabel1_2->setText( i18n( "Host:" ) ); Layout11->addMultiCellWidget( TextLabel1_2, 0, 0, 0, 1 ); - QStringList protocols = KProtocolInfo::protocols(); + TQStringList protocols = KProtocolInfo::protocols(); - protocol = new QComboBox( FALSE, this, "protocol" ); - if( protocols.contains("ftp") ) + protocol = new TQComboBox( FALSE, this, "protocol" ); + if( protocols.tqcontains("ftp") ) protocol->insertItem( i18n( "ftp://" ) ); - if( protocols.contains("smb") ) + if( protocols.tqcontains("smb") ) protocol->insertItem( i18n( "smb://" ) ); - if( protocols.contains("fish") ) + if( protocols.tqcontains("fish") ) protocol->insertItem( i18n( "fish://" )); - if( protocols.contains("sftp") ) + if( protocols.tqcontains("sftp") ) protocol->insertItem( i18n( "sftp://" )); - protocol->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, protocol->sizePolicy().hasHeightForWidth() ) ); + protocol->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, protocol->sizePolicy().hasHeightForWidth() ) ); Layout11->addWidget( protocol, 1, 0 ); - hostName = new QLineEdit( this, "hostName" ); - hostName->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, hostName->sizePolicy().hasHeightForWidth() ) ); - hostName->setMinimumSize( QSize( 0, 0 ) ); + hostName = new TQLineEdit( this, "hostName" ); + hostName->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, hostName->sizePolicy().hasHeightForWidth() ) ); + hostName->setMinimumSize( TQSize( 0, 0 ) ); Layout11->addWidget( hostName, 1, 1 ); - portNum = new QSpinBox( this, "portNum" ); + portNum = new TQSpinBox( this, "portNum" ); portNum->setMaxValue( 99999 ); portNum->setValue( 21 ); Layout11->addWidget( portNum, 1, 2 ); - TextLabel1_2_2 = new QLabel( this, "TextLabel1_2_2" ); + TextLabel1_2_2 = new TQLabel( this, "TextLabel1_2_2" ); TextLabel1_2_2->setText( i18n( "Port: " ) ); Layout11->addWidget( TextLabel1_2_2, 0, 2 ); remoteManBaseLayout->addLayout( Layout11, 1, 1 ); - TextLabel1_4 = new QLabel( this, "TextLabel1_4" ); - QFont TextLabel1_4_font( TextLabel1_4->font() ); + TextLabel1_4 = new TQLabel( this, "TextLabel1_4" ); + TQFont TextLabel1_4_font( TextLabel1_4->font() ); TextLabel1_4_font.setPointSize( 10 ); TextLabel1_4->setFont( TextLabel1_4_font ); TextLabel1_4->setText( i18n( "* Warning: Storing your password is not secure !!!" ) ); - TextLabel1_4->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); + TextLabel1_4->tqsetAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) ); remoteManBaseLayout->addWidget( TextLabel1_4, 3, 1 ); // signals and slots connections - connect( closeBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( addBtn, SIGNAL( clicked() ), this, SLOT( addSession() ) ); - connect( removeBtn, SIGNAL( clicked() ), this, SLOT( removeSession() ) ); - connect( sessions, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( refreshData() ) ); - connect( sessions, SIGNAL( selectionChanged() ), this, SLOT( refreshData() ) ); - connect( sessions, SIGNAL( expanded(QListViewItem*) ), this, SLOT( refreshData() ) ); - connect( sessions, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( refreshData() ) ); - connect( sessions, SIGNAL( mouseButtonClicked(int,QListViewItem*,const -QPoint&,int) ), this, SLOT( refreshData() ) ); - connect( sessions, SIGNAL( collapsed(QListViewItem*) ), this, SLOT( refreshData() ) ); - connect( connectBtn, SIGNAL( clicked() ), this, SLOT( connection() ) ); - connect( sessionName, SIGNAL( textChanged(const QString&) ), this, SLOT( updateName(const QString&) ) ); - connect( newGroupBtn, SIGNAL( clicked() ), this, SLOT( addGroup() ) ); - connect( anonymous, SIGNAL( clicked() ), this, SLOT( refreshData() ) ); - connect( protocol, SIGNAL(activated(int)), this, SLOT(refreshData())); + connect( closeBtn, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) ); + connect( addBtn, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addSession() ) ); + connect( removeBtn, TQT_SIGNAL( clicked() ), this, TQT_SLOT( removeSession() ) ); + connect( sessions, TQT_SIGNAL( selectionChanged(TQListViewItem*) ), this, TQT_SLOT( refreshData() ) ); + connect( sessions, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( refreshData() ) ); + connect( sessions, TQT_SIGNAL( expanded(TQListViewItem*) ), this, TQT_SLOT( refreshData() ) ); + connect( sessions, TQT_SIGNAL( currentChanged(TQListViewItem*) ), this, TQT_SLOT( refreshData() ) ); + connect( sessions, TQT_SIGNAL( mouseButtonClicked(int,TQListViewItem*,const +TQPoint&,int) ), this, TQT_SLOT( refreshData() ) ); + connect( sessions, TQT_SIGNAL( collapsed(TQListViewItem*) ), this, TQT_SLOT( refreshData() ) ); + connect( connectBtn, TQT_SIGNAL( clicked() ), this, TQT_SLOT( connection() ) ); + connect( sessionName, TQT_SIGNAL( textChanged(const TQString&) ), this, TQT_SLOT( updateName(const TQString&) ) ); + connect( newGroupBtn, TQT_SIGNAL( clicked() ), this, TQT_SLOT( addGroup() ) ); + connect( anonymous, TQT_SIGNAL( clicked() ), this, TQT_SLOT( refreshData() ) ); + connect( protocol, TQT_SIGNAL(activated(int)), this, TQT_SLOT(refreshData())); // tab order setTabOrder( sessionName, hostName ); @@ -275,18 +275,18 @@ QPoint&,int) ), this, SLOT( refreshData() ) ); */ remoteManBase::~remoteManBase() { - // no need to delete child widgets, Qt does it all for us + // no need to delete child widgets, TQt does it all for us } /* * Main event handler. Reimplemented to handle application * font changes */ -bool remoteManBase::event( QEvent* ev ) +bool remoteManBase::event( TQEvent* ev ) { - bool ret = QDialog::event( ev ); - if ( ev->type() == QEvent::ApplicationFontChange ) { - QFont TextLabel1_4_font( TextLabel1_4->font() ); + bool ret = TQDialog::event( ev ); + if ( ev->type() == TQEvent::ApplicationFontChange ) { + TQFont TextLabel1_4_font( TextLabel1_4->font() ); TextLabel1_4_font.setPointSize( 10 ); TextLabel1_4->setFont( TextLabel1_4_font ); } @@ -323,9 +323,9 @@ void remoteManBase::removeSession() qWarning( "remoteManBase::removeSession(): Not implemented yet!" ); } -void remoteManBase::updateName(const QString&) +void remoteManBase::updateName(const TQString&) { - qWarning( "remoteManBase::updateName(const QString&): Not implemented yet!" ); + qWarning( "remoteManBase::updateName(const TQString&): Not implemented yet!" ); } #include "remotemanbase.moc" diff --git a/krusader/RemoteMan/remotemanbase.h b/krusader/RemoteMan/remotemanbase.h index 7fcc65e..527cd7c 100644 --- a/krusader/RemoteMan/remotemanbase.h +++ b/krusader/RemoteMan/remotemanbase.h @@ -9,53 +9,54 @@ #ifndef REMOTEMANBASE_H #define REMOTEMANBASE_H -#include <qvariant.h> -#include <qdialog.h> -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QCheckBox; -class QComboBox; -class QLabel; -class QLineEdit; -class QListView; -class QListViewItem; -class QMultiLineEdit; -class QPushButton; -class QSpinBox; +#include <tqvariant.h> +#include <tqdialog.h> +class TQVBoxLayout; +class TQHBoxLayout; +class TQGridLayout; +class TQCheckBox; +class TQComboBox; +class TQLabel; +class TQLineEdit; +class TQListView; +class TQListViewItem; +class TQMultiLineEdit; +class TQPushButton; +class TQSpinBox; -class remoteManBase : public QDialog +class remoteManBase : public TQDialog { Q_OBJECT + TQ_OBJECT public: - remoteManBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + remoteManBase( TQWidget* tqparent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~remoteManBase(); - QLabel* TextLabel1; - QLineEdit* sessionName; - QPushButton* moreBtn; - QPushButton* closeBtn; - QListView* sessions; - QLabel* TextLabel1_3_3; - QLineEdit* password; - QLabel* TextLabel1_3; - QLineEdit* userName; - QCheckBox* anonymous; - QLabel* TextLabel1_3_2; - QLineEdit* remoteDir; - QLabel* TextLabel1_3_2_2; - QMultiLineEdit* description; - QPushButton* removeBtn; - QPushButton* connectBtn; - QPushButton* newGroupBtn; - QPushButton* addBtn; - QLabel* TextLabel1_2; - QComboBox* protocol; - QLineEdit* hostName; - QSpinBox* portNum; - QLabel* TextLabel1_2_2; - QLabel* TextLabel1_4; + TQLabel* TextLabel1; + TQLineEdit* sessionName; + TQPushButton* moreBtn; + TQPushButton* closeBtn; + TQListView* sessions; + TQLabel* TextLabel1_3_3; + TQLineEdit* password; + TQLabel* TextLabel1_3; + TQLineEdit* userName; + TQCheckBox* anonymous; + TQLabel* TextLabel1_3_2; + TQLineEdit* remoteDir; + TQLabel* TextLabel1_3_2_2; + TQMultiLineEdit* description; + TQPushButton* removeBtn; + TQPushButton* connectBtn; + TQPushButton* newGroupBtn; + TQPushButton* addBtn; + TQLabel* TextLabel1_2; + TQComboBox* protocol; + TQLineEdit* hostName; + TQSpinBox* portNum; + TQLabel* TextLabel1_2_2; + TQLabel* TextLabel1_4; public slots: virtual void addSession(); @@ -64,19 +65,19 @@ public slots: virtual void addGroup(); virtual void refreshData(); virtual void removeSession(); - virtual void updateName(const QString&); + virtual void updateName(const TQString&); protected: - QGridLayout* remoteManBaseLayout; - QVBoxLayout* Layout23; - QHBoxLayout* Layout12; - QVBoxLayout* Layout9; - QGridLayout* Layout10; - QVBoxLayout* Layout26; - QVBoxLayout* Layout27; - QGridLayout* layout; - QGridLayout* Layout11; - bool event( QEvent* ); + TQGridLayout* remoteManBaseLayout; + TQVBoxLayout* Layout23; + TQHBoxLayout* Layout12; + TQVBoxLayout* Layout9; + TQGridLayout* Layout10; + TQVBoxLayout* Layout26; + TQVBoxLayout* Layout27; + TQGridLayout* tqlayout; + TQGridLayout* Layout11; + bool event( TQEvent* ); }; #endif // REMOTEMANBASE_H |