From: Peter Penz Date: Tue, 10 Mar 2009 06:59:27 +0000 (+0000) Subject: Provide an "Open Terminal" entry for the Tools menu (thanks to Rahman Duran for the... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/7697cad99fcd96be31f0fb7633f8e32cd4f37f10 Provide an "Open Terminal" entry for the Tools menu (thanks to Rahman Duran for the patch!) BUG: 164746 svn path=/trunk/KDE/kdebase/apps/; revision=937624 --- diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 6338f0f3f..53505b95a 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -78,6 +78,7 @@ #include #include #include +#include #include #include @@ -742,6 +743,11 @@ void DolphinMainWindow::toggleShowMenuBar() menuBar()->setVisible(!visible); } +void DolphinMainWindow::openTerminal() +{ + KToolInvocation::invokeTerminal(QString(), m_activeViewContainer->url().path()); +} + void DolphinMainWindow::editSettings() { if (m_settingsDialog == 0) { @@ -1142,6 +1148,12 @@ void DolphinMainWindow::setupActions() compareFiles->setEnabled(false); connect(compareFiles, SIGNAL(triggered()), this, SLOT(compareFiles())); + KAction* openTerminal = actionCollection()->addAction("open_terminal"); + openTerminal->setText(i18nc("@action:inmenu Tools", "Open Terminal")); + openTerminal->setIcon(KIcon("terminal")); + openTerminal->setShortcut(Qt::SHIFT | Qt::Key_F4); + connect(openTerminal, SIGNAL(triggered()), this, SLOT(openTerminal())); + // setup 'Settings' menu m_showMenuBar = KStandardAction::showMenubar(this, SLOT(toggleShowMenuBar()), actionCollection()); KStandardAction::preferences(this, SLOT(editSettings()), actionCollection()); diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 5b91b99ce..2b5b00515 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -268,6 +268,9 @@ private slots: */ void toggleShowMenuBar(); + /** Opens a terminal window for the current location. */ + void openTerminal(); + /** Opens the settings dialog for Dolphin. */ void editSettings(); diff --git a/src/dolphinui.rc b/src/dolphinui.rc index b770d96f6..8d89b07c8 100644 --- a/src/dolphinui.rc +++ b/src/dolphinui.rc @@ -1,5 +1,5 @@ - + @@ -76,8 +76,8 @@ + -