| 67 |
- |
1 |
|
|
|
2 |
#include <QtGui>
|
|
|
3 |
#include <QtGui/QSpacerItem>
|
|
|
4 |
#include "pages.h"
|
|
|
5 |
|
|
|
6 |
#include "../cat_entry/cat_entry.h"
|
|
|
7 |
#include "../leg_entry/leg_entry.h"
|
|
|
8 |
#include "../leg_entry/team_break_entry.h"
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
ConfigurationPage::ConfigurationPage(QWidget *parent)
|
|
|
12 |
: QWidget(parent)
|
|
|
13 |
{
|
|
|
14 |
QGroupBox *updateGroup = new QGroupBox(tr("Categories"));
|
|
|
15 |
QVBoxLayout *updateLayout = new QVBoxLayout();
|
|
|
16 |
updateLayout->setSpacing(0);
|
|
|
17 |
|
|
|
18 |
for ( int ii = 0; ii < 20; ii++)
|
|
|
19 |
{
|
|
|
20 |
CatEntry *configGroup0 = new CatEntry();
|
|
|
21 |
updateLayout->addWidget(configGroup0);
|
|
|
22 |
}
|
|
|
23 |
|
|
|
24 |
QSpacerItem *verticalSpacer;
|
|
|
25 |
verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
|
|
26 |
updateLayout->addItem(verticalSpacer);
|
|
|
27 |
updateGroup->setLayout(updateLayout);
|
|
|
28 |
|
|
|
29 |
QVBoxLayout *mainLayout = new QVBoxLayout;
|
|
|
30 |
mainLayout->addWidget(updateGroup);
|
|
|
31 |
setLayout(mainLayout);
|
|
|
32 |
}
|
|
|
33 |
|
|
|
34 |
UpdatePage::UpdatePage(QWidget *parent)
|
|
|
35 |
: QWidget(parent)
|
|
|
36 |
{
|
|
|
37 |
QGroupBox *packagesGroup = new QGroupBox(tr("Event"));
|
|
|
38 |
|
|
|
39 |
QLabel *nameLabel = new QLabel(tr("Name:"));
|
|
|
40 |
QLineEdit *nameEdit = new QLineEdit;
|
|
|
41 |
|
|
|
42 |
QGridLayout *packagesLayout = new QGridLayout;
|
|
|
43 |
packagesLayout->addWidget(nameLabel, 0, 0);
|
|
|
44 |
packagesLayout->addWidget(nameEdit, 0, 1);
|
|
|
45 |
packagesGroup->setLayout(packagesLayout);
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
QGroupBox *updateGroup = new QGroupBox(tr("Legs"));
|
|
|
50 |
QVBoxLayout *updateLayout = new QVBoxLayout();
|
|
|
51 |
updateLayout->setSpacing(0);
|
|
|
52 |
|
|
|
53 |
for ( int ii = 0; ii < 5; ii++)
|
|
|
54 |
{
|
|
|
55 |
LegEntry *configGroup0 = new LegEntry();
|
|
|
56 |
updateLayout->addWidget(configGroup0);
|
|
|
57 |
}
|
|
|
58 |
updateGroup->setLayout(updateLayout);
|
|
|
59 |
|
|
|
60 |
QGroupBox *teamBreakGroup = new QGroupBox(tr("Team Breaks"));
|
|
|
61 |
QVBoxLayout *teamBreakLayout = new QVBoxLayout();
|
|
|
62 |
teamBreakLayout->setSpacing(0);
|
|
|
63 |
|
|
|
64 |
for ( int ii = 0; ii < 5; ii++)
|
|
|
65 |
{
|
|
|
66 |
TeamBreakEntry *configGroup0 = new TeamBreakEntry();
|
|
|
67 |
teamBreakLayout->addWidget(configGroup0);
|
|
|
68 |
}
|
|
|
69 |
teamBreakGroup->setLayout(teamBreakLayout);
|
|
|
70 |
|
|
|
71 |
QGroupBox *miscGroup = new QGroupBox(tr("Misc"));
|
|
|
72 |
|
|
|
73 |
QLabel *dfileLabel = new QLabel(tr("Data File:"));
|
|
|
74 |
QLineEdit *dfileEdit = new QLineEdit;
|
|
|
75 |
|
|
|
76 |
QLabel *lfileLabel = new QLabel(tr("Ledgend:"));
|
|
|
77 |
QLineEdit *lfileEdit = new QLineEdit;
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
QLabel *elegLabel = new QLabel(tr("Equestrian Leg:"));
|
|
|
81 |
QLineEdit *elegEdit = new QLineEdit;
|
|
|
82 |
|
|
|
83 |
QLabel *neCatLabel = new QLabel(tr("NE Cat:"));
|
|
|
84 |
QLineEdit *neCatEdit = new QLineEdit;
|
|
|
85 |
|
|
|
86 |
QLabel *lppLabel = new QLabel(tr("Line Per Page:"));
|
|
|
87 |
QLineEdit *lppEdit = new QLineEdit;
|
|
|
88 |
|
|
|
89 |
QLabel *perfLabel = new QLabel(tr("PerfSkip:"));
|
|
|
90 |
QLineEdit *perfEdit = new QLineEdit;
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
QGridLayout *miscLayout = new QGridLayout;
|
|
|
94 |
miscLayout->addWidget(elegLabel, 0, 0);
|
|
|
95 |
miscLayout->addWidget(elegEdit, 0, 1);
|
|
|
96 |
|
|
|
97 |
miscLayout->addWidget(neCatLabel, 1, 0);
|
|
|
98 |
miscLayout->addWidget(neCatEdit, 1, 1);
|
|
|
99 |
|
|
|
100 |
miscLayout->addWidget(lppLabel, 2, 0);
|
|
|
101 |
miscLayout->addWidget(lppEdit, 2, 1);
|
|
|
102 |
|
|
|
103 |
miscLayout->addWidget(perfLabel, 2, 2);
|
|
|
104 |
miscLayout->addWidget(perfEdit, 2, 3);
|
|
|
105 |
|
|
|
106 |
miscLayout->addWidget(dfileLabel, 3, 0);
|
|
|
107 |
miscLayout->addWidget(dfileEdit, 3, 1);
|
|
|
108 |
|
|
|
109 |
miscLayout->addWidget(lfileLabel, 4, 0);
|
|
|
110 |
miscLayout->addWidget(lfileEdit, 4, 1);
|
|
|
111 |
|
|
|
112 |
miscGroup->setLayout(miscLayout);
|
|
|
113 |
|
|
|
114 |
|
|
|
115 |
QVBoxLayout *mainLayout = new QVBoxLayout;
|
|
|
116 |
mainLayout->addWidget(packagesGroup);
|
|
|
117 |
mainLayout->addWidget(updateGroup);
|
|
|
118 |
mainLayout->addWidget(teamBreakGroup);
|
|
|
119 |
mainLayout->addWidget(miscGroup);
|
|
|
120 |
mainLayout->addStretch(1);
|
|
|
121 |
setLayout(mainLayout);
|
|
|
122 |
}
|
|
|
123 |
|
|
|
124 |
QueryPage::QueryPage(QWidget *parent)
|
|
|
125 |
: QWidget(parent)
|
|
|
126 |
{
|
|
|
127 |
QGroupBox *packagesGroup = new QGroupBox(tr("Look for packages"));
|
|
|
128 |
|
|
|
129 |
QLabel *nameLabel = new QLabel(tr("Name:"));
|
|
|
130 |
QLineEdit *nameEdit = new QLineEdit;
|
|
|
131 |
|
|
|
132 |
QLabel *dateLabel = new QLabel(tr("Released after:"));
|
|
|
133 |
QDateTimeEdit *dateEdit = new QDateTimeEdit(QDate::currentDate());
|
|
|
134 |
|
|
|
135 |
QCheckBox *releasesCheckBox = new QCheckBox(tr("Releases"));
|
|
|
136 |
QCheckBox *upgradesCheckBox = new QCheckBox(tr("Upgrades"));
|
|
|
137 |
|
|
|
138 |
QSpinBox *hitsSpinBox = new QSpinBox;
|
|
|
139 |
hitsSpinBox->setPrefix(tr("Return up to "));
|
|
|
140 |
hitsSpinBox->setSuffix(tr(" results"));
|
|
|
141 |
hitsSpinBox->setSpecialValueText(tr("Return only the first result"));
|
|
|
142 |
hitsSpinBox->setMinimum(1);
|
|
|
143 |
hitsSpinBox->setMaximum(100);
|
|
|
144 |
hitsSpinBox->setSingleStep(10);
|
|
|
145 |
|
|
|
146 |
QPushButton *startQueryButton = new QPushButton(tr("Start query"));
|
|
|
147 |
|
|
|
148 |
QGridLayout *packagesLayout = new QGridLayout;
|
|
|
149 |
packagesLayout->addWidget(nameLabel, 0, 0);
|
|
|
150 |
packagesLayout->addWidget(nameEdit, 0, 1);
|
|
|
151 |
packagesLayout->addWidget(dateLabel, 1, 0);
|
|
|
152 |
packagesLayout->addWidget(dateEdit, 1, 1);
|
|
|
153 |
packagesLayout->addWidget(releasesCheckBox, 2, 0);
|
|
|
154 |
packagesLayout->addWidget(upgradesCheckBox, 3, 0);
|
|
|
155 |
packagesLayout->addWidget(hitsSpinBox, 4, 0, 1, 2);
|
|
|
156 |
packagesGroup->setLayout(packagesLayout);
|
|
|
157 |
|
|
|
158 |
QVBoxLayout *mainLayout = new QVBoxLayout;
|
|
|
159 |
mainLayout->addWidget(packagesGroup);
|
|
|
160 |
mainLayout->addSpacing(12);
|
|
|
161 |
mainLayout->addWidget(startQueryButton);
|
|
|
162 |
mainLayout->addStretch(1);
|
|
|
163 |
setLayout(mainLayout);
|
|
|
164 |
}
|