adopted for custom button handling qt5.
This commit is contained in:
parent
3e216cb6ea
commit
bb28e7258a
@ -1418,18 +1418,18 @@ void PTextEdit::fileSavePrefs()
|
|||||||
QString msg("");
|
QString msg("");
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
msgBox.setText("Which Preferences do you want to open?");
|
msgBox.setText("Which Preferences do you want to open?");
|
||||||
msgBox.addButton("Default", QMessageBox::AcceptRole);
|
QAbstractButton *def = msgBox.addButton("Default", QMessageBox::AcceptRole);
|
||||||
msgBox.addButton("Custom", QMessageBox::AcceptRole);
|
QAbstractButton *cust = msgBox.addButton("Custom", QMessageBox::AcceptRole);
|
||||||
msgBox.setStandardButtons(QMessageBox::Cancel);
|
msgBox.setStandardButtons(QMessageBox::Cancel);
|
||||||
int result = msgBox.exec();
|
int result = msgBox.exec();
|
||||||
if (result == QMessageBox::Cancel) {
|
if (result == QMessageBox::Cancel) {
|
||||||
return;
|
return;
|
||||||
} else if (result == 0) { // default dir
|
} else if (msgBox.clickedButton() == def) { // default dir
|
||||||
fln = fAdmin->getDefaultPrefPathName();
|
fln = fAdmin->getDefaultPrefPathName();
|
||||||
msg = QString("Current Default Preferences Path-Name:\n") + fln;
|
msg = QString("Current Default Preferences Path-Name:\n") + fln;
|
||||||
if (QMessageBox::information(this, "Info", msg, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel)
|
if (QMessageBox::information(this, "Info", msg, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel)
|
||||||
return;
|
return;
|
||||||
} else if (result == 1) { // custom dir
|
} else if (msgBox.clickedButton() == cust) { // custom dir
|
||||||
fln = QFileDialog::getSaveFileName( this,
|
fln = QFileDialog::getSaveFileName( this,
|
||||||
tr( "Save Prefs As" ), "musredit_startup.xml",
|
tr( "Save Prefs As" ), "musredit_startup.xml",
|
||||||
tr( "xml-Files (*.xml);;All Files (*)" ) );
|
tr( "xml-Files (*.xml);;All Files (*)" ) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user