Database is now at ~/.kisscount/kc.bdd

This commit is contained in:
Grégory Soutadé 2011-02-20 14:22:31 +01:00
parent 46df6c01d3
commit 16e90b8fc0
9 changed files with 146 additions and 93 deletions

View File

@ -12,6 +12,7 @@ v0.2_dev (19/02/2011)
Searchs aren't case sensitive enough Searchs aren't case sensitive enough
Default categories in native language (even if switching language at runtime) Default categories in native language (even if switching language at runtime)
Add Real mode Add Real mode
Database is now at ~/.kisscount/kc.bdd
** Dev ** ** Dev **
Use a factory to create panels (prepare for plug-in) Use a factory to create panels (prepare for plug-in)

View File

@ -1,6 +1,6 @@
CREATE TABLE kisscount(db_version VARCHAR(20)); CREATE TABLE kisscount(db_version VARCHAR(20));
CREATE TABLE user (id INTEGER PRIMARY KEY, name VARCHAR(255), password VARCHAR(255)); CREATE TABLE user (id INTEGER PRIMARY KEY, name VARCHAR(255), password VARCHAR(255));
CREATE TABLE account(id INTEGER PRIMARY KEY, user REFERENCES user(id), name VARCHAR(255), number VARCHAR(255), shared CHAR(1), blocked CHAR(1), default_account CHAR(1)); CREATE TABLE account(id INTEGER PRIMARY KEY, user REFERENCES user(id), name VARCHAR(255), number VARCHAR(255), shared CHAR(1), blocked CHAR(1), default_account CHAR(1), virtual CHAR(1));
CREATE TABLE shared_account(account REFERENCES account(id), user REFERENCES user(id)); CREATE TABLE shared_account(account REFERENCES account(id), user REFERENCES user(id));
CREATE TABLE account_amount(id INTEGER PRIMARY KEY, account REFERENCES account(id), year INTEGER, month INTEGER, amount FLOAT); CREATE TABLE account_amount(id INTEGER PRIMARY KEY, account REFERENCES account(id), year INTEGER, month INTEGER, amount FLOAT);
CREATE TABLE operation(id INTEGER PRIMARY KEY, parent REFERENCES operation(id), user REFERENCES user(id), account REFERENCES account(id), year INTEGER, month INTEGER, day INTEGER, amount FLOAT, description VARCHAR(255), category REFERENCES category(id), fix_cost CHAR(1), checked CHAR(1), formula VARCHAR(255), transfert REFERENCES operation(id), meta CHAR(1), virtual CHAR(1)); CREATE TABLE operation(id INTEGER PRIMARY KEY, parent REFERENCES operation(id), user REFERENCES user(id), account REFERENCES account(id), year INTEGER, month INTEGER, day INTEGER, amount FLOAT, description VARCHAR(255), category REFERENCES category(id), fix_cost CHAR(1), checked CHAR(1), formula VARCHAR(255), transfert REFERENCES operation(id), meta CHAR(1), virtual CHAR(1));

Binary file not shown.

