Added "About swift dialog"

* Details as text edit, so users can cut and paste it for bug reports
* Removed setup/compile info from internals and show it in about
* display Qt icon for "About Qt"
This commit is contained in:
Klaus Basan
2017-07-14 19:57:38 +02:00
committed by Mathew Sutcliffe
parent 94c9886c35
commit 8c9e3541ee
5 changed files with 192 additions and 21 deletions

View File

@@ -0,0 +1,37 @@
/* Copyright (C) 2017
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#include "aboutdialog.h"
#include "ui_aboutdialog.h"
#include "blackgui/guiapplication.h"
namespace BlackGui
{
namespace Components
{
CAboutDialog::CAboutDialog(QWidget *parent) :
QDialog(parent), ui(new Ui::CAboutDialog)
{
ui->setupUi(this);
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
this->init();
}
CAboutDialog::~CAboutDialog()
{ }
void CAboutDialog::init()
{
ui->lbl_VersionValue->setText(sGui->getApplicationNameVersionBetaDev());
ui->pte_Info->setPlainText(sGui->getInfoString("\n"));
ui->pte_Info->appendPlainText("\nSetup follows:\n----");
ui->pte_Info->appendPlainText(sGui->getGlobalSetup().convertToQString("\n", true));
}
} // ns
} // ns

View File

@@ -0,0 +1,46 @@
/* Copyright (C) 2017
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKGUI_COMPONENTS_ABOUTDIALOG_H
#define BLACKGUI_COMPONENTS_ABOUTDIALOG_H
#include <QDialog>
#include <QScopedPointer>
namespace Ui { class CAboutDialog; }
namespace BlackGui
{
namespace Components
{
/*!
* About dialog
*/
class CAboutDialog : public QDialog
{
Q_OBJECT
public:
//! Constructor
explicit CAboutDialog(QWidget *parent = nullptr);
//! Destructor
virtual ~CAboutDialog();
private:
//! Init values
void init();
QScopedPointer<Ui::CAboutDialog> ui;
};
} // ns
} // ns
#endif // guard

View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CAboutDialog</class>
<widget class="QDialog" name="CAboutDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>320</width>
<height>258</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>200</height>
</size>
</property>
<property name="windowTitle">
<string>About swift</string>
</property>
<property name="modal">
<bool>false</bool>
</property>
<layout class="QFormLayout" name="fl_AboutDialog">
<item row="0" column="0">
<widget class="QLabel" name="lbl_Version">
<property name="text">
<string>Version:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPlainTextEdit" name="pte_Info">
<property name="documentTitle">
<string>about swift details</string>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDialogButtonBox" name="bb_AboutDialog">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="lbl_VersionValue">
<property name="text">
<string>Version ....</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lbl_Details">
<property name="text">
<string>Details:</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>bb_AboutDialog</sender>
<signal>accepted()</signal>
<receiver>CAboutDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>261</x>
<y>248</y>
</hint>
<hint type="destinationlabel">
<x>319</x>
<y>199</y>
</hint>
</hints>
</connection>
</connections>
</ui>