We now support translateable titles for ActionCollections, and also support
multiple collections in KDE-integrated Quassel (this did work for !KDE already).
}
void MainWin::setupActions() {
}
void MainWin::setupActions() {
- ActionCollection *coll = QtUi::actionCollection("General");
+ ActionCollection *coll = QtUi::actionCollection("General", tr("General"));
// File
coll->addAction("ConnectCore", new Action(SmallIcon("network-connect"), tr("&Connect to Core..."), coll,
this, SLOT(showCoreConnectionDlg())));
// File
coll->addAction("ConnectCore", new Action(SmallIcon("network-connect"), tr("&Connect to Core..."), coll,
this, SLOT(showCoreConnectionDlg())));
QtUi::style(), SLOT(reload()), QKeySequence::Refresh));
// Navigation
QtUi::style(), SLOT(reload()), QKeySequence::Refresh));
// Navigation
+ coll = QtUi::actionCollection("Navigation", tr("Navigation"));
+
coll->addAction("JumpHotBuffer", new Action(tr("Jump to hot chat"), coll,
this, SLOT(on_jumpHotBuffer_triggered()), QKeySequence(Qt::META + Qt::Key_A)));
}
coll->addAction("JumpHotBuffer", new Action(tr("Jump to hot chat"), coll,
this, SLOT(on_jumpHotBuffer_triggered()), QKeySequence(Qt::META + Qt::Key_A)));
}
void MainWin::showShortcutsDlg() {
#ifdef HAVE_KDE
void MainWin::showShortcutsDlg() {
#ifdef HAVE_KDE
- KShortcutsDialog::configure(QtUi::actionCollection("General"), KShortcutsEditor::LetterShortcutsDisallowed);
+ KShortcutsDialog dlg(KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcutsDisallowed, this);
+ foreach(KActionCollection *coll, QtUi::actionCollections())
+ dlg.addCollection(coll, coll->property("Category").toString());
+ dlg.exec();
#else
SettingsPageDlg dlg(new ShortcutsSettingsPage(QtUi::actionCollections(), this), this);
dlg.exec();
#else
SettingsPageDlg dlg(new ShortcutsSettingsPage(QtUi::actionCollections(), this), this);
dlg.exec();
-ActionCollection *GraphicalUi::actionCollection(const QString &category) {
+ActionCollection *GraphicalUi::actionCollection(const QString &category, const QString &translatedCategory) {
if(_actionCollections.contains(category))
return _actionCollections.value(category);
ActionCollection *coll = new ActionCollection(_mainWidget);
if(_actionCollections.contains(category))
return _actionCollections.value(category);
ActionCollection *coll = new ActionCollection(_mainWidget);
- coll->setProperty("Category", category);
+
+ if(!translatedCategory.isEmpty())
+ coll->setProperty("Category", translatedCategory);
+ else
+ coll->setProperty("Category", category);
+
if(_mainWidget)
coll->addAssociatedWidget(_mainWidget);
_actionCollections.insert(category, coll);
if(_mainWidget)
coll->addAssociatedWidget(_mainWidget);
_actionCollections.insert(category, coll);
* create appropriate Action objects using GraphicalUi::actionCollection(cat)->add\<Action\>().
* @param category The category (default: "General")
*/
* 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
static QHash<QString, ActionCollection *> actionCollections();
//! Load custom shortcuts from ShortcutSettings