View File

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-02-15 19:15+0100\n" "POT-Creation-Date: 2011-02-20 12:04+0100\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: Soutadé <soutade@gmail.com>\n" "Last-Translator: Soutadé <soutade@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@ -37,11 +37,11 @@ msgstr " existe déjà"
msgid " entries found" msgid " entries found"
msgstr " entrées trouvées" msgstr " entrées trouvées"
#: src/model/Database.cpp:96 #: src/model/Database.cpp:103
msgid " not found, aborting" msgid " not found, aborting"
msgstr " non trouvé, arrêt" msgstr " non trouvé, arrêt"
#: src/view/AccountPanel.cpp:766 #: src/view/AccountPanel.cpp:852
msgid " operations ?" msgid " operations ?"
msgstr " opérations ?" msgstr " opérations ?"
@ -49,7 +49,7 @@ msgstr " opérations ?"
msgid " profil ?" msgid " profil ?"
msgstr " profil ?" msgstr " profil ?"
#: src/model/Database.cpp:85 #: src/model/Database.cpp:92
msgid "!! Warning !! If there was a bug, the old database will be suppressed !" msgid "!! Warning !! If there was a bug, the old database will be suppressed !"
msgstr "!! Attention !! S'il y a eu un bug, l'ancienne base de donnée va être supprimée !" msgstr "!! Attention !! S'il y a eu un bug, l'ancienne base de donnée va être supprimée !"
@ -71,11 +71,11 @@ msgstr "Le compte "
msgid "Account 1" msgid "Account 1"
msgstr "Compte 1" msgstr "Compte 1"
#: src/view/AccountPanel.cpp:106 #: src/view/AccountPanel.cpp:108
msgid "Account name" msgid "Account name"
msgstr "Nom du compte" msgstr "Nom du compte"
#: src/view/AccountPanel.cpp:105 #: src/view/AccountPanel.cpp:107
msgid "Account number" msgid "Account number"
msgstr "Numéro de compte" msgstr "Numéro de compte"
@ -93,7 +93,7 @@ msgid "Amount to"
msgstr "Montant max" msgstr "Montant max"
#: src/view/PreferencesPanel.cpp:838 #: src/view/PreferencesPanel.cpp:838
#: src/view/AccountPanel.cpp:761 #: src/view/AccountPanel.cpp:847
msgid "Are you sure want to delete " msgid "Are you sure want to delete "
msgstr "Etes vous sûr de vouloir supprimer " msgstr "Etes vous sûr de vouloir supprimer "
@ -163,9 +163,9 @@ msgstr "Changer la catégorie"
msgid "Change password" msgid "Change password"
msgstr "Changer le mot de passe" msgstr "Changer le mot de passe"
#: src/view/AccountPanel.cpp:122 #: src/view/AccountPanel.cpp:124
msgid "Check mode" msgid "Check"
msgstr "Mode rapprochement" msgstr "Rapprochement"
#: src/view/SearchPanel.cpp:84 #: src/view/SearchPanel.cpp:84
msgid "Checked" msgid "Checked"
@ -184,7 +184,7 @@ msgid "Confirm password "
msgstr "Confirmer le mot de passe " msgstr "Confirmer le mot de passe "
#: src/view/StatsPanel.cpp:128 #: src/view/StatsPanel.cpp:128
#: src/view/AccountPanel.cpp:116 #: src/view/AccountPanel.cpp:118
msgid "Cost repartition" msgid "Cost repartition"
msgstr "Répartition des coûts" msgstr "Répartition des coûts"
@ -192,15 +192,15 @@ msgstr "Répartition des coûts"
msgid "Credit" msgid "Credit"
msgstr "Crédit" msgstr "Crédit"
#: src/view/AccountPanel.cpp:215 #: src/view/AccountPanel.cpp:219
msgid "Cur Credit" msgid "Cur Credit"
msgstr "Cur Crédit" msgstr "Cur Crédit"
#: src/view/AccountPanel.cpp:216 #: src/view/AccountPanel.cpp:220
msgid "Cur Debit" msgid "Cur Debit"
msgstr "Cur Débit" msgstr "Cur Débit"
#: src/view/AccountPanel.cpp:108 #: src/view/AccountPanel.cpp:110
msgid "Current value" msgid "Current value"
msgstr "Valeur courante" msgstr "Valeur courante"
@ -226,7 +226,7 @@ msgstr "Défaut"
#: src/view/PreferencesPanel.cpp:201 #: src/view/PreferencesPanel.cpp:201
#: src/view/PreferencesPanel.cpp:295 #: src/view/PreferencesPanel.cpp:295
#: src/view/AccountPanel.cpp:620 #: src/view/AccountPanel.cpp:706
msgid "Delete" msgid "Delete"
msgstr "Supprimer" msgstr "Supprimer"
@ -239,7 +239,7 @@ msgstr "Décroissant"
msgid "Description" msgid "Description"
msgstr "Description" msgstr "Description"
#: src/view/SearchPanel.cpp:394 #: src/view/SearchPanel.cpp:393
msgid "Enter a new description" msgid "Enter a new description"
msgstr "Nouvelle description" msgstr "Nouvelle description"
@ -258,27 +258,29 @@ msgstr "Nouvelle description"
#: src/view/PreferencesPanel.cpp:789 #: src/view/PreferencesPanel.cpp:789
#: src/view/PasswordDialog.cpp:72 #: src/view/PasswordDialog.cpp:72
#: src/view/PasswordDialog.cpp:78 #: src/view/PasswordDialog.cpp:78
#: src/view/AccountPanel.cpp:757 #: src/view/AccountPanel.cpp:843
#: src/view/grid/GridAccount.cpp:1271 #: src/view/grid/GridAccount.cpp:1271
#: src/view/grid/GridAccount.cpp:1278 #: src/view/grid/GridAccount.cpp:1278
#: src/view/grid/GridAccount.cpp:1397 #: src/view/grid/GridAccount.cpp:1397
#: src/view/grid/GridAccount.cpp:1403 #: src/view/grid/GridAccount.cpp:1403
#: src/view/grid/wxGridCellFormulaEditor.cpp:69 #: src/view/grid/wxGridCellFormulaEditor.cpp:69
#: src/model/Database.cpp:42 #: src/model/Database.cpp:45
#: src/model/Database.cpp:49 #: src/model/Database.cpp:52
#: src/model/Database.cpp:67 #: src/model/Database.cpp:70
#: src/model/Database.cpp:96 #: src/model/Database.cpp:103
#: src/model/Database.cpp:104 #: src/model/Database.cpp:109
#: src/model/Database.cpp:125 #: src/model/Database.cpp:115
#: src/model/Database.cpp:123
#: src/model/Database.cpp:144
#: src/model/Database_Update.cpp:23 #: src/model/Database_Update.cpp:23
msgid "Error" msgid "Error"
msgstr "Erreur" msgstr "Erreur"
#: src/model/Database.cpp:125 #: src/model/Database.cpp:144
msgid "Error creating original database" msgid "Error creating original database"
msgstr "Erreur durant la création de la base de données initiale" msgstr "Erreur durant la création de la base de données initiale"
#: src/view/AccountPanel.cpp:109 #: src/view/AccountPanel.cpp:111
msgid "Final value" msgid "Final value"
msgstr "Valeur finale" msgstr "Valeur finale"
@ -305,7 +307,7 @@ msgid "From "
msgstr "A partir de " msgstr "A partir de "
#: src/view/GenerateDialog.cpp:31 #: src/view/GenerateDialog.cpp:31
#: src/view/AccountPanel.cpp:617 #: src/view/AccountPanel.cpp:703
msgid "Generate month" msgid "Generate month"
msgstr "Générer mois" msgstr "Générer mois"
@ -313,7 +315,7 @@ msgstr "Générer mois"
msgid "Groceries" msgid "Groceries"
msgstr "Courses" msgstr "Courses"
#: src/view/AccountPanel.cpp:126 #: src/view/AccountPanel.cpp:130
msgid "Group" msgid "Group"
msgstr "Grouper" msgstr "Grouper"
@ -321,7 +323,7 @@ msgstr "Grouper"
msgid "Hobbies" msgid "Hobbies"
msgstr "Loisirs" msgstr "Loisirs"
#: src/view/AccountPanel.cpp:107 #: src/view/AccountPanel.cpp:109
msgid "Initial value" msgid "Initial value"
msgstr "Valeur initiale" msgstr "Valeur initiale"
@ -365,7 +367,7 @@ msgstr "Intervalle de temps invalide"
msgid "It must be at least one account !" msgid "It must be at least one account !"
msgstr "Il doit y avoir au moins un compte !" msgstr "Il doit y avoir au moins un compte !"
#: src/view/AccountPanel.cpp:757 #: src/view/AccountPanel.cpp:843
msgid "It must be at least one month !" msgid "It must be at least one month !"
msgstr "Il doit rester au moins un mois" msgstr "Il doit rester au moins un mois"
@ -392,6 +394,10 @@ msgstr "Langue non changée"
msgid "Language successfully changed, please go to another panel" msgid "Language successfully changed, please go to another panel"
msgstr "Langue changée, allez sur un autre panneau pour rendre le changement effectif" msgstr "Langue changée, allez sur un autre panneau pour rendre le changement effectif"
#: src/view/AccountPanel.cpp:125
msgid "Mode"
msgstr "Mode"
#: src/view/PreferencesPanel.cpp:72 #: src/view/PreferencesPanel.cpp:72
#: src/view/PreferencesPanel.cpp:196 #: src/view/PreferencesPanel.cpp:196
#: src/view/PreferencesPanel.cpp:291 #: src/view/PreferencesPanel.cpp:291
@ -411,7 +417,7 @@ msgstr "Nouvel utilisateur"
msgid "New password " msgid "New password "
msgstr "Nouveau mot de passe " msgstr "Nouveau mot de passe "
#: src/model/Database.cpp:84 #: src/model/Database.cpp:91
msgid "" msgid ""
"No database found, would you like to create a new one ?\n" "No database found, would you like to create a new one ?\n"
"\n" "\n"
@ -461,7 +467,7 @@ msgid "Operation order"
msgstr "Ordre des opérations" msgstr "Ordre des opérations"
#: src/view/SearchPanel.cpp:98 #: src/view/SearchPanel.cpp:98
#: src/view/AccountPanel.cpp:175 #: src/view/AccountPanel.cpp:179
msgid "Operations" msgid "Operations"
msgstr "Opérations" msgstr "Opérations"
@ -509,7 +515,11 @@ msgstr "Préférences"
msgid "Quit KissCount ?" msgid "Quit KissCount ?"
msgstr "Quitter KissCount ?" msgstr "Quitter KissCount ?"
#: src/view/AccountPanel.cpp:217 #: src/view/AccountPanel.cpp:124
msgid "Real"
msgstr "Réel"
#: src/view/AccountPanel.cpp:221
msgid "Remains" msgid "Remains"
msgstr "Restant" msgstr "Restant"
@ -519,12 +529,12 @@ msgstr "Renommer"
#: src/view/SearchPanel.cpp:92 #: src/view/SearchPanel.cpp:92
#: src/view/SearchPanel.cpp:164 #: src/view/SearchPanel.cpp:164
#: src/view/SearchPanel.cpp:410 #: src/view/SearchPanel.cpp:409
msgid "Search" msgid "Search"
msgstr "Chercher" msgstr "Chercher"
#: src/view/StatsPanel.cpp:120 #: src/view/StatsPanel.cpp:120
#: src/view/AccountPanel.cpp:90 #: src/view/AccountPanel.cpp:92
msgid "Serie 1" msgid "Serie 1"
msgstr "Série 1" msgstr "Série 1"
@ -545,22 +555,27 @@ msgstr "A"
msgid "To " msgid "To "
msgstr "Vers " msgstr "Vers "
#: src/view/AccountPanel.cpp:199 #: src/view/AccountPanel.cpp:203
msgid "Total Credit" msgid "Total Credit"
msgstr "Total Crédit" msgstr "Total Crédit"
#: src/view/AccountPanel.cpp:200 #: src/view/AccountPanel.cpp:204
msgid "Total Debit" msgid "Total Debit"
msgstr "Total Débit" msgstr "Total Débit"
#: src/view/AccountPanel.cpp:127 #: src/view/AccountPanel.cpp:131
msgid "UnGroup" msgid "UnGroup"
msgstr "Dégrouper" msgstr "Dégrouper"
#: src/model/Database.cpp:42 #: src/model/Database.cpp:109
#: src/model/Database.cpp:49 #: src/model/Database.cpp:115
#: src/model/Database.cpp:67 msgid "Unable to Create "
#: src/model/Database.cpp:104 msgstr "Impossible de créer "
#: src/model/Database.cpp:45
#: src/model/Database.cpp:52
#: src/model/Database.cpp:70
#: src/model/Database.cpp:123
msgid "Unable to open Database" msgid "Unable to open Database"
msgstr "Impossible d'ouvrir la base de données" msgstr "Impossible d'ouvrir la base de données"
@ -591,6 +606,7 @@ msgid "Users"
msgstr "Utilisateurs" msgstr "Utilisateurs"
#: src/view/PreferencesPanel.cpp:199 #: src/view/PreferencesPanel.cpp:199
#: src/view/AccountPanel.cpp:124
msgid "Virtual" msgid "Virtual"
msgstr "Virtuel" msgstr "Virtuel"
@ -658,6 +674,8 @@ msgstr "octobre"
msgid "september" msgid "september"
msgstr "septembre" msgstr "septembre"
#~ msgid "Check mode"
#~ msgstr "Mode rapprochement"
#~ msgid "Query failed !\n" #~ msgid "Query failed !\n"
#~ msgstr "La requête a échouée !\n" #~ msgstr "La requête a échouée !\n"
#~ msgid "Update failed !\n" #~ msgid "Update failed !\n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-02-15 19:15+0100\n" "POT-Creation-Date: 2011-02-20 12:04+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -31,11 +31,11 @@ msgstr ""
msgid " entries found" msgid " entries found"
msgstr "" msgstr ""
#: src/model/Database.cpp:96 #: src/model/Database.cpp:103
msgid " not found, aborting" msgid " not found, aborting"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:766 #: src/view/AccountPanel.cpp:852
msgid " operations ?" msgid " operations ?"
msgstr "" msgstr ""
@ -43,7 +43,7 @@ msgstr ""
msgid " profil ?" msgid " profil ?"
msgstr "" msgstr ""
#: src/model/Database.cpp:85 #: src/model/Database.cpp:92
msgid "!! Warning !! If there was a bug, the old database will be suppressed !" msgid "!! Warning !! If there was a bug, the old database will be suppressed !"
msgstr "" msgstr ""
@ -63,11 +63,11 @@ msgstr ""
msgid "Account 1" msgid "Account 1"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:106 #: src/view/AccountPanel.cpp:108
msgid "Account name" msgid "Account name"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:105 #: src/view/AccountPanel.cpp:107
msgid "Account number" msgid "Account number"
msgstr "" msgstr ""
@ -83,7 +83,7 @@ msgstr ""
msgid "Amount to" msgid "Amount to"
msgstr "" msgstr ""
#: src/view/PreferencesPanel.cpp:838 src/view/AccountPanel.cpp:761 #: src/view/PreferencesPanel.cpp:838 src/view/AccountPanel.cpp:847
msgid "Are you sure want to delete " msgid "Are you sure want to delete "
msgstr "" msgstr ""
@ -148,8 +148,8 @@ msgstr ""
msgid "Change password" msgid "Change password"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:122 #: src/view/AccountPanel.cpp:124
msgid "Check mode" msgid "Check"
msgstr "" msgstr ""
#: src/view/SearchPanel.cpp:84 #: src/view/SearchPanel.cpp:84
@ -168,7 +168,7 @@ msgstr ""
msgid "Confirm password " msgid "Confirm password "
msgstr "" msgstr ""
#: src/view/StatsPanel.cpp:128 src/view/AccountPanel.cpp:116 #: src/view/StatsPanel.cpp:128 src/view/AccountPanel.cpp:118
msgid "Cost repartition" msgid "Cost repartition"
msgstr "" msgstr ""
@ -176,15 +176,15 @@ msgstr ""
msgid "Credit" msgid "Credit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:215 #: src/view/AccountPanel.cpp:219
msgid "Cur Credit" msgid "Cur Credit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:216 #: src/view/AccountPanel.cpp:220
msgid "Cur Debit" msgid "Cur Debit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:108 #: src/view/AccountPanel.cpp:110
msgid "Current value" msgid "Current value"
msgstr "" msgstr ""
@ -209,7 +209,7 @@ msgid "Default"
msgstr "" msgstr ""
#: src/view/PreferencesPanel.cpp:201 src/view/PreferencesPanel.cpp:295 #: src/view/PreferencesPanel.cpp:201 src/view/PreferencesPanel.cpp:295
#: src/view/AccountPanel.cpp:620 #: src/view/AccountPanel.cpp:706
msgid "Delete" msgid "Delete"
msgstr "" msgstr ""
@ -221,7 +221,7 @@ msgstr ""
msgid "Description" msgid "Description"
msgstr "" msgstr ""
#: src/view/SearchPanel.cpp:394 #: src/view/SearchPanel.cpp:393
msgid "Enter a new description" msgid "Enter a new description"
msgstr "" msgstr ""
@ -232,21 +232,22 @@ msgstr ""
#: src/view/PreferencesPanel.cpp:515 src/view/PreferencesPanel.cpp:726 #: src/view/PreferencesPanel.cpp:515 src/view/PreferencesPanel.cpp:726
#: src/view/PreferencesPanel.cpp:745 src/view/PreferencesPanel.cpp:783 #: src/view/PreferencesPanel.cpp:745 src/view/PreferencesPanel.cpp:783
#: src/view/PreferencesPanel.cpp:789 src/view/PasswordDialog.cpp:72 #: src/view/PreferencesPanel.cpp:789 src/view/PasswordDialog.cpp:72
#: src/view/PasswordDialog.cpp:78 src/view/AccountPanel.cpp:757 #: src/view/PasswordDialog.cpp:78 src/view/AccountPanel.cpp:843
#: src/view/grid/GridAccount.cpp:1271 src/view/grid/GridAccount.cpp:1278 #: src/view/grid/GridAccount.cpp:1271 src/view/grid/GridAccount.cpp:1278
#: src/view/grid/GridAccount.cpp:1397 src/view/grid/GridAccount.cpp:1403 #: src/view/grid/GridAccount.cpp:1397 src/view/grid/GridAccount.cpp:1403
#: src/view/grid/wxGridCellFormulaEditor.cpp:69 src/model/Database.cpp:42 #: src/view/grid/wxGridCellFormulaEditor.cpp:69 src/model/Database.cpp:45
#: src/model/Database.cpp:49 src/model/Database.cpp:67 #: src/model/Database.cpp:52 src/model/Database.cpp:70
#: src/model/Database.cpp:96 src/model/Database.cpp:104 #: src/model/Database.cpp:103 src/model/Database.cpp:109
#: src/model/Database.cpp:125 src/model/Database_Update.cpp:23 #: src/model/Database.cpp:115 src/model/Database.cpp:123
#: src/model/Database.cpp:144 src/model/Database_Update.cpp:23
msgid "Error" msgid "Error"
msgstr "" msgstr ""
#: src/model/Database.cpp:125 #: src/model/Database.cpp:144
msgid "Error creating original database" msgid "Error creating original database"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:109 #: src/view/AccountPanel.cpp:111
msgid "Final value" msgid "Final value"
msgstr "" msgstr ""
@ -271,7 +272,7 @@ msgstr ""
msgid "From " msgid "From "
msgstr "" msgstr ""
#: src/view/GenerateDialog.cpp:31 src/view/AccountPanel.cpp:617 #: src/view/GenerateDialog.cpp:31 src/view/AccountPanel.cpp:703
msgid "Generate month" msgid "Generate month"
msgstr "" msgstr ""
@ -279,7 +280,7 @@ msgstr ""
msgid "Groceries" msgid "Groceries"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:126 #: src/view/AccountPanel.cpp:130
msgid "Group" msgid "Group"
msgstr "" msgstr ""
@ -287,7 +288,7 @@ msgstr ""
msgid "Hobbies" msgid "Hobbies"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:107 #: src/view/AccountPanel.cpp:109
msgid "Initial value" msgid "Initial value"
msgstr "" msgstr ""
@ -331,7 +332,7 @@ msgstr ""
msgid "It must be at least one account !" msgid "It must be at least one account !"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:757 #: src/view/AccountPanel.cpp:843
msgid "It must be at least one month !" msgid "It must be at least one month !"
msgstr "" msgstr ""
@ -356,6 +357,10 @@ msgstr ""
msgid "Language successfully changed, please go to another panel" msgid "Language successfully changed, please go to another panel"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:125
msgid "Mode"
msgstr ""
#: src/view/PreferencesPanel.cpp:72 src/view/PreferencesPanel.cpp:196 #: src/view/PreferencesPanel.cpp:72 src/view/PreferencesPanel.cpp:196
#: src/view/PreferencesPanel.cpp:291 #: src/view/PreferencesPanel.cpp:291
msgid "Name" msgid "Name"
@ -373,7 +378,7 @@ msgstr ""
msgid "New password " msgid "New password "
msgstr "" msgstr ""
#: src/model/Database.cpp:84 #: src/model/Database.cpp:91
msgid "" msgid ""
"No database found, would you like to create a new one ?\n" "No database found, would you like to create a new one ?\n"
"\n" "\n"
@ -417,7 +422,7 @@ msgstr ""
msgid "Operation order" msgid "Operation order"
msgstr "" msgstr ""
#: src/view/SearchPanel.cpp:98 src/view/AccountPanel.cpp:175 #: src/view/SearchPanel.cpp:98 src/view/AccountPanel.cpp:179
msgid "Operations" msgid "Operations"
msgstr "" msgstr ""
@ -457,7 +462,11 @@ msgstr ""
msgid "Quit KissCount ?" msgid "Quit KissCount ?"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:217 #: src/view/AccountPanel.cpp:124
msgid "Real"
msgstr ""
#: src/view/AccountPanel.cpp:221
msgid "Remains" msgid "Remains"
msgstr "" msgstr ""
@ -466,11 +475,11 @@ msgid "Rename"
msgstr "" msgstr ""
#: src/view/SearchPanel.cpp:92 src/view/SearchPanel.cpp:164 #: src/view/SearchPanel.cpp:92 src/view/SearchPanel.cpp:164
#: src/view/SearchPanel.cpp:410 #: src/view/SearchPanel.cpp:409
msgid "Search" msgid "Search"
msgstr "" msgstr ""
#: src/view/StatsPanel.cpp:120 src/view/AccountPanel.cpp:90 #: src/view/StatsPanel.cpp:120 src/view/AccountPanel.cpp:92
msgid "Serie 1" msgid "Serie 1"
msgstr "" msgstr ""
@ -490,20 +499,24 @@ msgstr ""
msgid "To " msgid "To "
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:199 #: src/view/AccountPanel.cpp:203
msgid "Total Credit" msgid "Total Credit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:200 #: src/view/AccountPanel.cpp:204
msgid "Total Debit" msgid "Total Debit"
msgstr "" msgstr ""
#: src/view/AccountPanel.cpp:127 #: src/view/AccountPanel.cpp:131
msgid "UnGroup" msgid "UnGroup"
msgstr "" msgstr ""
#: src/model/Database.cpp:42 src/model/Database.cpp:49 #: src/model/Database.cpp:109 src/model/Database.cpp:115
#: src/model/Database.cpp:67 src/model/Database.cpp:104 msgid "Unable to Create "
msgstr ""
#: src/model/Database.cpp:45 src/model/Database.cpp:52
#: src/model/Database.cpp:70 src/model/Database.cpp:123
msgid "Unable to open Database" msgid "Unable to open Database"
msgstr "" msgstr ""
@ -529,7 +542,7 @@ msgstr ""
msgid "Users" msgid "Users"
msgstr "" msgstr ""
#: src/view/PreferencesPanel.cpp:199 #: src/view/PreferencesPanel.cpp:199 src/view/AccountPanel.cpp:124
msgid "Virtual" msgid "Virtual"
msgstr "" msgstr ""

