summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp37
-rw-r--r--noncore/apps/advancedfm/advancedfm.h4
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
@@ -105,39 +105,40 @@ AdvancedFm::AdvancedFm( )
105 docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); 105 docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton");
106 docButton->setFixedSize( QSize( 20, 20 ) ); 106 docButton->setFixedSize( QSize( 20, 20 ) );
107 connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); 107 connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) );
108 docButton->setFlat(TRUE); 108 docButton->setFlat(TRUE);
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" );
140 tabLayout = new QGridLayout( tab ); 141 tabLayout = new QGridLayout( tab );
141 tabLayout->setSpacing( 2); 142 tabLayout->setSpacing( 2);
142 tabLayout->setMargin( 2); 143 tabLayout->setMargin( 2);
143 144
@@ -188,39 +189,40 @@ AdvancedFm::AdvancedFm( )
188 TabWidget->insertTab( tab_2, tr( "2")); 189 TabWidget->insertTab( tab_2, tr( "2"));
189 190
190 connect(TabWidget,SIGNAL(currentChanged(QWidget *)), 191 connect(TabWidget,SIGNAL(currentChanged(QWidget *)),
191 this,SLOT(tabChanged(QWidget*))); 192 this,SLOT(tabChanged(QWidget*)));
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" ); 211b = 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
223 layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); 225 layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6);
224 226
225 filterStr="*"; 227 filterStr="*";
226 b=FALSE; 228 b=FALSE;
@@ -1249,22 +1251,45 @@ void AdvancedFm::fileStatus() {
1249 fp = popen( (const char *) command, "r"); 1251 fp = popen( (const char *) command, "r");
1250 if ( !fp ) { 1252 if ( !fp ) {
1251 qDebug("Could not execute '" + command + "'! err=%d", fp); 1253 qDebug("Could not execute '" + command + "'! err=%d", fp);
1252 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") ); 1254 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") );
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
1267void AdvancedFm::mkDir() {
1268 if (TabWidget->currentPageIndex() == 0)
1269 localMakDir();
1270 else
1271 remoteMakDir();
1272
1273}
1274
1275void AdvancedFm::rn() {
1276 if (TabWidget->currentPageIndex() == 0)
1277 localRename();
1278 else
1279 remoteRename();
1280
1281}
1282
1283void AdvancedFm::del() {
1284 if (TabWidget->currentPageIndex() == 0)
1285 localDelete();
1286 else
1287 remoteDelete();
1288}
1289
1265void AdvancedFm::doAbout() { 1290void 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
@@ -51,33 +51,35 @@ public:
51 51
52 QLineEdit *currentPathEdit; 52 QLineEdit *currentPathEdit;
53 QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu; 53 QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu;
54 QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton; 54 QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton;
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;
61protected slots: 61protected 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();
80 void remoteMakDir(); 82 void remoteMakDir();
81 void remoteDelete(); 83 void remoteDelete();
82/* bool remoteDirList(const QString &); */ 84/* bool remoteDirList(const QString &); */
83/* bool remoteChDir(const QString &); */ 85/* bool remoteChDir(const QString &); */