From abcb33d72ce3eeabd79cf4a15b7f49476b74cb56 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 28 Apr 2015 08:50:51 -0400 Subject: Add a button to the userbutton "home dir" section for starting a search of the selected directory. Also enable the use of lumina-fileinfo for *any* file within the desktopview plugin. --- .../desktopview/DesktopViewPlugin.cpp | 5 +- .../panel-plugins/userbutton/UserWidget.cpp | 10 +- .../panel-plugins/userbutton/UserWidget.h | 1 + .../panel-plugins/userbutton/UserWidget.ui | 109 +++++++++++++-------- 4 files changed, 77 insertions(+), 48 deletions(-) diff --git a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp index be815587..527de682 100644 --- a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp +++ b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp @@ -174,9 +174,6 @@ void DesktopViewPlugin::updateContents(){ void DesktopViewPlugin::displayProperties(){ QList sel = list->selectedItems(); for(int i=0; iwhatsThis().endsWith(".desktop")){ - LSession::LaunchApplication("lumina-fileinfo \""+sel[i]->whatsThis()); - } + LSession::LaunchApplication("lumina-fileinfo \""+sel[i]->whatsThis()); } } diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp index 404fcc26..9c002109 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp +++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp @@ -35,6 +35,7 @@ UserWidget::UserWidget(QWidget* parent) : QTabWidget(parent), ui(new Ui::UserWid ui->tool_config_screensettings->setIcon( LXDG::findIcon("preferences-other","") ); ui->tool_home_gohome->setIcon( LXDG::findIcon("go-home","") ); ui->tool_home_browse->setIcon( LXDG::findIcon("document-open","") ); + ui->tool_home_search->setIcon( LXDG::findIcon("system-search","") ); ui->tool_config_about->setIcon( LXDG::findIcon("lumina","") ); //Connect the signals/slots connect(ui->tool_desktopsettings, SIGNAL(clicked()), this, SLOT(openDeskSettings()) ); @@ -46,6 +47,7 @@ UserWidget::UserWidget(QWidget* parent) : QTabWidget(parent), ui(new Ui::UserWid connect(ui->combo_app_cats, SIGNAL(currentIndexChanged(int)), this, SLOT(updateApps()) ); connect(ui->tool_home_gohome, SIGNAL(clicked()), this, SLOT(slotGoHome()) ); connect(ui->tool_home_browse, SIGNAL(clicked()), this, SLOT(slotOpenDir()) ); + connect(ui->tool_home_search, SIGNAL(clicked()), this, SLOT(slotOpenSearch()) ); connect(ui->tool_config_about, SIGNAL(clicked()), this, SLOT(openLuminaInfo()) ); //Setup the special buttons @@ -297,7 +299,7 @@ void UserWidget::slotGoToDir(QString dir){ ui->label_home_dir->setWhatsThis(dir); updateHome(); } - + void UserWidget::slotGoHome(){ slotGoToDir(QDir::homePath()); } @@ -305,7 +307,11 @@ void UserWidget::slotGoHome(){ void UserWidget::slotOpenDir(){ LaunchItem(ui->label_home_dir->whatsThis()); } - + +void UserWidget::slotOpenSearch(){ + LaunchItem("lumina-search -dir \""+ui->label_home_dir->whatsThis()+"\"", false); //use command as-is +} + void UserWidget::mouseMoveEvent( QMouseEvent *event){ QTabBar *wid = tabBar(); if(wid==0){ return; } //invalid widget found diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.h b/lumina-desktop/panel-plugins/userbutton/UserWidget.h index 8f5ba852..2dce25b4 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserWidget.h +++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.h @@ -65,6 +65,7 @@ private slots: void slotGoToDir(QString dir); void slotGoHome(); void slotOpenDir(); + void slotOpenSearch(); //Slots for the special buttons void openStore(){ diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.ui b/lumina-desktop/panel-plugins/userbutton/UserWidget.ui index f00daf08..bce684fd 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserWidget.ui +++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.ui @@ -17,7 +17,7 @@ QTabWidget::West - 3 + 2 @@ -170,8 +170,8 @@ 0 0 - 98 - 28 + 260 + 247 @@ -276,8 +276,8 @@ 0 0 - 98 - 28 + 260 + 247 @@ -309,11 +309,61 @@ 1 - - + + + 4 + + 1 - + + + + Search this Directory + + + + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Open Directory + + + Browse + + + + 20 + 20 + + + + Qt::ToolButtonIconOnly + + + + @@ -338,8 +388,14 @@ - + + + + 0 + 0 + + 0 @@ -376,37 +432,6 @@ - - - - - 0 - 0 - - - - - 90 - 30 - - - - Open Directory - - - Browse - - - - 20 - 20 - - - - Qt::ToolButtonTextBesideIcon - - - @@ -419,8 +444,8 @@ 0 0 - 98 - 28 + 260 + 247 -- cgit