QTfrontend/ui/page/pagenet.cpp
author Wuzzy <Wuzzy2@mail.ru>
Sat, 08 Dec 2018 19:20:57 +0100
changeset 14391 35af3d1ccdfc
parent 12902 fc47fc4af6bd
child 14870 90cf07c60feb
permissions -rw-r--r--
Clarify the buttons in pagenet
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     1
/*
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     2
 * Hedgewars, a free turn based strategy game
11046
47a8c19ecb60 more copyright fixes
sheepluva
parents: 10108
diff changeset
     3
 * Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com>
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     4
 *
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     8
 *
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    12
 * GNU General Public License for more details.
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    13
 *
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
10108
c68cf030eded update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents: 9998
diff changeset
    16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    17
 */
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    18
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    19
#include <QGridLayout>
6171
8627698134b6 fix layout of net page
sheepluva
parents: 6060
diff changeset
    20
#include <QHBoxLayout>
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    21
#include <QPushButton>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    22
#include <QGroupBox>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    23
#include <QTableView>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    24
#include <QMessageBox>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    25
#include <QHeaderView>
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    26
5204
e1a5f4d5d86a split pages.h into several header files
koda
parents: 5078
diff changeset
    27
#include "pagenet.h"
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    28
#include "hwconsts.h"
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    29
#include "netudpwidget.h"
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    30
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
    31
