From 259b163b119a5eacc1afa455ecc8304e710454b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sun, 3 Oct 2021 12:35:17 +0200 Subject: [PATCH] Fix bug in GenerateDialog that always display error message --- src/view/GenerateDialog.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/view/GenerateDialog.cpp b/src/view/GenerateDialog.cpp index 198c09f..f2478e8 100644 --- a/src/view/GenerateDialog.cpp +++ b/src/view/GenerateDialog.cpp @@ -54,9 +54,6 @@ GenerateDialog::GenerateDialog(KissCount* kiss, wxUI *parent, int month, int yea connect(_ok, SIGNAL(clicked()), this, SLOT(OnOK())); connect(cancel, SIGNAL(clicked()), this, SLOT(OnCancel())); - connect(_yearTo, SIGNAL(currentIndexChanged(int)), this, SLOT(OnYearToChange(int))); - connect(_yearFrom, SIGNAL(currentIndexChanged(int)), this, SLOT(OnYearFromChange(int))); - _ops = _kiss->GetAllOperations(); /* From */ @@ -67,6 +64,8 @@ GenerateDialog::GenerateDialog(KissCount* kiss, wxUI *parent, int month, int yea toSelect = i; } + connect(_yearFrom, SIGNAL(currentIndexChanged(int)), this, SLOT(OnYearFromChange(int))); + if (toSelect != -1) { _yearFrom->setCurrentIndex(toSelect); @@ -93,6 +92,8 @@ GenerateDialog::GenerateDialog(KissCount* kiss, wxUI *parent, int month, int yea for(i=year-10; i<=year+10; i++) _yearTo->addItem(QString::number(i)); + connect(_yearTo, SIGNAL(currentIndexChanged(int)), this, SLOT(OnYearToChange(int))); + if (year == -1) { _yearTo->setCurrentIndex(10);