Commit d92c12c7 authored by Dirk Wilden's avatar Dirk Wilden

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(){
//init and show the widget
if (!widget){
widget = new unloadPluginsWidget(pluginNames);
widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
connect( widget, SIGNAL(unload(QString)), this, SLOT(unloadPlugin(QString)));
connect( widget, SIGNAL(dontLoadPlugins(QStringList)), this, SLOT(dontLoadPlugins(QStringList)));
}else
......
......@@ -272,6 +272,7 @@ void Core::slotAddEmptyObjectMenu() {
typeNames.push_back(supportedTypes_[i].plugin->typeName());
}
widget = new addEmptyWidget(types,typeNames);
widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
connect(widget,SIGNAL(chosen(DataType, int&)),this,SLOT(slotAddEmptyObject(DataType, int&)));
}
widget->show();
......@@ -293,6 +294,8 @@ void Core::loadObject() {
connect(widget,SIGNAL(load(QString, DataType, int&)),this,SLOT(slotLoad(QString, DataType, int&)));
connect(widget,SIGNAL(save(int, QString)),this,SLOT(saveObject(int, QString)));
widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
widget->showLoad();
widget->disconnect();
......
......@@ -101,6 +101,7 @@ bool Core::saveObjectTo( int _id, QString _filename ) {
//init widget
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(save(int, QString)),this,SLOT(saveObject(int, QString)));
......
......@@ -67,6 +67,9 @@ static QDir textureDir_;
/// Stores the Path to the Icons
static QDir iconDir_;
/// Stores the OpenFlipper Icon
static QIcon* OpenFlipperIcon_ = 0;
/// Stores the Path to the Fonts
static QDir fontsDir_;
......@@ -322,6 +325,18 @@ bool iconDir(QString _dir) {
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) {
QDir tmp(_dir);
if (tmp.exists()) {
......
......@@ -51,6 +51,7 @@
#include <QDir>
#include <QStringList>
#include <QColor>
#include <QIcon>
namespace OpenFlipper {
namespace Options {
......@@ -99,6 +100,10 @@ QString textureDirStr();
DLLEXPORT
QString iconDirStr();
/// Returns the OpenFlipper Icon
DLLEXPORT
QIcon& OpenFlipperIcon();
/// Returns the Path to Fonts
DLLEXPORT
QString fontsDirStr();
......
......@@ -452,6 +452,9 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
registerCoreKeys();
setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
}
......@@ -626,6 +629,8 @@ void CoreWidget::showOptionsWidget() {
connect(optionsWidget_,SIGNAL(saveOptions()),this,SIGNAL(saveOptions()));
connect(optionsWidget_,SIGNAL(addKeyMapping(int,Qt::KeyboardModifiers,QObject*,int)),
this, SLOT(slotAddKeyMapping(int,Qt::KeyboardModifiers,QObject*,int)));
optionsWidget_->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
}
//show the optionsWidget centered
......
......@@ -193,6 +193,7 @@ void CoreWidget::slotViewModeDialog(){
static viewModeWidget* widget = 0;
if ( !widget ){
widget = new viewModeWidget(viewModes_);
widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
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(removeMode(QString)), this, SLOT(slotRemoveViewMode(QString)) );
......
Markdown is supported
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