summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/beingpopup.cpp2
-rw-r--r--src/gui/itempopup.cpp2
-rw-r--r--src/gui/speechbubble.cpp4
-rw-r--r--src/gui/textpopup.cpp2
-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
8 files changed, 3 insertions, 67 deletions
diff --git a/src/gui/beingpopup.cpp b/src/gui/beingpopup.cpp
index 9f05bbdb..687b20c2 100644
--- a/src/gui/beingpopup.cpp
+++ b/src/gui/beingpopup.cpp
@@ -51,8 +51,6 @@ BeingPopup::BeingPopup():
add(mBeingName);
add(mBeingParty);
-
- loadPopupConfiguration();
}
BeingPopup::~BeingPopup()
diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp
index 72a46696..3f22c442 100644
--- a/src/gui/itempopup.cpp
+++ b/src/gui/itempopup.cpp
@@ -68,8 +68,6 @@ ItemPopup::ItemPopup():
add(mItemWeight);
addMouseListener(this);
-
- loadPopupConfiguration();
}
ItemPopup::~ItemPopup()
diff --git a/src/gui/speechbubble.cpp b/src/gui/speechbubble.cpp
index 8d7458aa..08d00038 100644
--- a/src/gui/speechbubble.cpp
+++ b/src/gui/speechbubble.cpp
@@ -50,8 +50,6 @@ SpeechBubble::SpeechBubble():
add(mCaption);
add(mSpeechBox);
-
- loadPopupConfiguration();
}
void SpeechBubble::setCaption(const std::string &name, const gcn::Color *color)
@@ -73,7 +71,7 @@ void SpeechBubble::setText(const std::string &text, bool showName)
const int speechWidth = mSpeechBox->getMinWidth() + 2 * getPadding();
const int fontHeight = getFont()->getHeight();
- const int nameHeight = showName ? mCaption->getHeight() +
+ const int nameHeight = showName ? mCaption->getHeight() +
(getPadding() / 2) : 0;
const int numRows = mSpeechBox->getNumberOfRows();
const int height = (numRows * fontHeight) + nameHeight + getPadding();
diff --git a/src/gui/textpopup.cpp b/src/gui/textpopup.cpp
index aa688987..6aeae319 100644
--- a/src/gui/textpopup.cpp
+++ b/src/gui/textpopup.cpp
@@ -49,8 +49,6 @@ TextPopup::TextPopup():
add(mText1);
add(mText2);
addMouseListener(this);
-
- loadPopupConfiguration();
}
TextPopup::~TextPopup()
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 */