Skip to content

Commit

Permalink
Version on about dialog
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Ribelotta <[email protected]>
  • Loading branch information
martinribelotta committed Sep 4, 2016
1 parent 3c36737 commit 25d9f5c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
5 changes: 5 additions & 0 deletions aboutdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#include "aboutdialog.h"
#include "ui_aboutdialog.h"

#include "version.h"

AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
ui->label_VerBuildDate->setText(tr("Version %1, build date %2")
.arg(VERSION)
.arg(BUILD_DATE));
setWindowTitle(QCoreApplication::applicationName());
setFixedSize(sizeHint());
}
Expand Down
10 changes: 10 additions & 0 deletions aboutdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_VerBuildDate">
<property name="text">
<string>TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
Expand Down
7 changes: 4 additions & 3 deletions embedded-ide.pro
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ SOURCES += main.cpp\
qsvtextoperationswidget.cpp \
etags.cpp \
projectview.cpp \
filedownloader.cpp
filedownloader.cpp \
version.cpp

HEADERS += mainwindow.h \
documentarea.h \
Expand All @@ -62,7 +63,8 @@ HEADERS += mainwindow.h \
qsvtextoperationswidget.h \
etags.h \
projectview.h \
filedownloader.h
filedownloader.h \
version.h

FORMS += mainwindow.ui \
editorwidget.ui \
Expand All @@ -86,4 +88,3 @@ DISTFILES += \
reference-code-c.txt

RC_ICONS = icon-theme/icon.ico

4 changes: 4 additions & 0 deletions version.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "version.h"

const char *VERSION = "v0.1-rc2";
const char *BUILD_DATE = __DATE__ " " __TIME__;
7 changes: 7 additions & 0 deletions version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef VERSION_H
#define VERSION_H

extern const char *VERSION;
extern const char *BUILD_DATE;

#endif // VERSION_H

0 comments on commit 25d9f5c

Please sign in to comment.