diff --git a/src/shortcutsdialog.cpp b/src/shortcutsdialog.cpp index 7f6bf7ffe..e05e6857c 100644 --- a/src/shortcutsdialog.cpp +++ b/src/shortcutsdialog.cpp @@ -8,11 +8,11 @@ ShortcutsDialog::ShortcutsDialog(QWidget* parent) // Load settings // Check if settings exist first, if not create them - // TODO: How do we store the button values? Numbers, strings, especially when it comes to combinations? + // TODO: QKeySequence::toString() to load/save values connect(ui_.button_defaults, SIGNAL(clicked()), SLOT(DefaultShortcuts())); - connect(ui_.button_save, SIGNAL(clicked()), SLOT(SaveShortcuts())); - connect(ui_.button_cancel, SIGNAL(clicked()), SLOT(CancelEvent())); + connect(ui_.button_box, SIGNAL(accepted()), SLOT(SaveShortcuts())); + connect(ui_.button_box, SIGNAL(rejected()), SLOT(CancelEvent())); } /** @@ -21,16 +21,13 @@ ShortcutsDialog::ShortcutsDialog(QWidget* parent) void ShortcutsDialog::DefaultShortcuts() { } -/** - * Save the shortcuts and close the window - */ void ShortcutsDialog::SaveShortcuts() { - close(); + accept(); } /** - * Reset settings to original values taken from settings file and then close the window. + * Reset back to original values found in settings file and close */ void ShortcutsDialog::CancelEvent() { close(); -} +} \ No newline at end of file diff --git a/src/shortcutsdialog.h b/src/shortcutsdialog.h index 055db1bb9..6eccdc6c0 100644 --- a/src/shortcutsdialog.h +++ b/src/shortcutsdialog.h @@ -17,6 +17,7 @@ class ShortcutsDialog : public QDialog { void SaveShortcuts(); void CancelEvent(); + private: Ui::ShortcutsDialog ui_; QSettings settings_; diff --git a/src/shortcutsdialog.ui b/src/shortcutsdialog.ui index 7bd21e234..bf1cbd568 100644 --- a/src/shortcutsdialog.ui +++ b/src/shortcutsdialog.ui @@ -7,7 +7,7 @@ 0 0 485 - 361 + 371 @@ -46,21 +46,6 @@ true - - false - - - true - - - false - - - 24 - - - 116 - Play @@ -138,39 +123,13 @@ 10 330 80 - 26 + 31 &Defaults - - - - 300 - 330 - 80 - 26 - - - - &OK - - - - - - 390 - 330 - 80 - 26 - - - - &Cancel - - true @@ -258,6 +217,19 @@ + + + + 300 + 330 + 166 + 32 + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + tableWidget @@ -265,8 +237,6 @@ radio_default radio_custom button_custom - button_save - button_cancel button_defaults @@ -320,4 +290,7 @@ + + +