Forgot a static inModification in PreferencesPanel
This commit is contained in:
parent
691b1a603b
commit
951c41a5f7
|
@ -541,16 +541,21 @@ void PreferencesPanel::OnAccountVirtualClicked(int id)
|
||||||
Account account;
|
Account account;
|
||||||
int row;
|
int row;
|
||||||
|
|
||||||
|
if (_inModification) return;
|
||||||
|
|
||||||
it = std::find(user->_accounts.begin(), user->_accounts.end(), id);
|
it = std::find(user->_accounts.begin(), user->_accounts.end(), id);
|
||||||
|
|
||||||
if (it == user->_accounts.end()) return ;
|
if (it == user->_accounts.end()) return ;
|
||||||
|
|
||||||
|
_inModification = true;
|
||||||
|
|
||||||
row = it-user->_accounts.begin();
|
row = it-user->_accounts.begin();
|
||||||
account = user->_accounts[row];
|
account = user->_accounts[row];
|
||||||
|
|
||||||
account._virtual = (checkBox->checkState() == Qt::Checked);
|
account._virtual = (checkBox->checkState() == Qt::Checked);
|
||||||
_kiss->UpdateAccount(account);
|
_kiss->UpdateAccount(account);
|
||||||
|
|
||||||
|
_inModification = false;
|
||||||
_wxUI->NeedReload();
|
_wxUI->NeedReload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -562,16 +567,21 @@ void PreferencesPanel::OnAccountBlockedClicked(int id)
|
||||||
Account account;
|
Account account;
|
||||||
int row;
|
int row;
|
||||||
|
|
||||||
|
if (_inModification) return;
|
||||||
|
|
||||||
it = std::find(user->_accounts.begin(), user->_accounts.end(), id);
|
it = std::find(user->_accounts.begin(), user->_accounts.end(), id);
|
||||||
|
|
||||||
if (it == user->_accounts.end()) return ;
|
if (it == user->_accounts.end()) return ;
|
||||||
|
|
||||||
|
_inModification = true;
|
||||||
|
|
||||||
row = it-user->_accounts.begin();
|
row = it-user->_accounts.begin();
|
||||||
account = user->_accounts[row];
|
account = user->_accounts[row];
|
||||||
|
|
||||||
account.blocked = (checkBox->checkState() == Qt::Checked);
|
account.blocked = (checkBox->checkState() == Qt::Checked);
|
||||||
_kiss->UpdateAccount(account);
|
_kiss->UpdateAccount(account);
|
||||||
|
|
||||||
|
_inModification = false;
|
||||||
_wxUI->NeedReload();
|
_wxUI->NeedReload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -645,6 +655,10 @@ void PreferencesPanel::OnAccountHiddenClicked(int id)
|
||||||
Account account;
|
Account account;
|
||||||
int row;
|
int row;
|
||||||
|
|
||||||
|
if (_inModification) return;
|
||||||
|
|
||||||
|
_inModification = true;
|
||||||
|
|
||||||
it = std::find(user->_accounts.begin(), user->_accounts.end(), id);
|
it = std::find(user->_accounts.begin(), user->_accounts.end(), id);
|
||||||
|
|
||||||
if (it == user->_accounts.end()) return ;
|
if (it == user->_accounts.end()) return ;
|
||||||
|
@ -655,6 +669,7 @@ void PreferencesPanel::OnAccountHiddenClicked(int id)
|
||||||
account.hidden = (checkBox->checkState() == Qt::Checked);
|
account.hidden = (checkBox->checkState() == Qt::Checked);
|
||||||
_kiss->UpdateAccount(account);
|
_kiss->UpdateAccount(account);
|
||||||
|
|
||||||
|
_inModification = false;
|
||||||
_wxUI->NeedReload();
|
_wxUI->NeedReload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -712,6 +727,8 @@ void PreferencesPanel::OnBackgroundColorClicked(int id)
|
||||||
std::vector<Category>::iterator it;
|
std::vector<Category>::iterator it;
|
||||||
int row;
|
int row;
|
||||||
|
|
||||||
|
if (_inModification) return;
|
||||||
|
|
||||||
it = std::find(user->_categories.begin(), user->_categories.end(), id);
|
it = std::find(user->_categories.begin(), user->_categories.end(), id);
|
||||||
|
|
||||||
if (it == user->_categories.end()) return ;
|
if (it == user->_categories.end()) return ;
|
||||||
|
@ -741,6 +758,8 @@ void PreferencesPanel::OnForegroundClicked(int id)
|
||||||
std::vector<Category>::iterator it;
|
std::vector<Category>::iterator it;
|
||||||
int row;
|
int row;
|
||||||
|
|
||||||
|
if (_inModification) return;
|
||||||
|
|
||||||
it = std::find(user->_categories.begin(), user->_categories.end(), id);
|
it = std::find(user->_categories.begin(), user->_categories.end(), id);
|
||||||
|
|
||||||
if (it == user->_categories.end()) return ;
|
if (it == user->_categories.end()) return ;
|
||||||
|
@ -771,6 +790,8 @@ void PreferencesPanel::OnFontClicked(int id)
|
||||||
std::vector<Category>::iterator it;
|
std::vector<Category>::iterator it;
|
||||||
int row;
|
int row;
|
||||||
|
|
||||||
|
if (_inModification) return;
|
||||||
|
|
||||||
it = std::find(user->_categories.begin(), user->_categories.end(), id);
|
it = std::find(user->_categories.begin(), user->_categories.end(), id);
|
||||||
|
|
||||||
if (it == user->_categories.end()) return ;
|
if (it == user->_categories.end()) return ;
|
||||||
|
@ -953,7 +974,6 @@ void PreferencesPanel::OnCategoryModified(int row, int col)
|
||||||
int op_complete = 1;
|
int op_complete = 1;
|
||||||
QString value;
|
QString value;
|
||||||
User* user = _kiss->GetUser();
|
User* user = _kiss->GetUser();
|
||||||
static bool _inModification = false ;
|
|
||||||
Category new_cat, old_cat;
|
Category new_cat, old_cat;
|
||||||
int new_id;
|
int new_id;
|
||||||
QTableWidgetItem* item = _categoriesGrid->item(row, col);
|
QTableWidgetItem* item = _categoriesGrid->item(row, col);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user