Qt: Add "Now" button to RTC overrides
Jeffrey Pfau jeffrey@endrift.com
Thu, 01 Jan 2015 16:26:42 -0800
2 files changed,
26 insertions(+),
16 deletions(-)
M
src/platform/qt/GamePakView.cpp
→
src/platform/qt/GamePakView.cpp
@@ -34,6 +34,9 @@ });
connect(m_ui.time, &QDateTimeEdit::dateTimeChanged, [controller, this] (const QDateTime&) { m_ui.timeButtons->checkedButton()->clicked(); }); + connect(m_ui.timeNow, &QPushButton::clicked, [controller, this] () { + m_ui.time->setDateTime(QDateTime::currentDateTime()); + }); if (controller->isLoaded()) { gameStarted(controller->thread());
M
src/platform/qt/GamePakView.ui
→
src/platform/qt/GamePakView.ui
@@ -6,8 +6,8 @@ <property name="geometry">
<rect> <x>0</x> <y>0</y> - <width>247</width> - <height>345</height> + <width>259</width> + <height>373</height> </rect> </property> <property name="sizePolicy">@@ -149,8 +149,18 @@ <widget class="QWidget" name="tab_3">
<attribute name="title"> <string>RTC</string> </attribute> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="2" column="0"> + <widget class="QRadioButton" name="timeFakeEpoch"> + <property name="text"> + <string>Start time at</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">timeButtons</string> + </attribute> + </widget> + </item> + <item row="0" column="0"> <widget class="QRadioButton" name="timeNoOverride"> <property name="text"> <string>System time</string>@@ -163,7 +173,7 @@ <string notr="true">timeButtons</string>
</attribute> </widget> </item> - <item> + <item row="1" column="0"> <widget class="QRadioButton" name="timeFixed"> <property name="text"> <string>Fixed time</string>@@ -173,17 +183,7 @@ <string notr="true">timeButtons</string>
</attribute> </widget> </item> - <item> - <widget class="QRadioButton" name="timeFakeEpoch"> - <property name="text"> - <string>Start time at</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">timeButtons</string> - </attribute> - </widget> - </item> - <item> + <item row="3" column="0" colspan="2"> <widget class="QDateTimeEdit" name="time"> <property name="wrapping"> <bool>true</bool>@@ -210,6 +210,13 @@ <string>MM/dd/yy hh:mm:ss AP</string>
</property> <property name="timeSpec"> <enum>Qt::UTC</enum> + </property> + </widget> + </item> + <item row="0" column="1" rowspan="3" alignment="Qt::AlignBottom"> + <widget class="QPushButton" name="timeNow"> + <property name="text"> + <string>Now</string> </property> </widget> </item>