View File

@ -33,6 +33,9 @@ Database::Database(const char* filename, KissCount* kiss) : _kiss(kiss)
{ {
std::ifstream bdd_file; std::ifstream bdd_file;
std::string sPath = std::string(wxGetHomeDir().mb_str()) + std::string(BDD_FILE);
wxString wPath = wxGetHomeDir() + wxT(BDD_FILE);
if (filename) if (filename)
{ {
bdd_file.open(filename, std::ifstream::in); bdd_file.open(filename, std::ifstream::in);
@ -53,7 +56,7 @@ Database::Database(const char* filename, KissCount* kiss) : _kiss(kiss)
else else
{ {
// If default BDD file, assume this can be the first load // If default BDD file, assume this can be the first load
bdd_file.open(BDD_FILE, std::ifstream::in); bdd_file.open(sPath.c_str(), std::ifstream::in);
if (!bdd_file.good()) if (!bdd_file.good())
{ {
@ -61,11 +64,11 @@ Database::Database(const char* filename, KissCount* kiss) : _kiss(kiss)
} }
else else
{ {
_db.Open(wxT(BDD_FILE)); _db.Open(wPath);
if (!_db.IsOpen()) if (!_db.IsOpen())
{ {
wxMessageBox(_("Unable to open Database"), _("Error"), wxICON_ERROR | wxOK ); wxMessageBox(_("Unable to open Database"), _("Error"), wxICON_ERROR | wxOK );
throw std::string("Unable to open ") + BDD_FILE; throw std::string("Unable to open ") + sPath;
} }
} }
} }
@ -80,7 +83,11 @@ void Database::CreateDatabase()
std::ifstream init_script; std::ifstream init_script;
std::string line; std::string line;
wxString wxline; wxString wxline;
std::string sPath = std::string(wxGetHomeDir().mb_str()) + std::string(BDD_FILE);
wxString wPath = wxGetHomeDir() + wxT(BDD_FILE);
wxFileName dirname( wxGetHomeDir() +wxT("/.kisscount/"), wxPATH_UNIX);
wxFileName filename (wPath);
wxFile file;
wxString message = _("No database found, would you like to create a new one ?\n\n"); wxString message = _("No database found, would you like to create a new one ?\n\n");
message += _("!! Warning !! If there was a bug, the old database will be suppressed !"); message += _("!! Warning !! If there was a bug, the old database will be suppressed !");
@ -97,12 +104,24 @@ void Database::CreateDatabase()
throw "init.sql not found, aborting"; throw "init.sql not found, aborting";
} }
_db.Open(wxT(BDD_FILE)); if (!dirname.DirExists() && !dirname.Mkdir())
{
wxMessageBox(_("Unable to Create ") + wxGetHomeDir() +wxT("/.kisscount/"), _("Error"), wxICON_ERROR | wxOK );
throw std::string("Unable to create ") + std::string(wxGetHomeDir().mb_str()) + std::string("/.kisscount/");
}
if (!filename.FileExists() && !file.Create(wPath, false, wxS_IRUSR|wxS_IWUSR|wxS_IXUSR))
{
wxMessageBox(_("Unable to Create ") + wPath, _("Error"), wxICON_ERROR | wxOK );
throw std::string("Unable to create ") + sPath;
}
_db.Open(wPath);
if (!_db.IsOpen()) if (!_db.IsOpen())
{ {
wxMessageBox(_("Unable to open Database"), _("Error"), wxICON_ERROR | wxOK ); wxMessageBox(_("Unable to open Database"), _("Error"), wxICON_ERROR | wxOK );
throw std::string("Unable to open ") + BDD_FILE; throw std::string("Unable to open ") + sPath;
} }
do do
@ -123,7 +142,7 @@ void Database::CreateDatabase()
catch (...) catch (...)
{ {
wxMessageBox(_("Error creating original database"), _("Error"), wxICON_ERROR | wxOK ); wxMessageBox(_("Error creating original database"), _("Error"), wxICON_ERROR | wxOK );
remove(BDD_FILE); remove(sPath.c_str());
throw line; throw line;
} }
} while (init_script); } while (init_script);
@ -210,7 +229,7 @@ User* Database::LoadUser(const wxString& name)
set.Finalize(); set.Finalize();
req = wxT("SELECT * FROM account WHERE user='") + user->_id + wxT("' ORDER BY default_account DESC, name ASC"); req = wxT("SELECT * FROM account WHERE user='") + user->_id + wxT("' ORDER BY default_account DESC, blocked, virtual, name ASC");
EXECUTE_SQL_QUERY_WITH_CODE(req, set, NULL, {delete user;}, {delete user;}); EXECUTE_SQL_QUERY_WITH_CODE(req, set, NULL, {delete user;}, {delete user;});
@ -228,7 +247,7 @@ User* Database::LoadUser(const wxString& name)
} }
set.Finalize(); set.Finalize();
req = wxT("SELECT * FROM account WHERE id IN (SELECT account FROM shared_account WHERE user='") + user->_id + wxT("') ORDER BY name ASC"); req = wxT("SELECT * FROM account WHERE id IN (SELECT account FROM shared_account WHERE user='") + user->_id + wxT("') ORDER BY blocked, virtual, name ASC");
EXECUTE_SQL_QUERY_WITH_CODE(req, set, NULL, {delete user;}, {delete user;}); EXECUTE_SQL_QUERY_WITH_CODE(req, set, NULL, {delete user;}, {delete user;});

