Add option to override the UI color

* Add -color option to core plugin which will override
   the base UI color for that session.

Reviewed-by: thorbjorn
This commit is contained in:
Tobias Hunger
2009-11-25 18:44:54 +01:00
parent a37592a16f
commit 9bf1d52685
5 changed files with 33 additions and 3 deletions

View File

@@ -37,6 +37,7 @@
#include <extensionsystem/pluginmanager.h>
#include <QtCore/QtPlugin>
#include <QtCore/QDebug>
using namespace Core::Internal;
@@ -58,9 +59,20 @@ CorePlugin::~CorePlugin()
delete m_mainWindow;
}
void CorePlugin::parseArguments(const QStringList &arguments)
{
for (int i = 0; i < arguments.size() - 1; i++) {
if (arguments.at(i) == QLatin1String("-color")) {
const QString colorcode(arguments.at(i + 1));
m_mainWindow->setOverrideColor(QColor(colorcode));
i++; // skip the argument
}
}
}
bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments)
parseArguments(arguments);
const bool success = m_mainWindow->init(errorMessage);
if (success) {
EditorManager *editorManager = m_mainWindow->editorManager();