From f1661e315c5f9830333f2d05d1b0be9c5d6d3d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sun, 6 May 2012 11:40:13 +0200 Subject: [PATCH] Change message for new users Fix a bug : updating operations doesn't work --- ChangeLog | 2 +- TODO | 3 +++ src/model/Database.cpp | 11 ++++------- src/model/export/XMLExportEngine.cpp | 13 ++++++++++++- src/view/grid/GridAccount.cpp | 7 ++----- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca82b3f..5bbec26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ v0.3 (05/05/2012) ** User ** - New interface in Qt + New interface in Qt4 Use BDD file from .local/share/kisscount Use libkchart for graphics Use oxygen icons diff --git a/TODO b/TODO index a4c053d..3e7ec24 100644 --- a/TODO +++ b/TODO @@ -37,3 +37,6 @@ it's not taken in account by UpdateStats it will not be displayed. In this case we must load whole meta. This bug can't be resolved without use of hashtable because of complexity in searching this issue. + +* When changing date in a sub operation (set date > main date), +meta amount is set to 0 \ No newline at end of file diff --git a/src/model/Database.cpp b/src/model/Database.cpp index b9e6360..956afa1 100644 --- a/src/model/Database.cpp +++ b/src/model/Database.cpp @@ -88,14 +88,11 @@ void Database::CreateDatabase() QString sPath = GetDatabaseHome() + GetDatabaseFile(); QDir dirname( GetDatabaseHome()); QFile file(sPath); - QString 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 !"); + QString message; - if (dirname.exists()) - { - if (QMessageBox::question(0, "KissCount", message, QMessageBox::Yes|QMessageBox::No) == QMessageBox::No) - throw std::string("No database") ; - } + message = _("A new database will be created, continue ?"); + if (QMessageBox::question(0, "KissCount", message, QMessageBox::Yes|QMessageBox::No) == QMessageBox::No) + throw std::string("Abort") ; if (!init_script.exists() || !init_script.open(QIODevice::ReadOnly | QIODevice::Text)) { diff --git a/src/model/export/XMLExportEngine.cpp b/src/model/export/XMLExportEngine.cpp index 31b1269..e15936b 100644 --- a/src/model/export/XMLExportEngine.cpp +++ b/src/model/export/XMLExportEngine.cpp @@ -50,7 +50,18 @@ bool XMLExportEngine::SaveAccounts() for(it=_accounts.begin(); it!=_accounts.end(); it++) { - account = _user->GetAccount(it->first); + try + { + account = _user->GetAccount(it->first); + } + catch(User::AccountNotFound) + { + account.id = it->first; + account.name = "Unknown"; + account.blocked = false; + account._virtual = false; + account.hidden = false; + } ESCAPE_CHARS(account.name); ESCAPE_CHARS(account.number); diff --git a/src/view/grid/GridAccount.cpp b/src/view/grid/GridAccount.cpp index 845caf9..b50cc56 100644 --- a/src/view/grid/GridAccount.cpp +++ b/src/view/grid/GridAccount.cpp @@ -1037,14 +1037,11 @@ void GridAccount::OnOperationModified(int row, int col) { need_insertion = true; removeRow(row); - DeleteOperation(cur_op); - _displayedOperations.erase(_displayedOperations.begin()+row); if (fix_cost) _fixCosts--; - } - else - (_displayedOperations)[row] = new_op; + } + (_displayedOperations)[row] = new_op; UpdateOperation(new_op); } // Add an operation