hide tabs if not used

This commit is contained in:
Patrick von Reth 2015-03-04 13:14:59 +01:00
parent bf39165bca
commit 49180a6495
1 changed files with 9 additions and 1 deletions

View File

@ -57,7 +57,15 @@ void SettingsDialog::initTabs()
enabled = true; enabled = true;
} }
} }
ui->tabWidget->setTabEnabled(ui->tabWidget->indexOf(container), enabled); if (enabled) {
if (ui->tabWidget->indexOf(container) == -1) {
ui->tabWidget->addTab(container,container->property("TAB_NAME").toString());
}
} else {
int index = ui->tabWidget->indexOf(container);
container->setProperty("TAB_NAME", ui->tabWidget->tabText(index));
ui->tabWidget->removeTab(index);
}
}; };
addWidgets(ui->tabWidget_backends, ui->tab_backends, SnorePlugin::BACKEND); addWidgets(ui->tabWidget_backends, ui->tab_backends, SnorePlugin::BACKEND);
addWidgets(ui->tabWidget_secondary_backends, ui->tab_secondaryBackends, SnorePlugin::SECONDARY_BACKEND); addWidgets(ui->tabWidget_secondary_backends, ui->tab_secondaryBackends, SnorePlugin::SECONDARY_BACKEND);