Python gi.repository.GObject.property() Examples

The following are 3 code examples of gi.repository.GObject.property(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module gi.repository.GObject , or try the search function .
Example #1
Source File: InfoBar.py    From pychess with GNU General Public License v3.0 6 votes vote down vote up
def add_button(self, button):
        """
        All buttons must be added before doing InfoBarNotebook.push_message()
        """
        if not isinstance(button, InfoBarMessageButton):
            raise TypeError("Not an InfoBarMessageButton: %s" % repr(button))
        self.buttons.append(button)
        button._button = Gtk.InfoBar.add_button(self, button.text,
                                                button.response_id)

        def set_sensitive(button, property):
            if self.get_children():
                self.set_response_sensitive(button.response_id,
                                            button.sensitive)

        button.connect("notify::sensitive", set_sensitive)

        def set_tooltip_text(button, property):
            button._button.set_property("tooltip-text", button.tooltip_text)

        button.connect("notify::tooltip-text", set_tooltip_text) 
Example #2
Source File: alternative-toolbar.py    From alternative-toolbar with GNU General Public License v3.0 5 votes vote down vote up
def _connect_signals(self):
        """
          connect to various rhythmbox signals that the toolbars need
        """
        self.sh_display_page_tree = self.shell.props.display_page_tree.connect(
            "selected", self.on_page_change
        )

        self.sh_psc = self.shell_player.connect("playing-song-changed",
                                                self._sh_on_song_change)

        self.sh_op = self.shell_player.connect("elapsed-changed",
                                               self._sh_on_playing)

        self.sh_pc = self.shell_player.connect("playing-changed",
                                               self._sh_on_playing_change)

        self.sh_pspc = self.shell_player.connect(
            "playing-song-property-changed",
            self._sh_on_song_property_changed)

        self.rb_settings = Gio.Settings.new('org.gnome.rhythmbox')

        self.rb_settings.bind('show-album-art', self, 'show_album_art',
                              Gio.SettingsBindFlags.GET)
        self.connect('notify::show-album-art',
                     self.show_album_art_settings_changed)
        self.show_album_art_settings_changed(None)

        self.rb_settings.bind('show-song-position-slider', self,
                              'show_song_position_slider',
                              Gio.SettingsBindFlags.GET)
        self.connect('notify::show-song-position-slider',
                     self.show_song_position_slider_settings_changed)
        self.show_song_position_slider_settings_changed(None) 
Example #3
Source File: alternative-toolbar.py    From alternative-toolbar with GNU General Public License v3.0 5 votes vote down vote up
def _sh_on_song_property_changed(self, sp, uri, property, old, new):
        """
           shell-player "playing-song-property-changed" signal handler
        """
        if sp.get_playing() and property in \
                ('artist',
                 'album',
                 'title',
                 RB.RHYTHMDB_PROP_STREAM_SONG_ARTIST,
                 RB.RHYTHMDB_PROP_STREAM_SONG_ALBUM,
                 RB.RHYTHMDB_PROP_STREAM_SONG_TITLE):
            entry = sp.get_playing_entry()
            self.toolbar_type.display_song(entry)