author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /noncore/comm/keypebble/kvncconnectdlg.cpp | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
Diffstat (limited to 'noncore/comm/keypebble/kvncconnectdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/comm/keypebble/kvncconnectdlg.cpp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/noncore/comm/keypebble/kvncconnectdlg.cpp b/noncore/comm/keypebble/kvncconnectdlg.cpp new file mode 100644 index 0000000..467cebf --- a/dev/null +++ b/noncore/comm/keypebble/kvncconnectdlg.cpp | |||
@@ -0,0 +1,79 @@ | |||
1 | #include <qstring.h> | ||
2 | #include <qlayout.h> | ||
3 | #include <qframe.h> | ||
4 | #include <qspinbox.h> | ||
5 | #include <qcombobox.h> | ||
6 | #include <qlabel.h> | ||
7 | #include <qfont.h> | ||
8 | |||
9 | #include <assert.h> | ||
10 | |||
11 | #include "krfbconnection.h" | ||
12 | #include "kvncoptionsdlg.h" | ||
13 | #include "kvncconnectdlg.h" | ||
14 | |||
15 | |||
16 | KVNCConnectDlg::KVNCConnectDlg( KRFBConnection *con, | ||
17 | QWidget *parent, const char *name ) | ||
18 | : QDialog( parent, name, true ) | ||
19 | { | ||
20 | setCaption( tr("Connect to VNC server") ); | ||
21 | assert( con ); | ||
22 | this->con = con; | ||
23 | |||
24 | QGridLayout *inner = new QGridLayout( this, 3, 2, 6 ); | ||
25 | |||
26 | QLabel *label = new QLabel( tr("Host Name:"), | ||
27 | this , "hostLabel"); | ||
28 | hostNameCombo = new QComboBox( true, this ); | ||
29 | hostNameCombo->setInsertionPolicy( QComboBox::AtTop ); | ||
30 | hostNameCombo->setMaxCount( 10 ); | ||
31 | hostNameCombo->insertItem( "localhost" ); | ||
32 | hostNameCombo->setFocus(); | ||
33 | |||
34 | inner->addWidget( label, 0, 0 ); | ||
35 | inner->addWidget( hostNameCombo, 0, 1 ); | ||
36 | |||
37 | label = new QLabel( tr("Display Number:"), this, "displayNumber" ); | ||
38 | displayNumberEdit = new QSpinBox( this ); | ||
39 | |||
40 | inner->addWidget( label, 1, 0 ); | ||
41 | inner->addWidget( displayNumberEdit, 1, 1 ); | ||
42 | |||
43 | // if ( viewer->display() != -1 ) { | ||
44 | // displayNumberEdit->setValue( viewer->display() ); | ||
45 | displayNumberEdit->setValue( 1 ); | ||
46 | // } | ||
47 | |||
48 | label = new QLabel( tr("Password:"), this ); | ||
49 | inner->addWidget( label, 2, 0 ); | ||
50 | |||
51 | passwordEdit = new QLineEdit( this ); | ||
52 | passwordEdit->setEchoMode( QLineEdit::Password ); | ||
53 | inner->addWidget( passwordEdit, 2, 1 ); | ||
54 | |||
55 | inner->setColStretch( 0, 0 ); | ||
56 | inner->setColStretch( 1, 15 ); | ||
57 | } | ||
58 | |||
59 | |||
60 | void KVNCConnectDlg::accept() | ||
61 | { | ||
62 | int dis; | ||
63 | // viewer->setHost(hostNameCombo->currentText()); | ||
64 | QString temp = displayNumberEdit->text(); | ||
65 | if(temp.isEmpty()) | ||
66 | dis = -1; | ||
67 | else | ||
68 | dis = temp.toUInt(); | ||
69 | // viewer->setDisplay(dis); | ||
70 | QDialog::accept(); | ||
71 | } | ||
72 | |||
73 | void KVNCConnectDlg::options() | ||
74 | { | ||
75 | KVNCOptionsDlg *wdg = new KVNCOptionsDlg( con->options(), this ); | ||
76 | wdg->exec(); | ||
77 | delete wdg; | ||
78 | } | ||
79 | |||