[quarkplayer] r1432 committed - Refactoring: simplify ActionCollection...

0 views
Skip to first unread message

quark...@googlecode.com

unread,
Feb 23, 2011, 1:24:29 PM2/23/11
to quarkplay...@googlegroups.com
Revision: 1432
Author: tkrotoff
Date: Wed Feb 23 10:23:21 2011
Log: Refactoring: simplify ActionCollection
Change the way -DQT_STATICPLUGIN is handled
http://code.google.com/p/quarkplayer/source/detail?r=1432

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

=======================================
--- /trunk/libs/Logger/LogWindow.cpp Tue Feb 22 18:44:12 2011
+++ /trunk/libs/Logger/LogWindow.cpp Wed Feb 23 10:23:21 2011
@@ -36,7 +36,6 @@
#include <TkUtil/TkAction.h>
#include <TkUtil/TkToolBar.h>
#include <TkUtil/LanguageChangeEventFilter.h>
-#include <TkUtil/Actions.h>

#include <QtGui/QtGui>

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

setupUi();

- 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()));
+ connect(_actions["LogWindow.Open"], SIGNAL(triggered()), SLOT(open()));
+ connect(_actions["LogWindow.Save"], SIGNAL(triggered()), SLOT(save()));
+ connect(_actions["LogWindow.Clear"], SIGNAL(triggered()), SLOT(clear()));
+ connect(_actions["LogWindow.PlayPause"], SIGNAL(triggered()),
SLOT(playPauseButtonClicked()));

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

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

_outputsButton = new QPushButton();
_menuOutputs = new QMenu();
@@ -186,26 +185,26 @@
QCoreApplication * app = QApplication::instance();
Q_ASSERT(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));
+ _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"));

- 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");
+ _actions["LogWindow.Open"]->setText(tr("&Open"));
+ _actions["LogWindow.Open"]->setIcon(QIcon::fromTheme("document-open"));
+
+ _actions["LogWindow.Save"]->setText(tr("&Save"));
+ _actions["LogWindow.Save"]->setIcon(QIcon::fromTheme("document-save"));
+
+ _actions["LogWindow.Clear"]->setText(tr("&Clear"));
+ _actions["LogWindow.Clear"]->setIcon(QIcon::fromTheme("edit-clear"));
+
+ QAction * action = _actions["LogWindow.PlayPause"];
LogModel::State state = _model->state();
switch (state) {
case LogModel::PlayingState:
=======================================
--- /trunk/libs/Logger/LogWindow.h Fri Jan 21 09:19:32 2011
+++ /trunk/libs/Logger/LogWindow.h Wed Feb 23 10:23:21 2011
@@ -29,6 +29,8 @@

#include <Logger/LoggerExport.h>

+#include <TkUtil/Actions.h>
+
#include <QtGui/QMainWindow>

class LogModel;
@@ -115,6 +117,8 @@
* Latest row inserted, saved as a number.
*/
int _lastRow;
+
+ ActionCollection _actions;
};

#endif //LOGWINDOW_H
=======================================
--- /trunk/libs/TkUtil/Actions.cpp Tue Feb 22 18:44:12 2011
+++ /trunk/libs/TkUtil/Actions.cpp Wed Feb 23 10:23:21 2011
@@ -22,16 +22,18 @@

#include <QtGui/QtGui>

