added game filter dialog in GameSelector; switched all dialogs to QDialogButtonBox; issue #32 fixed

This commit is contained in:
Max-Wilhelm Bruker 2012-03-30 21:09:35 +02:00
parent facfc3cc52
commit 6b14b4e543
21 changed files with 310 additions and 116 deletions

View file

@ -1,9 +1,9 @@
#include <QSettings>
#include <QLabel>
#include <QPushButton>
#include <QCheckBox>
#include <QGridLayout>
#include <QHBoxLayout>
#include <QDialogButtonBox>
#include "dlg_connect.h"
DlgConnect::DlgConnect(QWidget *parent)
@ -32,10 +32,6 @@ DlgConnect::DlgConnect(QWidget *parent)
savePasswordCheckBox = new QCheckBox(tr("&Save password"));
savePasswordCheckBox->setChecked(settings.value("save_password", 1).toInt());
okButton = new QPushButton(tr("&OK"));
okButton->setDefault(true);
cancelButton = new QPushButton(tr("&Cancel"));
QGridLayout *grid = new QGridLayout;
grid->addWidget(hostLabel, 0, 0);
grid->addWidget(hostEdit, 0, 1);
@ -46,23 +42,19 @@ DlgConnect::DlgConnect(QWidget *parent)
grid->addWidget(passwordLabel, 3, 0);
grid->addWidget(passwordEdit, 3, 1);
grid->addWidget(savePasswordCheckBox, 4, 0, 1, 2);
QHBoxLayout *buttonLayout = new QHBoxLayout;
buttonLayout->addStretch();
buttonLayout->addWidget(okButton);
buttonLayout->addWidget(cancelButton);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actOk()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(grid);
mainLayout->addLayout(buttonLayout);
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);
setWindowTitle(tr("Connect to server"));
setFixedHeight(sizeHint().height());
setMinimumWidth(300);
connect(okButton, SIGNAL(clicked()), this, SLOT(actOk()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
}
void DlgConnect::actOk()