The branch, eden-pre has been updated
       via  d0bff5b60df5366c5c9b953ea3d9cf3d5b3682c8 (commit)
      from  9bae00bf5af17c1065ebff937499be202e10a5f2 (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=d0bff5b60df5366c5c9b953ea3d9cf3d5b3682c8

commit d0bff5b60df5366c5c9b953ea3d9cf3d5b3682c8
Author: spiff <[email protected]>
Date:   Thu Feb 16 22:20:00 2012 +0100

    [plugin.image.iphoto] updated to version 1.9.0

diff --git a/plugin.image.iphoto/README.txt b/plugin.image.iphoto/README.txt
index 2315fc0..a73175c 100644
--- a/plugin.image.iphoto/README.txt
+++ b/plugin.image.iphoto/README.txt
@@ -10,12 +10,16 @@ see categories that correspond with their iPhoto 
counterparts:
 * Keywords
 * Ratings
 
+Your iPhoto library can reside locally (on the machine on which you run XBMC)
+or can be located on a network share.
+
+
 Configuration
 =============
 The plugin needs to know where your AlbumData.xml file is.  If you haven't
 explicitly pointed iPhoto to a non-standard library location, the default of
-"~/Pictures/iPhoto Library/AlbumData.xml" should work fine.  Otherwise,
-please enter in the correct path in the plugin's settings dialog.
+"~/Pictures/iPhoto Library" should work fine.  Otherwise, please enter in the
+correct path in the plugin's settings dialog.
 
 The iPhoto plugin can also be configured to ignore certain album types.
 It is currently hard-coded to ignore albums of type "Book" and
@@ -24,6 +28,7 @@ It is currently hard-coded to ignore albums of type "Book" and
 * Empty -- albums with no pictures.
 * Published -- MobileMe Gallery albums.
 * Flagged -- albums flagged in iPhoto's interface.
+* Keywords -- any photos with these keywords will be hidden.
 
 All of these album types are ignored by default.
 
@@ -38,6 +43,28 @@ choose "Default," it will preserve whatever view mode you 
have chosen in XBMC
 for each album; otherwise, it will force the view style to the one selected
 here.
 
+
+Referenced and Managed Libraries
+================================
+iPhoto gives you the option of managing your photos for you, by placing a
+copy of them within the library itself, or referencing your originals,
+leaving them in their original location on the filesystem.
+
+If your library is managed, you will select "Managed Library" in the plugin
+settings (this is the default).
+
+If your library is referenced and you are running XBMC on the same machine
+that you use iPhoto, you may also select "Managed Library".
+
+If your library is referenced and resides on a share over the network,
+you need to tell the plugin how to access the originals.  If on the
+machine you use iPhoto your originals are accessed via, for instance,
+"/Volumes/Media/Pictures", they may not be mounted at the same point on
+the machine on which you run XBMC.  If this is the case, you will need to
+configure the "Local root path to masters" and "Rewrite root path as"
+options.
+
+
 About Places support
 ====================
 If the plugin is configured to support the Places feature of iPhoto, it will
@@ -57,6 +84,7 @@ map images.  If you receive a map image with a red X over it, 
the plugin won't
 re-download the map until you clear the map image caches.  You can do so by
 selecting "Remove cached maps" from the context menu of the Places category.
 
+
 Translations
 ============
 If you'd like to help translate this plugin to another language, please send
@@ -66,10 +94,29 @@ If possible, patch against the most recent version at:
 
   http://github.com/jingai/plugin.image.iphoto
 
+
 Known Issues
 ============
+* Selecting previous picture sometimes erroneously selects next instead
+  See http://trac.xbmc.org/ticket/11826
 * Sorting by Date sorts on the file date, not the EXIF date.
   See http://trac.xbmc.org/ticket/10519
+* Can only set default view mode in Confluence skin
+  See http://trac.xbmc.org/ticket/9952
+
+
+Assistance
+==========
+If you need help getting the plugin to work, please visit my thread on the
+XBMC forums:
+
+  http://forum.xbmc.org/showthread.php?t=77612
+
+When asking for help or reporting a potential bug, please be prepared to post
+your debug log from XBMC and, if you don't mind, your AlbumData.xml from your
+iPhoto library.  Remember to remove any private information from both files
+before posting them.
+
 
 Credits
 =======
diff --git a/plugin.image.iphoto/addon.py b/plugin.image.iphoto/addon.py
index db017d1..6e6f9db 100644
--- a/plugin.image.iphoto/addon.py
+++ b/plugin.image.iphoto/addon.py
@@ -70,6 +70,37 @@ else:
     media_sort_col = "NULL"
 
 
+def generic_context_menu_items(commands=[]):
+    commands.append((addon.getLocalizedString(30217), 
"XBMC.RunPlugin(\""+BASE_URL+"?action=textview&file=README.txt\")",))
+    commands.append((xbmc.getLocalizedString(1045), 
"XBMC.RunPlugin(\""+BASE_URL+"?action=settings\")",))
+
+def maintenance_context_menu_items(commands=[]):
+    commands.append((addon.getLocalizedString(30213), 
"XBMC.RunPlugin(\""+BASE_URL+"?action=rescan\")",))
+    commands.append((addon.getLocalizedString(30216), 
"XBMC.RunPlugin(\""+BASE_URL+"?action=resetdb\")",))
+    commands.append((addon.getLocalizedString(30215), 
"XBMC.RunPlugin(\""+BASE_URL+"?action=rm_caches\")",))
+
+def textview(file):
+    WINDOW = 10147
+    CONTROL_LABEL = 1
+    CONTROL_TEXTBOX = 5
+
+    xbmc.executebuiltin("ActivateWindow(%d)" % (WINDOW))
+    retries = 5
+    while (gui.getCurrentWindowDialogId() != WINDOW and retries):
+       retries -= 1
+       xbmc.sleep(100)
+
+    window = gui.Window(WINDOW)
+
+    try:
+       heading = os.path.splitext(os.path.basename(file))[0]
+       text = open(os.path.join(PLUGIN_PATH, file)).read()
+    except:
+       print traceback.print_exc()
+    else:
+       window.getControl(CONTROL_LABEL).setLabel("%s - %s" % (heading, 
__plugin__))
+       window.getControl(CONTROL_TEXTBOX).setText(text)
+
 def md5sum(filename):
     try:
        m = md5()
@@ -84,11 +115,17 @@ def render_media(media):
     global view_mode
 
     # default view in Confluence
-    view_mode = addon.getSetting('view_mode')
-    if (view_mode == ""):
-       view_mode = "0"
-       addon.setSetting('view_mode', view_mode)
-    view_mode = int(view_mode)
+    vm = addon.getSetting('view_mode')
+    if (vm == ""):
+       vm = "0"
+       addon.setSetting('view_mode', vm)
+    vm = int(vm)
+    if (vm == 1):
+       view_mode = 510
+    elif (vm == 2):
+       view_mode = 514
+    else:
+       view_mode = vm
 
     sort_date = False
     n = 0
@@ -130,7 +167,7 @@ def list_photos_in_album(params):
     return render_media(media)
 
 def list_albums(params):
-    global db, BASE_URL, ICONS_PATH, album_ign_empty
+    global db, BASE_URL, ICONS_PATH, album_ign_empty, view_mode
 
     albumid = 0
     try:
@@ -146,6 +183,9 @@ def list_albums(params):
        dialog.ok(addon.getLocalizedString(30240), 
addon.getLocalizedString(30241))
        return
 
+    commands = []
+    generic_context_menu_items(commands)
+
     n = 0
     for (albumid, name, count) in albums:
        if (name == "Photos"):
@@ -155,11 +195,20 @@ def list_albums(params):
            continue
 
        item = gui.ListItem(name, thumbnailImage=ICONS_PATH+"/folder.png")
+       item.addContextMenuItems(commands, True)
        plugin.addDirectoryItem(handle = int(sys.argv[1]), 
url=BASE_URL+"?action=albums&albumid=%s" % (albumid), listitem = item, isFolder 
= True, totalItems = count)
        n += 1
 
     plugin.addSortMethod(int(sys.argv[1]), plugin.SORT_METHOD_UNSORTED)
     plugin.addSortMethod(int(sys.argv[1]), plugin.SORT_METHOD_LABEL)
+
+    # default view in Confluence
+    vm = addon.getSetting('confluence_view_albums')
+    if (vm == ""):
+       vm = "0"
+    view_mode = int(vm)
+    addon.setSetting('confluence_view_albums', "0")
+
     return n
 
 def list_photos_in_event(params):
@@ -170,7 +219,7 @@ def list_photos_in_event(params):
     return render_media(media)
 
 def list_events(params):
-    global db, BASE_URL, album_ign_empty
+    global db, BASE_URL, album_ign_empty, view_mode
 
     rollid = 0
     try:
@@ -186,6 +235,9 @@ def list_events(params):
        dialog.ok(addon.getLocalizedString(30240), 
addon.getLocalizedString(30241))
        return
 
+    commands = []
+    generic_context_menu_items(commands)
+
     sort_date = False
     n = 0
     for (rollid, name, thumbpath, rolldate, count) in rolls:
@@ -193,6 +245,7 @@ def list_events(params):
            continue
 
        item = gui.ListItem(name, thumbnailImage=thumbpath)
+       item.addContextMenuItems(commands, True)
 
        try:
            item_date = time.strftime("%d.%m.%Y", time.localtime(apple_epoch + 
float(rolldate)))
@@ -208,6 +261,14 @@ def list_events(params):
     plugin.addSortMethod(int(sys.argv[1]), plugin.SORT_METHOD_LABEL)
     if (sort_date == True):
        plugin.addSortMethod(int(sys.argv[1]), plugin.SORT_METHOD_DATE)
+
+    # default view in Confluence
+    vm = addon.getSetting('confluence_view_events')
+    if (vm == ""):
+       vm = "0"
+    view_mode = int(vm)
+    addon.setSetting('confluence_view_events', "0")
+
     return n
 
 def list_photos_with_face(params):
@@ -218,7 +279,7 @@ def list_photos_with_face(params):
     return render_media(media)
 
 def list_faces(params):
-    global db, BASE_URL, album_ign_empty
+    global db, BASE_URL, album_ign_empty, view_mode
 
     faceid = 0
     try:
@@ -234,18 +295,29 @@ def list_faces(params):
        dialog.ok(addon.getLocalizedString(30240), 
addon.getLocalizedString(30241))
        return
 
+    commands = []
+    generic_context_menu_items(commands)
+
     n = 0
     for (faceid, name, thumbpath, count) in faces:
        if (not count and album_ign_empty == "true"):
            continue
 
        item = gui.ListItem(name, thumbnailImage=thumbpath)
-
+       item.addContextMenuItems(commands, True)
        plugin.addDirectoryItem(handle = int(sys.argv[1]), 
url=BASE_URL+"?action=faces&faceid=%s" % (faceid), listitem = item, isFolder = 
True, totalItems = count)
        n += 1
 
     plugin.addSortMethod(int(sys.argv[1]), plugin.SORT_METHOD_UNSORTED)
     plugin.addSortMethod(int(sys.argv[1]), plugin.SORT_METHOD_LABEL)
+
+    # default view in Confluence
+    vm = addon.getSetting('confluence_view_faces')
+    if (vm == ""):
+       vm = "0"
+    view_mode = int(vm)
+    addon.setSetting('confluence_view_faces', "0")
+
     return n
 
 def list_photos_with_place(params):
@@ -256,7 +328,7 @@ def list_photos_with_place(params):
     return render_media(media)
 
 def list_places(params):
-    global db, BASE_URL, album_ign_empty
+    global db, BASE_URL, album_ign_empty, view_mode
 
     # how to display Places labels:
     # 0 = Addresses
@@ -289,6 +361,9 @@ def list_places(params):
        dialog.ok(addon.getLocalizedString(30240), 
addon.getLocalizedString(30241))
        return
 
+    commands = []
+    generic_context_menu_items(commands)
+
     n = 0
     for (placeid, latlon, address, thumbpath, fanartpath, count) in places:
        if (not count and album_ign_empty == "true"):
@@ -300,8 +375,7 @@ def list_places(params):
            item = gui.ListItem(latlon, address)
        else:
            item = gui.ListItem(address, latlon)
-
-       item.addContextMenuItems([(addon.getLocalizedString(30215), 
"XBMC.RunPlugin(\""+BASE_URL+"?action=rm_caches\")",)])
+       item.addContextMenuItems(commands, True)
 
        if (thumbpath):
            item.setThumbnailImage(thumbpath)
@@ -314,6 +388,14 @@ def list_places(params):
     if (n > 0):
        plugin.addSortMethod(int(sys.argv[1]), plugin.SORT_METHOD_UNSORTED)
        plugin.addSortMethod(int(sys.argv[1]), plugin.SORT_METHOD_LABEL)
+
+    # default view in Confluence
+    vm = addon.getSetting('confluence_view_places')
+    if (vm == ""):
+       vm = "0"
+    view_mode = int(vm)
+    addon.setSetting('confluence_view_places', "0")
+
     return n
 
 def list_photos_with_keyword(params):
@@ -324,7 +406,7 @@ def list_photos_with_keyword(params):
     return render_media(media)
 
 def list_keywords(params):
-    global db, BASE_URL, ICONS_PATH, album_ign_empty
+    global db, BASE_URL, ICONS_PATH, album_ign_empty, view_mode
 
     keywordid = 0
     try:
@@ -342,6 +424,9 @@ def list_keywords(params):
 
     hidden_keywords = addon.getSetting('hidden_keywords')
 
+    commands = []
+    generic_context_menu_items(commands)
+
     n = 0
     for (keywordid, name, count) in keywords:
        if (name in hidden_keywords):
@@ -351,13 +436,22 @@ def list_keywords(params):
            continue
 
        item = gui.ListItem(name, thumbnailImage=ICONS_PATH+"/folder.png")
-       item.addContextMenuItems([(addon.getLocalizedString(30214), 
"XBMC.RunPlugin(\""+BASE_URL+"?action=hidekeyword&keyword=%s\")" % (name),)])
+       commands.append((addon.getLocalizedString(30214), 
"XBMC.RunPlugin(\""+BASE_URL+"?action=hidekeyword&keyword=%s\")" % (name),))
+       item.addContextMenuItems(commands, True)
        plugin.addDirectoryItem(handle = int(sys.argv[1]), 
url=BASE_URL+"?action=keywords&keywordid=%s" % (keywordid), listitem = item, 
isFolder = True, totalItems = count)
        n += 1
 
     if (n > 0):
        plugin.addSortMethod(int(sys.argv[1]), plugin.SORT_METHOD_UNSORTED)
        plugin.addSortMethod(int(sys.argv[1]), plugin.SORT_METHOD_LABEL)
+
+    # default view in Confluence
+    vm = addon.getSetting('confluence_view_keywords')
+    if (vm == ""):
+       vm = "0"
+    view_mode = int(vm)
+    addon.setSetting('confluence_view_keywords', "0")
+
     return n
 
 def list_photos_with_rating(params):
@@ -368,7 +462,7 @@ def list_photos_with_rating(params):
     return render_media(media)
 
 def list_ratings(params):
-    global db, BASE_URL, ICONS_PATH
+    global db, BASE_URL, ICONS_PATH, view_mode
 
     albumid = 0
     try:
@@ -378,15 +472,27 @@ def list_ratings(params):
        print to_str(e)
        pass
 
+    commands = []
+    generic_context_menu_items(commands)
+
     n = 0
     for a in range(1,6):
        rating = addon.getLocalizedString(30200) % (a)
        item = gui.ListItem(rating, thumbnailImage=ICONS_PATH+"/star%d.png" % 
(a))
+       item.addContextMenuItems(commands, True)
        plugin.addDirectoryItem(handle = int(sys.argv[1]), 
url=BASE_URL+"?action=ratings&rating=%d" % (a), listitem = item, isFolder = 
True)
        n += 1
 
     plugin.addSortMethod(int(sys.argv[1]), plugin.SORT_METHOD_UNSORTED)
     plugin.addSortMethod(int(sys.argv[1]), plugin.SORT_METHOD_LABEL)
+
+    # default view in Confluence
+    vm = addon.getSetting('confluence_view_ratings')
+    if (vm == ""):
+       vm = "0"
+    view_mode = int(vm)
+    addon.setSetting('confluence_view_ratings', "0")
+
     return n
 
 def import_progress_callback(progress_dialog, altinfo, nphotos, ntotal):
@@ -402,6 +508,13 @@ def import_progress_callback(progress_dialog, altinfo, 
nphotos, ntotal):
 def import_library(xmlpath, xmlfile, masterspath, masters_realpath, 
enable_places):
     global db
 
+    # crude locking to prevent multiple simultaneous library imports
+    if (xbmc.getInfoLabel("Window(10000).Property(iphoto_scanning)") == 
"True"):
+       print "iPhoto: Library import already in progress."
+       return
+    else:
+       gui.Window(10000).setProperty("iphoto_scanning", "True")
+
     # always ignore Books and currently selected album
     album_ign = []
     album_ign.append("Book")
@@ -430,36 +543,44 @@ def import_library(xmlpath, xmlfile, masterspath, 
masters_realpath, enable_place
        addon.setSetting('places_enable_maps', "true")
     elif (e == "false"):
        enable_maps = False
+    if (enable_maps == True):
+       res_x = float(xbmc.getInfoLabel("System.ScreenWidth"))
+       res_y = float(xbmc.getInfoLabel("System.ScreenHeight"))
+       map_aspect = res_x / res_y
+    else:
+       map_aspect = 0.0
 
-    db.ResetDB()
-
-    progress_dialog = gui.DialogProgress()
     try:
-       progress_dialog.create(addon.getLocalizedString(30210))
-       progress_dialog.update(0, addon.getLocalizedString(30212))
+       # try to get progress dialog actually on-screen before we do work
+       retries = 10
+       progress_dialog = None
+       while (gui.getCurrentWindowDialogId() != 10101 and retries):
+           if (not progress_dialog):
+               progress_dialog = gui.DialogProgress()
+               progress_dialog.create(addon.getLocalizedString(30210))
+           retries -= 1
+           xbmc.sleep(100)
     except:
        print traceback.print_exc()
     else:
-       map_aspect = 0.0
-       if (enable_maps == True):
-           res_x = float(xbmc.getInfoLabel("System.ScreenWidth"))
-           res_y = float(xbmc.getInfoLabel("System.ScreenHeight"))
-           map_aspect = res_x / res_y
-
        iparser = IPhotoParser(xmlpath, xmlfile, masterspath, masters_realpath, 
album_ign, enable_places, map_aspect, db.AddAlbumNew, db.AddRollNew, 
db.AddFaceNew, db.AddKeywordNew, db.AddMediaNew, import_progress_callback, 
progress_dialog)
 
        try:
+           progress_dialog.update(0, addon.getLocalizedString(30219))
+           db.ResetDB()
+
+           progress_dialog.update(0, addon.getLocalizedString(30212))
            iparser.Parse()
        except:
            print traceback.print_exc()
+           print "iPhoto: Library parse failed."
            progress_dialog.close()
+           gui.Window(10000).setProperty("iphoto_scanning", "False")
            xbmc.executebuiltin("XBMC.RunPlugin(%s?action=resetdb&corrupted=1)" 
% (BASE_URL))
        else:
-           print "iPhoto Library imported successfully."
-
+           print "iPhoto: Library imported successfully."
            progress_dialog.close()
-
-           xbmc.sleep(1000)
+           gui.Window(10000).setProperty("iphoto_scanning", "False")
            try:
                # this is non-critical
                db.UpdateLastImport()
@@ -488,6 +609,12 @@ def reset_db(params):
            confirmed = dialog.yesno(addon.getLocalizedString(30230), 
addon.getLocalizedString(30232), addon.getLocalizedString(30233))
 
     if (confirmed):
+       if (xbmc.getInfoLabel("Window(10000).Property(iphoto_scanning)") == 
"True"):
+           dialog = gui.Dialog()
+           dialog.ok(addon.getLocalizedString(30260), 
addon.getLocalizedString(30261))
+           print "iPhoto: Library import in progress; not resetting database."
+           return
+
        remove_tries = 3
        while (remove_tries and os.path.isfile(db_file)):
            try:
@@ -525,10 +652,6 @@ def get_params(paramstring):
     print params
     return params
 
-def add_generic_context_menu_items(item):
-    item.addContextMenuItems([(addon.getLocalizedString(30213), 
"XBMC.RunPlugin(\""+BASE_URL+"?action=rescan\")",)])
-    item.addContextMenuItems([(addon.getLocalizedString(30216), 
"XBMC.RunPlugin(\""+BASE_URL+"?action=resetdb\")",)])
-
 if (__name__ == "__main__"):
     xmlpath = addon.getSetting('albumdata_xml_path')
     if (xmlpath == ""):
@@ -537,6 +660,7 @@ if (__name__ == "__main__"):
            addon.setSetting('albumdata_xml_path', xmlpath)
        except:
            pass
+       addon.openSettings(BASE_URL)
 
     # we used to store the file path to the XML instead of the iPhoto Library 
directory.
     if (os.path.basename(xmlpath) == ALBUM_DATA_XML):
@@ -577,38 +701,51 @@ if (__name__ == "__main__"):
     except:
        # main menu
        try:
+           commands = []
+           generic_context_menu_items(commands)
+           maintenance_context_menu_items(commands)
+
            item = gui.ListItem(addon.getLocalizedString(30100), 
thumbnailImage=ICONS_PATH+"/events.png")
-           add_generic_context_menu_items(item)
+           item.addContextMenuItems(commands, True)
            plugin.addDirectoryItem(int(sys.argv[1]), 
BASE_URL+"?action=events", item, True)
 
            item = gui.ListItem(addon.getLocalizedString(30101), 
thumbnailImage=ICONS_PATH+"/albums.png")
-           add_generic_context_menu_items(item)
+           item.addContextMenuItems(commands, True)
            plugin.addDirectoryItem(int(sys.argv[1]), 
BASE_URL+"?action=albums", item, True)
 
            item = gui.ListItem(addon.getLocalizedString(30105), 
thumbnailImage=ICONS_PATH+"/faces.png")
-           add_generic_context_menu_items(item)
+           item.addContextMenuItems(commands, True)
            plugin.addDirectoryItem(int(sys.argv[1]), BASE_URL+"?action=faces", 
item, True)
 
            item = gui.ListItem(addon.getLocalizedString(30106), 
thumbnailImage=ICONS_PATH+"/places.png")
-           add_generic_context_menu_items(item)
-           item.addContextMenuItems([(addon.getLocalizedString(30215), 
"XBMC.RunPlugin(\""+BASE_URL+"?action=rm_caches\")",)])
+           item.addContextMenuItems(commands, True)
            plugin.addDirectoryItem(int(sys.argv[1]), 
BASE_URL+"?action=places", item, True)
 
            item = gui.ListItem(addon.getLocalizedString(30104), 
thumbnailImage=ICONS_PATH+"/keywords.png")
-           add_generic_context_menu_items(item)
+           item.addContextMenuItems(commands, True)
            plugin.addDirectoryItem(int(sys.argv[1]), 
BASE_URL+"?action=keywords", item, True)
 
            item = gui.ListItem(addon.getLocalizedString(30102), 
thumbnailImage=ICONS_PATH+"/star.png")
-           add_generic_context_menu_items(item)
+           item.addContextMenuItems(commands, True)
            plugin.addDirectoryItem(int(sys.argv[1]), 
BASE_URL+"?action=ratings", item, True)
 
-           hide_import_lib = addon.getSetting('hide_import_lib')
-           if (hide_import_lib == ""):
-               hide_import_lib = "false"
-               addon.setSetting('hide_import_lib', hide_import_lib)
-           if (hide_import_lib == "false"):
+           hide_item = addon.getSetting('hide_import_lib')
+           if (hide_item == ""):
+               hide_item = "false"
+               addon.setSetting('hide_import_lib', hide_item)
+           if (hide_item == "false"):
                item = gui.ListItem(addon.getLocalizedString(30103), 
thumbnailImage=ICONS_PATH+"/update.png")
+               item.addContextMenuItems(commands, True)
                plugin.addDirectoryItem(int(sys.argv[1]), 
BASE_URL+"?action=rescan", item, False)
+
+           hide_item = addon.getSetting('hide_view_readme')
+           if (hide_item == ""):
+               hide_item = "false"
+               addon.setSetting('hide_view_readme', hide_item)
+           if (hide_item == "false"):
+               item = gui.ListItem(addon.getLocalizedString(30107), 
thumbnailImage=ICONS_PATH+"/help.png")
+               item.addContextMenuItems(commands, True)
+               plugin.addDirectoryItem(int(sys.argv[1]), 
BASE_URL+"?action=textview&file=README.txt", item, False)
        except:
            plugin.endOfDirectory(int(sys.argv[1]), False)
        else:
@@ -641,8 +778,6 @@ if (__name__ == "__main__"):
        # actions that don't require a database connection
        if (action == "resetdb"):
            reset_db(params)
-       elif (action == "hidekeyword"):
-           items = hide_keyword(params)
        elif (action == "rm_caches"):
            progress_dialog = gui.DialogProgress()
            try:
@@ -665,6 +800,17 @@ if (__name__ == "__main__"):
                dialog = gui.Dialog()
                dialog.ok(addon.getLocalizedString(30250), 
addon.getLocalizedString(30251) % (nfiles))
                print "iPhoto: deleted %d cached map image files." % (nfiles)
+       elif (action == "textview"):
+           try:
+               file = params['file']
+           except Exception, e:
+               print to_str(e)
+           else:
+               textview(file)
+       elif (action == "settings"):
+           addon.openSettings(BASE_URL)
+       elif (action == "hidekeyword"):
+           items = hide_keyword(params)
        else:
            # actions that do require a database connection
            try:
@@ -699,11 +845,8 @@ if (__name__ == "__main__"):
 
        if (items):
            plugin.endOfDirectory(int(sys.argv[1]), True)
-           if (view_mode > 0):
+           if (view_mode > 0 and xbmc.getSkinDir() == "skin.confluence"):
                xbmc.sleep(300)
-               if (view_mode == 1):
-                   xbmc.executebuiltin("Container.SetViewMode(510)")
-               elif (view_mode == 2):
-                   xbmc.executebuiltin("Container.SetViewMode(514)")
+               xbmc.executebuiltin("Container.SetViewMode(%d)" % (view_mode))
 
 # vim: tabstop=8 softtabstop=4 shiftwidth=4 noexpandtab:
diff --git a/plugin.image.iphoto/addon.xml b/plugin.image.iphoto/addon.xml
index 83679a5..77c95b5 100644
--- a/plugin.image.iphoto/addon.xml
+++ b/plugin.image.iphoto/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.image.iphoto" name="iPhoto" version="1.7.1" 
provider-name="jingai">
+<addon id="plugin.image.iphoto" name="iPhoto" version="1.9.0" 
provider-name="jingai">
     <requires>
        <import addon="xbmc.python" version="2.0"/>
        <import addon="script.module.simplejson" version="2.0.10"/>
diff --git a/plugin.image.iphoto/changelog.txt 
b/plugin.image.iphoto/changelog.txt
index 0e66f4b..72c4df2 100644
--- a/plugin.image.iphoto/changelog.txt
+++ b/plugin.image.iphoto/changelog.txt
@@ -1,3 +1,11 @@
+1.9.0 - 20120216
+- Allow access to network browser from addon settings.
+- Online documentation.
+- Default view modes when using Confluence skin.
+- Clean up context menu items.
+- Pop up settings dialog on first run.
+- Locking to prevent multiple instances of import operation.
+
 1.7.1 - 20120202
 - New icons.
 
diff --git a/plugin.image.iphoto/resources/language/English/strings.xml 
b/plugin.image.iphoto/resources/language/English/strings.xml
index d1ea841..33cd0ef 100644
--- a/plugin.image.iphoto/resources/language/English/strings.xml
+++ b/plugin.image.iphoto/resources/language/English/strings.xml
@@ -4,11 +4,13 @@
     <string id="30200">%d star</string>
     <string id="30210">Importing iPhoto Library</string>
     <string id="30211">Imported %d items</string>
-    <string id="30212">Scanning iPhoto database...</string>
+    <string id="30212">Scanning iPhoto Library...</string>
     <string id="30213">Update library</string>
     <string id="30214">Ignore Keyword</string>
     <string id="30215">Remove cached maps</string>
     <string id="30216">Reset addon database</string>
+    <string id="30217">Addon documentation</string>
+    <string id="30219">Resetting addon database...</string>
     <string id="30220">Enable Support for Places?</string>
     <string id="30221">Places looks up addresses via Google.</string>
     <string id="30222">This can slow down the library import a bit.</string>
@@ -22,6 +24,8 @@
     <string id="30250">Deleting cached map images</string>
     <string id="30251">Deleted %d cached maps</string>
     <string id="30252">Scanning...</string>
+    <string id="30260">Library import in progress</string>
+    <string id="30261">Unable to reset database.</string>
 
     <!-- Category strings -->
     <string id="30100">Events</string>
@@ -31,6 +35,7 @@
     <string id="30104">Keywords</string>
     <string id="30105">Faces</string>
     <string id="30106">Places</string>
+    <string id="30107">&lt;&lt; View Documentation &gt;&gt;</string>
 
     <!-- Plugin settings strings -->
     <string id="30000">Path to iPhoto Library</string>
@@ -56,6 +61,7 @@
     <string id="30027">Managed Library (change requires rescan)</string>
     <string id="30028">Local root path to Masters</string>
     <string id="30029">Rewrite root path as</string>
+    <string id="30030">Hide View Documentation item in main menu</string>
 
     <!-- Plugin settings categories strings -->
     <string id="30050">General</string>
diff --git a/plugin.image.iphoto/resources/settings.xml 
b/plugin.image.iphoto/resources/settings.xml
index cbde507..049b31b 100644
--- a/plugin.image.iphoto/resources/settings.xml
+++ b/plugin.image.iphoto/resources/settings.xml
@@ -2,10 +2,10 @@
 <settings>   
     <!-- General -->
     <category label="30050">
-       <setting id="albumdata_xml_path" type="folder" source="video" 
label="30000" default=""/>
+       <setting id="albumdata_xml_path" type="folder" source="" label="30000" 
default=""/>
        <setting id="managed_lib_enable" type="bool" label="30027" 
default="true"/>
        <setting id="masters_path" type="text" label="30028" 
default="/Volumes/Pictures/" enable="eq(-1,false)"/>
-       <setting id="masters_real_path" type="folder" source="video" 
label="30029" default="" enable="eq(-2,false)"/>
+       <setting id="masters_real_path" type="folder" source="" label="30029" 
default="" enable="eq(-2,false)"/>
        <setting id="places_enable" type="bool" label="30015" default="true"/>
        <setting id="places_enable_maps" type="bool" label="30025" 
default="true" enable="eq(-1,true)"/>
        <setting id="auto_update_lib" type="bool" label="30003" 
default="false"/>
@@ -24,10 +24,17 @@
        <setting id="album_ignore_flagged" type="bool" label="30002" 
default="true"/>
        <setting type="sep"/>
        <setting id="hidden_keywords" type="text" label="30006" default=""/>
+       <setting id="confluence_view_events" type="text" visible="false" 
default="0"/>
+       <setting id="confluence_view_albums" type="text" visible="false" 
default="51"/>
+       <setting id="confluence_view_faces" type="text" visible="false" 
default="500"/>
+       <setting id="confluence_view_places" type="text" visible="false" 
default="500"/>
+       <setting id="confluence_view_keywords" type="text" visible="false" 
default="51"/>
+       <setting id="confluence_view_ratings" type="text" visible="false" 
default="51"/>
     </category>
 
     <!-- Advanced -->
     <category label="30059">
        <setting id="hide_import_lib" type="bool" label="30004" 
default="false"/>
+       <setting id="hide_view_readme" type="bool" label="30030" 
default="false"/>
     </category>
 </settings>

-----------------------------------------------------------------------

Summary of changes:
 plugin.image.iphoto/README.txt                     |   51 ++++-
 plugin.image.iphoto/addon.py                       |  249 +++++++++++++++----
 plugin.image.iphoto/addon.xml                      |    2 +-
 plugin.image.iphoto/changelog.txt                  |    8 +
 .../resources/icons/token_dark/help.png            |  Bin 0 -> 13185 bytes
 .../resources/icons/token_light/help.png           |  Bin 0 -> 13522 bytes
 .../resources/language/English/strings.xml         |    8 +-
 plugin.image.iphoto/resources/settings.xml         |   11 +-
 8 files changed, 270 insertions(+), 59 deletions(-)
 create mode 100644 plugin.image.iphoto/resources/icons/token_dark/help.png
 create mode 100644 plugin.image.iphoto/resources/icons/token_light/help.png


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to