Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:pcbsd/pcbsd

  • Loading branch information...
commit a81910587291377ddcb53e89a31d95f042bf30d1 2 parents 89cdf9c + 9fabf4e
@beanpole135 beanpole135 authored
View
15 src-qt4/pc-firstbootgui/backend.cpp
@@ -486,3 +486,18 @@ QList<QStringList> Backend::getPackageData(bool &found)
return metaPkgs;
}
+
+QString Backend::detectCountryCode()
+{
+ QString code;
+
+ Process p(QStringList() << "detect-country");
+
+ if (p.waitForFinished()) {
+ code = p.readLine().simplified();
+ }
+ code = code.section(" ", 0, 0);
+ qDebug() << "Found Country Code:" << code;
+ return code;
+}
+
View
1  src-qt4/pc-firstbootgui/backend.h
@@ -51,6 +51,7 @@ class Backend {
static QStringList networkDevices();
static QStringList timezones();
static QString guessTimezone();
+ static QString detectCountryCode();
static void changeKbMap(QString model, QString layout, QString variant);
static QList<QStringList> hardDrives();
static QList<QStringList> availComponents();
View
29 src-qt4/pc-firstbootgui/firstboot.cpp
@@ -106,13 +106,42 @@ void Installer::slotPushVirtKeyboard()
void Installer::initInstall()
{
// load languages
+ QString langCode;
+ QString curLang;
+ curLang = "en_US";
+ bool foundLang = false;
comboLanguage->clear();
languages = Scripts::Backend::languages();
+ if ( QFile::exists("/var/.wizardlang") ) {
+ QFile lFile("/var/.wizardlang");
+ if ( lFile.open(QIODevice::ReadOnly | QIODevice::Text) ) {
+ curLang = lFile.readLine().simplified();
+ lFile.close();
+ }
+ }
+
+ qDebug() << curLang;
+
+ // Now set languages
for (int i=0; i < languages.count(); ++i) {
QString languageStr = languages.at(i);
QString language = languageStr.split("-").at(0);
comboLanguage->addItem(language.trimmed());
+
+ // Grab the language code
+ langCode = languageStr;
+ langCode.truncate(langCode.lastIndexOf(")"));
+ langCode.remove(0, langCode.lastIndexOf("(") + 1);
+ if ( curLang == langCode ) {
+ comboLanguage->setCurrentIndex(i);
+ foundLang = true;
+ }
}
+
+ // If we found a language to default to
+ if ( foundLang )
+ slotChangeLanguage();
+
connect(comboLanguage, SIGNAL(currentIndexChanged(QString)), this, SLOT(slotChangeLanguage()));
}
View
8 src-qt4/pc-installgui/installer.cpp
@@ -1008,6 +1008,14 @@ void Installer::startConfigGen()
cfgList << "runCommand=touch /var/.pcbsd-firstboot";
cfgList << "runCommand=touch /var/.pcbsd-firstgui";
+ if ( comboLanguage->currentIndex() != 0 ) {
+ QString lang = languages.at(comboLanguage->currentIndex());
+ // Grab the language code
+ lang.truncate(lang.lastIndexOf(")"));
+ lang.remove(0, lang.lastIndexOf("(") + 1);
+ cfgList << "runCommand=echo " + lang + " >/var/.wizardlang";
+ }
+
} else {
// Doing TrueOS Install
cfgList+=getUsersCfgSettings();
View
12 src-qt4/pc-sysmanager/portsnapprogress.cpp
@@ -61,16 +61,17 @@ void PortsnapProgress::startSource(QString pcVer)
QString branch;
// Figure out which to download
if ( pcVer.indexOf("STABLE") )
- branch = "/stable/" + pcVer.section(".", 0, 0);
+ branch = "stable/" + pcVer.section("-", 0, 0).section(".", 0, 0);
else if ( pcVer.indexOf(".") != -1 )
- branch = "/releng/" + pcVer.section("-", 0, 0);
+ branch = "releng/" + pcVer.section("-", 0, 0);
else
- branch = "/head";
+ branch = "master";
QStringList args;
QString prog;
- prog = "svn";
- args << "co" << "svn://svn.freebsd.org/base" + branch << "/usr/src";
+ prog = "git";
+ args << "clone" << "https://github.com/pcbsd/freebsd.git" << "-b" << branch << "/usr/src";
+ qDebug() << args;
portsnap = new QProcess(this);
portsnap->setProcessChannelMode(QProcess::MergedChannels);
connect(portsnap, SIGNAL(readyReadStandardOutput()), this, SLOT(parseUpdate()));
@@ -145,6 +146,7 @@ void PortsnapProgress::parseUpdate()
while( portsnap->canReadLine() )
{
QString output = portsnap->readLine().simplified();
+ output.truncate(100);
qDebug() << "Portsnap Update: " + output;
taskProgressLbl->setText(output);
}
Please sign in to comment.
Something went wrong with that request. Please try again.