-QHash<QString, QAction *> Actions::_actionHash;
-
-Actions::Actions() {
+ActionCollection::ActionCollection() {
+}
+
+ActionCollection::ActionCollection(const QString & name) {
+ _name = name;
}

-Actions::~Actions() {
+ActionCollection::~ActionCollection() {
_actionHash.clear();
}

-void Actions::add(const QString & name, QAction * action) {
+void ActionCollection::add(const QString & name, QAction * action) {
Q_ASSERT(action);
Q_ASSERT(!name.isEmpty());

@@ -42,28 +44,14 @@
_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 * ActionCollection::operator[](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 *> ActionCollection::list() {
QList<QAction *> actionList;

QHashIterator<QString, QAction *> it(_actionHash);
@@ -76,3 +64,9 @@

return actionList;
}
+
+
+ActionCollection & GlobalActionCollection::instance() {
+ static ActionCollection instance;
+ return instance;
+}
=======================================
--- /trunk/libs/TkUtil/Actions.h Tue Feb 22 18:44:12 2011
+++ /trunk/libs/TkUtil/Actions.h Wed Feb 23 10:23:21 2011
@@ -16,10 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

-#ifndef ACTIONS_H
-#define ACTIONS_H
+#ifndef ACTIONCOLLECTION_H
+#define ACTIONCOLLECTION_H

#include <TkUtil/TkUtilExport.h>
+#include <TkUtil/Singleton.h>

#include <QtCore/QString>
#include <QtCore/QHash>
@@ -34,47 +35,55 @@
* 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 :/
+ * Checks are done at runtime.
*
* @author Tanguy Krotoff
*/
-class TKUTIL_API Actions {
+class TKUTIL_API ActionCollection {
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);
+ ActionCollection();
+
+ ActionCollection(const QString & name);
+
+ ~ActionCollection();

/**
- * Adds a global action give a name.
+ * Retrieves an action given its name.
*/
- static void add(const QString & name, QAction * action);
+ QAction * operator[](const QString & name);

/**
- * Adds a unique action given a name and an id.
+ * Adds an action with a name.
*/
- static void add(const QString & name, const QUuid & uuid, QAction *
action);
+ void add(const QString & name, QAction * action);

/**
- * Retrieves all the actions registered using ActionCollection.
+ * Retrieves all the actions registered.
*/
- static QList<QAction *> list();
+ QList<QAction *> list();

private:

- /** Singleton. */
- Actions();
-
- ~Actions();
+ /** Name of the collection, can be empty. */
+ QString _name;

/** Associates a name to a QAction. */
- static QHash<QString, QAction *> _actionHash;
+ QHash<QString, QAction *> _actionHash;
};

-#endif //ACTIONS_H
+/**
+ * Global variable ActionCollection.
+ *
+ * Singleton Pattern.
+ */
+class TKUTIL_API GlobalActionCollection : public Singleton {
+public:
+
+ static ActionCollection & instance();
+};
+
+/** Simplify the syntax. */
+#define Actions GlobalActionCollection::instance()
+
+#endif //ACTIONCOLLECTION_H
=======================================
--- /trunk/libs/TkUtil/Singleton.h Fri Aug 13 02:18:04 2010
+++ /trunk/libs/TkUtil/Singleton.h Wed Feb 23 10:23:21 2011
@@ -1,6 +1,6 @@
/*
* QuarkPlayer, a Phonon media player
- * Copyright (C) 2008-2010 Tanguy Krotoff <tkro...@gmail.com>
+ * 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
@@ -51,9 +51,6 @@
* void doSomething();
*
* private:
- *
- * MyClass();
- * ~MyClass();
* };
*
* //MyClass.cpp
@@ -70,7 +67,10 @@
class Singleton {
public:

- /* This does not work across DLLs
+ /*
+ This does not work across DLLs
+ You should write this yourself
+
static T & instance() {
//Guaranteed to be destroyed
static T instance;
=======================================
--- /trunk/libs/WebBrowser/WebBrowser.cpp Tue Feb 22 18:44:12 2011
+++ /trunk/libs/WebBrowser/WebBrowser.cpp Wed Feb 23 10:23:21 2011
@@ -1,6 +1,6 @@
/*
* QuarkPlayer, a Phonon media player
- * Copyright (C) 2008-2010 Tanguy Krotoff <tkro...@gmail.com>
+ * 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
@@ -21,7 +21,6 @@
#include "TkTextBrowser.h"
#include "WebBrowserLogger.h"

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

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

_toolBar = new QToolBar();
_toolBar->setIconSize(QSize(16, 16));
- _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"));
+ _toolBar->addAction(_actions["WebBrowser.Backward"]);
+ _toolBar->addAction(_actions["WebBrowser.Forward"]);
+ _toolBar->addAction(_actions["WebBrowser.Reload"]);
+ _toolBar->addAction(_actions["WebBrowser.Stop"]);
+ _toolBar->addAction(_actions["WebBrowser.Home"]);
layout->addWidget(_toolBar);

_urlLineEdit = new QLineEdit();
@@ -60,10 +59,10 @@
//Do not use QLineEdit::editingFinished() since it will trigger go()
//even with QLineEdit::setText()
connect(_urlLineEdit, SIGNAL(returnPressed()), SLOT(go()));
- _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()));
+ _toolBar->addAction(_actions["WebBrowser.Go"]);
+ connect(_actions["WebBrowser.Go"], SIGNAL(triggered()), SLOT(go()));
+ _toolBar->addAction(_actions["WebBrowser.OpenBrowser"]);
+ connect(_actions["WebBrowser.OpenBrowser"], SIGNAL(triggered()),
SLOT(openExternalWebBrowser()));

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

connect(_webView, SIGNAL(urlChanged(const QUrl &)), SLOT(urlChanged(const
QUrl &)));
connect(_webView, SIGNAL(urlChanged(const QUrl &)),
SLOT(historyChanged()));
- 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()));
+ connect(_actions["WebBrowser.Backward"], SIGNAL(triggered()), _webView,
SLOT(back()));
+ connect(_actions["WebBrowser.Forward"], SIGNAL(triggered()), _webView,
SLOT(forward()));
+ connect(_actions["WebBrowser.Reload"], SIGNAL(triggered()), _webView,
SLOT(reload()));
+ connect(_actions["WebBrowser.Home"], SIGNAL(triggered()), SLOT(home()));
+ connect(_actions["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(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()));
+ connect(_actions["WebBrowser.Backward"], SIGNAL(triggered()),
_textBrowser, SLOT(backward()));
+ connect(_actions["WebBrowser.Forward"], SIGNAL(triggered()),
_textBrowser, SLOT(forward()));
+ connect(_actions["WebBrowser.Reload"], SIGNAL(triggered()), _textBrowser,
SLOT(reload()));
+ connect(_actions["WebBrowser.Home"], SIGNAL(triggered()), SLOT(home()));
//QTextBrowser cannot stops current rendering, multithreaded?
- //connect(Actions::get("WebBrowser.Stop"), SIGNAL(triggered()),
_textBrowser, SLOT(stop()));
- Actions::get("WebBrowser.Stop")->setEnabled(false);
+ //connect(_actions["WebBrowser.Stop"], SIGNAL(triggered()), _textBrowser,
SLOT(stop()));
+ _actions["WebBrowser.Stop"]->setEnabled(false);
#endif //WEBKIT

//Initializes the backward and forward QAction
@@ -106,36 +105,36 @@
QCoreApplication * app = QApplication::instance();
Q_ASSERT(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));
+ _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() {
- 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"));
+ _actions["WebBrowser.Backward"]->setText(tr("Back"));
+ _actions["WebBrowser.Backward"]->setIcon(QIcon::fromTheme("go-previous"));
+
+ _actions["WebBrowser.Forward"]->setText(tr("Forward"));
+ _actions["WebBrowser.Forward"]->setIcon(QIcon::fromTheme("go-next"));
+
+ _actions["WebBrowser.Reload"]->setText(tr("Reload"));
+ _actions["WebBrowser.Reload"]->setIcon(QIcon::fromTheme("view-refresh"));
+
+ _actions["WebBrowser.Stop"]->setText(tr("Stop"));
+ _actions["WebBrowser.Stop"]->setIcon(QIcon::fromTheme("process-stop"));
+
+ _actions["WebBrowser.Home"]->setText(tr("Home"));
+ _actions["WebBrowser.Home"]->setIcon(QIcon::fromTheme("go-home"));
+
+ _actions["WebBrowser.Go"]->setText(tr("Go"));
+
_actions["WebBrowser.Go"]->setIcon(QIcon::fromTheme("go-jump-locationbar"));
+
+ _actions["WebBrowser.OpenBrowser"]->setText(tr("Open External Browser"));
+
_actions["WebBrowser.OpenBrowser"]->setIcon(QIcon::fromTheme("internet-web-browser"));
}

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

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

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

- Actions::get("WebBrowser.Backward")->setEnabled(!title.isEmpty());
- Actions::get("WebBrowser.Backward")->setToolTip(title);
+ _actions["WebBrowser.Backward"]->setEnabled(!title.isEmpty());
+ _actions["WebBrowser.Backward"]->setToolTip(title);
}

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

- Actions::get("WebBrowser.Forward")->setEnabled(!title.isEmpty());
- Actions::get("WebBrowser.Forward")->setToolTip(title);
+ _actions["WebBrowser.Forward"]->setEnabled(!title.isEmpty());
+ _actions["WebBrowser.Forward"]->setToolTip(title);
}

void WebBrowser::urlChanged(const QUrl & url) {
=======================================
--- /trunk/libs/WebBrowser/WebBrowser.h Fri Aug 13 02:18:04 2010
+++ /trunk/libs/WebBrowser/WebBrowser.h Wed Feb 23 10:23:21 2011
@@ -1,6 +1,6 @@
/*
* QuarkPlayer, a Phonon media player
- * Copyright (C) 2008-2010 Tanguy Krotoff <tkro...@gmail.com>
+ * 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
@@ -21,6 +21,8 @@

#include <WebBrowser/WebBrowserExport.h>

+#include <TkUtil/Actions.h>
+
#include <QtGui/QWidget>

class TkTextBrowser;
@@ -158,6 +160,8 @@

/** Home HTML text if any. */
QString _homeHtml;
+
+ ActionCollection _actions;
};

#endif //WEBBROWSER_H
=======================================
--- /trunk/quarkplayer-plugins/CMakeLists.txt Thu Nov 26 04:37:13 2009
+++ /trunk/quarkplayer-plugins/CMakeLists.txt Wed Feb 23 10:23:21 2011
@@ -1,3 +1,7 @@
+if (STATICPLUGINS)
+ add_definitions(-DQT_STATICPLUGIN)
+endif (STATICPLUGINS)
+
add_subdirectory(MainWindow)
add_subdirectory(ConfigWindow)
add_subdirectory(FileBrowser)
=======================================
--- /trunk/quarkplayer-plugins/ConfigWindow/CMakeLists.txt Thu Jul 8
11:50:43 2010
+++ /trunk/quarkplayer-plugins/ConfigWindow/CMakeLists.txt Wed Feb 23
10:23:21 2011
@@ -2,10 +2,6 @@

add_definitions(-DBUILD_CONFIGWINDOW ${QTSINGLEAPPLICATION_DEFINITIONS})

-if (STATICPLUGINS)
- add_definitions(-DQT_STATICPLUGIN)
-endif (STATICPLUGINS)
-
set(ConfigWindow_SRCS
ConfigWindowPlugin.cpp
ConfigWindow.cpp
=======================================
--- /trunk/quarkplayer-plugins/ConfigWindow/ConfigWindowPlugin.cpp Tue Feb
22 18:44:12 2011
+++ /trunk/quarkplayer-plugins/ConfigWindow/ConfigWindowPlugin.cpp Wed Feb
23 10:23:21 2011
@@ -60,8 +60,7 @@

loadSettings();

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

ConfigWindowPlugin::~ConfigWindowPlugin() {
=======================================
--- /trunk/quarkplayer-plugins/ConfigWindow/PlaylistConfig.cpp Tue Feb 22
17:14:14 2011
+++ /trunk/quarkplayer-plugins/ConfigWindow/PlaylistConfig.cpp Wed Feb 23
10:23:21 2011
@@ -17,14 +17,6 @@
*/

#include "PlaylistConfig.h"
-
-#include "ConfigWindowLogger.h"
-
-PlaylistConfig::PlaylistConfig() {
-}
-
-PlaylistConfig::~PlaylistConfig() {
-}

PlaylistConfig & PlaylistConfig::instance() {
static PlaylistConfig instance;
=======================================
--- /trunk/quarkplayer-plugins/ConfigWindow/PlaylistConfig.h Tue Feb 22
17:14:14 2011
+++ /trunk/quarkplayer-plugins/ConfigWindow/PlaylistConfig.h Wed Feb 23
10:23:21 2011
@@ -58,10 +58,6 @@

private:

- PlaylistConfig();
-
- ~PlaylistConfig();
-
QUuid _uuid;
};

=======================================
--- /trunk/quarkplayer-plugins/ConfigWindow/ShortcutsConfig.cpp Tue Feb 22
18:44:12 2011
+++ /trunk/quarkplayer-plugins/ConfigWindow/ShortcutsConfig.cpp Wed Feb 23
10:23:21 2011
@@ -1,6 +1,6 @@
/*
* QuarkPlayer, a Phonon media player
- * Copyright (C) 2008-2009 Tanguy Krotoff <tkro...@gmail.com>
+ * 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
@@ -65,7 +65,7 @@
QAction * ShortcutsConfig::findAction(const QString & name) const {
QAction * result = NULL;

- QList<QAction *> actions = Actions::list();
+ 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 = Actions::list();
+ 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 Tue
Feb 22 18:44:12 2011
+++ /trunk/quarkplayer-plugins/ConfigWindow/ShortcutsConfigWidget.cpp Wed
Feb 23 10:23:21 2011
@@ -1,6 +1,6 @@
/*
* QuarkPlayer, a Phonon media player
- * Copyright (C) 2008 Tanguy Krotoff <tkro...@gmail.com>
+ * 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
@@ -100,7 +100,7 @@
_shortcutItems.clear();
_ui->actionList->clear();

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

foreach (QAction * action, actions) {
TkAction * tkAction = qobject_cast<TkAction *>(action);
=======================================
--- /trunk/quarkplayer-plugins/FileBrowser/CMakeLists.txt Wed Nov 25
10:08:49 2009
+++ /trunk/quarkplayer-plugins/FileBrowser/CMakeLists.txt Wed Feb 23
10:23:21 2011
@@ -2,10 +2,6 @@

add_definitions(-DBUILD_FILEBROWSER)

-if (STATICPLUGINS)
- add_definitions(-DQT_STATICPLUGIN)
-endif (STATICPLUGINS)
-
set(FileBrowser_SRCS
FileBrowserWidget.cpp
FileBrowserTreeView.cpp
=======================================
--- /trunk/quarkplayer-plugins/FileBrowser/FileBrowserTreeView.cpp Tue Feb
22 18:44:12 2011
+++ /trunk/quarkplayer-plugins/FileBrowser/FileBrowserTreeView.cpp Wed Feb
23 10:23:21 2011
@@ -33,7 +33,6 @@
#include <MediaInfoFetcher/MediaInfoFetcher.h>

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

#include <phonon/mediaobject.h>

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

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

populateActionCollection();

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

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

RETRANSLATE(this);
@@ -81,11 +79,11 @@

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

@@ -93,10 +91,10 @@
QCoreApplication * app = QApplication::instance();
Q_ASSERT(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));
+ _actions.add("FileBrowser.AddToPlaylist", new QAction(app));
+ _actions.add("FileBrowser.Play", new QAction(app));
+ _actions.add("FileBrowser.GetInfo", new QAction(app));
+ _actions.add("FileBrowser.OpenDir", new QAction(app));
}

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

void FileBrowserTreeView::retranslate() {
- 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..."));
+ _actions["FileBrowser.AddToPlaylist"]->setText(tr("Add to Playlist"));
+ _actions["FileBrowser.Play"]->setText(tr("Play"));
+ _actions["FileBrowser.GetInfo"]->setText(tr("Get Info..."));
+ _actions["FileBrowser.OpenDir"]->setText(tr("Open Directory..."));
}

QFileInfo FileBrowserTreeView::fileInfo(const QModelIndex & index) const {
=======================================
--- /trunk/quarkplayer-plugins/FileBrowser/FileBrowserTreeView.h Tue Feb 22
18:44:12 2011
+++ /trunk/quarkplayer-plugins/FileBrowser/FileBrowserTreeView.h Wed Feb 23
10:23:21 2011
@@ -19,6 +19,8 @@
#ifndef FILEBROWSERTREEVIEW_H
#define FILEBROWSERTREEVIEW_H

+#include <TkUtil/Actions.h>
+
#include <QtGui/QTreeView>

#include <QtCore/QUuid>
@@ -65,7 +67,7 @@

FileBrowserWidget * _fileBrowserWidget;

- QUuid _uuid;
+ ActionCollection _actions;
};

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

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

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

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

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

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

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

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

- 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"));
+ _actions["FileBrowser.Browse"]->setText(tr("Change Directory"));
+ _actions["FileBrowser.Browse"]->setIcon(QIcon::fromTheme("folder"));
+
+ _actions["FileBrowser.New"]->setText(tr("New File Browser Window"));
+ _actions["FileBrowser.New"]->setIcon(QIcon::fromTheme("tab-new"));

setWindowTitle(QString());
}
=======================================
--- /trunk/quarkplayer-plugins/FileBrowser/FileBrowserWidget.h Sun Feb 20
17:34:30 2011
+++ /trunk/quarkplayer-plugins/FileBrowser/FileBrowserWidget.h Wed Feb 23
10:23:21 2011
@@ -21,6 +21,8 @@

#include <quarkplayer/PluginInterface.h>

+#include <TkUtil/Actions.h>
+
#include <QtGui/QWidget>

class FileBrowserTreeView;
@@ -90,6 +92,8 @@
QDockWidget * _dockWidget;

IMainWindow * _mainWindow;
+
+ ActionCollection _actions;
};

#include <quarkplayer/PluginFactory.h>
=======================================
--- /trunk/quarkplayer-plugins/FindSubtitles/CMakeLists.txt Wed Aug 11
10:00:14 2010
+++ /trunk/quarkplayer-plugins/FindSubtitles/CMakeLists.txt Wed Feb 23
10:23:21 2011
@@ -3,10 +3,6 @@
include_directories(${QTIOCOMPRESSOR_INCLUDE_DIRS})
add_definitions(${QTIOCOMPRESSOR_DEFINITIONS})

-if (STATICPLUGINS)
- add_definitions(-DQT_STATICPLUGIN)
-endif (STATICPLUGINS)
-
set(FindSubtitles_SRCS
FindSubtitles.cpp
FindSubtitlesWindow.cpp
=======================================
--- /trunk/quarkplayer-plugins/FindSubtitles/FindSubtitles.cpp Tue Feb 22
18:44:12 2011
+++ /trunk/quarkplayer-plugins/FindSubtitles/FindSubtitles.cpp Wed Feb 23
10:23:21 2011
@@ -60,9 +60,9 @@

addMenusToMediaController();

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

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

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

void FindSubtitles::retranslate() {
- 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..."));
+ Actions["FindSubtitles.FindSubtitles"]->setText(tr("&Find Subtitles..."));
+
Actions["FindSubtitles.FindSubtitles"]->setIcon(QIcon::fromTheme("edit-find"));
+
+ Actions["FindSubtitles.UploadSubtitles"]->setText(tr("&Upload
Subtitles..."));
}

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

- menuSubtitle->addAction(Actions::get("FindSubtitles.FindSubtitles"));
- menuSubtitle->addAction(Actions::get("FindSubtitles.UploadSubtitles"));
+ menuSubtitle->addAction(Actions["FindSubtitles.FindSubtitles"]);
+ menuSubtitle->addAction(Actions["FindSubtitles.UploadSubtitles"]);

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

void FindSubtitles::findSubtitles() {
=======================================
--- /trunk/quarkplayer-plugins/FindSubtitles/FindSubtitlesWindow.cpp Tue
Feb 22 18:44:12 2011
+++ /trunk/quarkplayer-plugins/FindSubtitles/FindSubtitlesWindow.cpp Wed
Feb 23 10:23:21 2011
@@ -1,7 +1,7 @@
/*
* QuarkPlayer, a Phonon media player
* Copyright (C) 2006-2008 Ricardo Villalba <r...@escomposlinux.org>
- * Copyright (C) 2008-2010 Tanguy Krotoff <tkro...@gmail.com>
+ * 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
@@ -102,12 +102,12 @@
SLOT(downloadProgress(qint64, qint64)));

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

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

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

- Actions::add("FindSubtitles.Download", new QAction(app));
- Actions::add("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"));

- 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"));
+ Actions["FindSubtitles.Download"]->setText(tr("&Download"));
+ Actions["FindSubtitles.Download"]->setIcon(QIcon::fromTheme("go-down"));
+
+ Actions["FindSubtitles.CopyClipboard"]->setText(tr("&Copy link to
clipboard"));
+
Actions["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());
- Actions::get("FindSubtitles.Download")->setEnabled(current.isValid());
-
Actions::get("FindSubtitles.CopyClipboard")->setEnabled(current.isValid());
+ Actions["FindSubtitles.Download"]->setEnabled(current.isValid());
+ Actions["FindSubtitles.CopyClipboard"]->setEnabled(current.isValid());
}

void FindSubtitlesWindow::setLanguage(const QString & language) {
=======================================
--- /trunk/quarkplayer-plugins/MainWindow/CMakeLists.txt Sun Feb 20
13:15:39 2011
+++ /trunk/quarkplayer-plugins/MainWindow/CMakeLists.txt Wed Feb 23
10:23:21 2011
@@ -9,10 +9,6 @@
include_directories(${MEDIAINFOLIB_INCLUDE_DIRS})
endif (MEDIAINFOLIB)

-if (STATICPLUGINS)
- add_definitions(-DQT_STATICPLUGIN)
-endif (STATICPLUGINS)
-
include_directories(${QTSINGLEAPPLICATION_INCLUDE_DIRS})
add_definitions(${QTSINGLEAPPLICATION_DEFINITIONS})

=======================================
--- /trunk/quarkplayer-plugins/MainWindow/CommonActions.cpp Tue Feb 22
18:44:12 2011
+++ /trunk/quarkplayer-plugins/MainWindow/CommonActions.cpp Wed Feb 23
10:23:21 2011
@@ -57,174 +57,174 @@
QCoreApplication * app = QApplication::instance();
Q_ASSERT(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));
+ 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);
- Actions::add("CommonActions.PlayPause", action);
+ Actions.add("CommonActions.PlayPause", action);
action = new TkAction(app, Qt::Key_MediaStop);
- Actions::add("CommonActions.Stop", action);
+ Actions.add("CommonActions.Stop", action);
action = new TkAction(app, tr("Ctrl+N"), tr(">"), Qt::Key_MediaNext);
action->setShortcutContext(Qt::ApplicationShortcut);
- Actions::add("CommonActions.NextTrack", action);
+ Actions.add("CommonActions.NextTrack", action);
action = new TkAction(app, tr("Ctrl+P"), tr("<"), Qt::Key_MediaPrevious);
action->setShortcutContext(Qt::ApplicationShortcut);
- Actions::add("CommonActions.PreviousTrack", action);
+ Actions.add("CommonActions.PreviousTrack", action);

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

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

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

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

action = new TkAction(app, tr("Ctrl+Down"), tr("-"), tr("Alt+-"));
action->setShortcutContext(Qt::ApplicationShortcut);
- Actions::add("CommonActions.VolumeDecrease10%", action);
+ Actions.add("CommonActions.VolumeDecrease10%", action);
action = new TkAction(app, tr("Ctrl+Up"), tr("+"), tr("Alt++"));
action->setShortcutContext(Qt::ApplicationShortcut);
- Actions::add("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);
- Actions::add("CommonActions.FullScreen", action);
+ Actions.add("CommonActions.FullScreen", action);

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

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

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

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

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

case Phonon::PlayingState:
- 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()),
+ Actions["CommonActions.PlayPause"]->setText(tr("&Pause"));
+
Actions["CommonActions.PlayPause"]->setIcon(QIcon::fromTheme("media-playback-pause"));
+ disconnect(Actions["CommonActions.PlayPause"], 0, 0, 0);
+ connect(Actions["CommonActions.PlayPause"], SIGNAL(triggered()),
_quarkPlayer.currentMediaObject(), SLOT(pause()));

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

case Phonon::StoppedState:
- 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()),
+ Actions["CommonActions.PlayPause"]->setText(tr("P&lay"));
+
Actions["CommonActions.PlayPause"]->setIcon(QIcon::fromTheme("media-playback-start"));
+ disconnect(Actions["CommonActions.PlayPause"], 0, 0, 0);
+ connect(Actions["CommonActions.PlayPause"], SIGNAL(triggered()),
_quarkPlayer.currentMediaObject(), SLOT(play()));

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

case Phonon::PausedState:
- 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()),
+ Actions["CommonActions.PlayPause"]->setText(tr("P&lay"));
+
Actions["CommonActions.PlayPause"]->setIcon(QIcon::fromTheme("media-playback-start"));
+ disconnect(Actions["CommonActions.PlayPause"], 0, 0, 0);
+ connect(Actions["CommonActions.PlayPause"], SIGNAL(triggered()),
_quarkPlayer.currentMediaObject(), SLOT(play()));

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

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

//Actions connect
- disconnect(Actions::get("CommonActions.Stop"), 0, 0, 0);
- connect(Actions::get("CommonActions.Stop"), SIGNAL(triggered()),
+ disconnect(Actions["CommonActions.Stop"], 0, 0, 0);
+ connect(Actions["CommonActions.Stop"], SIGNAL(triggered()),
mediaObject, SLOT(stop()));
}
=======================================
--- /trunk/quarkplayer-plugins/MainWindow/MainWindow.cpp Tue Feb 22
18:44:12 2011
+++ /trunk/quarkplayer-plugins/MainWindow/MainWindow.cpp Wed Feb 23
10:23:21 2011
@@ -90,18 +90,18 @@
_playToolBar = NULL;
_statusBar = NULL;

- 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(Actions["CommonActions.OpenFile"], SIGNAL(triggered()),
SLOT(playFile()));
+ connect(Actions["CommonActions.OpenDVD"], SIGNAL(triggered()),
SLOT(playDVD()));
+ connect(Actions["CommonActions.OpenURL"], SIGNAL(triggered()),
SLOT(playURL()));
+ connect(Actions["CommonActions.OpenVCD"], SIGNAL(triggered()),
SLOT(playVCD()));
+ connect(Actions["CommonActions.NewMediaObject"], SIGNAL(triggered()),
&quarkPlayer, SLOT(createNewMediaObject()));
+ connect(Actions["CommonActions.Quit"], SIGNAL(triggered()),
SLOT(close()));
+ connect(Actions["CommonActions.ReportBug"], SIGNAL(triggered()),
SLOT(reportBug()));
+ connect(Actions["CommonActions.ShowMailingList"], SIGNAL(triggered()),
SLOT(showMailingList()));
+ connect(Actions["CommonActions.ShowLog"], SIGNAL(triggered()),
SLOT(showLog()));
+ connect(Actions["CommonActions.About"], SIGNAL(triggered()),
SLOT(about()));
+ connect(Actions["CommonActions.AboutQt"], SIGNAL(triggered()), qApp,
SLOT(aboutQt()));
+ connect(Actions["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(Actions::get("CommonActions.OpenFile"));
- _menuFile->addAction(Actions::get("CommonActions.OpenURL"));
- _menuFile->addAction(Actions::get("CommonActions.OpenDVD"));
- _menuFile->addAction(Actions::get("CommonActions.OpenVCD"));
+ _menuFile->addAction(Actions["CommonActions.OpenFile"]);
+ _menuFile->addAction(Actions["CommonActions.OpenURL"]);
+ _menuFile->addAction(Actions["CommonActions.OpenDVD"]);
+ _menuFile->addAction(Actions["CommonActions.OpenVCD"]);
_menuFile->addSeparator();
- _menuFile->addAction(Actions::get("CommonActions.Quit"));
+ _menuFile->addAction(Actions["CommonActions.Quit"]);

_menuPlay = new QMenu();
menuBar()->addMenu(_menuPlay);
- _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->addAction(Actions["CommonActions.PreviousTrack"]);
+ _menuPlay->addAction(Actions["CommonActions.PlayPause"]);
+ _menuPlay->addAction(Actions["CommonActions.Stop"]);
+ _menuPlay->addAction(Actions["CommonActions.NextTrack"]);
_menuPlay->addSeparator();
- _menuPlay->addAction(Actions::get("CommonActions.JumpBackward10s"));
- _menuPlay->addAction(Actions::get("CommonActions.JumpBackward1min"));
- _menuPlay->addAction(Actions::get("CommonActions.JumpBackward10min"));
+ _menuPlay->addAction(Actions["CommonActions.JumpBackward10s"]);
+ _menuPlay->addAction(Actions["CommonActions.JumpBackward1min"]);
+ _menuPlay->addAction(Actions["CommonActions.JumpBackward10min"]);
_menuPlay->addSeparator();
- _menuPlay->addAction(Actions::get("CommonActions.JumpForward10s"));
- _menuPlay->addAction(Actions::get("CommonActions.JumpForward1min"));
- _menuPlay->addAction(Actions::get("CommonActions.JumpForward10min"));
+ _menuPlay->addAction(Actions["CommonActions.JumpForward10s"]);
+ _menuPlay->addAction(Actions["CommonActions.JumpForward1min"]);
+ _menuPlay->addAction(Actions["CommonActions.JumpForward10min"]);
_menuPlay->addSeparator();
- _menuPlay->addAction(Actions::get("CommonActions.SpeedDecrease10%"));
- _menuPlay->addAction(Actions::get("CommonActions.SpeedIncrease10%"));
+ _menuPlay->addAction(Actions["CommonActions.SpeedDecrease10%"]);
+ _menuPlay->addAction(Actions["CommonActions.SpeedIncrease10%"]);
_menuPlay->addSeparator();
- _menuPlay->addAction(Actions::get("CommonActions.FullScreen"));
+ _menuPlay->addAction(Actions["CommonActions.FullScreen"]);
_menuPlay->addSeparator();
- _menuPlay->addAction(Actions::get("CommonActions.NewMediaObject"));
+ _menuPlay->addAction(Actions["CommonActions.NewMediaObject"]);

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

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

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

//Main ToolBar
_mainToolBar = new TkToolBar(this);
TkToolBar::setToolButtonStyle(_mainToolBar);
- _mainToolBar->addAction(Actions::get("CommonActions.OpenFile"));
- _mainToolBar->addAction(Actions::get("CommonActions.OpenDVD"));
- //_mainToolBar->addAction(Actions::get("CommonActions.OpenURL"));
+ _mainToolBar->addAction(Actions["CommonActions.OpenFile"]);
+ _mainToolBar->addAction(Actions["CommonActions.OpenDVD"]);
+ //_mainToolBar->addAction(Actions["CommonActions.OpenURL"]);
//_mainToolBar->addSeparator();
- //_mainToolBar->addAction(Actions::get("CommonActions.Equalizer"));
- //_mainToolBar->addAction(Actions::get("CommonActions.Configure"));
+ //_mainToolBar->addAction(Actions["CommonActions.Equalizer"]);
+ //_mainToolBar->addAction(Actions["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(Actions::get("CommonActions.Quit"), SIGNAL(triggered()),
mediaObject, SLOT(stop()));
- connect(Actions::get("CommonActions.Quit"), SIGNAL(triggered()),
mediaObject, SLOT(stop()));
+ disconnect(Actions["CommonActions.Quit"], SIGNAL(triggered()),
mediaObject, SLOT(stop()));
+ connect(Actions["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
-
Actions::get("CommonActions.VolumeMute")->setChecked(audioOutput->isMuted());
+ Actions["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) {
- Actions::get("CommonActions.VolumeMute")->setChecked(muted);
+ Actions["CommonActions.VolumeMute"]->setChecked(muted);
}

void MainWindow::mutedToggled(bool muted) {
=======================================
--- /trunk/quarkplayer-plugins/MainWindow/MockMainWindow.cpp Tue Feb 22
18:44:12 2011
+++ /trunk/quarkplayer-plugins/MainWindow/MockMainWindow.cpp Wed Feb 23
10:23:21 2011
@@ -54,10 +54,10 @@

_playToolBar = NULL;

- 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(Actions["CommonActions.OpenFile"], SIGNAL(triggered()),
SLOT(playFile()));
+ connect(Actions["CommonActions.Quit"], SIGNAL(triggered()),
SLOT(close()));
+ connect(Actions["CommonActions.ShowLog"], SIGNAL(triggered()),
SLOT(showLog()));
+ connect(Actions["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(Actions::get("CommonActions.OpenFile"));
+ _menuFile->addAction(Actions["CommonActions.OpenFile"]);
_menuFile->addSeparator();
- _menuFile->addAction(Actions::get("CommonActions.Quit"));
+ _menuFile->addAction(Actions["CommonActions.Quit"]);

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

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

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

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

- disconnect(Actions::get("CommonActions.Quit"), SIGNAL(triggered()),
mediaObject, SLOT(stop()));
- connect(Actions::get("CommonActions.Quit"), SIGNAL(triggered()),
mediaObject, SLOT(stop()));
-}
+ disconnect(Actions["CommonActions.Quit"], SIGNAL(triggered()),
mediaObject, SLOT(stop()));
+ connect(Actions["CommonActions.Quit"], SIGNAL(triggered()), mediaObject,
SLOT(stop()));
+}
=======================================
--- /trunk/quarkplayer-plugins/MainWindow/MockMainWindow.h Tue Feb 22
17:14:14 2011
+++ /trunk/quarkplayer-plugins/MainWindow/MockMainWindow.h Wed Feb 23
10:23:21 2011
@@ -42,7 +42,7 @@
* @see http://en.wikipedia.org/wiki/Facade_pattern
* @author Tanguy Krotoff
*/
-class MockMainWindow : public IMainWindow {
+class MAINWINDOW_API MockMainWindow : public IMainWindow {
Q_OBJECT
public:

=======================================
--- /trunk/quarkplayer-plugins/MediaController/CMakeLists.txt Wed Aug 11
10:00:14 2010
+++ /trunk/quarkplayer-plugins/MediaController/CMakeLists.txt Wed Feb 23
10:23:21 2011
@@ -2,10 +2,6 @@

add_definitions(-DBUILD_MEDIACONTROLLER)

-if (STATICPLUGINS)
- add_definitions(-DQT_STATICPLUGIN)
-endif (STATICPLUGINS)
-
set(MediaController_SRCS
MediaController.cpp
MediaControllerToolBar.cpp
=======================================
--- /trunk/quarkplayer-plugins/MediaController/MediaController.cpp Tue Feb
22 18:44:12 2011
+++ /trunk/quarkplayer-plugins/MediaController/MediaController.cpp Wed Feb
23 10:23:21 2011
@@ -89,7 +89,7 @@
connect(&quarkPlayer,
SIGNAL(currentMediaObjectChanged(Phonon::MediaObject *)),
SLOT(currentMediaObjectChanged(Phonon::MediaObject *)));

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

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

- Actions::add("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(Actions::get("CommonActions.EmptyMenu"));
+ _menuAudioChannels->addAction(Actions["CommonActions.EmptyMenu"]);
_mainWindow->menuAudio()->addMenu(_menuAudioChannels);

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

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

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

void MediaController::retranslate() {
- Actions::get("MediaController.OpenSubtitleFile")->setText(tr("&Open
Subtitle..."));
-
Actions::get("MediaController.OpenSubtitleFile")->setIcon(QIcon::fromTheme("document-open"));
+ Actions["MediaController.OpenSubtitleFile"]->setText(tr("&Open
Subtitle..."));
+
Actions["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(Actions::get("CommonActions.EmptyMenu"));
-
_toolBar->menuAudioChannels()->addAction(Actions::get("CommonActions.EmptyMenu"));
+ _menuAudioChannels->addAction(Actions["CommonActions.EmptyMenu"]);
+
_toolBar->menuAudioChannels()->addAction(Actions["CommonActions.EmptyMenu"]);
}

for (int i = 0; i < audios.size(); i++) {
@@ -311,8 +311,8 @@
removeAllAction(_menuSubtitles);
removeAllAction(_toolBar->menuSubtitles());
if (subtitles.isEmpty()) {
- _menuSubtitles->addAction(Actions::get("CommonActions.EmptyMenu"));
-
_toolBar->menuSubtitles()->addAction(Actions::get("CommonActions.EmptyMenu"));
+ _menuSubtitles->addAction(Actions["CommonActions.EmptyMenu"]);
+ _toolBar->menuSubtitles()->addAction(Actions["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(Actions::get("CommonActions.EmptyMenu"));
+ _menuTitles->addAction(Actions["CommonActions.EmptyMenu"]);
}

for (int i = 0; i < nbTitles; i++) {
@@ -385,7 +385,7 @@
int nbTitles = titles;
removeAllAction(_menuTitles);
if (titles == 0) {
- _menuTitles->addAction(Actions::get("CommonActions.EmptyMenu"));
+ _menuTitles->addAction(Actions["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(Actions::get("CommonActions.EmptyMenu"));
+ _menuChapters->addAction(Actions["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(Actions::get("CommonActions.EmptyMenu"));
+ _menuChapters->addAction(Actions["CommonActions.EmptyMenu"]);
}

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

for (int i = 0; i < angles; i++) {
=======================================
--- /trunk/quarkplayer-plugins/MediaController/MediaControllerToolBar.cpp
Tue Feb 22 18:44:12 2011
+++ /trunk/quarkplayer-plugins/MediaController/MediaControllerToolBar.cpp
Wed Feb 23 10:23:21 2011
@@ -32,13 +32,13 @@

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

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

=======================================
--- /trunk/quarkplayer-plugins/PlayToolBar/CMakeLists.txt Wed Nov 25
10:08:49 2009
+++ /trunk/quarkplayer-plugins/PlayToolBar/CMakeLists.txt Wed Feb 23
10:23:21 2011
@@ -1,9 +1,5 @@
project(PlayToolBar)

-if (STATICPLUGINS)
- add_definitions(-DQT_STATICPLUGIN)
-endif (STATICPLUGINS)
-
set(PlayToolBar_SRCS
PlayToolBar.cpp
)
=======================================
--- /trunk/quarkplayer-plugins/PlayToolBar/PlayToolBar.cpp Tue Feb 22
18:44:12 2011
+++ /trunk/quarkplayer-plugins/PlayToolBar/PlayToolBar.cpp Wed Feb 23
10:23:21 2011
@@ -120,28 +120,28 @@
//_seekSlider->setIconVisible(true);
//_seekSlider->setTracking(false);

- //_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->addAction(Actions["CommonActions.SpeedDecrease10%"));
+ connect(Actions["CommonActions.SpeedDecrease10%"], SIGNAL(triggered()),
SLOT(decreaseSpeed10()));
+ //_seekToolBar->addAction(Actions["CommonActions.JumpBackward10min"));
+ connect(Actions["CommonActions.JumpBackward10min"], SIGNAL(triggered()),
SLOT(jumpBackward10min()));
+ _seekToolBar->addAction(Actions["CommonActions.JumpBackward1min"]);
+ connect(Actions["CommonActions.JumpBackward1min"], SIGNAL(triggered()),
SLOT(jumpBackward1min()));
+ //_seekToolBar->addAction(Actions["CommonActions.JumpBackward10s"));
+ connect(Actions["CommonActions.JumpBackward10s"], SIGNAL(triggered()),
SLOT(jumpBackward10s()));

_seekToolBar->addWidget(_seekSlider);

- //_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()));
+ //_seekToolBar->addAction(Actions["CommonActions.JumpForward10s"));
+ connect(Actions["CommonActions.JumpForward10s"], SIGNAL(triggered()),
SLOT(jumpForward10s()));
+ _seekToolBar->addAction(Actions["CommonActions.JumpForward1min"]);
+ connect(Actions["CommonActions.JumpForward1min"], SIGNAL(triggered()),
SLOT(jumpForward1min()));
+ //_seekToolBar->addAction(Actions["CommonActions.JumpForward10min"));
+ connect(Actions["CommonActions.JumpForward10min"], SIGNAL(triggered()),
SLOT(jumpForward10min()));
+ //_seekToolBar->addAction(Actions["CommonActions.SpeedIncrease10%"));
+ connect(Actions["CommonActions.SpeedIncrease10%"], SIGNAL(triggered()),
SLOT(increaseSpeed10()));
+
+ connect(Actions["CommonActions.VolumeDecrease10%"], SIGNAL(triggered()),
SLOT(volumeDecrease10()));
+ connect(Actions["CommonActions.VolumeIncrease10%"], SIGNAL(triggered()),
SLOT(volumeIncrease10()));
}

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

- _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->addAction(Actions["CommonActions.PreviousTrack"]);
+ _controlToolBar->addAction(Actions["CommonActions.PlayPause"]);
+ _controlToolBar->addAction(Actions["CommonActions.Stop"]);
+ _controlToolBar->addAction(Actions["CommonActions.NextTrack"]);

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

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

//volumeSlider
_controlToolBar->addSeparator();
@@ -280,11 +280,11 @@
//FIXME don't know why, seekToolBar does not get enabled afterwards
//_seekToolBar->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);
+ Actions["CommonActions.PreviousTrack"]->setEnabled(enabled);
+ Actions["CommonActions.PlayPause"]->setEnabled(enabled);
+ Actions["CommonActions.Stop"]->setEnabled(enabled);
+ Actions["CommonActions.NextTrack"]->setEnabled(enabled);
+ Actions["CommonActions.FullScreen"]->setEnabled(enabled);
}

void PlayToolBar::currentMediaObjectChanged(Phonon::MediaObject *
mediaObject) {
=======================================
--- /trunk/quarkplayer-plugins/Playlist/CMakeLists.txt Wed Aug 11 10:00:14
2010
+++ /trunk/quarkplayer-plugins/Playlist/CMakeLists.txt Wed Feb 23 10:23:21
2011
@@ -2,10 +2,6 @@

add_definitions(-DBUILD_PLAYLIST)

-if (STATICPLUGINS)
- add_definitions(-DQT_STATICPLUGIN)
-endif (STATICPLUGINS)
-
set(Playlist_SRCS
PlaylistWidget.cpp
PlaylistModel.cpp
=======================================
--- /trunk/quarkplayer-plugins/Playlist/DragAndDropTreeView.cpp Tue Feb 22
18:44:12 2011
+++ /trunk/quarkplayer-plugins/Playlist/DragAndDropTreeView.cpp Wed Feb 23
10:23:21 2011
@@ -32,7 +32,6 @@
#include <MediaInfoWindow/MediaInfoWindow.h>

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

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

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

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

populateActionCollection();

- 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()));
+ connect(_actions["Playlist.PlayItem"], SIGNAL(triggered()),
SLOT(playItem()));
+ connect(_actions["Playlist.RemoveItem"], SIGNAL(triggered()),
SLOT(clearSelection()));
+ connect(_actions["Playlist.GetInfo"], SIGNAL(triggered()),
SLOT(viewMediaInfo()));
+ connect(_actions["Playlist.OpenDir"], SIGNAL(triggered()),
SLOT(openDir()));

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

void DragAndDropTreeView::contextMenuEvent(QContextMenuEvent * event) {
QMenu menu(this);
- menu.addAction(Actions::get("Playlist.PlayItem", _uuid));
- menu.addAction(Actions::get("Playlist.RemoveItem", _uuid));
+ menu.addAction(_actions["Playlist.PlayItem"]);
+ menu.addAction(_actions["Playlist.RemoveItem"]);
menu.addSeparator();
- menu.addAction(Actions::get("Playlist.GetInfo", _uuid));
- menu.addAction(Actions::get("Playlist.OpenDir", _uuid));
+ menu.addAction(_actions["Playlist.GetInfo"]);
+ menu.addAction(_actions["Playlist.OpenDir"]);
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(_uuid);
+ PlaylistConfig::instance().setActivePlaylist(_playlistWidget->uuid());

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

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

void DragAndDropTreeView::retranslate() {
- 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..."));
+ _actions["Playlist.PlayItem"]->setText(tr("Play"));
+ _actions["Playlist.RemoveItem"]->setText(tr("Remove from Playlist"));
+ _actions["Playlist.GetInfo"]->setText(tr("Get Info..."));
+ _actions["Playlist.OpenDir"]->setText(tr("Open Directory..."));

if (_mediaInfoWindow) {
_mediaInfoWindow->setLanguage(Config::instance().language());
=======================================
--- /trunk/quarkplayer-plugins/Playlist/DragAndDropTreeView.h Tue Feb 22
18:44:12 2011
+++ /trunk/quarkplayer-plugins/Playlist/DragAndDropTreeView.h Wed Feb 23
10:23:21 2011
@@ -21,7 +21,7 @@

#include <QtGui/QTreeView>

-#include <QtCore/QUuid>
+#include <TkUtil/Actions.h>

class PlaylistWidget;
class PlaylistModel;
@@ -83,7 +83,7 @@

MediaInfoWindow * _mediaInfoWindow;

- QUuid _uuid;
+ ActionCollection _actions;
};

#endif //DRAGANDDROPTREEVIEW_H
=======================================
--- /trunk/quarkplayer-plugins/Playlist/PlaylistWidget.cpp Tue Feb 22
18:44:12 2011
+++ /trunk/quarkplayer-plugins/Playlist/PlaylistWidget.cpp Wed Feb 23
10:23:21 2011
@@ -166,17 +166,14 @@
_searchTimer->setInterval(1500);
connect(_searchTimer, SIGNAL(timeout()), SLOT(addWordToWordList()));

- 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()));
+ toolBar->addAction(Actions["Playlist.Shuffle"]);
+ connect(Actions["Playlist.Shuffle"], SIGNAL(toggled(bool)),
_playlistFilter, SLOT(setShuffle(bool)));
+
+ toolBar->addAction(Actions["Playlist.Repeat"]);
+ connect(Actions["Playlist.Repeat"], SIGNAL(toggled(bool)),
_playlistFilter, SLOT(setRepeat(bool)));
+
+ toolBar->addAction(Actions["Playlist.JumpToCurrent"]);
+ connect(Actions["Playlist.JumpToCurrent"], SIGNAL(triggered()),
SLOT(jumpToCurrent()));

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

- 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()));
+ toolBar->addAction(Actions["Playlist.Open"]);
+ connect(Actions["Playlist.Open"], SIGNAL(triggered()),
SLOT(openPlaylist()));
+
+ toolBar->addAction(Actions["Playlist.Save"]);
+ connect(Actions["Playlist.Save"], 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(Actions::get("Playlist.Add", uuid()));
+ addButton->setDefaultAction(Actions["Playlist.Add"]);
toolBar->addWidget(addButton);

QMenu * addMenu = new QMenu();
- 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()));
+ addMenu->addAction(Actions["Playlist.AddFiles"]);
+ connect(Actions["Playlist.AddFiles"], SIGNAL(triggered()),
SLOT(addFiles()));
+
+ addMenu->addAction(Actions["Playlist.AddDir"]);
+ connect(Actions["Playlist.AddDir"], SIGNAL(triggered()), SLOT(addDir()));
+
+ connect(Actions["Playlist.AddURL"], SIGNAL(triggered()), SLOT(addURL()));
addButton->setMenu(addMenu);

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

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

toolBar->addSeparator();

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

void PlaylistWidget::populateActionCollection() {
QCoreApplication * app = QApplication::instance();
Q_ASSERT(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));
+ Actions.add("Playlist.Open", new QAction(app));
+ Actions.add("Playlist.Save", new QAction(app));
+
+ Actions.add("Playlist.Add", new QAction(app));
+ Actions.add("Playlist.AddFiles", new QAction(app));
+ Actions.add("Playlist.AddDir", new QAction(app));
+ Actions.add("Playlist.AddURL", new QAction(app));
+
+ Actions.add("Playlist.RemoveAll", new QAction(app));

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

action = new TkAction(app, tr("Ctrl+R"));
action->setCheckable(true);
- 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));
+ Actions.add("Playlist.Repeat", action);
+
+ Actions.add("Playlist.JumpToCurrent", new TkAction(app, tr("Ctrl+J")));
+
+ Actions.add("Playlist.New", new QAction(app));
}

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

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

updateWindowTitle();
}
@@ -310,7 +299,7 @@

void PlaylistWidget::addFilesToCurrentPlaylist(const QStringList & files) {
if (!files.isEmpty()) {
- if (uuid() == PlaylistConfig::instance().activePlaylist()) {
+ if (PlaylistConfig::instance().activePlaylist() == uuid()) {
_playlistModel->addFiles(files);
_playlistModel->saveCurrentPlaylist();
}
@@ -408,11 +397,11 @@
}

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

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

@@ -423,10 +412,10 @@
}

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

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

void PlaylistWidget::createNewPlaylistWidget() {
@@ -521,7 +510,7 @@
}

void PlaylistWidget::activePlaylistChanged(const QUuid & _uuid) {
- if (uuid() == _uuid) {
+ if (_uuid == uuid()) {
//This playlist is the active one

disconnectFromMediaObjectList();
=======================================
--- /trunk/quarkplayer-plugins/QuickSettings/CMakeLists.txt Wed Nov 25
10:08:49 2009
+++ /trunk/quarkplayer-plugins/QuickSettings/CMakeLists.txt Wed Feb 23
10:23:21 2011
@@ -1,9 +1,5 @@
project(QuickSettings)

-if (STATICPLUGINS)
- add_definitions(-DQT_STATICPLUGIN)
-endif (STATICPLUGINS)
-
set(QuickSettings_SRCS
QuickSettingsWindow.cpp
)
=======================================
--- /trunk/quarkplayer-plugins/QuickSettings/QuickSettingsWindow.cpp Tue
Feb 22 18:44:12 2011
+++ /trunk/quarkplayer-plugins/QuickSettings/QuickSettingsWindow.cpp Wed
Feb 23 10:23:21 2011
@@ -67,7 +67,7 @@
_nextEffect = NULL;
_ui = NULL;

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

QuickSettingsWindow::~QuickSettingsWindow() {
=======================================
--- /trunk/quarkplayer-plugins/StatusBar/CMakeLists.txt Wed Nov 25 10:08:49
2009
+++ /trunk/quarkplayer-plugins/StatusBar/CMakeLists.txt Wed Feb 23 10:23:21
2011
@@ -1,9 +1,5 @@
project(StatusBar)

-if (STATICPLUGINS)
- add_definitions(-DQT_STATICPLUGIN)
-endif (STATICPLUGINS)
-
set(StatusBar_SRCS
StatusBar.cpp
)
=======================================
--- /trunk/quarkplayer-plugins/VideoWidget/CMakeLists.txt Mon Mar 1
10:00:30 2010
+++ /trunk/quarkplayer-plugins/VideoWidget/CMakeLists.txt Wed Feb 23
10:23:21 2011
@@ -1,9 +1,5 @@
project(VideoWidget)

-if (STATICPLUGINS)
- add_definitions(-DQT_STATICPLUGIN)
-endif (STATICPLUGINS)
-
set(VideoWidget_SRCS
VideoWidgetPlugin.cpp
MyVideoWidget.cpp
=======================================
--- /trunk/quarkplayer-plugins/VideoWidget/MyVideoWidget.cpp Tue Feb 22
18:44:12 2011
+++ /trunk/quarkplayer-plugins/VideoWidget/MyVideoWidget.cpp Wed Feb 23
10:23:21 2011
@@ -50,7 +50,7 @@
//Lazy initialization
_widgetOverFullScreen = NULL;

- connect(Actions::get("CommonActions.FullScreen"), SIGNAL(toggled(bool)),
+ connect(Actions["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(Actions::get("CommonActions.FullScreenExit"));
-
- connect(Actions::get("CommonActions.FullScreenExit"), SIGNAL(triggered()),
+ addAction(Actions["CommonActions.FullScreenExit"]);
+
+ connect(Actions["CommonActions.FullScreenExit"], SIGNAL(triggered()),
SLOT(triggerFullScreenExitAction()));

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

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

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

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

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

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

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

void MyVideoWidget::retranslate() {
- 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"));
+ Actions["VideoWidget.AspectRatioAuto"]->setText(tr("Auto"));
+ Actions["VideoWidget.AspectRatioScale"]->setText(tr("Scale"));
+ Actions["VideoWidget.AspectRatio16/9"]->setText(tr("16/9"));
+ Actions["VideoWidget.AspectRatio4/3"]->setText(tr("4/3"));
+ Actions["VideoWidget.ScaleModeFitInView"]->setText(tr("Fit in View"));
+ Actions["VideoWidget.ScaleModeScaleAndCrop"]->setText(tr("Scale and
Crop"));
}

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

- _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->addAction(Actions["CommonActions.PreviousTrack"]);
+ _contextMenu->addAction(Actions["CommonActions.PlayPause"]);
+ _contextMenu->addAction(Actions["CommonActions.Stop"]);
+ _contextMenu->addAction(Actions["CommonActions.NextTrack"]);
+ _contextMenu->addAction(Actions["CommonActions.FullScreen"]);

_contextMenu->addSeparator();

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

_contextMenu->addSeparator();

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

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

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

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

- action = Actions::get("VideoWidget.AspectRatio4/3");
+ action = Actions["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 = Actions::get("VideoWidget.ScaleModeFitInView");
+ action = Actions["VideoWidget.ScaleModeFitInView"];
action->setCheckable(true);
action->setChecked(true);
scaleModeMenu->addAction(action);
scaleModeGroup->addAction(action);

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

_contextMenu->addSeparator();

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

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

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

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

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

void MyVideoWidget::enterFullScreenInternal() {
@@ -277,11 +277,12 @@
void MyVideoWidget::mouseDoubleClickEvent(QMouseEvent * event) {
if (event->button() == Qt::LeftButton) {
event->accept();
- Actions::get("CommonActions.FullScreen")->toggle();
+ Actions["CommonActions.FullScreen"]->toggle();
} else {
event->ignore();
}
- return Phonon::VideoWidget::mouseDoubleClickEvent(event);
+
+ Phonon::VideoWidget::mouseDoubleClickEvent(event);
}

void MyVideoWidget::mouseMoveEvent(QMouseEvent * event) {
@@ -291,7 +292,8 @@
_timer.start(1000, this);
}
unsetCursor();
- return Phonon::VideoWidget::mouseMoveEvent(event);
+
+ Phonon::VideoWidget::mouseMoveEvent(event);
}

bool MyVideoWidget::event(QEvent * event) {
@@ -308,7 +310,7 @@
}
}

- return Phonon::VideoWidget::event(event);
+ Phonon::VideoWidget::event(event);
}

void MyVideoWidget::timerEvent(QTimerEvent * event) {
@@ -317,6 +319,7 @@
//Let's store the cursor shape
setCursor(Qt::BlankCursor);
}
+
Phonon::VideoWidget::timerEvent(event);
}

@@ -405,4 +408,3 @@
_mainWindow->setStatusBar(_statusBar);
}
}
-
=======================================
--- /trunk/quarkplayer-plugins/Welcome/CMakeLists.txt Wed Nov 25 10:08:49
2009
+++ /trunk/quarkplayer-plugins/Welcome/CMakeLists.txt Wed Feb 23 10:23:21
2011
@@ -1,9 +1,5 @@
project(Welcome)

-if (STATICPLUGINS)
- add_definitions(-DQT_STATICPLUGIN)
-endif (STATICPLUGINS)
-
set(Welcome_SRCS
WelcomeWindow.cpp
)
=======================================
--- /trunk/tests/quarkplayer-plugins/CMakeLists.txt Tue Feb 22 17:14:14 2011
+++ /trunk/tests/quarkplayer-plugins/CMakeLists.txt Wed Feb 23 10:23:21 2011
@@ -1,3 +1,7 @@
+if (STATICPLUGINS)
+ add_definitions(-DQT_STATICPLUGIN)
+endif (STATICPLUGINS)
+
add_subdirectory(FindSubtitles)
add_subdirectory(MainWindow)
add_subdirectory(VideoWidget)

Reply all
Reply to author
Forward
0 new messages