Example #1
0
 def on_recent_game_activated (gamemodel, uri):
     if isinstance(uri, basestring):
         path = url2pathname(uri)
         if GObject.pygobject_version >= (3, 7, 4):
             recent_data = Gtk.RecentData()
             recent_data.mime_type = 'application/x-chess-pgn'
             recent_data.app_name = 'pychess'
             recent_data.app_exec = 'pychess'
             #recent_data.groups = ['pychess']    # cannot add groups in python https://bugzilla.gnome.org/show_bug.cgi?id=695970
             recentManager.add_full("file:"+pathname2url(path), recent_data)
         else:
             recentManager.add_item("file:"+pathname2url(path))
Example #2
0
 def on_recent_game_activated (gamemodel, uri):
     if isinstance(uri, basestring):
         path = url2pathname(uri)
         if GObject.pygobject_version >= (3, 7, 4):
             recent_data = Gtk.RecentData()
             recent_data.mime_type = 'application/x-chess-pgn'
             recent_data.app_name = 'pychess'
             recent_data.app_exec = 'pychess'
             #recent_data.groups = ['pychess']    # cannot add groups in python https://bugzilla.gnome.org/show_bug.cgi?id=695970
             recentManager.add_full("file:"+pathname2url(path), recent_data)
         else:
             recentManager.add_item("file:"+pathname2url(path))
Example #3
0
        uistuff.keep(widgets["max_analysis_spin"],
                     "max_analysis_spin",
                     first_value=3)

# Sound initing

# Setup default sounds
EXT = "wav" if sys.platform == "win32" else "ogg"

for i in range(11):
    if not conf.hasKey("soundcombo%d" % i):
        conf.set("soundcombo%d" % i, SOUND_URI)
if not conf.hasKey("sounduri0"):
    conf.set("sounduri0",
             "file:" + pathname2url(addDataPrefix("sounds/move1.%s" % EXT)))
if not conf.hasKey("sounduri1"):
    conf.set("sounduri1",
             "file:" + pathname2url(addDataPrefix("sounds/check1.%s" % EXT)))
if not conf.hasKey("sounduri2"):
    conf.set("sounduri2",
             "file:" + pathname2url(addDataPrefix("sounds/capture1.%s" % EXT)))
if not conf.hasKey("sounduri3"):
    conf.set("sounduri3",
             "file:" + pathname2url(addDataPrefix("sounds/start1.%s" % EXT)))
if not conf.hasKey("sounduri4"):
    conf.set("sounduri4",
             "file:" + pathname2url(addDataPrefix("sounds/win1.%s" % EXT)))
if not conf.hasKey("sounduri5"):
    conf.set("sounduri5",
             "file:" + pathname2url(addDataPrefix("sounds/lose1.%s" % EXT)))
Example #4
0
                                              "inv_analyzer_check", SPY))

        uistuff.keep(widgets["max_analysis_spin"], "max_analysis_spin", first_value=3)

################################################################################
# Sound initing                                                                #
################################################################################

# Setup default sounds
EXT = "wav" if sys.platform == "win32" else "ogg"

for i in range(11):
    if not conf.hasKey("soundcombo%d" % i):
        conf.set("soundcombo%d" % i, SOUND_URI)
if not conf.hasKey("sounduri0"):
    conf.set("sounduri0", "file:"+pathname2url(addDataPrefix("sounds/move1.%s" % EXT)))
if not conf.hasKey("sounduri1"):
    conf.set("sounduri1", "file:"+pathname2url(addDataPrefix("sounds/check1.%s" % EXT)))
if not conf.hasKey("sounduri2"):
    conf.set("sounduri2", "file:"+pathname2url(addDataPrefix("sounds/capture1.%s" % EXT)))
if not conf.hasKey("sounduri3"):
    conf.set("sounduri3", "file:"+pathname2url(addDataPrefix("sounds/start1.%s" % EXT)))
if not conf.hasKey("sounduri4"):
    conf.set("sounduri4", "file:"+pathname2url(addDataPrefix("sounds/win1.%s" % EXT)))
if not conf.hasKey("sounduri5"):
    conf.set("sounduri5", "file:"+pathname2url(addDataPrefix("sounds/lose1.%s" % EXT)))
if not conf.hasKey("sounduri6"):
    conf.set("sounduri6", "file:"+pathname2url(addDataPrefix("sounds/draw1.%s" % EXT)))
if not conf.hasKey("sounduri7"):
    conf.set("sounduri7", "file:"+pathname2url(addDataPrefix("sounds/obs_mov.%s" % EXT)))
if not conf.hasKey("sounduri8"):
Example #5
0
        uistuff.keep(self.widgets["max_analysis_spin"],
                     "max_analysis_spin",
                     first_value=3)


# Sound initing

# Setup default sounds
EXT = "wav" if sys.platform == "win32" else "ogg"

for i in range(11):
    if not conf.hasKey("soundcombo%d" % i):
        conf.set("soundcombo%d" % i, SOUND_URI)
if not conf.hasKey("sounduri0"):
    conf.set("sounduri0",
             "file:" + pathname2url(addDataPrefix("sounds/move1.%s" % EXT)))
if not conf.hasKey("sounduri1"):
    conf.set("sounduri1",
             "file:" + pathname2url(addDataPrefix("sounds/check1.%s" % EXT)))
if not conf.hasKey("sounduri2"):
    conf.set("sounduri2",
             "file:" + pathname2url(addDataPrefix("sounds/capture1.%s" % EXT)))
if not conf.hasKey("sounduri3"):
    conf.set("sounduri3",
             "file:" + pathname2url(addDataPrefix("sounds/start1.%s" % EXT)))
if not conf.hasKey("sounduri4"):
    conf.set("sounduri4",
             "file:" + pathname2url(addDataPrefix("sounds/win1.%s" % EXT)))
if not conf.hasKey("sounduri5"):
    conf.set("sounduri5",
             "file:" + pathname2url(addDataPrefix("sounds/lose1.%s" % EXT)))
Example #6
0
 def on_recent_game_activated(gamemodel, uri):
     if isinstance(uri, basestring):
         path = url2pathname(uri)
         recentManager.add_item("file:" + pathname2url(path))
Example #7
0
 def update_recent(self, gamemodel, uri):
     if isinstance(uri, basestring):
         path = url2pathname(uri)
         recentManager.add_item("file:" + pathname2url(path))
Example #8
0
 def on_recent_game_activated(self, uri):
     if isinstance(uri, basestring):
         path = url2pathname(uri)
         recentManager.add_item("file:" + pathname2url(path))
Example #9
0
 def update_recent(self, gamemodel, uri):
     if isinstance(uri, basestring):
         path = url2pathname(uri)
         recentManager.add_item("file:" + pathname2url(path))