[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/kmameleon/main
From:       Primoz Anzur <zerokode () gmx ! net>
Date:       2005-09-03 22:37:32
Message-ID: 1125787052.078897.13100.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 456872 by zero:

Auto redetect xmame binary, if there are not in the list
cleanup


 M  +8 -4      mainwindow.cc  
 M  +33 -17    xmameconfig.cc  


--- trunk/kdenonbeta/kmameleon/main/mainwindow.cc #456871:456872
@@ -190,14 +190,18 @@
 	switch (xmame_type)
 	{
 		case 0:
-			if (! modes(0).isEmpty())
+			if (! modes(0).isEmpty()) {
 				break;
-			if (! modes(1).isEmpty())
+			}
+			if (! modes(1).isEmpty()) {
 				break;
-			if (! modes(2).isEmpty())
+			}
+			if (! modes(2).isEmpty()) {
 				break;
-			if (! modes(3).isEmpty())
+			}
+			if (! modes(3).isEmpty()) {
 				break;
+			}
 		break;
 
 		case 1:
--- trunk/kdenonbeta/kmameleon/main/xmameconfig.cc #456871:456872
@@ -62,8 +62,16 @@
 	modDevices();
 	modCustom();
 	modInfo();
-	modThemes();
+//	modThemes();
 
+	int mode;
+	for (int x = 0; x < 4; x++) {
+		if (xmModes(x) > 0) {
+			mode = xmModes(x);
+		}
+	}
+
+
 //we won't need the module for first time more than JUST a first time...
 	config->setGroup("First_run");
 	if(config->readBoolEntry("First",true)) {
@@ -73,8 +81,14 @@
 		config->writeEntry("First",false);
 		config->sync();
 	}
-	else
+	else if (mode == 0)
+	{
 		loadConfig();
+		reload();
+	}
+	else {
+		loadConfig();
+	}
 }
 
 void XMameCfg::modInfo()
@@ -1259,36 +1273,38 @@
 	else if (KMessageBox::questionYesNo(this,i18n("This will override your current X11 \
binary path... Want me to proceed?")) == 3)  \
pthXmameX11Bin->setText(KStandardDirs::findExe("xmame.x11"));  
-	if (pthXmameGlBin -> text().isEmpty())
+	if (pthXmameGlBin -> text().isEmpty()) {
 		pthXmameGlBin->setText(KStandardDirs::findExe("xmame.xgl"));
-	else if (KMessageBox::questionYesNo(this,i18n("This will override your current XGL \
binary path... Want me to proceed?")) == 3) +	} else if \
(KMessageBox::questionYesNo(this,i18n("This will override your current XGL binary \
path... Want me to proceed?")) == 3) {  \
                pthXmameGlBin->setText(KStandardDirs::findExe("xmame.xgl"));
-
-	if (pthXmameSvgaLibBin -> text().isEmpty())
+	}
+	if (pthXmameSvgaLibBin -> text().isEmpty()) {
 		pthXmameSvgaLibBin->setText(KStandardDirs::findExe("xmame.svgalib"));
-	else if (KMessageBox::questionYesNo(this,i18n("This will override your current \
SVGALIB binary path... Want me to proceed?")) == 3) +	} else if \
(KMessageBox::questionYesNo(this,i18n("This will override your current SVGALIB binary \
path... Want me to proceed?")) == 3) {  \
pthXmameSvgaLibBin->setText(KStandardDirs::findExe("xmame.svgalib")); +	}
 
 //could this be easier?
 	xMameBinList.clear();
-	if (! pthXmameSdlBin -> text().isEmpty())
+	if (! pthXmameSdlBin -> text().isEmpty()) {
 		xMameBinList +=pthXmameSdlBin -> text();
-
-	if (! pthXmameX11Bin -> text().isEmpty())
+	}
+	if (! pthXmameX11Bin -> text().isEmpty()) {
 		xMameBinList +=pthXmameX11Bin -> text();
-
-	if (! pthXmameGlBin -> text().isEmpty())
+	}
+	if (! pthXmameGlBin -> text().isEmpty()) {
 		xMameBinList +=pthXmameGlBin -> text();
-
-	if (! pthXmameSvgaLibBin -> text().isEmpty())
+	}
+	if (! pthXmameSvgaLibBin -> text().isEmpty()) {
 		xMameBinList +=pthXmameSvgaLibBin -> text();
-
+	}
 	kdDebug() << "Executables count [listed]: " << xMameBinList.count() << endl;
 
-	if ( xMameBinList.count() < 1)
+	if ( xMameBinList.count() < 1) {
 		KMessageBox::information(this, i18n("Cannot find XMame binaries... Please make \
                sure that it is installed..."));
-	else if ( xMameBinList.count() > 1)
+	} else if ( xMameBinList.count() > 1) {
 		KMessageBox::information(this, i18n("KMameleon found more than 1 XMame binary \
file.\nPlease use PathFinder tool to set the default rompath/artwork/samples \
directory or set it manually.")); +	}
 	else if ( xMameBinList.count() == 1 )
 	{
 		kdDebug() << xMameBinList[0] << endl;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic