mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-19 10:58:51 +00:00
Fix opening correct panel in the preferences dialog via the contextmenu (#583)
This commit is contained in:
parent
db682f6ef9
commit
662837e38e
@ -20,8 +20,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent)
|
|||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
QList<PreferenceCategory> prefs
|
QList<PreferenceCategory> prefs {
|
||||||
{
|
|
||||||
{
|
{
|
||||||
"General",
|
"General",
|
||||||
new GeneralOptionsWidget(this),
|
new GeneralOptionsWidget(this),
|
||||||
@ -61,12 +60,17 @@ PreferencesDialog::~PreferencesDialog()
|
|||||||
|
|
||||||
void PreferencesDialog::showSection(PreferencesDialog::Section section)
|
void PreferencesDialog::showSection(PreferencesDialog::Section section)
|
||||||
{
|
{
|
||||||
|
QTreeWidgetItem *defitem;
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case Section::General:
|
case Section::General:
|
||||||
ui->configPanel->setCurrentIndex(0);
|
ui->configPanel->setCurrentIndex(0);
|
||||||
|
defitem = ui->configCategories->topLevelItem(0);
|
||||||
|
ui->configCategories->setCurrentItem(defitem, 0);
|
||||||
break;
|
break;
|
||||||
case Section::Disassembly:
|
case Section::Disassembly:
|
||||||
ui->configPanel->setCurrentIndex(1);
|
ui->configPanel->setCurrentIndex(1);
|
||||||
|
defitem = ui->configCategories->topLevelItem(1);
|
||||||
|
ui->configCategories->setCurrentItem(defitem, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user