Skip to content

Commit

Permalink
fix #68131 make stave properties window size/position persistent
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer authored and lasconic committed Jul 8, 2015
1 parent 6a0c332 commit d5f7c8a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions mscore/editstaff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

namespace Ms {

extern bool useFactorySettings;

//---------------------------------------------------------
// EditStaff
//---------------------------------------------------------
Expand Down Expand Up @@ -89,6 +91,14 @@ EditStaff::EditStaff(Staff* s, QWidget* parent)
updateStaffType();
updateInstrument();

if (!useFactorySettings) {
QSettings settings;
settings.beginGroup("EditStaff");
resize(settings.value("size", QSize(484, 184)).toSize());
move(settings.value("pos", QPoint(10, 10)).toPoint());
settings.endGroup();
}

connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), SLOT(bboxClicked(QAbstractButton*)));
connect(changeInstrument, SIGNAL(clicked()), SLOT(showInstrumentDialog()));
connect(changeStaffType, SIGNAL(clicked()), SLOT(showStaffTypeDialog()));
Expand All @@ -105,6 +115,20 @@ EditStaff::EditStaff(Staff* s, QWidget* parent)
addAction(getAction("local-help")); // why is this needed?
}

//---------------------------------------------------------
// closeEvent
//---------------------------------------------------------

void EditStaff::closeEvent(QCloseEvent* ev)
{
QSettings settings;
settings.beginGroup("EditStaff");
settings.setValue("size", size());
settings.setValue("pos", pos());
settings.endGroup();
QWidget::closeEvent(ev);
}

//---------------------------------------------------------
// updateStaffType
//---------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions mscore/editstaff.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class EditStaff : public QDialog, private Ui::EditStaffBase {
Instrument instrument;
int _minPitchA, _maxPitchA, _minPitchP, _maxPitchP;

virtual void closeEvent(QCloseEvent*);
void apply();
void updateInterval(const Interval&);
void updateStaffType();
Expand Down

0 comments on commit d5f7c8a

Please sign in to comment.