From beb8af056848fdfe2863b3d1da4b88e2ca0659c9 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 22 Apr 2015 12:29:11 -0400 Subject: Add support for running "lumina-fileinfo" from the right-click menu in lumina-fm --- lumina-fm/MainUI.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lumina-fm/MainUI.cpp') 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; } -- cgit