Commit f4e4a120 authored by Mehrdad Momeny's avatar Mehrdad Momeny

FEATURE:208799 a button added to toolbar that can open the blog in our user internet browser.

svn path=/trunk/KDE/kdepim/blogilo/; revision=1031741
parent a8f10ca4
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="blogilo" version="8">
<kpartgui name="blogilo" version="9">
<MenuBar>
<Menu name="blog"><text>Blog</text>
<Action name="add_blog" />
......@@ -22,5 +22,6 @@
<Action name="publish_post" />
<Separator />
<Action name="blogs_list" />
<Action name="open_blog_in_browser" />
</Toolbar>
</kpartgui>
......@@ -59,6 +59,7 @@
#include <QTimer>
#define TIMEOUT 5000
#include <KToolInvocation>
MainWindow::MainWindow()
: KXmlGuiWindow(), mCurrentBlogId(__currentBlogId)
......@@ -182,6 +183,11 @@ void MainWindow::setupActions()
blogs = new KSelectAction( this );
actionCollection()->addAction( QLatin1String( "blogs_list" ), blogs );
KAction *actOpenBlog = new KAction(KIcon("applications-internet"), i18n("Open in browser"), this);
actionCollection()->addAction( QLatin1String("open_blog_in_browser"), actOpenBlog);
actOpenBlog->setToolTip(i18n("Open current blog in browser"));
connect( actOpenBlog, SIGNAL(triggered(bool)), this, SLOT(slotOpenCurrentBlogInBrowser()) );
}
void MainWindow::loadTempPosts()
......@@ -641,4 +647,13 @@ void MainWindow::uploadMediaObject()
uploadDlg->init( &DBMan::self()->blog(mCurrentBlogId) );
}
void MainWindow::slotOpenCurrentBlogInBrowser()
{
KUrl url( DBMan::self()->blog( mCurrentBlogId ).blogUrl() );
if(url.isValid())
KToolInvocation::invokeBrowser(url.url());
else
KMessageBox::sorry(this, i18n("Cannot find current blog URL."));
}
#include "mainwindow.moc"
......@@ -58,6 +58,7 @@ signals:
void settingsChanged();
protected slots:
void slotOpenCurrentBlogInBrowser();
void slotSettingsChanged();
void sltCreateNewPost();
void addBlog();
......
Markdown is supported
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