Esempio n. 1
0
    def __init__(self, uri):
        builder = Gtk.Builder()
        builder.set_translation_domain(tailsgreeter.__appname__)
        builder.add_from_file(
            os.path.join(tailsgreeter.GLADE_DIR, "helpwindow.glade"))
        builder.connect_signals(self)
        TranslatableWindow.__init__(self, builder.get_object("help_dialog"))
        self.html_help = WebKit.WebView()

        def cb_request_starting(web_view,
                                web_frame,
                                web_ressource,
                                request,
                                response,
                                user_data=None):
            if not request.get_uri().startswith("file://"):
                webbrowser.open_new(request.get_uri())
                request.set_uri(web_frame.get_uri())

        self.html_help.connect("resource-request-starting",
                               cb_request_starting)
        self.help_container = builder.get_object("scrolled_help")
        self.html_help.load_uri(uri)
        self.help_container.add_child(builder, self.html_help, None)
        self.html_help.show()
        self.window.resize(self.window.get_size()[0],
                           self.window.get_screen().get_height())
        self.window.run()
Esempio n. 2
0
    def __init__(self, greeter):
        self.greeter = greeter

        builder = Gtk.Builder()
        builder.set_translation_domain(tailsgreeter.__appname__)
        builder.add_from_file(os.path.join(tailsgreeter.GLADE_DIR, "optionswindow.glade"))
        builder.connect_signals(self)
        self.entry_password = builder.get_object("password_entry")
        self.entry_password2 = builder.get_object("password_entry2")
        self.warning_label = builder.get_object("warning_label")
        self.warning_area = builder.get_object("warning_area")
        self.camouflage_checkbox = builder.get_object("camouflage_checkbox")
        self.macspoof_checkbox = builder.get_object("macspoof_checkbox")
        self.macspoof_checkbox.set_active(True)
        self.netconf_direct = builder.get_object("netconf_direct")
        self.netconf_direct.set_active(True)

        self.dialog = builder.get_object("options_dialog")
        TranslatableWindow.__init__(self, self.dialog)
        self.window.set_visible(False)

        self.entry_password.set_visibility(False)
        self.entry_password2.set_visibility(False)

        def cb_pw_changed(*args):
            self.warning_area.hide()
            # compact the window
            self.window.resize(1, 1)

        self.entry_password.connect("changed", cb_pw_changed)
        self.entry_password2.connect("changed", cb_pw_changed)
        cb_pw_changed()

        ignore, langpanel_height = self.greeter.langpanel.window.get_size()
        screen_width = self.dialog.get_screen().get_width()
        screen_height = self.dialog.get_screen().get_height()
        free_height = screen_height - langpanel_height

        # These magic values specify a "nice" size for the options
        # dialog. They may need to be revised, or (ideally) be set to
        # what GTK thinks is necessary for the window to fit
        # everything without showing a scrollbar, if that's possible.
        nice_width = 700
        nice_height = 740

        width_request = min(nice_width, screen_width)
        height_request = min(nice_height, free_height)

        # For low (height-wise) resolution we have to un-center the
        # dialog and move it to the top of the screen, so it won't
        # shadow the language panel.
        if screen_height - height_request < 2*langpanel_height:
            self.dialog.set_position(Gtk.WindowPosition.NONE)
            self.dialog.move((screen_width-width_request)/2, 0)

        self.dialog.set_size_request(width_request, height_request)
Esempio n. 3
0
    def __init__(self):
        builder = Gtk.Builder()
        builder.set_translation_domain(tailsgreeter.__appname__)
        builder.add_from_file(os.path.join(tailsgreeter.GLADE_DIR, "langdialog.glade"))
        self.dialog = builder.get_object("languages_dialog")
        self.treeview = builder.get_object("languages_treeview")
        self.liststore = builder.get_object("languages_liststore")
        builder.connect_signals(self)

        tvcolumn = Gtk.TreeViewColumn(_("Language"))
        self.treeview.append_column(tvcolumn)
        cell = Gtk.CellRendererText()
        tvcolumn.pack_start(cell, True)
        tvcolumn.add_attribute(cell, 'text', 1)

        TranslatableWindow.__init__(self, self.dialog)
Esempio n. 4
0
    def __init__(self, greeter):
        self.greeter = greeter

        builder = Gtk.Builder()
        builder.set_translation_domain(tailsgreeter.__appname__)
        builder.add_from_file(
            os.path.join(tailsgreeter.GLADE_DIR, "persistencewindow.glade"))
        builder.connect_signals(self)

        self.moreoptions = False

        # Sets self.window
        self.login_dialog = builder.get_object("login_dialog")
        TranslatableWindow.__init__(self, self.login_dialog)
        self.btn_persistence_yes = builder.get_object("persistence_yes_button")
        self.btn_persistence_no = builder.get_object("persistence_no_button")
        self.passphrase_box = builder.get_object("passphrase_box")
        self.entry_passphrase = builder.get_object("passphrase_entry")
        self.btn_moreoptions_yes = builder.get_object("moreoptions_yes_button")
        self.btn_moreoptions_no = builder.get_object("moreoptions_no_button")
        self.btn_login = builder.get_object("login_button")
        self.btn_next = builder.get_object("next_button")
        self.box_persistence = builder.get_object("persistence_box")
        self.readonly_checkbutton = builder.get_object("readonly_checkbutton")
        self.warning_label = builder.get_object("warning_label")
        self.warning_area = builder.get_object("warning_area")
        self.warning_image = builder.get_object("warning_area")
        # self.spinner = builder.get_object("spinner")
        self.checked_img_moreoptions_yes = builder.get_object(
            "moreoptions_yes_checked_img")
        self.checked_img_moreoptions_no = builder.get_object(
            "moreoptions_no_checked_img")
        self.checked_img_persistence_yes = builder.get_object(
            "persistence_yes_checked_img")
        self.checked_img_persistence_no = builder.get_object(
            "persistence_no_checked_img")

        self.warning_area.hide()

        # FIXME: list_containers may raise exceptions. Deal with that.
        self.containers = [{
            "path": container,
            "locked": True
        } for container in self.greeter.persistence.list_containers()]
        if len(self.containers) == 0:
            self.box_persistence.hide()
Esempio n. 5
0
    def __init__(self):
        builder = Gtk.Builder()
        builder.set_translation_domain(tailsgreeter.__appname__)
        builder.add_from_file(
            os.path.join(tailsgreeter.GLADE_DIR, "langdialog.glade"))
        self.dialog = builder.get_object("languages_dialog")
        self.treeview = builder.get_object("languages_treeview")
        self.liststore = builder.get_object("languages_liststore")
        builder.connect_signals(self)

        tvcolumn = Gtk.TreeViewColumn(_("Language"))
        self.treeview.append_column(tvcolumn)
        cell = Gtk.CellRendererText()
        tvcolumn.pack_start(cell, True)
        tvcolumn.add_attribute(cell, 'text', 1)

        TranslatableWindow.__init__(self, self.dialog)
    def __init__(self, greeter):
        self.greeter = greeter

        builder = Gtk.Builder()
        builder.set_translation_domain(tailsgreeter.__appname__)
        builder.add_from_file(os.path.join(tailsgreeter.GLADE_DIR, "persistencewindow.glade"))
        builder.connect_signals(self)

        self.moreoptions = False

        # Sets self.window
        self.login_dialog = builder.get_object("login_dialog")
        TranslatableWindow.__init__(self, self.login_dialog)
        self.btn_persistence_yes = builder.get_object("persistence_yes_button")
        self.btn_persistence_no = builder.get_object("persistence_no_button")
        self.passphrase_box = builder.get_object("passphrase_box")
        self.entry_passphrase = builder.get_object("passphrase_entry")
        self.btn_moreoptions_yes = builder.get_object("moreoptions_yes_button")
        self.btn_moreoptions_no = builder.get_object("moreoptions_no_button")
        self.btn_login = builder.get_object("login_button")
        self.btn_next = builder.get_object("next_button")
        self.box_persistence = builder.get_object("persistence_box")
        self.readonly_checkbutton = builder.get_object("readonly_checkbutton")
        self.warning_label = builder.get_object("warning_label")
        self.warning_area = builder.get_object("warning_area")
        self.warning_image = builder.get_object("warning_area")
        # self.spinner = builder.get_object("spinner")
        self.checked_img_moreoptions_yes = builder.get_object("moreoptions_yes_checked_img")
        self.checked_img_moreoptions_no  = builder.get_object("moreoptions_no_checked_img")
        self.checked_img_persistence_yes = builder.get_object("persistence_yes_checked_img")
        self.checked_img_persistence_no  = builder.get_object("persistence_no_checked_img")

        self.warning_area.hide()

        # FIXME: list_containers may raise exceptions. Deal with that.
        self.containers = [
            { "path": container, "locked": True }
            for container in self.greeter.persistence.list_containers()
            ]
        if len(self.containers) == 0:
            self.box_persistence.hide()
