summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAlexander Baldeck <alexander@archlinux.org>2004-12-26 14:46:39 +0000
committerAlexander Baldeck <alexander@archlinux.org>2004-12-26 14:46:39 +0000
commit0ad7cabf1feaa6af32f127254453f6b37d9fecc6 (patch)
tree7c4bae6232889672da3ff7bcf4fa042b37049daf /src/gui
parentf98f9d96ec60b5e64117f9f241f3a3a8fc300b7d (diff)
downloadmana-0ad7cabf1feaa6af32f127254453f6b37d9fecc6.tar.gz
mana-0ad7cabf1feaa6af32f127254453f6b37d9fecc6.tar.bz2
mana-0ad7cabf1feaa6af32f127254453f6b37d9fecc6.tar.xz
mana-0ad7cabf1feaa6af32f127254453f6b37d9fecc6.zip
- final touch to writing mechanism of the config system
- tmw now can read and write its ini file - some fixes in login.cpp to get it to work properly - Init method -> init - Write method -> write - minor code "beautification" in several files
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.cpp34
-rw-r--r--src/gui/login.cpp16
2 files changed, 25 insertions, 25 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 0c052fec..b6bfd72f 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -127,7 +127,7 @@ void loadButtonSkin() {
int a = 0;
int x,y,mode;
- tokens = get_config_argv("button", "gridx", &tokenCount);
+ tokens = get_config_argv("button", "gridx", &tokenCount);
for (a=0; a < 4; a++) {
gridx[a] = atoi(tokens[a]);
}
@@ -438,22 +438,22 @@ void draw_skinned_rect(BITMAP*dst, LexSkinnedRect *skin, int x, int y,int w, int
int gui_load_skin(const char* skinname) {
- gui__external_slider_callback = NULL;
- push_config_state();
- set_config_file(skinname);
- gui_gfx = load_datafile(get_config_string("skin", "gfx", 0));
- loadButtonSkin();
- loadSliderSkin();
- loadCheckboxSkin();
- loadTextboxSkin();
- loadListboxSkin();
- loadDialogSkin();
- loadBarSkin();
- loadPlusSkin();
- pop_config_state();
- set_mouse_sprite((BITMAP *)gui_gfx[7].dat);
-
- return TRUE;
+ gui__external_slider_callback = NULL;
+ push_config_state();
+ set_config_file(skinname);
+ gui_gfx = load_datafile(get_config_string("skin", "gfx", 0));
+ loadButtonSkin();
+ loadSliderSkin();
+ loadCheckboxSkin();
+ loadTextboxSkin();
+ loadListboxSkin();
+ loadDialogSkin();
+ loadBarSkin();
+ loadPlusSkin();
+ pop_config_state();
+ set_mouse_sprite((BITMAP *)gui_gfx[7].dat);
+
+ return TRUE;
}
void gui_exit() {
diff --git a/src/gui/login.cpp b/src/gui/login.cpp
index 313ea516..1645a329 100644
--- a/src/gui/login.cpp
+++ b/src/gui/login.cpp
@@ -29,7 +29,6 @@
#include "passwordfield.h"
#include "../graphic/graphic.h"
-
LoginDialog::LoginDialog(gcn::Container *parent):
Window(parent, "Login")
{
@@ -49,7 +48,7 @@ LoginDialog::LoginDialog(gcn::Container *parent):
userField->setWidth(130);
passField->setWidth(130);
keepCheck->setPosition(4, 52);
- keepCheck->setMarked(get_config_int("login", "remember", 0));
+ keepCheck->setMarked(config.getValue("remember", 0));
okButton->setPosition(120, 52);
cancelButton->setPosition(146, 52);
@@ -76,9 +75,9 @@ LoginDialog::LoginDialog(gcn::Container *parent):
userField->requestFocus();
userField->setCaretPosition(userField->getText().length());
- if (get_config_int("login", "remember", 0)) {
- if (get_config_string("login", "username", 0)) {
- userField->setText(get_config_string("login", "username", ""));
+ if (config.getValue("remember", 0) != 0) {
+ if (config.getValue("username", "") != "") {
+ userField->setText(config.getValue("username", ""));
passField->requestFocus();
}
}
@@ -102,11 +101,12 @@ void LoginDialog::action(const std::string& eventId)
log("Network", "Username is %s", user.c_str());
// Store config settings
- set_config_int("login", "remember", keepCheck->isMarked());
+ config.setValue("remember", keepCheck->isMarked());
if (keepCheck->isMarked()) {
- set_config_string("login", "username", user.c_str());
+ std::cout << "blah\n";
+ config.setValue("username", user);
} else {
- set_config_string("login", "username", "");
+ config.setValue("username", "");
}
// Check login