[GCI] backz task: unify the back button functionality, avoid using the save button
--- 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;