# HG changeset patch # User m4tx # Date 1323634506 -10800 # Node ID 6c97379c584b91cc9a66991b3ae5eac34e95a9e1 # Parent 416fdfb666dae70761603681db11aa2595bc1a26 [GCI] backz task: unify the back button functionality, avoid using the save button diff -r 416fdfb666da -r 6c97379c584b QTfrontend/hwform.cpp --- 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())); diff -r 416fdfb666da -r 6c97379c584b QTfrontend/ui/page/pageeditteam.cpp --- 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); diff -r 416fdfb666da -r 6c97379c584b QTfrontend/ui/page/pageeditteam.h --- 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(); diff -r 416fdfb666da -r 6c97379c584b QTfrontend/ui/page/pageoptions.cpp --- 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() diff -r 416fdfb666da -r 6c97379c584b QTfrontend/ui/page/pageoptions.h --- 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; diff -r 416fdfb666da -r 6c97379c584b QTfrontend/ui/page/pagescheme.h --- 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); diff -r 416fdfb666da -r 6c97379c584b QTfrontend/ui/page/pageselectweapon.cpp --- 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&))); diff -r 416fdfb666da -r 6c97379c584b QTfrontend/ui/page/pageselectweapon.h --- 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;