Skip to content

Commit

Permalink
Merge pull request #529 from iwbnwif/persist_dialog_sizes
Browse files Browse the repository at this point in the history
Persist geometry of ComponentDialog
  • Loading branch information
ra3xdh authored Feb 5, 2024
2 parents 1edf39e + a447dd5 commit 864042c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions qucs/components/componentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
ComponentDialog::ComponentDialog(Component *c, Schematic *d)
: QDialog(d)
{
resize(450, 250);
QSettings settings("qucs","qucs_s");
restoreGeometry(settings.value("ComponentDialog/geometry").toByteArray());

setWindowTitle(tr("Edit Component Properties"));
Comp = c;
Doc = d;
Expand Down Expand Up @@ -469,7 +471,7 @@ ComponentDialog::ComponentDialog(Component *c, Schematic *d)
prop->setCurrentItem(prop->item(0,0));
slotSelectProperty(prop->item(0,0));
}


/// \todo add key up/down browse and select prop
connect(prop, SIGNAL(itemClicked(QTableWidgetItem*)),
Expand Down Expand Up @@ -826,6 +828,9 @@ void ComponentDialog::slotApplyState(int State)
// Is called if the "OK"-button is pressed.
void ComponentDialog::slotButtOK()
{
QSettings settings("qucs","qucs_s");
settings.setValue("ComponentDialog/geometry", saveGeometry());

slotApplyInput();
slotButtCancel();
}
Expand Down

0 comments on commit 864042c

Please sign in to comment.