View File

@ -25,6 +25,9 @@
#include <list> #include <list>
#include <wx/wxsqlite3.h> #include <wx/wxsqlite3.h>
#include <wx/wx.h> #include <wx/wx.h>
#include <wx/utils.h>
#include <wx/filename.h>
#include <wx/file.h>
#include <sha1.h> #include <sha1.h>
#include "model.h" #include "model.h"
@ -32,7 +35,7 @@
#define DATABASE_VERSION 2 #define DATABASE_VERSION 2
#define BDD_FILE "kc.bdd" #define BDD_FILE "/.kisscount/kc.bdd"
#define INIT_SCRIPT "init.sql" #define INIT_SCRIPT "init.sql"
#define FIX_OP (1 << 0) #define FIX_OP (1 << 0)

View File

@ -79,7 +79,7 @@ SearchPanel::SearchPanel(KissCount* kiss, wxUI *parent) : KissPanel(kiss, parent
_category = new wxCheckListBox(this, wxID_ANY); _category = new wxCheckListBox(this, wxID_ANY);
_category->Append(_("Unknown")); _category->Append(_("Unknown"));
for(categoryIt = user->_categories.begin(); categoryIt != user->_categories.end(); categoryIt++) for(categoryIt = user->_categories.begin(); categoryIt != user->_categories.end(); categoryIt++)
_category->Append(categoryIt->name); _category->Append(wxGetTranslation(categoryIt->name));
wxString stypes[] = {_("Fix"), _("Non fix"), _("Checked"), _("Not checked")}; wxString stypes[] = {_("Fix"), _("Non fix"), _("Checked"), _("Not checked")};
_optype = new wxCheckListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 4, stypes); _optype = new wxCheckListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 4, stypes);
@ -381,7 +381,6 @@ static void ChangeName(Operation* op, void** params)
void SearchPanel::OnButtonRename(wxCommandEvent& event) void SearchPanel::OnButtonRename(wxCommandEvent& event)
{ {
std::vector<int> rows; std::vector<int> rows;
User* user = _kiss->GetUser();
std::vector<Operation>::iterator it; std::vector<Operation>::iterator it;
wxString category; wxString category;
wxString description; wxString description;

View File

@ -84,7 +84,7 @@ StatsPanel::StatsPanel(KissCount* kiss, wxUI *parent) : KissPanel(kiss, parent),
categoryIt++, i++) categoryIt++, i++)
{ {
_categoriesIndexes[categoryIt->id] = i; _categoriesIndexes[categoryIt->id] = i;
_categories[i] = categoryIt->name ; _categories[i] = wxGetTranslation(categoryIt->name) ;
} }
DEFAULT_FONT(font); DEFAULT_FONT(font);