Commit d92c12c7 authored by Dirk Wilden's avatar Dirk Wilden
Browse files

OpenFlipper Icon now available through Options so that plugins can set the icon for their widgets

Additionally added icon to all core widgets

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4993 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 1491671f
...@@ -303,6 +303,7 @@ void Core::slotUnloadPlugin(){ ...@@ -303,6 +303,7 @@ void Core::slotUnloadPlugin(){
//init and show the widget //init and show the widget
if (!widget){ if (!widget){
widget = new unloadPluginsWidget(pluginNames); widget = new unloadPluginsWidget(pluginNames);
widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
connect( widget, SIGNAL(unload(QString)), this, SLOT(unloadPlugin(QString))); connect( widget, SIGNAL(unload(QString)), this, SLOT(unloadPlugin(QString)));
connect( widget, SIGNAL(dontLoadPlugins(QStringList)), this, SLOT(dontLoadPlugins(QStringList))); connect( widget, SIGNAL(dontLoadPlugins(QStringList)), this, SLOT(dontLoadPlugins(QStringList)));
}else }else
......
...@@ -272,6 +272,7 @@ void Core::slotAddEmptyObjectMenu() { ...@@ -272,6 +272,7 @@ void Core::slotAddEmptyObjectMenu() {
typeNames.push_back(supportedTypes_[i].plugin->typeName()); typeNames.push_back(supportedTypes_[i].plugin->typeName());
} }
widget = new addEmptyWidget(types,typeNames); widget = new addEmptyWidget(types,typeNames);
widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
connect(widget,SIGNAL(chosen(DataType, int&)),this,SLOT(slotAddEmptyObject(DataType, int&))); connect(widget,SIGNAL(chosen(DataType, int&)),this,SLOT(slotAddEmptyObject(DataType, int&)));
} }
widget->show(); widget->show();
...@@ -293,6 +294,8 @@ void Core::loadObject() { ...@@ -293,6 +294,8 @@ void Core::loadObject() {
connect(widget,SIGNAL(load(QString, DataType, int&)),this,SLOT(slotLoad(QString, DataType, int&))); connect(widget,SIGNAL(load(QString, DataType, int&)),this,SLOT(slotLoad(QString, DataType, int&)));
connect(widget,SIGNAL(save(int, QString)),this,SLOT(saveObject(int, QString))); connect(widget,SIGNAL(save(int, QString)),this,SLOT(saveObject(int, QString)));
widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
widget->showLoad(); widget->showLoad();
widget->disconnect(); widget->disconnect();
......
...@@ -101,6 +101,7 @@ bool Core::saveObjectTo( int _id, QString _filename ) { ...@@ -101,6 +101,7 @@ bool Core::saveObjectTo( int _id, QString _filename ) {
//init widget //init widget
LoadWidget* widget = new LoadWidget(supportedTypes_); LoadWidget* widget = new LoadWidget(supportedTypes_);
widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
connect(widget,SIGNAL(load(QString, DataType, int&)),this,SLOT(slotLoad(QString, DataType, int&))); connect(widget,SIGNAL(load(QString, DataType, int&)),this,SLOT(slotLoad(QString, DataType, int&)));
connect(widget,SIGNAL(save(int, QString)),this,SLOT(saveObject(int, QString))); connect(widget,SIGNAL(save(int, QString)),this,SLOT(saveObject(int, QString)));
......
...@@ -67,6 +67,9 @@ static QDir textureDir_; ...@@ -67,6 +67,9 @@ static QDir textureDir_;
/// Stores the Path to the Icons /// Stores the Path to the Icons
static QDir iconDir_; static QDir iconDir_;
/// Stores the OpenFlipper Icon
static QIcon* OpenFlipperIcon_ = 0;
/// Stores the Path to the Fonts /// Stores the Path to the Fonts
static QDir fontsDir_; static QDir fontsDir_;
...@@ -322,6 +325,18 @@ bool iconDir(QString _dir) { ...@@ -322,6 +325,18 @@ bool iconDir(QString _dir) {
return false; return false;
} }
QIcon& OpenFlipperIcon() {
if (OpenFlipperIcon_ == 0){
OpenFlipperIcon_ = new QIcon( iconDirStr() + dirSeparator() + "OpenFlipper_Icon_128x128x32.png");
OpenFlipperIcon_->addFile( iconDirStr() + dirSeparator() + "OpenFlipper_Icon_48x48x32.png", QSize(48,48) );
OpenFlipperIcon_->addFile( iconDirStr() + dirSeparator() + "OpenFlipper_Icon_32x32x32.png", QSize(32,32) );
OpenFlipperIcon_->addFile( iconDirStr() + dirSeparator() + "OpenFlipper_Icon_16x16x32.png", QSize(16,16) );
}
return *OpenFlipperIcon_;
}
bool fontsDir(QString _dir) { bool fontsDir(QString _dir) {
QDir tmp(_dir); QDir tmp(_dir);
if (tmp.exists()) { if (tmp.exists()) {
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include <QDir> #include <QDir>
#include <QStringList> #include <QStringList>
#include <QColor> #include <QColor>
#include <QIcon>
namespace OpenFlipper { namespace OpenFlipper {
namespace Options { namespace Options {
...@@ -99,6 +100,10 @@ QString textureDirStr(); ...@@ -99,6 +100,10 @@ QString textureDirStr();
DLLEXPORT DLLEXPORT
QString iconDirStr(); QString iconDirStr();
/// Returns the OpenFlipper Icon
DLLEXPORT
QIcon& OpenFlipperIcon();
/// Returns the Path to Fonts /// Returns the Path to Fonts
DLLEXPORT DLLEXPORT
QString fontsDirStr(); QString fontsDirStr();
......
...@@ -452,6 +452,9 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -452,6 +452,9 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
registerCoreKeys(); registerCoreKeys();
setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
} }
...@@ -626,6 +629,8 @@ void CoreWidget::showOptionsWidget() { ...@@ -626,6 +629,8 @@ void CoreWidget::showOptionsWidget() {
connect(optionsWidget_,SIGNAL(saveOptions()),this,SIGNAL(saveOptions())); connect(optionsWidget_,SIGNAL(saveOptions()),this,SIGNAL(saveOptions()));
connect(optionsWidget_,SIGNAL(addKeyMapping(int,Qt::KeyboardModifiers,QObject*,int)), connect(optionsWidget_,SIGNAL(addKeyMapping(int,Qt::KeyboardModifiers,QObject*,int)),
this, SLOT(slotAddKeyMapping(int,Qt::KeyboardModifiers,QObject*,int))); this, SLOT(slotAddKeyMapping(int,Qt::KeyboardModifiers,QObject*,int)));
optionsWidget_->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
} }
//show the optionsWidget centered //show the optionsWidget centered
......
...@@ -193,6 +193,7 @@ void CoreWidget::slotViewModeDialog(){ ...@@ -193,6 +193,7 @@ void CoreWidget::slotViewModeDialog(){
static viewModeWidget* widget = 0; static viewModeWidget* widget = 0;
if ( !widget ){ if ( !widget ){
widget = new viewModeWidget(viewModes_); widget = new viewModeWidget(viewModes_);
widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
connect(widget, SIGNAL(changeView(QString, QStringList)), this, SLOT(slotChangeView(QString, QStringList)) ); connect(widget, SIGNAL(changeView(QString, QStringList)), this, SLOT(slotChangeView(QString, QStringList)) );
connect(widget, SIGNAL(saveMode(QString, bool, QStringList)), this, SLOT(slotAddViewMode(QString, bool, QStringList)) ); connect(widget, SIGNAL(saveMode(QString, bool, QStringList)), this, SLOT(slotAddViewMode(QString, bool, QStringList)) );
connect(widget, SIGNAL(removeMode(QString)), this, SLOT(slotRemoveViewMode(QString)) ); connect(widget, SIGNAL(removeMode(QString)), this, SLOT(slotRemoveViewMode(QString)) );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment