Diffstat (limited to 'noncore/comm/keypebble/kvncconndlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/comm/keypebble/kvncconndlg.cpp | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/noncore/comm/keypebble/kvncconndlg.cpp b/noncore/comm/keypebble/kvncconndlg.cpp new file mode 100644 index 0000000..6873feb --- a/dev/null +++ b/noncore/comm/keypebble/kvncconndlg.cpp | |||
@@ -0,0 +1,75 @@ | |||
1 | #include <qframe.h> | ||
2 | #include <qvbox.h> | ||
3 | #include <qcheckbox.h> | ||
4 | #include <qspinbox.h> | ||
5 | #include <qlabel.h> | ||
6 | #include <qlayout.h> | ||
7 | #include <qwhatsthis.h> | ||
8 | #include <qapplication.h> | ||
9 | #include <qlineedit.h> | ||
10 | #include <qpushbutton.h> | ||
11 | #include "krfbserver.h" | ||
12 | |||
13 | #include "kvncconndlg.h" | ||
14 | |||
15 | KVNCConnDlg::KVNCConnDlg( KRFBServer *options, | ||
16 | QWidget *parent, char *name, bool modal ) | ||
17 | : KVNCConnDlgBase( parent, name, modal ) | ||
18 | { | ||
19 | this->options=options; | ||
20 | tmpOptions=*options; | ||
21 | |||
22 | serverHostname->setText(options->hostname); | ||
23 | serverDisplay->setValue(options->display); | ||
24 | serverPassword->setText(options->password); | ||
25 | serverBookmark->setText(options->name); | ||
26 | |||
27 | hex->setChecked( options->hexTile ); | ||
28 | corre->setChecked( options->corre ); | ||
29 | rre->setChecked( options->rre ); | ||
30 | copyRect->setChecked( options->copyrect ); | ||
31 | |||
32 | // TODO | ||
33 | hex->setEnabled( false ); | ||
34 | corre->setEnabled( false ); | ||
35 | rre->setEnabled( false ); | ||
36 | // /TODO | ||
37 | |||
38 | deIconify->setChecked( options->deIconify ); | ||
39 | bit->setChecked( options->colors256 ); | ||
40 | shared->setChecked( options->shared ); | ||
41 | timeBox->setValue( options->updateRate ); | ||
42 | |||
43 | |||
44 | } | ||
45 | |||
46 | KVNCConnDlg::~KVNCConnDlg() | ||
47 | { | ||
48 | } | ||
49 | |||
50 | void KVNCConnDlg::accept() | ||
51 | { | ||
52 | save(); | ||
53 | QDialog::accept(); | ||
54 | } | ||
55 | |||
56 | void KVNCConnDlg::save() | ||
57 | { | ||
58 | tmpOptions.hexTile = hex->isChecked(); | ||
59 | tmpOptions.corre = corre->isChecked(); | ||
60 | tmpOptions.rre = rre->isChecked(); | ||
61 | tmpOptions.copyrect = copyRect->isChecked(); | ||
62 | tmpOptions.deIconify = deIconify->isChecked(); | ||
63 | tmpOptions.colors256 = bit->isChecked(); | ||
64 | tmpOptions.shared = shared->isChecked(); | ||
65 | tmpOptions.hostname = serverHostname->text(); | ||
66 | tmpOptions.password = serverPassword->text(); | ||
67 | tmpOptions.display = serverDisplay->value(); | ||
68 | tmpOptions.name = serverBookmark->text(); | ||
69 | |||
70 | if (!serverBookmark->text().isEmpty()) { | ||
71 | if ( options) { | ||
72 | *options=tmpOptions; | ||
73 | } | ||
74 | } | ||
75 | } | ||