1
/* This file is part of kdesdk / KBugBuster.
3
Copyright 2008 KBugBuster Authors <kde-ev-board@kde.org>
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public License as
7
published by the Free Software Foundation; either version 2 of
8
the License or (at your option) version 3 or any later version
9
accepted by the membership of KDE e.V. (or its successor approved
10
by the membership of KDE e.V.), which shall act as a proxy
11
defined in Section 14 of version 3 of the license.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License
19
along with this program. If not, see <http://www.gnu.org/licenses/>.
1
21
#include "serverconfigdialog.h"
3
#include "bugserverconfig.h"
28
#include <QGridLayout>
30
#include <klineedit.h>
7
32
#include <klocale.h>
10
#include <qlineedit.h>
13
#include <qcombobox.h>
15
ServerConfigDialog::ServerConfigDialog( QWidget *parent, const char *name ) :
16
KDialogBase( parent, name, true, i18n("Edit Bugzilla Server"), Ok|Cancel )
34
#include "bugserverconfig.h"
37
ServerConfigDialog::ServerConfigDialog( QWidget *parent) :
18
QWidget *topFrame = makeMainWidget();
40
setCaption( i18n("Edit Bugzilla Server") );
41
setButtons( Ok|Cancel );
42
setDefaultButton( Ok );
45
QWidget *topFrame = new QWidget( this );
46
setMainWidget( topFrame );
20
48
QGridLayout *topLayout = new QGridLayout( topFrame );
21
49
topLayout->setSpacing( spacingHint() );
25
53
mServerName = new QLineEdit( topFrame );
26
label = new QLabel( mServerName, i18n("Name:"), topFrame );
54
label = new QLabel( i18n("Name:"), topFrame );
55
label->setBuddy( mServerName );
27
56
topLayout->addWidget( label, 0, 0 );
28
57
topLayout->addWidget( mServerName, 0, 1 );
29
58
mServerName->setFocus();
31
60
mServerUrl = new QLineEdit( topFrame );
32
label = new QLabel( mServerUrl, i18n("URL:"), topFrame );
61
label = new QLabel( i18n("URL:"), topFrame );
62
label->setBuddy( mServerUrl );
33
63
topLayout->addWidget( label, 1, 0 );
34
64
topLayout->addWidget( mServerUrl, 1, 1 );
36
66
mUser = new QLineEdit( topFrame );
37
label = new QLabel( mUser, i18n("User:"), topFrame );
67
label = new QLabel( i18n("User:"), topFrame );
68
label->setBuddy( mUser );
38
69
topLayout->addWidget( label, 2, 0 );
39
70
topLayout->addWidget( mUser, 2, 1 );
41
mPassword = new KPasswordEdit( topFrame );
42
label = new QLabel( mPassword, i18n("Password:"), topFrame );
72
mPassword = new KLineEdit( topFrame );
73
mPassword->setPasswordMode(true);
74
label = new QLabel( i18n("Password:"), topFrame );
75
label->setBuddy( mPassword );
43
76
topLayout->addWidget( label, 3, 0 );
44
77
topLayout->addWidget( mPassword, 3, 1 );
46
79
mVersion = new QComboBox( topFrame );
47
label = new QLabel( mVersion, i18n("Bugzilla version:"), topFrame );
80
label = new QLabel( i18n("Bugzilla version:"), topFrame );
81
label->setBuddy( mVersion );
48
82
topLayout->addWidget( label, 4, 0 );
49
83
topLayout->addWidget( mVersion, 4, 1 );
50
mVersion->insertStringList( BugServerConfig::bugzillaVersions() );
84
mVersion->addItems( BugServerConfig::bugzillaVersions() );
53
87
void ServerConfigDialog::setServerConfig( const BugServerConfig &cfg )