Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Add support for enabling bios UTC time during first-boot
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Moore committed May 13, 2014
1 parent aaa71d1 commit b3da723
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 105 deletions.
6 changes: 6 additions & 0 deletions src-qt4/pc-firstbootgui/firstboot.cpp
Expand Up @@ -476,6 +476,12 @@ void Installer::saveSettings()
tz = tz.section(":", 0, 0);
system("cp /usr/share/zoneinfo/" + tz.toLatin1() + " /etc/localtime");

// Using UTC bios?
if ( checkUTC->isChecked() )
system("rm /etc/wall_cmos_clock >/dev/null 2>/dev/null");
else
system("touch /etc/wall_cmos_clock");

// Set the root PW
QTemporaryFile rfile("/tmp/.XXXXXXXX");
if ( rfile.open() ) {
Expand Down
205 changes: 100 additions & 105 deletions src-qt4/pc-firstbootgui/firstboot.ui
Expand Up @@ -30,7 +30,7 @@
<string notr="true">background-color: rgb(245, 245, 245);</string>
</property>
<property name="currentIndex">
<number>3</number>
<number>1</number>
</property>
<widget class="QWidget" name="Page_Welcome">
<layout class="QGridLayout" name="gridLayout_2">
Expand Down Expand Up @@ -148,37 +148,15 @@ background: transparent;</string>
</layout>
</widget>
<widget class="QWidget" name="Page_Time">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" rowspan="4">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>115</width>
<height>278</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>30</height>
</size>
<layout class="QGridLayout" name="gridLayout_12">
<item row="3" column="1">
<widget class="QCheckBox" name="checkUTC">
<property name="text">
<string>Set system clock to UTC time</string>
</property>
</spacer>
</widget>
</item>
<item row="0" column="2" rowspan="3">
<item row="0" column="2" rowspan="5">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
Expand Down Expand Up @@ -256,9 +234,38 @@ background: transparent;</string>
</item>
</layout>
</item>
<item row="0" column="1">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>30</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" rowspan="5">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>115</width>
<height>278</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
Expand All @@ -280,7 +287,7 @@ background: transparent;</string>
</property>
</widget>
</item>
<item>
<item row="1" column="0">
<widget class="QComboBox" name="comboBoxTimezone">
<property name="minimumSize">
<size>
Expand All @@ -293,44 +300,32 @@ background: transparent;</string>
</property>
</widget>
</item>
<item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="styleSheet">
<string notr="true">background: transparent;</string>
</property>
<property name="text">
<string>Where are you located? Please select the timezone for your location.</string>
<string>Please select the timezone for your location.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<spacer name="verticalSpacer_17">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="verticalSpacer_11">
<spacer name="horizontalSpacer_25">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
Expand All @@ -339,14 +334,14 @@ background: transparent;</string>
<widget class="QLabel" name="label_23">
<property name="minimumSize">
<size>
<width>0</width>
<height>55</height>
<width>45</width>
<height>45</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>55</height>
<width>45</width>
<height>45</height>
</size>
</property>
<property name="styleSheet">
Expand All @@ -362,66 +357,66 @@ background: transparent;</string>
<property name="pixmap">
<pixmap resource="pc-firstboot.qrc">:/modules/images/network.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background: transparent;</string>
</property>
<property name="title">
<string>System Hostname</string>
<spacer name="horizontalSpacer_26">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout_10">
<item row="1" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Enter a valid hostname, or leave default.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLineEdit" name="lineHostname">
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string>
</property>
</widget>
</item>
</layout>
</widget>
</spacer>
</item>
</layout>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="5" column="1">
<widget class="QGroupBox" name="groupBox">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
<property name="styleSheet">
<string notr="true">background: transparent;</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>248</width>
<height>18</height>
</size>
<property name="title">
<string>System Hostname</string>
</property>
</spacer>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<layout class="QGridLayout" name="gridLayout_10">
<item row="1" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Enter a valid hostname, or leave default.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLineEdit" name="lineHostname">
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
Expand Down

0 comments on commit b3da723

Please sign in to comment.