author | llornkcor <llornkcor> | 2002-04-25 18:15:30 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-25 18:15:30 (UTC) |
commit | 42cb3d115a46637f4c46f4b3f3821075a2c18f02 (patch) (unidiff) | |
tree | b11a7aebc1c5282e463e211d89ba64cccf8dae29 /noncore/apps/advancedfm | |
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 | |||
@@ -109,31 +109,32 @@ AdvancedFm::AdvancedFm( ) | |||
109 | layout->addMultiCellWidget( docButton, 0, 0, 5, 5); | 109 | layout->addMultiCellWidget( docButton, 0, 0, 5, 5); |
110 | 110 | ||
111 | homeButton = new QPushButton( Resource::loadIconSet("home"),"",this,"homeButton"); | 111 | homeButton = new QPushButton( Resource::loadIconSet("home"),"",this,"homeButton"); |
112 | homeButton->setFixedSize( QSize( 20, 20 ) ); | 112 | homeButton->setFixedSize( QSize( 20, 20 ) ); |
113 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); | 113 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); |
114 | homeButton->setFlat(TRUE); | 114 | homeButton->setFlat(TRUE); |
115 | layout->addMultiCellWidget( homeButton, 0, 0, 6, 6); | 115 | layout->addMultiCellWidget( homeButton, 0, 0, 6, 6); |
116 | // fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); | 116 | // fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); |
117 | // fileMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); | 117 | // fileMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); |
118 | // fileMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); | 118 | // fileMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); |
119 | 119 | ||
120 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | 120 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); |
121 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | ||
121 | fileMenu->insertSeparator(); | 122 | fileMenu->insertSeparator(); |
122 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); | 123 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); |
123 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); | 124 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); |
124 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); | 125 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); |
125 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | 126 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); |
126 | fileMenu->insertSeparator(); | 127 | fileMenu->insertSeparator(); |
127 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); | 128 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); |
128 | fileMenu->setCheckable(TRUE); | 129 | fileMenu->setCheckable(TRUE); |
129 | 130 | ||
130 | viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); | 131 | viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); |
131 | viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); | 132 | viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); |
132 | viewMenu->insertSeparator(); | 133 | viewMenu->insertSeparator(); |
133 | viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | 134 | viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); |
134 | viewMenu->setCheckable(TRUE); | 135 | viewMenu->setCheckable(TRUE); |
135 | 136 | ||
136 | TabWidget = new QTabWidget( this, "TabWidget" ); | 137 | TabWidget = new QTabWidget( this, "TabWidget" ); |
137 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6); | 138 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6); |
138 | 139 | ||
139 | tab = new QWidget( TabWidget, "tab" ); | 140 | tab = new QWidget( TabWidget, "tab" ); |
@@ -192,31 +193,32 @@ AdvancedFm::AdvancedFm( ) | |||
192 | 193 | ||
193 | // tab_3 = new QWidget( TabWidget, "tab_3" ); | 194 | // tab_3 = new QWidget( TabWidget, "tab_3" ); |
194 | // tabLayout_3 = new QGridLayout( tab_3 ); | 195 | // tabLayout_3 = new QGridLayout( tab_3 ); |
195 | // tabLayout_3->setSpacing( 2); | 196 | // tabLayout_3->setSpacing( 2); |
196 | // tabLayout_3->setMargin( 2); | 197 | // tabLayout_3->setMargin( 2); |
197 | 198 | ||
198 | // OFileSelector *fileSelector; | 199 | // OFileSelector *fileSelector; |
199 | // fileSelector = new OFileSelector(tab_3,0,0,"/","","*"); | 200 | // fileSelector = new OFileSelector(tab_3,0,0,"/","","*"); |
200 | // tabLayout_3->addMultiCellWidget( fileSelector, 0, 0, 0, 3 ); | 201 | // tabLayout_3->addMultiCellWidget( fileSelector, 0, 0, 0, 3 ); |
201 | 202 | ||
202 | // TabWidget->insertTab( tab_3, tr( "Files" ) ); | 203 | // TabWidget->insertTab( tab_3, tr( "Files" ) ); |
203 | 204 | ||
204 | currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 205 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
205 | currentDir.setPath( QDir::currentDirPath()); | 206 | currentDir.setPath( QDir::currentDirPath()); |
206 | 207 | ||
207 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 208 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
208 | currentRemoteDir.setPath( QDir::currentDirPath()); | 209 | currentRemoteDir.setPath( QDir::currentDirPath()); |
209 | 210 | ||
210 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); | 211 | b = TRUE; |
212 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); | ||
211 | currentPathCombo->setEditable(TRUE); | 213 | currentPathCombo->setEditable(TRUE); |
212 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); | 214 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); |
213 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 215 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
214 | 216 | ||
215 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), | 217 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), |
216 | this, SLOT( currentPathComboActivated( const QString & ) ) ); | 218 | this, SLOT( currentPathComboActivated( const QString & ) ) ); |
217 | 219 | ||
218 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), | 220 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), |
219 | this,SLOT(currentPathComboChanged())); | 221 | this,SLOT(currentPathComboChanged())); |
220 | 222 | ||
221 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 223 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
222 | 224 | ||
@@ -1253,18 +1255,41 @@ void AdvancedFm::fileStatus() { | |||
1253 | pclose(fp); | 1255 | pclose(fp); |
1254 | return; | 1256 | return; |
1255 | } else { | 1257 | } else { |
1256 | while ( fgets( line, sizeof line, fp)) { | 1258 | while ( fgets( line, sizeof line, fp)) { |
1257 | outDlg->OutputEdit->append(line); | 1259 | outDlg->OutputEdit->append(line); |
1258 | outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); | 1260 | outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); |
1259 | 1261 | ||
1260 | } | 1262 | } |
1261 | 1263 | ||
1262 | } | 1264 | } |
1263 | } | 1265 | } |
1264 | 1266 | ||
1267 | void AdvancedFm::mkDir() { | ||
1268 | if (TabWidget->currentPageIndex() == 0) | ||
1269 | localMakDir(); | ||
1270 | else | ||
1271 | remoteMakDir(); | ||
1272 | |||
1273 | } | ||
1274 | |||
1275 | void AdvancedFm::rn() { | ||
1276 | if (TabWidget->currentPageIndex() == 0) | ||
1277 | localRename(); | ||
1278 | else | ||
1279 | remoteRename(); | ||
1280 | |||
1281 | } | ||
1282 | |||
1283 | void AdvancedFm::del() { | ||
1284 | if (TabWidget->currentPageIndex() == 0) | ||
1285 | localDelete(); | ||
1286 | else | ||
1287 | remoteDelete(); | ||
1288 | } | ||
1289 | |||
1265 | void AdvancedFm::doAbout() { | 1290 | void AdvancedFm::doAbout() { |
1266 | QMessageBox::message("AdvancedFm","Advanced FileManager\n" | 1291 | QMessageBox::message("AdvancedFm","Advanced FileManager\n" |
1267 | "is copyright 2002 by\n" | 1292 | "is copyright 2002 by\n" |
1268 | "L.J.Potter<llornkcor@handhelds.org>\n" | 1293 | "L.J.Potter<llornkcor@handhelds.org>\n" |
1269 | "and is licensed by the GPL"); | 1294 | "and is licensed by the GPL"); |
1270 | } | 1295 | } |
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 | |||
@@ -55,25 +55,27 @@ public: | |||
55 | QDir currentDir, currentRemoteDir; | 55 | QDir currentDir, currentRemoteDir; |
56 | QComboBox *currentPathCombo; | 56 | QComboBox *currentPathCombo; |
57 | QString filterStr; | 57 | QString filterStr; |
58 | QListViewItem * item; | 58 | QListViewItem * item; |
59 | bool b; | 59 | bool b; |
60 | int currentServerConfig; | 60 | int currentServerConfig; |
61 | protected slots: | 61 | protected slots: |
62 | void showLocalMenu( QListViewItem *); | 62 | void showLocalMenu( QListViewItem *); |
63 | void showRemoteMenu( QListViewItem *); | 63 | void showRemoteMenu( QListViewItem *); |
64 | void doLocalCd(); | 64 | void doLocalCd(); |
65 | void doRemoteCd(); | 65 | void doRemoteCd(); |
66 | // void copy(); | 66 | // void copy(); |
67 | 67 | void mkDir(); | |
68 | void del(); | ||
69 | void rn(); | ||
68 | void populateLocalView(); | 70 | void populateLocalView(); |
69 | void populateRemoteView(); | 71 | void populateRemoteView(); |
70 | void showHidden(); | 72 | void showHidden(); |
71 | void showRemoteHidden(); | 73 | void showRemoteHidden(); |
72 | void writeConfig(); | 74 | void writeConfig(); |
73 | void readConfig(); | 75 | void readConfig(); |
74 | void localListClicked(QListViewItem *); | 76 | void localListClicked(QListViewItem *); |
75 | void remoteListClicked(QListViewItem *); | 77 | void remoteListClicked(QListViewItem *); |
76 | void localListPressed( int, QListViewItem *, const QPoint&, int); | 78 | void localListPressed( int, QListViewItem *, const QPoint&, int); |
77 | void remoteListPressed( int, QListViewItem *, const QPoint&, int); | 79 | void remoteListPressed( int, QListViewItem *, const QPoint&, int); |
78 | void localMakDir(); | 80 | void localMakDir(); |
79 | void localDelete(); | 81 | void localDelete(); |