wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src game.cpp preferences.cpp preference...


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth/src game.cpp preferences.cpp preference...
Date: Sat, 02 Apr 2005 16:33:21 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      05/04/02 21:33:21

Modified files:
        src            : game.cpp preferences.cpp preferences.hpp 

Log message:
        Made it so the last campaign host is remembered. Added the 
"campaign_server"
        attribute in preferences WML.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.222&tr2=1.223&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/preferences.cpp.diff?tr1=1.148&tr2=1.149&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/preferences.hpp.diff?tr1=1.52&tr2=1.53&r1=text&r2=text

Patches:
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.222 wesnoth/src/game.cpp:1.223
--- wesnoth/src/game.cpp:1.222  Tue Mar 29 21:01:30 2005
+++ wesnoth/src/game.cpp        Sat Apr  2 21:33:21 2005
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.222 2005/03/29 21:01:30 gruikya Exp $ */
+/* $Id: game.cpp,v 1.223 2005/04/02 21:33:21 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -986,7 +986,8 @@
 
 void game_controller::download_campaigns()
 {
-       std::string host = "campaigns.wesnoth.org";
+       std::string host = preferences::campaign_server();
+
        const int res = gui::show_dialog(disp(),NULL,_("Connect to Server"),
                _("You will now connect to a campaign server to download 
campaigns."),
                gui::OK_CANCEL,NULL,NULL,_("Server: "),&host);
@@ -996,6 +997,7 @@
 
        const std::vector<std::string> items = utils::split(host, ':');
        host = items.front();
+       preferences::set_campaign_server(host);
 
        try {
                const network::manager net_manager;
Index: wesnoth/src/preferences.cpp
diff -u wesnoth/src/preferences.cpp:1.148 wesnoth/src/preferences.cpp:1.149
--- wesnoth/src/preferences.cpp:1.148   Sun Mar 27 23:06:17 2005
+++ wesnoth/src/preferences.cpp Sat Apr  2 21:33:21 2005
@@ -1,4 +1,4 @@
-/* $Id: preferences.cpp,v 1.148 2005/03/27 23:06:17 gruikya Exp $ */
+/* $Id: preferences.cpp,v 1.149 2005/04/02 21:33:21 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -368,6 +368,20 @@
        prefs["host"] = host;
 }
 
+const std::string& campaign_server()
+{
+       t_string& res = prefs["campaign_server"];
+       if(res.empty())
+               res = "campaigns.wesnoth.org";
+
+       return res;
+}
+
+void set_campaign_server(const std::string& host)
+{
+       prefs["campaign_server"] = host;
+}
+
 const std::string& login()
 {
        t_string& res = prefs["login"];
Index: wesnoth/src/preferences.hpp
diff -u wesnoth/src/preferences.hpp:1.52 wesnoth/src/preferences.hpp:1.53
--- wesnoth/src/preferences.hpp:1.52    Thu Mar 10 20:59:20 2005
+++ wesnoth/src/preferences.hpp Sat Apr  2 21:33:21 2005
@@ -1,4 +1,4 @@
-/* $Id: preferences.hpp,v 1.52 2005/03/10 20:59:20 ydirson Exp $ */
+/* $Id: preferences.hpp,v 1.53 2005/04/02 21:33:21 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -78,6 +78,9 @@
        const std::string& network_host();
        void set_network_host(const std::string& host);
 
+       const std::string& campaign_server();
+       void set_campaign_server(const std::string& host);
+
        const std::string& login();
        void set_login(const std::string& username);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]