/***************************************************************************
- * Copyright (C) 2005-09 by the Quassel Project *
+ * Copyright (C) 2005-2012 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
public:
GraphicalUi(QObject *parent = 0);
- virtual ~GraphicalUi();
+ virtual void init();
//! Access global ActionCollections.
/** These ActionCollections are associated with the main window, i.e. they contain global
* create appropriate Action objects using GraphicalUi::actionCollection(cat)->add\<Action\>().
* @param category The category (default: "General")
*/
- static ActionCollection *actionCollection(const QString &category = "General");
+ static ActionCollection *actionCollection(const QString &category = "General", const QString &translatedCategory = QString());
+ static QHash<QString, ActionCollection *> actionCollections();
+
+ //! Load custom shortcuts from ShortcutSettings
+ /** @note This method assumes that all configurable actions are defined when being called
+ */
+ static void loadShortcuts();
+
+ //! Save custom shortcuts to ShortcutSettings
+ static void saveShortcuts();
inline static ContextMenuActionProvider *contextMenuActionProvider();
inline static ToolBarActionProvider *toolBarActionProvider();
//! Toggle main widget
static void toggleMainWidget();
+ //! Check if the main widget if (fully, in KDE) visible
+ static bool isMainWidgetVisible();
+
protected:
//! This is the widget we associate global actions with, typically the main window
void setMainWidget(QWidget *);
* it should be activated or hidden. Without KDE, we need to resort to checking the current state
* as Qt knows it, ignoring windows covering it.
* @param performToggle If true, toggle the window's state in addition to checking visibility
- * @return True, if the window is currently visible
+ * @return True, if the window is currently *not* visible (needs activation)
*/
bool checkMainWidgetVisibility(bool performToggle);
virtual bool eventFilter(QObject *obj, QEvent *event);
+protected slots:
+ virtual void disconnectedFromCore();
+
private:
static inline GraphicalUi *instance();