diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-12 20:59:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-12 20:59:16 +0300 |
commit | 6b0ade8b1ba9d9364b889d93c37486a52840031e (patch) | |
tree | a01268d40327f3eef9bab5a52424e6b54559fdc6 /src/gui/windows/serverdialog.cpp | |
parent | 2f768a34f72560ee8b2934228f548a4909533887 (diff) | |
download | mv-6b0ade8b1ba9d9364b889d93c37486a52840031e.tar.gz mv-6b0ade8b1ba9d9364b889d93c37486a52840031e.tar.bz2 mv-6b0ade8b1ba9d9364b889d93c37486a52840031e.tar.xz mv-6b0ade8b1ba9d9364b889d93c37486a52840031e.zip |
Add server info window. For now empty.
Diffstat (limited to 'src/gui/windows/serverdialog.cpp')
-rw-r--r-- | src/gui/windows/serverdialog.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index c447bfc12..9600028b3 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -37,6 +37,7 @@ #include "gui/widgets/desktop.h" #include "gui/windows/editserverdialog.h" #include "gui/windows/logindialog.h" +#include "gui/windows/serverinfowindow.h" #include "gui/widgets/button.h" #include "gui/widgets/label.h" @@ -115,6 +116,8 @@ ServerDialog::ServerDialog(ServerInfo *const serverInfo, mDeleteButton(new Button(this, _("Delete"), "remove", this)), // TRANSLATORS: servers dialog button mLoadButton(new Button(this, _("Load"), "load", this)), + // TRANSLATORS: servers dialog button + mInfoButton(new Button(this, _("Info"), "info", this)), mServersListModel(new ServersListModel(&mServers, this)), mServersList(CREATEWIDGETR(ServersListBox, this, mServersListModel)), mDownload(nullptr), @@ -151,15 +154,16 @@ ServerDialog::ServerDialog(ServerInfo *const serverInfo, mServersList->addSelectionListener(this); usedScroll->setVerticalScrollAmount(0); - place(0, 0, usedScroll, 7, 5).setPadding(3); - place(0, 5, mDescription, 7); - place(0, 6, mPersistentIPCheckBox, 7); - place(0, 7, mAddEntryButton); - place(1, 7, mEditEntryButton); - place(2, 7, mLoadButton); - place(3, 7, mDeleteButton); - place(5, 7, mQuitButton); - place(6, 7, mConnectButton); + place(0, 0, usedScroll, 8, 5).setPadding(3); + place(0, 5, mDescription, 8); + place(0, 6, mPersistentIPCheckBox, 8); + place(0, 7, mInfoButton); + place(1, 7, mAddEntryButton); + place(2, 7, mEditEntryButton); + place(3, 7, mLoadButton); + place(4, 7, mDeleteButton); + place(6, 7, mQuitButton); + place(7, 7, mConnectButton); // Make sure the list has enough height getLayout().setRowHeight(0, 80); @@ -304,6 +308,15 @@ void ServerDialog::action(const ActionEvent &event) saveCustomServers(); } } + else if (eventId == "info") + { + const int index = mServersList->getSelected(); + if (index >= 0) + { + CREATEWIDGET(ServerInfoWindow, + mServers.at(index)); + } + } } void ServerDialog::keyPressed(KeyEvent &event) |