Пример #1
0
def create_card_type_dialog_ui(
    selectors, front_to_back_id, both_ways_id, three_sided_id, cloze_id, card_type_button, current_card_type, callback
):
    """Creates CardType dialog UI."""

    from mnemosyne.maemo_ui.widgets.common import create_radio_button

    button = create_radio_button(None, "front_to_back_cardtype_button", callback)
    selectors[front_to_back_id]["selector"] = button
    button = create_radio_button(button, "both_ways_cardtype_button", callback)
    selectors[both_ways_id]["selector"] = button
    button = create_radio_button(button, "three_sided_cardtype_button", callback)
    selectors[three_sided_id]["selector"] = button
    button = create_radio_button(button, "cloze_cardtype_button", callback)
    selectors[cloze_id]["selector"] = button
    dialog = gtk.Dialog()
    dialog.set_decorated(False)
    dialog.set_name("dialog")
    dialog.set_has_separator(False)
    pos_x, pos_y = card_type_button.window.get_origin()
    dialog.move(pos_x, pos_y)
    buttons_table = gtk.Table(rows=1, columns=4, homogeneous=True)
    buttons_table.set_col_spacings(16)
    index = 0
    for selector in selectors.values():
        widget = selector["selector"]
        if current_card_type is selector["card_type"]:
            widget.set_active(True)
        buttons_table.attach(widget, index, index + 1, 0, 1, xoptions=gtk.EXPAND, xpadding=6)
        index += 1
    dialog.vbox.pack_start(buttons_table, expand=True, fill=False, padding=12)
    buttons_table.show_all()
    dialog.run()
