]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Provide an "Open Terminal" entry for the Tools menu (thanks to Rahman Duran for the...
authorPeter Penz <peter.penz19@gmail.com>
Tue, 10 Mar 2009 06:59:27 +0000 (06:59 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 10 Mar 2009 06:59:27 +0000 (06:59 +0000)
BUG: 164746

svn path=/trunk/KDE/kdebase/apps/; revision=937624

src/dolphinmainwindow.cpp
src/dolphinmainwindow.h
src/dolphinui.rc

index 6338f0f3fb763d2857061b00494eda0dceebb1f7..53505b95a0c9cd9bc942ce92ef2b042e10e8cc81 100644 (file)
@@ -78,6 +78,7 @@
 #include <kurlnavigator.h>
 #include <kurl.h>
 #include <kurlcombobox.h>
+#include <ktoolinvocation.h>
 
 #include <QDBusMessage>
 #include <QKeyEvent>
@@ -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());
index 5b91b99ce04ccc384857c0f55905f6e0556ba8c6..2b5b00515603ddec3e27ec504f2dac8d1a20bbfe 100644 (file)
@@ -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();
 
index b770d96f6072e1aca92251c08371fb53ac07242c..8d89b07c8c10471612f600f2853a14898bccc96b 100644 (file)
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name="dolphin" version="9">
+<kpartgui name="dolphin" version="10">
     <MenuBar>
         <Menu name="file">
             <Action name="create_new" />
@@ -76,8 +76,8 @@
         <Menu name="tools">
             <Action name="find_file" />
             <Action name="show_filter_bar" />
+            <Action name="open_terminal" />
             <Action name="compare_files" />
-            <Action name="quick_view" />
         </Menu>
     </MenuBar>
     <State name="new_file" >