We changed enough of dhcpcd-qt in 2017 to warrant a copyright bump.
[dhcpcd-ui] / src / dhcpcd-qt / dhcpcd-about.cpp
index 11b44a2ded866dc2ad89657ed844e476591725c2..14a6bef408a065494a5663bc2bae5f98b2df707b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * dhcpcd-qt
- * Copyright 2014 Roy Marples <roy@marples.name>
+ * Copyright 2014-2017 Roy Marples <roy@marples.name>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  */
 
 #include <QDialog>
+#include <QHBoxLayout>
 #include <QIcon>
 #include <QLabel>
 #include <QPixmap>
 #include <QPushButton>
+#include <QSpacerItem>
 #include <QVBoxLayout>
 
 #include "config.h"
 #include "dhcpcd-qt.h"
 
 DhcpcdAbout::DhcpcdAbout(DhcpcdQt *parent)
-    : QDialog(NULL)
+    : QDialog(parent)
 {
-       QVBoxLayout *layout;
-
        this->parent = parent;
+       QVBoxLayout *layout;
        resize(300, 200);
-       setWindowTitle("About dhcpcd-qt");
+       setWindowIcon(DhcpcdQt::getIcon("status", "network-transmit-receive"));
+       setWindowTitle(tr("About Network Configurator"));
+       QPoint p = QCursor::pos();
+       move(p.x(), p.y());
+
        layout = new QVBoxLayout(this);
 
        QIcon icon = DhcpcdQt::getIcon("status", "network-transmit-receive");
-       QPixmap picon = icon.pixmap(48, 48);
+       QPixmap picon = icon.pixmap(32, 32);
        iconLabel = new QLabel(this);
        iconLabel->setAlignment(Qt::AlignCenter);
        iconLabel->setPixmap(picon);
@@ -55,10 +60,10 @@ DhcpcdAbout::DhcpcdAbout(DhcpcdQt *parent)
        aboutLabel = new QLabel("<h1>Network Configurator "  VERSION "</h1>", this);
        aboutLabel->setAlignment(Qt::AlignCenter);
        layout->addWidget(aboutLabel);
-       partLabel = new QLabel("Part of the dhcpcd project", this);
+       partLabel = new QLabel(tr("Part of the dhcpcd project"), this);
        partLabel->setAlignment(Qt::AlignCenter);
        layout->addWidget(partLabel);
-       copyrightLabel = new QLabel("Copyright (c) 2009-2014 Roy Marples", this);
+       copyrightLabel = new QLabel("Copyright (c) 2009-2017 Roy Marples", this);
        copyrightLabel->setAlignment(Qt::AlignCenter);
        layout->addWidget(copyrightLabel);
        urlLabel = new QLabel(
@@ -70,9 +75,12 @@ DhcpcdAbout::DhcpcdAbout(DhcpcdQt *parent)
        urlLabel->setOpenExternalLinks(true);
        layout->addWidget(urlLabel);
 
-       closeButton = new QPushButton("Close", this);
+       QHBoxLayout *hbox = new QHBoxLayout();
+       layout->addLayout(hbox);
+       hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding));
+       closeButton = new QPushButton(tr("Close"));
        closeButton->setIcon(QIcon::fromTheme("window-close"));
-       layout->addWidget(closeButton);
+       hbox->addWidget(closeButton);
        connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
 }