QTfrontend/ui/page/pagefeedback.cpp
author valnut
Sat, 14 Jan 2012 05:05:53 +0100
changeset 6561 b2165583cdf5
child 6616 f77bb02b669f
permissions -rw-r--r--
GCI task: feedback is important
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6561
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
     1
/*
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
     2
 * Hedgewars, a free turn based strategy game
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
     3
 * Copyright (c) 2006-2011 Andrey Korotaev <unC0Rr@gmail.com>
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
     4
 *
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
     8
 *
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    12
 * GNU General Public License for more details.
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    13
 *
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    17
 */
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    18
 
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    19
#include <QHBoxLayout>
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    20
#include <QLineEdit>
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    21
#include <QTextBrowser>
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    22
#include <QLabel>
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    23
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    24
#include "pagefeedback.h"
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    25
#include "hwconsts.h"
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    26
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    27
QLayout * PageFeedback::bodyLayoutDefinition()
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    28
{
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    29
    QVBoxLayout * pageLayout = new QVBoxLayout();
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    30
    QHBoxLayout * summaryLayout = new QHBoxLayout();
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    31
    
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    32
    info = new QLabel();
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    33
    info->setText(
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    34
            "<style type=\"text/css\">"
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    35
            "a { color: #ffcc00; }"
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    36
            "</style>"
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    37
            "<div align=\"center\"><h1>Please give us a feedback!</h1>"
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    38
            "<h3>We are always happy about suggestions, ideas or bug reports.<h3>"
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    39
	    "<h4>The feedback will be posted as a new issue on our Google Code page.<h4>"
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    40
            "</div>"
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    41
            );
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    42
    pageLayout->addWidget(info);
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    43
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    44
    label_summary = new QLabel();
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    45
    label_summary->setText(QLabel::tr("Summary   "));
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    46
    summaryLayout->addWidget(label_summary);
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    47
    summary = new QLineEdit();
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    48
    summaryLayout->addWidget(summary);
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    49
    pageLayout->addLayout(summaryLayout);
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    50
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    51
    label_description = new QLabel();
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    52
    label_description->setText(QLabel::tr("Description"));
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    53
    pageLayout->addWidget(label_description, 0, Qt::AlignHCenter);
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    54
    description = new QTextBrowser();
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    55
    description->setReadOnly(false);
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    56
    pageLayout->addWidget(description);
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    57
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    58
    return pageLayout;
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    59
}
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    60
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    61
QLayout * PageFeedback::footerLayoutDefinition()
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    62
{
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    63
    QHBoxLayout * bottomLayout = new QHBoxLayout();
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    64
    
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    65
    bottomLayout->setStretch(0,1);
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    66
    //TODO: create logo for send button
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    67
    BtnSend = addButton("Send", bottomLayout, 0, false);
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    68
    bottomLayout->insertStretch(0);
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    69
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    70
    return bottomLayout;
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    71
}
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    72
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    73
void PageFeedback::connectSignals()
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    74
{
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    75
    //TODO
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    76
}
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    77
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    78
PageFeedback::PageFeedback(QWidget* parent) : AbstractPage(parent)
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    79
{
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    80
    initPage();
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    81
b2165583cdf5 GCI task: feedback is important
valnut
parents:
diff changeset
    82
}