Пример #1
0
    def finish_initializing(self, builder):
        """Called while initializing this instance in __new__

        finish_initializing should be called after parsing the UI definition
        and creating a PictagWindow object with it in order to finish
        initializing the start of the new PictagWindow instance.
        """
        # Get a reference to the builder and set up the signals.
        self.builder = builder
        self.ui = builder.get_ui(self, True)
        self.PreferencesDialog = None # class
        self.preferences_dialog = None # instance
        self.AboutDialog = None # class

        schema = Gio.SettingsSchemaSource.get_default()
        if schema.lookup("net.launchpad.pictag", True):
            self.settings = Gio.Settings("net.launchpad.pictag")
            self.settings.connect('changed', self.on_preferences_changed)
        else:
            logger.warning("GSettings schema not installed. "
                         "Running with default options.")
            self.settings = MockSettings()

        # Optional Launchpad integration
        # This shouldn't crash if not found as it is simply used for bug reporting.
        # See https://wiki.ubuntu.com/UbuntuDevelopment/Internationalisation/Coding
        # for more information about Launchpad integration.
        try:
            from gi.repository import LaunchpadIntegration # pylint: disable=E0611
            LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
            LaunchpadIntegration.set_sourcepackagename('pictag')
        except ImportError:
            pass
Пример #2
0
    def finish_initializing(self, builder):
        """Called while initializing this instance in __new__

        finish_initializing should be called after parsing the UI definition
        and creating a GnomereadWindow object with it in order to finish
        initializing the start of the new GnomereadWindow instance.
        """
        # Get a reference to the builder and set up the signals.
        self.builder = builder
        self.ui = builder.get_ui(self, True)
        self.AboutDialog = None # class

        # Optional Launchpad integration
        # This shouldn't crash if not found as it is simply used for bug reporting.
        # See https://wiki.ubuntu.com/UbuntuDevelopment/Internationalisation/Coding
        # for more information about Launchpad integration.
        try:
            from gi.repository import LaunchpadIntegration # pylint: disable=E0611
            LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
            LaunchpadIntegration.set_sourcepackagename('gnomeread')
        except ImportError:
            pass

        # Optional application indicator support
        # Run 'quickly add indicator' to get started.
        # More information:
        #  http://owaislone.org/quickly-add-indicator/
        #  https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators
        try:
            from gnomeread import indicator
            # self is passed so methods of this class can be called from indicator.py
            # Comment this next line out to disable appindicator
            self.indicator = indicator.new_application_indicator(self)
        except ImportError:
            pass
Пример #3
0
 def setup_gui (self):
     self.setup_main_window()
     self.gsd = gsudoku.SudokuGameDisplay()
     self.gsd.set_parent_for(self.w)
     self.gsd.connect('puzzle-finished', self.you_win_callback)
     self.setup_color()
     self.setup_actions()
     self.setup_undo()
     self.setup_autosave()
     self.w.add_accel_group(self.uimanager.get_accel_group())
     # Add launchpad integration
     LaunchpadIntegration.set_sourcepackagename ("gnome-sudoku")
     LaunchpadIntegration.add_ui(self.uimanager, "/MenuBar/Help/LaunchpadItems")
     self.setup_main_boxes()
     self.setup_tracker_interface()
     self.setup_toggles()
Пример #4
0
    def finish_initializing(self, builder):
        """Called while initializing this instance in __new__

        finish_initializing should be called after parsing the UI definition
        and creating a VaultWindow object with it in order to finish
        initializing the start of the new VaultWindow instance.
        """
        # Get a reference to the builder and set up the signals.
        self.builder = builder
        self.ui = builder.get_ui(self, True)
        self.PreferencesDialog = None  # class
        self.preferences_dialog = None  # instance
        self.AboutDialog = None  # class

        self.settings = Gio.Settings("net.launchpad.vault")
        self.settings.connect('changed', self.on_preferences_changed)

        # Optional Launchpad integration
        # This shouldn't crash if not found as it is simply used for bug reporting.
        # See https://wiki.ubuntu.com/UbuntuDevelopment/Internationalisation/Coding
        # for more information about Launchpad integration.
        try:
            from gi.repository import LaunchpadIntegration  # pylint: disable=E0611
            LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
            LaunchpadIntegration.set_sourcepackagename('vault')
        except ImportError:
            pass

        # Optional application indicator support
        # Run 'quickly add indicator' to get started.
        # More information:
        #  http://owaislone.org/quickly-add-indicator/
        #  https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators
        try:
            from vault import indicator
            # self is passed so methods of this class can be called from indicator.py
            # Comment this next line out to disable appindicator
            self.indicator = indicator.new_application_indicator(self)
        except ImportError:
            pass
