Пример #1
0
    def __init__(self, parent, path, type):
        if type == self.AMIGA_FOREVER:
            title = _("Import From Amiga Forever CD/DVD")
        else:
            title = _("Import Kickstarts and ROMs")
        fsui.Dialog.__init__(self, parent, title)
        self.layout = fsui.VerticalLayout()
        self.layout.padding_left = 20
        self.layout.padding_top = 20
        self.layout.padding_right = 20
        self.layout.padding_bottom = 20

        self.text_area = fsui.TextArea(self, read_only=True)
        self.text_area.set_min_width(600)
        self.text_area.set_min_height(300)
        self.layout.add(self.text_area)

        hori_layout = fsui.HorizontalLayout()
        self.layout.add(hori_layout, fill=True, margin_top=20)
        hori_layout.add_spacer(0, expand=True)
        self.close_button = fsui.Button(self, _("Close"))
        self.close_button.on_activate = self.on_close_button
        self.close_button.disable()
        hori_layout.add(self.close_button)

        self.line_count = 0
        self.task = ImportTask(path, type)
        self.task.start()

        self.set_size(self.layout.get_min_size())
        self.center_on_parent()
        fsui.call_later(TIMER_INTERVAL, self.on_timer)
Пример #2
0
    def on_timer(self):
        fsui.call_later(TIMER_INTERVAL, self.on_timer)

        if not Scanner.running:
            if self.has_started_scan:
                if Scanner.error:
                    self.set_scan_title(_("Scan error"))
                    self.set_scan_status(Scanner.error)
                else:
                    if not self.interactive:
                        self.end_modal(True)
                        return
                    self.set_scan_title(_("Scan complete"))
                    self.set_scan_status(
                            _("Click 'Scan' button if you want to re-scan"))
            else:
                self.set_scan_title(_("No scan in progress"))
                self.set_scan_status(_("Click 'Scan' button to start scan"))
            if self.scan_button is not None:
                self.scan_button.enable()
            self.stop_button.disable()
            self.close_button.enable()
            return

        status = Scanner.status
        self.set_scan_title(status[0])
        self.set_scan_status(status[1])
Пример #3
0
 def on_timer(self):
     if self.task.done:
         self.close_button.enable()
     else:
         fsui.call_later(TIMER_INTERVAL, self.on_timer)
     lines = self.task.get_new_log_lines(self.line_count)
     for line in lines:
         self.text_area.append_text(line + "\n")
     self.line_count += len(lines)
Пример #4
0
 def on_timer(self):
     fsui.call_later(500, self.on_timer)
     #print("timer")
     if Netplay.config_version:
         for player in Netplay.players.values():
             if player.config_version != Netplay.config_version:
                 break
         else:
             # everyone has acked!
             self.create_server()
Пример #5
0
    def __init__(self):
        fsui.Window.__init__(self, None, "FS-UAE Launcher")
        #self.set_size((1000, 600))
        
        self.layout = fsui.HorizontalLayout()
        #self.layout.add_spacer(12)
        
        #from .KickstartGroup import KickstartGroup
        #self.kickstart_group = KickstartGroup(self)
        #self.layout.add(self.kickstart_group, fill=True, expand=True)
        #return
        
        #panel = fsui.Panel(self)
        #self.layout.add(panel, fill=True, expand=True)
        #panel.layout = fsui.HorizontalLayout()
        #panel.layout.add_spacer(12)
        #button = fsui.Button(panel, "Title")
        #panel.layout.add(button, fill=True, expand=True)
        #return
        
        self.left_side = fsui.Panel(self)
        #self.left_side = self
        # FIXME: HACK
        #def get_left_min_width():
        #    return 440
        #self.left_side.get_min_width = get_left_min_width
        #self.left_side.set_size((300, 300))
        self.create_left_side(self.left_side)
        self.layout.add(self.left_side, expand=False, fill=True)
        
        self.layout.add_spacer(20)
        
        self.right_side = fsui.Panel(self)
        self.create_right_side(self.right_side)
        self.layout.add(self.right_side, expand=True, fill=True)

        self.layout.add_spacer(20)
        self.layout.set_size(self.get_size())
        self.layout.update()
        
        self.init_net_play()
        
        self.set_size(self.layout.get_min_size())
        fsui.call_later(500, self.on_timer)
Пример #6
0
    def __init__(self, parent, minimal=False, interactive=True,
            scan_roms=True, scan_files=True, scan_configs=True):
        fsui.Dialog.__init__(self, parent, _("Scan"))
        self.layout = fsui.VerticalLayout()
        self.layout.padding_left = 10
        self.layout.padding_top = 10
        self.layout.padding_right = 10
        self.layout.padding_bottom = 10

        self.layout.add_spacer(640, 0)

        self.interactive = interactive
        self.scan_roms = scan_roms
        self.scan_files = scan_files
        self.scan_configs = scan_configs
        if Settings.get("database_feature") == "1":
            self.update_game_database = True
        else:
            self.update_game_database = False

        if not minimal:
            #self.layout.add_spacer(20)

            from .ScanKickstartGroup import ScanKickstartGroup
            self.scan_kickstart_group = ScanKickstartGroup(self)
            self.layout.add(self.scan_kickstart_group, fill=True)

            #self.layout.add_spacer(20)

            label = fsui.HeadingLabel(self,
                    _("Scan for Kickstarts, Files and Configurations"))
            self.layout.add(label, margin=10)

            self.scan_paths_group = ScanPathsGroup(self)
            self.layout.add(self.scan_paths_group, fill=True)

            #self.layout.add_spacer(20)

        from .ScanProgressGroup import ScanProgressGroup
        self.scan_progress_group = ScanProgressGroup(self)
        self.layout.add(self.scan_progress_group, fill=True)

        self.layout.add_spacer(20)
        #self.layout.add_spacer(20)

        hor_layout = fsui.HorizontalLayout()
        self.layout.add(hor_layout, fill=True)

        hor_layout.add_spacer(10, expand=True)
        if interactive:
            self.scan_button = fsui.Button(self, _("Scan"))
            self.scan_button.on_activate = self.on_scan_button
            hor_layout.add(self.scan_button)
            hor_layout.add_spacer(10)
        else:
            self.scan_button = None
        self.stop_button = fsui.Button(self, _("Abort"))
        self.stop_button.on_activate = self.on_stop_button
        hor_layout.add(self.stop_button)
        hor_layout.add_spacer(10)
        self.close_button = fsui.Button(self, _("Close"))
        self.close_button.on_activate = self.on_close_button
        hor_layout.add(self.close_button)
        hor_layout.add_spacer(10)

        self.layout.add_spacer(10)

        self.set_size(self.layout.get_min_size())
        self.center_on_parent()

        self.old_title = ""
        self.old_status = ""
        self.has_started_scan = False

        self.on_timer()
        fsui.call_later(TIMER_INTERVAL, self.on_timer)
        if not self.interactive:
            self.start_scan()