-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index dbba4b9..2746732 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp | |||
@@ -305,92 +305,99 @@ QString OFileSelectorItem::key( int id, bool )const | |||
305 | ke.append("1" ); | 305 | ke.append("1" ); |
306 | ke.append( text(1) ); | 306 | ke.append( text(1) ); |
307 | } | 307 | } |
308 | return ke; | 308 | return ke; |
309 | }else if(id == 2) { | 309 | }else if(id == 2) { |
310 | return text(2).rightJustify(20, '0'); | 310 | return text(2).rightJustify(20, '0'); |
311 | }else | 311 | }else |
312 | return text( id ); | 312 | return text( id ); |
313 | 313 | ||
314 | } | 314 | } |
315 | 315 | ||
316 | OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& startDir, OFileSelector* sel) | 316 | OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& startDir, OFileSelector* sel) |
317 | :QWidget( parent ), m_sel( sel ) | 317 | :QWidget( parent ), m_sel( sel ) |
318 | { | 318 | { |
319 | m_all = false; | 319 | m_all = false; |
320 | QVBoxLayout* lay = new QVBoxLayout( this ); | 320 | QVBoxLayout* lay = new QVBoxLayout( this ); |
321 | m_currentDir = startDir; | 321 | m_currentDir = startDir; |
322 | 322 | ||
323 | /* | 323 | /* |
324 | * now we add a special bar | 324 | * now we add a special bar |
325 | * One Button For Up | 325 | * One Button For Up |
326 | * Home | 326 | * Home |
327 | * Doc | 327 | * Doc |
328 | * And a dropdown menu with FileSystems | 328 | * And a dropdown menu with FileSystems |
329 | * FUTURE: one to change dir with lineedit | 329 | * FUTURE: one to change dir with lineedit |
330 | * Bookmarks | 330 | * Bookmarks |
331 | * Create Dir | 331 | * Create Dir |
332 | */ | 332 | */ |
333 | QHBox* box = new QHBox(this ); | 333 | QHBox* box = new QHBox(this ); |
334 | box->setBackgroundMode( PaletteButton ); | 334 | box->setBackgroundMode( PaletteButton ); |
335 | box->setSpacing( 0 ); | 335 | box->setSpacing( 0 ); |
336 | 336 | ||
337 | QPixmap pic; | ||
337 | QToolButton *btn = new QToolButton( box ); | 338 | QToolButton *btn = new QToolButton( box ); |
338 | btn->setIconSet( Resource::loadIconSet("up") ); | 339 | pic.convertFromImage( Resource::loadImage( "up" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
340 | btn->setPixmap( pic ); | ||
339 | connect(btn, SIGNAL(clicked() ), | 341 | connect(btn, SIGNAL(clicked() ), |
340 | this, SLOT( cdUP() ) ); | 342 | this, SLOT( cdUP() ) ); |
341 | 343 | ||
342 | btn = new QToolButton( box ); | 344 | btn = new QToolButton( box ); |
343 | btn->setIconSet( Resource::loadIconSet("home") ); | 345 | pic.convertFromImage( Resource::loadImage( "home" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
346 | btn->setPixmap( pic ); | ||
344 | connect(btn, SIGNAL(clicked() ), | 347 | connect(btn, SIGNAL(clicked() ), |
345 | this, SLOT( cdHome() ) ); | 348 | this, SLOT( cdHome() ) ); |
346 | 349 | ||
347 | btn = new QToolButton( box ); | 350 | btn = new QToolButton( box ); |
348 | btn->setIconSet( Resource::loadIconSet("DocsIcon") ); | 351 | pic.convertFromImage( Resource::loadImage( "DocsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
352 | btn->setPixmap( pic ); | ||
349 | connect(btn, SIGNAL(clicked() ), | 353 | connect(btn, SIGNAL(clicked() ), |
350 | this, SLOT(cdDoc() ) ); | 354 | this, SLOT(cdDoc() ) ); |
351 | 355 | ||
352 | m_btnNew = new QToolButton( box ); | 356 | m_btnNew = new QToolButton( box ); |
353 | m_btnNew->setIconSet( Resource::loadIconSet("new") ); | 357 | pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
358 | btn->setPixmap( pic ); | ||
354 | connect(m_btnNew, SIGNAL(clicked() ), | 359 | connect(m_btnNew, SIGNAL(clicked() ), |
355 | this, SLOT(slotNew() ) ); | 360 | this, SLOT(slotNew() ) ); |
356 | 361 | ||
357 | 362 | ||
358 | m_btnClose = new QToolButton( box ); | 363 | m_btnClose = new QToolButton( box ); |
359 | m_btnClose->setIconSet( Resource::loadIconSet("close") ); | 364 | pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
365 | btn->setPixmap( pic ); | ||
360 | connect(m_btnClose, SIGNAL(clicked() ), | 366 | connect(m_btnClose, SIGNAL(clicked() ), |
361 | selector(), SIGNAL(closeMe() ) ); | 367 | selector(), SIGNAL(closeMe() ) ); |
362 | 368 | ||
363 | btn = new QToolButton( box ); | 369 | btn = new QToolButton( box ); |
364 | btn->setIconSet( Resource::loadIconSet("cardmon/pcmcia") ); | 370 | pic.convertFromImage( Resource::loadImage( "cardmon/pcmcia" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
371 | btn->setPixmap( pic ); | ||
365 | 372 | ||
366 | m_fsButton = btn; | 373 | m_fsButton = btn; |
367 | /* let's fill device parts */ | 374 | /* let's fill device parts */ |
368 | QPopupMenu* pop = new QPopupMenu(this); | 375 | QPopupMenu* pop = new QPopupMenu(this); |
369 | connect(pop, SIGNAL( activated(int) ), | 376 | connect(pop, SIGNAL( activated(int) ), |
370 | this, SLOT(slotFSActivated(int) ) ); | 377 | this, SLOT(slotFSActivated(int) ) ); |
371 | 378 | ||
372 | StorageInfo storage; | 379 | StorageInfo storage; |
373 | const QList<FileSystem> &fs = storage.fileSystems(); | 380 | const QList<FileSystem> &fs = storage.fileSystems(); |
374 | QListIterator<FileSystem> it(fs); | 381 | QListIterator<FileSystem> it(fs); |
375 | for ( ; it.current(); ++it ) | 382 | for ( ; it.current(); ++it ) |
376 | { | 383 | { |
377 | const QString disk = (*it)->name(); | 384 | const QString disk = (*it)->name(); |
378 | const QString path = (*it)->path(); | 385 | const QString path = (*it)->path(); |
379 | m_dev.insert( disk, path ); | 386 | m_dev.insert( disk, path ); |
380 | pop->insertItem( disk ); | 387 | pop->insertItem( disk ); |
381 | } | 388 | } |
382 | m_fsPop = pop; | 389 | m_fsPop = pop; |
383 | 390 | ||
384 | connect(btn,SIGNAL(pressed()),this,SLOT(slotFSpressed())); | 391 | connect(btn,SIGNAL(pressed()),this,SLOT(slotFSpressed())); |
385 | 392 | ||
386 | lay->addWidget( box ); | 393 | lay->addWidget( box ); |
387 | 394 | ||
388 | m_view = new QListView( this ); | 395 | m_view = new QListView( this ); |
389 | 396 | ||
390 | m_view->installEventFilter(this); | 397 | m_view->installEventFilter(this); |
391 | 398 | ||
392 | QPEApplication::setStylusOperation( m_view->viewport(), | 399 | QPEApplication::setStylusOperation( m_view->viewport(), |
393 | QPEApplication::RightOnHold); | 400 | QPEApplication::RightOnHold); |
394 | m_view->addColumn(" " ); | 401 | m_view->addColumn(" " ); |
395 | m_view->addColumn(tr("Name"), 135 ); | 402 | m_view->addColumn(tr("Name"), 135 ); |
396 | m_view->addColumn(tr("Size"), -1 ); | 403 | m_view->addColumn(tr("Size"), -1 ); |