Пример #5
0
    def finish_initializing(self, builder):
        """Called while initializing this instance in __new__

        finish_initializing should be called after parsing the UI definition
        and creating a FoggerWindow object with it in order to finish
        initializing the start of the new FoggerWindow instance.
        """
        # Get a reference to the builder and set up the signals.
        self.builder = builder
        self.ui = builder.get_ui(self, True)
        self.PreferencesDialog = None # class
        self.preferences_dialog = None # instance
        self.AboutDialog = None # class

        self.root = None
        self.popups = [self]
        #self.is_destroyed = False

        try:
            from gi.repository import LaunchpadIntegration # pylint: disable=E0611
            LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
            LaunchpadIntegration.set_sourcepackagename('fogger')
        except ImportError:
            pass
Пример #6
0
    def finish_initializing(self, builder):
        """Called while initializing this instance in __new__

        finish_initializing should be called after parsing the UI definition
        and creating a FoggerWindow object with it in order to finish
        initializing the start of the new FoggerWindow instance.
        """
        # Get a reference to the builder and set up the signals.
        self.builder = builder
        self.ui = builder.get_ui(self, True)
        self.PreferencesDialog = None  # class
        self.preferences_dialog = None  # instance
        self.AboutDialog = None  # class

        self.root = None
        self.popups = [self]
        #self.is_destroyed = False

        try:
            from gi.repository import LaunchpadIntegration  # pylint: disable=E0611
            LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
            LaunchpadIntegration.set_sourcepackagename('fogger')
        except ImportError:
            pass
Пример #7
0
    def finish_initializing(self, builder):
        """Called while initializing this instance in __new__

        finish_initializing should be called after parsing the UI definition
        and creating a SlidewallWindow object with it in order to finish
        initializing the start of the new SlidewallWindow instance.
        """
        # copy first the data
        self.config_engine = ConfEngine.ConfigEngine()
        self.live_engine = liveengine.LiveEngine(parent=self)
        # Get a reference to the builder and set up the signals.
        self.builder = builder
        self.ui = builder.get_ui(self, True)

        self.AboutDialog = None  # class

        self.settings = Gio.Settings("net.launchpad.slidewall")

        self.first_start = True
        if os.path.exists(os.environ["HOME"] + "/.local/share/slidewall"):
            self.first_start = False
        # enable buttons with images on them
        bt_settings = Gtk.Settings.get_default()
        bt_settings.props.gtk_button_images = True
        bt_settings.props.gtk_menu_images = True

        self.wall_engine = SlideWallEngine.WallEngine()
        self.notify_engine = NotifyEngine.NotifyServer("Slidewall")
        self.wall_base = wallbase.WallBase()
        self.slide_link = {}
        self.livemode_position = "live earth"
        self.ui.cb_options.set_active(0)
        self.slide_options = {
            "0": "zoom",
            "1": "scaled",
            "2": "centered",
            "3": "spanned",
            "4": "stretched",
            "5": "wallpaper",
        }

        # Optional Launchpad integration
        # This shouldn't crash if not found as it is simply used for bug reporting.
        # See https://wiki.ubuntu.com/UbuntuDevelopment/Internationalisation/Coding
        # for more information about Launchpad integration.
        try:
            from gi.repository import LaunchpadIntegration  # pylint: disable=E0611

            LaunchpadIntegration.add_items(self.ui.helpMenu, 1, True, True)
            LaunchpadIntegration.set_sourcepackagename("slidewall")
        except ImportError:
            pass

        # Optional application indicator support
        # Run 'quickly add indicator' to get started.
        # More information:
        #  http://owaislone.org/quickly-add-indicator
        #  https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators
        # try:
        # from slidewall import indicator
        # self is passed so methods of this class can be called from indicator.py
        # Comment this next line out to disable appindicator
        # self.indicator = indicator.new_application_indicator(self)
        # except ImportError:
        # pass
        self.position = 0
        self.livemode_last = 0

        self.timer_id = 1
        self.liststore2 = Gtk.ListStore(GdkPixbuf.Pixbuf, str)
        self.liststore3 = Gtk.ListStore(GdkPixbuf.Pixbuf, str)

        self.live_engine.load_livemode_wall()
        self.wallclock_engine = wallclock.WallClock(parent=self)
        # force write config file
        if self.first_start:
            self.on_bt_save_clicked(None)

        self.load_config_file()
        self.ui.wall_view.set_pixbuf_column(0)
        self.ui.wall_view.set_text_column(1)
        print (str(self.first_start))
        if self.ui.r_bt_slide.get_active() and (not self.first_start):
            print ("Going to autostart slideshow")
            # initialize timer_id but won't run now since 1 billion seconds it's quite a time
            self.timer_id = GObject.timeout_add_seconds(1000000000, self.on_slidechange_time, None)
            # now force running in the background
            self.on_bt_start_clicked(self.ui.bt_start)

        elif not self.first_start:
            print ("Going to autostart live")
            self.timer_id = GObject.timeout_add_seconds(1000000000, self.on_livechange_time, None)
            # now force autostart in livemode
            self.on_bt_apply_clicked(self.ui.bt_apply, data=[self.livemode_position])

        # force starting in system tray if check_tray is active
        if self.ui.check_tray.get_active() and not self.first_start:
            # self.ui.slidewall_window.hide()
            self.ui.slidewall_window.iconify()
            self.build_tray()
            self.build_tray_first = 1