From af44cb451c2f570c009cac3e1ae5a63be8e0a911 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 23 Apr 2015 10:17:20 -0400 Subject: Make the open/openwith functionality in lumina-fm multi-selection aware. Also so the same for the "properties" option (although it only operates on *.desktop files at the moment). --- lumina-fm/MainUI.cpp | 59 ++++++++++++++++++++++++++-------------------------- lumina-fm/MainUI.h | 6 +++--- 2 files changed, 32 insertions(+), 33 deletions(-) (limited to 'lumina-fm') diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index d7e3b290..7f1e5fcc 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -953,12 +953,9 @@ void MainUI::OpenContextMenu(const QPoint &pt){ //Create the context menu contextMenu->clear(); if(!CItem.isEmpty()){ - if(info.isDir()){ - contextMenu->addAction(LXDG::findIcon("tab-new-background",""), tr("Open in new tab"), this, SLOT(OpenDir()) ); - }else{ - contextMenu->addAction(LXDG::findIcon("run-build-file",""), tr("Open"), this, SLOT(OpenItem()) ); - contextMenu->addAction(LXDG::findIcon("run-build-configure",""), tr("Open With..."), this, SLOT(OpenItemWith()) ); - } + contextMenu->addAction(LXDG::findIcon("run-build-file",""), tr("Open"), this, SLOT(OpenItem()) ); + contextMenu->addAction(LXDG::findIcon("run-build-configure",""), tr("Open With..."), this, SLOT(OpenItemWith()) ); + contextMenu->addAction(LXDG::findIcon("edit-rename",""), tr("Rename"), this, SLOT(RenameItem()) )->setEnabled(info.isWritable()); contextMenu->addAction(LXDG::findIcon("document-encrypted",""), tr("View Checksums"), this, SLOT(ChecksumItems()) ); contextMenu->addSeparator(); @@ -990,8 +987,8 @@ void MainUI::ItemSelectionChanged(){ if(sel.size()>0){ emit Si_AdaptStatusBar(sel, "", tr("Selected Folders"), tr("Files"));} else{ emit Si_AdaptStatusBar(fsmod->rootDirectory().entryInfoList(), getCurrentDir(), tr("Folders"), tr("Files")); } - ui->tool_act_run->setEnabled(sel.length()==1); - ui->tool_act_runwith->setEnabled(sel.length()==1); + ui->tool_act_run->setEnabled(!sel.isEmpty()); + ui->tool_act_runwith->setEnabled(!sel.isEmpty()); ui->tool_act_rm->setEnabled(!sel.isEmpty() && isUserWritable); ui->tool_act_rename->setEnabled(sel.length()==1 && isUserWritable); ui->tool_act_cut->setEnabled(!sel.isEmpty() && isUserWritable); @@ -1293,30 +1290,32 @@ void MainUI::playerFileChanged(){ // Context Menu Actions //---------------------------------- void MainUI::OpenItem(){ - if(CItem.isEmpty()){ - QFileInfoList sel = getSelectedItems(); - if(sel.isEmpty()){ return; } - else{ CItem = sel[0].absoluteFilePath(); } - if(sel[0].isDir()){ OpenDir(); return; } //just in case - open it in a new tab + QFileInfoList sel = getSelectedItems(); + if(sel.isEmpty()){ return; } + + QStringList dirs; + for(int i=0; i