summaryrefslogtreecommitdiff
path: root/src/gui/serverdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-07 22:09:11 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-07 22:09:11 +0300
commitb7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2 (patch)
treeee27a5a1ace7e5dbc588466dc623013e4d5cea99 /src/gui/serverdialog.cpp
parent7d3059516fc25134d0d29b497e546f2846162399 (diff)
downloadmv-b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2.tar.gz
mv-b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2.tar.bz2
mv-b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2.tar.xz
mv-b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2.zip
Improve constructors in some classes.
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r--src/gui/serverdialog.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 0104e2aa5..472d01223 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -243,12 +243,23 @@ private:
ServerDialog::ServerDialog(ServerInfo *const serverInfo,
const std::string &dir) :
Window(_("Choose Your Server"), false, nullptr, "server.xml"),
+ ActionListener(),
+ KeyListener(),
+ SelectionListener(),
+ mDescription(new Label(std::string())),
+ mQuitButton(new Button(_("Quit"), "quit", this)),
+ mConnectButton(new Button(_("Connect"), "connect", this)),
+ mAddEntryButton(new Button(_("Add"), "addEntry", this)),
+ mEditEntryButton(new Button(_("Edit"), "editEntry", this)),
+ mDeleteButton(new Button(_("Delete"), "remove", this)),
+ mLoadButton(new Button(_("Load"), "load", this)),
+ mServers(ServerInfos()),
+ mServersListModel(new ServersListModel(&mServers, this)),
+ mServersList(new ServersListBox(mServersListModel)),
mDir(dir),
-// mDownloadStatus(DOWNLOADING_PREPARING),
mDownloadStatus(DOWNLOADING_UNKNOWN),
mDownload(nullptr),
mDownloadProgress(-1.0f),
- mServers(ServerInfos()),
mServerInfo(serverInfo),
mPersistentIPCheckBox(nullptr)
{
@@ -263,29 +274,16 @@ ServerDialog::ServerDialog(ServerInfo *const serverInfo,
loadCustomServers();
- mServersListModel = new ServersListModel(&mServers, this);
-
- mServersList = new ServersListBox(mServersListModel);
mServersList->addMouseListener(this);
ScrollArea *const usedScroll = new ScrollArea(mServersList,
getOptionBool("showbackground"), "server_background.xml");
usedScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
- const int n = 0;
-
- mDescription = new Label(std::string());
-
- mQuitButton = new Button(_("Quit"), "quit", this);
- mLoadButton = new Button(_("Load"), "load", this);
- mConnectButton = new Button(_("Connect"), "connect", this);
- mAddEntryButton = new Button(_("Add"), "addEntry", this);
- mEditEntryButton = new Button(_("Edit"), "editEntry", this);
- mDeleteButton = new Button(_("Delete"), "remove", this);
-
mServersList->addSelectionListener(this);
usedScroll->setVerticalScrollAmount(0);
+ const int n = 0;
place(0, 0 + n, usedScroll, 7, 5).setPadding(3);
place(0, 5 + n, mDescription, 7);
place(0, 6 + n, mPersistentIPCheckBox, 7);