예제 #1
0
 def on_browse_clicked(self, widget, callback_data):
     dialog = DirectoryDialog("Select the folder where the disc is mounted",
                              parent=self)
     folder = dialog.folder
     callback = callback_data["callback"]
     requires = callback_data["requires"]
     callback(widget, requires, folder)
예제 #2
0
 def on_move_clicked(self, _button):
     new_location = DirectoryDialog("Select new location for the game",
                                    default_path=self.game.directory, parent=self)
     if not new_location.folder or new_location.folder == self.game.directory:
         return
     move_dialog = dialogs.MoveDialog(self.game, new_location.folder)
     move_dialog.connect("game-moved", self.on_game_moved)
     move_dialog.move()
예제 #3
0
 def scan_folder(self):
     """Scan a folder of already installed games"""
     self.title_label.set_markup("<b>Import games from a folder</b>")
     self.listbox.destroy()
     script_dlg = DirectoryDialog(_("Select folder to scan"))
     if not script_dlg.folder:
         self.destroy()
         return
     spinner = Gtk.Spinner(visible=True)
     spinner.start()
     self.vbox.pack_start(spinner, False, False, 18)
     AsyncCall(scan_directory, self._on_folder_scanned, script_dlg.folder)
예제 #4
0
 def on_move_clicked(self, _button):
     new_location = DirectoryDialog("Select new location for the game",
                                    default_path=self.game.directory)
     new_directory = self.game.move(new_location.folder)
     if new_directory:
         self.directory_entry.set_text(new_directory)