QTfrontend/pagenetserver.cpp
changeset 6042 8b5345758f62
parent 6009 14f6fc9869f2
equal deleted inserted replaced
6040:a740069c21e3 6042:8b5345758f62
    15  * along with this program; if not, write to the Free Software
    15  * along with this program; if not, write to the Free Software
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17  */
    17  */
    18 
    18 
    19 #include <QGridLayout>
    19 #include <QGridLayout>
       
    20 #include <QHBoxLayout>
       
    21 #include <QVBoxLayout>
    20 #include <QPushButton>
    22 #include <QPushButton>
    21 #include <QGroupBox>
    23 #include <QGroupBox>
    22 #include <QLabel>
    24 #include <QLabel>
    23 #include <QLineEdit>
    25 #include <QLineEdit>
    24 #include <QSpinBox>
    26 #include <QSpinBox>
    25 
    27 
    26 #include "pagenetserver.h"
    28 #include "pagenetserver.h"
    27 
    29 
    28 PageNetServer::PageNetServer(QWidget* parent) : AbstractPage(parent)
    30 QLayout * PageNetServer::bodyLayoutDefinition()
    29 {
    31 {
    30     QFont * font14 = new QFont("MS Shell Dlg", 14);
    32     QVBoxLayout * pageLayout = new QVBoxLayout();
    31     QGridLayout * pageLayout = new QGridLayout(this);
       
    32     pageLayout->setColumnStretch(0, 1);
       
    33     pageLayout->setColumnStretch(1, 1);
       
    34     pageLayout->setColumnStretch(2, 1);
       
    35 
       
    36     pageLayout->setRowStretch(0, 1);
       
    37     pageLayout->setRowStretch(1, 0);
       
    38 
       
    39 
       
    40     BtnBack =addButton(":/res/Exit.png", pageLayout, 1, 0, true);
       
    41     connect(BtnBack, SIGNAL(clicked()), this, SIGNAL(goBack()));
       
    42 
       
    43 
       
    44     BtnStart = new QPushButton(this);
       
    45     BtnStart->setFont(*font14);
       
    46     BtnStart->setText(QPushButton::tr("Start"));
       
    47     pageLayout->addWidget(BtnStart, 1, 2);
       
    48 
    33 
    49     QWidget * wg = new QWidget(this);
    34     QWidget * wg = new QWidget(this);
    50     pageLayout->addWidget(wg, 0, 0, 1, 3);
    35     pageLayout->addWidget(wg);
    51 
    36 
    52     QGridLayout * wgLayout = new QGridLayout(wg);
    37     QGridLayout * wgLayout = new QGridLayout(wg);
    53     wgLayout->setColumnStretch(0, 1);
    38     wgLayout->setColumnStretch(0, 1);
    54     wgLayout->setColumnStretch(1, 3);
    39     wgLayout->setColumnStretch(1, 3);
    55     wgLayout->setColumnStretch(2, 1);
    40     wgLayout->setColumnStretch(2, 1);
    80 
    65 
    81     BtnDefault = new QPushButton(gb);
    66     BtnDefault = new QPushButton(gb);
    82     BtnDefault->setText(QPushButton::tr("default"));
    67     BtnDefault->setText(QPushButton::tr("default"));
    83     gbLayout->addWidget(BtnDefault, 1, 2);
    68     gbLayout->addWidget(BtnDefault, 1, 2);
    84 
    69 
       
    70     return pageLayout;
       
    71 }
       
    72 
       
    73 QLayout * PageNetServer::footerLayoutDefinition()
       
    74 {
       
    75     QHBoxLayout * bottomLayout = new QHBoxLayout();
       
    76 
       
    77     BtnStart = new QPushButton(this);
       
    78     BtnStart->setFont(*font14);
       
    79     BtnStart->setText(QPushButton::tr("Start"));
       
    80 
       
    81     bottomLayout->addStretch();
       
    82     bottomLayout->addWidget(BtnStart);
       
    83 
       
    84     return bottomLayout;
       
    85 }
       
    86 
       
    87 void PageNetServer::connectSignals()
       
    88 {
    85     connect(BtnDefault, SIGNAL(clicked()), this, SLOT(setDefaultPort()));
    89     connect(BtnDefault, SIGNAL(clicked()), this, SLOT(setDefaultPort()));
       
    90 }
       
    91 
       
    92 PageNetServer::PageNetServer(QWidget* parent) : AbstractPage(parent)
       
    93 {
       
    94     initPage();
    86 }
    95 }
    87 
    96 
    88 void PageNetServer::setDefaultPort()
    97 void PageNetServer::setDefaultPort()
    89 {
    98 {
    90     sbPort->setValue(46631);
    99     sbPort->setValue(46631);