aboutsummaryrefslogtreecommitdiff
path: root/lumina-fm/MainUI.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-04-22 12:29:11 -0400
committerKen Moore <ken@pcbsd.org>2015-04-22 12:29:11 -0400
commitbeb8af056848fdfe2863b3d1da4b88e2ca0659c9 (patch)
tree8318a3f68da7aacec943173a487837bfeac97aa0 /lumina-fm/MainUI.cpp
parentMake sure that lumina-fileinfo displays an error message if an invalid file t... (diff)
downloadlumina-beb8af056848fdfe2863b3d1da4b88e2ca0659c9.tar.gz
lumina-beb8af056848fdfe2863b3d1da4b88e2ca0659c9.tar.bz2
lumina-beb8af056848fdfe2863b3d1da4b88e2ca0659c9.zip
Add support for running "lumina-fileinfo" from the right-click menu in lumina-fm
Diffstat (limited to 'lumina-fm/MainUI.cpp')
-rw-r--r--lumina-fm/MainUI.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp
index 0c38ae34..d7e3b290 100644
--- a/lumina-fm/MainUI.cpp
+++ b/lumina-fm/MainUI.cpp
@@ -970,6 +970,10 @@ void MainUI::OpenContextMenu(const QPoint &pt){
contextMenu->addAction(LXDG::findIcon("edit-paste",""), tr("Paste"), this, SLOT(PasteItems()) )->setEnabled(QApplication::clipboard()->mimeData()->hasFormat("x-special/lumina-copied-files") && isUserWritable);
contextMenu->addSeparator();
contextMenu->addAction(LXDG::findIcon("edit-delete",""), tr("Delete Selection"), this, SLOT(RemoveItem()) )->setEnabled(info.isWritable()&&hasSelection);
+ if(LUtils::isValidBinary("lumina-fileinfo")){
+ contextMenu->addSeparator();
+ contextMenu->addAction(LXDG::findIcon("system-search",""), tr("File Properties"), this, SLOT(ViewPropertiesItem()) )->setEnabled(hasSelection && info.fileName().endsWith(".desktop"));
+ }
//Now show the menu
if(radio_view_details->isChecked()){
contextMenu->popup(ui->tree_dir_view->mapToGlobal(pt));
@@ -1412,6 +1416,16 @@ void MainUI::FavoriteItem(){
ItemSelectionChanged();
}
+void MainUI::ViewPropertiesItem(){
+ if(CItem.isEmpty()){
+ QFileInfoList sel = getSelectedItems();
+ if(sel.isEmpty()){ return; }
+ else{ CItem = sel[0].absoluteFilePath(); }
+ }
+ QString file = CItem;
+ QProcess::startDetached("lumina-fileinfo \""+file+"\"");
+}
+
void MainUI::CutItems(){
//Only let this run if viewing the browser page
if(ui->stackedWidget->currentWidget()!=ui->page_browser){ return; }
bgstack15