示例#1
0
    def openClicked(self, button):
        if self.widgets["createNew"].get_active():
            perspective = perspective_manager.get_perspective("database")
            perspective.create_database()

        else:
            tree_iter = self.recent_combo.get_active_iter()
            if tree_iter is None:
                return
            else:
                model = self.recent_combo.get_model()
                uri = model[tree_iter][0]

            try:
                urlopen(unquote(uri)).close()
                perspective = perspective_manager.get_perspective("database")
                perspective.open_chessfile(unquote(uri))
                recent_manager.add_item(uri)
            except (IOError, OSError):
                # shomething wrong whit the uri
                recent_manager.remove_item(uri)
示例#2
0
    def openClicked(self, button):
        if self.widgets["createNew"].get_active():
            perspective = perspective_manager.get_perspective("database")
            perspective.create_database()

        else:
            tree_iter = self.recent_combo.get_active_iter()
            if tree_iter is None:
                return
            else:
                model = self.recent_combo.get_model()
                uri = model[tree_iter][0]

            try:
                urlopen(unquote(uri)).close()
                perspective = perspective_manager.get_perspective("database")
                perspective.open_chessfile(unquote(uri))
                recent_manager.add_item(uri)
            except (IOError, OSError):
                # shomething wrong whit the uri
                recent_manager.remove_item(uri)
示例#3
0
 def update_recent(self, gamemodel, uri):
     if isinstance(uri, str):
         path = url2pathname(uri)
         recent_manager.add_item("file:" + pathname2url(path))
示例#4
0
 def on_recent_game_activated(self, uri):
     if isinstance(uri, str):
         path = url2pathname(uri)
         recent_manager.add_item("file:" + pathname2url(path))
示例#5
0
 def update_recent(self, gamemodel, uri):
     if isinstance(uri, str):
         path = url2pathname(uri)
         recent_manager.add_item("file:" + pathname2url(path))
示例#6
0
 def on_recent_game_activated(self, uri):
     if isinstance(uri, str):
         path = url2pathname(uri)
         recent_manager.add_item("file:" + pathname2url(path))