QTfrontend/hwform.cpp
changeset 3937 494221b5950e
parent 3932 2fc211f60015
child 3940 cc29628976cc
--- a/QTfrontend/hwform.cpp	Thu Oct 07 16:02:28 2010 -0400
+++ b/QTfrontend/hwform.cpp	Fri Oct 08 17:47:00 2010 +0200
@@ -83,7 +83,7 @@
 
     ui.setupUi(this);
     setMinimumSize(760, 580);
-
+    setFocusPolicy(Qt::StrongFocus);
     CustomizePalettes();
 
     ui.pageOptions->CBResolution->addItems(sdli.getResolutions());
@@ -93,13 +93,13 @@
     namegen = new HWNamegen();
 
 #ifdef __APPLE__
-        panel = new M3Panel;
+    panel = new M3Panel;
 #ifdef SPARKLE_ENABLED
-        AutoUpdater* updater;
-        CocoaInitializer initializer;
-        updater = new SparkleAutoUpdater(SPARKLE_APPCAST_URL);
-    if(updater && config->isAutoUpdateEnabled())
-            updater->checkForUpdates();
+    AutoUpdater* updater;
+    CocoaInitializer initializer;
+    updater = new SparkleAutoUpdater(SPARKLE_APPCAST_URL);
+    if (updater && config->isAutoUpdateEnabled())
+        updater->checkForUpdates();
 #endif
 #endif
 
@@ -274,6 +274,12 @@
   }
 }
 
+void HWForm::keyReleaseEvent(QKeyEvent *event)
+{
+  if (event->key() == Qt::Key_Escape || event->key() == Qt::Key_Backspace)
+    this->GoBack();
+}
+
 void HWForm::CustomizePalettes()
 {
     QList<QScrollBar *> allSBars = findChildren<QScrollBar *>();
@@ -529,11 +535,11 @@
 {
     if (eggTimer.elapsed() < 3000){
 #ifdef __APPLE__
-                panel->showInstallController();
+        panel->showInstallController();
 #endif
         close();
     }
-        else
+    else
     {
         QPushButton * btn = findChild<QPushButton *>("imageButt");
         if (btn)
@@ -1127,3 +1133,4 @@
     registry_hkcr.setValue("Hedgewars.Save/Shell/Open/Command/Default", "\"" + bindir->absolutePath().replace("/", "\\") + "\\hwengine.exe\" \"" + datadir->absolutePath().replace("/", "\\") + "\" \"%1\"");
     QMessageBox::information(0, "", QMessageBox::tr("All file associations have been set."));
 }
+