Diffstat (limited to 'noncore/apps/advancedfm/advancedfmData.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 29335f8..dc7e8e1 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -140,155 +140,156 @@ void AdvancedFm::init() { | |||
140 | 140 | ||
141 | layout->addLayout( CBHB ); | 141 | layout->addLayout( CBHB ); |
142 | 142 | ||
143 | TabWidget = new OSplitter( Horizontal, this, "TabWidget" ); | 143 | TabWidget = new OSplitter( Horizontal, this, "TabWidget" ); |
144 | // TabWidget = new QTabWidget( this, "TabWidget" ); | 144 | // TabWidget = new QTabWidget( this, "TabWidget" ); |
145 | layout->addWidget( TabWidget, 4 ); | 145 | layout->addWidget( TabWidget, 4 ); |
146 | 146 | ||
147 | tab = new QWidget( TabWidget, "tab" ); | 147 | tab = new QWidget( TabWidget, "tab" ); |
148 | tabLayout = new QGridLayout( tab ); | 148 | tabLayout = new QGridLayout( tab ); |
149 | tabLayout->setSpacing( 2); | 149 | tabLayout->setSpacing( 2); |
150 | tabLayout->setMargin( 2); | 150 | tabLayout->setMargin( 2); |
151 | 151 | ||
152 | Local_View = new QListView( tab, "Local_View" ); | 152 | Local_View = new QListView( tab, "Local_View" ); |
153 | Local_View->addColumn( tr("File"),130); | 153 | Local_View->addColumn( tr("File"),130); |
154 | Local_View->addColumn( tr("Size"),-1); | 154 | Local_View->addColumn( tr("Size"),-1); |
155 | Local_View->setColumnAlignment(1,QListView::AlignRight); | 155 | Local_View->setColumnAlignment(1,QListView::AlignRight); |
156 | Local_View->addColumn( tr("Date"),-1); | 156 | Local_View->addColumn( tr("Date"),-1); |
157 | Local_View->setColumnAlignment(2,QListView::AlignRight); | 157 | Local_View->setColumnAlignment(2,QListView::AlignRight); |
158 | Local_View->setAllColumnsShowFocus(TRUE); | 158 | Local_View->setAllColumnsShowFocus(TRUE); |
159 | Local_View->setMultiSelection( TRUE ); | 159 | Local_View->setMultiSelection( TRUE ); |
160 | Local_View->setSelectionMode(QListView::Extended); | 160 | Local_View->setSelectionMode(QListView::Extended); |
161 | Local_View->setFocusPolicy(StrongFocus); | 161 | Local_View->setFocusPolicy(StrongFocus); |
162 | Local_View->installEventFilter( this ); | 162 | Local_View->installEventFilter( this ); |
163 | 163 | ||
164 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); | 164 | QPEApplication::setStylusOperation( Local_View->viewport() , QPEApplication::RightOnHold); |
165 | 165 | ||
166 | tabLayout->addWidget( Local_View, 0, 0 ); | 166 | tabLayout->addWidget( Local_View, 0, 0 ); |
167 | 167 | ||
168 | TabWidget->addWidget( tab,"advancedfm/smFileBrowser.png", tr("1")); | 168 | TabWidget->addWidget( tab,"advancedfm/smFileBrowser.png", tr("1")); |
169 | // TabWidget->insertTab( tab, tr("1")); | 169 | // TabWidget->insertTab( tab, tr("1")); |
170 | 170 | ||
171 | tab_2 = new QWidget( TabWidget, "tab_2" ); | 171 | tab_2 = new QWidget( TabWidget, "tab_2" ); |
172 | tabLayout_2 = new QGridLayout( tab_2 ); | 172 | tabLayout_2 = new QGridLayout( tab_2 ); |
173 | tabLayout_2->setSpacing( 2); | 173 | tabLayout_2->setSpacing( 2); |
174 | tabLayout_2->setMargin( 2); | 174 | tabLayout_2->setMargin( 2); |
175 | 175 | ||
176 | Remote_View = new QListView( tab_2, "Remote_View" ); | 176 | Remote_View = new QListView( tab_2, "Remote_View" ); |
177 | Remote_View->addColumn( tr("File"),130); | 177 | Remote_View->addColumn( tr("File"),130); |
178 | Remote_View->addColumn( tr("Size"),-1); | 178 | Remote_View->addColumn( tr("Size"),-1); |
179 | Remote_View->setColumnAlignment(1,QListView::AlignRight); | 179 | Remote_View->setColumnAlignment(1,QListView::AlignRight); |
180 | Remote_View->addColumn( tr("Date"),-1); | 180 | Remote_View->addColumn( tr("Date"),-1); |
181 | Remote_View->setColumnAlignment(2,QListView::AlignRight); | 181 | Remote_View->setColumnAlignment(2,QListView::AlignRight); |
182 | Remote_View->setAllColumnsShowFocus(TRUE); | 182 | Remote_View->setAllColumnsShowFocus(TRUE); |
183 | Remote_View->setMultiSelection( TRUE ); | 183 | Remote_View->setMultiSelection( TRUE ); |
184 | Remote_View->setSelectionMode(QListView::Extended); | 184 | Remote_View->setSelectionMode(QListView::Extended); |
185 | Remote_View->setFocusPolicy(StrongFocus); | 185 | Remote_View->setFocusPolicy(StrongFocus); |
186 | Remote_View->installEventFilter( this ); | 186 | Remote_View->installEventFilter( this ); |
187 | 187 | ||
188 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); | 188 | QPEApplication::setStylusOperation( Remote_View->viewport(), QPEApplication::RightOnHold); |
189 | 189 | ||
190 | tabLayout_2->addWidget( Remote_View, 0, 0 ); | 190 | tabLayout_2->addWidget( Remote_View, 0, 0 ); |
191 | 191 | ||
192 | TabWidget->addWidget( tab_2, "advancedfm/smFileBrowser.png",tr( "2")); | 192 | TabWidget->addWidget( tab_2, "advancedfm/smFileBrowser.png",tr( "2")); |
193 | TabWidget->setSizeChange( 370 ); | 193 | TabWidget->setSizeChange( 370 ); |
194 | // TabWidget->insertTab( tab_2, tr( "2")); | 194 | // TabWidget->insertTab( tab_2, tr( "2")); |
195 | 195 | ||
196 | /* tab_3 = new QWidget( TabWidget, "tab_3" ); | 196 | /* tab_3 = new QWidget( TabWidget, "tab_3" ); |
197 | tabLayout_3 = new QGridLayout( tab_3 ); | 197 | tabLayout_3 = new QGridLayout( tab_3 ); |
198 | tabLayout_3->setSpacing( 2); | 198 | tabLayout_3->setSpacing( 2); |
199 | tabLayout_3->setMargin( 2); | 199 | tabLayout_3->setMargin( 2); |
200 | 200 | ||
201 | 201 | ||
202 | // OFileDialog fileDialog; | 202 | // OFileDialog fileDialog; |
203 | // fileDialog; | 203 | // fileDialog; |
204 | // fileSelector = new FileSelector( "*",tab_3, "fileselector" , FALSE, FALSE); //buggy | 204 | // fileSelector = new FileSelector( "*",tab_3, "fileselector" , FALSE, FALSE); //buggy |
205 | // fileDialog = new OFileDialog("bangalow", tab_3, 4, 2, "Bungalow"); | 205 | // fileDialog = new OFileDialog("bangalow", tab_3, 4, 2, "Bungalow"); |
206 | // OFileSelector fileDialog = new OFileSelector( tab_3, 4, 2,"/"); | 206 | // OFileSelector fileDialog = new OFileSelector( tab_3, 4, 2,"/"); |
207 | 207 | ||
208 | QListView *fileTree; | 208 | QListView *fileTree; |
209 | fileTree = new QListView( tab_3, "tree" ); | 209 | fileTree = new QListView( tab_3, "tree" ); |
210 | 210 | ||
211 | 211 | ||
212 | tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); | 212 | tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); |
213 | 213 | ||
214 | TabWidget->insertTab( tab_3, tr( "Remote" ) ); | 214 | TabWidget->insertTab( tab_3, tr( "Remote" ) ); |
215 | */ | 215 | */ |
216 | 216 | ||
217 | /////////////// | 217 | /////////////// |
218 | 218 | ||
219 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) | 219 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) |
220 | zaurusDevice=TRUE; | 220 | zaurusDevice=TRUE; |
221 | else | 221 | else |
222 | zaurusDevice=FALSE; | 222 | zaurusDevice=FALSE; |
223 | 223 | ||
224 | 224 | ||
225 | if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { | 225 | if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { |
226 | odebug << "not have sd" << oendl; | 226 | odebug << "not have sd" << oendl; |
227 | sdButton->hide(); | 227 | sdButton->hide(); |
228 | } | 228 | } |
229 | if( !StorageInfo::hasCf() ) { | 229 | if( !StorageInfo::hasCf() ) { |
230 | odebug << "not have cf" << oendl; | 230 | odebug << "not have cf" << oendl; |
231 | cfButton->hide(); | 231 | cfButton->hide(); |
232 | } | 232 | } |
233 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 233 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
234 | currentDir.setPath( QDir::currentDirPath()); | 234 | currentDir.setPath( QDir::currentDirPath()); |
235 | 235 | ||
236 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 236 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
237 | currentRemoteDir.setPath( QDir::currentDirPath()); | 237 | currentRemoteDir.setPath( QDir::currentDirPath()); |
238 | 238 | ||
239 | // b = TRUE; | 239 | // b = TRUE; |
240 | 240 | ||
241 | filterStr="*"; | 241 | filterStr="*"; |
242 | showMenuHidden(); | 242 | showMenuHidden(); |
243 | TabWidget->setCurrentWidget(0); | 243 | TabWidget->setCurrentWidget(0); |
244 | 244 | ||
245 | } | 245 | } |
246 | 246 | ||
247 | void AdvancedFm::initConnections() | 247 | void AdvancedFm::initConnections() |
248 | { | 248 | { |
249 | 249 | ||
250 | connect( qApp,SIGNAL( aboutToQuit()), | 250 | connect( qApp,SIGNAL( aboutToQuit()), |
251 | this, SLOT( cleanUp()) ); | 251 | this, SLOT( cleanUp()) ); |
252 | connect( qpeDirButton ,SIGNAL(released()), | 252 | connect( qpeDirButton ,SIGNAL(released()), |
253 | this,SLOT( QPEButtonPushed()) ); | 253 | this,SLOT( QPEButtonPushed()) ); |
254 | connect( cfButton ,SIGNAL(released()), | 254 | connect( cfButton ,SIGNAL(released()), |
255 | this,SLOT( CFButtonPushed()) ); | 255 | this,SLOT( CFButtonPushed()) ); |
256 | connect( sdButton ,SIGNAL(released()), | 256 | connect( sdButton ,SIGNAL(released()), |
257 | this,SLOT( SDButtonPushed()) ); | 257 | this,SLOT( SDButtonPushed()) ); |
258 | connect( cdUpButton ,SIGNAL(released()), | 258 | connect( cdUpButton ,SIGNAL(released()), |
259 | this,SLOT( upDir()) ); | 259 | this,SLOT( upDir()) ); |
260 | connect( docButton,SIGNAL(released()), | 260 | connect( docButton,SIGNAL(released()), |
261 | this,SLOT( docButtonPushed()) ); | 261 | this,SLOT( docButtonPushed()) ); |
262 | connect( homeButton,SIGNAL(released()), | 262 | connect( homeButton,SIGNAL(released()), |
263 | this,SLOT( homeButtonPushed()) ); | 263 | this,SLOT( homeButtonPushed()) ); |
264 | connect( currentPathCombo, SIGNAL( activated(const QString&) ), | 264 | connect( currentPathCombo, SIGNAL( activated(const QString&) ), |
265 | this, SLOT( currentPathComboActivated(const QString&) ) ); | 265 | this, SLOT( currentPathComboActivated(const QString&) ) ); |
266 | 266 | ||
267 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), | 267 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), |
268 | this,SLOT(currentPathComboChanged())); | 268 | this,SLOT(currentPathComboChanged())); |
269 | 269 | ||
270 | connect( Local_View, SIGNAL( clicked(QListViewItem*)), | 270 | connect( Local_View, SIGNAL( clicked(QListViewItem*)), |
271 | this,SLOT( ListClicked(QListViewItem*)) ); | 271 | this,SLOT( ListClicked(QListViewItem*)) ); |
272 | 272 | ||
273 | connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), | 273 | connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), |
274 | this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); | 274 | this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); |
275 | 275 | ||
276 | connect( Local_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); | ||
277 | |||
278 | connect( Remote_View, SIGNAL( clicked(QListViewItem*)), | 276 | connect( Remote_View, SIGNAL( clicked(QListViewItem*)), |
279 | this,SLOT( ListClicked(QListViewItem*)) ); | 277 | this,SLOT( ListClicked(QListViewItem*)) ); |
280 | connect( Remote_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), | 278 | connect( Remote_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), |
281 | this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); | 279 | this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); |
282 | 280 | ||
283 | connect( TabWidget,SIGNAL(currentChanged(QWidget*)), | 281 | connect( TabWidget,SIGNAL(currentChanged(QWidget*)), |
284 | this,SLOT(tabChanged(QWidget*))); | 282 | this,SLOT(tabChanged(QWidget*))); |
285 | 283 | ||
286 | connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); | 284 | connect( Remote_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&, int)), |
285 | this, SLOT(showFileMenu())); | ||
286 | connect( Local_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&,int)), | ||
287 | this, SLOT(showFileMenu())); | ||
287 | 288 | ||
288 | connect( menuButton, SIGNAL( selected(const QString&)), SLOT(gotoCustomDir(const QString&))); | 289 | connect( menuButton, SIGNAL( selected(const QString&)), SLOT(gotoCustomDir(const QString&))); |
289 | // connect( menuButton, SIGNAL( selected(int)), SLOT( dirMenuSelected(int))); | 290 | // connect( menuButton, SIGNAL( selected(int)), SLOT( dirMenuSelected(int))); |
290 | connect( viewMenu, SIGNAL( activated(int)), this, SLOT(slotSwitchMenu(int))); | 291 | connect( viewMenu, SIGNAL( activated(int)), this, SLOT(slotSwitchMenu(int))); |
291 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); | 292 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); |
292 | 293 | ||
293 | } | 294 | } |
294 | 295 | ||