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 | |
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 | |||
@@ -73,186 +73,188 @@ AdvancedFm::AdvancedFm( ) | |||
73 | layout->setMargin( 2); | 73 | layout->setMargin( 2); |
74 | 74 | ||
75 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 75 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
76 | 76 | ||
77 | QPEMenuBar *menuBar = new QPEMenuBar(this); | 77 | QPEMenuBar *menuBar = new QPEMenuBar(this); |
78 | // fileMenu = new QPopupMenu( this ); | 78 | // fileMenu = new QPopupMenu( this ); |
79 | fileMenu = new QPopupMenu( this ); | 79 | fileMenu = new QPopupMenu( this ); |
80 | viewMenu = new QPopupMenu( this ); | 80 | viewMenu = new QPopupMenu( this ); |
81 | 81 | ||
82 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 ); | 82 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 ); |
83 | 83 | ||
84 | menuBar->insertItem( tr( "File" ), fileMenu); | 84 | menuBar->insertItem( tr( "File" ), fileMenu); |
85 | menuBar->insertItem( tr( "View" ), viewMenu); | 85 | menuBar->insertItem( tr( "View" ), viewMenu); |
86 | 86 | ||
87 | cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton"); | 87 | cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton"); |
88 | cfButton ->setFixedSize( QSize( 20, 20 ) ); | 88 | cfButton ->setFixedSize( QSize( 20, 20 ) ); |
89 | connect( cfButton ,SIGNAL(released()),this,SLOT( CFButtonPushed()) ); | 89 | connect( cfButton ,SIGNAL(released()),this,SLOT( CFButtonPushed()) ); |
90 | cfButton->setFlat(TRUE); | 90 | cfButton->setFlat(TRUE); |
91 | layout->addMultiCellWidget( cfButton , 0, 0, 2, 2); | 91 | layout->addMultiCellWidget( cfButton , 0, 0, 2, 2); |
92 | 92 | ||
93 | sdButton = new QPushButton(Resource::loadIconSet("sdmon/sdcard"),"",this,"SDButton"); | 93 | sdButton = new QPushButton(Resource::loadIconSet("sdmon/sdcard"),"",this,"SDButton"); |
94 | sdButton->setFixedSize( QSize( 20, 20 ) ); | 94 | sdButton->setFixedSize( QSize( 20, 20 ) ); |
95 | connect( sdButton ,SIGNAL(released()),this,SLOT( SDButtonPushed()) ); | 95 | connect( sdButton ,SIGNAL(released()),this,SLOT( SDButtonPushed()) ); |
96 | sdButton->setFlat(TRUE); | 96 | sdButton->setFlat(TRUE); |
97 | layout->addMultiCellWidget( sdButton , 0, 0, 3, 3); | 97 | layout->addMultiCellWidget( sdButton , 0, 0, 3, 3); |
98 | 98 | ||
99 | cdUpButton = new QPushButton(Resource::loadIconSet("up"),"",this,"cdUpButton"); | 99 | cdUpButton = new QPushButton(Resource::loadIconSet("up"),"",this,"cdUpButton"); |
100 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); | 100 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); |
101 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); | 101 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); |
102 | cdUpButton ->setFlat(TRUE); | 102 | cdUpButton ->setFlat(TRUE); |
103 | layout->addMultiCellWidget( cdUpButton , 0, 0, 4, 4); | 103 | layout->addMultiCellWidget( cdUpButton , 0, 0, 4, 4); |
104 | 104 | ||
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 | ||
144 | Local_View = new QListView( tab, "Local_View" ); | 145 | Local_View = new QListView( tab, "Local_View" ); |
145 | // Local_View->setResizePolicy( QListView::AutoOneFit ); | 146 | // Local_View->setResizePolicy( QListView::AutoOneFit ); |
146 | Local_View->addColumn( tr("File"),130); | 147 | Local_View->addColumn( tr("File"),130); |
147 | Local_View->addColumn( tr("Size"),-1); | 148 | Local_View->addColumn( tr("Size"),-1); |
148 | Local_View->setColumnAlignment(1,QListView::AlignRight); | 149 | Local_View->setColumnAlignment(1,QListView::AlignRight); |
149 | Local_View->addColumn( tr("Date"),-1); | 150 | Local_View->addColumn( tr("Date"),-1); |
150 | Local_View->setColumnAlignment(2,QListView::AlignRight); | 151 | Local_View->setColumnAlignment(2,QListView::AlignRight); |
151 | Local_View->setAllColumnsShowFocus(TRUE); | 152 | Local_View->setAllColumnsShowFocus(TRUE); |
152 | // Local_View->setMultiSelection( TRUE ); | 153 | // Local_View->setMultiSelection( TRUE ); |
153 | // Local_View->setSelectionMode(QListView::Extended); | 154 | // Local_View->setSelectionMode(QListView::Extended); |
154 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); | 155 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); |
155 | 156 | ||
156 | tabLayout->addWidget( Local_View, 0, 0 ); | 157 | tabLayout->addWidget( Local_View, 0, 0 ); |
157 | 158 | ||
158 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), | 159 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), |
159 | this,SLOT( localListClicked(QListViewItem *)) ); | 160 | this,SLOT( localListClicked(QListViewItem *)) ); |
160 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 161 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
161 | this,SLOT( localListPressed(int, QListViewItem *, const QPoint&, int)) ); | 162 | this,SLOT( localListPressed(int, QListViewItem *, const QPoint&, int)) ); |
162 | 163 | ||
163 | TabWidget->insertTab( tab, tr("1")); | 164 | TabWidget->insertTab( tab, tr("1")); |
164 | 165 | ||
165 | tab_2 = new QWidget( TabWidget, "tab_2" ); | 166 | tab_2 = new QWidget( TabWidget, "tab_2" ); |
166 | tabLayout_2 = new QGridLayout( tab_2 ); | 167 | tabLayout_2 = new QGridLayout( tab_2 ); |
167 | tabLayout_2->setSpacing( 2); | 168 | tabLayout_2->setSpacing( 2); |
168 | tabLayout_2->setMargin( 2); | 169 | tabLayout_2->setMargin( 2); |
169 | 170 | ||
170 | Remote_View = new QListView( tab_2, "Remote_View" ); | 171 | Remote_View = new QListView( tab_2, "Remote_View" ); |
171 | Remote_View->addColumn( tr("File"),130); | 172 | Remote_View->addColumn( tr("File"),130); |
172 | Remote_View->addColumn( tr("Size"),-1); | 173 | Remote_View->addColumn( tr("Size"),-1); |
173 | Remote_View->setColumnAlignment(1,QListView::AlignRight); | 174 | Remote_View->setColumnAlignment(1,QListView::AlignRight); |
174 | Remote_View->addColumn( tr("Date"),-1); | 175 | Remote_View->addColumn( tr("Date"),-1); |
175 | Remote_View->setColumnAlignment(2,QListView::AlignRight); | 176 | Remote_View->setColumnAlignment(2,QListView::AlignRight); |
176 | Remote_View->setAllColumnsShowFocus(TRUE); | 177 | Remote_View->setAllColumnsShowFocus(TRUE); |
177 | // Remote_View->setMultiSelection( TRUE ); | 178 | // Remote_View->setMultiSelection( TRUE ); |
178 | // Remote_View->setSelectionMode(QListView::Extended); | 179 | // Remote_View->setSelectionMode(QListView::Extended); |
179 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); | 180 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); |
180 | 181 | ||
181 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), | 182 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), |
182 | this,SLOT( remoteListClicked(QListViewItem *)) ); | 183 | this,SLOT( remoteListClicked(QListViewItem *)) ); |
183 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 184 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
184 | this,SLOT( remoteListPressed(int, QListViewItem *, const QPoint&, int)) ); | 185 | this,SLOT( remoteListPressed(int, QListViewItem *, const QPoint&, int)) ); |
185 | 186 | ||
186 | tabLayout_2->addWidget( Remote_View, 0, 0 ); | 187 | tabLayout_2->addWidget( Remote_View, 0, 0 ); |
187 | 188 | ||
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" ); | 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 | ||
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; |
227 | populateLocalView(); | 229 | populateLocalView(); |
228 | populateRemoteView(); | 230 | populateRemoteView(); |
229 | } | 231 | } |
230 | 232 | ||
231 | AdvancedFm::~AdvancedFm() | 233 | AdvancedFm::~AdvancedFm() |
232 | { | 234 | { |
233 | } | 235 | } |
234 | 236 | ||
235 | void AdvancedFm::cleanUp() | 237 | void AdvancedFm::cleanUp() |
236 | { | 238 | { |
237 | QString sfile=QDir::homeDirPath(); | 239 | QString sfile=QDir::homeDirPath(); |
238 | if(sfile.right(1) != "/") | 240 | if(sfile.right(1) != "/") |
239 | sfile+="/._temp"; | 241 | sfile+="/._temp"; |
240 | else | 242 | else |
241 | sfile+="._temp"; | 243 | sfile+="._temp"; |
242 | QFile file( sfile); | 244 | QFile file( sfile); |
243 | if(file.exists()) | 245 | if(file.exists()) |
244 | file.remove(); | 246 | file.remove(); |
245 | } | 247 | } |
246 | 248 | ||
247 | void AdvancedFm::tabChanged(QWidget *w) | 249 | void AdvancedFm::tabChanged(QWidget *w) |
248 | { | 250 | { |
249 | if (TabWidget->currentPageIndex() == 0) { | 251 | if (TabWidget->currentPageIndex() == 0) { |
250 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 252 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
251 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); | 253 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); |
252 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); | 254 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); |
253 | } | 255 | } |
254 | if (TabWidget->currentPageIndex() == 1) { | 256 | if (TabWidget->currentPageIndex() == 1) { |
255 | currentPathCombo->lineEdit()->setText( currentRemoteDir.canonicalPath()); | 257 | currentPathCombo->lineEdit()->setText( currentRemoteDir.canonicalPath()); |
256 | viewMenu->setItemChecked(viewMenu->idAt(1),TRUE); | 258 | viewMenu->setItemChecked(viewMenu->idAt(1),TRUE); |
257 | viewMenu->setItemChecked(viewMenu->idAt(0),FALSE); | 259 | viewMenu->setItemChecked(viewMenu->idAt(0),FALSE); |
258 | } | 260 | } |
@@ -1217,54 +1219,77 @@ void AdvancedFm::runCommandStd() { | |||
1217 | curFile = currentRemoteDir.canonicalPath() + Remote_View->currentItem()->text(0); | 1219 | curFile = currentRemoteDir.canonicalPath() + Remote_View->currentItem()->text(0); |
1218 | } | 1220 | } |
1219 | 1221 | ||
1220 | InputDialog *fileDlg; | 1222 | InputDialog *fileDlg; |
1221 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | 1223 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); |
1222 | fileDlg->setInputText(curFile); | 1224 | fileDlg->setInputText(curFile); |
1223 | fileDlg->exec(); | 1225 | fileDlg->exec(); |
1224 | QString command; | 1226 | QString command; |
1225 | if( fileDlg->result() == 1 ) { | 1227 | if( fileDlg->result() == 1 ) { |
1226 | qApp->processEvents(); | 1228 | qApp->processEvents(); |
1227 | command = fileDlg->LineEdit1->text() + " &"; | 1229 | command = fileDlg->LineEdit1->text() + " &"; |
1228 | system(command.latin1()); | 1230 | system(command.latin1()); |
1229 | } | 1231 | } |
1230 | } | 1232 | } |
1231 | 1233 | ||
1232 | void AdvancedFm::fileStatus() { | 1234 | void AdvancedFm::fileStatus() { |
1233 | QString curFile; | 1235 | QString curFile; |
1234 | if (TabWidget->currentPageIndex() == 0) { | 1236 | if (TabWidget->currentPageIndex() == 0) { |
1235 | curFile = Local_View->currentItem()->text(0); | 1237 | curFile = Local_View->currentItem()->text(0); |
1236 | } else { | 1238 | } else { |
1237 | curFile = Remote_View->currentItem()->text(0); | 1239 | curFile = Remote_View->currentItem()->text(0); |
1238 | } | 1240 | } |
1239 | QString command = " stat -l "+ curFile +" 2>&1"; | 1241 | QString command = " stat -l "+ curFile +" 2>&1"; |
1240 | int err=0; | 1242 | int err=0; |
1241 | Output *outDlg; | 1243 | Output *outDlg; |
1242 | outDlg = new Output(this, tr("AdvancedFm Output"),FALSE); | 1244 | outDlg = new Output(this, tr("AdvancedFm Output"),FALSE); |
1243 | outDlg->showMaximized(); | 1245 | outDlg->showMaximized(); |
1244 | outDlg->show(); | 1246 | outDlg->show(); |
1245 | qApp->processEvents(); | 1247 | qApp->processEvents(); |
1246 | FILE *fp; | 1248 | FILE *fp; |
1247 | char line[130]; | 1249 | char line[130]; |
1248 | sleep(1); | 1250 | sleep(1); |
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 | ||
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 | |||
@@ -19,97 +19,99 @@ | |||
19 | #include <qstring.h> | 19 | #include <qstring.h> |
20 | #include <qpoint.h> | 20 | #include <qpoint.h> |
21 | 21 | ||
22 | class QVBoxLayout; | 22 | class QVBoxLayout; |
23 | class QHBoxLayout; | 23 | class QHBoxLayout; |
24 | class QGridLayout; | 24 | class QGridLayout; |
25 | class QComboBox; | 25 | class QComboBox; |
26 | class QListView; | 26 | class QListView; |
27 | class QListviewItem; | 27 | class QListviewItem; |
28 | class QLabel; | 28 | class QLabel; |
29 | class QProgressBar; | 29 | class QProgressBar; |
30 | class QSpinBox; | 30 | class QSpinBox; |
31 | class QTabWidget; | 31 | class QTabWidget; |
32 | class QWidget; | 32 | class QWidget; |
33 | class QPEToolBar; | 33 | class QPEToolBar; |
34 | class QPEMenuBar; | 34 | class QPEMenuBar; |
35 | class QPopupMenu; | 35 | class QPopupMenu; |
36 | class QFile; | 36 | class QFile; |
37 | class QListViewItem; | 37 | class QListViewItem; |
38 | class QLineEdit; | 38 | class QLineEdit; |
39 | class QPushButton; | 39 | class QPushButton; |
40 | 40 | ||
41 | class AdvancedFm : public QMainWindow | 41 | class AdvancedFm : public QMainWindow |
42 | { | 42 | { |
43 | Q_OBJECT | 43 | Q_OBJECT |
44 | public: | 44 | public: |
45 | AdvancedFm(); | 45 | AdvancedFm(); |
46 | ~AdvancedFm(); | 46 | ~AdvancedFm(); |
47 | 47 | ||
48 | QTabWidget *TabWidget; | 48 | QTabWidget *TabWidget; |
49 | QWidget *tab, *tab_2, *tab_3; | 49 | QWidget *tab, *tab_2, *tab_3; |
50 | QListView *Local_View, *Remote_View; | 50 | QListView *Local_View, *Remote_View; |
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; |
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(); |
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 &); */ |
84 | void tabChanged(QWidget*); | 86 | void tabChanged(QWidget*); |
85 | void cleanUp(); | 87 | void cleanUp(); |
86 | void remoteRename(); | 88 | void remoteRename(); |
87 | void localRename(); | 89 | void localRename(); |
88 | void runThis(); | 90 | void runThis(); |
89 | void runText(); | 91 | void runText(); |
90 | void filePerms(); | 92 | void filePerms(); |
91 | void doProperties(); | 93 | void doProperties(); |
92 | void runCommand(); | 94 | void runCommand(); |
93 | void runCommandStd(); | 95 | void runCommandStd(); |
94 | QString getPath(); | 96 | QString getPath(); |
95 | void switchToLocalTab(); | 97 | void switchToLocalTab(); |
96 | void switchToRemoteTab(); | 98 | void switchToRemoteTab(); |
97 | 99 | ||
98 | protected: | 100 | protected: |
99 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; | 101 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; |
100 | QStringList remoteDirPathStringList, localDirPathStringList; | 102 | QStringList remoteDirPathStringList, localDirPathStringList; |
101 | 103 | ||
102 | protected slots: | 104 | protected slots: |
103 | void homeButtonPushed(); | 105 | void homeButtonPushed(); |
104 | void docButtonPushed(); | 106 | void docButtonPushed(); |
105 | void SDButtonPushed(); | 107 | void SDButtonPushed(); |
106 | void CFButtonPushed(); | 108 | void CFButtonPushed(); |
107 | void upDir(); | 109 | void upDir(); |
108 | void currentPathComboChanged(); | 110 | void currentPathComboChanged(); |
109 | void copy(); | 111 | void copy(); |
110 | void copyAs(); | 112 | void copyAs(); |
111 | void currentPathComboActivated(const QString &); | 113 | void currentPathComboActivated(const QString &); |
112 | void fillCombo(const QString &); | 114 | void fillCombo(const QString &); |
113 | bool copyFile( const QString & , const QString & ); | 115 | bool copyFile( const QString & , const QString & ); |
114 | void move(); | 116 | void move(); |
115 | void fileStatus(); | 117 | void fileStatus(); |