[quarkplayer] r1431 committed - Refactoring: rename ActionCollection to Actions, simplify...

0 views
Skip to first unread message

quark...@googlecode.com

unread,
Feb 22, 2011, 9:46:43 PM2/22/11
to quarkplay...@googlegroups.com
Revision: 1431
Author: tkrotoff
Date: Tue Feb 22 18:44:12 2011
Log: Refactoring: rename ActionCollection to Actions, simplify
PluginInterface

http://code.google.com/p/quarkplayer/source/detail?r=1431

Added:
/trunk/libs/TkUtil/Actions.cpp
/trunk/libs/TkUtil/Actions.h
Deleted:
/trunk/libs/TkUtil/ActionCollection.cpp
/trunk/libs/TkUtil/ActionCollection.h
Modified:
/trunk/libs/Logger/LogWindow.cpp
/trunk/libs/TkUtil/CMakeLists.txt
/trunk/libs/WebBrowser/WebBrowser.cpp
/trunk/quarkplayer/PluginInterface.cpp
/trunk/quarkplayer/PluginInterface.h
/trunk/quarkplayer-plugins/ConfigWindow/ConfigWindowPlugin.cpp
/trunk/quarkplayer-plugins/ConfigWindow/ShortcutsConfig.cpp
/trunk/quarkplayer-plugins/ConfigWindow/ShortcutsConfigWidget.cpp
/trunk/quarkplayer-plugins/FileBrowser/FileBrowserTreeView.cpp
/trunk/quarkplayer-plugins/FileBrowser/FileBrowserTreeView.h
/trunk/quarkplayer-plugins/FileBrowser/FileBrowserWidget.cpp
/trunk/quarkplayer-plugins/FindSubtitles/FindSubtitles.cpp
/trunk/quarkplayer-plugins/FindSubtitles/FindSubtitlesWindow.cpp
/trunk/quarkplayer-plugins/MainWindow/CommonActions.cpp
/trunk/quarkplayer-plugins/MainWindow/MainWindow.cpp
/trunk/quarkplayer-plugins/MainWindow/MockMainWindow.cpp
/trunk/quarkplayer-plugins/MediaController/MediaController.cpp
/trunk/quarkplayer-plugins/MediaController/MediaControllerToolBar.cpp
/trunk/quarkplayer-plugins/PlayToolBar/PlayToolBar.cpp
/trunk/quarkplayer-plugins/Playlist/DragAndDropTreeView.cpp
/trunk/quarkplayer-plugins/Playlist/DragAndDropTreeView.h
/trunk/quarkplayer-plugins/Playlist/PlaylistWidget.cpp
/trunk/quarkplayer-plugins/QuickSettings/QuickSettingsWindow.cpp
/trunk/quarkplayer-plugins/VideoWidget/MyVideoWidget.cpp

=======================================
--- /dev/null
+++ /trunk/libs/TkUtil/Actions.cpp Tue Feb 22 18:44:12 2011
@@ -0,0 +1,78 @@
+/*
+ * QuarkPlayer, a Phonon media player
+ * Copyright (C) 2008-2011 Tanguy Krotoff <tkro...@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Actions.h"
+
+#include "TkUtilLogger.h"
+
+#include <QtGui/QtGui>
+
+QHash<QString, QAction *> Actions::_actionHash;
+
+Actions::Actions() {
+}
+
+Actions::~Actions() {
+ _actionHash.clear();
+}
+
+void Actions::add(const QString & name, QAction * action) {
+ Q_ASSERT(action);
+ Q_ASSERT(!name.isEmpty());
+
+ if (_actionHash.contains(name)) {
+ TkUtilCritical() << "QAction:" << name << "already exist";
+ }
+
+ _actionHash[name] = action;
+}
+
+void Actions::add(const QString & name, const QUuid & uuid, QAction *
action) {
+ Q_ASSERT(!name.isEmpty());
+ Q_ASSERT(!uuid.isNull());
+
+ return Actions::add(name + '_' + uuid.toString(), action);
+}
+
+QAction * Actions::get(const QString & name) {
+ QAction * action = _actionHash.value(name);
+ Q_ASSERT(action);
+
+ return action;
+}
+
+QAction * Actions::get(const QString & name, const QUuid & uuid) {
+ Q_ASSERT(!name.isEmpty());
+ Q_ASSERT(!uuid.isNull());
+
+ return Actions::get(name + '_' + uuid.toString());
+}
+
+QList<QAction *> Actions::list() {
+ QList<QAction *> actionList;
+
+ QHashIterator<QString, QAction *> it(_actionHash);
+ while (it.hasNext()) {
+ it.next();
+
+ QAction * action = it.value();
+ actionList += action;
+ }
+
+ return actionList;
+}
=======================================
--- /dev/null
+++ /trunk/libs/TkUtil/Actions.h Tue Feb 22 18:44:12 2011
@@ -0,0 +1,80 @@
+/*
+ * QuarkPlayer, a Phonon media player
+ * Copyright (C) 2008-2010 Tanguy Krotoff <tkro...@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ACTIONS_H
+#define ACTIONS_H
+
+#include <TkUtil/TkUtilExport.h>
+
+#include <QtCore/QString>
+#include <QtCore/QHash>
+
+class QAction;
+struct QUuid;
+
+/**
+ * Contains all QuarkPlayer' QActions.
+ *
+ * This is code factorization, idea is to not duplicate QAction.
+ * QAction are defined once (with translation, icon...) and used
+ * everywhere via this class.
+ *
+ * Problem with Actions is that every code checking is done at runtime :/
+ *
+ * @author Tanguy Krotoff
+ */
+class TKUTIL_API Actions {
+public:
+
+ /**
+ * Retrieves a global action given a name.
+ */
+ static QAction * get(const QString & name);
+
+ /**
+ * Retrieves a unique action given a name and an id.
+ */
+ static QAction * get(const QString & name, const QUuid & uuid);
+
+ /**
+ * Adds a global action give a name.
+ */
+ static void add(const QString & name, QAction * action);
+
+ /**
+ * Adds a unique action given a name and an id.
+ */
+ static void add(const QString & name, const QUuid & uuid, QAction *
action);
+
+ /**
+ * Retrieves all the actions registered using ActionCollection.
+ */
+ static QList<QAction *> list();
+
+private:
+
+ /** Singleton. */
+ Actions();
+
+ ~Actions();
+
+ /** Associates a name to a QAction. */
+ static QHash<QString, QAction *> _actionHash;
+};
+
+#endif //ACTIONS_H
=======================================
--- /trunk/libs/TkUtil/ActionCollection.cpp Tue Feb 22 16:25:52 2011
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * QuarkPlayer, a Phonon media player
- * Copyright (C) 2008-2011 Tanguy Krotoff <tkro...@gmail.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ActionCollection.h"
-
-#include "TkUtilLogger.h"
-
-#include <QtGui/QtGui>
-
-QHash<QString, QAction *> ActionCollection::_actionHash;
-
-ActionCollection::ActionCollection() {
-}
-
-ActionCollection::~ActionCollection() {
- _actionHash.clear();
-}
-
-void ActionCollection::addAction(const QString & name, QAction * action) {
- Q_ASSERT(action);
- Q_ASSERT(!name.isEmpty());
-
- if (_actionHash.contains(name)) {
- TkUtilCritical() << "QAction:" << name << "already exist";
- }
-
- _actionHash[name] = action;
-}
-
-QAction * ActionCollection::action(const QString & name) {
- QAction * action = _actionHash.value(name);
- Q_ASSERT(action);
-
- return action;
-}
-
-QList<QAction *> ActionCollection::actions() {
- QList<QAction *> actionList;
-
- QHashIterator<QString, QAction *> it(_actionHash);
- while (it.hasNext()) {
- it.next();
-
- QAction * action = it.value();
- actionList += action;
- }
-
- return actionList;
-}
=======================================
--- /trunk/libs/TkUtil/ActionCollection.h Fri Aug 13 02:18:04 2010
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * QuarkPlayer, a Phonon media player
- * Copyright (C) 2008-2010 Tanguy Krotoff <tkro...@gmail.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef ACTIONCOLLECTION_H
-#define ACTIONCOLLECTION_H
-
-#include <TkUtil/TkUtilExport.h>
-
-#include <QtCore/QString>
-#include <QtCore/QHash>
-
-class QAction;
-
-/**
- * Contains all QuarkPlayer' QActions.
- *
- * This is code factorization, idea is to not duplicate QAction.
- * QAction are defined once (with translation, icon...) and used
- * everywhere via this class.
- *
- * Problem with ActionCollection is that every code checking is done at
runtime :/
- *
- * @author Tanguy Krotoff
- */
-class TKUTIL_API ActionCollection {
-public:
-
- static QAction * action(const QString & name);
-
- static void addAction(const QString & name, QAction * action);
-
- static QList<QAction *> actions();
-
-private:
-
- /** Singleton. */
- ActionCollection();
-
- ~ActionCollection();
-
- /** Associates a name to a QAction. */
- static QHash<QString, QAction *> _actionHash;
-};
-
-#endif //ACTIONCOLLECTION_H
=======================================
--- /trunk/libs/Logger/LogWindow.cpp Fri Jan 21 09:19:32 2011
+++ /trunk/libs/Logger/LogWindow.cpp Tue Feb 22 18:44:12 2011
@@ -36,7 +36,7 @@
#include <TkUtil/TkAction.h>
#include <TkUtil/TkToolBar.h>
#include <TkUtil/LanguageChangeEventFilter.h>
-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>

#include <QtGui/QtGui>

@@ -93,10 +93,10 @@

setupUi();

- connect(ActionCollection::action("LogWindow.Open"), SIGNAL(triggered()),
SLOT(open()));
- connect(ActionCollection::action("LogWindow.Save"), SIGNAL(triggered()),
SLOT(save()));
- connect(ActionCollection::action("LogWindow.Clear"), SIGNAL(triggered()),
SLOT(clear()));
- connect(ActionCollection::action("LogWindow.PlayPause"),
SIGNAL(triggered()), SLOT(playPauseButtonClicked()));
+ connect(Actions::get("LogWindow.Open"), SIGNAL(triggered()),
SLOT(open()));
+ connect(Actions::get("LogWindow.Save"), SIGNAL(triggered()),
SLOT(save()));
+ connect(Actions::get("LogWindow.Clear"), SIGNAL(triggered()),
SLOT(clear()));
+ connect(Actions::get("LogWindow.PlayPause"), SIGNAL(triggered()),
SLOT(playPauseButtonClicked()));

RETRANSLATE(this);
retranslate();
@@ -155,10 +155,10 @@

_toolBar = new QToolBar();
TkToolBar::setToolButtonStyle(_toolBar);
- _toolBar->addAction(ActionCollection::action("LogWindow.Open"));
- _toolBar->addAction(ActionCollection::action("LogWindow.Save"));
- _toolBar->addAction(ActionCollection::action("LogWindow.Clear"));
- _toolBar->addAction(ActionCollection::action("LogWindow.PlayPause"));
+ _toolBar->addAction(Actions::get("LogWindow.Open"));
+ _toolBar->addAction(Actions::get("LogWindow.Save"));
+ _toolBar->addAction(Actions::get("LogWindow.Clear"));
+ _toolBar->addAction(Actions::get("LogWindow.PlayPause"));

_outputsButton = new QPushButton();
_menuOutputs = new QMenu();
@@ -186,26 +186,26 @@
QCoreApplication * app = QApplication::instance();
Q_ASSERT(app);

- ActionCollection::addAction("LogWindow.Open", new TkAction(app,
QKeySequence::Open));
- ActionCollection::addAction("LogWindow.Save", new TkAction(app,
QKeySequence::Save));
- ActionCollection::addAction("LogWindow.Clear", new QAction(app));
- ActionCollection::addAction("LogWindow.PlayPause", new QAction(app));
+ Actions::add("LogWindow.Open", new TkAction(app, QKeySequence::Open));
+ Actions::add("LogWindow.Save", new TkAction(app, QKeySequence::Save));
+ Actions::add("LogWindow.Clear", new QAction(app));
+ Actions::add("LogWindow.PlayPause", new QAction(app));
//TODO add level action
}

void LogWindow::retranslate() {
setWindowTitle(tr("Message Log"));

- ActionCollection::action("LogWindow.Open")->setText(tr("&Open"));
-
ActionCollection::action("LogWindow.Open")->setIcon(QIcon::fromTheme("document-open"));
-
- ActionCollection::action("LogWindow.Save")->setText(tr("&Save"));
-
ActionCollection::action("LogWindow.Save")->setIcon(QIcon::fromTheme("document-save"));
-
- ActionCollection::action("LogWindow.Clear")->setText(tr("&Clear"));
-
ActionCollection::action("LogWindow.Clear")->setIcon(QIcon::fromTheme("edit-clear"));
-
- QAction * action = ActionCollection::action("LogWindow.PlayPause");
+ Actions::get("LogWindow.Open")->setText(tr("&Open"));
+
Actions::get("LogWindow.Open")->setIcon(QIcon::fromTheme("document-open"));
+
+ Actions::get("LogWindow.Save")->setText(tr("&Save"));
+
Actions::get("LogWindow.Save")->setIcon(QIcon::fromTheme("document-save"));
+
+ Actions::get("LogWindow.Clear")->setText(tr("&Clear"));
+ Actions::get("LogWindow.Clear")->setIcon(QIcon::fromTheme("edit-clear"));
+
+ QAction * action = Actions::get("LogWindow.PlayPause");
LogModel::State state = _model->state();
switch (state) {
case LogModel::PlayingState:
=======================================
--- /trunk/libs/TkUtil/CMakeLists.txt Sun May 30 04:35:00 2010
+++ /trunk/libs/TkUtil/CMakeLists.txt Tue Feb 22 18:44:12 2011
@@ -13,7 +13,7 @@
CloseEventFilter.cpp
KeyEventFilter.cpp
DropEventFilter.cpp
- ActionCollection.cpp
+ Actions.cpp
TkConfig.cpp
Translator.cpp
TkStackedWidget.cpp
=======================================
--- /trunk/libs/WebBrowser/WebBrowser.cpp Wed Aug 25 15:38:42 2010
+++ /trunk/libs/WebBrowser/WebBrowser.cpp Tue Feb 22 18:44:12 2011
@@ -21,7 +21,7 @@
#include "TkTextBrowser.h"
#include "WebBrowserLogger.h"

-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/LanguageChangeEventFilter.h>

#ifdef WEBKIT
@@ -48,11 +48,11 @@

_toolBar = new QToolBar();
_toolBar->setIconSize(QSize(16, 16));
- _toolBar->addAction(ActionCollection::action("WebBrowser.Backward"));
- _toolBar->addAction(ActionCollection::action("WebBrowser.Forward"));
- _toolBar->addAction(ActionCollection::action("WebBrowser.Reload"));
- _toolBar->addAction(ActionCollection::action("WebBrowser.Stop"));
- _toolBar->addAction(ActionCollection::action("WebBrowser.Home"));
+ _toolBar->addAction(Actions::get("WebBrowser.Backward"));
+ _toolBar->addAction(Actions::get("WebBrowser.Forward"));
+ _toolBar->addAction(Actions::get("WebBrowser.Reload"));
+ _toolBar->addAction(Actions::get("WebBrowser.Stop"));
+ _toolBar->addAction(Actions::get("WebBrowser.Home"));
layout->addWidget(_toolBar);

_urlLineEdit = new QLineEdit();
@@ -60,10 +60,10 @@
//Do not use QLineEdit::editingFinished() since it will trigger go()
//even with QLineEdit::setText()
connect(_urlLineEdit, SIGNAL(returnPressed()), SLOT(go()));
- _toolBar->addAction(ActionCollection::action("WebBrowser.Go"));
- connect(ActionCollection::action("WebBrowser.Go"), SIGNAL(triggered()),
SLOT(go()));
- _toolBar->addAction(ActionCollection::action("WebBrowser.OpenBrowser"));
- connect(ActionCollection::action("WebBrowser.OpenBrowser"),
SIGNAL(triggered()), SLOT(openExternalWebBrowser()));
+ _toolBar->addAction(Actions::get("WebBrowser.Go"));
+ connect(Actions::get("WebBrowser.Go"), SIGNAL(triggered()), SLOT(go()));
+ _toolBar->addAction(Actions::get("WebBrowser.OpenBrowser"));
+ connect(Actions::get("WebBrowser.OpenBrowser"), SIGNAL(triggered()),
SLOT(openExternalWebBrowser()));

#ifdef WEBKIT
_webView = new QWebView();
@@ -71,24 +71,24 @@

connect(_webView, SIGNAL(urlChanged(const QUrl &)), SLOT(urlChanged(const
QUrl &)));
connect(_webView, SIGNAL(urlChanged(const QUrl &)),
SLOT(historyChanged()));
- connect(ActionCollection::action("WebBrowser.Backward"),
SIGNAL(triggered()), _webView, SLOT(back()));
- connect(ActionCollection::action("WebBrowser.Forward"),
SIGNAL(triggered()), _webView, SLOT(forward()));
- connect(ActionCollection::action("WebBrowser.Reload"),
SIGNAL(triggered()), _webView, SLOT(reload()));
- connect(ActionCollection::action("WebBrowser.Home"), SIGNAL(triggered()),
SLOT(home()));
- connect(ActionCollection::action("WebBrowser.Stop"), SIGNAL(triggered()),
_webView, SLOT(stop()));
+ connect(Actions::get("WebBrowser.Backward"), SIGNAL(triggered()),
_webView, SLOT(back()));
+ connect(Actions::get("WebBrowser.Forward"), SIGNAL(triggered()),
_webView, SLOT(forward()));
+ connect(Actions::get("WebBrowser.Reload"), SIGNAL(triggered()), _webView,
SLOT(reload()));
+ connect(Actions::get("WebBrowser.Home"), SIGNAL(triggered()),
SLOT(home()));
+ connect(Actions::get("WebBrowser.Stop"), SIGNAL(triggered()), _webView,
SLOT(stop()));
#else
_textBrowser = new TkTextBrowser();
layout->addWidget(_textBrowser);

connect(_textBrowser, SIGNAL(sourceChanged(const QUrl &)),
SLOT(urlChanged(const QUrl &)));
connect(_textBrowser, SIGNAL(historyChanged()), SLOT(historyChanged()));
- connect(ActionCollection::action("WebBrowser.Backward"),
SIGNAL(triggered()), _textBrowser, SLOT(backward()));
- connect(ActionCollection::action("WebBrowser.Forward"),
SIGNAL(triggered()), _textBrowser, SLOT(forward()));
- connect(ActionCollection::action("WebBrowser.Reload"),
SIGNAL(triggered()), _textBrowser, SLOT(reload()));
- connect(ActionCollection::action("WebBrowser.Home"), SIGNAL(triggered()),
SLOT(home()));
+ connect(Actions::get("WebBrowser.Backward"), SIGNAL(triggered()),
_textBrowser, SLOT(backward()));
+ connect(Actions::get("WebBrowser.Forward"), SIGNAL(triggered()),
_textBrowser, SLOT(forward()));
+ connect(Actions::get("WebBrowser.Reload"), SIGNAL(triggered()),
_textBrowser, SLOT(reload()));
+ connect(Actions::get("WebBrowser.Home"), SIGNAL(triggered()),
SLOT(home()));
//QTextBrowser cannot stops current rendering, multithreaded?
- //connect(ActionCollection::action("WebBrowser.Stop"),
SIGNAL(triggered()), _textBrowser, SLOT(stop()));
- ActionCollection::action("WebBrowser.Stop")->setEnabled(false);
+ //connect(Actions::get("WebBrowser.Stop"), SIGNAL(triggered()),
_textBrowser, SLOT(stop()));
+ Actions::get("WebBrowser.Stop")->setEnabled(false);
#endif //WEBKIT

