From 2c7a1ca252dff0dd9889e5a105458e3386d03950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Thu, 9 Sep 2010 20:54:00 +0200 Subject: [PATCH] * Add category font/color (web is missing) * Fix a bug in category modification (PreferencesPanel), inModification = false ; missing --- init.sql | 28 +-------- ressources/po/french.mo | Bin 6544 -> 6625 bytes ressources/po/french.po | 108 ++++++++++++++++++---------------- ressources/po/kisscount.pot | 84 +++++++++++++------------- src/controller/KissCount.cpp | 12 ++-- src/model/Category.h | 3 +- src/model/Database.cpp | 41 ++++++++----- src/model/User.cpp | 3 +- src/view/AccountPanel.cpp | 2 +- src/view/PreferencesPanel.cpp | 76 +++++++++++++++--------- src/view/SearchPanel.cpp | 2 +- src/view/grid/GridAccount.cpp | 13 ++-- 12 files changed, 198 insertions(+), 174 deletions(-) diff --git a/init.sql b/init.sql index 0eef6cb..d921189 100644 --- a/init.sql +++ b/init.sql @@ -3,30 +3,6 @@ CREATE TABLE user (id INTEGER PRIMARY KEY, name VARCHAR(255), password VARCHAR(2 CREATE TABLE account(id INTEGER PRIMARY KEY, user REFERENCES user(id), name VARCHAR(255), number VARCHAR(255), shared CHAR(1), default_account CHAR(1)); 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)); -CREATE TABLE category(id INTEGER PRIMARY KEY, user REFERENCES user(id), parent REFERENCES category(id), name VARCHAR(255), color VARCHAR(255), font VARCHAR(255)); +CREATE TABLE category(id INTEGER PRIMARY KEY, user REFERENCES user(id), parent REFERENCES category(id), name VARCHAR(255), backcolor VARCHAR(10), forecolor VARCHAR(10), font VARCHAR(255)); CREATE TABLE preference(id INTEGER PRIMARY KEY, user REFERENCES user(id), name VARCHAR(255), value VARCHAR(255)); -INSERT INTO kisscount ("db_version") VALUES ("1"); - --- CREATE TABLE default_preference(id INTEGER PRIMARY KEY, type VARCHAR(255), name VARCHAR(255), value VARCHAR(255)); --- -- No password --- INSERT INTO user ("id", "name", "password") VALUES ("0", "Greg", "da39a3ee5e6b4b0d3255bfef95601890afd80709"); --- INSERT INTO account ("id", "user", "name", "number", "shared", "default_account") VALUES ("0", "0", "Compte Courant", "000" , "0", "1"); --- -- May 2009 --- INSERT INTO account_amount("id", "account", "year", "month", "amount") VALUES("1", "0", "2009", "4", "500"); --- INSERT INTO operation ("id", "user", "account", "year", "month", "day", "amount", "description", "category", "fix_cost", "checked") VALUES ("1", "0", "0", "2009", "4", "0", "1234", "Opé May 1", "1", "1", "0"); --- -- May 2010 --- INSERT INTO account_amount("id", "account", "year", "month", "amount") VALUES("2", "0", "2010", "4", "500"); --- INSERT INTO operation ("id", "user", "account", "year", "month", "day", "amount", "description", "category", "fix_cost", "checked") VALUES ("2", "0", "0", "2010", "4", "0", "1234", "Opé May 1", "1", "1", "0"); --- INSERT INTO operation ("id", "user", "account", "year", "month", "day", "amount", "description", "category", "fix_cost", "checked") VALUES ("3", "0", "0", "2010", "4", "1", "-56", "Opé May 2", "2", "0", "0"); --- -- June 2010 --- INSERT INTO account_amount("id", "account", "year", "month", "amount") VALUES("3", "0", "2010", "5", "1000"); --- INSERT INTO operation ("id", "user", "account", "year", "month", "day", "amount", "description", "category", "fix_cost", "checked") VALUES ("4", "0", "0", "2010", "5", "0", "1234", "Opé 1", "1", "1", "0"); --- INSERT INTO operation ("id", "user", "account", "year", "month", "day", "amount", "description", "category", "fix_cost", "checked") VALUES ("5", "0", "0", "2010", "5", "1", "-56", "Opé 2", "2", "0", "0"); --- INSERT INTO operation ("id", "user", "account", "year", "month", "day", "amount", "description", "category", "fix_cost", "checked") VALUES ("6", "0", "0", "2010", "5", "8", "12", "Opé 3", "3", "0", "1"); --- INSERT INTO operation ("id", "user", "account", "year", "month", "day", "amount", "description", "category", "fix_cost", "checked") VALUES ("7", "0", "0", "2010", "5", "29", "-2056", "Opé 4", "4", "0", "0"); --- INSERT INTO category ("user", "parent", "name", "color", "font") VALUES ("0", "0", "Fixe", "#FFFF99", ""); --- INSERT INTO category ("user", "parent", "name", "color", "font") VALUES ("0", "0", "Courses", "#3DEB3D", ""); --- INSERT INTO category ("user", "parent", "name", "color", "font") VALUES ("0", "0", "Loisirs", "#3DEB3D", ""); --- INSERT INTO category ("user", "parent", "name", "color", "font") VALUES ("0", "0", "Frais de fonctionnement", "#3DEB3D", ""); --- INSERT INTO category ("user", "parent", "name", "color", "font") VALUES ("0", "0", "Exceptionnel", "#3DEB3D", ""); --- INSERT INTO category ("user", "parent", "name", "color", "font") VALUES ("0", "0", "Autre", "#3DEB3D", ""); +INSERT INTO kisscount ("db_version") VALUES ("1"); \ No newline at end of file diff --git a/ressources/po/french.mo b/ressources/po/french.mo index 5fbb212cae533a544cb8fc338f247f081d34c1cc..4a87544c263ee919a4b887fe67500bf2d1e0fd94 100644 GIT binary patch delta 2691 zcmYk+e@s6BI$K4O%v1a^PEC)51h8kD~remSIz6ldK--gq%8)?G!pgMRC_591o zpB>?#3G_QphOYa~KBJ-sFW^iZMKwH*YB+*n>i1YwgQ=()doTiTbJufGGb}*OxWt{8 zq1vfHwX+dv+8QvD{;h+G2Y0$34xyI(D5`@#)PM%u`6*NfgQ%7J6g9A~Q3Ln^HNeZ5 zjDMqERU8*J!3<2oT=esst)ikEDloL9s0X_-1NWkq{!LT|!>A5NP)j|Edj2xzP|4Ef0_QTJ_)=lxT+!yL3k$1ohf>7)KZl=*PbdQx`+HC;^Ay&EnZ1Cz?+P1$s{Mv~#eS`?-dzf^ik6LfFb^xS82Ph<9MnNSYM?>X zOi!X-)evfPeTf>tCDh9N>ih>YIgg~*ES!(@yVpn;u2wf9vT>#vT#=YnSN6RP1q zunc2nO}xu0)RKBp-}P?P3=W|>c-5W1je3P2IES3)Q0KLUptp({UwgMo=SH(F)y9RuO&6+B+@e!N5RNy1$*8iq=U}%Oe^xGYjqem3S9Xp;5b+ zWE1U-$&yLsX0nb{OkSMgdg|Kh8gUU>L8=HN)`m8Fh%6x5MQuc7{sf`pYL2{Pdz3st z?j&&EM-b(Hxl|);`M|P6i z$z;(tu$knOCQ?Tzjn>Ig8~l1wNc8U@gDfGnL|>Uo7Fiyunca=M$W3G^*-9QJlSN*dIwKjD5JoQ<%K40@-pRd8w-dfuhSd`ow{5&}#EM>|KJ8IiHL%#-xQ%*{+`cyZs+{Y<$1p@f2=%p zAvu~@!Vl{4#*I&a7&b!bi z&)^k!4zof?h0mzi;J5L{Z#aF~ie14ByA0_yyX*k7x(Kq8<03BhDcG1m>XE^U)EGMcbPc&&$wu zD$sW3B29$Fm_h$xIh7(@9dGPIr~Clg!NKU`Xv0U)8G9P-_!YF{6KGnRp&eco5myK{ona zA#y8BK%bkA{KAgG%)e8U;;b*Wp${HFGd+T?-Am}yy@}4i88nfP(8NE*`S?AK#EHD* z6j!0|*KshhHR$sj&;jik!u*>+YrOCvdVUb?@DQ5VGw6~$hmPz8w1ZB}!!Gps&(Vgz zK|A^h?YIX`+>6>jnw6qrhuP><6-39P4V9t|lt(Mj24(RAeg*LbeeXbd2;eF_g zoIscCy?FlvbPs)kzJDGa*hNhG{r_SG|3owU5BY^546_Kwq2~+Hf5HZ|p}q0^0pu5+ zjprxPDeuNH_!ruK{)paz6rqVv!W6R;rc$ZFh3IBEgpTk@bc&xx6F7-C;aTJta+zn> zelj}3IcR(HkY8BFfxg2ww7vak$B&`|cp{Jax8b8)xEWtZ*D#UaJC$S5?|Cvhf@-vb z+IYSmUAnE&=IB1OgEr(N2<_-sa~NHsr{eu%`OJR_7f!?r7toG=#zOoZ%{+&!v=D8$ z6m75~ItSe&RcJyrXge#Sjp&}(7;QpldS@jSUuZ#JXhj=pLo>HHLv_SL!f)8kvxQjE z{#LRuwVj%U7t&*!fu_n-ruX}`xQehan)Cur#L-@e#oclh;U>5>Ub~!HPG%COJeTml zb}2!|Zeadyh{?nfVjE$Z)Jyt!BS&}4W?~sJop3AfAZ{m|Ys+GyFJYA`;_g{b6cLMv@q}d_aTl?R*g#An>IpwsOB2yTtZ6SEkdyLj*+kq!Se6s3 ziLHdIbg5KP8AbSUSV$sWrg1DKZXs?X+$uYXJ;ZgyrQ%0$Cs9G%O{^mpSlvy<4eq9& zP55_EOiU##er1*t;`(%ruMYPTV~KKNEzv++Dt>{NmpeKOGHd&^-#c(izozZG+Aj|L sxU(xOFOjS$np!q%+KkSxhNk+qH|HG6XldHeva2&=c(PAtaqj8F|INS73jhEB diff --git a/ressources/po/french.po b/ressources/po/french.po index bf75f79..90dbd6a 100644 --- a/ressources/po/french.po +++ b/ressources/po/french.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-09-08 10:57+0200\n" +"POT-Creation-Date: 2010-09-09 20:48+0200\n" "PO-Revision-Date: \n" "Last-Translator: Soutadé \n" "Language-Team: \n" @@ -19,16 +19,16 @@ msgstr "" # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#: src/view/PreferencesPanel.cpp:638 +#: src/view/PreferencesPanel.cpp:660 #: src/view/StatsPanel.cpp:282 msgid " - " msgstr " - " -#: src/view/PreferencesPanel.cpp:383 -#: src/view/PreferencesPanel.cpp:402 -#: src/view/PreferencesPanel.cpp:532 -#: src/view/PreferencesPanel.cpp:551 -#: src/view/PreferencesPanel.cpp:596 +#: src/view/PreferencesPanel.cpp:384 +#: src/view/PreferencesPanel.cpp:403 +#: src/view/PreferencesPanel.cpp:553 +#: src/view/PreferencesPanel.cpp:572 +#: src/view/PreferencesPanel.cpp:618 #: src/view/UsersDialog.cpp:116 msgid " already exists" msgstr " existe déjà " @@ -45,7 +45,7 @@ msgstr " non trouvé, arrêt" msgid " operations ?" msgstr " opérations ?" -#: src/view/PreferencesPanel.cpp:645 +#: src/view/PreferencesPanel.cpp:667 msgid " profil ?" msgstr " profil ?" @@ -61,13 +61,13 @@ msgstr "1 entrée trouvée" msgid "About" msgstr "A propos" -#: src/view/grid/GridAccount.cpp:60 +#: src/view/grid/GridAccount.cpp:61 #: src/view/SearchPanel.cpp:89 msgid "Account" msgstr "Compte" -#: src/view/PreferencesPanel.cpp:383 -#: src/view/PreferencesPanel.cpp:402 +#: src/view/PreferencesPanel.cpp:384 +#: src/view/PreferencesPanel.cpp:403 msgid "Account " msgstr "Le compte " @@ -92,22 +92,26 @@ msgstr "Montant min" msgid "Amount to" msgstr "Montant max" -#: src/view/PreferencesPanel.cpp:364 -#: src/view/PreferencesPanel.cpp:645 +#: src/view/PreferencesPanel.cpp:365 +#: src/view/PreferencesPanel.cpp:667 #: src/view/AccountPanel.cpp:991 msgid "Are you sure want to delete " msgstr "Etes vous sûr de vouloir supprimer " -#: src/view/PreferencesPanel.cpp:513 +#: src/view/PreferencesPanel.cpp:534 #: src/view/AccountPanel.cpp:675 #: src/view/SearchPanel.cpp:350 msgid "Are you sure want to delete : \n" msgstr "Etes vous sûr de vouloir supprimer : \n" -#: src/view/PreferencesPanel.cpp:279 +#: src/view/PreferencesPanel.cpp:280 msgid "Ascending" msgstr "Croissant" +#: src/view/PreferencesPanel.cpp:221 +msgid "Background color" +msgstr "Couleur d'arrière plan" + #: src/view/PasswordDialog.cpp:56 #: src/view/GenerateDialog.cpp:60 #: src/view/UsersDialog.cpp:51 @@ -118,13 +122,13 @@ msgstr "Annuler" msgid "Categories" msgstr "Catégories" -#: src/view/grid/GridAccount.cpp:60 +#: src/view/grid/GridAccount.cpp:61 #: src/view/SearchPanel.cpp:88 msgid "Category" msgstr "Catégorie" -#: src/view/PreferencesPanel.cpp:532 -#: src/view/PreferencesPanel.cpp:551 +#: src/view/PreferencesPanel.cpp:553 +#: src/view/PreferencesPanel.cpp:572 msgid "Category " msgstr "Catégorie" @@ -148,10 +152,6 @@ msgstr "Changer d'utilisateur" msgid "Check mode" msgstr "Mode rapprochement" -#: src/view/PreferencesPanel.cpp:220 -msgid "Color" -msgstr "Couleur" - #: src/view/PasswordDialog.cpp:46 msgid "Confirm password " msgstr "Confirmer le mot de passe" @@ -161,7 +161,7 @@ msgstr "Confirmer le mot de passe" msgid "Cost repartition" msgstr "Répartition des coûts" -#: src/view/grid/GridAccount.cpp:60 +#: src/view/grid/GridAccount.cpp:61 msgid "Credit" msgstr "Crédit" @@ -177,7 +177,7 @@ msgstr "Cur Débit" msgid "Current value" msgstr "Valeur courante" -#: src/view/grid/GridAccount.cpp:60 +#: src/view/grid/GridAccount.cpp:61 msgid "Date" msgstr "Date" @@ -189,7 +189,7 @@ msgstr "Date min" msgid "Date to" msgstr "Date max" -#: src/view/grid/GridAccount.cpp:60 +#: src/view/grid/GridAccount.cpp:61 msgid "Debit" msgstr "Débit" @@ -198,16 +198,16 @@ msgid "Default" msgstr "Défaut" #: src/view/PreferencesPanel.cpp:167 -#: src/view/PreferencesPanel.cpp:222 +#: src/view/PreferencesPanel.cpp:224 #: src/view/AccountPanel.cpp:850 msgid "Delete" msgstr "Supprimer" -#: src/view/PreferencesPanel.cpp:280 +#: src/view/PreferencesPanel.cpp:281 msgid "Descending" msgstr "Décroissant" -#: src/view/grid/GridAccount.cpp:60 +#: src/view/grid/GridAccount.cpp:61 #: src/view/SearchPanel.cpp:85 msgid "Description" msgstr "Description" @@ -222,13 +222,13 @@ msgstr "Description" #: src/model/Database.cpp:176 #: src/view/PasswordDialog.cpp:72 #: src/view/PasswordDialog.cpp:78 -#: src/view/PreferencesPanel.cpp:360 -#: src/view/PreferencesPanel.cpp:383 -#: src/view/PreferencesPanel.cpp:402 -#: src/view/PreferencesPanel.cpp:532 -#: src/view/PreferencesPanel.cpp:551 -#: src/view/PreferencesPanel.cpp:590 -#: src/view/PreferencesPanel.cpp:596 +#: src/view/PreferencesPanel.cpp:361 +#: src/view/PreferencesPanel.cpp:384 +#: src/view/PreferencesPanel.cpp:403 +#: src/view/PreferencesPanel.cpp:553 +#: src/view/PreferencesPanel.cpp:572 +#: src/view/PreferencesPanel.cpp:612 +#: src/view/PreferencesPanel.cpp:618 #: src/view/AccountPanel.cpp:987 #: src/view/UsersDialog.cpp:88 #: src/view/UsersDialog.cpp:116 @@ -247,16 +247,20 @@ msgstr "Erreur durant la création de la base de données initiale" msgid "Final value" msgstr "Valeur finale" -#: src/model/Database.cpp:311 +#: src/model/Database.cpp:312 #: src/controller/KissCount.cpp:278 -#: src/view/grid/GridAccount.cpp:143 +#: src/view/grid/GridAccount.cpp:144 msgid "Fix" msgstr "Fixe" -#: src/view/PreferencesPanel.cpp:221 +#: src/view/PreferencesPanel.cpp:223 msgid "Font" msgstr "Police" +#: src/view/PreferencesPanel.cpp:222 +msgid "Foreground color" +msgstr "Couleur d'avant plan" + #: src/view/StatsPanel.cpp:62 msgid "From" msgstr "De" @@ -298,7 +302,7 @@ msgstr "Montant max invalide" msgid "Invalid date range" msgstr "Intervalle de temps invalide" -#: src/view/PreferencesPanel.cpp:590 +#: src/view/PreferencesPanel.cpp:612 msgid "Invalid name" msgstr "Nom invalide" @@ -314,7 +318,7 @@ msgstr "Mot de passe invalide" msgid "Invalide date range" msgstr "Intervalle de temps invalide" -#: src/view/PreferencesPanel.cpp:360 +#: src/view/PreferencesPanel.cpp:361 msgid "It must be at least one account !" msgstr "Il doit y avoir au moins un compte !" @@ -326,8 +330,8 @@ msgstr "Il doit rester au mois un mois" msgid "Kill me" msgstr "Kill me" -#: src/view/PreferencesPanel.cpp:630 -#: src/view/PreferencesPanel.cpp:633 +#: src/view/PreferencesPanel.cpp:652 +#: src/view/PreferencesPanel.cpp:655 #: src/view/StatsPanel.cpp:297 msgid "KissCount" msgstr "KissCount" @@ -336,21 +340,21 @@ msgstr "KissCount" msgid "Language" msgstr "Langue" -#: src/view/PreferencesPanel.cpp:633 +#: src/view/PreferencesPanel.cpp:655 msgid "Language not changed" msgstr "Langue non changée" -#: src/view/PreferencesPanel.cpp:630 +#: src/view/PreferencesPanel.cpp:652 msgid "Language successfully changed, please go to another panel" msgstr "Langue changée, allez sur un autre panneau pour rendre le changement effectif" #: src/view/PreferencesPanel.cpp:66 #: src/view/PreferencesPanel.cpp:163 -#: src/view/PreferencesPanel.cpp:219 +#: src/view/PreferencesPanel.cpp:220 msgid "Name" msgstr "Nom" -#: src/view/PreferencesPanel.cpp:602 +#: src/view/PreferencesPanel.cpp:624 msgid "Name changed" msgstr "Nom changé" @@ -427,8 +431,8 @@ msgstr "" msgid "Please retype new password" msgstr "Re entrez le mot de passe" -#: src/view/PreferencesPanel.cpp:604 -#: src/view/PreferencesPanel.cpp:638 +#: src/view/PreferencesPanel.cpp:626 +#: src/view/PreferencesPanel.cpp:660 #: src/view/ButtonPanel.cpp:72 msgid "Preferences" msgstr "Préférences" @@ -497,8 +501,8 @@ msgid "Unexpected" msgstr "Exceptionnel" #: src/model/User.cpp:46 -#: src/model/User.cpp:60 -#: src/model/User.cpp:91 +#: src/model/User.cpp:61 +#: src/model/User.cpp:92 msgid "Unknown" msgstr "Inconnu" @@ -510,7 +514,7 @@ msgstr "La mise à jour à échouée !\n" msgid "User" msgstr "Utilisateur" -#: src/view/PreferencesPanel.cpp:596 +#: src/view/PreferencesPanel.cpp:618 #: src/view/UsersDialog.cpp:38 #: src/view/UsersDialog.cpp:116 msgid "User " @@ -568,6 +572,8 @@ msgstr "octobre" msgid "september" msgstr "septembre" +#~ msgid "Color" +#~ msgstr "Couleur" #~ msgid "Fixe" #~ msgstr "Fixe" diff --git a/ressources/po/kisscount.pot b/ressources/po/kisscount.pot index 1f86cdb..eafc644 100644 --- a/ressources/po/kisscount.pot +++ b/ressources/po/kisscount.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-09-08 10:57+0200\n" +"POT-Creation-Date: 2010-09-09 20:48+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,13 +17,13 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/view/PreferencesPanel.cpp:638 src/view/StatsPanel.cpp:282 +#: src/view/PreferencesPanel.cpp:660 src/view/StatsPanel.cpp:282 msgid " - " msgstr "" -#: src/view/PreferencesPanel.cpp:383 src/view/PreferencesPanel.cpp:402 -#: src/view/PreferencesPanel.cpp:532 src/view/PreferencesPanel.cpp:551 -#: src/view/PreferencesPanel.cpp:596 src/view/UsersDialog.cpp:116 +#: src/view/PreferencesPanel.cpp:384 src/view/PreferencesPanel.cpp:403 +#: src/view/PreferencesPanel.cpp:553 src/view/PreferencesPanel.cpp:572 +#: src/view/PreferencesPanel.cpp:618 src/view/UsersDialog.cpp:116 msgid " already exists" msgstr "" @@ -39,7 +39,7 @@ msgstr "" msgid " operations ?" msgstr "" -#: src/view/PreferencesPanel.cpp:645 +#: src/view/PreferencesPanel.cpp:667 msgid " profil ?" msgstr "" @@ -55,11 +55,11 @@ msgstr "" msgid "About" msgstr "" -#: src/view/grid/GridAccount.cpp:60 src/view/SearchPanel.cpp:89 +#: src/view/grid/GridAccount.cpp:61 src/view/SearchPanel.cpp:89 msgid "Account" msgstr "" -#: src/view/PreferencesPanel.cpp:383 src/view/PreferencesPanel.cpp:402 +#: src/view/PreferencesPanel.cpp:384 src/view/PreferencesPanel.cpp:403 msgid "Account " msgstr "" @@ -83,20 +83,24 @@ msgstr "" msgid "Amount to" msgstr "" -#: src/view/PreferencesPanel.cpp:364 src/view/PreferencesPanel.cpp:645 +#: src/view/PreferencesPanel.cpp:365 src/view/PreferencesPanel.cpp:667 #: src/view/AccountPanel.cpp:991 msgid "Are you sure want to delete " msgstr "" -#: src/view/PreferencesPanel.cpp:513 src/view/AccountPanel.cpp:675 +#: src/view/PreferencesPanel.cpp:534 src/view/AccountPanel.cpp:675 #: src/view/SearchPanel.cpp:350 msgid "Are you sure want to delete : \n" msgstr "" -#: src/view/PreferencesPanel.cpp:279 +#: src/view/PreferencesPanel.cpp:280 msgid "Ascending" msgstr "" +#: src/view/PreferencesPanel.cpp:221 +msgid "Background color" +msgstr "" + #: src/view/PasswordDialog.cpp:56 src/view/GenerateDialog.cpp:60 #: src/view/UsersDialog.cpp:51 msgid "Cancel" @@ -106,11 +110,11 @@ msgstr "" msgid "Categories" msgstr "" -#: src/view/grid/GridAccount.cpp:60 src/view/SearchPanel.cpp:88 +#: src/view/grid/GridAccount.cpp:61 src/view/SearchPanel.cpp:88 msgid "Category" msgstr "" -#: src/view/PreferencesPanel.cpp:532 src/view/PreferencesPanel.cpp:551 +#: src/view/PreferencesPanel.cpp:553 src/view/PreferencesPanel.cpp:572 msgid "Category " msgstr "" @@ -134,10 +138,6 @@ msgstr "" msgid "Check mode" msgstr "" -#: src/view/PreferencesPanel.cpp:220 -msgid "Color" -msgstr "" - #: src/view/PasswordDialog.cpp:46 msgid "Confirm password " msgstr "" @@ -146,7 +146,7 @@ msgstr "" msgid "Cost repartition" msgstr "" -#: src/view/grid/GridAccount.cpp:60 +#: src/view/grid/GridAccount.cpp:61 msgid "Credit" msgstr "" @@ -162,7 +162,7 @@ msgstr "" msgid "Current value" msgstr "" -#: src/view/grid/GridAccount.cpp:60 +#: src/view/grid/GridAccount.cpp:61 msgid "Date" msgstr "" @@ -174,7 +174,7 @@ msgstr "" msgid "Date to" msgstr "" -#: src/view/grid/GridAccount.cpp:60 +#: src/view/grid/GridAccount.cpp:61 msgid "Debit" msgstr "" @@ -182,16 +182,16 @@ msgstr "" msgid "Default" msgstr "" -#: src/view/PreferencesPanel.cpp:167 src/view/PreferencesPanel.cpp:222 +#: src/view/PreferencesPanel.cpp:167 src/view/PreferencesPanel.cpp:224 #: src/view/AccountPanel.cpp:850 msgid "Delete" msgstr "" -#: src/view/PreferencesPanel.cpp:280 +#: src/view/PreferencesPanel.cpp:281 msgid "Descending" msgstr "" -#: src/view/grid/GridAccount.cpp:60 src/view/SearchPanel.cpp:85 +#: src/view/grid/GridAccount.cpp:61 src/view/SearchPanel.cpp:85 msgid "Description" msgstr "" @@ -200,10 +200,10 @@ msgstr "" #: src/model/Database.cpp:120 src/model/Database.cpp:147 #: src/model/Database.cpp:155 src/model/Database.cpp:176 #: src/view/PasswordDialog.cpp:72 src/view/PasswordDialog.cpp:78 -#: src/view/PreferencesPanel.cpp:360 src/view/PreferencesPanel.cpp:383 -#: src/view/PreferencesPanel.cpp:402 src/view/PreferencesPanel.cpp:532 -#: src/view/PreferencesPanel.cpp:551 src/view/PreferencesPanel.cpp:590 -#: src/view/PreferencesPanel.cpp:596 src/view/AccountPanel.cpp:987 +#: src/view/PreferencesPanel.cpp:361 src/view/PreferencesPanel.cpp:384 +#: src/view/PreferencesPanel.cpp:403 src/view/PreferencesPanel.cpp:553 +#: src/view/PreferencesPanel.cpp:572 src/view/PreferencesPanel.cpp:612 +#: src/view/PreferencesPanel.cpp:618 src/view/AccountPanel.cpp:987 #: src/view/UsersDialog.cpp:88 src/view/UsersDialog.cpp:116 #: src/view/SearchPanel.cpp:139 src/view/SearchPanel.cpp:149 #: src/view/SearchPanel.cpp:163 src/view/SearchPanel.cpp:174 @@ -218,15 +218,19 @@ msgstr "" msgid "Final value" msgstr "" -#: src/model/Database.cpp:311 src/controller/KissCount.cpp:278 -#: src/view/grid/GridAccount.cpp:143 +#: src/model/Database.cpp:312 src/controller/KissCount.cpp:278 +#: src/view/grid/GridAccount.cpp:144 msgid "Fix" msgstr "" -#: src/view/PreferencesPanel.cpp:221 +#: src/view/PreferencesPanel.cpp:223 msgid "Font" msgstr "" +#: src/view/PreferencesPanel.cpp:222 +msgid "Foreground color" +msgstr "" + #: src/view/StatsPanel.cpp:62 msgid "From" msgstr "" @@ -267,7 +271,7 @@ msgstr "" msgid "Invalid date range" msgstr "" -#: src/view/PreferencesPanel.cpp:590 +#: src/view/PreferencesPanel.cpp:612 msgid "Invalid name" msgstr "" @@ -283,7 +287,7 @@ msgstr "" msgid "Invalide date range" msgstr "" -#: src/view/PreferencesPanel.cpp:360 +#: src/view/PreferencesPanel.cpp:361 msgid "It must be at least one account !" msgstr "" @@ -295,7 +299,7 @@ msgstr "" msgid "Kill me" msgstr "" -#: src/view/PreferencesPanel.cpp:630 src/view/PreferencesPanel.cpp:633 +#: src/view/PreferencesPanel.cpp:652 src/view/PreferencesPanel.cpp:655 #: src/view/StatsPanel.cpp:297 msgid "KissCount" msgstr "" @@ -304,20 +308,20 @@ msgstr "" msgid "Language" msgstr "" -#: src/view/PreferencesPanel.cpp:633 +#: src/view/PreferencesPanel.cpp:655 msgid "Language not changed" msgstr "" -#: src/view/PreferencesPanel.cpp:630 +#: src/view/PreferencesPanel.cpp:652 msgid "Language successfully changed, please go to another panel" msgstr "" #: src/view/PreferencesPanel.cpp:66 src/view/PreferencesPanel.cpp:163 -#: src/view/PreferencesPanel.cpp:219 +#: src/view/PreferencesPanel.cpp:220 msgid "Name" msgstr "" -#: src/view/PreferencesPanel.cpp:602 +#: src/view/PreferencesPanel.cpp:624 msgid "Name changed" msgstr "" @@ -387,7 +391,7 @@ msgstr "" msgid "Please retype new password" msgstr "" -#: src/view/PreferencesPanel.cpp:604 src/view/PreferencesPanel.cpp:638 +#: src/view/PreferencesPanel.cpp:626 src/view/PreferencesPanel.cpp:660 #: src/view/ButtonPanel.cpp:72 msgid "Preferences" msgstr "" @@ -450,7 +454,7 @@ msgstr "" msgid "Unexpected" msgstr "" -#: src/model/User.cpp:46 src/model/User.cpp:60 src/model/User.cpp:91 +#: src/model/User.cpp:46 src/model/User.cpp:61 src/model/User.cpp:92 msgid "Unknown" msgstr "" @@ -462,7 +466,7 @@ msgstr "" msgid "User" msgstr "" -#: src/view/PreferencesPanel.cpp:596 src/view/UsersDialog.cpp:38 +#: src/view/PreferencesPanel.cpp:618 src/view/UsersDialog.cpp:38 #: src/view/UsersDialog.cpp:116 msgid "User " msgstr "" diff --git a/src/controller/KissCount.cpp b/src/controller/KissCount.cpp index d586405..3217b54 100644 --- a/src/controller/KissCount.cpp +++ b/src/controller/KissCount.cpp @@ -275,17 +275,17 @@ void KissCount::NewUser(const wxString& name) AddAccount(ac); - cat.parent = wxT("0") ; cat.name = _("Fix") ; cat.color = OWN_YELLOW ; + cat.parent = wxT("0") ; cat.name = _("Fix") ; cat.backcolor = OWN_YELLOW ; cat.forecolor = *wxBLACK; AddCategory(cat); - cat.parent = wxT("0") ; cat.name = _("Groceries") ; cat.color = OWN_GREEN; + cat.parent = wxT("0") ; cat.name = _("Groceries") ; cat.backcolor = OWN_GREEN; cat.forecolor = *wxBLACK; AddCategory(cat); - cat.parent = wxT("0") ; cat.name = _("Hobbies") ; cat.color = OWN_GREEN; + cat.parent = wxT("0") ; cat.name = _("Hobbies") ; cat.backcolor = OWN_GREEN; cat.forecolor = *wxBLACK; AddCategory(cat); - cat.parent = wxT("0") ; cat.name = _("Operating exepense") ; cat.color = OWN_GREEN; + cat.parent = wxT("0") ; cat.name = _("Operating exepense") ; cat.backcolor = OWN_GREEN; cat.forecolor = *wxBLACK; AddCategory(cat); - cat.parent = wxT("0") ; cat.name = _("Unexpected") ; cat.color = OWN_GREEN; + cat.parent = wxT("0") ; cat.name = _("Unexpected") ; cat.backcolor = OWN_GREEN; cat.forecolor = *wxBLACK; AddCategory(cat); - cat.parent = wxT("0") ; cat.name = _("Other") ; cat.color = OWN_GREEN; + cat.parent = wxT("0") ; cat.name = _("Other") ; cat.backcolor = OWN_GREEN; cat.forecolor = *wxBLACK; AddCategory(cat); SetOperationOrder(wxT("ASC")); diff --git a/src/model/Category.h b/src/model/Category.h index a06cd5d..af2f29a 100644 --- a/src/model/Category.h +++ b/src/model/Category.h @@ -26,7 +26,8 @@ public: wxString id; wxString parent; wxString name; - wxColour color; + wxColour backcolor; + wxColour forecolor; wxString font; }; diff --git a/src/model/Database.cpp b/src/model/Database.cpp index 06d6315..0f763c2 100644 --- a/src/model/Database.cpp +++ b/src/model/Database.cpp @@ -306,7 +306,8 @@ User* Database::LoadUser(const wxString& name) category.id = set.GetAsString(wxT("id")); category.parent = set.GetAsString(wxT("parent")); category.name = set.GetAsString(wxT("name")); - category.color = wxColour(set.GetAsString(wxT("color"))); + category.backcolor = wxColour(set.GetAsString(wxT("backcolor"))); + category.forecolor = wxColour(set.GetAsString(wxT("forecolor"))); category.font = set.GetAsString(wxT("font")); if (category.name != _("Fix")) user->_categories.push_back(category); @@ -678,18 +679,24 @@ void Database::DeleteAccount(Account& ac) wxString Database::AddCategory(User* user, Category& category) { wxString req; - wxString color; + wxString backcolor, forecolor; - color = wxT("#") ; - color += wxString::Format(wxT("%02X"), category.color.Red()); - color += wxString::Format(wxT("%02X"), category.color.Green()); - color += wxString::Format(wxT("%02X"), category.color.Blue()); + backcolor = wxT("#") ; + backcolor += wxString::Format(wxT("%02X"), category.backcolor.Red()); + backcolor += wxString::Format(wxT("%02X"), category.backcolor.Green()); + backcolor += wxString::Format(wxT("%02X"), category.backcolor.Blue()); - req = wxT("INSERT INTO category ('user', 'parent', 'name', 'color', font) VALUES ('") ; + forecolor = wxT("#") ; + forecolor += wxString::Format(wxT("%02X"), category.forecolor.Red()); + forecolor += wxString::Format(wxT("%02X"), category.forecolor.Green()); + forecolor += wxString::Format(wxT("%02X"), category.forecolor.Blue()); + + req = wxT("INSERT INTO category ('user', 'parent', 'name', 'backcolor', 'forecolor', font) VALUES ('") ; req += user->_id + wxT("'"); req += wxT(", '") + category.parent + wxT("'"); req += wxT(", '") + category.name + wxT("'"); - req += wxT(", '") + color + wxT("'"); + req += wxT(", '") + backcolor + wxT("'"); + req += wxT(", '") + forecolor + wxT("'"); req += wxT(", '") + category.font + wxT("'"); req += wxT(")"); @@ -701,17 +708,23 @@ wxString Database::AddCategory(User* user, Category& category) void Database::UpdateCategory(Category& category) { wxString req; - wxString color; + wxString backcolor, forecolor; - color = wxT("#") ; - color += wxString::Format(wxT("%02X"), category.color.Red()); - color += wxString::Format(wxT("%02X"), category.color.Green()); - color += wxString::Format(wxT("%02X"), category.color.Blue()); + backcolor = wxT("#") ; + backcolor += wxString::Format(wxT("%02X"), category.backcolor.Red()); + backcolor += wxString::Format(wxT("%02X"), category.backcolor.Green()); + backcolor += wxString::Format(wxT("%02X"), category.backcolor.Blue()); + + forecolor = wxT("#") ; + forecolor += wxString::Format(wxT("%02X"), category.forecolor.Red()); + forecolor += wxString::Format(wxT("%02X"), category.forecolor.Green()); + forecolor += wxString::Format(wxT("%02X"), category.forecolor.Blue()); req = wxT("UPDATE category SET") ; req += wxT(" parent='") + category.parent + wxT("'"); req += wxT(", name='") + category.name + wxT("'"); - req += wxT(", color='") + color + wxT("'"); + req += wxT(", backcolor='") + backcolor + wxT("'"); + req += wxT(", forecolor='") + forecolor + wxT("'"); req += wxT(", font='") + category.font + wxT("'"); req += wxT(" WHERE id='") + category.id + wxT("'"); diff --git a/src/model/User.cpp b/src/model/User.cpp index 92ba34e..9467129 100644 --- a/src/model/User.cpp +++ b/src/model/User.cpp @@ -45,7 +45,8 @@ Category User::GetCategory(wxString& catId) cat.parent = wxT("0"); cat.name = _("Unknown"); cat.font = wxT(""); - cat.color = wxColour(0xFF, 0xFF, 0xFF); + cat.backcolor = wxColour(0xFF, 0xFF, 0xFF); + cat.forecolor = wxColour(0x00, 0x00, 0x00); return cat; } diff --git a/src/view/AccountPanel.cpp b/src/view/AccountPanel.cpp index ffaa3b8..eff6f38 100644 --- a/src/view/AccountPanel.cpp +++ b/src/view/AccountPanel.cpp @@ -657,7 +657,7 @@ void AccountPanel::OnOperationModified(wxGridEvent& event) if (col == CHECKED || col == CATEGORY) { - color = user->GetCategory(new_op.category).color; + color = user->GetCategory(new_op.category).backcolor; if (new_op.checked) { diff --git a/src/view/PreferencesPanel.cpp b/src/view/PreferencesPanel.cpp index 8c55dd2..7f3fe4d 100644 --- a/src/view/PreferencesPanel.cpp +++ b/src/view/PreferencesPanel.cpp @@ -20,7 +20,7 @@ #include "PreferencesPanel.h" enum {ACCOUNT_NAME, ACCOUNT_NUMBER, ACCOUNT_SHARED, ACCOUNT_DEFAULT, ACCOUNT_DELETE, NUMBER_COLS_ACCOUNT}; -enum {CATEGORY_NAME, CATEGORY_COLOR, CATEGORY_FONT, CATEGORY_DELETE, NUMBER_COLS_CATEGORY}; +enum {CATEGORY_NAME, CATEGORY_BACKGROUND_COLOR, CATEGORY_FOREGROUND_COLOR, CATEGORY_FONT, CATEGORY_DELETE, NUMBER_COLS_CATEGORY}; enum {CATEGORIES_GRID_ID=1, ACCOUNTS_GRID_ID, NAME_ID, CHANGE_NAME_ID, CHANGE_PASSWORD_ID, KILL_ME_ID, LANGUAGE_ID, OPERATION_ORDER_ID}; @@ -100,9 +100,9 @@ PreferencesPanel::PreferencesPanel(KissCount* kiss, wxUI *parent) : wxPanel(&(*p staticBoxSizer = new wxStaticBoxSizer (staticCategories, wxVERTICAL); { - int clicks[] = {CATEGORY_COLOR, CATEGORY_FONT, CATEGORY_DELETE}; + int clicks[] = {CATEGORY_BACKGROUND_COLOR, CATEGORY_FOREGROUND_COLOR, CATEGORY_FONT, CATEGORY_DELETE}; - _categoriesGrid = new wxMyGrid(this, CATEGORIES_GRID_ID, clicks, 3); + _categoriesGrid = new wxMyGrid(this, CATEGORIES_GRID_ID, clicks, 4); } staticBoxSizer->Add(_categoriesGrid); @@ -196,9 +196,10 @@ void PreferencesPanel::InitAccounts(User* user) _accountsGrid->SetReadOnly(curLine, ACCOUNT_DELETE, true); } -#define SET_ROW_COLOR(row, color) for(int i=0; iSetCellBackgroundColour(row, i, color); \ + _categoriesGrid->SetCellBackgroundColour(row, i, backcolor); \ + _categoriesGrid->SetCellTextColour(row, i, forecolor); \ } #define SET_ROW_FONT(row, font) for(int i=0; iSetDefaultCellFont(font); _categoriesGrid->SetColLabelValue(CATEGORY_NAME, _("Name")); - _categoriesGrid->SetColLabelValue(CATEGORY_COLOR, _("Color")); + _categoriesGrid->SetColLabelValue(CATEGORY_BACKGROUND_COLOR, _("Background color")); + _categoriesGrid->SetColLabelValue(CATEGORY_FOREGROUND_COLOR, _("Foreground color")); _categoriesGrid->SetColLabelValue(CATEGORY_FONT, _("Font")); _categoriesGrid->SetColLabelValue(CATEGORY_DELETE, _("Delete")); @@ -226,22 +228,20 @@ void PreferencesPanel::InitCategories(User* user) _categoriesGrid->AppendRows(); _categoriesGrid->SetCellValue(curLine, CATEGORY_NAME, it->name); - SET_ROW_COLOR(curLine, it->color); + SET_ROW_COLOR(curLine, it->backcolor, it->forecolor); if (curLine) { _categoriesGrid->SetCellRenderer(curLine, CATEGORY_DELETE, new wxGridCellBoolRenderer ()); _categoriesGrid->SetCellEditor(curLine, CATEGORY_DELETE, new wxGridCellBoolEditor ()); } - _categoriesGrid->SetCellRenderer(curLine, CATEGORY_COLOR, new wxGridCellButtonRenderer (wxT("..."))); + _categoriesGrid->SetCellRenderer(curLine, CATEGORY_BACKGROUND_COLOR, new wxGridCellButtonRenderer (wxT("..."))); + _categoriesGrid->SetCellRenderer(curLine, CATEGORY_FOREGROUND_COLOR, new wxGridCellButtonRenderer (wxT("..."))); _categoriesGrid->SetCellRenderer(curLine, CATEGORY_FONT, new wxGridCellButtonRenderer (wxT("..."))); - _categoriesGrid->SetCellEditor(curLine, CATEGORY_COLOR, new wxGridCellButtonEditor (wxT("..."))); + _categoriesGrid->SetCellEditor(curLine, CATEGORY_BACKGROUND_COLOR, new wxGridCellButtonEditor (wxT("..."))); + _categoriesGrid->SetCellEditor(curLine, CATEGORY_FOREGROUND_COLOR, new wxGridCellButtonEditor (wxT("..."))); _categoriesGrid->SetCellEditor(curLine, CATEGORY_FONT, new wxGridCellButtonEditor (wxT("..."))); - _categoriesGrid->SetCellAlignment(curLine, CATEGORY_COLOR, wxALIGN_CENTRE, wxALIGN_CENTRE); - _categoriesGrid->SetCellAlignment(curLine, CATEGORY_FONT, wxALIGN_CENTRE, wxALIGN_CENTRE); - _categoriesGrid->SetCellAlignment(curLine, CATEGORY_DELETE, wxALIGN_CENTRE, wxALIGN_CENTRE); - if (it->font.Length()) { wxFont font = user->GetCategoryFont(it->id); @@ -254,10 +254,11 @@ void PreferencesPanel::InitCategories(User* user) _categoriesGrid->AutoSizeColumns(true); _categoriesGrid->AppendRows(); - _categoriesGrid->SetReadOnly(curLine, CATEGORY_COLOR, true); + _categoriesGrid->SetReadOnly(curLine, CATEGORY_BACKGROUND_COLOR, true); + _categoriesGrid->SetReadOnly(curLine, CATEGORY_FOREGROUND_COLOR, true); _categoriesGrid->SetReadOnly(curLine, CATEGORY_FONT, true); _categoriesGrid->SetReadOnly(curLine, CATEGORY_DELETE, true); - SET_ROW_COLOR(curLine, OWN_GREEN); + SET_ROW_COLOR(curLine, OWN_GREEN, *wxBLACK); } void PreferencesPanel::InitLanguage(User* user) @@ -453,18 +454,37 @@ void PreferencesPanel::OnCategoryModified(wxGridEvent& event) inModification = true; - if (event.GetCol() == CATEGORY_COLOR) + if (event.GetCol() == CATEGORY_BACKGROUND_COLOR) { wxColourData color; - color.SetColour(wxColor(user->_categories[row].color)); + color.SetColour(wxColor(user->_categories[row].backcolor)); wxColourDialog dial(this, &color); if (dial.ShowModal() == wxID_OK) { - user->_categories[row].color = dial.GetColourData().GetColour(); + user->_categories[row].backcolor = dial.GetColourData().GetColour(); _kiss->UpdateCategory(user->_categories[row]); - SET_ROW_COLOR(row, user->_categories[row].color); + SET_ROW_COLOR(row, user->_categories[row].backcolor, user->_categories[row].forecolor); + _wxUI->NeedReload(); + } + + inModification = false ; + return ; + } + + if (event.GetCol() == CATEGORY_FOREGROUND_COLOR) + { + wxColourData color; + color.SetColour(wxColor(user->_categories[row].forecolor)); + wxColourDialog dial(this, &color); + + if (dial.ShowModal() == wxID_OK) + { + user->_categories[row].forecolor = dial.GetColourData().GetColour(); + _kiss->UpdateCategory(user->_categories[row]); + + SET_ROW_COLOR(row, user->_categories[row].backcolor, user->_categories[row].forecolor); _wxUI->NeedReload(); } @@ -500,7 +520,8 @@ void PreferencesPanel::OnCategoryModified(wxGridEvent& event) op_complete--; } - new_cat.color = _categoriesGrid->GetCellBackgroundColour(row, col); + new_cat.backcolor = _categoriesGrid->GetCellBackgroundColour(row, col); + new_cat.forecolor = _categoriesGrid->GetCellTextColour(row, col); new_cat.font = wxT(""); new_cat.parent = wxT("0"); @@ -554,26 +575,27 @@ void PreferencesPanel::OnCategoryModified(wxGridEvent& event) } _kiss->AddCategory(new_cat); - _categoriesGrid->SetReadOnly(row, CATEGORY_COLOR, false); + _categoriesGrid->SetReadOnly(row, CATEGORY_BACKGROUND_COLOR, false); + _categoriesGrid->SetReadOnly(row, CATEGORY_FOREGROUND_COLOR, false); _categoriesGrid->SetReadOnly(row, CATEGORY_FONT, false); _categoriesGrid->SetReadOnly(row, CATEGORY_DELETE, false); _categoriesGrid->SetCellRenderer(row, CATEGORY_DELETE, new wxGridCellBoolRenderer ()); _categoriesGrid->SetCellEditor(row, CATEGORY_DELETE, new wxGridCellBoolEditor ()); - _categoriesGrid->SetCellAlignment(row, CATEGORY_COLOR, wxALIGN_CENTRE, wxALIGN_CENTRE); - _categoriesGrid->SetCellAlignment(row, CATEGORY_FONT, wxALIGN_CENTRE, wxALIGN_CENTRE); - _categoriesGrid->SetCellAlignment(row, CATEGORY_DELETE, wxALIGN_CENTRE, wxALIGN_CENTRE); - row++; _categoriesGrid->AppendRows(); - _categoriesGrid->SetReadOnly(row, CATEGORY_COLOR, true); + _categoriesGrid->SetReadOnly(row, CATEGORY_BACKGROUND_COLOR, true); + _categoriesGrid->SetReadOnly(row, CATEGORY_FOREGROUND_COLOR, true); _categoriesGrid->SetReadOnly(row, CATEGORY_FONT, true); _categoriesGrid->SetReadOnly(row, CATEGORY_DELETE, true); - SET_ROW_COLOR(row, OWN_GREEN); + SET_ROW_COLOR(row, OWN_GREEN, *wxBLACK); } _wxUI->Layout(); _wxUI->NeedReload(); + + inModification = false; + return; } diff --git a/src/view/SearchPanel.cpp b/src/view/SearchPanel.cpp index ab84271..d086e7b 100644 --- a/src/view/SearchPanel.cpp +++ b/src/view/SearchPanel.cpp @@ -332,7 +332,7 @@ void SearchPanel::OnOperationModified(wxGridEvent& event) if (col == CHECKED || col == CATEGORY) { - color = user->GetCategory(new_op.category).color; + color = user->GetCategory(new_op.category).backcolor; if (new_op.checked) { diff --git a/src/view/grid/GridAccount.cpp b/src/view/grid/GridAccount.cpp index fab9501..3db9199 100644 --- a/src/view/grid/GridAccount.cpp +++ b/src/view/grid/GridAccount.cpp @@ -19,9 +19,10 @@ #include "GridAccount.h" -#define SET_ROW_COLOR(row, color) for(int i=0; ichecked) { @@ -176,7 +177,7 @@ void GridAccount::InsertOperation(User* user, Operation* op, int line, bool fix, SetCellValue(line, CHECKED, wxT("1")); } - SET_ROW_COLOR(line, color); + SET_ROW_COLOR(line, color, cat.forecolor); if (cat.font.Length()) { font = user->GetCategoryFont(cat.id); @@ -198,11 +199,11 @@ void GridAccount::InsertOperation(User* user, Operation* op, int line, bool fix, if (fix) { - SET_ROW_COLOR(line, OWN_YELLOW); + SET_ROW_COLOR(line, OWN_YELLOW, *wxBLACK); } else { - SET_ROW_COLOR(line, OWN_GREEN); + SET_ROW_COLOR(line, OWN_GREEN, *wxBLACK); } SetReadOnly(line, CHECKED, true);