diff options
-rw-r--r-- | lumina-fm/MainUI.cpp | 15 | ||||
-rw-r--r-- | lumina-fm/MainUI.h | 3 | ||||
-rw-r--r-- | lumina-fm/MainUI.ui | 13 |
3 files changed, 22 insertions, 9 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index b9f983be..558ecf4d 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -207,8 +207,8 @@ void MainUI::setupIcons(){ ui->actionClose->setIcon( LXDG::findIcon("application-exit","") ); ui->actionNew_Tab->setIcon( LXDG::findIcon("tab-new","") );\ ui->actionNew_Window->setIcon( LXDG::findIcon("window-new","") ); - //ui->action_Preferences->setIcon( LXDG::findIcon("configure","") ); ui->actionManage_Bookmarks->setIcon( LXDG::findIcon("bookmarks-organize","") ); + ui->actionAdd_Bookmark->setIcon( LXDG::findIcon("bookmark-new","") ); ui->actionScan->setIcon( LXDG::findIcon("system-search","") ); ui->actionSearch->setIcon( LXDG::findIcon("edit-find","") ); ui->actionLarger_Icons->setIcon( LXDG::findIcon("zoom-in","") ); @@ -267,12 +267,10 @@ void MainUI::loadSettings(){ void MainUI::RebuildBookmarksMenu(){ //Create the bookmarks menu - ui->menuBookmarks->clear(); - ui->menuBookmarks->addAction(ui->actionManage_Bookmarks); - ui->menuBookmarks->addSeparator(); QStringList BM = settings->value("bookmarks", QStringList()).toStringList(); ui->menuBookmarks->clear(); ui->menuBookmarks->addAction(ui->actionManage_Bookmarks); + ui->menuBookmarks->addAction(ui->actionAdd_Bookmark); ui->menuBookmarks->addSeparator(); bool changed = false; BM.sort(); //Sort alphabetically @@ -430,6 +428,8 @@ void MainUI::goToBookmark(QAction *act){ dlg.loadSettings(settings); dlg.exec(); RebuildBookmarksMenu(); + }else if(act == ui->actionAdd_Bookmark){ + CreateBookMark(); }else{ //Find the current directory DirWidget *dir = FindActiveBrowser(); @@ -524,8 +524,8 @@ void MainUI::on_actionSmaller_Icons_triggered(){ settings->setValue("iconsize", size); } -/*void MainUI::on_actionBookMark_triggered(){ - QString dir = getCurrentDir(); +void MainUI::CreateBookMark(){ + QString dir = FindActiveBrowser()->currentDir(); bool ok = false; QString name = QInputDialog::getText(this, tr("New Bookmark"), tr("Name:"), QLineEdit::Normal, dir, \ &ok, 0, Qt::ImhFormattedNumbersOnly | Qt::ImhUppercaseOnly | Qt::ImhLowercaseOnly); @@ -541,8 +541,7 @@ void MainUI::on_actionSmaller_Icons_triggered(){ settings->setValue("bookmarks", BM); //Now rebuild the bookmarks menu RebuildBookmarksMenu(); - ui->actionBookMark->setEnabled(false); //already bookmarked -}*/ +} void MainUI::tabChanged(int tab){ if(tab<0){ tab = tabBar->currentIndex(); } diff --git a/lumina-fm/MainUI.h b/lumina-fm/MainUI.h index e9a2aff8..e139d341 100644 --- a/lumina-fm/MainUI.h +++ b/lumina-fm/MainUI.h @@ -125,7 +125,8 @@ private slots: void groupModeChanged(bool); void on_actionLarger_Icons_triggered(); void on_actionSmaller_Icons_triggered(); - + void CreateBookMark(); + //Tab interactions void tabChanged(int tab = -1); void tabClosed(int tab = -1); diff --git a/lumina-fm/MainUI.ui b/lumina-fm/MainUI.ui index c2a56626..15476b75 100644 --- a/lumina-fm/MainUI.ui +++ b/lumina-fm/MainUI.ui @@ -150,6 +150,8 @@ <string>Bookmarks</string> </property> <addaction name="actionManage_Bookmarks"/> + <addaction name="actionAdd_Bookmark"/> + <addaction name="separator"/> </widget> <widget class="QMenu" name="menuExternal_Devices"> <property name="title"> @@ -307,6 +309,17 @@ <enum>Qt::ApplicationShortcut</enum> </property> </action> + <action name="actionAdd_Bookmark"> + <property name="text"> + <string>Add Bookmark</string> + </property> + <property name="shortcut"> + <string>Ctrl+D</string> + </property> + <property name="shortcutContext"> + <enum>Qt::ApplicationShortcut</enum> + </property> + </action> </widget> <resources/> <connections/> |