The branch, dharma has been updated
via 6ea066dfc2ec70fabad357aecc65ea1dd9e3aaaf (commit)
from d754deb91e502c1eb99bce506c5913d0b64daa9a (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=6ea066dfc2ec70fabad357aecc65ea1dd9e3aaaf
commit 6ea066dfc2ec70fabad357aecc65ea1dd9e3aaaf
Author: amet <[email protected]>
Date: Thu Apr 21 09:41:49 2011 +0400
[script.games.xbmame] -v2.0.3
Fixed a bug that would prevent the script to startup on nightly builds.
Fixed a bug where the script would randomly crash when using mouse.
Changed the initialization sequence for GUI to spawn faster.
diff --git a/script.games.xbmame/LICENSE.txt b/script.games.xbmame/LICENSE.txt
index 7714141..06f9651 100644
--- a/script.games.xbmame/LICENSE.txt
+++ b/script.games.xbmame/LICENSE.txt
@@ -467,4 +467,3 @@ EXHIBIT A -Mozilla Public License.
the notices in the Source Code files of the Original Code. You should
use the text of this Exhibit A rather than the text found in the
Original Code Source Code for Your Modifications.]
-
diff --git a/script.games.xbmame/addon.xml b/script.games.xbmame/addon.xml
index 66acd9f..5da83b7 100644
--- a/script.games.xbmame/addon.xml
+++ b/script.games.xbmame/addon.xml
@@ -18,7 +18,7 @@
# All Rights Reserved.
-->
-<addon id="script.games.xbmame" name="MAME Frontend" version="2.0.1"
provider-name="Akira76">
+<addon id="script.games.xbmame" name="MAME Frontend" version="2.0.3"
provider-name="Akira76">
<requires>
<import addon="xbmc.python" version="1.0"/>
<import addon="script.module.pysqlite" version="2.5.6"/>
diff --git a/script.games.xbmame/changelog.txt
b/script.games.xbmame/changelog.txt
index bc882b7..ac9e488 100644
--- a/script.games.xbmame/changelog.txt
+++ b/script.games.xbmame/changelog.txt
@@ -1,12 +1,17 @@
+2011-04-20 -> v2.0.3
+ Fixed a bug that would prevent the script to startup on nightly builds.
+ Fixed a bug where the script would randomly crash when using mouse.
+ Changed the initialization sequence for GUI to spawn faster.
+
2011-03-31 -> v2.0.1
Fixed a bug where maintenance operations from the settings dialog wouldn't
work
Added plugin profile migration
-
+
2011-03-25 -> v2.0.0
Rewrote most of the code
Reworked thumbnail generation process
Changed execution mode from plugin to script
- Fixed a but where XBMame would appear twice in the add-on list
+ Fixed a bug where XBMame would appear twice in the add-on list
Added skin support
Added favorites
Added German plugin description
@@ -27,7 +32,7 @@
Reworked the database for faster creation/indexing.
It's now possible to fix most of mame parameters from the plugin settings.
Informations from mameinfo.dat are now imported if available.
-
+
2010-10-30 -> v1.1.2
Reworked the database for faster creation/indexing.
Fixed an issue where MAME couldn't start on windows XP.
@@ -39,4 +44,4 @@
Fixed an issue where game config file wasn't successfully created.
2010-10-28 -> v1.0.0
- Initial public release.
\ No newline at end of file
+ Initial public release.
diff --git a/script.games.xbmame/resources/lib/XBMame.py
b/script.games.xbmame/resources/lib/XBMame.py
index ae3583c..e385f3c 100644
--- a/script.games.xbmame/resources/lib/XBMame.py
+++ b/script.games.xbmame/resources/lib/XBMame.py
@@ -33,7 +33,14 @@ class XBMame:
def __init__(self, ADDON_ID, arg):
self.__settings__ = Addon(ADDON_ID)
self.__language__ = Addon(ADDON_ID).getLocalizedString
- self.__profile__ = Addon(ADDON_ID).getAddonInfo("profile")
+ self.__profile__ =
translatePath(Addon(ADDON_ID).getAddonInfo("profile"))
+
+ command = arg.split(":")
+ if len(command)==1:Path="/"
+ else: Path = "/%s" % command[1]
+ XBMameGUI("XBMame.xml", self.__settings__.getAddonInfo("path"),
"default", "720p", Plugin=self, Path=Path, command=command)
+
+ def _postInit(self, command):
OLD_PLUGIN_PATH =
path.abspath(translatePath(path.join(path.dirname(self.__profile__), "..",
"plugin.games.xbmame")))
ADDON_PATH = translatePath(self.__profile__)
@@ -45,16 +52,16 @@ class XBMame:
move(OLD_PLUGIN_PATH, ADDON_PATH)
except Exception:
pass
-
- self.MEDIA_PATH = path.join(Addon(ADDON_ID).getAddonInfo("path"),
"resources", "skins", "Default", "media")
+
+ self.MEDIA_PATH = path.join(self.__settings__.getAddonInfo("path"),
"resources", "skins", "Default", "media")
self._MAME_CONFIG_PATH = translatePath(path.join(self.__profile__,
"cfg"))
self._MAME_NVRAM_PATH = translatePath(path.join(self.__profile__,
"nvram"))
if not path.exists(self._MAME_CONFIG_PATH):
makedirs(self._MAME_CONFIG_PATH)
self._MAME_CACHE_PATH = translatePath(path.join(self.__profile__,
"titles"))
if not path.exists(self._MAME_CACHE_PATH):
makedirs(self._MAME_CACHE_PATH)
- SETTINGS_PLUGIN_ID = "%s.settings" % ADDON_ID
- SETTINGS_PLUGIN_PATH =
path.join(path.dirname(Addon(ADDON_ID).getAddonInfo("path")),
SETTINGS_PLUGIN_ID)
+ SETTINGS_PLUGIN_ID = "%s.settings" %
self.__settings__.getAddonInfo("id")
+ SETTINGS_PLUGIN_PATH =
path.join(path.dirname(self.__settings__.getAddonInfo("path")),
SETTINGS_PLUGIN_ID)
try:
Addon(SETTINGS_PLUGIN_ID)
self.SETTINGS_PLUGIN_ID=SETTINGS_PLUGIN_ID
@@ -67,7 +74,7 @@ class XBMame:
executebuiltin("RestartApp")
self._FILTERS = ""
-
+
if not path.exists(self.__profile__): makedirs(self.__profile__)
self._MAME_DATABASE_PATH =
translatePath(path.join(self.__settings__.getAddonInfo("profile"), "XBMame.db"))
@@ -79,8 +86,6 @@ class XBMame:
self.__settings__.openSettings()
self.getSettings()
- command = arg.split(":")
-
if command[0]=="exec": self.execute(command[1:])
else:
if self._db.isEmpty():MameImport(self)
@@ -89,9 +94,6 @@ class XBMame:
if dbver!=DB_VERSION:
dialog.ok(self.__language__(30600), self.__language__(30620),
self.__language__(30621) % (dbver, DB_VERSION), self.__language__(30622))
MameImport(self)
- if len(command)==1:Path="/"
- else: Path = "/%s" % command[1]
- XBMameGUI("XBMame.xml", self.__settings__.getAddonInfo("path"),
"default", "720p", Plugin=self, Path=Path)
def getSettings(self):
self._MAME_PARAMS = {}
@@ -159,7 +161,7 @@ class XBMame:
self.GUI.populateList(self.browse(self.GUI.path))
except AttributeError:
pass
-
+
def execute(self, args):
print args
if args[0]=="builddb":MameImport(self)
@@ -259,7 +261,7 @@ class XBMame:
for i in range(10):
criteria += "gamename LIKE '" + str(i) + "%'"
if i < 9:
- criteria += " OR "
+ criteria += " OR "
criteria += ")"
else:
criteria = "gamename LIKE '" + Path[1] + "%'"
@@ -277,7 +279,7 @@ class XBMame:
items = self._gameCollection("", favorites=1)
unlock()
return items
-
+
def _item(self, caption, image, action="", menu = ""):
menu = "%s,exec:config," % self.__language__(30803) + menu
if menu[-1]==",": menu=menu[:-1]
@@ -343,7 +345,7 @@ class XBMame:
# xbmcgui.unlock()
return items
del games
-
+
def _runGame(self, romset):
game = GameItem(self._db, id=romset)
if game.have:
@@ -528,7 +530,7 @@ class XBMame:
class XBMameGUI(WindowXML):
_LISTCONTAINER = 30301
-
+
def __init__(self, *args, **kwargs):
self.parent = kwargs["Plugin"]
try:
@@ -536,35 +538,40 @@ class XBMameGUI(WindowXML):
except KeyError:
self.path = "/"
self.parent.GUI = self
+ self.command = kwargs["command"]
self.doModal()
def onInit(self):
self._LIST = self.getControl(self._LISTCONTAINER)
self.populateList(self.parent.browse(self.path))
-
+ self.parent._postInit(self.command)
+
def onClick(self, controlId):
if controlId==self._LISTCONTAINER:
- action =
self._LIST.getSelectedItem().getProperty("action").split(":")
- if action[0]=="browse":
- self.path = action[1]
- self.populateList(self.parent.browse(action[1]))
- elif action[0]=="exec":
- self.parent.execute(action[1:])
+ if self._LIST.getSelectedPosition()<self._LIST.size():
+ action =
self._LIST.getSelectedItem().getProperty("action").split(":")
+ if action[0]=="browse":
+ self.path = action[1]
+ self.populateList(self.parent.browse(action[1]))
+ elif action[0]=="exec":
+ self.parent.execute(action[1:])
def onFocus(self, controlId):
pass
-
+
def onAction(self, action):
if action.getId()==10:
self.close()
elif action.getId()==117:
- obj = self._LIST.getSelectedItem()
- if obj.getProperty("menu")!="":
- menu = ContextMenu("ContextMenu.xml",
self.parent.__settings__.getAddonInfo("path"), "Default", "720p",
menu=obj.getProperty("menu"))
- action = menu.action.split(":")
- if action[0]=="exec":
- self.parent.execute(action[1:])
-
+ print self._LIST.getSelectedPosition()
+ if self._LIST.getSelectedPosition()<self._LIST.size():
+ obj = self._LIST.getSelectedItem()
+ if obj.getProperty("menu")!="":
+ menu = ContextMenu("ContextMenu.xml",
self.parent.__settings__.getAddonInfo("path"), "Default", "720p",
menu=obj.getProperty("menu"))
+ action = menu.action.split(":")
+ if action[0]=="exec":
+ self.parent.execute(action[1:])
+
def populateList(self, items):
self._LIST.reset()
self._LIST.addItems(items)
diff --git a/script.games.xbmame/resources/lib/gui/InfoDialog.py
b/script.games.xbmame/resources/lib/gui/InfoDialog.py
index f994594..2323b1e 100644
--- a/script.games.xbmame/resources/lib/gui/InfoDialog.py
+++ b/script.games.xbmame/resources/lib/gui/InfoDialog.py
@@ -95,7 +95,7 @@ class InfoDialog(xbmcgui.WindowXMLDialog):
else:
return "%s : %s[CR][CR]" % (label, info)
else: return ""
-
+
def addMenu(self, info, label):
control = self.getControl(CONTROL_MENU)
if info==None:info = ""
diff --git a/script.games.xbmame/resources/lib/gui/xbDialog.py
b/script.games.xbmame/resources/lib/gui/xbDialog.py
index 597576a..b9a6c70 100644
--- a/script.games.xbmame/resources/lib/gui/xbDialog.py
+++ b/script.games.xbmame/resources/lib/gui/xbDialog.py
@@ -120,7 +120,7 @@ class Progress(xbmcgui.WindowXMLDialog):
def iscanceled(self):
return self.canceled
-
+
def onClick(self, controlId):
print "clicked"
self.canceled = True
diff --git a/script.games.xbmame/resources/lib/obj/DBHelper.py
b/script.games.xbmame/resources/lib/obj/DBHelper.py
index 4f2a0b6..85fa691 100644
--- a/script.games.xbmame/resources/lib/obj/DBHelper.py
+++ b/script.games.xbmame/resources/lib/obj/DBHelper.py
@@ -23,7 +23,7 @@ class DBHelper(object):
def __init__(self, dbpath):
self._db = sqlite.connect(dbpath)
self._cursor = self._db.cursor()
-
+
if self.needsSchema():
self.execute("CREATE TABLE GameSettings (id INTEGER PRIMARY KEY,
romset TEXT, view INTEGER, rotate INTEGER, backdrops BOOLEAN, overlays BOOLEAN,
bezels BOOLEAN, zoom BOOLEAN, have BOOLEAN, thumb BOOLEAN)")
self.execute("CREATE TABLE XBMame (id INTEGER PRIMARY KEY, setting
TEXT, value TEXT)")
@@ -33,7 +33,7 @@ class DBHelper(object):
self.execute("CREATE TABLE Dipswitches (id INTEGER PRIMARY KEY,
romset_id integer, name TEXT, tag TEXT, mask INTEGER, defvalue INTEGER, value
INTEGER)")
self.execute("CREATE TABLE DipswitchesValues (id INTEGER PRIMARY
KEY, dipswitch_id INTEGER, name TEXT, value TEXT)")
self.commit()
-
+
def commit(self):
self.db.commit()
@@ -138,4 +138,3 @@ class DBHelper(object):
fields[headers[i]]=result[i]
values.append(fields)
return values
-
diff --git a/script.games.xbmame/resources/lib/obj/MameInfo.py
b/script.games.xbmame/resources/lib/obj/MameInfo.py
index eb8b631..3c4bb35 100644
--- a/script.games.xbmame/resources/lib/obj/MameInfo.py
+++ b/script.games.xbmame/resources/lib/obj/MameInfo.py
@@ -147,4 +147,3 @@ class InfoItem(object):
self.games += re.sub(".\((.*?)\)", "", games.replace("&&&&",
",").strip())
except IndexError:
pass
-
diff --git a/script.games.xbmame/xbmame.py b/script.games.xbmame/xbmame.py
index 11a63a4..840725f 100644
--- a/script.games.xbmame/xbmame.py
+++ b/script.games.xbmame/xbmame.py
@@ -25,7 +25,7 @@
sys.path.append(os.path.join(Addon(ADDON_ID).getAddonInfo("path"), "resources",
sys.path.append(os.path.join(Addon(ADDON_ID).getAddonInfo("path"),
"resources", "lib", "gui" ))
if __name__ == "__main__":
- from XBMame import XBMame
+ from XBMame import XBMame
if len(sys.argv)==1:action=""
else: action = sys.argv[1]
XBMame(ADDON_ID, action)
-----------------------------------------------------------------------
Summary of changes:
script.games.xbmame/LICENSE.txt | 1 -
script.games.xbmame/addon.xml | 2 +-
script.games.xbmame/changelog.txt | 13 +++-
script.games.xbmame/fanart.jpg | Bin 0 -> 315978 bytes
script.games.xbmame/resources/lib/XBMame.py | 69 +++++++++++---------
.../resources/lib/gui/InfoDialog.py | 2 +-
script.games.xbmame/resources/lib/gui/xbDialog.py | 2 +-
script.games.xbmame/resources/lib/obj/DBHelper.py | 5 +-
script.games.xbmame/resources/lib/obj/MameInfo.py | 1 -
script.games.xbmame/xbmame.py | 2 +-
10 files changed, 53 insertions(+), 44 deletions(-)
create mode 100644 script.games.xbmame/fanart.jpg
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons