Diffstat (limited to 'noncore/comm/keypebble/kvncconndlg.cpp') (more/less context) (show 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,9 +1,10 @@ | |||
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> |
@@ -26,26 +27,35 @@ KVNCConnDlg::KVNCConnDlg( KRFBServer *options, | |||
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); | ||
51 | |||
52 | connect(togglePassword, SIGNAL( stateChanged(int) ), this, SLOT( showPassword(int) ) ); | ||
43 | 53 | ||
44 | } | ||
45 | 54 | ||
55 | } | ||
46 | KVNCConnDlg::~KVNCConnDlg() | 56 | KVNCConnDlg::~KVNCConnDlg() |
47 | { | 57 | { |
48 | } | 58 | } |
49 | 59 | ||
50 | void KVNCConnDlg::accept() | 60 | void KVNCConnDlg::accept() |
51 | { | 61 | { |
@@ -63,13 +73,22 @@ void KVNCConnDlg::save() | |||
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 | } | ||