UI dialog tweaks: filter + create game(s) (#3351)
* vbox --> grid layout
This commit is contained in:
parent
69c103ede3
commit
451e1874a7
4 changed files with 22 additions and 15 deletions
|
@ -37,7 +37,8 @@ void DlgCreateGame::sharedCtor()
|
||||||
generalGrid->addWidget(descriptionEdit, 0, 1);
|
generalGrid->addWidget(descriptionEdit, 0, 1);
|
||||||
generalGrid->addWidget(maxPlayersLabel, 1, 0);
|
generalGrid->addWidget(maxPlayersLabel, 1, 0);
|
||||||
generalGrid->addWidget(maxPlayersEdit, 1, 1);
|
generalGrid->addWidget(maxPlayersEdit, 1, 1);
|
||||||
generalGrid->addWidget(rememberGameSettings, 2, 0);
|
generalGroupBox = new QGroupBox(tr("General"));
|
||||||
|
generalGroupBox->setLayout(generalGrid);
|
||||||
|
|
||||||
QVBoxLayout *gameTypeLayout = new QVBoxLayout;
|
QVBoxLayout *gameTypeLayout = new QVBoxLayout;
|
||||||
QMapIterator<int, QString> gameTypeIterator(gameTypes);
|
QMapIterator<int, QString> gameTypeIterator(gameTypes);
|
||||||
|
@ -89,10 +90,11 @@ void DlgCreateGame::sharedCtor()
|
||||||
spectatorsGroupBox->setLayout(spectatorsLayout);
|
spectatorsGroupBox->setLayout(spectatorsLayout);
|
||||||
|
|
||||||
QGridLayout *grid = new QGridLayout;
|
QGridLayout *grid = new QGridLayout;
|
||||||
grid->addLayout(generalGrid, 0, 0);
|
grid->addWidget(generalGroupBox, 0, 0);
|
||||||
grid->addWidget(spectatorsGroupBox, 1, 0);
|
|
||||||
grid->addWidget(joinRestrictionsGroupBox, 0, 1);
|
grid->addWidget(joinRestrictionsGroupBox, 0, 1);
|
||||||
grid->addWidget(gameTypeGroupBox, 1, 1);
|
grid->addWidget(gameTypeGroupBox, 1, 0);
|
||||||
|
grid->addWidget(spectatorsGroupBox, 1, 1);
|
||||||
|
grid->addWidget(rememberGameSettings, 2, 0);
|
||||||
|
|
||||||
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
|
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
|
||||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||||
|
|
|
@ -4,18 +4,17 @@
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
|
class QCheckBox;
|
||||||
|
class QDialogButtonBox;
|
||||||
|
class QGroupBox;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
class QCheckBox;
|
|
||||||
class QRadioButton;
|
class QRadioButton;
|
||||||
class QGroupBox;
|
|
||||||
class QSpinBox;
|
class QSpinBox;
|
||||||
class QDialogButtonBox;
|
|
||||||
class TabRoom;
|
|
||||||
|
|
||||||
class Response;
|
class Response;
|
||||||
class ServerInfo_Game;
|
class ServerInfo_Game;
|
||||||
|
class TabRoom;
|
||||||
|
|
||||||
class DlgCreateGame : public QDialog
|
class DlgCreateGame : public QDialog
|
||||||
{
|
{
|
||||||
|
@ -34,7 +33,7 @@ private:
|
||||||
QMap<int, QString> gameTypes;
|
QMap<int, QString> gameTypes;
|
||||||
QMap<int, QRadioButton *> gameTypeCheckBoxes;
|
QMap<int, QRadioButton *> gameTypeCheckBoxes;
|
||||||
|
|
||||||
QGroupBox *spectatorsGroupBox;
|
QGroupBox *generalGroupBox, *spectatorsGroupBox;
|
||||||
QLabel *descriptionLabel, *passwordLabel, *maxPlayersLabel;
|
QLabel *descriptionLabel, *passwordLabel, *maxPlayersLabel;
|
||||||
QLineEdit *descriptionEdit, *passwordEdit;
|
QLineEdit *descriptionEdit, *passwordEdit;
|
||||||
QSpinBox *maxPlayersEdit;
|
QSpinBox *maxPlayersEdit;
|
||||||
|
|
|
@ -29,12 +29,19 @@ DlgFilterGames::DlgFilterGames(const QMap<int, QString> &_allGameTypes,
|
||||||
gameNameFilterEdit->setText(gamesProxyModel->getGameNameFilter());
|
gameNameFilterEdit->setText(gamesProxyModel->getGameNameFilter());
|
||||||
QLabel *gameNameFilterLabel = new QLabel(tr("Game &description:"));
|
QLabel *gameNameFilterLabel = new QLabel(tr("Game &description:"));
|
||||||
gameNameFilterLabel->setBuddy(gameNameFilterEdit);
|
gameNameFilterLabel->setBuddy(gameNameFilterEdit);
|
||||||
|
|
||||||
creatorNameFilterEdit = new QLineEdit;
|
creatorNameFilterEdit = new QLineEdit;
|
||||||
creatorNameFilterEdit->setText(gamesProxyModel->getCreatorNameFilter());
|
creatorNameFilterEdit->setText(gamesProxyModel->getCreatorNameFilter());
|
||||||
QLabel *creatorNameFilterLabel = new QLabel(tr("&Creator name:"));
|
QLabel *creatorNameFilterLabel = new QLabel(tr("&Creator name:"));
|
||||||
creatorNameFilterLabel->setBuddy(creatorNameFilterEdit);
|
creatorNameFilterLabel->setBuddy(creatorNameFilterEdit);
|
||||||
|
|
||||||
|
QGridLayout *generalGrid = new QGridLayout;
|
||||||
|
generalGrid->addWidget(gameNameFilterLabel, 0, 0);
|
||||||
|
generalGrid->addWidget(gameNameFilterEdit, 0, 1);
|
||||||
|
generalGrid->addWidget(creatorNameFilterLabel, 1, 0);
|
||||||
|
generalGrid->addWidget(creatorNameFilterEdit, 1, 1);
|
||||||
|
generalGroupBox = new QGroupBox(tr("General"));
|
||||||
|
generalGroupBox->setLayout(generalGrid);
|
||||||
|
|
||||||
QVBoxLayout *gameTypeFilterLayout = new QVBoxLayout;
|
QVBoxLayout *gameTypeFilterLayout = new QVBoxLayout;
|
||||||
QMapIterator<int, QString> gameTypesIterator(allGameTypes);
|
QMapIterator<int, QString> gameTypesIterator(allGameTypes);
|
||||||
while (gameTypesIterator.hasNext()) {
|
while (gameTypesIterator.hasNext()) {
|
||||||
|
@ -85,10 +92,7 @@ DlgFilterGames::DlgFilterGames(const QMap<int, QString> &_allGameTypes,
|
||||||
restrictionsGroupBox->setLayout(restrictionsLayout);
|
restrictionsGroupBox->setLayout(restrictionsLayout);
|
||||||
|
|
||||||
QGridLayout *leftGrid = new QGridLayout;
|
QGridLayout *leftGrid = new QGridLayout;
|
||||||
leftGrid->addWidget(gameNameFilterLabel, 0, 0);
|
leftGrid->addWidget(generalGroupBox, 0, 0, 1, 2);
|
||||||
leftGrid->addWidget(gameNameFilterEdit, 0, 1);
|
|
||||||
leftGrid->addWidget(creatorNameFilterLabel, 1, 0);
|
|
||||||
leftGrid->addWidget(creatorNameFilterEdit, 1, 1);
|
|
||||||
leftGrid->addWidget(maxPlayersGroupBox, 2, 0, 1, 2);
|
leftGrid->addWidget(maxPlayersGroupBox, 2, 0, 1, 2);
|
||||||
leftGrid->addWidget(restrictionsGroupBox, 3, 0, 1, 2);
|
leftGrid->addWidget(restrictionsGroupBox, 3, 0, 1, 2);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
|
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
|
class QGroupBox;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QSpinBox;
|
class QSpinBox;
|
||||||
|
|
||||||
|
@ -15,6 +16,7 @@ class DlgFilterGames : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
|
QGroupBox *generalGroupBox;
|
||||||
QCheckBox *showBuddiesOnlyGames;
|
QCheckBox *showBuddiesOnlyGames;
|
||||||
QCheckBox *unavailableGamesVisibleCheckBox;
|
QCheckBox *unavailableGamesVisibleCheckBox;
|
||||||
QCheckBox *showPasswordProtectedGames;
|
QCheckBox *showPasswordProtectedGames;
|
||||||
|
|
Loading…
Reference in a new issue