Changeset bb3f61c


Ignore:
Timestamp:
06/23/14 21:04:54 (10 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
9088f3f
Parents:
08438b40
Message:

Add the new bookmark manager dialog to lumina-fm. Now the user can remove/rename bookmarks.

Location:
lumina/lumina-fm
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • lumina/lumina-fm/MainUI.cpp

    r08438b40 rbb3f61c  
    148148    ui->menuBookmarks->addSeparator(); 
    149149  QStringList BM = settings->value("bookmarks", QStringList()).toStringList(); 
     150  ui->menuBookmarks->clear(); 
     151    ui->menuBookmarks->addAction(ui->actionManage_Bookmarks); 
     152    ui->menuBookmarks->addSeparator(); 
    150153  bool changed = false; 
    151154  for(int i=0; i<BM.length(); i++){ 
     
    162165  } 
    163166  if(changed){ settings->setValue("bookmarks",BM); } 
     167  ui->actionManage_Bookmarks->setEnabled(BM.length()>0); 
    164168} 
    165169 
     
    376380void MainUI::goToBookmark(QAction *act){ 
    377381  if(act==ui->actionManage_Bookmarks){ 
    378     qDebug() << "Bookmark Manager not implemented yet!"; 
     382    BMMDialog dlg(this); 
     383      dlg.loadSettings(settings); 
     384      dlg.exec(); 
     385    loadSettings(); //rebuild bookmarks menu 
    379386  }else{ 
    380387    setCurrentDir(act->whatsThis()); 
     
    417424  settings->setValue("bookmarks", BM); 
    418425  //Now rebuild the bookmarks menu 
    419   ui->menuBookmarks->clear(); 
    420     ui->menuBookmarks->addAction(ui->actionManage_Bookmarks); 
    421     ui->menuBookmarks->addSeparator(); 
    422   bool changed = false; 
    423   for(int i=0; i<BM.length(); i++){ 
    424     if(QFile::exists(BM[i].section("::::",1,1)) ){ 
    425       QAction *act = new QAction(BM[i].section("::::",0,0),this); 
    426         act->setWhatsThis(BM[i].section("::::",1,1)); 
    427       ui->menuBookmarks->addAction(act); 
    428     }else{ 
    429       //Invalid directory - remove the bookmark 
    430       BM.removeAt(i); 
    431       i--; 
    432       changed = true; 
    433     } 
    434   } 
    435   if(changed){ settings->setValue("bookmarks",BM); } 
     426  loadSettings(); 
    436427  ui->actionBookMark->setEnabled(false); //already bookmarked 
    437428} 
  • lumina/lumina-fm/MainUI.h

    r603a75a rbb3f61c  
    3232// Local includes 
    3333#include "FODialog.h" //file operation dialog 
     34#include "BMMDialog.h" //bookmark manager dialog 
    3435 
    3536namespace Ui{ 
  • lumina/lumina-fm/lumina-fm.pro

    r20c7552 rbb3f61c  
    99SOURCES += main.cpp \ 
    1010                MainUI.cpp \ 
    11                 FODialog.cpp 
     11                FODialog.cpp \ 
     12                BMMDialog.cpp 
    1213 
    1314HEADERS  += MainUI.h \ 
    14                 FODialog.h 
     15                FODialog.h \ 
     16                BMMDialog.h 
    1517 
    1618FORMS    += MainUI.ui \ 
    17                 FODialog.ui 
     19                FODialog.ui \ 
     20                BMMDialog.ui 
    1821 
    1922# RESOURCES+= lumina-fm.qrc 
Note: See TracChangeset for help on using the changeset viewer.