3 * Copyright 2014-2015 Roy Marples <roy@marples.name>
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 #include <QHBoxLayout>
32 #include <QPushButton>
33 #include <QSpacerItem>
34 #include <QVBoxLayout>
37 #include "dhcpcd-about.h"
38 #include "dhcpcd-qt.h"
40 DhcpcdAbout::DhcpcdAbout(DhcpcdQt *parent)
43 this->parent = parent;
46 setWindowIcon(DhcpcdQt::getIcon("status", "network-transmit-receive"));
47 setWindowTitle(tr("About Network Configurator"));
48 QPoint p = QCursor::pos();
51 layout = new QVBoxLayout(this);
53 QIcon icon = DhcpcdQt::getIcon("status", "network-transmit-receive");
54 QPixmap picon = icon.pixmap(32, 32);
55 iconLabel = new QLabel(this);
56 iconLabel->setAlignment(Qt::AlignCenter);
57 iconLabel->setPixmap(picon);
58 layout->addWidget(iconLabel);
60 aboutLabel = new QLabel("<h1>Network Configurator " VERSION "</h1>", this);
61 aboutLabel->setAlignment(Qt::AlignCenter);
62 layout->addWidget(aboutLabel);
63 partLabel = new QLabel(tr("Part of the dhcpcd project"), this);
64 partLabel->setAlignment(Qt::AlignCenter);
65 layout->addWidget(partLabel);
66 copyrightLabel = new QLabel("Copyright (c) 2009-2015 Roy Marples", this);
67 copyrightLabel->setAlignment(Qt::AlignCenter);
68 layout->addWidget(copyrightLabel);
69 urlLabel = new QLabel(
70 "<a href=\"http://roy.marples.name/projects/dhcpcd\">"
74 urlLabel->setAlignment(Qt::AlignCenter);
75 urlLabel->setOpenExternalLinks(true);
76 layout->addWidget(urlLabel);
78 QHBoxLayout *hbox = new QHBoxLayout();
79 layout->addLayout(hbox);
80 hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding));
81 closeButton = new QPushButton(tr("Close"));
82 closeButton->setIcon(QIcon::fromTheme("window-close"));
83 hbox->addWidget(closeButton);
84 connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
87 void DhcpcdAbout::closeEvent(QCloseEvent *e)
90 parent->dialogClosed(this);
91 QDialog::closeEvent(e);