-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 6a3a64d..118275b 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp @@ -75,5 +75,5 @@ OpieFtp::OpieFtp( ) localMenu = new QPopupMenu( this ); remoteMenu = new QPopupMenu( this ); - tabMenu = new QPopupMenu( this ); + tabMenu = new QPopupMenu( this ); layout->addMultiCellWidget( menuBar, 0, 0, 0, 3 ); @@ -84,5 +84,5 @@ OpieFtp::OpieFtp( ) menuBar->insertItem( tr( "View" ), tabMenu); - connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); + connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); connectionMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); @@ -105,6 +105,7 @@ OpieFtp::OpieFtp( ) tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); + tabMenu->setCheckable(TRUE); - TabWidget = new QTabWidget( this, "TabWidget" ); + TabWidget = new QTabWidget( this, "TabWidget" ); layout->addMultiCellWidget( TabWidget, 1, 1, 0, 3 ); @@ -149,5 +150,5 @@ OpieFtp::OpieFtp( ) QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); - connect( Remote_View, SIGNAL( doubleClicked( QListViewItem*)), + connect( Remote_View, SIGNAL( doubleClicked( QListViewItem*)), this,SLOT( remoteListClicked(QListViewItem *)) ); connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), @@ -156,5 +157,5 @@ OpieFtp::OpieFtp( ) tabLayout_2->addWidget( Remote_View, 0, 0 ); - TabWidget->insertTab( tab_2, tr( "Remote" ) ); + TabWidget->insertTab( tab_2, tr( "Remote" ) ); tab_3 = new QWidget( TabWidget, "tab_3" ); @@ -206,17 +207,17 @@ OpieFtp::OpieFtp( ) TextLabel4 = new QLabel( tab_3, "TextLabel4" ); TextLabel4->setText( tr( "Port" ) ); - tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 ); + tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 ); - PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" ); + PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" ); PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows ); PortSpinBox->setMaxValue(32786); PortSpinBox->setValue( 4242); // PortSpinBox->setValue( 21); - tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1); + tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1); QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); tabLayout_3->addItem( spacer, 5, 0 ); - TabWidget->insertTab( tab_3, tr( "Config" ) ); + TabWidget->insertTab( tab_3, tr( "Config" ) ); connect(TabWidget,SIGNAL(currentChanged(QWidget *)), @@ -229,5 +230,5 @@ OpieFtp::OpieFtp( ) layout->addMultiCellWidget( currentPathEdit, 3, 3, 0, 3 ); - currentPathEdit->setText( currentDir.canonicalPath()); + currentPathEdit->setText( currentDir.canonicalPath()); connect( currentPathEdit,SIGNAL(returnPressed()),this,SLOT(currentPathEditChanged())); @@ -261,9 +262,18 @@ void OpieFtp::tabChanged(QWidget *w) if (TabWidget->currentPageIndex() == 0) { currentPathEdit->setText( currentDir.canonicalPath()); + tabMenu->setItemChecked(tabMenu->idAt(0),TRUE); + tabMenu->setItemChecked(tabMenu->idAt(1),FALSE); + tabMenu->setItemChecked(tabMenu->idAt(2),FALSE); } if (TabWidget->currentPageIndex() == 1) { currentPathEdit->setText( currentRemoteDir ); + tabMenu->setItemChecked(tabMenu->idAt(1),TRUE); + tabMenu->setItemChecked(tabMenu->idAt(0),FALSE); + tabMenu->setItemChecked(tabMenu->idAt(2),FALSE); } if (TabWidget->currentPageIndex() == 2) { + tabMenu->setItemChecked(tabMenu->idAt(2),TRUE); + tabMenu->setItemChecked(tabMenu->idAt(0),FALSE); + tabMenu->setItemChecked(tabMenu->idAt(1),FALSE); } } @@ -854,14 +864,14 @@ void OpieFtp::currentPathEditChanged() void OpieFtp::switchToLocalTab() { -TabWidget->setCurrentPage(0); + TabWidget->setCurrentPage(0); } void OpieFtp::switchToRemoteTab() { -TabWidget->setCurrentPage(1); + TabWidget->setCurrentPage(1); } void OpieFtp::switchToConfigTab() { -TabWidget->setCurrentPage(2); + TabWidget->setCurrentPage(2); } |