- Timestamp:
- 10/03/2008 08:17:22 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 2 deleted
- 3 edited
-
MainFrame.cpp (modified) (4 diffs)
-
Makefile.am (modified) (2 diffs)
-
UtilityFunctions.cpp (deleted)
-
UtilityFunctions.h (deleted)
-
configuration.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MainFrame.cpp
r169 r170 33 33 #include "highscores_dialog.h" 34 34 #include "About.h" 35 #include "UtilityFunctions.h"36 35 #include "configuration.h" 37 36 #include "settings_dialog.h" 37 #include "../config.h" 38 38 #include <iostream> 39 39 #include <sstream> … … 68 68 #endif 69 69 #define VER_DICE_SPACER 10 70 71 //default values - settings72 #define DEF_HIGHSCORESIZE 2073 #define OY_VERSION "1.8.0"74 70 75 71 const wxEventType wxEVT_ENABLE_ROLL = wxNewEventType(); … … 413 409 wxString link = wxT("http://openyahtzee.sourceforge.net/download/check-for-updates/"); 414 410 415 link += wxT( OY_VERSION);411 link += wxT(VERSION); 416 412 417 413 wxLaunchDefaultBrowser(link); … … 1332 1328 delete m_config; 1333 1329 delete m_evt_handler; 1334 } 1330 1331 for (int i = 0; i<6; i++) { 1332 delete bitmap_dice[i]; 1333 } 1334 } -
trunk/src/Makefile.am
r169 r170 14 14 settings_dialog.h \ 15 15 ScoreDice.cpp \ 16 UtilityFunctions.cpp \17 16 wxDynamicBitmap.cpp \ 18 17 one.xpm \ … … 36 35 ObjectsID.h \ 37 36 ScoreDice.h \ 38 UtilityFunctions.h \39 37 wxDynamicBitmap.h 40 38 -
trunk/src/configuration.cpp
r167 r170 19 19 ***************************************************************************/ 20 20 21 #include <iostream>22 21 #include <cstdlib> // used in the back-compatibility code 23 22 #include <sstream> … … 37 36 m_file = file; 38 37 39 cerr<<"loading file: "<<file<<endl;40 38 ifstream conf_file (file.c_str()); 41 39 if (!conf_file.is_open()) { 42 40 // file couldn't be opened, this is due to missing file or 43 41 // permission error. 44 cerr<<"Error openning configuration file for reading: "<<m_file<<endl; 42 loadDefaultSettings(); 43 save(); 44 return; 45 45 } 46 46 … … 49 49 string header; 50 50 getline(conf_file,header); 51 cerr<<"line: "<<header.substr(0,11)<<endl;52 51 if (header.substr(0,11) != "openyahtzee") { 53 52 // this is probably an old sqllite file import it. … … 59 58 while(!conf_file.eof()) { 60 59 getline(conf_file,header); 61 cerr<<"line: "<<header<<endl;62 60 if (header == "[settings]") { 63 61 parseSettings(&conf_file); … … 73 71 { 74 72 loadDefaultSettings(); 75 cerr<<"parsing settings"<<endl;76 73 string temp_line; 77 74 size_t pos; // used to loacate the '=' sign … … 91 88 return; 92 89 } 93 cerr<<"key: "<<temp_line.substr(0,pos)<<endl;94 cerr<<"value: "<<temp_line.substr(pos+1)<<endl;95 90 m_settings[temp_line.substr(0,pos)] = temp_line.substr(pos+1); 96 91 } … … 124 119 temp_item.date = date+" "+hour; 125 120 m_highscores.push_back(temp_item); 126 cerr<<score<<" "<<name<<" "<<temp_item.date<<endl;127 121 128 122 // The following two lines read one character forword and … … 139 133 ofstream conf_file (m_file.c_str()); 140 134 if (!conf_file.is_open()) { 141 // file couldn't be opened, this is due to missing file or 142 // permission error. 143 cerr<<"Error openning configuration file for writing: "<<m_file<<endl; 135 // file couldn't be opened, probably due to permission error 136 return; 144 137 } 145 138 conf_file<<"openyahtzee="<<VERSION<<endl;
Note: See TracChangeset
for help on using the changeset viewer.
