summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-29 12:56:16 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-29 12:56:16 +0300
commit1b500cb24655e2ad3e6c6fd20143ce0d2d070d6f (patch)
tree3eea380919dae735fdbeacff314edf1ad06d26ab /src/gui/windows
parent0b7ef18ac3c7fb4e3717f6311d4e21a31ff440d5 (diff)
downloadplus-1b500cb24655e2ad3e6c6fd20143ce0d2d070d6f.tar.gz
plus-1b500cb24655e2ad3e6c6fd20143ce0d2d070d6f.tar.bz2
plus-1b500cb24655e2ad3e6c6fd20143ce0d2d070d6f.tar.xz
plus-1b500cb24655e2ad3e6c6fd20143ce0d2d070d6f.zip
Move many variables from client into settings.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/chatwindow.cpp5
-rw-r--r--src/gui/windows/serverdialog.cpp5
-rw-r--r--src/gui/windows/shopwindow.cpp5
-rw-r--r--src/gui/windows/updaterwindow.cpp3
-rw-r--r--src/gui/windows/whoisonline.cpp3
-rw-r--r--src/gui/windows/worldselectdialog.cpp3
6 files changed, 17 insertions, 7 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index fb7219ed9..921d32fff 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -29,6 +29,7 @@
#include "game.h"
#include "guild.h"
#include "party.h"
+#include "settings.h"
#include "spellshortcut.h"
#include "being/attributes.h"
@@ -1520,7 +1521,7 @@ void ChatWindow::localPetEmote(const std::string &nick, const uint8_t emoteId)
void ChatWindow::initTradeFilter()
{
- const std::string tradeListName = client->getServerConfigDirectory()
+ const std::string tradeListName = settings.serverConfigDir
+ "/tradefilter.txt";
std::ifstream tradeFile;
@@ -1670,7 +1671,7 @@ void ChatWindow::loadCustomList()
std::ifstream listFile;
struct stat statbuf;
- std::string listName = client->getServerConfigDirectory()
+ std::string listName = settings.serverConfigDir
+ "/customwords.txt";
if (!stat(listName.c_str(), &statbuf) && S_ISREG(statbuf.st_mode))
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp
index 48ccd9f6d..3f537344f 100644
--- a/src/gui/windows/serverdialog.cpp
+++ b/src/gui/windows/serverdialog.cpp
@@ -26,6 +26,7 @@
#include "client.h"
#include "configuration.h"
#include "main.h"
+#include "settings.h"
#include "events/keyevent.h"
@@ -238,6 +239,10 @@ void ServerDialog::connectToSelectedServer()
mServerInfo->persistentIp = server.persistentIp;
mServerInfo->updateMirrors = server.updateMirrors;
+ settings.persistentIp = mServerInfo->persistentIp;
+ settings.supportUrl = mServerInfo->supportUrl;
+ settings.updateMirrors = mServerInfo->updateMirrors;
+
if (chatLogger)
chatLogger->setServerName(mServerInfo->hostname);
diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp
index 2d13cf23f..51d102972 100644
--- a/src/gui/windows/shopwindow.cpp
+++ b/src/gui/windows/shopwindow.cpp
@@ -48,6 +48,7 @@
#include "configuration.h"
#include "inventory.h"
#include "item.h"
+#include "settings.h"
#include "shopitem.h"
#include "soundmanager.h"
@@ -371,7 +372,7 @@ void ShopWindow::loadList()
mBuyShopItems->clear();
mSellShopItems->clear();
- const std::string shopListName = client->getServerConfigDirectory()
+ const std::string shopListName = settings.serverConfigDir
+ "/shoplist.txt";
if (!stat(shopListName.c_str(), &statbuf) && S_ISREG(statbuf.st_mode))
@@ -421,7 +422,7 @@ void ShopWindow::saveList() const
return;
std::ofstream shopFile;
- const std::string shopListName = client->getServerConfigDirectory()
+ const std::string shopListName = settings.serverConfigDir
+ "/shoplist.txt";
std::map<int, ShopItem*> mapItems;
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index 3248a3920..0422f7553 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -24,6 +24,7 @@
#include "client.h"
#include "configuration.h"
+#include "settings.h"
#include "events/keyevent.h"
@@ -583,7 +584,7 @@ void UpdaterWindow::download()
}
else
{
- const std::vector<std::string> &mirrors = client->getMirrors();
+ const std::vector<std::string> &mirrors = settings.updateMirrors;
FOR_EACH (std::vector<std::string>::const_iterator, it, mirrors)
{
mDownload->addMirror(std::string(*it).append(
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index 312eeb129..9d0f64b5a 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -27,6 +27,7 @@
#include "configuration.h"
#include "guild.h"
#include "party.h"
+#include "settings.h"
#include "gui/onlineplayer.h"
#include "gui/viewport.h"
@@ -492,7 +493,7 @@ int WhoIsOnline::downloadThread(void *ptr)
int attempts = 0;
WhoIsOnline *const wio = reinterpret_cast<WhoIsOnline *>(ptr);
CURLcode res;
- const std::string url(client->getOnlineUrl() + "/online.txt");
+ const std::string url(settings.onlineListUrl + "/online.txt");
while (attempts < 1 && !wio->mDownloadComplete)
{
diff --git a/src/gui/windows/worldselectdialog.cpp b/src/gui/windows/worldselectdialog.cpp
index da7e29585..db7db88aa 100644
--- a/src/gui/windows/worldselectdialog.cpp
+++ b/src/gui/windows/worldselectdialog.cpp
@@ -23,6 +23,7 @@
#include "gui/windows/worldselectdialog.h"
#include "client.h"
+#include "settings.h"
#include "input/inputaction.h"
@@ -105,7 +106,7 @@ void WorldSelectDialog::action(const ActionEvent &event)
mChangeLoginButton->setEnabled(false);
mChooseWorld->setEnabled(false);
Net::getLoginHandler()->chooseServer(mWorldList->getSelected(),
- client->getPersistentIp());
+ settings.persistentIp);
// Check in case netcode moves us forward
if (client->getState() == STATE_WORLD_SELECT)