QLayout * PageNet::bodyLayoutDefinition()
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    32
{
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
    33
    QGridLayout * pageLayout = new QGridLayout();
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
    34
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    35
    pageLayout->setColumnStretch(0, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    36
    pageLayout->setColumnStretch(1, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    37
    pageLayout->setColumnStretch(2, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    38
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    39
    ConnGroupBox = new QGroupBox(this);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    40
    ConnGroupBox->setTitle(QGroupBox::tr("Net game"));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    41
    pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    42
    GBClayout = new QGridLayout(ConnGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    43
    GBClayout->setColumnStretch(0, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    44
    GBClayout->setColumnStretch(1, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    45
    GBClayout->setColumnStretch(2, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    46
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    47
    BtnNetConnect = new QPushButton(ConnGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    48
    BtnNetConnect->setFont(*font14);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    49
    BtnNetConnect->setText(QPushButton::tr("Connect"));
14391
35af3d1ccdfc Clarify the buttons in pagenet
Wuzzy <Wuzzy2@mail.ru>
parents: 12902
diff changeset
    50
    BtnNetConnect->setWhatsThis(tr("Connect to the selected server"));
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    51
    GBClayout->addWidget(BtnNetConnect, 2, 2);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    52
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    53
    tvServersList = new QTableView(ConnGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    54
    tvServersList->setSelectionBehavior(QAbstractItemView::SelectRows);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    55
    GBClayout->addWidget(tvServersList, 1, 0, 1, 3);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    56
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    57
    BtnUpdateSList = new QPushButton(ConnGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    58
    BtnUpdateSList->setFont(*font14);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    59
    BtnUpdateSList->setText(QPushButton::tr("Update"));
14391
35af3d1ccdfc Clarify the buttons in pagenet
Wuzzy <Wuzzy2@mail.ru>
parents: 12902
diff changeset
    60
    BtnUpdateSList->setWhatsThis(tr("Update the list of servers"));
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    61
    GBClayout->addWidget(BtnUpdateSList, 2, 0);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    62
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    63
    BtnSpecifyServer = new QPushButton(ConnGroupBox);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    64
    BtnSpecifyServer->setFont(*font14);
14391
35af3d1ccdfc Clarify the buttons in pagenet
Wuzzy <Wuzzy2@mail.ru>
parents: 12902
diff changeset
    65
    BtnSpecifyServer->setText(QPushButton::tr("Specify address"));
35af3d1ccdfc Clarify the buttons in pagenet
Wuzzy <Wuzzy2@mail.ru>
parents: 12902
diff changeset
    66
    BtnSpecifyServer->setWhatsThis(tr("Specify the address and port number of a known server and connect to it directly"));
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    67
    GBClayout->addWidget(BtnSpecifyServer, 2, 1);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    68
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
    69
    return pageLayout;
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
    70
}
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
    71
6171
8627698134b6 fix layout of net page
sheepluva
parents: 6060
diff changeset
    72
QLayout * PageNet::footerLayoutDefinition()
8627698134b6 fix layout of net page
sheepluva
parents: 6060
diff changeset
    73
{
8627698134b6 fix layout of net page
sheepluva
parents: 6060
diff changeset
    74
    QHBoxLayout * footerLayout = new QHBoxLayout();
8627698134b6 fix layout of net page
sheepluva
parents: 6060
diff changeset
    75
8627698134b6 fix layout of net page
sheepluva
parents: 6060
diff changeset
    76
    BtnNetSvrStart = formattedButton(QPushButton::tr("Start server"));
14391
35af3d1ccdfc Clarify the buttons in pagenet
Wuzzy <Wuzzy2@mail.ru>
parents: 12902
diff changeset
    77
    BtnNetSvrStart->setWhatsThis(tr("Start private server"));
11824
7642955690bc Tweak sizes and icons of most footer buttons of frontend
Wuzzy <almikes@aol.com>
parents: 11046
diff changeset
    78
    BtnNetSvrStart->setMinimumSize(180, 50);
8636
fa8cd97a0a09 convert HAVE_NETSERVER to check for file existance, so that it's easier to provide missing servers
koda
parents: 7794
diff changeset
    79
    QString serverPath = bindir->absolutePath() + "/hedgewars-server";
9163
67334acaaac7 port all Q_WS_* to Q_OS_* so that we are forward compatible with Qt5
koda
parents: 9080
diff changeset
    80
#ifdef Q_OS_WIN
8636
fa8cd97a0a09 convert HAVE_NETSERVER to check for file existance, so that it's easier to provide missing servers
koda
parents: 7794
diff changeset
    81
    serverPath += + ".exe";
fa8cd97a0a09 convert HAVE_NETSERVER to check for file existance, so that it's easier to provide missing servers
koda
parents: 7794
diff changeset
    82
#endif
fa8cd97a0a09 convert HAVE_NETSERVER to check for file existance, so that it's easier to provide missing servers
koda
parents: 7794
diff changeset
    83
    QFile server(serverPath);
fa8cd97a0a09 convert HAVE_NETSERVER to check for file existance, so that it's easier to provide missing servers
koda
parents: 7794
diff changeset
    84
    BtnNetSvrStart->setVisible(server.exists());
6171
8627698134b6 fix layout of net page
sheepluva
parents: 6060
diff changeset
    85
8627698134b6 fix layout of net page
sheepluva
parents: 6060
diff changeset
    86
    footerLayout->addStretch();
11824
7642955690bc Tweak sizes and icons of most footer buttons of frontend
Wuzzy <almikes@aol.com>
parents: 11046
diff changeset
    87
    footerLayout->addWidget(BtnNetSvrStart, 0, Qt::AlignBottom);
6171
8627698134b6 fix layout of net page
sheepluva
parents: 6060
diff changeset
    88
8627698134b6 fix layout of net page
sheepluva
parents: 6060
diff changeset
    89
    return footerLayout;
8627698134b6 fix layout of net page
sheepluva
parents: 6060
diff changeset
    90
}
8627698134b6 fix layout of net page
sheepluva
parents: 6060
diff changeset
    91
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
    92
void PageNet::connectSignals()
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
    93
{
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    94
    connect(BtnNetConnect, SIGNAL(clicked()), this, SLOT(slotConnect()));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    95
}
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
    96
6042
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
    97
PageNet::PageNet(QWidget* parent) : AbstractPage(parent)
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
    98
{
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
    99
    initPage();
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
   100
}
8b5345758f62 some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents: 6009
diff changeset
   101
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   102
void PageNet::updateServersList()
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   103
{
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   104
    tvServersList->setModel(new HWNetUdpModel(tvServersList));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   105
12902
fc47fc4af6bd Finish porting. Seems to work, but no thorough testing has been performed
unc0rr
parents: 11824
diff changeset
   106
    tvServersList->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   107
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   108
    static_cast<HWNetServersModel *>(tvServersList->model())->updateList();
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   109
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   110
    connect(BtnUpdateSList, SIGNAL(clicked()), static_cast<HWNetServersModel *>(tvServersList->model()), SLOT(updateList()));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   111
    connect(tvServersList, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotConnect()));
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   112
}
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   113
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   114
void PageNet::slotConnect()
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   115
{
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   116
    HWNetServersModel * model = static_cast<HWNetServersModel *>(tvServersList->model());
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   117
    QModelIndex mi = tvServersList->currentIndex();
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   118
    if(!mi.isValid())
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   119
    {
7794
ab7b94c03bc9 QMessageBox overhaul: unify buttons, style and appearance of info dialogs, fixing a few typos and return values along the way
koda
parents: 6952
diff changeset
   120
        QMessageBox serverMsg(this);
ab7b94c03bc9 QMessageBox overhaul: unify buttons, style and appearance of info dialogs, fixing a few typos and return values along the way
koda
parents: 6952
diff changeset
   121
        serverMsg.setIcon(QMessageBox::Warning);
ab7b94c03bc9 QMessageBox overhaul: unify buttons, style and appearance of info dialogs, fixing a few typos and return values along the way
koda
parents: 6952
diff changeset
   122
        serverMsg.setWindowTitle(QMessageBox::tr("Netgame - Error"));
ab7b94c03bc9 QMessageBox overhaul: unify buttons, style and appearance of info dialogs, fixing a few typos and return values along the way
koda
parents: 6952
diff changeset
   123
        serverMsg.setText(QMessageBox::tr("Please select a server from the list"));
ab7b94c03bc9 QMessageBox overhaul: unify buttons, style and appearance of info dialogs, fixing a few typos and return values along the way
koda
parents: 6952
diff changeset
   124
        serverMsg.setWindowModality(Qt::WindowModal);
ab7b94c03bc9 QMessageBox overhaul: unify buttons, style and appearance of info dialogs, fixing a few typos and return values along the way
koda
parents: 6952
diff changeset
   125
        serverMsg.exec();
5078
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   126
        return;
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   127
    }
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   128
    QString host = model->index(mi.row(), 1).data().toString();
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   129
    quint16 port = model->index(mi.row(), 2).data().toUInt();
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   130
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   131
    emit connectClicked(host, port);
3527f0e7bb21 Removing pages.cpp and splitting it up into various files.
Zorg <zorgiepoo@gmail.com>
parents:
diff changeset
   132
}