-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 @@ -69,26 +69,26 @@ OpieFtp::OpieFtp( ) layout->setMargin( 2); connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); QPEMenuBar *menuBar = new QPEMenuBar(this); connectionMenu = new QPopupMenu( this ); localMenu = new QPopupMenu( this ); remoteMenu = new QPopupMenu( this ); - tabMenu = new QPopupMenu( this ); + tabMenu = new QPopupMenu( this ); layout->addMultiCellWidget( menuBar, 0, 0, 0, 3 ); menuBar->insertItem( tr( "Connection" ), connectionMenu); menuBar->insertItem( tr( "Local" ), localMenu); menuBar->insertItem( tr( "Remote" ), remoteMenu); 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() )); localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); localMenu->insertSeparator(); localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); localMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); localMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); @@ -99,18 +99,19 @@ OpieFtp::OpieFtp( ) remoteMenu->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); remoteMenu->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); remoteMenu->insertSeparator(); remoteMenu->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); 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 ); TabWidget->setTabShape(QTabWidget::Triangular); tab = new QWidget( TabWidget, "tab" ); tabLayout = new QGridLayout( tab ); tabLayout->setSpacing( 2); tabLayout->setMargin( 2); @@ -143,24 +144,24 @@ OpieFtp::OpieFtp( ) Remote_View->addColumn( "File",120); Remote_View->addColumn( "Size",-1); Remote_View->setColumnAlignment(1,QListView::AlignRight); Remote_View->addColumn( "Date",-1); Remote_View->setColumnAlignment(2,QListView::AlignRight); Remote_View->setAllColumnsShowFocus(TRUE); 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)), this,SLOT( RemoteListPressed(int, QListViewItem *, const QPoint&, int)) ); 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" ); tabLayout_3 = new QGridLayout( tab_3 ); tabLayout_3->setSpacing( 2); tabLayout_3->setMargin( 2); TextLabel1 = new QLabel( tab_3, "TextLabel1" ); TextLabel1->setText( tr( "Username" ) ); @@ -200,40 +201,40 @@ OpieFtp::OpieFtp( ) remotePath = new QLineEdit( "/", tab_3, "remotePath" ); remotePath->setText( currentRemoteDir = "/"); tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 ); // remotePath->setText( currentRemoteDir = "/home/llornkcor/"); 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 *)), this,SLOT(tabChanged(QWidget*))); currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); currentDir.setPath( QDir::currentDirPath()); // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); currentPathEdit = new QLineEdit( "/", this, "currentPathEdit" ); layout->addMultiCellWidget( currentPathEdit, 3, 3, 0, 3 ); - currentPathEdit->setText( currentDir.canonicalPath()); + currentPathEdit->setText( currentDir.canonicalPath()); connect( currentPathEdit,SIGNAL(returnPressed()),this,SLOT(currentPathEditChanged())); ProgressBar = new QProgressBar( this, "ProgressBar" ); layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 3 ); filterStr="*"; populateLocalView(); } @@ -255,21 +256,30 @@ void OpieFtp::cleanUp() if(file.exists()) file.remove(); } 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); } } void OpieFtp::localUpload() { int fsz; QCopEnvelope ( "QPE/System", "busy()" ); qApp->processEvents(); @@ -848,20 +858,20 @@ void OpieFtp::currentPathEditChanged() } remoteDirList( (const QString &)currentRemoteDir); } } 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); } |