Stellarium 0.12.0
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · Renderer · File Structure

StelShortcutMgr Class Reference

Manager of the keyboard shortcuts tied to different features. More...

#include <StelShortcutMgr.hpp>

List of all members.

Public Slots

void setAllActionsEnabled (bool enable)
 Enable/disable all actions of application.
void restoreDefaultShortcuts ()
 Restore the default combinations by reloading and resaving.

Signals

void shortcutChanged (StelShortcut *shortcut)

Public Member Functions

void init ()
bool loadShortcuts (const QString &filePath, bool overload=false)
 Load shortcuts from an existing file.
void loadShortcuts ()
 Search for file with shortcuts, load shortcuts from it.
void saveShortcuts ()
 Save current shortcuts to file.
void saveShortcuts (QIODevice *output) const
QAction * addGuiAction (const QString &actionId, bool temporary, const QString &text, const QString &primaryKey, const QString &altKey, const QString &groupId, bool checkable=true, bool autoRepeat=false, bool global=false)
 Add a new action managed by the GUI.
void changeActionPrimaryKey (const QString &actionId, const QString &groupId, QKeySequence newKey)
void changeActionAltKey (const QString &actionId, const QString &groupId, QKeySequence newKey)
void setShortcutText (const QString &actionId, const QString &groupId, const QString &description)
QAction * getGuiAction (const QString &actionName)
 Get a pointer to an action managed by the GUI.
QAction * addScriptToAction (const QString &actionId, const QString &script, const QString &scriptAction=QString())
 Bind script evaluation to given action.
QList< StelShortcutGroup * > getGroupList () const
 Get a list of all shortcut groups.

Detailed Description

Manager of the keyboard shortcuts tied to different features.

At the moment, the vast majority of QActions used in Stellarium are defined in a JSON file copied to the user data directory on the first run, similar to the configuration file.

Definition at line 34 of file StelShortcutMgr.hpp.


Member Function Documentation

QAction* StelShortcutMgr::addGuiAction ( const QString &  actionId,
bool  temporary,
const QString &  text,
const QString &  primaryKey,
const QString &  altKey,
const QString &  groupId,
bool  checkable = true,
bool  autoRepeat = false,
bool  global = false 
)

Add a new action managed by the GUI.

This method should be used to add new shortcuts to the program.

Parameters:
text Short human-readable description in English. Mark the string for translation with the N_() macro and it will be translated when displayed in ShortcutsDialog or HelpDialog.
QAction* StelShortcutMgr::addScriptToAction ( const QString &  actionId,
const QString &  script,
const QString &  scriptAction = QString() 
)

Bind script evaluation to given action.

QList<StelShortcutGroup*> StelShortcutMgr::getGroupList (  )  const

Get a list of all shortcut groups.

QAction* StelShortcutMgr::getGuiAction ( const QString &  actionName  ) 

Get a pointer to an action managed by the GUI.

Directly queryies the StelAppGraphicsWidget instance for a child with the given name.

Parameters:
actionName Qt object name for this action
Returns:
a pointer to the QAction object or NULL if doesn't exist
void StelShortcutMgr::loadShortcuts (  ) 

Search for file with shortcuts, load shortcuts from it.

bool StelShortcutMgr::loadShortcuts ( const QString &  filePath,
bool  overload = false 
)

Load shortcuts from an existing file.

Parameters:
filePath full path to the file.
overload if true, if a shortcut in the file already exists, replace its keys with the ones in the file.
void StelShortcutMgr::restoreDefaultShortcuts (  )  [slot]

Restore the default combinations by reloading and resaving.

void StelShortcutMgr::saveShortcuts (  ) 

Save current shortcuts to file.

void StelShortcutMgr::setAllActionsEnabled ( bool  enable  )  [slot]

Enable/disable all actions of application.

need for editing shortcuts without trigging any actions


The documentation for this class was generated from the following file:
Generated on Thu Jan 31 14:05:47 2013 for Stellarium by  doxygen 1.6.3