Skip to content
Permalink
Browse files

Extension of QgisInterface so also actions from plugins can be set in…

… configure shortcuts dialog.

git-svn-id: http://svn.osgeo.org/qgis/trunk@10741 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed May 5, 2009
1 parent ceb305c commit 3d2bbba6801a6ad75da442221a627235573f01b1
Showing with 27 additions and 0 deletions.
  1. +13 −0 src/app/qgisappinterface.cpp
  2. +8 −0 src/app/qgisappinterface.h
  3. +6 −0 src/gui/qgisinterface.h
@@ -29,6 +29,7 @@
#include "qgsmaplayerregistry.h"
#include "qgsmapcanvas.h"
#include "qgslegend.h"
#include "qgsshortcutsmanager.h"

QgisAppInterface::QgisAppInterface( QgisApp * _qgis )
: qgis( _qgis )
@@ -185,6 +186,18 @@ void QgisAppInterface::refreshLegend( QgsMapLayer *l )
void QgisAppInterface::addWindow( QAction *action ) { qgis->addWindow( action ); }
void QgisAppInterface::removeWindow( QAction *action ) { qgis->removeWindow( action ); }


bool QgisAppInterface::registerMainWindowAction( QAction* action, QString defaultShortcut )
{
return QgsShortcutsManager::instance()->registerAction( action, defaultShortcut );
}

bool QgisAppInterface::unregisterMainWindowAction( QAction* action )
{
return QgsShortcutsManager::instance()->unregisterAction( action );
}


//! Menus
QMenu *QgisAppInterface::fileMenu() { return qgis->fileMenu(); }
QMenu *QgisAppInterface::editMenu() { return qgis->editMenu(); }
@@ -116,6 +116,14 @@ class QgisAppInterface : public QgisInterface
* windows which are hidden rather than deleted when closed. */
virtual void removeWindow( QAction *action );

/** Register action to the shortcuts manager so its shortcut can be changed in GUI.
@note added in version 1.2. */
virtual bool registerMainWindowAction( QAction* action, QString defaultShortcut );

/** Unregister a previously registered action. (e.g. when plugin is going to be unloaded.
@note added in version 1.2. */
virtual bool unregisterMainWindowAction( QAction* action );

/** Accessors for inserting items into menus and toolbars.
* An item can be inserted before any existing action.
*/
@@ -135,6 +135,12 @@ class GUI_EXPORT QgisInterface : public QObject
* windows which are hidden rather than deleted when closed. */
virtual void removeWindow( QAction *action ) = 0;

/** Register action to the shortcuts manager so its shortcut can be changed in GUI */
virtual bool registerMainWindowAction( QAction* action, QString defaultShortcut ) = 0;

/** Unregister a previously registered action. (e.g. when plugin is going to be unloaded */
virtual bool unregisterMainWindowAction( QAction* action ) = 0;

// TODO: is this deprecated in favour of QgsContextHelp?
/** Open a url in the users browser. By default the QGIS doc directory is used
* as the base for the URL. To open a URL that is not relative to the installed

0 comments on commit 3d2bbba

Please sign in to comment.
You can’t perform that action at this time.