[PC-BSD Commits] r16476 - pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager
svn at pcbsd.org
svn at pcbsd.org
Fri Apr 20 09:59:47 PDT 2012
Author: kenmoore
Date: 2012-04-20 16:59:47 +0000 (Fri, 20 Apr 2012)
New Revision: 16476
Modified:
pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp
Log:
Fix the saving of a hostname in the network manager. Now it actually save the hostname if different, and will prompt the user to restart the computer to finish updating the hostname (don't run "hostname (newhostname)" on network restart)
Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp 2012-04-20 15:13:20 UTC (rev 16475)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp 2012-04-20 16:59:47 UTC (rev 16476)
@@ -635,7 +635,7 @@
{
//Set the hostname
- runCommand("hostname " + lineHostname->text());
+ //runCommand("hostname " + lineHostname->text());
// Set the gateway device name
if ( lineGateway->text() != "..." ) {
@@ -1051,10 +1051,11 @@
void NetworkMan::slotSave()
{
- if ( lineHostname->text().isEmpty() ) {
+ if ( !lineHostname->text().isEmpty() && (lineHostname->text().toLower() != Utils::getConfFileValue("/etc/rc.conf", "hostname=", 1).toLower() ) ) {
Utils::setConfFileValue("/etc/rc.conf", "hostname=", "hostname=\"" + lineHostname->text() + "\"", -1);
Utils::setConfFileValue("/etc/hosts", "::1", "::1\t\t\tlocalhost localhost.localdomain " + lineHostname->text() + ".localhost " + lineHostname->text(), -1);
Utils::setConfFileValue("/etc/hosts", "127.0.0.1", "127.0.0.1\t\tlocalhost localhost.localdomain " + lineHostname->text() + ".localhost " + lineHostname->text(), -1);
+ QMessageBox::information(this,tr("Computer Restart Required"), tr("You must restart your computer to finish changing your hostname") );
}
More information about the Commits
mailing list