Diffstat (limited to 'noncore/comm/keypebble/kvncconndlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/comm/keypebble/kvncconndlg.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/noncore/comm/keypebble/kvncconndlg.cpp b/noncore/comm/keypebble/kvncconndlg.cpp index 6873feb..2f073f8 100644 --- a/noncore/comm/keypebble/kvncconndlg.cpp +++ b/noncore/comm/keypebble/kvncconndlg.cpp | |||
@@ -1,15 +1,16 @@ | |||
1 | #include <qframe.h> | 1 | #include <qframe.h> |
2 | #include <qvbox.h> | 2 | #include <qvbox.h> |
3 | #include <qcheckbox.h> | 3 | #include <qcheckbox.h> |
4 | #include <qcombobox.h> | ||
4 | #include <qspinbox.h> | 5 | #include <qspinbox.h> |
5 | #include <qlabel.h> | 6 | #include <qlabel.h> |
6 | #include <qlayout.h> | 7 | #include <qlayout.h> |
7 | #include <qwhatsthis.h> | 8 | #include <qwhatsthis.h> |
8 | #include <qapplication.h> | 9 | #include <qapplication.h> |
9 | #include <qlineedit.h> | 10 | #include <qlineedit.h> |
10 | #include <qpushbutton.h> | 11 | #include <qpushbutton.h> |
11 | #include "krfbserver.h" | 12 | #include "krfbserver.h" |
12 | 13 | ||
13 | #include "kvncconndlg.h" | 14 | #include "kvncconndlg.h" |
14 | 15 | ||
15 | KVNCConnDlg::KVNCConnDlg( KRFBServer *options, | 16 | KVNCConnDlg::KVNCConnDlg( KRFBServer *options, |
@@ -20,56 +21,74 @@ KVNCConnDlg::KVNCConnDlg( KRFBServer *options, | |||
20 | tmpOptions=*options; | 21 | tmpOptions=*options; |
21 | 22 | ||
22 | serverHostname->setText(options->hostname); | 23 | serverHostname->setText(options->hostname); |
23 | serverDisplay->setValue(options->display); | 24 | serverDisplay->setValue(options->display); |
24 | serverPassword->setText(options->password); | 25 | serverPassword->setText(options->password); |
25 | serverBookmark->setText(options->name); | 26 | serverBookmark->setText(options->name); |
26 | 27 | ||
27 | hex->setChecked( options->hexTile ); | 28 | hex->setChecked( options->hexTile ); |
28 | corre->setChecked( options->corre ); | 29 | corre->setChecked( options->corre ); |
29 | rre->setChecked( options->rre ); | 30 | rre->setChecked( options->rre ); |
30 | copyRect->setChecked( options->copyrect ); | 31 | copyRect->setChecked( options->copyrect ); |
31 | 32 | ||
33 | for (int i=0; i < scaleFactor->count(); ++i) { | ||
34 | if (scaleFactor->text(i).toInt()==tmpOptions.scaleFactor) { | ||
35 | scaleFactor->setCurrentItem(i); | ||
36 | } | ||
37 | } | ||
38 | |||
32 | // TODO | 39 | // TODO |
33 | hex->setEnabled( false ); | 40 | hex->setEnabled( false ); |
34 | corre->setEnabled( false ); | 41 | corre->setEnabled( false ); |
35 | rre->setEnabled( false ); | 42 | rre->setEnabled( false ); |
36 | // /TODO | 43 | // /TODO |
37 | 44 | ||
38 | deIconify->setChecked( options->deIconify ); | 45 | deIconify->setChecked( options->deIconify ); |
39 | bit->setChecked( options->colors256 ); | 46 | bit->setChecked( options->colors256 ); |
40 | shared->setChecked( options->shared ); | 47 | shared->setChecked( options->shared ); |
41 | timeBox->setValue( options->updateRate ); | 48 | timeBox->setValue( options->updateRate ); |
42 | 49 | ||
50 | serverPassword->setEchoMode(QLineEdit::Password); | ||
43 | 51 | ||
44 | } | 52 | connect(togglePassword, SIGNAL( stateChanged(int) ), this, SLOT( showPassword(int) ) ); |
45 | 53 | ||
54 | |||
55 | } | ||
46 | KVNCConnDlg::~KVNCConnDlg() | 56 | KVNCConnDlg::~KVNCConnDlg() |
47 | { | 57 | { |
48 | } | 58 | } |
49 | 59 | ||
50 | void KVNCConnDlg::accept() | 60 | void KVNCConnDlg::accept() |
51 | { | 61 | { |
52 | save(); | 62 | save(); |
53 | QDialog::accept(); | 63 | QDialog::accept(); |
54 | } | 64 | } |
55 | 65 | ||
56 | void KVNCConnDlg::save() | 66 | void KVNCConnDlg::save() |
57 | { | 67 | { |
58 | tmpOptions.hexTile = hex->isChecked(); | 68 | tmpOptions.hexTile = hex->isChecked(); |
59 | tmpOptions.corre = corre->isChecked(); | 69 | tmpOptions.corre = corre->isChecked(); |
60 | tmpOptions.rre = rre->isChecked(); | 70 | tmpOptions.rre = rre->isChecked(); |
61 | tmpOptions.copyrect = copyRect->isChecked(); | 71 | tmpOptions.copyrect = copyRect->isChecked(); |
62 | tmpOptions.deIconify = deIconify->isChecked(); | 72 | tmpOptions.deIconify = deIconify->isChecked(); |
63 | tmpOptions.colors256 = bit->isChecked(); | 73 | tmpOptions.colors256 = bit->isChecked(); |
64 | tmpOptions.shared = shared->isChecked(); | 74 | tmpOptions.shared = shared->isChecked(); |
65 | tmpOptions.hostname = serverHostname->text(); | 75 | tmpOptions.hostname = serverHostname->text(); |
66 | tmpOptions.password = serverPassword->text(); | 76 | tmpOptions.password = serverPassword->text(); |
67 | tmpOptions.display = serverDisplay->value(); | 77 | tmpOptions.display = serverDisplay->value(); |
68 | tmpOptions.name = serverBookmark->text(); | 78 | tmpOptions.name = serverBookmark->text(); |
79 | tmpOptions.scaleFactor = scaleFactor->currentText().toInt(); | ||
69 | 80 | ||
70 | if (!serverBookmark->text().isEmpty()) { | 81 | if (!serverBookmark->text().isEmpty()) { |
71 | if ( options) { | 82 | if ( options) { |
72 | *options=tmpOptions; | 83 | *options=tmpOptions; |
73 | } | 84 | } |
74 | } | 85 | } |
75 | } | 86 | } |
87 | |||
88 | void KVNCConnDlg::showPassword(int show) | ||
89 | { | ||
90 | if (show) | ||
91 | serverPassword->setEchoMode(QLineEdit::Normal); | ||
92 | else | ||
93 | serverPassword->setEchoMode(QLineEdit::Password); | ||
94 | } | ||