[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r2968: Make pressing "Return" mean the same thing as clicking "OK" (vidalia/trunk/src/vidalia/config)
Author: edmanm
Date: 2008-08-15 00:53:56 -0400 (Fri, 15 Aug 2008)
New Revision: 2968
Modified:
vidalia/trunk/src/vidalia/config/configdialog.cpp
Log:
Make pressing "Return" mean the same thing as clicking "OK" in the config
dialog, and make pressing "Escape" mean the same thing as clicking "Cancel".
Modified: vidalia/trunk/src/vidalia/config/configdialog.cpp
===================================================================
--- vidalia/trunk/src/vidalia/config/configdialog.cpp 2008-08-15 04:23:14 UTC (rev 2967)
+++ vidalia/trunk/src/vidalia/config/configdialog.cpp 2008-08-15 04:53:56 UTC (rev 2968)
@@ -52,11 +52,17 @@
/* Override the QDialogButtonBox button text so we can use our own
* translations. */
QPushButton *button = ui.buttonBox->button(QDialogButtonBox::Ok);
- if (button)
+ if (button) {
button->setText(tr("OK"));
+ Vidalia::createShortcut(QKeySequence(Qt::Key_Return),
+ this, button, SLOT(click()));
+ }
button = ui.buttonBox->button(QDialogButtonBox::Cancel);
- if (button)
+ if (button) {
button->setText(tr("Cancel"));
+ Vidalia::createShortcut(QKeySequence(Qt::Key_Escape),
+ this, button, SLOT(click()));
+ }
/* Connect the button box signals to the appropriate slots */
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(saveChanges()));