summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLloyd Bryant <lloyd_bryant@netzero.net>2008-07-25 17:00:48 +0000
committerLloyd Bryant <lloyd_bryant@netzero.net>2008-07-25 17:00:48 +0000
commitb7bc2f74f4f2253bd67b2d51fa3d2c47d648453e (patch)
tree0b11d3e871ad33618f21b43b24d999014a7b1d7f /src
parent83f233b27ea4fdd5e9b16685af5c55eab8b0d295 (diff)
downloadmana-b7bc2f74f4f2253bd67b2d51fa3d2c47d648453e.tar.gz
mana-b7bc2f74f4f2253bd67b2d51fa3d2c47d648453e.tar.bz2
mana-b7bc2f74f4f2253bd67b2d51fa3d2c47d648453e.tar.xz
mana-b7bc2f74f4f2253bd67b2d51fa3d2c47d648453e.zip
Applied patch by ElvenProgrammer to remember window locations between sessions
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp13
-rw-r--r--src/gui/buy.cpp1
-rw-r--r--src/gui/itemshortcutwindow.cpp2
-rw-r--r--src/gui/sell.cpp1
-rw-r--r--src/gui/window.cpp2
5 files changed, 14 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 070cab52..2522c6e5 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -215,10 +215,15 @@ void createGuiWindows(Network *network)
//buddyWindow->setPosition(10, minimap->getHeight() + 30);
// Set initial window visibility
- chatWindow->setVisible(true);
- miniStatusWindow->setVisible(true);
- menuWindow->setVisible(true);
- itemShortcutWindow->setVisible(true);
+ chatWindow->setVisible((bool) config.getValue(
+ chatWindow->getWindowName() + "Visible", true));
+ miniStatusWindow->setVisible((bool) config.getValue(
+ miniStatusWindow->getWindowName() + "Visible",
+ true));
+ menuWindow->setVisible((bool) config.getValue(
+ menuWindow->getWindowName() + "Visible", true));
+ itemShortcutWindow->setVisible((bool) config.getValue(
+ itemShortcutWindow->getWindowName() + "Visible", true));
if (config.getValue("logToChat", 0))
{
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp
index 24acf2d1..0e48ea29 100644
--- a/src/gui/buy.cpp
+++ b/src/gui/buy.cpp
@@ -42,6 +42,7 @@ BuyDialog::BuyDialog(Network *network):
Window("Buy"), mNetwork(network),
mMoney(0), mAmountItems(0), mMaxItems(0)
{
+ setWindowName("Buy");
setResizable(true);
setMinWidth(260);
setMinHeight(230);
diff --git a/src/gui/itemshortcutwindow.cpp b/src/gui/itemshortcutwindow.cpp
index 31f3bf4e..394fcbb7 100644
--- a/src/gui/itemshortcutwindow.cpp
+++ b/src/gui/itemshortcutwindow.cpp
@@ -30,7 +30,7 @@ static const int SCROLL_PADDING = 0;
ItemShortcutWindow::ItemShortcutWindow()
{
- setWindowName("itemShortcut");
+ setWindowName("ItemShortcut");
// no title presented, title bar is padding so window can be moved.
gcn::Window::setTitleBarHeight(gcn::Window::getPadding());
setShowTitle(false);
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp
index 5f64fcea..9fed52f3 100644
--- a/src/gui/sell.cpp
+++ b/src/gui/sell.cpp
@@ -48,6 +48,7 @@ SellDialog::SellDialog(Network *network):
mNetwork(network),
mMaxItems(0), mAmountItems(0)
{
+ setWindowName("Sell");
setResizable(true);
setMinWidth(260);
setMinHeight(230);
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 4f94b3fb..55dac5e0 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -137,6 +137,7 @@ Window::~Window()
// Saving X, Y and Width and Height for resizables in the config
config.setValue(name + "WinX", getX());
config.setValue(name + "WinY", getY());
+ config.setValue(name + "Visible", isVisible());
if (mGrip)
{
@@ -476,6 +477,7 @@ Window::loadWindowState()
setPosition((int) config.getValue(name + "WinX", mDefaultX),
(int) config.getValue(name + "WinY", mDefaultY));
+ setVisible((bool) config.getValue(name + "Visible", false));
if (mGrip)
{