Diffstat (limited to 'noncore/net/opieirc/ircservereditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircservereditor.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircservereditor.cpp b/noncore/net/opieirc/ircservereditor.cpp index 60274d1..2d11bf0 100644 --- a/noncore/net/opieirc/ircservereditor.cpp +++ b/noncore/net/opieirc/ircservereditor.cpp | |||
@@ -1,17 +1,22 @@ | |||
1 | #include "ircservereditor.h" | ||
2 | |||
3 | /* OPIE */ | ||
4 | #include <qpe/qpeapplication.h> | ||
5 | |||
6 | /* QT */ | ||
1 | #include <qmessagebox.h> | 7 | #include <qmessagebox.h> |
2 | #include <qlayout.h> | 8 | #include <qlayout.h> |
3 | #include <qlabel.h> | 9 | #include <qlabel.h> |
4 | #include <qwhatsthis.h> | 10 | #include <qwhatsthis.h> |
5 | #include "ircservereditor.h" | ||
6 | 11 | ||
7 | IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) { | 12 | IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) { |
8 | QGridLayout *layout = new QGridLayout(this, 7, 2, 5, 5); | 13 | QGridLayout *layout = new QGridLayout(this, 7, 2, 5, 5); |
9 | QLabel *label = new QLabel(tr("Profile name :"), this); | 14 | QLabel *label = new QLabel(tr("Profile name :"), this); |
10 | m_name = new QLineEdit(server.name(), this); | 15 | m_name = new QLineEdit(server.name(), this); |
11 | QWhatsThis::add(m_name, tr("The name of this server profile in the overview")); | 16 | QWhatsThis::add(m_name, tr("The name of this server profile in the overview")); |
12 | layout->addWidget(label, 0, 0); | 17 | layout->addWidget(label, 0, 0); |
13 | layout->addWidget(m_name, 0, 1); | 18 | layout->addWidget(m_name, 0, 1); |
14 | label = new QLabel(tr("Hostname :"), this); | 19 | label = new QLabel(tr("Hostname :"), this); |
15 | m_hostname = new QLineEdit(server.hostname(), this); | 20 | m_hostname = new QLineEdit(server.hostname(), this); |
16 | QWhatsThis::add(m_hostname, tr("The server to connect to - can be any valid host name or IP address")); | 21 | QWhatsThis::add(m_hostname, tr("The server to connect to - can be any valid host name or IP address")); |
17 | layout->addWidget(label, 1, 0); | 22 | layout->addWidget(label, 1, 0); |
@@ -34,25 +39,26 @@ IRCServerEditor::IRCServerEditor(IRCServer server, QWidget* parent, const char* | |||
34 | label = new QLabel(tr("Password :"), this); | 39 | label = new QLabel(tr("Password :"), this); |
35 | m_password = new QLineEdit(server.password(), this); | 40 | m_password = new QLineEdit(server.password(), this); |
36 | m_password->setEchoMode( QLineEdit::Password ); | 41 | m_password->setEchoMode( QLineEdit::Password ); |
37 | QWhatsThis::add(m_password, tr("Password to connect to the server (if required)")); | 42 | QWhatsThis::add(m_password, tr("Password to connect to the server (if required)")); |
38 | layout->addWidget(label, 5, 0); | 43 | layout->addWidget(label, 5, 0); |
39 | layout->addWidget(m_password, 5, 1); | 44 | layout->addWidget(m_password, 5, 1); |
40 | label = new QLabel(tr("Channels :"), this); | 45 | label = new QLabel(tr("Channels :"), this); |
41 | m_channels = new QLineEdit(server.channels(), this); | 46 | m_channels = new QLineEdit(server.channels(), this); |
42 | QWhatsThis::add(m_channels, tr("Comma-Separated list of all channels you would like to join automatically")); | 47 | QWhatsThis::add(m_channels, tr("Comma-Separated list of all channels you would like to join automatically")); |
43 | layout->addWidget(label, 6, 0); | 48 | layout->addWidget(label, 6, 0); |
44 | layout->addWidget(m_channels, 6, 1); | 49 | layout->addWidget(m_channels, 6, 1); |
45 | setCaption(tr("Edit server information")); | 50 | setCaption(tr("Edit server information")); |
46 | showMaximized(); | 51 | |
52 | QPEApplication::showDialog( this ); | ||
47 | } | 53 | } |
48 | 54 | ||
49 | 55 | ||
50 | void IRCServerEditor::accept() { | 56 | void IRCServerEditor::accept() { |
51 | if (m_name->text().length()==0) | 57 | if (m_name->text().length()==0) |
52 | QMessageBox::critical(this, tr("Error"), tr("Profile name required")); | 58 | QMessageBox::critical(this, tr("Error"), tr("Profile name required")); |
53 | else if (m_hostname->text().length()==0) | 59 | else if (m_hostname->text().length()==0) |
54 | QMessageBox::critical(this, tr("Error"), tr("Host name required")); | 60 | QMessageBox::critical(this, tr("Error"), tr("Host name required")); |
55 | else if (m_port->text().toInt()<=0) | 61 | else if (m_port->text().toInt()<=0) |
56 | QMessageBox::critical(this, tr("Error"), tr("Port required")); | 62 | QMessageBox::critical(this, tr("Error"), tr("Port required")); |
57 | else if (m_nickname->text().length()==0) | 63 | else if (m_nickname->text().length()==0) |
58 | QMessageBox::critical(this, tr("Error"), tr("Nickname required")); | 64 | QMessageBox::critical(this, tr("Error"), tr("Nickname required")); |