Add version strings to gui
This commit is contained in:
parent
dbfb482c9f
commit
9d60eba90e
@ -24,6 +24,7 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
namespace f1x
|
namespace f1x
|
||||||
{
|
{
|
||||||
@ -124,6 +125,32 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
|||||||
connect(timer, SIGNAL(timeout()),this,SLOT(showTime()));
|
connect(timer, SIGNAL(timeout()),this,SLOT(showTime()));
|
||||||
timer->start();
|
timer->start();
|
||||||
|
|
||||||
|
// Get version string
|
||||||
|
QFileInfo vFile("/etc/crankshaft.build");
|
||||||
|
if (vFile.exists()) {
|
||||||
|
QFile versionFile(QString("/etc/crankshaft.build"));
|
||||||
|
versionFile.open(QIODevice::ReadOnly);
|
||||||
|
QTextStream data_version(&versionFile);
|
||||||
|
QString lineversion = data_version.readAll();
|
||||||
|
versionFile.close();
|
||||||
|
ui_->versionString->setText(lineversion);
|
||||||
|
} else {
|
||||||
|
ui_->versionString->setText("");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get date string
|
||||||
|
QFileInfo dFile("/etc/crankshaft.build");
|
||||||
|
if (dFile.exists()) {
|
||||||
|
QFile dateFile(QString("/etc/crankshaft.date"));
|
||||||
|
dateFile.open(QIODevice::ReadOnly);
|
||||||
|
QTextStream data_date(&dateFile);
|
||||||
|
QString linedate = data_date.readAll();
|
||||||
|
dateFile.close();
|
||||||
|
ui_->dateString->setText(linedate);
|
||||||
|
} else {
|
||||||
|
ui_->dateString->setText("");
|
||||||
|
}
|
||||||
|
|
||||||
QFileInfo cursorButtonFile("/etc/button_cursor_visible");
|
QFileInfo cursorButtonFile("/etc/button_cursor_visible");
|
||||||
bool cursorButtonForce = cursorButtonFile.exists();
|
bool cursorButtonForce = cursorButtonFile.exists();
|
||||||
|
|
||||||
|
@ -27,12 +27,41 @@
|
|||||||
<widget class="QLabel" name="Digital_clock">
|
<widget class="QLabel" name="Digital_clock">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>670</x>
|
<x>668</x>
|
||||||
<y>14</y>
|
<y>12</y>
|
||||||
<width>120</width>
|
<width>120</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="versionString">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>578</x>
|
||||||
|
<y>428</y>
|
||||||
|
<width>210</width>
|
||||||
|
<height>20</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="dateString">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>578</x>
|
||||||
|
<y>448</y>
|
||||||
|
<width>210</width>
|
||||||
|
<height>20</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="pushButtonSettings">
|
<widget class="QPushButton" name="pushButtonSettings">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
@ -231,12 +260,12 @@
|
|||||||
<property name="singleStep">
|
<property name="singleStep">
|
||||||
<number>25</number>
|
<number>25</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="tickInterval">
|
|
||||||
<number>25</number>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="tickInterval">
|
||||||
|
<number>25</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="pushButtonCameraShow">
|
<widget class="QPushButton" name="pushButtonCameraShow">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
@ -551,11 +580,8 @@
|
|||||||
<tabstop>pushButtonWirelessConnection</tabstop>
|
<tabstop>pushButtonWirelessConnection</tabstop>
|
||||||
<tabstop>pushButtonToggleCursor</tabstop>
|
<tabstop>pushButtonToggleCursor</tabstop>
|
||||||
<tabstop>pushButtonBrightness</tabstop>
|
<tabstop>pushButtonBrightness</tabstop>
|
||||||
<tabstop>pushButtonToggleCamera</tabstop>
|
|
||||||
<tabstop>pushButtonExit</tabstop>
|
<tabstop>pushButtonExit</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources/>
|
||||||
<include location="../../../assets/resources.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user