Changeset 76


Ignore:
Timestamp:
28/04/07 16:33:02 (8 years ago)
Author:
guyru
Message:

updated about info and added url settings

Location:
trunk/OpenYahtzee
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/OpenYahtzee/macros/autogen.sh

    r66 r76  
    11#!/bin/sh 
    22aclocal 
     3autoheader 
    34libtoolize --automake --force --copy 
    45automake -a -c 
  • trunk/OpenYahtzee/src/About.cpp

    r72 r76  
    5353        label_1 = new wxStaticText(notebook_main_pane_about, -1, wxT("http://openyahtzee.sourceforge.net/")); 
    5454        label_7 = new wxStaticText(notebook_main_pane_authors, -1, wxT("Please report bugs to openyahtzee-users@lists.sourceforge.net.\n\nGuy Rutenberg\n\tguyrutenberg@gmail.com\n\tAuthor, maintainer")); 
    55         label_6 = new wxStaticText(notebook_main_pane_thanks, -1, wxT("Seamous McGill\n\tjohndoe@gmail.com\n\tLogo and dice design\n\nNeil Gierman\n\tNeil Gierman\n\tRPM packages\n\nJohn Doe3\n    email@john.com\n    Windows Installer")); 
     55        label_6 = new wxStaticText(notebook_main_pane_thanks, -1, wxT("Seamous McGill\n\tjohndoe@gmail.com\n\tLogo and dice design\n\nNeil Gierman\n\tngierman@roadrunn.com\n\tRPM packages")); 
    5656    label_15 = new wxStaticText(notebook_main_pane_license, -1, wxT("This program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by \nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of \nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details. \n\nYou should have received a copy of the GNU General Public License \nalong with this program; if not, write to the\nFree Software Foundation, Inc.,\n59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.")); 
    5757    close_button = new wxButton(this, wxID_OK, wxT("Close")); 
  • trunk/OpenYahtzee/src/MainFrame.cpp

    r71 r76  
    6767        m_settingsdb = new SettingsDB(); //Get the settings database connection 
    6868        m_highscoredb = new HighScoreTableDB(); 
    69  
    70         //DATABASE initialization 
    71         if (m_settingsdb->GetKey("highscoresize") == "") { //check if we need to create a new high score table 
    72                 m_highscoredb->SetSize(DEF_HIGHSCORESIZE); 
    73                 sstr<<DEF_HIGHSCORESIZE<<std::flush; 
    74                 m_settingsdb->SetKey("highscoresize", sstr.str()); 
    75         } else { 
    76                 int highscoresize = atoi((m_settingsdb->GetKey("highscoresize")).c_str()); 
    77                 //m_highscoredb->SetSize((highscoresize>0)?highscoresize:DEF_HIGHSCORESIZE); 
    78                 m_highscoredb->SetSize(highscoresize); 
    79         } 
    80          
    81         if (m_settingsdb->GetKey("animate") == "Yes") { 
    82                 m_animate = true; 
    83         } else if (m_settingsdb->GetKey("animate") == "No") { 
    84                 m_animate = false; 
    85         } else { 
    86                 m_settingsdb->SetKey("animate", "Yes"); 
    87                 m_animate = true; 
    88         } 
    89         if (m_settingsdb->GetKey("calculatesubtotal") == "Yes") { 
    90                 m_calculatesubtotal = true; 
    91         } else if (m_settingsdb->GetKey("calculatesubtotal") == "No") { 
    92                 m_calculatesubtotal = false; 
    93         } else { 
    94                 m_settingsdb->SetKey("calculatesubtotal", "Yes"); 
    95                 m_calculatesubtotal = true; 
    96         } 
    97  
    98         // END Database initialization 
     69         
     70        InitializeDatabase();//this must come _after_ m_settingsdb and m_highscoredb are created 
    9971 
    10072        bitmap_dices[0] = new wxBitmap(one_xpm); 
     
    1023995        } 
    1024996} 
     997 
     998/** 
     999 * Initializes the database and stores default settings if needed. 
     1000 * @return 0 if some error 
     1001 */ 
     1002int MainFrame::InitializeDatabase() 
     1003{ 
     1004        std::ostringstream sstr; 
     1005 
     1006 
     1007        if (m_settingsdb->GetKey("highscoresize") == "") { //check if we need to create a new high score table 
     1008                m_highscoredb->SetSize(DEF_HIGHSCORESIZE); 
     1009                sstr<<DEF_HIGHSCORESIZE<<std::flush; 
     1010                m_settingsdb->SetKey("highscoresize", sstr.str()); 
     1011        } else { 
     1012                int highscoresize = atoi((m_settingsdb->GetKey("highscoresize")).c_str()); 
     1013                //m_highscoredb->SetSize((highscoresize>0)?highscoresize:DEF_HIGHSCORESIZE); 
     1014                m_highscoredb->SetSize(highscoresize); 
     1015        } 
     1016         
     1017        if (m_settingsdb->GetKey("animate") == "Yes") { 
     1018                m_animate = true; 
     1019        } else if (m_settingsdb->GetKey("animate") == "No") { 
     1020                m_animate = false; 
     1021        } else { 
     1022                m_settingsdb->SetKey("animate", "Yes"); 
     1023                m_animate = true; 
     1024        } 
     1025        if (m_settingsdb->GetKey("calculatesubtotal") == "Yes") { 
     1026                m_calculatesubtotal = true; 
     1027        } else if (m_settingsdb->GetKey("calculatesubtotal") == "No") { 
     1028                m_calculatesubtotal = false; 
     1029        } else { 
     1030                m_settingsdb->SetKey("calculatesubtotal", "Yes"); 
     1031                m_calculatesubtotal = true; 
     1032        } 
     1033         
     1034        if (m_settingsdb->GetKey("openyahtzeehomepage") == "") { 
     1035                m_settingsdb->SetKey("openyahtzeehomepage", "http://openyahtzee.sourceforge.net/"); 
     1036        } 
     1037 
     1038        if (m_settingsdb->GetKey("updateurl") == "") { 
     1039                /*the version string will be appended in the end of the 
     1040                  given url */ 
     1041                m_settingsdb->SetKey("updateurl", "http://openyahtzee.sourceforge.net/update.php?version="); 
     1042        } 
     1043         
     1044        return 1; 
     1045} 
  • trunk/OpenYahtzee/src/MainFrame.h

    r71 r76  
    7676        void CalculateSubTotal(); 
    7777        void LaunchBrowser (wxString link); 
     78        int InitializeDatabase(); 
    7879 
    7980        //pointers to hold bitmap data for the dices 
Note: See TracChangeset for help on using the changeset viewer.