-rw-r--r-- | noncore/net/opierdesktop/qtwin.cpp | 21 | ||||
-rw-r--r-- | noncore/net/opierdesktop/qtwin.h | 6 |
2 files changed, 5 insertions, 22 deletions
diff --git a/noncore/net/opierdesktop/qtwin.cpp b/noncore/net/opierdesktop/qtwin.cpp index 181d275..54a5a03 100644 --- a/noncore/net/opierdesktop/qtwin.cpp +++ b/noncore/net/opierdesktop/qtwin.cpp | |||
@@ -177,23 +177,12 @@ QMyDialog::QMyDialog(QWidget* parent) : QDialog(parent, "Settings", true) | |||
177 | connect(RemoveButton, SIGNAL(clicked()), this, SLOT(RemoveClicked())); | 177 | connect(RemoveButton, SIGNAL(clicked()), this, SLOT(RemoveClicked())); |
178 | // full screen check box | 178 | // full screen check box |
179 | FullScreenCheckBox = new QCheckBox(this, "Full Screen"); | 179 | FullScreenCheckBox = new QCheckBox(this, "Full Screen"); |
180 | FullScreenCheckBox->setText("Full Screen"); | 180 | FullScreenCheckBox->setText("Full Screen"); |
181 | FullScreenCheckBox->move(10, 230); | 181 | FullScreenCheckBox->move(10, 230); |
182 | // ok button | 182 | // ok button |
183 | OKButton = new QPushButton(this); | ||
184 | OKButton->setText("OK"); | ||
185 | OKButton->move(100, 240); | ||
186 | OKButton->resize(50, 20); | ||
187 | connect(OKButton, SIGNAL(clicked()), this, SLOT(OKClicked())); | ||
188 | // cancel button | ||
189 | CancelButton = new QPushButton(this); | ||
190 | CancelButton->setText("Cancel"); | ||
191 | CancelButton->move(160, 240); | ||
192 | CancelButton->resize(50, 20); | ||
193 | connect(CancelButton, SIGNAL(clicked()), this, SLOT(CancelClicked())); | ||
194 | 183 | ||
195 | for (i = 0; i < 10; i++) | 184 | for (i = 0; i < 10; i++) |
196 | { | 185 | { |
197 | ConnectionList[i] = new QMyConnectionItem; | 186 | ConnectionList[i] = new QMyConnectionItem; |
198 | ConnectionList[i]->ServerName = ""; | 187 | ConnectionList[i]->ServerName = ""; |
199 | ConnectionList[i]->UserName = ""; | 188 | ConnectionList[i]->UserName = ""; |
@@ -274,29 +263,25 @@ void QMyDialog::ComboChanged(int index) | |||
274 | WidthEdit->setText("800"); | 263 | WidthEdit->setText("800"); |
275 | HeightEdit->setText("600"); | 264 | HeightEdit->setText("600"); |
276 | } | 265 | } |
277 | } | 266 | } |
278 | 267 | ||
279 | //***************************************************************************** | 268 | //***************************************************************************** |
280 | void QMyDialog::OKClicked() | 269 | void QMyDialog::accept() |
281 | { | 270 | { |
282 | ServerName = ServerNameEdit->text(); | 271 | ServerName = ServerNameEdit->text(); |
283 | UserName = UserNameEdit->text(); | 272 | UserName = UserNameEdit->text(); |
284 | Width = WidthEdit->text().toInt(); | 273 | Width = WidthEdit->text().toInt(); |
285 | Height = HeightEdit->text().toInt(); | 274 | Height = HeightEdit->text().toInt(); |
286 | ServerIP = IPEdit->text(); | 275 | ServerIP = IPEdit->text(); |
287 | FullScreen = FullScreenCheckBox->isChecked(); | 276 | FullScreen = FullScreenCheckBox->isChecked(); |
288 | done(1); | ||
289 | } | ||
290 | 277 | ||
291 | //***************************************************************************** | 278 | QDialog::accept(); |
292 | void QMyDialog::CancelClicked() | ||
293 | { | ||
294 | done(0); | ||
295 | } | 279 | } |
296 | 280 | ||
281 | |||
297 | //***************************************************************************** | 282 | //***************************************************************************** |
298 | void QMyDialog::AddClicked() | 283 | void QMyDialog::AddClicked() |
299 | { | 284 | { |
300 | int i; | 285 | int i; |
301 | QMyConnectionItem* Item; | 286 | QMyConnectionItem* Item; |
302 | 287 | ||
diff --git a/noncore/net/opierdesktop/qtwin.h b/noncore/net/opierdesktop/qtwin.h index 38ad190..7a2110b 100644 --- a/noncore/net/opierdesktop/qtwin.h +++ b/noncore/net/opierdesktop/qtwin.h | |||
@@ -25,14 +25,12 @@ class QMyDialog: public QDialog | |||
25 | Q_OBJECT | 25 | Q_OBJECT |
26 | public: | 26 | public: |
27 | QMyDialog(QWidget*); | 27 | QMyDialog(QWidget*); |
28 | ~QMyDialog(); | 28 | ~QMyDialog(); |
29 | public: | 29 | public: |
30 | QListBox* ListBox; | 30 | QListBox* ListBox; |
31 | QPushButton* OKButton; | ||
32 | QPushButton* CancelButton; | ||
33 | QLabel* Label1; | 31 | QLabel* Label1; |
34 | QLineEdit* ServerNameEdit; | 32 | QLineEdit* ServerNameEdit; |
35 | QLabel* Label2; | 33 | QLabel* Label2; |
36 | QLineEdit* UserNameEdit; | 34 | QLineEdit* UserNameEdit; |
37 | QLabel* Label3; | 35 | QLabel* Label3; |
38 | QLineEdit* IPEdit; | 36 | QLineEdit* IPEdit; |
@@ -43,14 +41,12 @@ class QMyDialog: public QDialog | |||
43 | QPushButton* EditButton; | 41 | QPushButton* EditButton; |
44 | QPushButton* SaveButton; | 42 | QPushButton* SaveButton; |
45 | QPushButton* RemoveButton; | 43 | QPushButton* RemoveButton; |
46 | QCheckBox* FullScreenCheckBox; | 44 | QCheckBox* FullScreenCheckBox; |
47 | public slots: | 45 | public slots: |
48 | void ComboChanged(int); | 46 | void ComboChanged(int); |
49 | void OKClicked(); | ||
50 | void CancelClicked(); | ||
51 | void AddClicked(); | 47 | void AddClicked(); |
52 | void EditClicked(); | 48 | void EditClicked(); |
53 | void SaveClicked(); | 49 | void SaveClicked(); |
54 | void RemoveClicked(); | 50 | void RemoveClicked(); |
55 | void ListBoxChanged(); | 51 | void ListBoxChanged(); |
56 | void ListBoxSelected(int); | 52 | void ListBoxSelected(int); |
@@ -59,12 +55,14 @@ class QMyDialog: public QDialog | |||
59 | QString UserName; | 55 | QString UserName; |
60 | QString ServerIP; | 56 | QString ServerIP; |
61 | int Width; | 57 | int Width; |
62 | int Height; | 58 | int Height; |
63 | int FullScreen; | 59 | int FullScreen; |
64 | QMyConnectionItem* ConnectionList[10]; | 60 | QMyConnectionItem* ConnectionList[10]; |
61 | protected slots: | ||
62 | void accept(); | ||
65 | }; | 63 | }; |
66 | 64 | ||
67 | class QMyScrollView: public QScrollView | 65 | class QMyScrollView: public QScrollView |
68 | { | 66 | { |
69 | Q_OBJECT | 67 | Q_OBJECT |
70 | public: | 68 | public: |