[PC-BSD Commits] r2949 - in pcbsd: branches/7.0/kcmPBSystem trunk/kcmPBSystem

svn at pcbsd.org svn at pcbsd.org
Mon Nov 3 10:57:52 PST 2008


Author: kris
Date: 2008-11-03 10:57:51 -0800 (Mon, 03 Nov 2008)
New Revision: 2949

Modified:
   pcbsd/branches/7.0/kcmPBSystem/PBSystem.pro
   pcbsd/branches/7.0/kcmPBSystem/kcm.cpp
   pcbsd/branches/7.0/kcmPBSystem/pbsystemtab.cpp
   pcbsd/branches/7.0/kcmPBSystem/portsnapprogress.cpp
   pcbsd/trunk/kcmPBSystem/PBSystem.pro
   pcbsd/trunk/kcmPBSystem/kcm.cpp
   pcbsd/trunk/kcmPBSystem/pbsystemtab.cpp
   pcbsd/trunk/kcmPBSystem/portsnapprogress.cpp
Log:

Fixed a number of bugs in the System Utility:

 * Fixed a crash in the port snap tool
 * Fixed a bug which prevented being able to click apply when making changes
 * Fixed a bug with resolving the splash screen language names
 * Fixed a bug when trying to remember which language splash is being used



Modified: pcbsd/branches/7.0/kcmPBSystem/PBSystem.pro
===================================================================
--- pcbsd/branches/7.0/kcmPBSystem/PBSystem.pro	2008-11-03 15:15:31 UTC (rev 2948)
+++ pcbsd/branches/7.0/kcmPBSystem/PBSystem.pro	2008-11-03 18:57:51 UTC (rev 2949)
@@ -23,7 +23,7 @@
 
 DESTDIR = /usr/local/kde4/lib/kde4/
 
-TRANSLATIONS = PBSystem_en.ts
+TRANSLATIONS = PBSystem_en.ts PBSystem_af.ts PBSystem_ar.ts PBSystem_az.ts PBSystem_bg.ts PBSystem_bn.ts PBSystem_bs.ts PBSystem_ca.ts PBSystem_cs.ts PBSystem_cy.ts PBSystem_da.ts PBSystem_de.ts PBSystem_el.ts PBSystem_es.ts PBSystem_et.ts PBSystem_eu.ts PBSystem_fa.ts PBSystem_fi.ts PBSystem_fr.ts PBSystem_gl.ts PBSystem_he.ts PBSystem_hi.ts PBSystem_hr.ts PBSystem_hu.ts PBSystem_id.ts PBSystem_is.ts PBSystem_it.ts PBSystem_ja.ts PBSystem_ka.ts PBSystem_ko.ts PBSystem_lt.ts PBSystem_lv.ts PBSystem_mk.ts PBSystem_mn.ts PBSystem_ms.ts PBSystem_mt.ts PBSystem_nb.ts PBSystem_nl.ts PBSystem_pa.ts PBSystem_pl.ts PBSystem_pt.ts PBSystem_pt_BR.ts PBSystem_ro.ts PBSystem_ru.ts PBSystem_sk.ts PBSystem_sl.ts PBSystem_sr.ts PBSystem_sv.ts PBSystem_ta.ts PBSystem_tg.ts PBSystem_th.ts PBSystem_tr.ts PBSystem_uk.ts PBSystem_uz.ts PBSystem_vi.ts PBSystem_zh_CN.ts PBSystem_zh_HK.ts PBSystem_zh_TW.ts PBSystem_zu.ts
 
 QMAKE_LIBDIR = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib
 

Modified: pcbsd/branches/7.0/kcmPBSystem/kcm.cpp
===================================================================
--- pcbsd/branches/7.0/kcmPBSystem/kcm.cpp	2008-11-03 15:15:31 UTC (rev 2948)
+++ pcbsd/branches/7.0/kcmPBSystem/kcm.cpp	2008-11-03 18:57:51 UTC (rev 2949)
@@ -29,6 +29,8 @@
   setButtons(KCModule::Apply);
   systab = new PBSystemTab();
   systab->ProgramInit();
+
+  connect(systab, SIGNAL(changed() ), this, SLOT(configChanged() ) );
   
   if ( checkRoot() ) { systab->reparent(this, QPoint()); }
   else

