Changeset 38
- Timestamp:
- 09/01/07 20:56:05 (6 years ago)
- Location:
- trunk/OpenYahtzee
- Files:
-
- 9 edited
-
TODO (modified) (1 diff)
-
openyahtzee.kdevelop.pcs (modified) (previous)
-
openyahtzee.kdevses (modified) (3 diffs)
-
src/MainFrame.cpp (modified) (5 diffs)
-
src/MainFrame.h (modified) (1 diff)
-
src/Makefile.am (modified) (2 diffs)
-
src/Makefile.in (modified) (2 diffs)
-
src/ObjectsID.h (modified) (1 diff)
-
src/openyahtzee.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/OpenYahtzee/TODO
r34 r38 1 1 TODO FILE 2 3 DONE: 2 4 -cleanup code at the end of every scoring button 3 5 -cleanup code for the icon settings for the dialogs/frames -
trunk/OpenYahtzee/openyahtzee.kdevses
r37 r38 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 <DocsAndViews NumberOfDocuments="1 3" >4 <DocsAndViews NumberOfDocuments="14" > 5 5 <Doc0 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDB.h" > 6 6 <View0 Type="Source" /> 7 7 </Doc0> 8 8 <Doc1 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/openyahtzee.cpp" > 9 <View0 line="30"Type="Source" />9 <View0 Type="Source" /> 10 10 </Doc1> 11 11 <Doc2 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/MainFrame.cpp" > 12 <View0 line="53 9" Type="Source" />12 <View0 line="53" Type="Source" /> 13 13 </Doc2> 14 14 <Doc3 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/ObjectsID.h" > 15 <View0 Type="Source" />15 <View0 line="29" Type="Source" /> 16 16 </Doc3> 17 17 <Doc4 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/MainFrame.h" > 18 <View0 line=" 71" Type="Source" />18 <View0 line="51" Type="Source" /> 19 19 </Doc4> 20 20 <Doc5 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/DBwrapper.h" > … … 25 25 </Doc6> 26 26 <Doc7 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDialog.cpp" > 27 <View0 Type="Source" />27 <View0 line="27" Type="Source" /> 28 28 </Doc7> 29 29 <Doc8 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDB.cpp" > … … 34 34 </Doc9> 35 35 <Doc10 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/HighScoreDialog.cpp" > 36 <View0 line="32"Type="Source" />36 <View0 Type="Source" /> 37 37 </Doc10> 38 38 <Doc11 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/Icon.h" > 39 <View0 line="34"Type="Source" />39 <View0 Type="Source" /> 40 40 </Doc11> 41 41 <Doc12 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/openyahtzee.rc" > 42 <View0 line="19"Type="Source" />42 <View0 Type="Source" /> 43 43 </Doc12> 44 <Doc13 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/HighScoreDialog.h" > 45 <View0 line="0" Type="Source" /> 46 </Doc13> 44 47 </DocsAndViews> 45 48 <pluginList> -
trunk/OpenYahtzee/src/MainFrame.cpp
r37 r38 47 47 48 48 //include the icon file 49 #ifdef WIN32 50 #include "icon32.xpm" 51 #else 52 #include "icon.xpm" 53 #endif 49 #include "Icon.h" 54 50 55 51 //default values 56 52 #define SPACE_SIZE 1 57 53 #define DEF_HIGHSCORESIZE 16 54 #define OY_VERSION "1.6.0" 58 55 59 56 MainFrame::MainFrame(const wxString& title, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE) … … 61 58 { 62 59 //give the frame an icon 63 #ifdef WIN32 64 SetIcon(wxIcon(icon32_xpm)); 65 #else 66 SetIcon(wxIcon(icon_xpm)); 67 #endif 60 SetIcon(wxIcon(ICON)); 61 68 62 69 63 std::ostringstream sstr; … … 102 96 103 97 //insert menu items into menu Help 98 helpMenu->Append(ID_CHECK_FOR_UPDATES, wxT("&Check for Updates"), 99 wxT("Check for new version of the game via the web")); 104 100 helpMenu->Append(wxID_ABOUT, wxT("&About...\tF1"), 105 101 wxT("Show about dialog")); … … 224 220 Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnQuit)); 225 221 Connect(wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnAbout)); 222 Connect(ID_CHECK_FOR_UPDATES, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnCheckForUpdates)); 226 223 Connect(ID_NEWGAME, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnNewGame)); 227 224 Connect(ID_UNDO, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::OnUndo)); … … 256 253 wxString msg; 257 254 wxString sqliteversion = wxString(sqlite3_version,wxConvUTF8); 258 msg.Printf(wxT("OpenYahtzee 1.6\nCopyright (C) 2006 by Guy Rutenberg\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nOpenYahtzee was built against:\nwxWidgets %i.%i\n"),wxMAJOR_VERSION,wxMINOR_VERSION);255 msg.Printf(wxT("OpenYahtzee %s\nCopyright (C) 2006 by Guy Rutenberg\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nOpenYahtzee was built against:\nwxWidgets %i.%i\n"),wxT(OY_VERSION),wxMAJOR_VERSION,wxMINOR_VERSION); 259 256 msg += wxT("SQLite ") + sqliteversion; 260 257 261 258 wxMessageBox(msg, wxT("About Yahtzee"), wxOK | wxICON_INFORMATION, this); 259 } 260 261 void MainFrame::OnCheckForUpdates (wxCommandEvent& event){ 262 263 wxString path; 264 wxPathList path_list; 265 wxString link = wxT("http://openyahtzee.sourceforge.net/update.php?version="); 266 267 link += wxT(OY_VERSION); 268 269 if (!wxLaunchDefaultBrowser(link)){ 270 //if builtin function doesn't work search for couple of browsers manually. see 271 //http://linux-consulting.buanzo.com.ar/2006/05/wxwidgets-code-to-launch-browser.html 272 273 // variable declarations 274 wxArrayString browsers; 275 wxPathList path_list; 276 bool BrowserWasFound = false; 277 unsigned int i = 0; 278 wxString path; 279 280 // Add directories to wxPathList's search path from PATH environment variable 281 path_list.AddEnvList(wxT("PATH")); 282 283 // Add browsers filenames. First item = most priority 284 browsers.Add(wxT("firefox")); 285 browsers.Add(wxT("firefox-bin")); 286 browsers.Add(wxT("mozilla")); 287 browsers.Add(wxT("mozilla-bin")); 288 browsers.Add(wxT("opera")); 289 browsers.Add(wxT("konqueror")); 290 browsers.Add(wxT("epiphany")); 291 292 for (i = 0; i < browsers.GetCount(); i++) { 293 path = path_list.FindAbsoluteValidPath(browsers[i]); 294 if (path.IsEmpty()) { 295 continue; 296 } else { 297 BrowserWasFound = true; 298 break; 299 } 300 } 301 302 browsers.Clear(); 303 304 if (BrowserWasFound) { 305 path += wxT(" "); 306 path += link; 307 ::wxExecute(path); 308 } else { 309 wxMessageBox(wxT("No browser has been found."),wxT("OpenYahtzee")); 310 } 311 } 312 313 262 314 } 263 315 -
trunk/OpenYahtzee/src/MainFrame.h
r37 r38 50 50 void OnShowHighscore (wxCommandEvent& event); 51 51 void OnSettings (wxCommandEvent& event); 52 void OnCheckForUpdates (wxCommandEvent& event); 52 53 53 54 void OnRollButton (wxCommandEvent& event); -
trunk/OpenYahtzee/src/Makefile.am
r35 r38 1 1 bin_PROGRAMS = openyahtzee 2 2 openyahtzee_SOURCES = openyahtzee.cpp MainFrame.cpp five.xpm four.xpm one.xpm \ 3 six.xpm three.xpm two.xpm DBwrapper.cpp DBwrapper.h SettingsDB.cpp \ 4 HighScoreTableDB.cpp HighScoreDialog.cpp SettingsDialog.cpp icon.xpm icon32.xpm 3 six.xpm three.xpm two.xpm DBwrapper.cpp DBwrapper.h SettingsDB.cpp \ 4 HighScoreTableDB.cpp HighScoreDialog.cpp SettingsDialog.cpp icon.xpm icon32.xpm \ 5 openyahtzee.rc 5 6 6 7 # set the include path found by configure … … 10 11 11 12 noinst_HEADERS = MainFrame.h ObjectsID.h SettingsDB.h HighScoreTableDB.h \ 12 HighScoreDialog.h SettingsDialog.h Icon.h13 HighScoreDialog.h SettingsDialog.h Icon.h icon32.ico 13 14 14 15 openyahtzee_LDFLAGS = `wx-config --libs` -lsqlite3 -
trunk/OpenYahtzee/src/Makefile.in
r35 r38 185 185 target_alias = @target_alias@ 186 186 openyahtzee_SOURCES = openyahtzee.cpp MainFrame.cpp five.xpm four.xpm one.xpm \ 187 six.xpm three.xpm two.xpm DBwrapper.cpp DBwrapper.h SettingsDB.cpp \ 188 HighScoreTableDB.cpp HighScoreDialog.cpp SettingsDialog.cpp icon.xpm icon32.xpm 187 six.xpm three.xpm two.xpm DBwrapper.cpp DBwrapper.h SettingsDB.cpp \ 188 HighScoreTableDB.cpp HighScoreDialog.cpp SettingsDialog.cpp icon.xpm icon32.xpm \ 189 openyahtzee.rc 189 190 190 191 … … 194 195 # the library search path. 195 196 noinst_HEADERS = MainFrame.h ObjectsID.h SettingsDB.h HighScoreTableDB.h \ 196 HighScoreDialog.h SettingsDialog.h Icon.h197 HighScoreDialog.h SettingsDialog.h Icon.h icon32.ico 197 198 198 199 openyahtzee_LDFLAGS = `wx-config --libs` -lsqlite3 -
trunk/OpenYahtzee/src/ObjectsID.h
r20 r38 28 28 ID_SHOWHIGHSCORE, 29 29 ID_SETTINGS, 30 ID_CHECK_FOR_UPDATES, 30 31 31 32 ID_ACES, -
trunk/OpenYahtzee/src/openyahtzee.cpp
r17 r38 27 27 #include "wx/wx.h" 28 28 #include "MainFrame.h" 29 // #ifdef WIN32 30 // #include openyahtzee.rc 31 // #endif 29 32 30 33
Note: See TracChangeset
for help on using the changeset viewer.
