summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-03-24 22:55:57 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-03-31 17:57:30 +0200
commit9a0f5327c25c57963af837439d23a61c9510a6ac (patch)
treeb185f39126080409d981fd83e657a7e963804b0f /src/gui/widgets
parent2053bb3a588b504f255e83b1e7b4f9b935a5cbf3 (diff)
downloadmana-client-9a0f5327c25c57963af837439d23a61c9510a6ac.tar.gz
mana-client-9a0f5327c25c57963af837439d23a61c9510a6ac.tar.bz2
mana-client-9a0f5327c25c57963af837439d23a61c9510a6ac.tar.xz
mana-client-9a0f5327c25c57963af837439d23a61c9510a6ac.zip
Removed the ability to assign custom skins to windows/popups
Old settings are causing it to fall back on the wrong combination of files if old data is in the search path. Reviewed-by: Jared Adams
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/popup.cpp33
-rw-r--r--src/gui/widgets/popup.h13
-rw-r--r--src/gui/widgets/window.cpp13
-rw-r--r--src/gui/widgets/window.h1
4 files changed, 2 insertions, 58 deletions
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp
index 5cc8fad6..4dc58f72 100644
--- a/src/gui/widgets/popup.cpp
+++ b/src/gui/widgets/popup.cpp
@@ -37,7 +37,6 @@
Popup::Popup(const std::string &name, const std::string &skin):
mPopupName(name),
- mDefaultSkinPath(skin),
mMinWidth(100),
mMinHeight(40),
mMaxWidth(graphics->getWidth()),
@@ -51,7 +50,7 @@ Popup::Popup(const std::string &name, const std::string &skin):
setPadding(3);
// Loads the skin
- mSkin = Theme::instance()->load(skin, mDefaultSkinPath);
+ mSkin = Theme::instance()->load(skin);
// Add this window to the window container
windowContainer->add(this);
@@ -64,8 +63,6 @@ Popup::~Popup()
{
logger->log("Popup::~Popup(\"%s\")", mPopupName.c_str());
- savePopupConfiguration();
-
mSkin->instances--;
}
@@ -74,34 +71,6 @@ void Popup::setWindowContainer(WindowContainer *wc)
windowContainer = wc;
}
-void Popup::loadPopupConfiguration()
-{
- if (mPopupName.empty())
- return;
-
- const std::string &name = mPopupName;
- const std::string &skinName = config.getValue(name + "Skin",
- mSkin->getFilePath());
-
- if (skinName.compare(mSkin->getFilePath()) != 0)
- {
- mSkin->instances--;
- mSkin = Theme::instance()->load(skinName, mDefaultSkinPath);
- }
-}
-
-void Popup::savePopupConfiguration()
-{
- if (mPopupName.empty())
- return;
-
- const std::string &name = mPopupName;
-
- // Saves the skin path in a config file (which allows for skins to be
- // changed from the default path)
- config.setValue(name + "Skin", mSkin->getFilePath());
-}
-
void Popup::draw(gcn::Graphics *graphics)
{
Graphics *g = static_cast<Graphics*>(graphics);
diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h
index 5c9164f6..3b1a10c8 100644
--- a/src/gui/widgets/popup.h
+++ b/src/gui/widgets/popup.h
@@ -70,18 +70,6 @@ class Popup : public Container, public gcn::MouseListener
static void setWindowContainer(WindowContainer *windowContainer);
/**
- * Changes the popup's skin to use the skin defined in the saved
- * configuration file.
- */
- void loadPopupConfiguration();
-
- /**
- * Currently only saves the skin used by the popup so that when the
- * client is reloaded, it can use the saved skin.
- */
- void savePopupConfiguration();
-
- /**
* Draws the popup.
*/
void draw(gcn::Graphics *graphics);
@@ -166,7 +154,6 @@ class Popup : public Container, public gcn::MouseListener
private:
std::string mPopupName; /**< Name of the popup */
- std::string mDefaultSkinPath; /**< Default skin path for this popup */
int mMinWidth; /**< Minimum popup width */
int mMinHeight; /**< Minimum popup height */
int mMaxWidth; /**< Maximum popup width */
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 2db3afb5..118ee7c0 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -48,7 +48,6 @@ Window::Window(const std::string &caption, bool modal, Window *parent,
mParent(parent),
mLayout(NULL),
mWindowName("window"),
- mDefaultSkinPath(skin),
mShowTitle(true),
mModal(modal),
mCloseButton(false),
@@ -73,7 +72,7 @@ Window::Window(const std::string &caption, bool modal, Window *parent,
setTitleBarHeight(20);
// Loads the skin
- mSkin = Theme::instance()->load(skin, mDefaultSkinPath);
+ mSkin = Theme::instance()->load(skin);
// Add this window to the window container
windowContainer->add(this);
@@ -515,8 +514,6 @@ void Window::mouseDragged(gcn::MouseEvent &event)
void Window::loadWindowState()
{
const std::string &name = mWindowName;
- const std::string skinName = config.getValue(name + "Skin",
- mSkin->getFilePath());
assert(!name.empty());
setPosition((int) config.getValue(name + "WinX", mDefaultX),
@@ -528,12 +525,6 @@ void Window::loadWindowState()
if (mStickyButton)
setSticky((bool) config.getValue(name + "Sticky", isSticky()));
- if (skinName.compare(mSkin->getFilePath()) != 0)
- {
- mSkin->instances--;
- mSkin = Theme::instance()->load(skinName, mDefaultSkinPath);
- }
-
if (mGrip)
{
int width = (int) config.getValue(name + "WinWidth", mDefaultWidth);
@@ -573,8 +564,6 @@ void Window::saveWindowState()
if (mStickyButton)
config.setValue(mWindowName + "Sticky", isSticky());
- config.setValue(mWindowName + "Skin", mSkin->getFilePath());
-
if (mGrip)
{
if (getMinWidth() > getWidth())
diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h
index b72be9d4..a8eb4e62 100644
--- a/src/gui/widgets/window.h
+++ b/src/gui/widgets/window.h
@@ -371,7 +371,6 @@ class Window : public gcn::Window, gcn::WidgetListener
Window *mParent; /**< The parent window */
Layout *mLayout; /**< Layout handler */
std::string mWindowName; /**< Name of the window */
- std::string mDefaultSkinPath; /**< Default skin path for this window */
bool mShowTitle; /**< Window has a title bar */
bool mModal; /**< Window is modal */
bool mCloseButton; /**< Window has a close button */