Changeset 17


Ignore:
Timestamp:
12/12/06 16:38:38 (8 years ago)
Author:
guyru
Message:

several bug fixes to the high score table

Location:
trunk/OpenYahtzee
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/OpenYahtzee/AUTHORS

    r2 r17  
    1 Guy Rutenberg <guy@Guy_Computer> 
     1Guy Rutenberg guyrutenberg@gmail.com 
  • trunk/OpenYahtzee/openyahtzee.kdevelop

    r15 r17  
    33  <general> 
    44    <author>Guy Rutenberg</author> 
    5     <email>guy@Guy_Computer</email> 
    6     <version>0.1</version> 
     5    <email>guyrutenberg@gmail.com</email> 
     6    <version>1.5.1</version> 
    77    <projectmanagement>KDevAutoProject</projectmanagement> 
    88    <primarylanguage>C++</primarylanguage> 
     
    1414    <projectdirectory>.</projectdirectory> 
    1515    <absoluteprojectpath>false</absoluteprojectpath> 
    16     <description/> 
     16    <description></description> 
    1717  </general> 
    1818  <kdevautoproject> 
     
    2828        <openyahtzee/> 
    2929      </runarguments> 
     30      <customdirectory>/</customdirectory> 
     31      <programargs></programargs> 
     32      <autocompile>true</autocompile> 
     33      <envvars/> 
    3034    </run> 
    3135    <configurations> 
     
    7074        <envvar value="1" name="WANT_AUTOMAKE_1_6" /> 
    7175      </envvars> 
     76      <abortonerror>true</abortonerror> 
     77      <runmultiplejobs>false</runmultiplejobs> 
     78      <numberofjobs>1</numberofjobs> 
     79      <dontact>false</dontact> 
     80      <makebin></makebin> 
     81      <prio>0</prio> 
    7282    </make> 
    7383  </kdevautoproject> 
     
    119129  </kdevdoctreeview> 
    120130  <kdevfilecreate> 
     131    <filetypes/> 
    121132    <useglobaltypes> 
    122133      <type ext="cpp" /> 
     
    175186    </codecompletion> 
    176187    <creategettersetter> 
    177       <prefixGet/> 
     188      <prefixGet></prefixGet> 
    178189      <prefixSet>set</prefixSet> 
    179190      <prefixVariable>m_,_</prefixVariable> 
     
    191202  <kdevdebugger> 
    192203    <general> 
    193       <programargs/> 
    194       <gdbpath/> 
    195       <dbgshell/> 
    196       <configGdbScript/> 
    197       <runShellScript/> 
    198       <runGdbScript/> 
     204      <programargs></programargs> 
     205      <gdbpath></gdbpath> 
     206      <dbgshell></dbgshell> 
     207      <configGdbScript></configGdbScript> 
     208      <runShellScript></runShellScript> 
     209      <runGdbScript></runGdbScript> 
    199210      <breakonloadinglibs>true</breakonloadinglibs> 
    200211      <separatetty>false</separatetty> 
     
    212223    <archname></archname> 
    213224    <appname>OpenYahtzee</appname> 
    214     <version>1.5</version> 
     225    <version>1.5.1</version> 
    215226    <release></release> 
    216     <vendor></vendor> 
    217     <licence></licence> 
     227    <vendor>Guy Rutenberg</vendor> 
     228    <licence>GPL</licence> 
    218229    <summary></summary> 
    219230    <group></group> 
  • trunk/OpenYahtzee/openyahtzee.kdevses

    r15 r17  
    22<!DOCTYPE KDevPrjSession> 
    33<KDevPrjSession> 
    4  <DocsAndViews NumberOfDocuments="14" > 
    5   <Doc0 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/DBwrapper.cpp" > 
    6    <View0 line="0" Type="Source" /> 
     4 <DocsAndViews NumberOfDocuments="1" > 
     5  <Doc0 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDB.h" > 
     6   <View0 line="3" Type="Source" /> 
    77  </Doc0> 
    8   <Doc1 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/DBwrapper.h" > 
    9    <View0 line="0" Type="Source" /> 
    10   </Doc1> 
    11   <Doc2 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/HighScoreDialog.cpp" > 
    12    <View0 line="0" Type="Source" /> 
    13   </Doc2> 
    14   <Doc3 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/HighScoreTableDB.h" > 
    15    <View0 line="0" Type="Source" /> 
    16   </Doc3> 
    17   <Doc4 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/HighScoreDialog.h" > 
    18    <View0 line="0" Type="Source" /> 
    19   </Doc4> 
    20   <Doc5 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/MainFrame.h" > 
    21    <View0 line="0" Type="Source" /> 
    22   </Doc5> 
    23   <Doc6 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/ObjectsID.h" > 
    24    <View0 line="0" Type="Source" /> 
    25   </Doc6> 
    26   <Doc7 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDB.h" > 
    27    <View0 line="0" Type="Source" /> 
    28   </Doc7> 
    29   <Doc8 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/MainFrame.cpp" > 
    30    <View0 line="0" Type="Source" /> 
    31   </Doc8> 
    32   <Doc9 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/openyahtzee.cpp" > 
    33    <View0 line="0" Type="Source" /> 
    34   </Doc9> 
    35   <Doc10 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/HighScoreTableDB.cpp" > 
    36    <View0 line="0" Type="Source" /> 
    37   </Doc10> 
    38   <Doc11 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDB.cpp" > 
    39    <View0 line="0" Type="Source" /> 
    40   </Doc11> 
    41   <Doc12 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDialog.cpp" > 
    42    <View0 line="0" Type="Source" /> 
    43   </Doc12> 
    44   <Doc13 NumberOfViews="1" URL="file:///home/guy/workspace/OpenYahtzee/src/SettingsDialog.h" > 
    45    <View0 line="0" Type="Source" /> 
    46   </Doc13> 
    478 </DocsAndViews> 
    489 <pluginList> 
  • trunk/OpenYahtzee/src/HighScoreDialog.cpp

    r15 r17  
    22/*************************************************************************** 
    33 *   Copyright (C) 2006 by Guy Rutenberg   * 
    4  *   guy@Guy_Computer   * 
     4 *   guyrutenberg@gmail.com   * 
    55 *                                                                         * 
    66 *   This program is free software; you can redistribute it and/or modify  * 
  • trunk/OpenYahtzee/src/HighScoreDialog.h

    r15 r17  
    22/*************************************************************************** 
    33 *   Copyright (C) 2006 by Guy Rutenberg   * 
    4  *   guy@Guy_Computer   * 
     4 *   guyrutenberg@gmail.com   * 
    55 *                                                                         * 
    66 *   This program is free software; you can redistribute it and/or modify  * 
  • trunk/OpenYahtzee/src/HighScoreTableDB.cpp

    r15 r17  
    22/*************************************************************************** 
    33 *   Copyright (C) 2006 by Guy Rutenberg   * 
    4  *   guy@Guy_Computer   * 
     4 *   guyrutenberg@gmail.com   * 
    55 *                                                                         * 
    66 *   This program is free software; you can redistribute it and/or modify  * 
     
    121121        std::ostringstream sstr; 
    122122         
    123         std::string tmp_date, tmpswap_date, tmp_name,tmpswap_name; 
    124         int tmp_score, tmpswap_score; 
     123        std::string tmp_date, tmpswap_date="", tmp_name,tmpswap_name=""; 
     124        int tmp_score, tmpswap_score=0; 
    125125 
    126126        place = IsHighScore(score); 
     
    134134                 
    135135        //first move all the rows starting at 'place' one row down 
    136         for (int i = place;i<m_size;i++){ 
     136        for (int i = place; i <= m_size ; i++){ 
    137137                sstr.str(""); 
    138138                //Get the current score and details of the row and then move them one row below; 
     
    143143                p = result.begin(); 
    144144                tmp_name=*(p); 
    145                 tmp_date=*(p++); 
    146                 tmp_score= atoi((p++)->c_str()); 
     145                tmp_date=*(++p); 
     146                tmp_score= atoi((++p)->c_str()); 
    147147 
    148148                sstr.str(""); 
     
    158158                result = Query(tmp_query); 
    159159 
    160                 sstr.str(""); 
    161                 tmp_query="SELECT name,date,score FROM highscore WHERE place="; 
    162                 sstr<<i+1<<flush; //make sure the number realiy gets into the stream 
    163                 tmp_query += sstr.str();  
    164                 result = Query(tmp_query); 
    165                 p = result.begin(); 
    166                 tmpswap_name=*(p); 
    167                 tmpswap_date=*(p++); 
    168                 tmpswap_score= atoi((p++)->c_str()); 
    169  
    170                 sstr.str(""); 
    171                 tmp_query="REPLACE INTO highscore (place,name,date,score) VALUES("; 
    172                 sstr<<i+1<<flush; //make sure the number realiy gets into the stream 
    173                 tmp_query += sstr.str();  
    174                 tmp_query += ","; 
    175                 tmp_query +="\""+tmp_name+"\"" +", " + "\""+tmp_date+"\"" + ", "; 
    176                  
    177                 sstr.str(""); 
    178                 sstr<<tmp_score<<flush; //make sure the number realiy gets into the stream 
    179                 tmp_query += sstr.str()+")";  
    180                 result = Query(tmp_query); 
     160                //pass the info to the next item 
     161                tmpswap_score = tmp_score; 
     162                tmpswap_name = tmp_name; 
     163                tmpswap_date = tmp_date; 
    181164        } 
    182165        //now replace the row at 'place' 
  • trunk/OpenYahtzee/src/HighScoreTableDB.h

    r15 r17  
    22/*************************************************************************** 
    33 *   Copyright (C) 2006 by Guy Rutenberg   * 
    4  *   guy@Guy_Computer   * 
     4 *   guyrutenberg@gmail.com   * 
    55 *                                                                         * 
    66 *   This program is free software; you can redistribute it and/or modify  * 
  • trunk/OpenYahtzee/src/MainFrame.cpp

    r15 r17  
    22/*************************************************************************** 
    33 *   Copyright (C) 2006 by Guy Rutenberg   * 
    4  *   guy@Guy_Computer   * 
     4 *   guyrutenberg@gmail.com   * 
    55 *                                                                         * 
    66 *   This program is free software; you can redistribute it and/or modify  * 
     
    225225        wxString msg; 
    226226        wxString sqliteversion = wxString(sqlite3_version,wxConvUTF8); 
    227         msg.Printf(wxT("OpenYahtzee 1.5\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); 
     227        msg.Printf(wxT("OpenYahtzee 1.5.1\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); 
    228228        msg += wxT("SQLite ") + sqliteversion; 
    229229                 
  • trunk/OpenYahtzee/src/MainFrame.h

    r15 r17  
    22/*************************************************************************** 
    33 *   Copyright (C) 2006 by Guy Rutenberg   * 
    4  *   guy@Guy_Computer   * 
     4 *   guyrutenberg@gmail.com   * 
    55 *                                                                         * 
    66 *   This program is free software; you can redistribute it and/or modify  * 
  • trunk/OpenYahtzee/src/ObjectsID.h

    r15 r17  
    22/*************************************************************************** 
    33 *   Copyright (C) 2006 by Guy Rutenberg   * 
    4  *   guy@Guy_Computer   * 
     4 *   guyrutenberg@gmail.com   * 
    55 *                                                                         * 
    66 *   This program is free software; you can redistribute it and/or modify  * 
  • trunk/OpenYahtzee/src/SettingsDB.cpp

    r15 r17  
    22/*************************************************************************** 
    33 *   Copyright (C) 2006 by Guy Rutenberg   * 
    4  *   guy@Guy_Computer   * 
     4 *   guyrutenberg@gmail.com   * 
    55 *                                                                         * 
    66 *   This program is free software; you can redistribute it and/or modify  * 
  • trunk/OpenYahtzee/src/SettingsDB.h

    r15 r17  
    22/*************************************************************************** 
    33 *   Copyright (C) 2006 by Guy Rutenberg   * 
    4  *   guy@Guy_Computer   * 
     4 *   guyrutenberg@gmail.com   * 
    55 *                                                                         * 
    66 *   This program is free software; you can redistribute it and/or modify  * 
  • trunk/OpenYahtzee/src/SettingsDialog.cpp

    r15 r17  
    9999        SettingsDialogData data; 
    100100        data.highscoresize = spin_ctrl->GetValue(); 
     101        data.reset = button_3->GetValue(); 
    101102        return data; 
    102103} 
  • trunk/OpenYahtzee/src/SettingsDialog.h

    r15 r17  
    22/*************************************************************************** 
    33 *   Copyright (C) 2006 by Guy Rutenberg   * 
    4  *   guy@Guy_Computer   * 
     4 *   guyrutenberg@gmail.com   * 
    55 *                                                                         * 
    66 *   This program is free software; you can redistribute it and/or modify  * 
  • trunk/OpenYahtzee/src/openyahtzee.cpp

    r15 r17  
    22/*************************************************************************** 
    33 *   Copyright (C) 2006 by Guy Rutenberg   * 
    4  *   guy@Guy_Computer   * 
     4 *   guyrutenberg@gmail.com   * 
    55 *                                                                         * 
    66 *   This program is free software; you can redistribute it and/or modify  * 
Note: See TracChangeset for help on using the changeset viewer.