summaryrefslogtreecommitdiffstats
path: root/kbattleship/kbattleship/kserverdialog.cpp
blob: 7fb8a5a121eff35df4556a3bf0e7ed15a2f7a144 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/***************************************************************************
                              kserverdialog.cpp
                             -------------------
    Developers: (c) 2000-2001 Nikolas Zimmermann <wildfox@kde.org>
                (c) 2000-2001 Daniel Molkentin <molkentin@kde.org>

 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include <tdelocale.h>
#include <kuser.h>
#include <tqlayout.h>

#include "kserverdialog.h"

TDEServerDialog::TDEServerDialog(TQWidget *parent, const char *name) : 
	KDialogBase(Plain, i18n("Start Server"), Ok|Cancel, Ok, parent, name, true, false, KGuiItem(i18n("&Start")))
{
	TQFrame* page = plainPage();
	TQGridLayout* pageLayout = new TQGridLayout(page, 1, 1, 0, 0);
	m_mainWidget = new serverStartDlg(page);
	pageLayout->addWidget(m_mainWidget, 0, 0);
	
	KUser u;
	m_mainWidget->nicknameEdit->setText(u.loginName());

	TQString gamename = u.fullName();
	if(gamename.isEmpty()) gamename = u.loginName();
	m_mainWidget->gamenameEdit->setText(gamename);
}

void TDEServerDialog::slotOk()
{
	hide();
	emit okClicked();
}

void TDEServerDialog::slotCancel()
{
	hide();
	emit cancelClicked();
}

TQString TDEServerDialog::port() const
{
	return TQString::number(m_mainWidget->portEdit->value());
}

TQString TDEServerDialog::nickname() const
{
	return m_mainWidget->nicknameEdit->text();
}

TQString TDEServerDialog::gamename() const
{
	return m_mainWidget->gamenameEdit->text();
}

#include "kserverdialog.moc"