Exemple #1
0
    def __init__(self):

        self.__current_page = 0
        self.__pages = []

        data = open(os.path.join(_PATH, "tour_C.dat")).read()
        self.__parse_tour(data)

        Configurator.__init__(self)

        self.__tour_box = Widget()

        # toolbar elements
        btn_toc = ToolbarButton(theme.mb_btn_toc_1)
        btn_toc.connect_clicked(self.__on_btn_toc)

        btn_previous = ToolbarButton(theme.mb_btn_previous_1)
        btn_previous.connect_clicked(self.__on_btn_previous)

        btn_next = ToolbarButton(theme.mb_btn_next_1)
        btn_next.connect_clicked(self.__on_btn_next)

        # toolbar
        self.__toolbar = Toolbar()
        self.__toolbar.set_toolbar(btn_previous, btn_toc, btn_next)

        # arrangement
        self.__arr = Arrangement()
        self.__arr.connect_resized(self.__update_layout)
        self.__arr.add(self.__tour_box, "content")
        self.__arr.add(self.__toolbar, "toolbar")
        self.add(self.__arr)
Exemple #2
0
    def render_this(self):

        if (self.__needs_update):
            self.__update_list()
            self.__needs_update = False

        Configurator.render_this(self)
Exemple #3
0
    def __init__(self):
    
        self.__have_unapplied_changes = False
    
        Configurator.__init__(self)
        
        self.__list = ThumbableGridView()
        self.add(self.__list)
        
        #lbl = LabelItem("Orientation:")
        #self.__list.append_item(lbl)
        
        if (platforms.MAEMO5):
            chbox = OptionItem("Landscape Mode", config.ORIENTATION_LANDSCAPE,
                               "Portrait Mode", config.ORIENTATION_PORTRAIT,
                               "Automatic", config.ORIENTATION_AUTOMATIC)
        else:
            chbox = OptionItem("Landscape Mode", config.ORIENTATION_LANDSCAPE,
                               "Portrait Mode", config.ORIENTATION_PORTRAIT)
        
        chbox.connect_changed(self.__on_select_orientation)
        chbox.select_by_value(config.orientation())
        self.__list.append_item(chbox)

        # abusing empty label for space... TODO: implement space item :)
        #lbl = LabelItem("")
        #self.__list.append_item(lbl)

        chk = CheckBoxItem("Swap volume/zoom keys in portrait mode",
                           config.portrait_swap_volume())
        chk.connect_checked(self.__on_check_swap)
        self.__list.append_item(chk)
Exemple #4
0
    def __init__(self):

        # table: clientid -> path_stack
        self.__path_stacks = {}

        self.__current_file = None
        self.__artist = ""
        self.__title = ""

        Configurator.__init__(self)

        self.__list = ThumbableGridView()
        self.add(self.__list)

        lbl = LabelItem("MediaBox WebAccess lets you access your media and " \
                        "remote-control MediaBox with a web browser.")
        self.__list.append_item(lbl)

        lbl = LabelItem("This is still an experimental feature and not " \
                        "fully working yet!")
        self.__list.append_item(lbl)

        chbox = OptionItem("WebAccess is Off", "off", "WebAccess is On", "on")
        chbox.select_by_value("off")
        chbox.connect_changed(self.__on_toggle_webaccess)
        self.__list.append_item(chbox)

        self.__lbl_info = LabelItem("")
        self.__list.append_item(self.__lbl_info)
Exemple #5
0
    def __init__(self):
    
        Configurator.__init__(self)

        self.__list = ThumbableGridView()
        self.add(self.__list)
                  
        self.__update_list()
    def __init__(self):

        self.__components = []

        Configurator.__init__(self)

        self.__list = ThumbableGridView()
        self.add(self.__list)
Exemple #7
0
    def __init__(self):

        Configurator.__init__(self)

        self.__vbox = VBox()
        self.__vbox.set_spacing(12)
        self.add(self.__vbox)

        lbl = Label("Voice:", theme.font_mb_plain,
                    theme.color_mb_listitem_text)
        self.__vbox.add(lbl)

        hbox = HBox()
        hbox.set_size(600, 80)
        self.__vbox.add(hbox)

        current_voice = config.get_voice()
        chbox = ChoiceBox("Male A", "m1", "Male B", "m2", "Male C", "m3",
                          "Male D", "m4", "Female A", "f1", "Female B", "f2",
                          "Female C", "f3", "Female D", "f4", "Whisper",
                          "whisper")
        chbox.select_by_value(current_voice)
        chbox.connect_changed(self.__on_select_voice)
        hbox.add(chbox)

        button = Button("Test Voice")
        button.connect_clicked(self.__on_test_voice)
        hbox.add(button)

        pitch = config.get_pitch()
        self.__lbl_pitch = Label("Pitch: %d" % pitch, theme.font_mb_plain,
                                 theme.color_mb_listitem_text)
        self.__vbox.add(self.__lbl_pitch)

        slider = Slider(theme.mb_slider_gauge)
        slider.set_background_color(theme.color_mb_gauge)
        slider.connect_value_changed(self.__on_set_pitch)
        slider.set_value(pitch / 99.0)
        slider.set_size(600, 40)
        self.__vbox.add(slider)

        speed = config.get_speed()
        self.__lbl_speed = Label("Words per minute: %d" % speed,
                                 theme.font_mb_plain,
                                 theme.color_mb_listitem_text)
        self.__vbox.add(self.__lbl_speed)

        slider = Slider(theme.mb_slider_gauge)
        slider.set_background_color(theme.color_mb_gauge)
        slider.connect_value_changed(self.__on_set_speed)
        slider.set_value((speed - 80) / 290.0)
        slider.set_size(600, 40)
        self.__vbox.add(slider)

        lbl = Label(
            "Talk Navigation powered by espeak - http://espeak.sourceforge.net",
            theme.font_mb_tiny, theme.color_mb_listitem_text)
        self.__vbox.add(lbl)
