ui: aboutwindow

changed about window that it is consistent with the other windows
This commit is contained in:
Andreas Stallinger
2015-09-09 14:54:51 +02:00
parent 8c606ef5c4
commit baedc3eed1
6 changed files with 105 additions and 16 deletions
+2
View File
@@ -91,6 +91,8 @@ add_files(
qt/view/QtViewWidgetWrapper.cpp
qt/view/QtViewWidgetWrapper.h
qt/window/QtAbout.cpp
qt/window/QtAbout.h
qt/window/QtAboutLicense.cpp
qt/window/QtAboutLicense.h
qt/window/QtApplicationSettingsScreen.cpp
+58
View File
@@ -0,0 +1,58 @@
#include "qt/window/QtAbout.h"
#include <QFormLayout>
#include <QLineEdit>
#include <QLabel>
#include "version.h"
QtAbout::QtAbout(QWidget *parent)
: QtSettingsWindow(parent)
{
raise();
}
QSize QtAbout::sizeHint() const
{
return QSize(500,500);
}
void QtAbout::setup()
{
setupForm();
updateTitle("About Coati");
updateDoneButton("Ok");
hideCancelButton(true);
}
void QtAbout::populateForm(QFormLayout* layout)
{
QLabel* developerLabel = new QLabel(
"\nManuel Dobusch\n"
"Eberhard Gräther\n"
"Malte Langkabel\n"
"Victoria Pfausler\n"
"Andreas Stallinger\n");
layout->addRow(QString("Developed by:"), developerLabel);
layout->addRow(QString("Version:"), new QLabel(GIT_VERSION_NUMBER));
layout->addRow(QString("Branch:"), new QLabel(GIT_BRANCH));
layout->addRow(QString("Buildtype:"), new QLabel(BUILD_TYPE));
layout->addRow(QString("Date:"), new QLabel(GIT_COMMIT_TIME));
}
void QtAbout::handleCancelButtonPress()
{
emit canceled();
}
void QtAbout::handleUpdateButtonPress()
{
close();
}
void QtAbout::handleDoneButtonPress()
{
close();
}
+33
View File
@@ -0,0 +1,33 @@
#ifndef QT_ABOUT_H
#define QT_ABOUT_H
#include <QPushButton>
#include <QWidget>
#include "qt/window/QtSettingsWindow.h"
class QtAbout
: public QtSettingsWindow
{
Q_OBJECT
public:
QtAbout(QWidget* parent = 0);
QSize sizeHint() const Q_DECL_OVERRIDE;
virtual void setup() override;
protected:
virtual void populateForm(QFormLayout* layout) override;
private slots:
void handleCancelButtonPress();
void handleUpdateButtonPress();
void handleDoneButtonPress();
private:
QPushButton* m_cancelButton;
QPushButton* m_updateButton;
};
#endif //QT_ABOUT_H
@@ -12,6 +12,7 @@
QtApplicationSettingsScreen::QtApplicationSettingsScreen(QWidget *parent)
: QtSettingsWindow(parent)
, m_frameworkPaths(nullptr)
{
raise();
}
+9 -16
View File
@@ -149,22 +149,10 @@ bool QtMainWindow::event(QEvent* event)
void QtMainWindow::about()
{
QMessageBox::about(
this,
tr("About"),
tr(
"Developed by:\n\n"
"Manuel Dobusch\n"
"Eberhard Gräther\n"
"Malte Langkabel\n"
"Victoria Pfausler\n"
"Andreas Stallinger\n"
"\nVersion: " GIT_VERSION_NUMBER
"\nBranch: " GIT_BRANCH
"\nBuildtype: " BUILD_TYPE
"\nDate: " GIT_COMMIT_TIME
)
);
hideScreens();
m_aboutWindow = std::make_shared<QtAbout>(this);
m_aboutWindow->setup();
m_aboutWindow->show();
}
void QtMainWindow::hideScreens()
@@ -188,6 +176,11 @@ void QtMainWindow::hideScreens()
{
m_licenseWindow->hide();
}
if(m_aboutWindow)
{
m_aboutWindow->hide();
}
}
void QtMainWindow::closeScreens()
+2
View File
@@ -12,6 +12,7 @@
#include "qt/window/QtStartScreen.h"
#include "qt/window/QtProjectSetupScreen.h"
#include "qt/window/QtAboutLicense.h"
#include "qt/window/QtAbout.h"
class QDockWidget;
class View;
@@ -81,6 +82,7 @@ private:
std::shared_ptr<QtStartScreen> m_startScreen;
std::shared_ptr<QtProjectSetupScreen> m_newProjectDialog;
std::shared_ptr<QtAboutLicense> m_licenseWindow;
std::shared_ptr<QtAbout> m_aboutWindow;
std::vector<std::pair<View*, QDockWidget*>> m_dockWidgets;