[Marble-devel] patch for qt only
harshit jain
sonu.itbhu at googlemail.com
Mon Mar 23 17:55:54 CET 2009
Hi,
This is the patch that adds handbook menuitem in 'Help' menu.
--
Harshit Jain,
B.Tech Part II,
Computer Science and Engineering,
IT-BHU, Varanasi.
Mob: +91 9305250184
Work Email: harshit.jain.cse07 at itbhu.ac.in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/marble-devel/attachments/20090323/36c304a4/attachment.htm
-------------- next part --------------
Index: trunk/src/QtMainWindow.cpp
===================================================================
--- trunk/src/QtMainWindow.cpp (revision 1)
+++ trunk/src/QtMainWindow.cpp (working copy)
@@ -22,7 +22,7 @@
#include <QtGui/QIcon>
#include <QtGui/QMenuBar>
#include <QtGui/QStatusBar>
-
+#include <QtGui/QDesktopServices>
#include <QtGui/QFileDialog>
#include <QtGui/QMessageBox>
@@ -147,6 +147,11 @@
m_controlSunAct->setStatusTip(tr("Configure Sun Control"));
connect(m_controlSunAct, SIGNAL(triggered()), this, SLOT( controlSun()));
+ m_handbook = new QAction( QIcon(":/icons/help-contents.png"), tr("Marble Desktop Globe &Handbook"), this);
+ m_handbook->setShortcut(tr("F1"));
+ m_handbook->setStatusTip(tr("Show the Handbook for Marble Desktop Globe"));
+ connect(m_handbook, SIGNAL(triggered()), this, SLOT(handbook()));
+
m_whatsThisAct = new QAction( QIcon(":/icons/help-whatsthis.png"), tr("What's &This"), this);
m_whatsThisAct->setShortcut(tr("Shift+F1"));
m_whatsThisAct->setStatusTip(tr("Show a detailed explanation of the action."));
@@ -192,10 +197,13 @@
m_fileMenu->addAction(m_controlSunAct);
m_helpMenu = menuBar()->addMenu(tr("&Help"));
+ m_helpMenu->addAction(m_handbook);
+ m_helpMenu->addSeparator();
m_helpMenu->addAction(m_whatsThisAct);
m_helpMenu->addSeparator();
m_helpMenu->addAction(m_aboutMarbleAct);
m_helpMenu->addAction(m_aboutQtAct);
+
connect( m_infoBoxesMenu, SIGNAL( aboutToShow() ), this, SLOT( createInfoBoxesMenu() ) );
}
@@ -378,6 +386,12 @@
dlg.exec();
}
+void MainWindow::handbook()
+{
+ if( !QDesktopServices::openUrl( QString( "http://docs.kde.org/stable/en/kdeedu/marble/index.html" ) ) )
+ qDebug() >> "URL not opened";
+}
+
void MainWindow::showPosition( const QString& position )
{
m_position = position;
Index: trunk/src/QtMainWindow.h
===================================================================
--- trunk/src/QtMainWindow.h (revision 1)
+++ trunk/src/QtMainWindow.h (working copy)
@@ -73,6 +73,7 @@
void showSun( bool );
void enterWhatsThis();
void aboutMarble();
+ void handbook();
void openFile();
void setupStatusBar();
@@ -102,6 +103,7 @@
QAction *m_aboutMarbleAct;
QAction *m_aboutQtAct;
QAction *m_openAct;
+ QAction *m_handbook;
QString m_position;
QString m_distance;
More information about the Marble-devel
mailing list