Exemple #8
0
 def _visibility_changed(self):
 
     Configurator._visibility_changed(self)
     
     if (not self.is_visible() and self.__have_unapplied_changes):
         self.__have_unapplied_changed = False
         
         orientation = config.orientation()
         self.__set_orientation(orientation)
Exemple #9
0
    def __init__(self):

        Configurator.__init__(self)

        self.__list = ThumbableGridView()
        self.add(self.__list)

        if (platforms.MAEMO4 or platforms.MAEMO5):
            if (platforms.MAEMO4): tracker = "Metalayer Crawler"
            elif (platforms.MAEMO5): tracker = "Tracker"
            lbl = LabelItem("Your device provides a tracker service (%s) for "
                            "discovering new media. MediaBox can use it for "
                            "scanning for new media." % tracker)
            self.__list.append_item(lbl)

            btn = ButtonItem("Look for new media now")
            btn.connect_clicked(self.__on_click_update)
            self.__list.append_item(btn)

            chk = CheckBoxItem("Look for new media at startup (recommended)",
                               mb_config.scan_at_startup())
            chk.connect_checked(self.__on_check_startup)
            self.__list.append_item(chk)

        else:
            lbl = LabelItem("Your device does not provide a tracker service for "
                            "discovering new media automatically. You can " \
                            "scan for new media manually by selecting " \
                            "'Scan for Media' from the item popup menu of a "\
                            "local folder.")
            self.__list.append_item(lbl)

            lbl = LabelItem("")
            self.__list.append_item(lbl)
        #end if

        lbl = LabelItem("By clearing the index, MediaBox forgets about all "
                        "media files until you have it scan for media again.")
        self.__list.append_item(lbl)

        btn = ButtonItem("Clear index now")
        btn.connect_clicked(self.__on_click_clear)
        self.__list.append_item(btn)


        lbl = LabelItem("At startup, MediaBox removes media that no longer "
                        "exists from the index. If necessary, you can trigger " \
                        "this manually anytime, too")
        self.__list.append_item(lbl)

        btn = ButtonItem("Remove dead entries from index")
        btn.connect_clicked(self.__on_click_bury)
        self.__list.append_item(btn)
Exemple #10
0
 def render_this(self):
 
     x, y = self.get_screen_pos()
     w, h = self.get_size()
     screen = self.get_screen()
     
     self.__lbl_mem_size.set_text("Resident set size: %0.02f MB" \
                                  % self.__get_mem_size())
     self.__lbl_bpp.set_text("Screen: %d x %d x %d" \
                             % (gtk.gdk.screen_width(),
                                gtk.gdk.screen_height(),
                                screen.get_color_depth()))
     
     #self.__vbox.set_geometry(32, 32, w - 64, h - 64)
     screen.fill_area(x, y, w, h, theme.color_mb_background)
     Configurator.render_this(self)
Exemple #11
0
    def __init__(self):

        Configurator.__init__(self)

        self.__list = ThumbableGridView()
        self.add(self.__list)

        lbl = LabelItem("Behavior after a phone call:")
        self.__list.append_item(lbl)

        chbox = OptionItem("Resume playing", config.RESUME_AUTOMATIC,
                           "Stay paused", config.RESUME_MANUAL)
        chbox.connect_changed(self.__on_select_phonecall_resume)
        self.__list.append_item(chbox)

        self.__label_info = LabelItem("")
        self.__list.append_item(self.__label_info)
        chbox.select_by_value(config.get_phonecall_resume())