//Initializes the backward and forward QAction
@@ -106,36 +106,36 @@
QCoreApplication * app = QApplication::instance();
Q_ASSERT(app);

- ActionCollection::addAction("WebBrowser.Backward", new QAction(app));
- ActionCollection::addAction("WebBrowser.Forward", new QAction(app));
- ActionCollection::addAction("WebBrowser.Reload", new QAction(app));
- ActionCollection::addAction("WebBrowser.Stop", new QAction(app));
- ActionCollection::addAction("WebBrowser.Home", new QAction(app));
- ActionCollection::addAction("WebBrowser.Go", new QAction(app));
- ActionCollection::addAction("WebBrowser.OpenBrowser", new QAction(app));
+ Actions::add("WebBrowser.Backward", new QAction(app));
+ Actions::add("WebBrowser.Forward", new QAction(app));
+ Actions::add("WebBrowser.Reload", new QAction(app));
+ Actions::add("WebBrowser.Stop", new QAction(app));
+ Actions::add("WebBrowser.Home", new QAction(app));
+ Actions::add("WebBrowser.Go", new QAction(app));
+ Actions::add("WebBrowser.OpenBrowser", new QAction(app));
}

void WebBrowser::retranslate() {
- ActionCollection::action("WebBrowser.Backward")->setText(tr("Back"));
-
ActionCollection::action("WebBrowser.Backward")->setIcon(QIcon::fromTheme("go-previous"));
-
- ActionCollection::action("WebBrowser.Forward")->setText(tr("Forward"));
-
ActionCollection::action("WebBrowser.Forward")->setIcon(QIcon::fromTheme("go-next"));
-
- ActionCollection::action("WebBrowser.Reload")->setText(tr("Reload"));
-
ActionCollection::action("WebBrowser.Reload")->setIcon(QIcon::fromTheme("view-refresh"));
-
- ActionCollection::action("WebBrowser.Stop")->setText(tr("Stop"));
-
ActionCollection::action("WebBrowser.Stop")->setIcon(QIcon::fromTheme("process-stop"));
-
- ActionCollection::action("WebBrowser.Home")->setText(tr("Home"));
-
ActionCollection::action("WebBrowser.Home")->setIcon(QIcon::fromTheme("go-home"));
-
- ActionCollection::action("WebBrowser.Go")->setText(tr("Go"));
-
ActionCollection::action("WebBrowser.Go")->setIcon(QIcon::fromTheme("go-jump-locationbar"));
-
- ActionCollection::action("WebBrowser.OpenBrowser")->setText(tr("Open
External Browser"));
-
ActionCollection::action("WebBrowser.OpenBrowser")->setIcon(QIcon::fromTheme("internet-web-browser"));
+ Actions::get("WebBrowser.Backward")->setText(tr("Back"));
+
Actions::get("WebBrowser.Backward")->setIcon(QIcon::fromTheme("go-previous"));
+
+ Actions::get("WebBrowser.Forward")->setText(tr("Forward"));
+ Actions::get("WebBrowser.Forward")->setIcon(QIcon::fromTheme("go-next"));
+
+ Actions::get("WebBrowser.Reload")->setText(tr("Reload"));
+
Actions::get("WebBrowser.Reload")->setIcon(QIcon::fromTheme("view-refresh"));
+
+ Actions::get("WebBrowser.Stop")->setText(tr("Stop"));
+
Actions::get("WebBrowser.Stop")->setIcon(QIcon::fromTheme("process-stop"));
+
+ Actions::get("WebBrowser.Home")->setText(tr("Home"));
+ Actions::get("WebBrowser.Home")->setIcon(QIcon::fromTheme("go-home"));
+
+ Actions::get("WebBrowser.Go")->setText(tr("Go"));
+
Actions::get("WebBrowser.Go")->setIcon(QIcon::fromTheme("go-jump-locationbar"));
+
+ Actions::get("WebBrowser.OpenBrowser")->setText(tr("Open External
Browser"));
+
Actions::get("WebBrowser.OpenBrowser")->setIcon(QIcon::fromTheme("internet-web-browser"));
}

void WebBrowser::setHtml(const QString & html) {
@@ -153,7 +153,7 @@
void WebBrowser::setUrl(const QUrl & url) {
if (_homeUrl.isEmpty()) {
_homeUrl = url.toString();
- ActionCollection::action("WebBrowser.Home")->setToolTip(_homeUrl);
+ Actions::get("WebBrowser.Home")->setToolTip(_homeUrl);

_homeHtml = HOME_HTML_INVALID;
}
@@ -168,7 +168,7 @@
void WebBrowser::setUrlLineEdit(const QString & url) {
if (_homeUrl.isEmpty()) {
_homeUrl = url;
- ActionCollection::action("WebBrowser.Home")->setToolTip(_homeUrl);
+ Actions::get("WebBrowser.Home")->setToolTip(_homeUrl);
}

_urlLineEdit->setText(url);
@@ -199,8 +199,8 @@
title = _textBrowser->historyTitle(-1);
#endif //WEBKIT

-
ActionCollection::action("WebBrowser.Backward")->setEnabled(!title.isEmpty());
- ActionCollection::action("WebBrowser.Backward")->setToolTip(title);
+ Actions::get("WebBrowser.Backward")->setEnabled(!title.isEmpty());
+ Actions::get("WebBrowser.Backward")->setToolTip(title);
}

void WebBrowser::setForwardActionToolTip() {
@@ -211,8 +211,8 @@
title = _textBrowser->historyTitle(+1);
#endif //WEBKIT

-
ActionCollection::action("WebBrowser.Forward")->setEnabled(!title.isEmpty());
- ActionCollection::action("WebBrowser.Forward")->setToolTip(title);
+ Actions::get("WebBrowser.Forward")->setEnabled(!title.isEmpty());
+ Actions::get("WebBrowser.Forward")->setToolTip(title);
}

void WebBrowser::urlChanged(const QUrl & url) {
=======================================
--- /trunk/quarkplayer/PluginInterface.cpp Sun Feb 20 13:15:39 2011
+++ /trunk/quarkplayer/PluginInterface.cpp Tue Feb 22 18:44:12 2011
@@ -21,7 +21,7 @@
#include "QuarkPlayer.h"
#include "QuarkPlayerCoreLogger.h"

-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>

PluginInterface::PluginInterface(QuarkPlayer & quarkPlayer, const QUuid &
uuid)
: _quarkPlayer(quarkPlayer) {
@@ -40,15 +40,3 @@
QUuid PluginInterface::uuid() const {
return _uuid;
}
-
-QAction * PluginInterface::uuidAction(const QString & name) {
- Q_ASSERT(!name.isEmpty());
- Q_ASSERT(!_uuid.isNull());
- return ActionCollection::action(name + '_' + _uuid.toString());
-}
-
-void PluginInterface::addUuidAction(const QString & name, QAction *
action) {
- Q_ASSERT(!name.isEmpty());
- Q_ASSERT(!_uuid.isNull());
- return ActionCollection::addAction(name + '_' + _uuid.toString(), action);
-}
=======================================
--- /trunk/quarkplayer/PluginInterface.h Fri Aug 13 02:18:04 2010
+++ /trunk/quarkplayer/PluginInterface.h Tue Feb 22 18:44:12 2011
@@ -73,24 +73,6 @@
*/
QUuid uuid() const;

- /**
- * Gets a QAction given a name and the uuid of the plugin.
- *
- * Helper/factorization function.
- *
- * @see ActionCollection
- */
- QAction * uuidAction(const QString & name);
-
- /**
- * Adds a QAction given a name and the uuid of the plugin.
- *
- * Helper/factorization function.
- *
- * @see ActionCollection
- */
- void addUuidAction(const QString & name, QAction * action);
-
protected:

/**
=======================================
--- /trunk/quarkplayer-plugins/ConfigWindow/ConfigWindowPlugin.cpp Tue Feb
22 17:14:14 2011
+++ /trunk/quarkplayer-plugins/ConfigWindow/ConfigWindowPlugin.cpp Tue Feb
22 18:44:12 2011
@@ -27,7 +27,7 @@

#include <quarkplayer-plugins/MainWindow/MainWindow.h>

-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>

#include <QtGui/QtGui>

@@ -60,7 +60,7 @@

loadSettings();

- connect(ActionCollection::action("CommonActions.Configure"),
SIGNAL(triggered()),
+ connect(Actions::get("CommonActions.Configure"), SIGNAL(triggered()),
SLOT(showConfigWindow()));
}

=======================================
--- /trunk/quarkplayer-plugins/ConfigWindow/ShortcutsConfig.cpp Fri Aug 13
02:18:04 2010
+++ /trunk/quarkplayer-plugins/ConfigWindow/ShortcutsConfig.cpp Tue Feb 22
18:44:12 2011
@@ -24,7 +24,7 @@
#include <quarkplayer/config/Config.h>

#include <TkUtil/TkAction.h>
-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>

#include <QtGui/QtGui>

@@ -65,7 +65,7 @@
QAction * ShortcutsConfig::findAction(const QString & name) const {
QAction * result = NULL;

- QList<QAction *> actions = ActionCollection::actions();
+ QList<QAction *> actions = Actions::list();
foreach (QAction * action, actions) {
if (name == action->objectName()) {
result = action;
@@ -85,7 +85,7 @@
settings.beginWriteArray(SETTINGS_GROUP);
int count = 0;

- QList<QAction *> actions = ActionCollection::actions();
+ QList<QAction *> actions = Actions::list();
foreach (QAction * action, actions) {
QString name = action->objectName();
QString shortcuts = ShortcutsConfigWidget::toString(action->shortcuts());
=======================================
--- /trunk/quarkplayer-plugins/ConfigWindow/ShortcutsConfigWidget.cpp Fri
Aug 13 02:18:04 2010
+++ /trunk/quarkplayer-plugins/ConfigWindow/ShortcutsConfigWidget.cpp Tue
Feb 22 18:44:12 2011
@@ -26,7 +26,7 @@
#include <quarkplayer/config/Config.h>

#include <TkUtil/TkAction.h>
-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/TkFileDialog.h>

#include <QtGui/QtGui>
@@ -100,7 +100,7 @@
_shortcutItems.clear();
_ui->actionList->clear();

- QList<QAction *> actions = ActionCollection::actions();
+ QList<QAction *> actions = Actions::list();

foreach (QAction * action, actions) {
TkAction * tkAction = qobject_cast<TkAction *>(action);
=======================================
--- /trunk/quarkplayer-plugins/FileBrowser/FileBrowserTreeView.cpp Mon Feb
21 09:03:06 2011
+++ /trunk/quarkplayer-plugins/FileBrowser/FileBrowserTreeView.cpp Tue Feb
22 18:44:12 2011
@@ -33,6 +33,7 @@
#include <MediaInfoFetcher/MediaInfoFetcher.h>

#include <TkUtil/LanguageChangeEventFilter.h>
+#include <TkUtil/Actions.h>

#include <phonon/mediaobject.h>

@@ -51,6 +52,7 @@
: QTreeView(NULL) {

_fileBrowserWidget = fileBrowserWidget;
+ _uuid = _fileBrowserWidget->uuid();

populateActionCollection();

@@ -61,10 +63,14 @@
connect(this, SIGNAL(activated(const QModelIndex &)),
SLOT(activated(const QModelIndex &)));

- connect(_fileBrowserWidget->uuidAction("FileBrowser.AddToPlaylist"),
SIGNAL(triggered()), SLOT(addToPlaylist()));
- connect(_fileBrowserWidget->uuidAction("FileBrowser.Play"),
SIGNAL(triggered()), SLOT(play()));
- connect(_fileBrowserWidget->uuidAction("FileBrowser.GetInfo"),
SIGNAL(triggered()), SLOT(viewMediaInfo()));
- connect(_fileBrowserWidget->uuidAction("FileBrowser.OpenDir"),
SIGNAL(triggered()), SLOT(openDir()));
+ connect(Actions::get("FileBrowser.AddToPlaylist", _uuid),
SIGNAL(triggered()),
+ SLOT(addToPlaylist()));
+ connect(Actions::get("FileBrowser.Play", _uuid), SIGNAL(triggered()),
+ SLOT(play()));
+ connect(Actions::get("FileBrowser.GetInfo", _uuid), SIGNAL(triggered()),
+ SLOT(viewMediaInfo()));
+ connect(Actions::get("FileBrowser.OpenDir", _uuid), SIGNAL(triggered()),
+ SLOT(openDir()));

RETRANSLATE(this);
retranslate();
@@ -75,11 +81,11 @@

void FileBrowserTreeView::contextMenuEvent(QContextMenuEvent * event) {
QMenu menu(this);
-
menu.addAction(_fileBrowserWidget->uuidAction("FileBrowser.AddToPlaylist"));
- menu.addAction(_fileBrowserWidget->uuidAction("FileBrowser.Play"));
+ menu.addAction(Actions::get("FileBrowser.AddToPlaylist", _uuid));
+ menu.addAction(Actions::get("FileBrowser.Play", _uuid));
menu.addSeparator();
- menu.addAction(_fileBrowserWidget->uuidAction("FileBrowser.GetInfo"));
- menu.addAction(_fileBrowserWidget->uuidAction("FileBrowser.OpenDir"));
+ menu.addAction(Actions::get("FileBrowser.GetInfo", _uuid));
+ menu.addAction(Actions::get("FileBrowser.OpenDir", _uuid));
menu.exec(event->globalPos());
}

@@ -87,10 +93,10 @@
QCoreApplication * app = QApplication::instance();
Q_ASSERT(app);

- _fileBrowserWidget->addUuidAction("FileBrowser.AddToPlaylist", new
QAction(app));
- _fileBrowserWidget->addUuidAction("FileBrowser.Play", new QAction(app));
- _fileBrowserWidget->addUuidAction("FileBrowser.GetInfo", new
QAction(app));
- _fileBrowserWidget->addUuidAction("FileBrowser.OpenDir", new
QAction(app));
+ Actions::add("FileBrowser.AddToPlaylist", _uuid, new QAction(app));
+ Actions::add("FileBrowser.Play", _uuid, new QAction(app));
+ Actions::add("FileBrowser.GetInfo", _uuid, new QAction(app));
+ Actions::add("FileBrowser.OpenDir", _uuid, new QAction(app));
}

void FileBrowserTreeView::activated(const QModelIndex & index) {
@@ -132,10 +138,10 @@
}

void FileBrowserTreeView::retranslate() {
-
_fileBrowserWidget->uuidAction("FileBrowser.AddToPlaylist")->setText(tr("Add
to Playlist"));
- _fileBrowserWidget->uuidAction("FileBrowser.Play")->setText(tr("Play"));
- _fileBrowserWidget->uuidAction("FileBrowser.GetInfo")->setText(tr("Get
Info..."));
- _fileBrowserWidget->uuidAction("FileBrowser.OpenDir")->setText(tr("Open
Directory..."));
+ Actions::get("FileBrowser.AddToPlaylist", _uuid)->setText(tr("Add to
Playlist"));
+ Actions::get("FileBrowser.Play", _uuid)->setText(tr("Play"));
+ Actions::get("FileBrowser.GetInfo", _uuid)->setText(tr("Get Info..."));
+ Actions::get("FileBrowser.OpenDir", _uuid)->setText(tr("Open
Directory..."));
}

QFileInfo FileBrowserTreeView::fileInfo(const QModelIndex & index) const {
=======================================
--- /trunk/quarkplayer-plugins/FileBrowser/FileBrowserTreeView.h Mon Feb 21
09:03:06 2011
+++ /trunk/quarkplayer-plugins/FileBrowser/FileBrowserTreeView.h Tue Feb 22
18:44:12 2011
@@ -21,6 +21,8 @@

#include <QtGui/QTreeView>

+#include <QtCore/QUuid>
+
class FileBrowserWidget;

class QMouseEvent;
@@ -62,6 +64,8 @@
QFileInfo fileInfo(const QModelIndex & index) const;

FileBrowserWidget * _fileBrowserWidget;
+
+ QUuid _uuid;
};

#endif //FILEBROWSERTREEVIEW_H
=======================================
--- /trunk/quarkplayer-plugins/FileBrowser/FileBrowserWidget.cpp Tue Feb 22
17:14:14 2011
+++ /trunk/quarkplayer-plugins/FileBrowser/FileBrowserWidget.cpp Tue Feb 22
18:44:12 2011
@@ -36,6 +36,7 @@
#include <TkUtil/TkToolBar.h>
#include <TkUtil/SearchLineEdit.h>
#include <TkUtil/TkFileDialog.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/LanguageChangeEventFilter.h>

#include <QtGui/QVBoxLayout>
@@ -133,8 +134,9 @@
layout()->addWidget(toolBar);

//Browse button
- toolBar->addAction(uuidAction("FileBrowser.Browse"));
- connect(uuidAction("FileBrowser.Browse"), SIGNAL(triggered()),
SLOT(configure()));
+ toolBar->addAction(Actions::get("FileBrowser.Browse", uuid()));
+ connect(Actions::get("FileBrowser.Browse", uuid()), SIGNAL(triggered()),
+ SLOT(configure()));

//Search line edit
QStringList history =
Config::instance().value(FILEBROWSER_SEARCH_HISTORY_KEY).toStringList();
@@ -143,17 +145,18 @@
toolBar->addWidget(_searchLineEdit);

//New file browser button
- toolBar->addAction(uuidAction("FileBrowser.New"));
- connect(uuidAction("FileBrowser.New"), SIGNAL(triggered()),
SLOT(createNewFileBrowserWidget()));
+ toolBar->addAction(Actions::get("FileBrowser.New", uuid()));
+ connect(Actions::get("FileBrowser.New", uuid()), SIGNAL(triggered()),
+ SLOT(createNewFileBrowserWidget()));
}

void FileBrowserWidget::populateActionCollection() {
QCoreApplication * app = QApplication::instance();
Q_ASSERT(app);

- addUuidAction("FileBrowser.Browse", new QAction(app));
-
- addUuidAction("FileBrowser.New", new QAction(app));
+ Actions::add("FileBrowser.Browse", uuid(), new QAction(app));
+
+ Actions::add("FileBrowser.New", uuid(), new QAction(app));
}

void FileBrowserWidget::loadDirModel() {
@@ -290,11 +293,11 @@
void FileBrowserWidget::retranslate() {
_searchLineEdit->setToolTip(tr("Search files, use whitespaces to separate
words"));

- uuidAction("FileBrowser.Browse")->setText(tr("Change Directory"));
- uuidAction("FileBrowser.Browse")->setIcon(QIcon::fromTheme("folder"));
-
- uuidAction("FileBrowser.New")->setText(tr("New File Browser Window"));
- uuidAction("FileBrowser.New")->setIcon(QIcon::fromTheme("tab-new"));
+ Actions::get("FileBrowser.Browse", uuid())->setText(tr("Change
Directory"));
+ Actions::get("FileBrowser.Browse",
uuid())->setIcon(QIcon::fromTheme("folder"));
+
+ Actions::get("FileBrowser.New", uuid())->setText(tr("New File Browser
Window"));
+ Actions::get("FileBrowser.New",
uuid())->setIcon(QIcon::fromTheme("tab-new"));

setWindowTitle(QString());
}
=======================================
--- /trunk/quarkplayer-plugins/FindSubtitles/FindSubtitles.cpp Sun Feb 20
17:34:30 2011
+++ /trunk/quarkplayer-plugins/FindSubtitles/FindSubtitles.cpp Tue Feb 22
18:44:12 2011
@@ -28,7 +28,7 @@
#include <quarkplayer-plugins/MainWindow/MainWindow.h>
#include <quarkplayer-plugins/MediaController/MediaController.h>

-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/LanguageChangeEventFilter.h>

#include <phonon/mediaobject.h>
@@ -60,9 +60,9 @@

addMenusToMediaController();

- connect(ActionCollection::action("FindSubtitles.FindSubtitles"),
SIGNAL(triggered()),
+ connect(Actions::get("FindSubtitles.FindSubtitles"), SIGNAL(triggered()),
SLOT(findSubtitles()));
- connect(ActionCollection::action("FindSubtitles.UploadSubtitles"),
SIGNAL(triggered()),
+ connect(Actions::get("FindSubtitles.UploadSubtitles"),
SIGNAL(triggered()),
SLOT(uploadSubtitles()));

RETRANSLATE(this);
@@ -76,15 +76,15 @@
QCoreApplication * app = QApplication::instance();
Q_ASSERT(app);

- ActionCollection::addAction("FindSubtitles.FindSubtitles", new
QAction(app));
- ActionCollection::addAction("FindSubtitles.UploadSubtitles", new
QAction(app));
+ Actions::add("FindSubtitles.FindSubtitles", new QAction(app));
+ Actions::add("FindSubtitles.UploadSubtitles", new QAction(app));
}

void FindSubtitles::retranslate() {
-
ActionCollection::action("FindSubtitles.FindSubtitles")->setText(tr("&Find
Subtitles..."));
-
ActionCollection::action("FindSubtitles.FindSubtitles")->setIcon(QIcon::fromTheme("edit-find"));
-
-
ActionCollection::action("FindSubtitles.UploadSubtitles")->setText(tr("&Upload
Subtitles..."));
+ Actions::get("FindSubtitles.FindSubtitles")->setText(tr("&Find
Subtitles..."));
+
Actions::get("FindSubtitles.FindSubtitles")->setIcon(QIcon::fromTheme("edit-find"));
+
+ Actions::get("FindSubtitles.UploadSubtitles")->setText(tr("&Upload
Subtitles..."));
}

void FindSubtitles::addMenusToMediaController() {
@@ -95,11 +95,11 @@
return;
}

-
menuSubtitle->addAction(ActionCollection::action("FindSubtitles.FindSubtitles"));
-
menuSubtitle->addAction(ActionCollection::action("FindSubtitles.UploadSubtitles"));
+ menuSubtitle->addAction(Actions::get("FindSubtitles.FindSubtitles"));
+ menuSubtitle->addAction(Actions::get("FindSubtitles.UploadSubtitles"));

//Add find susbtitles action to the MediaController tool bar
-
mediaController->toolBar()->addAction(ActionCollection::action("FindSubtitles.FindSubtitles"));
+
mediaController->toolBar()->addAction(Actions::get("FindSubtitles.FindSubtitles"));
}

void FindSubtitles::findSubtitles() {
=======================================
--- /trunk/quarkplayer-plugins/FindSubtitles/FindSubtitlesWindow.cpp Wed
Aug 25 15:38:42 2010
+++ /trunk/quarkplayer-plugins/FindSubtitles/FindSubtitlesWindow.cpp Tue
Feb 22 18:44:12 2011
@@ -32,7 +32,7 @@
#include <FileTypes/FileTypes.h>

#include <TkUtil/LanguageChangeEventFilter.h>
-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/TkFileDialog.h>

#include <QtGui/QtGui>
@@ -102,12 +102,12 @@
SLOT(downloadProgress(qint64, qint64)));

populateActionCollection();
- connect(ActionCollection::action("FindSubtitles.Download"),
SIGNAL(triggered()), SLOT(downloadButtonClicked()));
- connect(ActionCollection::action("FindSubtitles.CopyClipboard"),
SIGNAL(triggered()), SLOT(copyClipboard()));
+ connect(Actions::get("FindSubtitles.Download"), SIGNAL(triggered()),
SLOT(downloadButtonClicked()));
+ connect(Actions::get("FindSubtitles.CopyClipboard"), SIGNAL(triggered()),
SLOT(copyClipboard()));

_contextMenu = new QMenu(this);
-
_contextMenu->addAction(ActionCollection::action("FindSubtitles.Download"));
-
_contextMenu->addAction(ActionCollection::action("FindSubtitles.CopyClipboard"));
+ _contextMenu->addAction(Actions::get("FindSubtitles.Download"));
+ _contextMenu->addAction(Actions::get("FindSubtitles.CopyClipboard"));

RETRANSLATE(this);
retranslate();
@@ -125,8 +125,8 @@
QCoreApplication * app = QApplication::instance();
Q_ASSERT(app);

- ActionCollection::addAction("FindSubtitles.Download", new QAction(app));
- ActionCollection::addAction("FindSubtitles.CopyClipboard", new
QAction(app));
+ Actions::add("FindSubtitles.Download", new QAction(app));
+ Actions::add("FindSubtitles.CopyClipboard", new QAction(app));
}

void FindSubtitlesWindow::retranslate() {
@@ -153,11 +153,11 @@

_ui->refreshButton->setIcon(QIcon::fromTheme("view-refresh"));

-
ActionCollection::action("FindSubtitles.Download")->setText(tr("&Download"));
-
ActionCollection::action("FindSubtitles.Download")->setIcon(QIcon::fromTheme("go-down"));
-
-
ActionCollection::action("FindSubtitles.CopyClipboard")->setText(tr("&Copy
link to clipboard"));
-
ActionCollection::action("FindSubtitles.CopyClipboard")->setIcon(QIcon::fromTheme("edit-copy"));
+ Actions::get("FindSubtitles.Download")->setText(tr("&Download"));
+
Actions::get("FindSubtitles.Download")->setIcon(QIcon::fromTheme("go-down"));
+
+ Actions::get("FindSubtitles.CopyClipboard")->setText(tr("&Copy link to
clipboard"));
+
Actions::get("FindSubtitles.CopyClipboard")->setIcon(QIcon::fromTheme("edit-copy"));
}

void FindSubtitlesWindow::refreshButtonClicked() {
@@ -196,8 +196,8 @@

void FindSubtitlesWindow::currentItemChanged(const QModelIndex & current,
const QModelIndex & /*previous*/) {
_ui->downloadButton->setEnabled(current.isValid());
-
ActionCollection::action("FindSubtitles.Download")->setEnabled(current.isValid());
-
ActionCollection::action("FindSubtitles.CopyClipboard")->setEnabled(current.isValid());
+ Actions::get("FindSubtitles.Download")->setEnabled(current.isValid());
+
Actions::get("FindSubtitles.CopyClipboard")->setEnabled(current.isValid());
}

void FindSubtitlesWindow::setLanguage(const QString & language) {
=======================================
--- /trunk/quarkplayer-plugins/MainWindow/CommonActions.cpp Tue Feb 22
16:25:52 2011
+++ /trunk/quarkplayer-plugins/MainWindow/CommonActions.cpp Tue Feb 22
18:44:12 2011
@@ -22,7 +22,7 @@

#include <quarkplayer/QuarkPlayer.h>

-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/TkAction.h>
#include <TkUtil/DesktopEnvironment.h>
#include <TkUtil/LanguageChangeEventFilter.h>
@@ -57,174 +57,174 @@
QCoreApplication * app = QApplication::instance();
Q_ASSERT(app);

- ActionCollection::addAction("CommonActions.OpenFile", new TkAction(app,
QKeySequence::Open));
- ActionCollection::addAction("CommonActions.Quit", new TkAction(app,
tr("Ctrl+Q"), tr("Alt+X")));
- ActionCollection::addAction("CommonActions.ReportBug", new QAction(app));
- ActionCollection::addAction("CommonActions.ShowMailingList", new
QAction(app));
- ActionCollection::addAction("CommonActions.ShowLog", new QAction(app));
- ActionCollection::addAction("CommonActions.About", new TkAction(app,
tr("Ctrl+F1")));
- ActionCollection::addAction("CommonActions.AboutQt", new QAction(app));
- ActionCollection::addAction("CommonActions.OpenDVD", new TkAction(app,
tr("Ctrl+D")));
- ActionCollection::addAction("CommonActions.OpenURL", new TkAction(app,
tr("Ctrl+U")));
- ActionCollection::addAction("CommonActions.OpenVCD", new QAction(app));
- ActionCollection::addAction("CommonActions.NewMediaObject", new
QAction(app));
- ActionCollection::addAction("CommonActions.Equalizer", new TkAction(app,
tr("Ctrl+E")));
- ActionCollection::addAction("CommonActions.Configure", new QAction(app));
- ActionCollection::addAction("CommonActions.EmptyMenu", new QAction(app));
+ Actions::add("CommonActions.OpenFile", new TkAction(app,
QKeySequence::Open));
+ Actions::add("CommonActions.Quit", new TkAction(app, tr("Ctrl+Q"),
tr("Alt+X")));
+ Actions::add("CommonActions.ReportBug", new QAction(app));
+ Actions::add("CommonActions.ShowMailingList", new QAction(app));
+ Actions::add("CommonActions.ShowLog", new QAction(app));
+ Actions::add("CommonActions.About", new TkAction(app, tr("Ctrl+F1")));
+ Actions::add("CommonActions.AboutQt", new QAction(app));
+ Actions::add("CommonActions.OpenDVD", new TkAction(app, tr("Ctrl+D")));
+ Actions::add("CommonActions.OpenURL", new TkAction(app, tr("Ctrl+U")));
+ Actions::add("CommonActions.OpenVCD", new QAction(app));
+ Actions::add("CommonActions.NewMediaObject", new QAction(app));
+ Actions::add("CommonActions.Equalizer", new TkAction(app, tr("Ctrl+E")));
+ Actions::add("CommonActions.Configure", new QAction(app));
+ Actions::add("CommonActions.EmptyMenu", new QAction(app));

TkAction * action = new TkAction(app, tr("Space"), Qt::Key_MediaPlay,
Qt::Key_Pause);
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.PlayPause", action);
+ Actions::add("CommonActions.PlayPause", action);
action = new TkAction(app, Qt::Key_MediaStop);
- ActionCollection::addAction("CommonActions.Stop", action);
+ Actions::add("CommonActions.Stop", action);
action = new TkAction(app, tr("Ctrl+N"), tr(">"), Qt::Key_MediaNext);
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.NextTrack", action);
+ Actions::add("CommonActions.NextTrack", action);
action = new TkAction(app, tr("Ctrl+P"), tr("<"), Qt::Key_MediaPrevious);
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.PreviousTrack", action);
+ Actions::add("CommonActions.PreviousTrack", action);

action = new TkAction(app, tr("Left"));
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.JumpBackward10s", action);
+ Actions::add("CommonActions.JumpBackward10s", action);
action = new TkAction(app, tr("Ctrl+Left"));
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.JumpBackward1min", action);
+ Actions::add("CommonActions.JumpBackward1min", action);
action = new TkAction(app, tr("Shift+Left"));
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.JumpBackward10min", action);
+ Actions::add("CommonActions.JumpBackward10min", action);

action = new TkAction(app, tr("Right"));
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.JumpForward10s", action);
+ Actions::add("CommonActions.JumpForward10s", action);
action = new TkAction(app, tr("Ctrl+Right"));
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.JumpForward1min", action);
+ Actions::add("CommonActions.JumpForward1min", action);
action = new TkAction(app, tr("Shift+Right"));
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.JumpForward10min", action);
+ Actions::add("CommonActions.JumpForward10min", action);

action = new TkAction(app, tr("["));
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.SpeedDecrease10%", action);
+ Actions::add("CommonActions.SpeedDecrease10%", action);
action = new TkAction(app, tr("]"));
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.SpeedIncrease10%", action);
+ Actions::add("CommonActions.SpeedIncrease10%", action);

action = new TkAction(app, tr("Ctrl+M"));
action->setShortcutContext(Qt::ApplicationShortcut);
action->setCheckable(true);
- ActionCollection::addAction("CommonActions.VolumeMute", action);
+ Actions::add("CommonActions.VolumeMute", action);

action = new TkAction(app, tr("Ctrl+Down"), tr("-"), tr("Alt+-"));
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.VolumeDecrease10%", action);
+ Actions::add("CommonActions.VolumeDecrease10%", action);
action = new TkAction(app, tr("Ctrl+Up"), tr("+"), tr("Alt++"));
action->setShortcutContext(Qt::ApplicationShortcut);
- ActionCollection::addAction("CommonActions.VolumeIncrease10%", action);
+ Actions::add("CommonActions.VolumeIncrease10%", action);

action = new TkAction(app, tr("Ctrl+F"), tr("Alt+Return"));
action->setShortcutContext(Qt::ApplicationShortcut);
action->setCheckable(true);
- ActionCollection::addAction("CommonActions.FullScreen", action);
+ Actions::add("CommonActions.FullScreen", action);

action = new TkAction(app, tr("Esc"));
- ActionCollection::addAction("CommonActions.FullScreenExit", action);
+ Actions::add("CommonActions.FullScreenExit", action);
}

void CommonActions::retranslate() {
- ActionCollection::action("CommonActions.OpenFile")->setText(tr("Play
&File..."));
-
ActionCollection::action("CommonActions.OpenFile")->setIcon(QIcon::fromTheme("document-open"));
-
- ActionCollection::action("CommonActions.Quit")->setText(tr("&Quit"));
-
ActionCollection::action("CommonActions.Quit")->setIcon(QIcon::fromTheme("application-exit"));
-
- ActionCollection::action("CommonActions.ReportBug")->setText(tr("&Report
a Problem..."));
+ Actions::get("CommonActions.OpenFile")->setText(tr("Play &File..."));
+
Actions::get("CommonActions.OpenFile")->setIcon(QIcon::fromTheme("document-open"));
+
+ Actions::get("CommonActions.Quit")->setText(tr("&Quit"));
+
Actions::get("CommonActions.Quit")->setIcon(QIcon::fromTheme("application-exit"));
+
+ Actions::get("CommonActions.ReportBug")->setText(tr("&Report a
Problem..."));
if (desktopEnvironment() == GNOME) {
-
ActionCollection::action("CommonActions.ReportBug")->setIcon(QIcon::fromTheme("apport"));
+
Actions::get("CommonActions.ReportBug")->setIcon(QIcon::fromTheme("apport"));
} else {
-
ActionCollection::action("CommonActions.ReportBug")->setIcon(QIcon::fromTheme("tools-report-bug"));
+
Actions::get("CommonActions.ReportBug")->setIcon(QIcon::fromTheme("tools-report-bug"));
}

-
ActionCollection::action("CommonActions.ShowMailingList")->setText(tr("&Discuss
about QuarkPlayer..."));
+ Actions::get("CommonActions.ShowMailingList")->setText(tr("&Discuss about
QuarkPlayer..."));
if (desktopEnvironment() == GNOME) {
-
ActionCollection::action("CommonActions.ShowMailingList")->setIcon(QIcon::fromTheme("help-faq"));
+
Actions::get("CommonActions.ShowMailingList")->setIcon(QIcon::fromTheme("help-faq"));
} else {
-
ActionCollection::action("CommonActions.ShowMailingList")->setIcon(QIcon::fromTheme("help-hint"));
+
Actions::get("CommonActions.ShowMailingList")->setIcon(QIcon::fromTheme("help-hint"));
}

- ActionCollection::action("CommonActions.ShowLog")->setText(tr("View
&Log"));
+ Actions::get("CommonActions.ShowLog")->setText(tr("View &Log"));
QIcon logIcon;
if (desktopEnvironment() == GNOME) {
logIcon = QIcon::fromTheme("logviewer");
} else {
logIcon = QIcon::fromTheme("text-x-log");
}
- ActionCollection::action("CommonActions.ShowLog")->setIcon(logIcon);
-
- ActionCollection::action("CommonActions.About")->setText(tr("&About"));
-
- ActionCollection::action("CommonActions.AboutQt")->setText(tr("About
&Qt"));
-
- ActionCollection::action("CommonActions.OpenDVD")->setText(tr("Play
&DVD..."));
-
ActionCollection::action("CommonActions.OpenDVD")->setIcon(QIcon::fromTheme("media-optical"));
-
- ActionCollection::action("CommonActions.OpenURL")->setText(tr("Play
&URL..."));
-
- ActionCollection::action("CommonActions.OpenVCD")->setText(tr("Play
&VCD..."));
+ Actions::get("CommonActions.ShowLog")->setIcon(logIcon);
+
+ Actions::get("CommonActions.About")->setText(tr("&About"));
+
+ Actions::get("CommonActions.AboutQt")->setText(tr("About &Qt"));
+
+ Actions::get("CommonActions.OpenDVD")->setText(tr("Play &DVD..."));
+
Actions::get("CommonActions.OpenDVD")->setIcon(QIcon::fromTheme("media-optical"));
+
+ Actions::get("CommonActions.OpenURL")->setText(tr("Play &URL..."));
+
+ Actions::get("CommonActions.OpenVCD")->setText(tr("Play &VCD..."));
\
- ActionCollection::action("CommonActions.NewMediaObject")->setText(tr("New
Media Window"));
-
ActionCollection::action("CommonActions.NewMediaObject")->setIcon(QIcon::fromTheme("tab-new"));
-
-
ActionCollection::action("CommonActions.Equalizer")->setText(tr("&Equalizer..."));
-
ActionCollection::action("CommonActions.Equalizer")->setIcon(QIcon::fromTheme("view-media-equalizer"));
-
-
ActionCollection::action("CommonActions.Configure")->setText(tr("&Configure..."));
-
ActionCollection::action("CommonActions.Configure")->setIcon(QIcon::fromTheme("preferences-system"));
-
-
ActionCollection::action("CommonActions.EmptyMenu")->setText(tr("<empty>"));
- ActionCollection::action("CommonActions.EmptyMenu")->setEnabled(false);
-
-
ActionCollection::action("CommonActions.PreviousTrack")->setText(tr("P&revious
Track"));
-
ActionCollection::action("CommonActions.PreviousTrack")->setIcon(QIcon::fromTheme("media-skip-backward"));
-
-
ActionCollection::action("CommonActions.PlayPause")->setText(tr("&Play/Pause"));
-
ActionCollection::action("CommonActions.PlayPause")->setIcon(QIcon::fromTheme("media-playback-start"));
-
- ActionCollection::action("CommonActions.Stop")->setText(tr("&Stop"));
-
ActionCollection::action("CommonActions.Stop")->setIcon(QIcon::fromTheme("media-playback-stop"));
-
- ActionCollection::action("CommonActions.NextTrack")->setText(tr("&Next
Track"));
-
ActionCollection::action("CommonActions.NextTrack")->setIcon(QIcon::fromTheme("media-skip-forward"));
-
-
ActionCollection::action("CommonActions.JumpBackward10s")->setText(tr("Jump
&Backward 10s"));
-
ActionCollection::action("CommonActions.JumpBackward1min")->setText(tr("Jump
&Backward 1min"));
-
ActionCollection::action("CommonActions.JumpBackward1min")->setIcon(QIcon::fromTheme("media-seek-backward"));
-
ActionCollection::action("CommonActions.JumpBackward10min")->setText(tr("Jump
&Backward 10min"));
-
ActionCollection::action("CommonActions.JumpForward10s")->setText(tr("Jump
&Forward 10s"));
-
ActionCollection::action("CommonActions.JumpForward1min")->setText(tr("Jump
&Forward 1min"));
-
ActionCollection::action("CommonActions.JumpForward1min")->setIcon(QIcon::fromTheme("media-seek-forward"));
-
ActionCollection::action("CommonActions.JumpForward10min")->setText(tr("Jump
&Forward 10min"));
-
ActionCollection::action("CommonActions.SpeedDecrease10%")->setText(tr("Decrease
Speed"));
-
ActionCollection::action("CommonActions.SpeedIncrease10%")->setText(tr("Increase
Speed"));
-
-
ActionCollection::action("CommonActions.VolumeMute")->setText(tr("&Mute"));
-
ActionCollection::action("CommonActions.VolumeMute")->setIcon(QIcon::fromTheme("audio-volume-muted"));
-
ActionCollection::action("CommonActions.VolumeDecrease10%")->setText(tr("&Decrease
Volume"));
-
ActionCollection::action("CommonActions.VolumeIncrease10%")->setText(tr("&Increase
Volume"));
-
-
ActionCollection::action("CommonActions.FullScreen")->setText(tr("&Fullscreen"));
-
ActionCollection::action("CommonActions.FullScreen")->setIcon(QIcon::fromTheme("view-fullscreen"));
-
-
ActionCollection::action("CommonActions.FullScreenExit")->setText(tr("&Exit
Fullscreen"));
+ Actions::get("CommonActions.NewMediaObject")->setText(tr("New Media
Window"));
+
Actions::get("CommonActions.NewMediaObject")->setIcon(QIcon::fromTheme("tab-new"));
+
+ Actions::get("CommonActions.Equalizer")->setText(tr("&Equalizer..."));
+
Actions::get("CommonActions.Equalizer")->setIcon(QIcon::fromTheme("view-media-equalizer"));
+
+ Actions::get("CommonActions.Configure")->setText(tr("&Configure..."));
+
Actions::get("CommonActions.Configure")->setIcon(QIcon::fromTheme("preferences-system"));
+
+ Actions::get("CommonActions.EmptyMenu")->setText(tr("<empty>"));
+ Actions::get("CommonActions.EmptyMenu")->setEnabled(false);
+
+ Actions::get("CommonActions.PreviousTrack")->setText(tr("P&revious
Track"));
+
Actions::get("CommonActions.PreviousTrack")->setIcon(QIcon::fromTheme("media-skip-backward"));
+
+ Actions::get("CommonActions.PlayPause")->setText(tr("&Play/Pause"));
+
Actions::get("CommonActions.PlayPause")->setIcon(QIcon::fromTheme("media-playback-start"));
+
+ Actions::get("CommonActions.Stop")->setText(tr("&Stop"));
+
Actions::get("CommonActions.Stop")->setIcon(QIcon::fromTheme("media-playback-stop"));
+
+ Actions::get("CommonActions.NextTrack")->setText(tr("&Next Track"));
+
Actions::get("CommonActions.NextTrack")->setIcon(QIcon::fromTheme("media-skip-forward"));
+
+ Actions::get("CommonActions.JumpBackward10s")->setText(tr("Jump &Backward
10s"));
+ Actions::get("CommonActions.JumpBackward1min")->setText(tr("Jump
&Backward 1min"));
+
Actions::get("CommonActions.JumpBackward1min")->setIcon(QIcon::fromTheme("media-seek-backward"));
+ Actions::get("CommonActions.JumpBackward10min")->setText(tr("Jump
&Backward 10min"));
+ Actions::get("CommonActions.JumpForward10s")->setText(tr("Jump &Forward
10s"));
+ Actions::get("CommonActions.JumpForward1min")->setText(tr("Jump &Forward
1min"));
+
Actions::get("CommonActions.JumpForward1min")->setIcon(QIcon::fromTheme("media-seek-forward"));
+ Actions::get("CommonActions.JumpForward10min")->setText(tr("Jump &Forward
10min"));
+ Actions::get("CommonActions.SpeedDecrease10%")->setText(tr("Decrease
Speed"));
+ Actions::get("CommonActions.SpeedIncrease10%")->setText(tr("Increase
Speed"));
+
+ Actions::get("CommonActions.VolumeMute")->setText(tr("&Mute"));
+
Actions::get("CommonActions.VolumeMute")->setIcon(QIcon::fromTheme("audio-volume-muted"));
+ Actions::get("CommonActions.VolumeDecrease10%")->setText(tr("&Decrease
Volume"));
+ Actions::get("CommonActions.VolumeIncrease10%")->setText(tr("&Increase
Volume"));
+
+ Actions::get("CommonActions.FullScreen")->setText(tr("&Fullscreen"));
+
Actions::get("CommonActions.FullScreen")->setIcon(QIcon::fromTheme("view-fullscreen"));
+
+ Actions::get("CommonActions.FullScreenExit")->setText(tr("&Exit
Fullscreen"));
}

void CommonActions::stateChanged(Phonon::State newState) {
//Enabled/disabled fullscreen button depending if media is a video or
audio
if (_quarkPlayer.currentMediaObject()->hasVideo()) {
- ActionCollection::action("CommonActions.FullScreen")->setEnabled(true);
+ Actions::get("CommonActions.FullScreen")->setEnabled(true);
} else {
- ActionCollection::action("CommonActions.FullScreen")->setEnabled(false);
+ Actions::get("CommonActions.FullScreen")->setEnabled(false);
}

switch (newState) {
@@ -232,33 +232,33 @@
break;

case Phonon::PlayingState:
-
ActionCollection::action("CommonActions.PlayPause")->setText(tr("&Pause"));
-
ActionCollection::action("CommonActions.PlayPause")->setIcon(QIcon::fromTheme("media-playback-pause"));
- disconnect(ActionCollection::action("CommonActions.PlayPause"), 0, 0, 0);
- connect(ActionCollection::action("CommonActions.PlayPause"),
SIGNAL(triggered()),
+ Actions::get("CommonActions.PlayPause")->setText(tr("&Pause"));
+
Actions::get("CommonActions.PlayPause")->setIcon(QIcon::fromTheme("media-playback-pause"));
+ disconnect(Actions::get("CommonActions.PlayPause"), 0, 0, 0);
+ connect(Actions::get("CommonActions.PlayPause"), SIGNAL(triggered()),
_quarkPlayer.currentMediaObject(), SLOT(pause()));

- ActionCollection::action("CommonActions.Stop")->setEnabled(true);
+ Actions::get("CommonActions.Stop")->setEnabled(true);
break;

case Phonon::StoppedState:
-
ActionCollection::action("CommonActions.PlayPause")->setText(tr("P&lay"));
-
ActionCollection::action("CommonActions.PlayPause")->setIcon(QIcon::fromTheme("media-playback-start"));
- disconnect(ActionCollection::action("CommonActions.PlayPause"), 0, 0, 0);
- connect(ActionCollection::action("CommonActions.PlayPause"),
SIGNAL(triggered()),
+ Actions::get("CommonActions.PlayPause")->setText(tr("P&lay"));
+
Actions::get("CommonActions.PlayPause")->setIcon(QIcon::fromTheme("media-playback-start"));
+ disconnect(Actions::get("CommonActions.PlayPause"), 0, 0, 0);
+ connect(Actions::get("CommonActions.PlayPause"), SIGNAL(triggered()),
_quarkPlayer.currentMediaObject(), SLOT(play()));

- ActionCollection::action("CommonActions.Stop")->setEnabled(false);
+ Actions::get("CommonActions.Stop")->setEnabled(false);
break;

case Phonon::PausedState:
-
ActionCollection::action("CommonActions.PlayPause")->setText(tr("P&lay"));
-
ActionCollection::action("CommonActions.PlayPause")->setIcon(QIcon::fromTheme("media-playback-start"));
- disconnect(ActionCollection::action("CommonActions.PlayPause"), 0, 0, 0);
- connect(ActionCollection::action("CommonActions.PlayPause"),
SIGNAL(triggered()),
+ Actions::get("CommonActions.PlayPause")->setText(tr("P&lay"));
+
Actions::get("CommonActions.PlayPause")->setIcon(QIcon::fromTheme("media-playback-start"));
+ disconnect(Actions::get("CommonActions.PlayPause"), 0, 0, 0);
+ connect(Actions::get("CommonActions.PlayPause"), SIGNAL(triggered()),
_quarkPlayer.currentMediaObject(), SLOT(play()));

- ActionCollection::action("CommonActions.Stop")->setEnabled(true);
+ Actions::get("CommonActions.Stop")->setEnabled(true);
break;

case Phonon::LoadingState:
@@ -284,7 +284,7 @@
stateChanged(mediaObject->state());

//Actions connect
- disconnect(ActionCollection::action("CommonActions.Stop"), 0, 0, 0);
- connect(ActionCollection::action("CommonActions.Stop"),
SIGNAL(triggered()),
+ disconnect(Actions::get("CommonActions.Stop"), 0, 0, 0);
+ connect(Actions::get("CommonActions.Stop"), SIGNAL(triggered()),
mediaObject, SLOT(stop()));
}
=======================================
--- /trunk/quarkplayer-plugins/MainWindow/MainWindow.cpp Tue Feb 22
16:25:52 2011
+++ /trunk/quarkplayer-plugins/MainWindow/MainWindow.cpp Tue Feb 22
18:44:12 2011
@@ -32,7 +32,7 @@

#include <Logger/LogWindow.h>

-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/TkFileDialog.h>
#include <TkUtil/TkToolBar.h>
#include <TkUtil/LanguageChangeEventFilter.h>
@@ -90,18 +90,18 @@
_playToolBar = NULL;
_statusBar = NULL;

- connect(ActionCollection::action("CommonActions.OpenFile"),
SIGNAL(triggered()), SLOT(playFile()));
- connect(ActionCollection::action("CommonActions.OpenDVD"),
SIGNAL(triggered()), SLOT(playDVD()));
- connect(ActionCollection::action("CommonActions.OpenURL"),
SIGNAL(triggered()), SLOT(playURL()));
- connect(ActionCollection::action("CommonActions.OpenVCD"),
SIGNAL(triggered()), SLOT(playVCD()));
- connect(ActionCollection::action("CommonActions.NewMediaObject"),
SIGNAL(triggered()), &quarkPlayer, SLOT(createNewMediaObject()));
- connect(ActionCollection::action("CommonActions.Quit"),
SIGNAL(triggered()), SLOT(close()));
- connect(ActionCollection::action("CommonActions.ReportBug"),
SIGNAL(triggered()), SLOT(reportBug()));
- connect(ActionCollection::action("CommonActions.ShowMailingList"),
SIGNAL(triggered()), SLOT(showMailingList()));
- connect(ActionCollection::action("CommonActions.ShowLog"),
SIGNAL(triggered()), SLOT(showLog()));
- connect(ActionCollection::action("CommonActions.About"),
SIGNAL(triggered()), SLOT(about()));
- connect(ActionCollection::action("CommonActions.AboutQt"),
SIGNAL(triggered()), qApp, SLOT(aboutQt()));
- connect(ActionCollection::action("CommonActions.VolumeMute"),
SIGNAL(toggled(bool)), SLOT(mutedToggled(bool)));
+ connect(Actions::get("CommonActions.OpenFile"), SIGNAL(triggered()),
SLOT(playFile()));
+ connect(Actions::get("CommonActions.OpenDVD"), SIGNAL(triggered()),
SLOT(playDVD()));
+ connect(Actions::get("CommonActions.OpenURL"), SIGNAL(triggered()),
SLOT(playURL()));
+ connect(Actions::get("CommonActions.OpenVCD"), SIGNAL(triggered()),
SLOT(playVCD()));
+ connect(Actions::get("CommonActions.NewMediaObject"),
SIGNAL(triggered()), &quarkPlayer, SLOT(createNewMediaObject()));
+ connect(Actions::get("CommonActions.Quit"), SIGNAL(triggered()),
SLOT(close()));
+ connect(Actions::get("CommonActions.ReportBug"), SIGNAL(triggered()),
SLOT(reportBug()));
+ connect(Actions::get("CommonActions.ShowMailingList"),
SIGNAL(triggered()), SLOT(showMailingList()));
+ connect(Actions::get("CommonActions.ShowLog"), SIGNAL(triggered()),
SLOT(showLog()));
+ connect(Actions::get("CommonActions.About"), SIGNAL(triggered()),
SLOT(about()));
+ connect(Actions::get("CommonActions.AboutQt"), SIGNAL(triggered()), qApp,
SLOT(aboutQt()));
+ connect(Actions::get("CommonActions.VolumeMute"), SIGNAL(toggled(bool)),
SLOT(mutedToggled(bool)));

connect(&quarkPlayer,
SIGNAL(currentMediaObjectChanged(Phonon::MediaObject *)),
SLOT(currentMediaObjectChanged(Phonon::MediaObject *)));
@@ -272,64 +272,64 @@

_menuFile = new QMenu();
menuBar()->addMenu(_menuFile);
- _menuFile->addAction(ActionCollection::action("CommonActions.OpenFile"));
- _menuFile->addAction(ActionCollection::action("CommonActions.OpenURL"));
- _menuFile->addAction(ActionCollection::action("CommonActions.OpenDVD"));
- _menuFile->addAction(ActionCollection::action("CommonActions.OpenVCD"));
+ _menuFile->addAction(Actions::get("CommonActions.OpenFile"));
+ _menuFile->addAction(Actions::get("CommonActions.OpenURL"));
+ _menuFile->addAction(Actions::get("CommonActions.OpenDVD"));
+ _menuFile->addAction(Actions::get("CommonActions.OpenVCD"));
_menuFile->addSeparator();
- _menuFile->addAction(ActionCollection::action("CommonActions.Quit"));
+ _menuFile->addAction(Actions::get("CommonActions.Quit"));

_menuPlay = new QMenu();
menuBar()->addMenu(_menuPlay);
-
_menuPlay->addAction(ActionCollection::action("CommonActions.PreviousTrack"));
- _menuPlay->addAction(ActionCollection::action("CommonActions.PlayPause"));
- _menuPlay->addAction(ActionCollection::action("CommonActions.Stop"));
- _menuPlay->addAction(ActionCollection::action("CommonActions.NextTrack"));
+ _menuPlay->addAction(Actions::get("CommonActions.PreviousTrack"));
+ _menuPlay->addAction(Actions::get("CommonActions.PlayPause"));
+ _menuPlay->addAction(Actions::get("CommonActions.Stop"));
+ _menuPlay->addAction(Actions::get("CommonActions.NextTrack"));
_menuPlay->addSeparator();
-
_menuPlay->addAction(ActionCollection::action("CommonActions.JumpBackward10s"));
-
_menuPlay->addAction(ActionCollection::action("CommonActions.JumpBackward1min"));
-
_menuPlay->addAction(ActionCollection::action("CommonActions.JumpBackward10min"));
+ _menuPlay->addAction(Actions::get("CommonActions.JumpBackward10s"));
+ _menuPlay->addAction(Actions::get("CommonActions.JumpBackward1min"));
+ _menuPlay->addAction(Actions::get("CommonActions.JumpBackward10min"));
_menuPlay->addSeparator();
-
_menuPlay->addAction(ActionCollection::action("CommonActions.JumpForward10s"));
-
_menuPlay->addAction(ActionCollection::action("CommonActions.JumpForward1min"));
-
_menuPlay->addAction(ActionCollection::action("CommonActions.JumpForward10min"));
+ _menuPlay->addAction(Actions::get("CommonActions.JumpForward10s"));
+ _menuPlay->addAction(Actions::get("CommonActions.JumpForward1min"));
+ _menuPlay->addAction(Actions::get("CommonActions.JumpForward10min"));
_menuPlay->addSeparator();
-
_menuPlay->addAction(ActionCollection::action("CommonActions.SpeedDecrease10%"));
-
_menuPlay->addAction(ActionCollection::action("CommonActions.SpeedIncrease10%"));
+ _menuPlay->addAction(Actions::get("CommonActions.SpeedDecrease10%"));
+ _menuPlay->addAction(Actions::get("CommonActions.SpeedIncrease10%"));
_menuPlay->addSeparator();
-
_menuPlay->addAction(ActionCollection::action("CommonActions.FullScreen"));
+ _menuPlay->addAction(Actions::get("CommonActions.FullScreen"));
_menuPlay->addSeparator();
-
_menuPlay->addAction(ActionCollection::action("CommonActions.NewMediaObject"));
+ _menuPlay->addAction(Actions::get("CommonActions.NewMediaObject"));

_menuAudio = new QMenu();
menuBar()->addMenu(_menuAudio);
-
_menuAudio->addAction(ActionCollection::action("CommonActions.VolumeMute"));
-
_menuAudio->addAction(ActionCollection::action("CommonActions.VolumeIncrease10%"));
-
_menuAudio->addAction(ActionCollection::action("CommonActions.VolumeDecrease10%"));
+ _menuAudio->addAction(Actions::get("CommonActions.VolumeMute"));
+ _menuAudio->addAction(Actions::get("CommonActions.VolumeIncrease10%"));
+ _menuAudio->addAction(Actions::get("CommonActions.VolumeDecrease10%"));

_menuSettings = new QMenu();
menuBar()->addMenu(_menuSettings);
-
_menuSettings->addAction(ActionCollection::action("CommonActions.Equalizer"));
-
_menuSettings->addAction(ActionCollection::action("CommonActions.Configure"));
+ _menuSettings->addAction(Actions::get("CommonActions.Equalizer"));
+ _menuSettings->addAction(Actions::get("CommonActions.Configure"));

_menuHelp = new QMenu();
menuBar()->addMenu(_menuHelp);
-
_menuHelp->addAction(ActionCollection::action("CommonActions.ShowMailingList"));
- _menuHelp->addAction(ActionCollection::action("CommonActions.ReportBug"));
- _menuHelp->addAction(ActionCollection::action("CommonActions.ShowLog"));
+ _menuHelp->addAction(Actions::get("CommonActions.ShowMailingList"));
+ _menuHelp->addAction(Actions::get("CommonActions.ReportBug"));
+ _menuHelp->addAction(Actions::get("CommonActions.ShowLog"));
_menuHelp->addSeparator();
- _menuHelp->addAction(ActionCollection::action("CommonActions.About"));
- _menuHelp->addAction(ActionCollection::action("CommonActions.AboutQt"));
+ _menuHelp->addAction(Actions::get("CommonActions.About"));
+ _menuHelp->addAction(Actions::get("CommonActions.AboutQt"));

//Main ToolBar
_mainToolBar = new TkToolBar(this);
TkToolBar::setToolButtonStyle(_mainToolBar);
-
_mainToolBar->addAction(ActionCollection::action("CommonActions.OpenFile"));
-
_mainToolBar->addAction(ActionCollection::action("CommonActions.OpenDVD"));
-
//_mainToolBar->addAction(ActionCollection::action("CommonActions.OpenURL"));
+ _mainToolBar->addAction(Actions::get("CommonActions.OpenFile"));
+ _mainToolBar->addAction(Actions::get("CommonActions.OpenDVD"));
+ //_mainToolBar->addAction(Actions::get("CommonActions.OpenURL"));
//_mainToolBar->addSeparator();
-
//_mainToolBar->addAction(ActionCollection::action("CommonActions.Equalizer"));
-
//_mainToolBar->addAction(ActionCollection::action("CommonActions.Configure"));
+ //_mainToolBar->addAction(Actions::get("CommonActions.Equalizer"));
+ //_mainToolBar->addAction(Actions::get("CommonActions.Configure"));
addToolBar(_mainToolBar);

//Main toolbar accessible but disabled by default
@@ -498,20 +498,20 @@
//Resets the window title when needed
connect(mediaObject, SIGNAL(metaDataChanged()),
SLOT(updateWindowTitle()));

- disconnect(ActionCollection::action("CommonActions.Quit"),
SIGNAL(triggered()), mediaObject, SLOT(stop()));
- connect(ActionCollection::action("CommonActions.Quit"),
SIGNAL(triggered()), mediaObject, SLOT(stop()));
+ disconnect(Actions::get("CommonActions.Quit"), SIGNAL(triggered()),
mediaObject, SLOT(stop()));
+ connect(Actions::get("CommonActions.Quit"), SIGNAL(triggered()),
mediaObject, SLOT(stop()));

Phonon::AudioOutput * audioOutput = quarkPlayer().currentAudioOutput();
if (audioOutput) {
//Avoid a crash inside Phonon if the backend couldn't be loaded
-
ActionCollection::action("CommonActions.VolumeMute")->setChecked(audioOutput->isMuted());
+
Actions::get("CommonActions.VolumeMute")->setChecked(audioOutput->isMuted());
disconnect(audioOutput, SIGNAL(mutedChanged(bool)), this,
SLOT(mutedChanged(bool)));
connect(audioOutput, SIGNAL(mutedChanged(bool)),
SLOT(mutedChanged(bool)));
}
}

void MainWindow::mutedChanged(bool muted) {
- ActionCollection::action("CommonActions.VolumeMute")->setChecked(muted);
+ Actions::get("CommonActions.VolumeMute")->setChecked(muted);
}

void MainWindow::mutedToggled(bool muted) {
=======================================
--- /trunk/quarkplayer-plugins/MainWindow/MockMainWindow.cpp Tue Feb 22
17:14:14 2011
+++ /trunk/quarkplayer-plugins/MainWindow/MockMainWindow.cpp Tue Feb 22
18:44:12 2011
@@ -29,7 +29,7 @@

#include <Logger/LogWindow.h>

-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/TkFileDialog.h>

#include <FileTypes/FileTypes.h>
@@ -54,10 +54,10 @@

_playToolBar = NULL;

- connect(ActionCollection::action("CommonActions.OpenFile"),
SIGNAL(triggered()), SLOT(playFile()));
- connect(ActionCollection::action("CommonActions.Quit"),
SIGNAL(triggered()), SLOT(close()));
- connect(ActionCollection::action("CommonActions.ShowLog"),
SIGNAL(triggered()), SLOT(showLog()));
- connect(ActionCollection::action("CommonActions.About"),
SIGNAL(triggered()), SLOT(about()));
+ connect(Actions::get("CommonActions.OpenFile"), SIGNAL(triggered()),
SLOT(playFile()));
+ connect(Actions::get("CommonActions.Quit"), SIGNAL(triggered()),
SLOT(close()));
+ connect(Actions::get("CommonActions.ShowLog"), SIGNAL(triggered()),
SLOT(showLog()));
+ connect(Actions::get("CommonActions.About"), SIGNAL(triggered()),
SLOT(about()));

connect(&quarkPlayer,
SIGNAL(currentMediaObjectChanged(Phonon::MediaObject *)),
SLOT(currentMediaObjectChanged(Phonon::MediaObject *)));
@@ -130,29 +130,29 @@
_menuFile = new QMenu();
_menuFile->setTitle("&File");
menuBar()->addMenu(_menuFile);
- _menuFile->addAction(ActionCollection::action("CommonActions.OpenFile"));
+ _menuFile->addAction(Actions::get("CommonActions.OpenFile"));
_menuFile->addSeparator();
- _menuFile->addAction(ActionCollection::action("CommonActions.Quit"));
+ _menuFile->addAction(Actions::get("CommonActions.Quit"));

_menuPlay = new QMenu();
_menuPlay->setTitle("&Play");
menuBar()->addMenu(_menuPlay);
- _menuPlay->addAction(ActionCollection::action("CommonActions.PlayPause"));
+ _menuPlay->addAction(Actions::get("CommonActions.PlayPause"));
_menuPlay->addSeparator();
-
_menuPlay->addAction(ActionCollection::action("CommonActions.FullScreen"));
+ _menuPlay->addAction(Actions::get("CommonActions.FullScreen"));
//No menu entry for FullScreenExit, see MyVideoWidget.cpp

_menuSettings = new QMenu();
_menuSettings->setTitle("&Settings");
menuBar()->addMenu(_menuSettings);
-
_menuSettings->addAction(ActionCollection::action("CommonActions.Equalizer"));
-
_menuSettings->addAction(ActionCollection::action("CommonActions.Configure"));
+ _menuSettings->addAction(Actions::get("CommonActions.Equalizer"));
+ _menuSettings->addAction(Actions::get("CommonActions.Configure"));

_menuHelp = new QMenu();
_menuHelp->setTitle("&Help");
menuBar()->addMenu(_menuHelp);
- _menuHelp->addAction(ActionCollection::action("CommonActions.ShowLog"));
- _menuHelp->addAction(ActionCollection::action("CommonActions.About"));
+ _menuHelp->addAction(Actions::get("CommonActions.ShowLog"));
+ _menuHelp->addAction(Actions::get("CommonActions.About"));
}

void MockMainWindow::closeEvent(QCloseEvent * event) {
@@ -218,6 +218,6 @@
tmp->disconnect(this);
}

- disconnect(ActionCollection::action("CommonActions.Quit"),
SIGNAL(triggered()), mediaObject, SLOT(stop()));
- connect(ActionCollection::action("CommonActions.Quit"),
SIGNAL(triggered()), mediaObject, SLOT(stop()));
-}
+ disconnect(Actions::get("CommonActions.Quit"), SIGNAL(triggered()),
mediaObject, SLOT(stop()));
+ connect(Actions::get("CommonActions.Quit"), SIGNAL(triggered()),
mediaObject, SLOT(stop()));
+}
=======================================
--- /trunk/quarkplayer-plugins/MediaController/MediaController.cpp Mon Feb
21 09:03:06 2011
+++ /trunk/quarkplayer-plugins/MediaController/MediaController.cpp Tue Feb
22 18:44:12 2011
@@ -31,7 +31,7 @@

#include <FileTypes/FileTypes.h>

-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/TkFileDialog.h>
#include <TkUtil/LanguageChangeEventFilter.h>

@@ -89,7 +89,7 @@
connect(&quarkPlayer,
SIGNAL(currentMediaObjectChanged(Phonon::MediaObject *)),
SLOT(currentMediaObjectChanged(Phonon::MediaObject *)));

- connect(ActionCollection::action("MediaController.OpenSubtitleFile"),
SIGNAL(triggered()),
+ connect(Actions::get("MediaController.OpenSubtitleFile"),
SIGNAL(triggered()),
SLOT(openSubtitleFile()));

RETRANSLATE(this);
@@ -109,7 +109,7 @@
QCoreApplication * app = QApplication::instance();
Q_ASSERT(app);

- ActionCollection::addAction("MediaController.OpenSubtitleFile", new
QAction(app));
+ Actions::add("MediaController.OpenSubtitleFile", new QAction(app));
}

void MediaController::addMenusToMainWindow() {
@@ -122,26 +122,26 @@
QAction * insertBeforeMenuSettings =
_mainWindow->menuSettings()->menuAction();

_menuAudioChannels = new QMenu();
-
_menuAudioChannels->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuAudioChannels->addAction(Actions::get("CommonActions.EmptyMenu"));
_mainWindow->menuAudio()->addMenu(_menuAudioChannels);

_menuSubtitle = new QMenu();
menuBar->insertMenu(insertBeforeMenuSettings, _menuSubtitle);
-
_menuSubtitle->addAction(ActionCollection::action("MediaController.OpenSubtitleFile"));
+
_menuSubtitle->addAction(Actions::get("MediaController.OpenSubtitleFile"));
_menuSubtitles = new QMenu();
-
_menuSubtitles->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuSubtitles->addAction(Actions::get("CommonActions.EmptyMenu"));
_menuSubtitle->addMenu(_menuSubtitles);

_menuBrowse = new QMenu();
menuBar->insertMenu(insertBeforeMenuSettings, _menuBrowse);
_menuTitles = new QMenu();
-
_menuTitles->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuTitles->addAction(Actions::get("CommonActions.EmptyMenu"));
_menuBrowse->addAction(_menuTitles->menuAction());
_menuChapters = new QMenu();
-
_menuChapters->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuChapters->addAction(Actions::get("CommonActions.EmptyMenu"));
_menuBrowse->addAction(_menuChapters->menuAction());
_menuAngles = new QMenu();
-
_menuAngles->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuAngles->addAction(Actions::get("CommonActions.EmptyMenu"));
_menuBrowse->addAction(_menuAngles->menuAction());
}

@@ -154,8 +154,8 @@
}

void MediaController::retranslate() {
-
ActionCollection::action("MediaController.OpenSubtitleFile")->setText(tr("&Open
Subtitle..."));
-
ActionCollection::action("MediaController.OpenSubtitleFile")->setIcon(QIcon::fromTheme("document-open"));
+ Actions::get("MediaController.OpenSubtitleFile")->setText(tr("&Open
Subtitle..."));
+
Actions::get("MediaController.OpenSubtitleFile")->setIcon(QIcon::fromTheme("document-open"));

_menuAudioChannels->setTitle(tr("&Audio Channels"));
_menuSubtitles->setTitle(tr("&Subtitles"));
@@ -260,8 +260,8 @@
removeAllAction(_menuAudioChannels);
removeAllAction(_toolBar->menuAudioChannels());
if (audios.isEmpty()) {
-
_menuAudioChannels->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
-
_toolBar->menuAudioChannels()->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuAudioChannels->addAction(Actions::get("CommonActions.EmptyMenu"));
+
_toolBar->menuAudioChannels()->addAction(Actions::get("CommonActions.EmptyMenu"));
}

for (int i = 0; i < audios.size(); i++) {
@@ -311,8 +311,8 @@
removeAllAction(_menuSubtitles);
removeAllAction(_toolBar->menuSubtitles());
if (subtitles.isEmpty()) {
-
_menuSubtitles->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
-
_toolBar->menuSubtitles()->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuSubtitles->addAction(Actions::get("CommonActions.EmptyMenu"));
+
_toolBar->menuSubtitles()->addAction(Actions::get("CommonActions.EmptyMenu"));
}

for (int i = 0; i < subtitles.size(); i++) {
@@ -370,7 +370,7 @@
int nbTitles = titles.size();
removeAllAction(_menuTitles);
if (titles.isEmpty()) {
-
_menuTitles->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuTitles->addAction(Actions::get("CommonActions.EmptyMenu"));
}

for (int i = 0; i < nbTitles; i++) {
@@ -385,7 +385,7 @@
int nbTitles = titles;
removeAllAction(_menuTitles);
if (titles == 0) {
-
_menuTitles->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuTitles->addAction(Actions::get("CommonActions.EmptyMenu"));
}

for (int i = 0; i < nbTitles; i++) {
@@ -455,7 +455,7 @@
QList<Phonon::ChapterDescription> chapters =
_currentMediaController->availableChapters2();
removeAllAction(_menuChapters);
if (chapters.isEmpty()) {
-
_menuChapters->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuChapters->addAction(Actions::get("CommonActions.EmptyMenu"));
}

for (int i = 0; i < chapters.size(); i++) {
@@ -469,7 +469,7 @@
int chapters = _currentMediaController->availableChapters();
removeAllAction(_menuChapters);
if (chapters == 0) {
-
_menuChapters->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuChapters->addAction(Actions::get("CommonActions.EmptyMenu"));
}

for (int i = 0; i < chapters; i++) {
@@ -518,7 +518,7 @@
int angles = _currentMediaController->availableAngles();
removeAllAction(_menuAngles);
if (angles == 0) {
-
_menuAngles->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuAngles->addAction(Actions::get("CommonActions.EmptyMenu"));
}

for (int i = 0; i < angles; i++) {
=======================================
--- /trunk/quarkplayer-plugins/MediaController/MediaControllerToolBar.cpp
Sun Feb 20 13:15:39 2011
+++ /trunk/quarkplayer-plugins/MediaController/MediaControllerToolBar.cpp
Tue Feb 22 18:44:12 2011
@@ -20,7 +20,7 @@

#include "MediaControllerLogger.h"

-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/LanguageChangeEventFilter.h>

#include <QtGui/QtGui>
@@ -32,13 +32,13 @@

_audioChannelsButton = new QPushButton();
_menuAudioChannels = new QMenu();
-
_menuAudioChannels->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuAudioChannels->addAction(Actions::get("CommonActions.EmptyMenu"));
_audioChannelsButton->setMenu(_menuAudioChannels);
addWidget(_audioChannelsButton);

_subtitlesButton = new QPushButton();
_menuSubtitles = new QMenu();
-
_menuSubtitles->addAction(ActionCollection::action("CommonActions.EmptyMenu"));
+ _menuSubtitles->addAction(Actions::get("CommonActions.EmptyMenu"));
_subtitlesButton->setMenu(_menuSubtitles);
addWidget(_subtitlesButton);

=======================================
--- /trunk/quarkplayer-plugins/PlayToolBar/PlayToolBar.cpp Sun Feb 20
13:15:39 2011
+++ /trunk/quarkplayer-plugins/PlayToolBar/PlayToolBar.cpp Tue Feb 22
18:44:12 2011
@@ -26,7 +26,7 @@

#include <quarkplayer-plugins/MainWindow/MainWindow.h>

-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/LanguageChangeEventFilter.h>

#include <phonon/mediaobject.h>
@@ -120,28 +120,28 @@
//_seekSlider->setIconVisible(true);
//_seekSlider->setTracking(false);

-
//_seekToolBar->addAction(ActionCollection::action("CommonActions.SpeedDecrease10%"));
- connect(ActionCollection::action("CommonActions.SpeedDecrease10%"),
SIGNAL(triggered()), SLOT(decreaseSpeed10()));
-
//_seekToolBar->addAction(ActionCollection::action("CommonActions.JumpBackward10min"));
- connect(ActionCollection::action("CommonActions.JumpBackward10min"),
SIGNAL(triggered()), SLOT(jumpBackward10min()));
-
_seekToolBar->addAction(ActionCollection::action("CommonActions.JumpBackward1min"));
- connect(ActionCollection::action("CommonActions.JumpBackward1min"),
SIGNAL(triggered()), SLOT(jumpBackward1min()));
-
//_seekToolBar->addAction(ActionCollection::action("CommonActions.JumpBackward10s"));
- connect(ActionCollection::action("CommonActions.JumpBackward10s"),
SIGNAL(triggered()), SLOT(jumpBackward10s()));
+ //_seekToolBar->addAction(Actions::get("CommonActions.SpeedDecrease10%"));
+ connect(Actions::get("CommonActions.SpeedDecrease10%"),
SIGNAL(triggered()), SLOT(decreaseSpeed10()));
+
//_seekToolBar->addAction(Actions::get("CommonActions.JumpBackward10min"));
+ connect(Actions::get("CommonActions.JumpBackward10min"),
SIGNAL(triggered()), SLOT(jumpBackward10min()));
+ _seekToolBar->addAction(Actions::get("CommonActions.JumpBackward1min"));
+ connect(Actions::get("CommonActions.JumpBackward1min"),
SIGNAL(triggered()), SLOT(jumpBackward1min()));
+ //_seekToolBar->addAction(Actions::get("CommonActions.JumpBackward10s"));
+ connect(Actions::get("CommonActions.JumpBackward10s"),
SIGNAL(triggered()), SLOT(jumpBackward10s()));

_seekToolBar->addWidget(_seekSlider);

-
//_seekToolBar->addAction(ActionCollection::action("CommonActions.JumpForward10s"));
- connect(ActionCollection::action("CommonActions.JumpForward10s"),
SIGNAL(triggered()), SLOT(jumpForward10s()));
-
_seekToolBar->addAction(ActionCollection::action("CommonActions.JumpForward1min"));
- connect(ActionCollection::action("CommonActions.JumpForward1min"),
SIGNAL(triggered()), SLOT(jumpForward1min()));
-
//_seekToolBar->addAction(ActionCollection::action("CommonActions.JumpForward10min"));
- connect(ActionCollection::action("CommonActions.JumpForward10min"),
SIGNAL(triggered()), SLOT(jumpForward10min()));
-
//_seekToolBar->addAction(ActionCollection::action("CommonActions.SpeedIncrease10%"));
- connect(ActionCollection::action("CommonActions.SpeedIncrease10%"),
SIGNAL(triggered()), SLOT(increaseSpeed10()));
-
- connect(ActionCollection::action("CommonActions.VolumeDecrease10%"),
SIGNAL(triggered()), SLOT(volumeDecrease10()));
- connect(ActionCollection::action("CommonActions.VolumeIncrease10%"),
SIGNAL(triggered()), SLOT(volumeIncrease10()));
+ //_seekToolBar->addAction(Actions::get("CommonActions.JumpForward10s"));
+ connect(Actions::get("CommonActions.JumpForward10s"),
SIGNAL(triggered()), SLOT(jumpForward10s()));
+ _seekToolBar->addAction(Actions::get("CommonActions.JumpForward1min"));
+ connect(Actions::get("CommonActions.JumpForward1min"),
SIGNAL(triggered()), SLOT(jumpForward1min()));
+ //_seekToolBar->addAction(Actions::get("CommonActions.JumpForward10min"));
+ connect(Actions::get("CommonActions.JumpForward10min"),
SIGNAL(triggered()), SLOT(jumpForward10min()));
+ //_seekToolBar->addAction(Actions::get("CommonActions.SpeedIncrease10%"));
+ connect(Actions::get("CommonActions.SpeedIncrease10%"),
SIGNAL(triggered()), SLOT(increaseSpeed10()));
+
+ connect(Actions::get("CommonActions.VolumeDecrease10%"),
SIGNAL(triggered()), SLOT(volumeDecrease10()));
+ connect(Actions::get("CommonActions.VolumeIncrease10%"),
SIGNAL(triggered()), SLOT(volumeIncrease10()));
}

void PlayToolBar::decreaseSpeed10() {
@@ -242,16 +242,16 @@
_controlToolBar = new QToolBar(NULL);
_controlToolBar->setIconSize(QSize(24, 18));

-
_controlToolBar->addAction(ActionCollection::action("CommonActions.PreviousTrack"));
-
_controlToolBar->addAction(ActionCollection::action("CommonActions.PlayPause"));
-
_controlToolBar->addAction(ActionCollection::action("CommonActions.Stop"));
-
_controlToolBar->addAction(ActionCollection::action("CommonActions.NextTrack"));
+ _controlToolBar->addAction(Actions::get("CommonActions.PreviousTrack"));
+ _controlToolBar->addAction(Actions::get("CommonActions.PlayPause"));
+ _controlToolBar->addAction(Actions::get("CommonActions.Stop"));
+ _controlToolBar->addAction(Actions::get("CommonActions.NextTrack"));

_controlToolBar->addSeparator();
-
_controlToolBar->addAction(ActionCollection::action("CommonActions.FullScreen"));
+ _controlToolBar->addAction(Actions::get("CommonActions.FullScreen"));

_controlToolBar->addSeparator();
-
_controlToolBar->addAction(ActionCollection::action("CommonActions.NewMediaObject"));
+ _controlToolBar->addAction(Actions::get("CommonActions.NewMediaObject"));

//volumeSlider
_controlToolBar->addSeparator();
@@ -280,11 +280,11 @@
//FIXME don't know why, seekToolBar does not get enabled afterwards
//_seekToolBar->setEnabled(enabled);

-
ActionCollection::action("CommonActions.PreviousTrack")->setEnabled(enabled);
- ActionCollection::action("CommonActions.PlayPause")->setEnabled(enabled);
- ActionCollection::action("CommonActions.Stop")->setEnabled(enabled);
- ActionCollection::action("CommonActions.NextTrack")->setEnabled(enabled);
- ActionCollection::action("CommonActions.FullScreen")->setEnabled(enabled);
+ Actions::get("CommonActions.PreviousTrack")->setEnabled(enabled);
+ Actions::get("CommonActions.PlayPause")->setEnabled(enabled);
+ Actions::get("CommonActions.Stop")->setEnabled(enabled);
+ Actions::get("CommonActions.NextTrack")->setEnabled(enabled);
+ Actions::get("CommonActions.FullScreen")->setEnabled(enabled);
}

void PlayToolBar::currentMediaObjectChanged(Phonon::MediaObject *
mediaObject) {
=======================================
--- /trunk/quarkplayer-plugins/Playlist/DragAndDropTreeView.cpp Mon Feb 21
09:03:06 2011
+++ /trunk/quarkplayer-plugins/Playlist/DragAndDropTreeView.cpp Tue Feb 22
18:44:12 2011
@@ -32,6 +32,7 @@
#include <MediaInfoWindow/MediaInfoWindow.h>

#include <TkUtil/TkAction.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/LanguageChangeEventFilter.h>

#include <QtGui/QtGui>
@@ -45,6 +46,8 @@
_playlistModel = _playlistWidget->playlistModel();
_playlistFilter = _playlistWidget->playlistFilter();

+ _uuid = _playlistWidget->uuid();
+
_mediaInfoWindow = NULL;

setUniformRowHeights(true);
@@ -61,10 +64,14 @@

populateActionCollection();

- connect(_playlistWidget->uuidAction("Playlist.PlayItem"),
SIGNAL(triggered()), SLOT(playItem()));
- connect(_playlistWidget->uuidAction("Playlist.RemoveItem"),
SIGNAL(triggered()), SLOT(clearSelection()));
- connect(_playlistWidget->uuidAction("Playlist.GetInfo"),
SIGNAL(triggered()), SLOT(viewMediaInfo()));
- connect(_playlistWidget->uuidAction("Playlist.OpenDir"),
SIGNAL(triggered()), SLOT(openDir()));
+ connect(Actions::get("Playlist.PlayItem", _uuid),
+ SIGNAL(triggered()), SLOT(playItem()));
+ connect(Actions::get("Playlist.RemoveItem", _uuid),
+ SIGNAL(triggered()), SLOT(clearSelection()));
+ connect(Actions::get("Playlist.GetInfo", _uuid),
+ SIGNAL(triggered()), SLOT(viewMediaInfo()));
+ connect(Actions::get("Playlist.OpenDir", _uuid),
+ SIGNAL(triggered()), SLOT(openDir()));

RETRANSLATE(this);
retranslate();
@@ -75,17 +82,17 @@

void DragAndDropTreeView::contextMenuEvent(QContextMenuEvent * event) {
QMenu menu(this);
- menu.addAction(_playlistWidget->uuidAction("Playlist.PlayItem"));
- menu.addAction(_playlistWidget->uuidAction("Playlist.RemoveItem"));
+ menu.addAction(Actions::get("Playlist.PlayItem", _uuid));
+ menu.addAction(Actions::get("Playlist.RemoveItem", _uuid));
menu.addSeparator();
- menu.addAction(_playlistWidget->uuidAction("Playlist.GetInfo"));
- menu.addAction(_playlistWidget->uuidAction("Playlist.OpenDir"));
+ menu.addAction(Actions::get("Playlist.GetInfo", _uuid));
+ menu.addAction(Actions::get("Playlist.OpenDir", _uuid));
menu.exec(event->globalPos());
}

void DragAndDropTreeView::mousePressEvent(QMouseEvent * event) {
//When the user clicks on this playlist, it becomes the only active one
- PlaylistConfig::instance().setActivePlaylist(_playlistWidget->uuid());
+ PlaylistConfig::instance().setActivePlaylist(_uuid);

if (event->button() == Qt::RightButton) {
QModelIndex index(indexAt(event->pos()));
@@ -131,19 +138,19 @@
QCoreApplication * app = QApplication::instance();
Q_ASSERT(app);

- _playlistWidget->addUuidAction("Playlist.PlayItem", new QAction(app));
- _playlistWidget->addUuidAction("Playlist.RemoveItem", new QAction(app));
+ Actions::add("Playlist.PlayItem", _uuid, new QAction(app));
+ Actions::add("Playlist.RemoveItem", _uuid, new QAction(app));
TkAction * action = new TkAction(app, tr("Ctrl+I"), tr("Alt+3"));
action->setShortcutContext(Qt::ApplicationShortcut);
- _playlistWidget->addUuidAction("Playlist.GetInfo", action);
- _playlistWidget->addUuidAction("Playlist.OpenDir", new QAction(app));
+ Actions::add("Playlist.GetInfo", _uuid, action);
+ Actions::add("Playlist.OpenDir", _uuid, new QAction(app));
}

void DragAndDropTreeView::retranslate() {
- _playlistWidget->uuidAction("Playlist.PlayItem")->setText(tr("Play"));
- _playlistWidget->uuidAction("Playlist.RemoveItem")->setText(tr("Remove
from Playlist"));
- _playlistWidget->uuidAction("Playlist.GetInfo")->setText(tr("Get
Info..."));
- _playlistWidget->uuidAction("Playlist.OpenDir")->setText(tr("Open
Directory..."));
+ Actions::get("Playlist.PlayItem", _uuid)->setText(tr("Play"));
+ Actions::get("Playlist.RemoveItem", _uuid)->setText(tr("Remove from
Playlist"));
+ Actions::get("Playlist.GetInfo", _uuid)->setText(tr("Get Info..."));
+ Actions::get("Playlist.OpenDir", _uuid)->setText(tr("Open Directory..."));

if (_mediaInfoWindow) {
_mediaInfoWindow->setLanguage(Config::instance().language());
=======================================
--- /trunk/quarkplayer-plugins/Playlist/DragAndDropTreeView.h Mon Feb 21
09:03:06 2011
+++ /trunk/quarkplayer-plugins/Playlist/DragAndDropTreeView.h Tue Feb 22
18:44:12 2011
@@ -21,6 +21,8 @@

#include <QtGui/QTreeView>

+#include <QtCore/QUuid>
+
class PlaylistWidget;
class PlaylistModel;
class PlaylistFilter;
@@ -80,6 +82,8 @@
PlaylistFilter * _playlistFilter;

MediaInfoWindow * _mediaInfoWindow;
+
+ QUuid _uuid;
};

#endif //DRAGANDDROPTREEVIEW_H
=======================================
--- /trunk/quarkplayer-plugins/Playlist/PlaylistWidget.cpp Tue Feb 22
16:25:52 2011
+++ /trunk/quarkplayer-plugins/Playlist/PlaylistWidget.cpp Tue Feb 22
18:44:12 2011
@@ -32,7 +32,7 @@
#include <quarkplayer-plugins/ConfigWindow/PlaylistConfig.h>

#include <TkUtil/TkAction.h>
-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/TkToolBar.h>
#include <TkUtil/TkFileDialog.h>
#include <TkUtil/LanguageChangeEventFilter.h>
@@ -166,13 +166,17 @@
_searchTimer->setInterval(1500);
connect(_searchTimer, SIGNAL(timeout()), SLOT(addWordToWordList()));

- toolBar->addAction(uuidAction("Playlist.Shuffle"));
- connect(uuidAction("Playlist.Shuffle"), SIGNAL(toggled(bool)),
_playlistFilter, SLOT(setShuffle(bool)));
- toolBar->addAction(uuidAction("Playlist.Repeat"));
- connect(uuidAction("Playlist.Repeat"), SIGNAL(toggled(bool)),
_playlistFilter, SLOT(setRepeat(bool)));
-
- toolBar->addAction(uuidAction("Playlist.JumpToCurrent"));
- connect(uuidAction("Playlist.JumpToCurrent"), SIGNAL(triggered()),
SLOT(jumpToCurrent()));
+ QAction * action = Actions::get("Playlist.Shuffle", uuid());
+ toolBar->addAction(action);
+ connect(action, SIGNAL(toggled(bool)), _playlistFilter,
SLOT(setShuffle(bool)));
+
+ action = Actions::get("Playlist.Repeat", uuid());
+ toolBar->addAction(action);
+ connect(action, SIGNAL(toggled(bool)), _playlistFilter,
SLOT(setRepeat(bool)));
+
+ action = Actions::get("Playlist.JumpToCurrent", uuid());
+ toolBar->addAction(action);
+ connect(action, SIGNAL(triggered()), SLOT(jumpToCurrent()));

//Search line edit
QStringList history =
Config::instance().value(PLAYLIST_SEARCH_HISTORY_KEY).toStringList();
@@ -180,98 +184,109 @@
connect(_searchLineEdit, SIGNAL(textChanged(const QString &)),
SLOT(search()));
toolBar->addWidget(_searchLineEdit);

- toolBar->addAction(uuidAction("Playlist.Open"));
- connect(uuidAction("Playlist.Open"), SIGNAL(triggered()),
SLOT(openPlaylist()));
- toolBar->addAction(uuidAction("Playlist.Save"));
- connect(uuidAction("Playlist.Save"), SIGNAL(triggered()),
SLOT(savePlaylist()));
+ action = Actions::get("Playlist.Open", uuid());
+ toolBar->addAction(action);
+ connect(action, SIGNAL(triggered()), SLOT(openPlaylist()));
+
+ action = Actions::get("Playlist.Save", uuid());
+ toolBar->addAction(action);
+ connect(action, SIGNAL(triggered()), SLOT(savePlaylist()));

//We have to use a QToolButton instead of a QAction,
//otherwise we cannot use QToolButton::InstantPopup :/
QToolButton * addButton = new QToolButton();
addButton->setPopupMode(QToolButton::InstantPopup);
- addButton->setDefaultAction(uuidAction("Playlist.Add"));
+ addButton->setDefaultAction(Actions::get("Playlist.Add", uuid()));
toolBar->addWidget(addButton);

QMenu * addMenu = new QMenu();
- addMenu->addAction(uuidAction("Playlist.AddFiles"));
- connect(uuidAction("Playlist.AddFiles"), SIGNAL(triggered()),
SLOT(addFiles()));
- addMenu->addAction(uuidAction("Playlist.AddDir"));
- connect(uuidAction("Playlist.AddDir"), SIGNAL(triggered()),
SLOT(addDir()));
- addMenu->addAction(uuidAction("Playlist.AddURL"));
- connect(uuidAction("Playlist.AddURL"), SIGNAL(triggered()),
SLOT(addURL()));
+ action = Actions::get("Playlist.AddFiles", uuid());
+ addMenu->addAction(action);
+ connect(action, SIGNAL(triggered()), SLOT(addFiles()));
+
+ action = Actions::get("Playlist.AddDir", uuid());
+ addMenu->addAction(action);
+ connect(action, SIGNAL(triggered()), SLOT(addDir()));
+
+ action = Actions::get("Playlist.AddURL", uuid());
+ addMenu->addAction(action);
+ connect(action, SIGNAL(triggered()), SLOT(addURL()));
addButton->setMenu(addMenu);

- KeyPressEventFilter * deleteKeyFilter = new KeyPressEventFilter(_view,
SLOT(clearSelection()), Qt::Key_Delete);
+ KeyPressEventFilter * deleteKeyFilter = new KeyPressEventFilter(_view,
SLOT(clearSelection()),
+ Qt::Key_Delete);
_view->installEventFilter(deleteKeyFilter);

- toolBar->addAction(uuidAction("Playlist.RemoveAll"));
- connect(uuidAction("Playlist.RemoveAll"), SIGNAL(triggered()),
_playlistModel, SLOT(clear()));
- connect(uuidAction("Playlist.RemoveAll"), SIGNAL(triggered()),
SLOT(updateWindowTitle()));
+ action = Actions::get("Playlist.RemoveAll", uuid());
+ toolBar->addAction(action);
+ connect(action, SIGNAL(triggered()), _playlistModel, SLOT(clear()));
+ connect(action, SIGNAL(triggered()), SLOT(updateWindowTitle()));

toolBar->addSeparator();

- toolBar->addAction(uuidAction("Playlist.New"));
- connect(uuidAction("Playlist.New"), SIGNAL(triggered()),
SLOT(createNewPlaylistWidget()));
+ action = Actions::get("Playlist.New", uuid());
+ toolBar->addAction(action);
+ connect(action, SIGNAL(triggered()), SLOT(createNewPlaylistWidget()));
}

void PlaylistWidget::populateActionCollection() {
QCoreApplication * app = QApplication::instance();
Q_ASSERT(app);

- addUuidAction("Playlist.Open", new QAction(app));
- addUuidAction("Playlist.Save", new QAction(app));
-
- addUuidAction("Playlist.Add", new QAction(app));
- addUuidAction("Playlist.AddFiles", new QAction(app));
- addUuidAction("Playlist.AddDir", new QAction(app));
- addUuidAction("Playlist.AddURL", new QAction(app));
-
- addUuidAction("Playlist.RemoveAll", new QAction(app));
+ Actions::add("Playlist.Open", uuid(), new QAction(app));
+ Actions::add("Playlist.Save", uuid(), new QAction(app));
+
+ Actions::add("Playlist.Add", uuid(), new QAction(app));
+ Actions::add("Playlist.AddFiles", uuid(), new QAction(app));
+ Actions::add("Playlist.AddDir", uuid(), new QAction(app));
+ Actions::add("Playlist.AddURL", uuid(), new QAction(app));
+
+ Actions::add("Playlist.RemoveAll", uuid(), new QAction(app));

TkAction * action = new TkAction(app, tr("Ctrl+S"));
action->setCheckable(true);
- addUuidAction("Playlist.Shuffle", action);
+ Actions::add("Playlist.Shuffle", uuid(), action);

action = new TkAction(app, tr("Ctrl+R"));
action->setCheckable(true);
- addUuidAction("Playlist.Repeat", action);
-
- addUuidAction("Playlist.JumpToCurrent", new TkAction(app, tr("Ctrl+J")));
-
- addUuidAction("Playlist.New", new QAction(app));
+ Actions::add("Playlist.Repeat", uuid(), action);
+
+ Actions::add("Playlist.JumpToCurrent", uuid(), new TkAction(app,
tr("Ctrl+J")));
+
+ Actions::add("Playlist.New", uuid(), new QAction(app));
}

void PlaylistWidget::retranslate() {
_searchLineEdit->setToolTip(tr("Search playlist, use whitespaces to
separate words"));
_searchLineEdit->setClickMessage(tr("Search"));

- uuidAction("Playlist.Open")->setText(tr("Open Playlist"));
- uuidAction("Playlist.Open")->setIcon(QIcon::fromTheme("document-open"));
-
- uuidAction("Playlist.Save")->setText(tr("Save Playlist"));
- uuidAction("Playlist.Save")->setIcon(QIcon::fromTheme("document-save"));
-
- uuidAction("Playlist.Add")->setText(tr("Add..."));
- uuidAction("Playlist.Add")->setIcon(QIcon::fromTheme("list-add"));
-
- uuidAction("Playlist.AddFiles")->setText(tr("Add Files"));
- uuidAction("Playlist.AddDir")->setText(tr("Add Directory"));
- uuidAction("Playlist.AddURL")->setText(tr("Add URL"));
-
- uuidAction("Playlist.RemoveAll")->setText(tr("Remove All"));
-
uuidAction("Playlist.RemoveAll")->setIcon(QIcon::fromTheme("list-remove"));
-
- uuidAction("Playlist.Shuffle")->setText(tr("Shuffle"));
-
uuidAction("Playlist.Shuffle")->setIcon(QIcon::fromTheme("media-playlist-shuffle"));
-
- uuidAction("Playlist.Repeat")->setText(tr("Repeat"));
-
uuidAction("Playlist.Repeat")->setIcon(QIcon::fromTheme("media-playlist-repeat"));
-
- uuidAction("Playlist.JumpToCurrent")->setText(tr("Jump to Current Playing
Media"));
-
uuidAction("Playlist.JumpToCurrent")->setIcon(QIcon::fromTheme("go-jump"));
-
- uuidAction("Playlist.New")->setText(tr("New Playlist Window"));
- uuidAction("Playlist.New")->setIcon(QIcon::fromTheme("tab-new"));
+ Actions::get("Playlist.Open", uuid())->setText(tr("Open Playlist"));
+ Actions::get("Playlist.Open",
uuid())->setIcon(QIcon::fromTheme("document-open"));
+
+ Actions::get("Playlist.Save", uuid())->setText(tr("Save Playlist"));
+ Actions::get("Playlist.Save",
uuid())->setIcon(QIcon::fromTheme("document-save"));
+
+ Actions::get("Playlist.Add", uuid())->setText(tr("Add..."));
+ Actions::get("Playlist.Add",
uuid())->setIcon(QIcon::fromTheme("list-add"));
+
+ Actions::get("Playlist.AddFiles", uuid())->setText(tr("Add Files"));
+ Actions::get("Playlist.AddDir", uuid())->setText(tr("Add Directory"));
+ Actions::get("Playlist.AddURL", uuid())->setText(tr("Add URL"));
+
+ Actions::get("Playlist.RemoveAll", uuid())->setText(tr("Remove All"));
+ Actions::get("Playlist.RemoveAll",
uuid())->setIcon(QIcon::fromTheme("list-remove"));
+
+ Actions::get("Playlist.Shuffle", uuid())->setText(tr("Shuffle"));
+ Actions::get("Playlist.Shuffle",
uuid())->setIcon(QIcon::fromTheme("media-playlist-shuffle"));
+
+ Actions::get("Playlist.Repeat", uuid())->setText(tr("Repeat"));
+ Actions::get("Playlist.Repeat",
uuid())->setIcon(QIcon::fromTheme("media-playlist-repeat"));
+
+ Actions::get("Playlist.JumpToCurrent", uuid())->setText(tr("Jump to
Current Playing Media"));
+ Actions::get("Playlist.JumpToCurrent",
uuid())->setIcon(QIcon::fromTheme("go-jump"));
+
+ Actions::get("Playlist.New", uuid())->setText(tr("New Playlist Window"));
+ Actions::get("Playlist.New",
uuid())->setIcon(QIcon::fromTheme("tab-new"));

updateWindowTitle();
}
@@ -393,11 +408,11 @@
}

//Next track
- connect(ActionCollection::action("CommonActions.NextTrack"),
SIGNAL(triggered()),
+ connect(Actions::get("CommonActions.NextTrack"), SIGNAL(triggered()),
_playlistFilter, SLOT(playNextTrack()));

//Previous track
- connect(ActionCollection::action("CommonActions.PreviousTrack"),
SIGNAL(triggered()),
+ connect(Actions::get("CommonActions.PreviousTrack"), SIGNAL(triggered()),
_playlistFilter, SLOT(playPreviousTrack()));
}

@@ -408,10 +423,10 @@
}

//Next track
-
ActionCollection::action("CommonActions.NextTrack")->disconnect(_playlistFilter);
+ Actions::get("CommonActions.NextTrack")->disconnect(_playlistFilter);

//Previous track
-
ActionCollection::action("CommonActions.PreviousTrack")->disconnect(_playlistFilter);
+ Actions::get("CommonActions.PreviousTrack")->disconnect(_playlistFilter);
}

void PlaylistWidget::createNewPlaylistWidget() {
=======================================
--- /trunk/quarkplayer-plugins/QuickSettings/QuickSettingsWindow.cpp Sun
Feb 20 17:34:30 2011
+++ /trunk/quarkplayer-plugins/QuickSettings/QuickSettingsWindow.cpp Tue
Feb 22 18:44:12 2011
@@ -28,7 +28,7 @@
#include <quarkplayer-plugins/MainWindow/MainWindow.h>

#include <TkUtil/LanguageChangeEventFilter.h>
-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>

#include <phonon/mediaobject.h>
#include <phonon/audiooutput.h>
@@ -67,7 +67,7 @@
_nextEffect = NULL;
_ui = NULL;

- connect(ActionCollection::action("CommonActions.Equalizer"),
SIGNAL(triggered()), SLOT(show()));
+ connect(Actions::get("CommonActions.Equalizer"), SIGNAL(triggered()),
SLOT(show()));
}

QuickSettingsWindow::~QuickSettingsWindow() {
=======================================
--- /trunk/quarkplayer-plugins/VideoWidget/MyVideoWidget.cpp Sun Feb 20
13:15:39 2011
+++ /trunk/quarkplayer-plugins/VideoWidget/MyVideoWidget.cpp Tue Feb 22
18:44:12 2011
@@ -22,7 +22,7 @@

#include <quarkplayer-plugins/MainWindow/MainWindow.h>

-#include <TkUtil/ActionCollection.h>
+#include <TkUtil/Actions.h>
#include <TkUtil/ScreenSaver.h>
#include <TkUtil/TkAction.h>
#include <TkUtil/LanguageChangeEventFilter.h>
@@ -50,7 +50,7 @@
//Lazy initialization
_widgetOverFullScreen = NULL;

- connect(ActionCollection::action("CommonActions.FullScreen"),
SIGNAL(toggled(bool)),
+ connect(Actions::get("CommonActions.FullScreen"), SIGNAL(toggled(bool)),
SLOT(setFullScreenInternal(bool)));

//We have to add the QAction to the widget otherwise it won't work
@@ -58,9 +58,9 @@
//Note that an action must be added to a widget before it can be used;
//this is also true when the shortcut should be global
//(i.e., Qt::ApplicationShortcut as Qt::ShortcutContext).
- addAction(ActionCollection::action("CommonActions.FullScreenExit"));
-
- connect(ActionCollection::action("CommonActions.FullScreenExit"),
SIGNAL(triggered()),
+ addAction(Actions::get("CommonActions.FullScreenExit"));
+
+ connect(Actions::get("CommonActions.FullScreenExit"), SIGNAL(triggered()),
SLOT(triggerFullScreenExitAction()));

if (_playToolBar) {
@@ -86,47 +86,47 @@
Q_ASSERT(app);

TkAction * action = new TkAction(app);
- ActionCollection::addAction("VideoWidget.AspectRatioAuto", action);
+ Actions::add("VideoWidget.AspectRatioAuto", action);

action = new TkAction(app);
- ActionCollection::addAction("VideoWidget.AspectRatioScale", action);
+ Actions::add("VideoWidget.AspectRatioScale", action);

action = new TkAction(app);
- ActionCollection::addAction("VideoWidget.AspectRatio16/9", action);
+ Actions::add("VideoWidget.AspectRatio16/9", action);

action = new TkAction(app);
- ActionCollection::addAction("VideoWidget.AspectRatio4/3", action);
+ Actions::add("VideoWidget.AspectRatio4/3", action);

action = new TkAction(app);
- ActionCollection::addAction("VideoWidget.ScaleModeFitInView", action);
+ Actions::add("VideoWidget.ScaleModeFitInView", action);

action = new TkAction(app);
- ActionCollection::addAction("VideoWidget.ScaleModeScaleAndCrop", action);
+ Actions::add("VideoWidget.ScaleModeScaleAndCrop", action);
}

void MyVideoWidget::retranslate() {
-
ActionCollection::action("VideoWidget.AspectRatioAuto")->setText(tr("Auto"));
-
ActionCollection::action("VideoWidget.AspectRatioScale")->setText(tr("Scale"));
-
ActionCollection::action("VideoWidget.AspectRatio16/9")->setText(tr("16/9"));
-
ActionCollection::action("VideoWidget.AspectRatio4/3")->setText(tr("4/3"));
-
ActionCollection::action("VideoWidget.ScaleModeFitInView")->setText(tr("Fit
in View"));
-
ActionCollection::action("VideoWidget.ScaleModeScaleAndCrop")->setText(tr("Scale
and Crop"));
+ Actions::get("VideoWidget.AspectRatioAuto")->setText(tr("Auto"));
+ Actions::get("VideoWidget.AspectRatioScale")->setText(tr("Scale"));
+ Actions::get("VideoWidget.AspectRatio16/9")->setText(tr("16/9"));
+ Actions::get("VideoWidget.AspectRatio4/3")->setText(tr("4/3"));
+ Actions::get("VideoWidget.ScaleModeFitInView")->setText(tr("Fit in
View"));
+ Actions::get("VideoWidget.ScaleModeScaleAndCrop")->setText(tr("Scale and
Crop"));
}

void MyVideoWidget::createContextMenu() {
_contextMenu = new QMenu(this);

-
_contextMenu->addAction(ActionCollection::action("CommonActions.PreviousTrack"));
-
_contextMenu->addAction(ActionCollection::action("CommonActions.PlayPause"));
- _contextMenu->addAction(ActionCollection::action("CommonActions.Stop"));
-
_contextMenu->addAction(ActionCollection::action("CommonActions.NextTrack"));
-
_contextMenu->addAction(ActionCollection::action("CommonActions.FullScreen"));
+ _contextMenu->addAction(Actions::get("CommonActions.PreviousTrack"));
+ _contextMenu->addAction(Actions::get("CommonActions.PlayPause"));
+ _contextMenu->addAction(Actions::get("CommonActions.Stop"));
+ _contextMenu->addAction(Actions::get("CommonActions.NextTrack"));
+ _contextMenu->addAction(Actions::get("CommonActions.FullScreen"));

_contextMenu->addSeparator();

-
_contextMenu->addAction(ActionCollection::action("CommonActions.OpenFile"));
-
_contextMenu->addAction(ActionCollection::action("CommonActions.OpenURL"));
-
_contextMenu->addAction(ActionCollection::action("CommonActions.OpenDVD"));
+ _contextMenu->addAction(Actions::get("CommonActions.OpenFile"));
+ _contextMenu->addAction(Actions::get("CommonActions.OpenURL"));
+ _contextMenu->addAction(Actions::get("CommonActions.OpenDVD"));

_contextMenu->addSeparator();

@@ -135,23 +135,23 @@
connect(aspectRatioGroup, SIGNAL(triggered(QAction *)),
SLOT(aspectRatioChanged(QAction *)));
aspectRatioGroup->setExclusive(true);

- QAction * action =
ActionCollection::action("VideoWidget.AspectRatioAuto");
+ QAction * action = Actions::get("VideoWidget.AspectRatioAuto");
action->setCheckable(true);
action->setChecked(true);
aspectRatioMenu->addAction(action);
aspectRatioGroup->addAction(action);

- action = ActionCollection::action("VideoWidget.AspectRatioScale");
+ action = Actions::get("VideoWidget.AspectRatioScale");
action->setCheckable(true);
aspectRatioMenu->addAction(action);
aspectRatioGroup->addAction(action);

- action = ActionCollection::action("VideoWidget.AspectRatio16/9");
+ action = Actions::get("VideoWidget.AspectRatio16/9");
action->setCheckable(true);
aspectRatioMenu->addAction(action);
aspectRatioGroup->addAction(action);

- action = ActionCollection::action("VideoWidget.AspectRatio4/3");
+ action = Actions::get("VideoWidget.AspectRatio4/3");
action->setCheckable(true);
aspectRatioMenu->addAction(action);
aspectRatioGroup->addAction(action);
@@ -161,20 +161,20 @@
connect(scaleModeGroup, SIGNAL(triggered(QAction *)),
SLOT(scaleModeChanged(QAction *)));
scaleModeGroup->setExclusive(true);

- action = ActionCollection::action("VideoWidget.ScaleModeFitInView");
+ action = Actions::get("VideoWidget.ScaleModeFitInView");
action->setCheckable(true);
action->setChecked(true);
scaleModeMenu->addAction(action);
scaleModeGroup->addAction(action);

- action = ActionCollection::action("VideoWidget.ScaleModeScaleAndCrop");
+ action = Actions::get("VideoWidget.ScaleModeScaleAndCrop");
action->setCheckable(true);
scaleModeMenu->addAction(action);
scaleModeGroup->addAction(action);

_contextMenu->addSeparator();

- _contextMenu->addAction(ActionCollection::action("CommonActions.Quit"));
+ _contextMenu->addAction(Actions::get("CommonActions.Quit"));
}

void MyVideoWidget::showContextMenu(const QPoint & pos) {
@@ -182,9 +182,9 @@
}

void MyVideoWidget::scaleModeChanged(QAction * action) {
- if (action == ActionCollection::action("VideoWidget.ScaleModeFitInView"))
{
+ if (action == Actions::get("VideoWidget.ScaleModeFitInView")) {
setScaleMode(Phonon::VideoWidget::FitInView);
- } else if (action ==
ActionCollection::action("VideoWidget.ScaleModeScaleAndCrop")) {
+ } else if (action == Actions::get("VideoWidget.ScaleModeScaleAndCrop")) {
setScaleMode(Phonon::VideoWidget::ScaleAndCrop);
} else {
VideoWidgetCritical() << "Unknown action:" << action->text();
@@ -192,13 +192,13 @@
}

void MyVideoWidget::aspectRatioChanged(QAction * action) {
- if (action == ActionCollection::action("VideoWidget.AspectRatio16/9")) {
+ if (action == Actions::get("VideoWidget.AspectRatio16/9")) {
setAspectRatio(Phonon::VideoWidget::AspectRatio16_9);
- } else if (action ==
ActionCollection::action("VideoWidget.AspectRatioScale")) {
+ } else if (action == Actions::get("VideoWidget.AspectRatioScale")) {
setAspectRatio(Phonon::VideoWidget::AspectRatioWidget);
- } else if (action ==
ActionCollection::action("VideoWidget.AspectRatio4/3")) {
+ } else if (action == Actions::get("VideoWidget.AspectRatio4/3")) {
setAspectRatio(Phonon::VideoWidget::AspectRatio4_3);
- } else if (action ==
ActionCollection::action("VideoWidget.AspectRatioAuto")) {
+ } else if (action == Actions::get("VideoWidget.AspectRatioAuto")) {
setAspectRatio(Phonon::VideoWidget::AspectRatioAuto);
} else {
VideoWidgetCritical() << "Unknown action:" << action->text();
@@ -206,7 +206,7 @@
}

void MyVideoWidget::triggerFullScreenExitAction() {
- ActionCollection::action("CommonActions.FullScreen")->setChecked(false);
+ Actions::get("CommonActions.FullScreen")->setChecked(false);
}

void MyVideoWidget::enterFullScreenInternal() {
@@ -277,7 +277,7 @@
void MyVideoWidget::mouseDoubleClickEvent(QMouseEvent * event) {
if (event->button() == Qt::LeftButton) {
event->accept();
- ActionCollection::action("CommonActions.FullScreen")->toggle();
+ Actions::get("CommonActions.FullScreen")->toggle();
} else {
event->ignore();
}

Reply all
Reply to author
Forward
0 new messages