author | llornkcor <llornkcor> | 2002-04-25 18:15:30 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-25 18:15:30 (UTC) |
commit | 42cb3d115a46637f4c46f4b3f3821075a2c18f02 (patch) (side-by-side diff) | |
tree | b11a7aebc1c5282e463e211d89ba64cccf8dae29 | |
parent | 1568872bbd1c92242d7110fe931da23226ca0c55 (diff) | |
download | opie-42cb3d115a46637f4c46f4b3f3821075a2c18f02.zip opie-42cb3d115a46637f4c46f4b3f3821075a2c18f02.tar.gz opie-42cb3d115a46637f4c46f4b3f3821075a2c18f02.tar.bz2 |
fixed menu items
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 37 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 4 |
2 files changed, 34 insertions, 7 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 1083f23..4289fcf 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -97,55 +97,56 @@ AdvancedFm::AdvancedFm( ) layout->addMultiCellWidget( sdButton , 0, 0, 3, 3); cdUpButton = new QPushButton(Resource::loadIconSet("up"),"",this,"cdUpButton"); cdUpButton ->setFixedSize( QSize( 20, 20 ) ); connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); cdUpButton ->setFlat(TRUE); layout->addMultiCellWidget( cdUpButton , 0, 0, 4, 4); docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); docButton->setFixedSize( QSize( 20, 20 ) ); connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); docButton->setFlat(TRUE); layout->addMultiCellWidget( docButton, 0, 0, 5, 5); homeButton = new QPushButton( Resource::loadIconSet("home"),"",this,"homeButton"); homeButton->setFixedSize( QSize( 20, 20 ) ); connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); homeButton->setFlat(TRUE); layout->addMultiCellWidget( homeButton, 0, 0, 6, 6); // fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); // fileMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); // fileMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); + fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); fileMenu->insertSeparator(); - fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); - fileMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); + fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); + fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); fileMenu->insertSeparator(); - fileMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); + fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); fileMenu->setCheckable(TRUE); viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); viewMenu->insertSeparator(); viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); viewMenu->setCheckable(TRUE); TabWidget = new QTabWidget( this, "TabWidget" ); layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6); tab = new QWidget( TabWidget, "tab" ); tabLayout = new QGridLayout( tab ); tabLayout->setSpacing( 2); tabLayout->setMargin( 2); Local_View = new QListView( tab, "Local_View" ); // Local_View->setResizePolicy( QListView::AutoOneFit ); Local_View->addColumn( tr("File"),130); Local_View->addColumn( tr("Size"),-1); Local_View->setColumnAlignment(1,QListView::AlignRight); Local_View->addColumn( tr("Date"),-1); Local_View->setColumnAlignment(2,QListView::AlignRight); Local_View->setAllColumnsShowFocus(TRUE); @@ -180,55 +181,56 @@ AdvancedFm::AdvancedFm( ) connect( Remote_View, SIGNAL( clicked( 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( "2")); connect(TabWidget,SIGNAL(currentChanged(QWidget *)), this,SLOT(tabChanged(QWidget*))); // tab_3 = new QWidget( TabWidget, "tab_3" ); // tabLayout_3 = new QGridLayout( tab_3 ); // tabLayout_3->setSpacing( 2); // tabLayout_3->setMargin( 2); // OFileSelector *fileSelector; // fileSelector = new OFileSelector(tab_3,0,0,"/","","*"); // tabLayout_3->addMultiCellWidget( fileSelector, 0, 0, 0, 3 ); // TabWidget->insertTab( tab_3, tr( "Files" ) ); - currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); + currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); currentDir.setPath( QDir::currentDirPath()); - currentRemoteDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); + currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); currentRemoteDir.setPath( QDir::currentDirPath()); - currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); +b = TRUE; + currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); currentPathCombo->setEditable(TRUE); layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); connect( currentPathCombo, SIGNAL( activated( const QString & ) ), this, SLOT( currentPathComboActivated( const QString & ) ) ); connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), this,SLOT(currentPathComboChanged())); currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); filterStr="*"; b=FALSE; populateLocalView(); populateRemoteView(); } AdvancedFm::~AdvancedFm() { } @@ -1241,30 +1243,53 @@ void AdvancedFm::fileStatus() { Output *outDlg; outDlg = new Output(this, tr("AdvancedFm Output"),FALSE); outDlg->showMaximized(); outDlg->show(); qApp->processEvents(); FILE *fp; char line[130]; sleep(1); fp = popen( (const char *) command, "r"); if ( !fp ) { qDebug("Could not execute '" + command + "'! err=%d", fp); QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") ); pclose(fp); return; } else { while ( fgets( line, sizeof line, fp)) { outDlg->OutputEdit->append(line); outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); } } } +void AdvancedFm::mkDir() { + if (TabWidget->currentPageIndex() == 0) + localMakDir(); + else + remoteMakDir(); + +} + +void AdvancedFm::rn() { + if (TabWidget->currentPageIndex() == 0) + localRename(); + else + remoteRename(); + +} + +void AdvancedFm::del() { + if (TabWidget->currentPageIndex() == 0) + localDelete(); + else + remoteDelete(); +} + void AdvancedFm::doAbout() { QMessageBox::message("AdvancedFm","Advanced FileManager\n" "is copyright 2002 by\n" "L.J.Potter<llornkcor@handhelds.org>\n" "and is licensed by the GPL"); } diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 30ff28c..a5f26a7 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h @@ -43,49 +43,51 @@ class AdvancedFm : public QMainWindow Q_OBJECT public: AdvancedFm(); ~AdvancedFm(); QTabWidget *TabWidget; QWidget *tab, *tab_2, *tab_3; QListView *Local_View, *Remote_View; QLineEdit *currentPathEdit; QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu; QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton; QDir currentDir, currentRemoteDir; QComboBox *currentPathCombo; QString filterStr; QListViewItem * item; bool b; int currentServerConfig; protected slots: void showLocalMenu( QListViewItem *); void showRemoteMenu( QListViewItem *); void doLocalCd(); void doRemoteCd(); // void copy(); - + void mkDir(); + void del(); + void rn(); void populateLocalView(); void populateRemoteView(); void showHidden(); void showRemoteHidden(); void writeConfig(); void readConfig(); void localListClicked(QListViewItem *); void remoteListClicked(QListViewItem *); void localListPressed( int, QListViewItem *, const QPoint&, int); void remoteListPressed( int, QListViewItem *, const QPoint&, int); void localMakDir(); void localDelete(); void remoteMakDir(); void remoteDelete(); /* bool remoteDirList(const QString &); */ /* bool remoteChDir(const QString &); */ void tabChanged(QWidget*); void cleanUp(); void remoteRename(); void localRename(); void runThis(); void runText(); void filePerms(); void doProperties(); |