Exemple #12
0
    def __init__(self):
    
        Configurator.__init__(self)
        
        self.__vbox = VBox()
        self.__vbox.set_spacing(12)
        self.add(self.__vbox)


        lbl = Label("Log Level:",
                    theme.font_mb_tiny, theme.color_list_item_text)
        self.__vbox.add(lbl)

        log_level = logging.get_level()
        chbox = ChoiceBox("Off", logging.OFF,
                          "Error", logging.ERROR,
                          "Warning", logging.WARNING,
                          "Info", logging.INFO,
                          "Debug", logging.DEBUG)
        chbox.select_by_value(log_level)
        chbox.connect_changed(self.__on_select_log_level)
        self.__vbox.add(chbox)


        lbl = Label("Running since: %s" % time.asctime(time.localtime(values.START_TIME)),
                    theme.font_mb_tiny, theme.color_list_item_text)
        self.__vbox.add(lbl)

        lbl = Label("Device: %s" % maemo.get_product_code(),
                    theme.font_mb_tiny, theme.color_list_item_text)
        self.__vbox.add(lbl)

        lbl = Label("OS: %s" % commands.getoutput("uname -a"),
                    theme.font_mb_tiny, theme.color_list_item_text)
        self.__vbox.add(lbl)
        lbl.set_size(560, 0)

        self.__lbl_mem_size = Label("",
                    theme.font_mb_tiny, theme.color_list_item_text)
        self.__vbox.add(self.__lbl_mem_size)
        
        self.__lbl_bpp = Label("",
                    theme.font_mb_tiny, theme.color_list_item_text)
        self.__vbox.add(self.__lbl_bpp)
Exemple #13
0
    def __init__(self):

        Configurator.__init__(self)

        self.__list = ThumbableGridView()
        self.add(self.__list)

        lbl = LabelItem("What should MediaBox do if multiple versions of a " \
                        "video are available:")
        self.__list.append_item(lbl)

        chbox = OptionItem("let me choose", config.QUALITY_ASK,
                           "automatically choose high quality",
                           config.QUALITY_HIGH,
                           "automatically choose low quality",
                           config.QUALITY_LOW)
        chbox.connect_changed(self.__on_select_quality)
        chbox.select_by_value(config.get_quality())
        self.__list.append_item(chbox)
Exemple #14
0
    def __init__(self):

        Configurator.__init__(self)

        self.__list = ThumbableGridView()
        self.add(self.__list)

        lbl = LabelItem("Keep display lit:")
        #lbl.set_font(theme.font_mb_headline)
        self.__list.append_item(lbl)

        chbox = OptionItem("never", "no", "while playing", "playing")
        #"yes", "yes")
        chbox.connect_changed(self.__on_select_display_lit)
        self.__list.append_item(chbox)

        self.__label_lit = LabelItem("")
        self.__list.append_item(self.__label_lit)
        chbox.select_by_value(config.get_display_lit())
Exemple #15
0
    def __init__(self):
    
        self.__sleep_handler = None
        self.__wakeup_handler = None
        
        self.__sleep_time = config.get_sleep_time()
        self.__wakeup_time = config.get_wakeup_time()
        
    
        Configurator.__init__(self)
                
        self.__list = ThumbableGridView()
        self.add(self.__list)
        
        #img = Image(theme.mb_sleep_timer_sleep)
        #hbox.add(img, False)
        
        chk = CheckBoxItem("Fall asleep and stop playing at", config.get_sleep())
        chk.connect_checked(self.__on_check_sleep)
        self.__list.append_item(chk)

        btn = ButtonItem("%02d:%02d" % self.__sleep_time)
        btn.connect_clicked(self.__on_set_sleep, btn)
        self.__list.append_item(btn)

        #img = Image(theme.mb_sleep_timer_wakeup)
        #hbox.add(img, False)

        chk = CheckBoxItem("Wake up at and start playing at", config.get_wakeup())
        chk.connect_checked(self.__on_check_wakeup)
        self.__list.append_item(chk)

        btn = ButtonItem("%02d:%02d" % self.__wakeup_time)
        btn.connect_clicked(self.__on_set_wakeup, btn)
        self.__list.append_item(btn)

        lbl = LabelItem("MediaBox will start playing the file that is " \
                        "selected at the moment of waking up.")
        lbl.set_icon(theme.mb_sleep_timer_wakeup)
        self.__list.append_item(lbl)
Exemple #16
0
    def __init__(self):
    
        Configurator.__init__(self)
        
        self.__vbox = VBox()
        self.__vbox.set_spacing(12)
        #self.__vbox.set_geometry(0, 0, 620, 370)
        self.add(self.__vbox)
        
        lbl = Label("FM radio region:\n",
                    theme.font_mb_plain, theme.color_mb_listitem_text)
        self.__vbox.add(lbl)

        chbox = ChoiceBox("US/Europe", "EUR",
                          "Japan", "JPN")
        chbox.select_by_value(config.get_region())
        chbox.connect_changed(self.__on_select_fm_band)
        self.__vbox.add(chbox)

        lbl = Label("\nDepending on the laws in your country,\n"
                    "operating a FM radio with an inappropriate\n"
                    "region setting may be illegal.",
                    theme.font_mb_plain, theme.color_mb_listitem_text)
        self.__vbox.add(lbl)
Exemple #17
0
 def set_size(self, w, h):
 
     Configurator.set_size(self, w, h)
     for item in self.__list.get_items():
         item.set_size(w, 80)
Exemple #18
0
    def _visibility_changed(self):

        self.__current_page = 0
        Configurator._visibility_changed(self)
Exemple #19
0
    def render_this(self):

        Configurator.render_this(self)
        self.__render_tour()