Commit 5b50d8c4 authored by Constantin Berzan's avatar Constantin Berzan
Browse files

Add 'Open Browser Here' menu item.

BUG: 61136


svn path=/trunk/KDE/kdebase/apps/konsole/; revision=712078
parent a88b0297
......@@ -3,6 +3,7 @@
<kpartgui name="session">
<MenuBar>
<Menu name="file">
<Action name="open-browser" group="session-operations"/>
<Action name="close-session" group="session-operations"/>
</Menu>
<Menu name="edit">
......@@ -46,6 +47,7 @@
<Action name="copy"/>
<Action name="paste"/>
<Action name="clear-history-and-reset"/>
<Action name="open-browser"/>
<Separator/>
<Action name="show-menubar"/>
<Action name="change-profile"/>
......
......@@ -21,6 +21,7 @@
#include "SessionController.h"
// Qt
#include <QtGui/QApplication>
#include <QMenu>
// KDE
......@@ -29,6 +30,7 @@
#include <KInputDialog>
#include <KLocale>
#include <KMenu>
#include <KRun>
#include <kshell.h>
#include <KToggleAction>
#include <KUrl>
......@@ -400,6 +402,12 @@ void SessionController::setupActions()
action->setText( i18n("&Close Tab") );
action->setShortcut( QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_W) );
connect( action , SIGNAL(triggered()) , this , SLOT(closeSession()) );
// Open Browser
action = collection->addAction("open-browser");
action->setText( i18n("Open Browser Here") );
action->setIcon( KIcon("folder-open") );
connect( action, SIGNAL(triggered()), this, SLOT(openBrowser()) );
// Copy and Paste
action = collection->addAction("copy");
......@@ -623,6 +631,12 @@ void SessionController::closeSession()
_session->close();
}
void SessionController::openBrowser()
{
kDebug() << "url is" << url();
new KRun(url(), QApplication::activeWindow());
}
void SessionController::copy()
{
_view->copyClipboard();
......
......@@ -150,6 +150,7 @@ public slots:
private slots:
// menu item handlers
void openBrowser();
void copy();
void paste();
void clear();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment