diff --git a/mscore/musescore.cpp b/mscore/musescore.cpp index 5122fbe3ce2c3..e8d9b42bba6e1 100644 --- a/mscore/musescore.cpp +++ b/mscore/musescore.cpp @@ -315,7 +315,12 @@ void MuseScore::cmdInsertMeasures() tr("No measure selected:\n" "Please select a measure and try again")); } else { - insertMeasuresDialog = new InsertMeasuresDialog; + if (!insertMeasuresDialog) + insertMeasuresDialog = new InsertMeasuresDialog; + else { + insertMeasuresDialog->insmeasures->setFocus(); + insertMeasuresDialog->insmeasures->selectAll(); + } insertMeasuresDialog->show(); } } @@ -3107,8 +3112,12 @@ void MuseScore::showPlayPanel(bool visible) void MuseScore::cmdAppendMeasures() { if (cs) { - if (measuresDialog == 0) + if (!measuresDialog) measuresDialog = new MeasuresDialog; + else { + measuresDialog->measures->setFocus(); + measuresDialog->measures->selectAll(); + } measuresDialog->show(); } } diff --git a/mscore/musescoredialogs.cpp b/mscore/musescoredialogs.cpp index 1fbb6eb0ae8fd..0f27b6c534db4 100644 --- a/mscore/musescoredialogs.cpp +++ b/mscore/musescoredialogs.cpp @@ -36,6 +36,7 @@ InsertMeasuresDialog::InsertMeasuresDialog(QWidget* parent) setupUi(this); setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); setModal(true); + insmeasures->setFocus(); insmeasures->selectAll(); connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), SLOT(buttonBoxClicked(QAbstractButton*))); } @@ -86,9 +87,11 @@ void InsertMeasuresDialog::hideEvent(QHideEvent* event) MeasuresDialog::MeasuresDialog(QWidget* parent) : QDialog(parent) { + setObjectName("MeasuresDialog"); setupUi(this); setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); setModal(true); + measures->setFocus(); measures->selectAll(); connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), SLOT(buttonBoxClicked(QAbstractButton*))); } @@ -122,6 +125,16 @@ void MeasuresDialog::accept() done(1); } +//--------------------------------------------------------- +// MeasuresDialog hideEvent +//--------------------------------------------------------- + +void MeasuresDialog::hideEvent(QHideEvent* event) + { + MuseScore::saveGeometry(this); + QDialog::hideEvent(event); + } + //--------------------------------------------------------- // AboutBoxDialog diff --git a/mscore/musescoredialogs.h b/mscore/musescoredialogs.h index 064e3af120665..f9adafa386d4f 100644 --- a/mscore/musescoredialogs.h +++ b/mscore/musescoredialogs.h @@ -77,6 +77,7 @@ class InsertMeasuresDialog : public QDialog, public Ui::InsertMeasuresDialogBase class MeasuresDialog : public QDialog, public Ui::MeasuresDialogBase { Q_OBJECT + void hideEvent(QHideEvent*) override; void accept() override; private slots: