Exemplo n.º 1
0
    def finish_initializing(self, builder, options=None): # pylint: disable=E1002
        """Set up the main window"""
        super(FirstbootWindow, self).finish_initializing(builder)
        self.connect("delete_event", self.on_delete_event)

        self.btnPrev = self.ui.btnPrev
        self.btnNext = self.ui.btnNext

        self.cmd_options = options
        self.fbe = FirstbootEntry.FirstbootEntry()

        iconfile = firstbootconfig.get_data_file('media', '%s' % ('wizard1.png',))
        self.set_icon_from_file(iconfile)

        self.pages = {}
        self.buttons = {}
        self.current_page = None
        self.is_last_page = False
        self.fully_configured = False

        self.translate()
        self.build_index()

        first_page = self.pages[pages.pages[0]]
        self.set_current_page(first_page['module'])
        self.on_link_status(None, False)
        self.show_applications()

        self.set_focus(self.ui.btnNext)
Exemplo n.º 2
0
    def new_index_button(self, page_title, page_name):

        button = Gtk.Button()
        button.set_relief(Gtk.ReliefStyle.NONE)
        button.set_property('focus-on-click', False)
        button.set_property('xalign', 0)

        image_file = firstbootconfig.get_data_file('media', '%s' % ('arrow_right_32.png',))
        pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(image_file, 8, 8)
        image = Gtk.Image.new_from_pixbuf(pixbuf)
        image.hide()

        #~ image = Gtk.Arrow()
        #~ image.set(Gtk.ArrowType.RIGHT, Gtk.ShadowType.NONE)

        label = Gtk.Label()
        label.set_text(page_title)
        label.show()

        hbox = Gtk.HBox()
        hbox.set_spacing(3)
        hbox.pack_start(image, False, True, 0)
        hbox.pack_start(label, False, True, 0)
        hbox.show()

        button.add(hbox)

        self.ui.boxIndex.pack_start(button, False, True, 0)
        button.connect('clicked', self.on_btnIndex_Clicked, page_name)
        button.show()

        return button
    def new_index_button(self, page_title, page_name):

        button = Gtk.Button()
        button.set_relief(Gtk.ReliefStyle.NONE)
        button.set_property('focus-on-click', False)
        button.set_property('xalign', 0)

        image_file = firstbootconfig.get_data_file(
            'media', '%s' % ('arrow_right_32.png', ))
        pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(image_file, 8, 8)
        image = Gtk.Image.new_from_pixbuf(pixbuf)
        image.hide()

        #~ image = Gtk.Arrow()
        #~ image.set(Gtk.ArrowType.RIGHT, Gtk.ShadowType.NONE)

        label = Gtk.Label()
        label.set_text(page_title)
        label.show()

        hbox = Gtk.HBox()
        hbox.set_spacing(3)
        hbox.pack_start(image, False, True, 0)
        hbox.pack_start(label, False, True, 0)
        hbox.show()

        button.add(hbox)

        self.ui.boxIndex.pack_start(button, False, True, 0)
        button.connect('clicked', self.on_btnIndex_Clicked, page_name)
        button.show()

        return button
    def finish_initializing(self, builder, options=None):  # pylint: disable=E1002
        """Set up the main window"""
        super(FirstbootWindow, self).finish_initializing(builder)
        #        self.connect("delete_event", self.on_delete_event)

        screen = Gdk.Screen.get_default()
        sw = math.floor(screen.width() - screen.width() / 6)
        sh = math.floor(screen.height() - screen.height() / 6)
        self.resize(sw, sh)

        self.btnPrev = self.ui.btnPrev
        self.btnApply = self.ui.btnApply
        self.btnNext = self.ui.btnNext
        self.btnUpdate = self.ui.btnUpdate

        self.cmd_options = options
        self.fbe = FirstbootEntry.FirstbootEntry()

        iconfile = firstbootconfig.get_data_file('media',
                                                 '%s' % ('wizard1.png', ))
        self.set_icon_from_file(iconfile)

        self.pages = {}
        self.buttons = {}
        self.current_page = None
        self.is_last_page = False
        self.fully_configured = False

        self.translate()
        self.build_index()

        first_page = self.pages[pages.pages[0]]
        self.set_current_page(first_page['module'])
        self.show_applications()

        self.set_focus(self.ui.btnNext)

        # Register changes on NetworkManager so we will
        # know the connection state.
        DBusGMainLoop(set_as_default=True)

        self.system_bus = dbus.SystemBus()
        self.nm = self.system_bus.get_object(NM_DBUS_SERVICE,
                                             NM_DBUS_OBJECT_PATH)
        self.nm.connect_to_signal('StateChanged', self.on_nm_state_changed)

        # Read the connection state now since it's posible we don't
        # get any signals at that point.
        i = dbus.Interface(self.nm, 'org.freedesktop.DBus.Properties')
        state = i.Get(NM_DBUS_SERVICE, 'State')
        self.on_nm_state_changed(state)
    def finish_initializing(self, builder, options=None):   # pylint: disable=E1002
        """Set up the main window"""
        super(FirstbootWindow, self).finish_initializing(builder)
#        self.connect("delete_event", self.on_delete_event)

        screen = Gdk.Screen.get_default()
        sw = math.floor(screen.width() - screen.width() / 6)
        sh = math.floor(screen.height() - screen.height() / 6)
        self.resize(sw, sh)

        self.btnPrev = self.ui.btnPrev
        self.btnApply = self.ui.btnApply
        self.btnNext = self.ui.btnNext
        self.btnUpdate = self.ui.btnUpdate


        self.cmd_options = options
        self.fbe = FirstbootEntry.FirstbootEntry()

        iconfile = firstbootconfig.get_data_file('media', '%s' % ('wizard1.png',))
        self.set_icon_from_file(iconfile)

        self.pages = {}
        self.buttons = {}
        self.current_page = None
        self.is_last_page = False
        self.fully_configured = False

        self.translate()
        self.build_index()

        first_page = self.pages[pages.pages[0]]
        self.set_current_page(first_page['module'])
        self.show_applications()

        self.set_focus(self.ui.btnNext)

        # Register changes on NetworkManager so we will
        # know the connection state.
        DBusGMainLoop(set_as_default=True)

        self.system_bus = dbus.SystemBus()
        self.nm = self.system_bus.get_object(NM_DBUS_SERVICE, NM_DBUS_OBJECT_PATH)
        self.nm.connect_to_signal('StateChanged', self.on_nm_state_changed)

        # Read the connection state now since it's posible we don't
        # get any signals at that point.
        i = dbus.Interface(self.nm, 'org.freedesktop.DBus.Properties')
        state = i.Get(NM_DBUS_SERVICE, 'State')
        self.on_nm_state_changed(state)