[PC-BSD Commits] r8153 - pcbsd/stable/SysInstaller
svn at pcbsd.org
svn at pcbsd.org
Mon Dec 6 14:38:23 PST 2010
Author: kris
Date: 2010-12-06 14:38:23 -0800 (Mon, 06 Dec 2010)
New Revision: 8153
Modified:
pcbsd/stable/SysInstaller/sysinstaller.cpp
pcbsd/stable/SysInstaller/sysinstaller.h
pcbsd/stable/SysInstaller/sysinstaller.ui
Log:
MFC changes to let user set system hostname during installation
Modified: pcbsd/stable/SysInstaller/sysinstaller.cpp
===================================================================
--- pcbsd/stable/SysInstaller/sysinstaller.cpp 2010-12-06 17:58:49 UTC (rev 8152)
+++ pcbsd/stable/SysInstaller/sysinstaller.cpp 2010-12-06 22:38:23 UTC (rev 8153)
@@ -124,6 +124,7 @@
connect(radioDVDUSBInstall,SIGNAL(toggled(bool)), this, SLOT(slotChangedInstallSource()));
connect(radioNetworkInstall,SIGNAL(toggled(bool)), this, SLOT(slotChangedInstallSource()));
connect(comboSelectNic,SIGNAL(currentIndexChanged(int)), this, SLOT(slotChangedNic()));
+ connect(checkHostname,SIGNAL(clicked()), this, SLOT(slotHostnameClicked()));
// Connect the disk slots
connectDiskSlots();
@@ -149,6 +150,12 @@
}
+// Enable / disable the hostname
+void SysInstaller::slotHostnameClicked()
+{
+ lineHostname->setEnabled(checkHostname->isChecked());
+}
+
// Load the NICS
void SysInstaller::loadNics()
{
@@ -239,6 +246,14 @@
{
QString tmp;
+ // IF using a custom hostname, do some basic sanity checking of it
+ if ( stackWidget->currentIndex() == 0 && checkHostname->isChecked() &&
+ ( lineHostname->text().isEmpty() || lineHostname->text().length() < 2) )
+ {
+ QMessageBox::critical(this, tr("Invalid Hostname"),
+ tr("You must specify a hostname between 2-250 characters!") );
+ return;
+ }
// If we've been called on the NIC page, and using network install
if ( stackWidget->currentIndex() == 2 && radioNetworkInstall->isChecked() ) {
@@ -566,7 +581,13 @@
}
}
+ // If we have a custom hostname, add it to the config
+ if ( checkHostname->isChecked() ) {
+ tmpList << "hostname=" + lineHostname->text();
+ summaryList << tr("Using custom hostname:") + " " + lineHostname->text();
+ }
+
// Check if we are doing net or DVD/usb install
if ( radioNetworkInstall->isChecked() )
{
Modified: pcbsd/stable/SysInstaller/sysinstaller.h
===================================================================
--- pcbsd/stable/SysInstaller/sysinstaller.h 2010-12-06 17:58:49 UTC (rev 8152)
+++ pcbsd/stable/SysInstaller/sysinstaller.h 2010-12-06 22:38:23 UTC (rev 8153)
@@ -65,6 +65,7 @@
void slotAbort();
void slotFinished();
+ void slotHostnameClicked();
void slotChangeLanguage();
// Keyboard slots
Modified: pcbsd/stable/SysInstaller/sysinstaller.ui
===================================================================
--- pcbsd/stable/SysInstaller/sysinstaller.ui 2010-12-06 17:58:49 UTC (rev 8152)
+++ pcbsd/stable/SysInstaller/sysinstaller.ui 2010-12-06 22:38:23 UTC (rev 8153)
@@ -996,7 +996,7 @@
</palette>
</property>
<property name="currentIndex">
- <number>3</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="aiStep0">
<property name="palette">
@@ -1703,6 +1703,106 @@
</spacer>
</item>
<item row="3" column="0" colspan="3">
+ <layout class="QHBoxLayout" name="horizontalLayout_14">
+ <item>
+ <spacer name="horizontalSpacer_46">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Preferred</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>125</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_8">
+ <property name="title">
+ <string/>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_31">
+ <item row="0" column="0" colspan="2">
+ <widget class="QLabel" name="label_34">
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0.7, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255));</string>
+ </property>
+ <property name="text">
+ <string>System Hostname</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLineEdit" name="lineHostname">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxLength">
+ <number>250</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="2">
+ <widget class="QCheckBox" name="checkHostname">
+ <property name="text">
+ <string>Custom hostname</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_45">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Preferred</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>125</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="4" column="0" colspan="3">
+ <spacer name="verticalSpacer_9">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>588</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="5" column="0" colspan="3">
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QLabel" name="label_2">
More information about the Commits
mailing list