Modified: pcbsd/branches/7.0/kcmPBSystem/pbsystemtab.cpp
===================================================================
--- pcbsd/branches/7.0/kcmPBSystem/pbsystemtab.cpp	2008-11-03 15:15:31 UTC (rev 2948)
+++ pcbsd/branches/7.0/kcmPBSystem/pbsystemtab.cpp	2008-11-03 18:57:51 UTC (rev 2949)
@@ -342,8 +342,8 @@
         while ( !stream.atEnd() ) {
             line = stream.readLine(); // line of text excluding '\n'
             
-               // If the KEY is found in the line, continue processing 
-	    if ( line.find(oldKey, 0) != -1 && found == 0 && line.find("#", 0) != 0)
+        // If the KEY is found in the line, continue processing 
+	if ( line.indexOf(oldKey, 0) != -1 && found == 0 && line.indexOf("#") != 0)
 	{
 	    SavedFile = SavedFile + newKey + "\n";
 	    found = 1;
@@ -404,7 +404,7 @@
             line = stream.readLine(); // line of text excluding '\n'
             
                // If the KEY is found in the line, continue processing 
-	if ( line.find(Key, 0) != -1)
+	if ( line.indexOf(Key, 0) != -1 && line.indexOf("#") != 0)
 	{
 	    line.remove(line.find(Key, 0), Key.length());
 	    //Remove instances of " and =
@@ -438,9 +438,8 @@
 	QMessageBox::warning(this, tr("Invalid Image"), tr("The splash screen image cannot be any larger than 1024x768, or any greater than 8-bit (256 colours) depth."));
 	return;
     }
-    KUrl url1 = KUrl::fromPath(file);
-    KUrl url2 = KUrl::fromPath("/PCBSD/splash-screens/loading-screen-custom.pcx");
-    KIO::file_copy(url1, url2, 0);
+
+    system("cp '" + file + "' /boot/loading-screen.pcx");
     splashSelect->clear();
     loadBootData();
     splashSelect->setCurrentItem(0);
@@ -455,15 +454,19 @@
     settings.writeEntry("/PCBSD/splash-screen", code);
     
     //Move files about
-    KUrl url1 = KUrl::fromPath("/PCBSD/splash-screens/loading-screen-" + code + ".pcx");
-    KUrl url2 = KUrl::fromPath("/boot/loading-screen.pcx");
-    KIO::file_copy(url1, url2, 0);
+    system("cp /PCBSD/splash-screens/loading-screen-" + code + ".pcx /boot/loading-screen.pcx");
+    system("chmod 644 /boot/loading-screen.pcx");
     
     if ( showBootCheck->isChecked() )
     {
 	saveValue("/boot/loader.conf", "splash_pcx_load=", "splash_pcx_load=\"YES\"" );
+	saveValue("/boot/loader.conf", "vesa_load=", "vesa_load=\"YES\"" );
+	saveValue("/boot/loader.conf", "bitmap_load=", "bitmap_load=\"YES\"" );
+	saveValue("/boot/loader.conf", "bitmap_name=", "bitmap_name=\"/boot/loading-screen.pcx\"" );
      } else {
 	saveValue("/boot/loader.conf", "splash_pcx_load=", "splash_pcx_load=\"NO\"" );
+	saveValue("/boot/loader.conf", "vesa_load=", "vesa_load=\"NO\"" );
+	saveValue("/boot/loader.conf", "bitmap_load=", "bitmap_load=\"NO\"" );
      }
 }
 
@@ -509,7 +512,11 @@
 	    if (code == "custom") { customPresent = true; }
 	    else
 	    {
-		QString langName = langResolver.countryCodeToName(code);
+		QString langName = langResolver.languageCodeToName(code);
+                if ( langName.isEmpty() )
+                {
+		    langName = "Splash Screen: " + code;
+                }
 		langList += langName;
 		codeMap[langName] = code;
 	    }
@@ -539,8 +546,15 @@
     else
     {
 	//If we don't have a splash for the user's language, default to english
-	if (codeMap[selectedLang] == "") selectedLang = "en";
-	selectedLang = langResolver.countryCodeToName(selectedLang);
+        QString testLangName = langResolver.languageCodeToName(selectedLang);
+	if (codeMap[testLangName] == "") selectedLang = "en";
+
+	selectedLang = langResolver.languageCodeToName(selectedLang);
+        if ( selectedLang.isEmpty() )
+        {
+	     selectedLang = "Splash Screen: " + selectedLang;
+        }
+
 	splashSelect->setCurrentItem(langList.findIndex(selectedLang) + indexMod);
     }
     

Modified: pcbsd/branches/7.0/kcmPBSystem/portsnapprogress.cpp
===================================================================
--- pcbsd/branches/7.0/kcmPBSystem/portsnapprogress.cpp	2008-11-03 15:15:31 UTC (rev 2948)
+++ pcbsd/branches/7.0/kcmPBSystem/portsnapprogress.cpp	2008-11-03 18:57:51 UTC (rev 2949)
@@ -107,7 +107,9 @@
     else {
 	displayString += output;
 	QStringList outputSplit = QStringList::split(" ", output);
-	if (outputSplit[1].toInt() != 0)
+        bool ok;
+	outputSplit[1].toInt(&ok);
+	if (ok)
 	{
 	    numberSteps += outputSplit[1].toInt();
 	}

Modified: pcbsd/trunk/kcmPBSystem/PBSystem.pro
===================================================================
--- pcbsd/trunk/kcmPBSystem/PBSystem.pro	2008-11-03 15:15:31 UTC (rev 2948)
+++ pcbsd/trunk/kcmPBSystem/PBSystem.pro	2008-11-03 18:57:51 UTC (rev 2949)
@@ -23,7 +23,7 @@
 
 DESTDIR = /usr/local/kde4/lib/kde4/
 
-TRANSLATIONS = PBSystem_en.ts
+TRANSLATIONS = PBSystem_en.ts PBSystem_af.ts PBSystem_ar.ts PBSystem_az.ts PBSystem_bg.ts PBSystem_bn.ts PBSystem_bs.ts PBSystem_ca.ts PBSystem_cs.ts PBSystem_cy.ts PBSystem_da.ts PBSystem_de.ts PBSystem_el.ts PBSystem_es.ts PBSystem_et.ts PBSystem_eu.ts PBSystem_fa.ts PBSystem_fi.ts PBSystem_fr.ts PBSystem_gl.ts PBSystem_he.ts PBSystem_hi.ts PBSystem_hr.ts PBSystem_hu.ts PBSystem_id.ts PBSystem_is.ts PBSystem_it.ts PBSystem_ja.ts PBSystem_ka.ts PBSystem_ko.ts PBSystem_lt.ts PBSystem_lv.ts PBSystem_mk.ts PBSystem_mn.ts PBSystem_ms.ts PBSystem_mt.ts PBSystem_nb.ts PBSystem_nl.ts PBSystem_pa.ts PBSystem_pl.ts PBSystem_pt.ts PBSystem_pt_BR.ts PBSystem_ro.ts PBSystem_ru.ts PBSystem_sk.ts PBSystem_sl.ts PBSystem_sr.ts PBSystem_sv.ts PBSystem_ta.ts PBSystem_tg.ts PBSystem_th.ts PBSystem_tr.ts PBSystem_uk.ts PBSystem_uz.ts PBSystem_vi.ts PBSystem_zh_CN.ts PBSystem_zh_HK.ts PBSystem_zh_TW.ts PBSystem_zu.ts
 
 QMAKE_LIBDIR = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib
 

Modified: pcbsd/trunk/kcmPBSystem/kcm.cpp
===================================================================
--- pcbsd/trunk/kcmPBSystem/kcm.cpp	2008-11-03 15:15:31 UTC (rev 2948)
+++ pcbsd/trunk/kcmPBSystem/kcm.cpp	2008-11-03 18:57:51 UTC (rev 2949)
@@ -29,6 +29,8 @@
   setButtons(KCModule::Apply);
   systab = new PBSystemTab();
   systab->ProgramInit();
+
+  connect(systab, SIGNAL(changed() ), this, SLOT(configChanged() ) );
   
   if ( checkRoot() ) { systab->reparent(this, QPoint()); }
   else

Modified: pcbsd/trunk/kcmPBSystem/pbsystemtab.cpp
===================================================================
--- pcbsd/trunk/kcmPBSystem/pbsystemtab.cpp	2008-11-03 15:15:31 UTC (rev 2948)
+++ pcbsd/trunk/kcmPBSystem/pbsystemtab.cpp	2008-11-03 18:57:51 UTC (rev 2949)
@@ -342,8 +342,8 @@
         while ( !stream.atEnd() ) {
             line = stream.readLine(); // line of text excluding '\n'
             
-               // If the KEY is found in the line, continue processing 
-	    if ( line.find(oldKey, 0) != -1 && found == 0 && line.find("#", 0) != 0)
+        // If the KEY is found in the line, continue processing 
+	if ( line.indexOf(oldKey, 0) != -1 && found == 0 && line.indexOf("#") != 0)
 	{
 	    SavedFile = SavedFile + newKey + "\n";
 	    found = 1;
@@ -404,7 +404,7 @@
             line = stream.readLine(); // line of text excluding '\n'
             
                // If the KEY is found in the line, continue processing 
-	if ( line.find(Key, 0) != -1)
+	if ( line.indexOf(Key, 0) != -1 && line.indexOf("#") != 0)
 	{
 	    line.remove(line.find(Key, 0), Key.length());
 	    //Remove instances of " and =
@@ -438,9 +438,8 @@
 	QMessageBox::warning(this, tr("Invalid Image"), tr("The splash screen image cannot be any larger than 1024x768, or any greater than 8-bit (256 colours) depth."));
 	return;
     }
-    KUrl url1 = KUrl::fromPath(file);
-    KUrl url2 = KUrl::fromPath("/PCBSD/splash-screens/loading-screen-custom.pcx");
-    KIO::file_copy(url1, url2, 0);
+
+    system("cp '" + file + "' /boot/loading-screen.pcx");
     splashSelect->clear();
     loadBootData();
     splashSelect->setCurrentItem(0);
@@ -455,15 +454,19 @@
     settings.writeEntry("/PCBSD/splash-screen", code);
     
     //Move files about
-    KUrl url1 = KUrl::fromPath("/PCBSD/splash-screens/loading-screen-" + code + ".pcx");
-    KUrl url2 = KUrl::fromPath("/boot/loading-screen.pcx");
-    KIO::file_copy(url1, url2, 0);
+    system("cp /PCBSD/splash-screens/loading-screen-" + code + ".pcx /boot/loading-screen.pcx");
+    system("chmod 644 /boot/loading-screen.pcx");
     
     if ( showBootCheck->isChecked() )
     {
 	saveValue("/boot/loader.conf", "splash_pcx_load=", "splash_pcx_load=\"YES\"" );
+	saveValue("/boot/loader.conf", "vesa_load=", "vesa_load=\"YES\"" );
+	saveValue("/boot/loader.conf", "bitmap_load=", "bitmap_load=\"YES\"" );
+	saveValue("/boot/loader.conf", "bitmap_name=", "bitmap_name=\"/boot/loading-screen.pcx\"" );
      } else {
 	saveValue("/boot/loader.conf", "splash_pcx_load=", "splash_pcx_load=\"NO\"" );
+	saveValue("/boot/loader.conf", "vesa_load=", "vesa_load=\"NO\"" );
+	saveValue("/boot/loader.conf", "bitmap_load=", "bitmap_load=\"NO\"" );
      }
 }
 
@@ -509,7 +512,11 @@
 	    if (code == "custom") { customPresent = true; }
 	    else
 	    {
-		QString langName = langResolver.countryCodeToName(code);
+		QString langName = langResolver.languageCodeToName(code);
+                if ( langName.isEmpty() )
+                {
+		    langName = "Splash Screen: " + code;
+                }
 		langList += langName;
 		codeMap[langName] = code;
 	    }
@@ -539,8 +546,15 @@
     else
     {
 	//If we don't have a splash for the user's language, default to english
-	if (codeMap[selectedLang] == "") selectedLang = "en";
-	selectedLang = langResolver.countryCodeToName(selectedLang);
+        QString testLangName = langResolver.languageCodeToName(selectedLang);
+	if (codeMap[testLangName] == "") selectedLang = "en";
+
+	selectedLang = langResolver.languageCodeToName(selectedLang);
+        if ( selectedLang.isEmpty() )
+        {
+	     selectedLang = "Splash Screen: " + selectedLang;
+        }
+
 	splashSelect->setCurrentItem(langList.findIndex(selectedLang) + indexMod);
     }
     

Modified: pcbsd/trunk/kcmPBSystem/portsnapprogress.cpp
===================================================================
--- pcbsd/trunk/kcmPBSystem/portsnapprogress.cpp	2008-11-03 15:15:31 UTC (rev 2948)
+++ pcbsd/trunk/kcmPBSystem/portsnapprogress.cpp	2008-11-03 18:57:51 UTC (rev 2949)
@@ -107,7 +107,9 @@
     else {
 	displayString += output;
 	QStringList outputSplit = QStringList::split(" ", output);
-	if (outputSplit[1].toInt() != 0)
+        bool ok;
+	outputSplit[1].toInt(&ok);
+	if (ok)
 	{
 	    numberSteps += outputSplit[1].toInt();
 	}



More information about the Commits mailing list