Пример #2
0
def create_configuration_ui(main_switcher):
    """Creates ConfigureWidget UI."""

    def create_toolbar_container(name, show_tabs=False, width=82, height=480):
        """Creates toolbar container."""

        container = gtk.Notebook()
        container.set_show_tabs(show_tabs)
        container.set_size_request(width, height)
        container.set_name(name)
        return container

    toplevel_table = gtk.Table(rows=1, columns=2)
    toolbar_container = create_toolbar_container('toolbar_container')
    toolbar_table = gtk.Table(rows=5, columns=1, homogeneous=True)
    general_settings_button = widgets.create_radio_button(None, \
        'config_toolbar_general_settings_button', None, width=80, height=80)
    skin_settings_button = widgets.create_radio_button(general_settings_button,
        'config_toolbar_skin_settings_button', None, width=80, height=80)
    tts_settings_button = widgets.create_radio_button(general_settings_button,
        'config_toolbar_tts_settings_button', None, width=80, height=80)
    menu_button = widgets.create_button('main_menu_button', None)
    mode_settings_switcher = gtk.Notebook()
    mode_settings_switcher.set_show_tabs(False)
    mode_settings_switcher.set_show_border(False)
    mode_settings_switcher.set_name('config_mode_settings_switcher')
    general_settings_table = gtk.Table(rows=2, columns=1, homogeneous=True)
    general_settings_table.set_row_spacings(10)
    directories_table = gtk.Table(rows=2, columns=1, homogeneous=True)
    directories_table.set_row_spacings(12)
    sounddir_box = gtk.VBox()
    sounddir_box.set_spacing(1)
    sounddir_label_container = gtk.HBox()
    sounddir_label = gtk.Label('  Sound directory:')
    sounddir_label.set_name('white_label')
    sounddir_container = gtk.Frame()
    sounddir_container.set_name('html_container')
    sounddir_entry = gtk.Entry()
    sounddir_entry.set_name('entry_widget')
    imagedir_box = gtk.VBox()
    imagedir_box.set_spacing(1)
    imagedir_label_container = gtk.HBox()
    imagedir_label = gtk.Label('  Image directory:')
    imagedir_label.set_name('white_label')
    imagedir_container = gtk.Frame()
    imagedir_container.set_name('html_container')
    imagedir_entry = gtk.Entry()
    imagedir_entry.set_name('entry_widget')
    checkboxes_box = gtk.VBox(homogeneous=True)
    checkboxes_box.set_spacing(12)
    fullscreen_table = gtk.Table(rows=1, columns=2)
    fullscreen_table.set_col_spacings(10)
    fullscreen_checkbox = gtk.ToggleButton()
    fullscreen_checkbox.set_size_request(64, 64)
    fullscreen_checkbox.set_name('config_checkbox')
    fullscreen_label = gtk.Label('Start in Fullscreen mode')
    fullscreen_label.set_name('white_label')
    start_with_review_table = gtk.Table(rows=1, columns=2)
    start_with_review_table.set_col_spacings(10)
    start_with_review_checkbox = gtk.ToggleButton()
    start_with_review_checkbox.set_size_request(64, 64)
    start_with_review_checkbox.set_name('config_checkbox')
    start_with_review_label = gtk.Label('Open Review mode at startup')
    start_with_review_label.set_name('white_label')
    skin_settings_table = gtk.Table(rows=1, columns=1)
    font_size_table = gtk.Table(rows=1, columns=3)
    font_size_example_container = gtk.Frame()
    font_size_example_container.set_size_request(-1, 140)
    font_size_example_container.set_name('html_container')
    font_size = widgets.create_gtkhtml()
    font_size_decrease_button = widgets.create_button('down_arrow', None,
        width=64, height=64)
    font_size_increase_button = widgets.create_button('up_arrow', None, 
        width=64, height=64)
    tts_settings_table = gtk.Table(rows=2, columns=1, homogeneous=True)
    tts_settings_table1 = gtk.Table(rows=2, columns=1, homogeneous=True)
    tts_settings_table1.set_row_spacings(10)
    tts_lang_table = gtk.Table(rows=1, columns=3)
    tts_lang_container = widgets.create_button('labels_container', 
        width=-1, height=60)
    tts_lang_label = gtk.Label('default')
    tts_lang_label.set_name('config_tts_label')
    tts_lang_prev_button = widgets.create_button('main_menu_button', None)
    tts_lang_next_button = widgets.create_button('right_arrow', None)
    tts_voice_table = gtk.Table(rows=1, columns=3)
    tts_voice_container = widgets.create_button('labels_container', 
        width=-1, height=60)
    tts_voice_label = gtk.Label('Male')
    tts_voice_label.set_name('config_tts_label')
    tts_voice_prev_button = widgets.create_button('main_menu_button', \
        None)
    tts_voice_next_button = widgets.create_button('right_arrow', None)
    tts_settings_table2 = gtk.Table(rows=2, columns=1, homogeneous=True)
    tts_settings_table2.set_row_spacings(10)
    tts_speed_box = gtk.VBox()
    tts_speed_box.set_spacing(10)
    tts_speed_label_box = gtk.HBox()
    tts_speed_label = gtk.Label('Speed:')
    tts_speed_label.set_name('config_scrollbar_label')
    tts_speed_scrollbar = gtk.HScrollbar()
    tts_speed_scrollbar.set_adjustment(gtk.Adjustment(lower=30, upper=200))
    tts_speed_scrollbar.set_increments(step=1, page=10)
    tts_speed_scrollbar.set_update_policy(gtk.UPDATE_CONTINUOUS)
    tts_speed_scrollbar.set_name('config_scrollbar')
    tts_pitch_box = gtk.VBox()
    tts_pitch_box.set_spacing(10)
    tts_pitch_label_box = gtk.HBox()
    tts_pitch_label = gtk.Label('Pitch:')
    tts_pitch_label.set_name('config_scrollbar_label')
    tts_pitch_scrollbar = gtk.HScrollbar()
    tts_pitch_scrollbar.set_update_policy(gtk.UPDATE_CONTINUOUS)
    tts_pitch_scrollbar.set_adjustment(gtk.Adjustment(lower=0, upper=100))
    tts_pitch_scrollbar.set_increments(step=1, page=10)
    tts_pitch_scrollbar.set_name('config_scrollbar')
    # packing widgets
    toolbar_table.attach(general_settings_button, 0, 1, 0, 1, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    toolbar_table.attach(skin_settings_button, 0, 1, 1, 2, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    toolbar_table.attach(tts_settings_button, 0, 1, 2, 3, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    toolbar_table.attach(menu_button, 0, 1, 4, 5, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    toolbar_container.add(toolbar_table)
    toplevel_table.attach(toolbar_container, 0, 1, 0, 1, \
        xoptions=gtk.SHRINK, yoptions=gtk.SHRINK|gtk.EXPAND|gtk.FILL)
    imagedir_container.add(imagedir_entry)
    imagedir_label_container.pack_start(imagedir_label, expand=False, 
        fill=False)
    imagedir_box.pack_start(imagedir_label_container)
    imagedir_box.pack_end(imagedir_container)
    sounddir_container.add(sounddir_entry)
    sounddir_label_container.pack_start(sounddir_label, expand=False, \
        fill=False)
    sounddir_box.pack_start(sounddir_label_container)
    sounddir_box.pack_end(sounddir_container)
    directories_table.attach(sounddir_box, 0, 1, 0, 1, xpadding=14, \
        xoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, \
        yoptions=gtk.EXPAND|gtk.SHRINK)
    directories_table.attach(imagedir_box, 0, 1, 1, 2, xpadding=14, \
        xoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, \
        yoptions=gtk.EXPAND|gtk.SHRINK)
    start_with_review_table.attach(start_with_review_checkbox, 0, 1, 0, 1, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND|gtk.FILL)
    start_with_review_table.attach(start_with_review_label, 1, 2, 0, 1, \
        xoptions=gtk.FILL, yoptions=gtk.EXPAND|gtk.FILL)
    fullscreen_table.attach(fullscreen_checkbox, 0, 1, 0, 1, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND|gtk.SHRINK)
    fullscreen_table.attach(fullscreen_label, 1, 2, 0, 1, \
        xoptions=gtk.FILL, yoptions=gtk.EXPAND|gtk.FILL)
    checkboxes_box.pack_start(fullscreen_table)
    checkboxes_box.pack_end(start_with_review_table)
    general_settings_table.attach(directories_table, 0, 1, 0, 1, \
        xoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, ypadding=10, 
        yoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK)
    general_settings_table.attach(checkboxes_box, 0, 1, 1, 2, \
        xoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, xpadding=13, \
        yoptions=gtk.EXPAND|gtk.SHRINK)
    mode_settings_switcher.append_page(general_settings_table)
    font_size_example_container.add(font_size)
    font_size_table.attach(font_size_decrease_button, 0, 1, 0, 1, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    font_size_table.attach(font_size_example_container, 1, 2, 0, 1, \
        xoptions=gtk.EXPAND|gtk.FILL, xpadding=14, \
        yoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK)
    font_size_table.attach(font_size_increase_button, 2, 3, 0, 1, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    skin_settings_table.attach(font_size_table, 0, 1, 0, 1, \
        xoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, yoptions=gtk.EXPAND)
    mode_settings_switcher.append_page(skin_settings_table)
    tts_voice_container.add(tts_voice_label)
    tts_voice_table.attach(tts_voice_prev_button, 0, 1, 0, 1, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    tts_voice_table.attach(tts_voice_container, 1, 2, 0, 1, \
        xoptions=gtk.EXPAND|gtk.FILL, yoptions=gtk.SHRINK)
    tts_voice_table.attach(tts_voice_next_button, 2, 3, 0, 1, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    tts_lang_container.add(tts_lang_label)
    tts_lang_table.attach(tts_lang_prev_button, 0, 1, 0, 1, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    tts_lang_table.attach(tts_lang_container, 1, 2, 0, 1, \
        xoptions=gtk.EXPAND|gtk.FILL, yoptions=gtk.SHRINK)
    tts_lang_table.attach(tts_lang_next_button, 2, 3, 0, 1, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    tts_speed_label_box.pack_start(tts_speed_label, expand=False, fill=False)
    tts_speed_box.pack_start(tts_speed_label_box, expand=False, fill=False)
    tts_speed_box.pack_end(tts_speed_scrollbar)
    tts_pitch_label_box.pack_start(tts_pitch_label, expand=False, fill=False)
    tts_pitch_box.pack_start(tts_pitch_label_box, expand=False, fill=False)
    tts_pitch_box.pack_end(tts_pitch_scrollbar)
    tts_settings_table2.attach(tts_speed_box, 0, 1, 0, 1, \
        xoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, \
        yoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK)
    tts_settings_table2.attach(tts_pitch_box, 0, 1, 1, 2, \
        xoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, \
        yoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK)
    tts_settings_table1.attach(tts_lang_table, 0, 1, 0, 1, \
        xoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, \
        yoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK)
    tts_settings_table1.attach(tts_voice_table, 0, 1, 1, 2, \
        xoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, \
        yoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK)
    tts_settings_table.attach(tts_settings_table1, 0, 1, 0, 1, \
        xoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, \
        yoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK)
    tts_settings_table.attach(tts_settings_table2, 0, 1, 1, 2, \
        xoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, \
        yoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK)
    mode_settings_switcher.append_page(tts_settings_table)
    toplevel_table.attach(mode_settings_switcher, 1, 2, 0, 1, \
        xoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, xpadding = 14, \
        yoptions=gtk.EXPAND|gtk.FILL|gtk.SHRINK, ypadding=14)
    toplevel_table.show_all()
    return main_switcher.append_page(toplevel_table), tts_settings_button, \
        general_settings_button, skin_settings_button, mode_settings_switcher,\
        fullscreen_checkbox, start_with_review_checkbox, imagedir_entry, \
        sounddir_entry, tts_voice_label, tts_pitch_label, tts_lang_label, \
        tts_speed_label, tts_speed_scrollbar, tts_pitch_scrollbar, font_size, \
        tts_lang_prev_button, tts_lang_next_button, menu_button, \
        font_size_decrease_button, font_size_increase_button, \
        tts_voice_prev_button, tts_voice_next_button
Пример #3
0
def create_statistics_ui(main_switcher):
    """Creates MaemoStatisticsWidget UI."""

    toplevel_table = gtk.Table(rows=1, columns=2)
    toolbar_container = widgets.create_toolbar_container('toolbar_container')
    toolbar_table = gtk.Table(rows=5, columns=1, homogeneous=True)
    # create toolbar buttons
    current_card_button = widgets.create_radio_button(None, \
        'stat_toolbar_current_card_button', None, width=80, height=80)
    common_button = widgets.create_radio_button(current_card_button, \
        'stat_toolbar_common_stat_button', None, width=80, height=80)
    tags_button = widgets.create_radio_button(common_button, \
        'stat_toolbar_tags_stat_button', None, width=80, height=80)
    menu_button = widgets.create_button('main_menu_button', None)
    # create mode switcher
    mode_statistics_switcher = gtk.Notebook()
    mode_statistics_switcher.set_show_tabs(False)
    mode_statistics_switcher.set_show_border(False)
    mode_statistics_switcher.set_name('config_mode_settings_switcher')
    # packing toolbar buttons
    toolbar_table.attach(current_card_button,  0, 1, 0, 1, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    toolbar_table.attach(common_button, 0, 1, 1, 2, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    toolbar_table.attach(tags_button, 0, 1, 2, 3, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    toolbar_table.attach(menu_button, 0, 1, 4, 5, \
        xoptions=gtk.SHRINK, yoptions=gtk.EXPAND)
    toolbar_container.add(toolbar_table)
    toplevel_table.attach(toolbar_container, 0, 1, 0, 1, \
        xoptions=gtk.SHRINK, yoptions=gtk.SHRINK|gtk.EXPAND|gtk.FILL)
    # create widgets for current card mode
    current_card_table = gtk.Table(rows=1, columns=1, homogeneous=False)
    current_card_frame = gtk.Frame()
    current_card_frame.set_name('html_container')
    current_card_eventbox = gtk.EventBox()
    current_card_eventbox.set_visible_window(True)
    current_card_eventbox.set_name('viewport_widget')
    current_card_scrolledwindow = gtk.ScrolledWindow()
    current_card_scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, \
        gtk.POLICY_AUTOMATIC)
    current_card_scrolledwindow.set_name('scrolled_window')
    current_card_html = widgets.create_gtkhtml()
    # packing widgets for current card mode
    current_card_table.attach(current_card_frame, 1, 2, 0, 1, \
        xoptions=gtk.SHRINK|gtk.EXPAND|gtk.FILL, \
        yoptions=gtk.SHRINK|gtk.EXPAND|gtk.FILL, \
        xpadding=30, ypadding=30)
    current_card_scrolledwindow.add(current_card_html)
    current_card_eventbox.add(current_card_scrolledwindow)
    current_card_frame.add(current_card_eventbox)
    mode_statistics_switcher.append_page(current_card_table)
    # create widgets for total cards mode
    total_card_table = gtk.Table(rows=1, columns=1, homogeneous=False)
    total_card_frame = gtk.Frame()
    total_card_frame.set_name('html_container')
    total_card_eventbox = gtk.EventBox()
    total_card_eventbox.set_visible_window(True)
    total_card_eventbox.set_name('viewport_widget')
    total_card_scrolledwindow = gtk.ScrolledWindow()
    total_card_scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, \
        gtk.POLICY_AUTOMATIC)
    total_card_scrolledwindow.set_name('scrolled_window')
    total_card_html = widgets.create_gtkhtml()
    # packing widgets for total cards mode
    total_card_table.attach(total_card_frame, 1, 2, 0, 1, \
        xoptions=gtk.SHRINK|gtk.EXPAND|gtk.FILL, \
        yoptions=gtk.SHRINK|gtk.EXPAND|gtk.FILL, \
        xpadding=30, ypadding=30)
    total_card_scrolledwindow.add(total_card_html)
    total_card_eventbox.add(total_card_scrolledwindow)
    total_card_frame.add(total_card_eventbox)
    mode_statistics_switcher.append_page(total_card_table)
    # create widgets for grades section
    tags_card_table = gtk.Table(rows=1, columns=1, homogeneous=False)
    tags_card_frame = gtk.Frame()
    tags_card_frame.set_name('html_container')
    tags_card_eventbox = gtk.EventBox()
    tags_card_eventbox.set_visible_window(True)
    tags_card_eventbox.set_name('viewport_widget')
    tags_card_scrolledwindow = gtk.ScrolledWindow()
    tags_card_scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, \
        gtk.POLICY_AUTOMATIC)
    tags_card_scrolledwindow.set_name('scrolled_window')
    tags_card_html = widgets.create_gtkhtml()
    # packing widgets for grades section
    tags_card_table.attach(tags_card_frame, 1, 2, 0, 1, \
        xoptions=gtk.SHRINK|gtk.EXPAND|gtk.FILL, \
        yoptions=gtk.SHRINK|gtk.EXPAND|gtk.FILL, \
        xpadding=30, ypadding=30)
    tags_card_scrolledwindow.add(tags_card_html)
    tags_card_eventbox.add(tags_card_scrolledwindow)
    tags_card_frame.add(tags_card_eventbox)
    mode_statistics_switcher.append_page(tags_card_table)
    # packing widgets
    toplevel_table.attach(mode_statistics_switcher, 1, 2, 0, 1, \
        xoptions=gtk.SHRINK|gtk.EXPAND|gtk.FILL, \
        yoptions=gtk.SHRINK|gtk.EXPAND|gtk.FILL)
    toplevel_table.show_all()
    return main_switcher.append_page(toplevel_table), \
        mode_statistics_switcher, menu_button, current_card_button, \
        common_button, tags_button, current_card_html, total_card_html, \
        tags_card_html
Пример #4
0
def create_about_ui(main_switcher, image_name):
    """Creates AboutWidget UI."""

    toplevel_table = gtk.Table(rows=1, columns=2)
    # create toolbar container
    toolbar_container = widgets.create_toolbar_container("three_button_container")
    toolbar_table = gtk.Table(rows=5, columns=1, homogeneous=True)
    # create mode switcher
    mode_switcher = gtk.Notebook()
    mode_switcher.set_show_tabs(False)
    mode_switcher.set_show_border(False)
    mode_switcher.set_name("config_mode_settings_switcher")
    # create toolbar elements
    about_button = widgets.create_radio_button(None, "help_toolbar_about_button", None, width=80, height=80)
    help_button = widgets.create_radio_button(about_button, "help_toolbar_help_button", None, width=80, height=80)
    menu_button = widgets.create_button("main_menu_button")
    info_container = gtk.Notebook()
    info_container.set_show_border(False)
    info_container.set_show_tabs(False)
    info_box = gtk.VBox()
    hbutton_box = gtk.HButtonBox()
    text_box = gtk.HBox()
    logo_box = gtk.HBox()
    label_left = gtk.Label()
    label_left.set_use_markup(True)
    label_left.set_markup(
        "<span foreground='white' size='small'><b>"
        "Developers:</b></span>\n<span foreground='white' size='small'>"
        "Max Usachev |</span> <span foreground='#299BFC' size='small'>"
        "[email protected]</span>\n<span foreground='white' size="
        "'small'>Ed Bartosh |</span> <span foreground='#299BFC' size="
        "'small'>[email protected]</span>\n<span foreground='white' "
        "size='small'>Vlad Vasiliev |</span> <span foreground='#299BFC' "
        "size='small'>[email protected]</span>\n\n<span foreground='white' "
        "size='small'><b>Designer:</b>\n</span><span foreground='white' "
        "size='small'>Andrew Zhilin |</span> <span foreground='#299BFC' "
        "size='small'>[email protected]</span>\n\n<span foreground="
        "'white' size='small'><b>Development team:</b></span>\n<span "
        "foreground='#299BFC' size='small'>[email protected]</span>"
    )
    label_right = gtk.Label()
    label_right.set_use_markup(True)
    label_right.set_markup(
        "<span foreground='white' size='small'><b>"
        "Special Thanks To:</b></span>\n<span foreground='white' size="
        "'small'>Peter Bienstman</span>\n<span foreground='#299BFC' size="
        "'small'>[email protected]</span>\n<span foreground="
        "'#299BFC' size='small'>http://www.mnemosyne-proj.org/</span>"
        "\n<span size='x-large'></span><span foreground='white' size="
        "'small'>\nGSoC 2009</span>\n<span foreground='#299BFC' size='"
        "small'>http://socghop.appspot.com/</span>\n\n<span size='x-large'>"
        "</span><span foreground='white' size='small'>\nMaemo community"
        "</span>\n<span foreground='#299BFC' size='small'>"
        "http://maemo.org/</span>"
    )
    logo = gtk.Image()
    logo.set_from_file(image_name)
    program_label = gtk.Label()
    program_label.set_justify(gtk.JUSTIFY_CENTER)
    program_label.set_use_markup(True)
    program_label.set_markup(
        "<span foreground='white' size='large'><b>"
        "Mnemosyne for Maemo</b></span>\n<span foreground='white' size="
        "'large'>version 2.0.0~beta11</span>"
    )
    # create help widgets
    help_table = gtk.Table(rows=1, columns=1, homogeneous=False)
    help_frame = gtk.Frame()
    help_frame.set_name("html_container")
    help_eventbox = gtk.EventBox()
    help_eventbox.set_visible_window(True)
    help_eventbox.set_name("viewport_widget")
    help_scrolledwindow = gtk.ScrolledWindow()
    help_scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
    help_scrolledwindow.set_name("scrolled_window")
    # help_html = widgets.create_gtkhtml(open(help_html).read())
    help_html = widgets.create_gtkhtml()
    # packing widgets
    logo_box.pack_start(logo, expand=False, fill=False, padding=10)
    logo_box.pack_end(program_label, expand=False, fill=False)
    hbutton_box.pack_start(logo_box)
    text_box.pack_start(label_left)
    text_box.pack_end(label_right)
    info_box.pack_start(hbutton_box, expand=False)
    info_box.pack_end(text_box)
    info_container.append_page(info_box)
    toolbar_table.attach(about_button, 0, 1, 1, 2, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
    toolbar_table.attach(help_button, 0, 1, 0, 1, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
    toolbar_table.attach(menu_button, 0, 1, 4, 5, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
    toolbar_container.append_page(toolbar_table)
    toplevel_table.attach(
        toolbar_container, 0, 1, 0, 1, xoptions=gtk.SHRINK, yoptions=gtk.SHRINK | gtk.EXPAND | gtk.FILL
    )
    mode_switcher.append_page(info_container)
    help_table.attach(
        help_frame,
        1,
        2,
        0,
        1,
        xoptions=gtk.SHRINK | gtk.EXPAND | gtk.FILL,
        yoptions=gtk.SHRINK | gtk.EXPAND | gtk.FILL,
        xpadding=30,
        ypadding=30,
    )
    help_scrolledwindow.add(help_html)
    help_eventbox.add(help_scrolledwindow)
    help_frame.add(help_eventbox)
    mode_switcher.append_page(help_table)
    toplevel_table.attach(
        mode_switcher,
        1,
        2,
        0,
        1,
        xoptions=gtk.SHRINK | gtk.EXPAND | gtk.FILL,
        yoptions=gtk.SHRINK | gtk.EXPAND | gtk.FILL,
    )
    toplevel_table.show_all()
    return main_switcher.append_page(toplevel_table), mode_switcher, menu_button, about_button, help_button, help_html