Esempio n. 7
0
    def __init__(self, greeter):
        self.greeter = greeter

        # XXX: initialize instance variables
        self.additional_language_displayed = False
        self.additional_layout_displayed = False
        self.default_position = 0

        # Build UI
        builder = Gtk.Builder()
        builder.set_translation_domain(tailsgreeter.__appname__)
        builder.add_from_file(
            os.path.join(tailsgreeter.GLADE_DIR, "langpanel.glade"))
        builder.connect_signals(self)
        self.window = builder.get_object("langpanel")

        cell = Gtk.CellRendererText()

        self.cb_languages = builder.get_object("lang_list_cbox")
        self.cb_languages.pack_start(cell, True)
        self.cb_languages.add_attribute(cell, 'text', 1)

        self.cb_locales = builder.get_object("locale_cbox")
        self.cb_locales.pack_start(cell, True)
        self.cb_locales.add_attribute(cell, 'text', 1)

        self.cb_layouts = builder.get_object("layout_cbox")
        self.cb_layouts.pack_start(cell, True)
        self.cb_layouts.add_attribute(cell, 'text', 1)

        self.cb_variants = builder.get_object("variant_cbox")
        if self.cb_variants:
            self.cb_variants.pack_start(cell, True)
            self.cb_variants.add_attribute(cell, 'text', 1)

        TranslatableWindow.__init__(self, self.window)

        self.populate_languages()
        self.cb_languages.set_active(self.default_position)
        self.set_panel_geometry()
Esempio n. 8
0
    def __init__(self, greeter):
        self.greeter = greeter

        # XXX: initialize instance variables
        self.additional_language_displayed = False
        self.additional_layout_displayed = False
        self.default_position = 0

        # Build UI
        builder = Gtk.Builder()
        builder.set_translation_domain(tailsgreeter.__appname__)
        builder.add_from_file(os.path.join(tailsgreeter.GLADE_DIR, "langpanel.glade"))
        builder.connect_signals(self)
        self.window = builder.get_object("langpanel")

        cell = Gtk.CellRendererText()

        self.cb_languages = builder.get_object("lang_list_cbox")
        self.cb_languages.pack_start(cell, True)
        self.cb_languages.add_attribute(cell, 'text', 1)

        self.cb_locales = builder.get_object("locale_cbox")
        self.cb_locales.pack_start(cell, True)
        self.cb_locales.add_attribute(cell, 'text', 1)

        self.cb_layouts = builder.get_object("layout_cbox")
        self.cb_layouts.pack_start(cell, True)
        self.cb_layouts.add_attribute(cell, 'text', 1)

        self.cb_variants = builder.get_object("variant_cbox")
        if self.cb_variants:
            self.cb_variants.pack_start(cell, True)
            self.cb_variants.add_attribute(cell, 'text', 1)

        TranslatableWindow.__init__(self, self.window)

        self.populate_languages()
        self.cb_languages.set_active(self.default_position)
        self.set_panel_geometry()
Esempio n. 9
0
    def __init__(self, uri):
        builder = Gtk.Builder()
        builder.set_translation_domain(tailsgreeter.__appname__)
        builder.add_from_file(os.path.join(tailsgreeter.GLADE_DIR,
                                           "helpwindow.glade"))
        builder.connect_signals(self)
        TranslatableWindow.__init__(self, builder.get_object("help_dialog"))
        self.html_help = WebKit.WebView()

        def cb_request_starting(web_view, web_frame, web_ressource, request,
                                response, user_data = None):
            if not request.get_uri().startswith("file://"):
                webbrowser.open_new(request.get_uri())
                request.set_uri(web_frame.get_uri())

        self.html_help.connect("resource-request-starting",
                               cb_request_starting)
        self.help_container = builder.get_object("scrolled_help")
        self.html_help.load_uri(uri)
        self.help_container.add_child(builder, self.html_help, None)
        self.html_help.show()
        self.window.resize(self.window.get_size()[0], self.window.get_screen().get_height())
        self.window.run()