Skip to content

Commit

Permalink
Fix dialog button mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
Umcaruje committed Jul 10, 2016
1 parent 52ec387 commit a13b21c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
Binary file added data/themes/default/discard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/themes/default/ignore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/themes/default/recover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 15 additions & 14 deletions src/core/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,42 +736,43 @@ int main( int argc, char * * argv )
MainWindow::tr( "Discard" ),
MainWindow::tr( "Launch a default session and delete "
"the restored files. This is not reversible." ),
MainWindow::tr( "Quit" ),
MainWindow::tr( "Exit" ),
MainWindow::tr( "Shut down LMMS with no further action." )
) );

mb.setIcon( QMessageBox::Warning );
mb.setWindowIcon( embed::getIconPixmap( "icon" ) );

mb.setStandardButtons( QMessageBox::Ok |
QMessageBox::Discard );

mb.setButtonText( QMessageBox::Ok,
MainWindow::tr( "Recover" ) );

QAbstractButton * recover;
QAbstractButton * discard;
QPushButton * recover;
QPushButton * ignore;
QPushButton * discard;
QPushButton * exit;

recover = mb.QMessageBox::button( QMessageBox::Ok );
discard = mb.QMessageBox::button( QMessageBox::Discard );
recover = mb.addButton( MainWindow::tr( "Recover" ),
QMessageBox::AcceptRole );
recover->setIcon( embed::getIconPixmap( "recover" ) );

discard = mb.addButton( MainWindow::tr( "Discard" ),
QMessageBox::DestructiveRole );
discard->setIcon( embed::getIconPixmap( "discard" ) );

ignore = mb.addButton( MainWindow::tr( "Ignore" ),
QMessageBox::NoRole );
ignore->setIcon( embed::getIconPixmap( "no_entry" ) );
ignore->setIcon( embed::getIconPixmap( "ignore" ) );

exit = mb.addButton( MainWindow::tr( "Exit" ),
QMessageBox::RejectRole );
exit->setIcon( embed::getIconPixmap( "exit" ) );

mb.setDefaultButton( QMessageBox::Ok );
mb.setDefaultButton( recover );
mb.setEscapeButton( exit );

mb.exec();
if( mb.clickedButton() == discard )
{
gui->mainWindow()->sessionCleanup();
}
else if( mb.clickedButton() == recover ) // ::Recover
else if( mb.clickedButton() == recover ) // Recover
{
fileToLoad = recoveryFile;
gui->mainWindow()->setSession( MainWindow::SessionState::Recover );
Expand Down

0 comments on commit a13b21c

Please sign in to comment.