void GuiSelectionManager::updateDelPB()
{
int const srows = selectedLV->model()->rowCount();
+ if (srows == 0) {
+ deletePB->setEnabled(false);
+ return;
+ }
QModelIndexList const selSels =
selectedLV->selectionModel()->selectedIndexes();
int const sel_nr = selSels.empty() ? -1 : selSels.first().row();
}
-void GuiSelectionManager::updateDownPB()
+void GuiSelectionManager::updateUpPB()
{
int const srows = selectedLV->model()->rowCount();
+ if (srows == 0) {
+ upPB->setEnabled(false);
+ return;
+ }
QModelIndexList const selSels =
selectedLV->selectionModel()->selectedIndexes();
int const sel_nr = selSels.empty() ? -1 : selSels.first().row();
}
-void GuiSelectionManager::updateUpPB()
+void GuiSelectionManager::updateDownPB()
{
int const srows = selectedLV->model()->rowCount();
+ if (srows == 0) {
+ downPB->setEnabled(false);
+ return;
+ }
QModelIndexList const selSels =
selectedLV->selectionModel()->selectedIndexes();
int const sel_nr = selSels.empty() ? -1 : selSels.first().row();