[GCI] backz task: unify the back button functionality, avoid using the save button
authorm4tx
Sun, 11 Dec 2011 23:15:06 +0300
changeset 6525 6c97379c584b
parent 6524 416fdfb666da
child 6526 6ed9d2acf1a5
[GCI] backz task: unify the back button functionality, avoid using the save button
QTfrontend/hwform.cpp
QTfrontend/ui/page/pageeditteam.cpp
QTfrontend/ui/page/pageeditteam.h
QTfrontend/ui/page/pageoptions.cpp
QTfrontend/ui/page/pageoptions.h
QTfrontend/ui/page/pagescheme.h
QTfrontend/ui/page/pageselectweapon.cpp
QTfrontend/ui/page/pageselectweapon.h
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/FrontendDataUtils.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/GameMode.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Grave.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Map.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Scheme.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Team.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Weapon.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/UserInput/TouchInterface.java
share/hedgewars/Data/Scripts/plist/Racer.plist
--- a/QTfrontend/hwform.cpp	Sun Dec 11 19:57:04 2011 +0100
+++ b/QTfrontend/hwform.cpp	Sun Dec 11 23:15:06 2011 +0300
@@ -201,8 +201,7 @@
     connect(ui.pageOptions, SIGNAL(newTeamRequested()), this, SLOT(NewTeam()));
     connect(ui.pageOptions, SIGNAL(editTeamRequested(const QString&)), this, SLOT(EditTeam(const QString&)));
     connect(ui.pageOptions, SIGNAL(deleteTeamRequested(const QString&)), this, SLOT(DeleteTeam(const QString&)));
-    connect(ui.pageOptions->btnSave, SIGNAL(clicked()), config, SLOT(SaveOptions()));
-    connect(ui.pageOptions->btnSave, SIGNAL(clicked()), this, SLOT(GoBack()));
+    connect(ui.pageOptions, SIGNAL(goBack()), config, SLOT(SaveOptions()));
     connect(ui.pageOptions->BtnAssociateFiles, SIGNAL(clicked()), this, SLOT(AssociateFiles()));
 
     connect(ui.pageOptions->WeaponEdit, SIGNAL(clicked()), this, SLOT(GoToSelectWeapon()));
--- a/QTfrontend/ui/page/pageeditteam.cpp	Sun Dec 11 19:57:04 2011 +0100
+++ b/QTfrontend/ui/page/pageeditteam.cpp	Sun Dec 11 23:15:06 2011 +0300
@@ -206,18 +206,12 @@
 
 QLayout * PageEditTeam::footerLayoutDefinition()
 {
-    QHBoxLayout * bottomLayout = new QHBoxLayout();
-
-    btnSave = addButton(":/res/Save.png", bottomLayout, 0, true);;
-    btnSave->setStyleSheet("QPushButton{margin: 24px 0 0 0;}");
-    bottomLayout->setAlignment(btnSave, Qt::AlignRight | Qt::AlignBottom);
-
-    return bottomLayout;
+    return NULL;
 }
 
 void PageEditTeam::connectSignals()
 {
-    connect(btnSave, SIGNAL(clicked()), this, SLOT(saveTeam()));
+    connect(this, SIGNAL(goBack()), this, SLOT(saveTeam()));
 
     signalMapper1 = new QSignalMapper(this);
     signalMapper2 = new QSignalMapper(this);
--- a/QTfrontend/ui/page/pageeditteam.h	Sun Dec 11 19:57:04 2011 +0100
+++ b/QTfrontend/ui/page/pageeditteam.h	Sun Dec 11 23:15:06 2011 +0300
@@ -78,9 +78,6 @@
     QPushButton * btnRandomTeam;
     QPushButton * btnTestSound;
 
-    // footer
-    QPushButton * btnSave;
-
 private slots:
     void saveTeam();
     void setRandomNames();
--- a/QTfrontend/ui/page/pageoptions.cpp	Sun Dec 11 19:57:04 2011 +0100
+++ b/QTfrontend/ui/page/pageoptions.cpp	Sun Dec 11 23:15:06 2011 +0300
@@ -408,11 +408,7 @@
 
 QLayout * PageOptions::footerLayoutDefinition()
 {
-    QHBoxLayout * bottomLayout = new QHBoxLayout();
-    btnSave = addButton(":/res/Save.png", bottomLayout, 0, true);
-    btnSave->setStyleSheet("QPushButton{margin: 24px 0 0 0;}");
-    bottomLayout->setAlignment(btnSave, Qt::AlignRight | Qt::AlignBottom);
-    return bottomLayout;
+    return NULL;
 }
 
 void PageOptions::connectSignals()
--- a/QTfrontend/ui/page/pageoptions.h	Sun Dec 11 19:57:04 2011 +0100
+++ b/QTfrontend/ui/page/pageoptions.h	Sun Dec 11 23:15:06 2011 +0300
@@ -63,7 +63,6 @@
 #endif
 
     FPSEdit *fpsedit;
-    QPushButton *btnSave;
     QLabel *labelNN;
     QLabel *labelNetPassword;
     QSpinBox * volumeBox;
--- a/QTfrontend/ui/page/pagescheme.h	Sun Dec 11 19:57:04 2011 +0100
+++ b/QTfrontend/ui/page/pagescheme.h	Sun Dec 11 23:15:06 2011 +0300
@@ -34,7 +34,6 @@
     QPushButton * BtnCopy;
     QPushButton * BtnNew;
     QPushButton * BtnDelete;
-    QPushButton * btnSave;
     QComboBox * selectScheme;
 
     void setModel(QAbstractItemModel * model);
--- a/QTfrontend/ui/page/pageselectweapon.cpp	Sun Dec 11 19:57:04 2011 +0100
+++ b/QTfrontend/ui/page/pageselectweapon.cpp	Sun Dec 11 23:15:06 2011 +0300
@@ -53,17 +53,13 @@
     bottomLayout->setColumnStretch(1,1);
     bottomLayout->setColumnStretch(2,1);
 
-    btnSave = addButton(":/res/Save.png", bottomLayout, 0, 3, 2, 1, true);
-    btnSave->setStyleSheet("QPushButton{margin: 24px 0 0 0;}");
-    bottomLayout->setAlignment(btnSave, Qt::AlignRight | Qt::AlignBottom);
-
     return bottomLayout;
 }
 
 void PageSelectWeapon::connectSignals()
 {
     connect(BtnDefault, SIGNAL(clicked()), pWeapons, SLOT(setDefault()));
-    connect(btnSave, SIGNAL(clicked()), pWeapons, SLOT(save()));
+    connect(this, SIGNAL(goBack()), pWeapons, SLOT(save()));
     connect(BtnNew, SIGNAL(clicked()), pWeapons, SLOT(newWeaponsName()));
     connect(BtnCopy, SIGNAL(clicked()), pWeapons, SLOT(copy()));
     connect(selectWeaponSet, SIGNAL(currentIndexChanged(const QString&)), pWeapons, SLOT(setWeaponsName(const QString&)));
--- a/QTfrontend/ui/page/pageselectweapon.h	Sun Dec 11 19:57:04 2011 +0100
+++ b/QTfrontend/ui/page/pageselectweapon.h	Sun Dec 11 23:15:06 2011 +0300
@@ -30,7 +30,6 @@
 public:
     PageSelectWeapon(QWidget* parent = 0);
 
-    QPushButton *btnSave;
     QPushButton *BtnDefault;
     QPushButton *BtnDelete;
     QPushButton *BtnNew;