~ubuntu-branches/ubuntu/vivid/gpodder/vivid-proposed

« back to all changes in this revision

Viewing changes to src/gpodder/gtkui/frmntl/episodes.py

  • Committer: Bazaar Package Importer
  • Author(s): tony mancill
  • Date: 2010-12-05 17:08:02 UTC
  • mfrom: (5.3.2 experimental) (5.2.10 sid)
  • Revision ID: james.westby@ubuntu.com-20101205170802-qbsq7r331j21np1i
Tags: 2.10-1
* New upstream release
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    def new(self):
37
37
        self.channel = None
38
38
 
 
39
        # Styling for the label that appears when the list is empty
 
40
        hildon.hildon_helper_set_logical_font(self.empty_label, \
 
41
                'LargeSystemFont')
 
42
        hildon.hildon_helper_set_logical_color(self.empty_label, \
 
43
                gtk.RC_FG, gtk.STATE_NORMAL, 'SecondaryTextColor')
 
44
 
39
45
        self.episode_actions = gPodderEpisodeActions(self.main_window, \
40
46
                episode_list_status_changed=self.episode_list_status_changed, \
41
47
                episode_is_downloading=self.episode_is_downloading, \
74
80
            button = gtk.Button()
75
81
            action.connect_proxy(button)
76
82
            appmenu.append(button)
 
83
 
 
84
        self.pause_sub_button = hildon.CheckButton(gtk.HILDON_SIZE_FINGER_HEIGHT)
 
85
        self.pause_sub_button.set_label(_('Pause subscription'))
 
86
        self.pause_sub_button.connect('toggled', self.on_pause_subscription_button_toggled)
 
87
        appmenu.append(self.pause_sub_button)
 
88
 
77
89
        for filter in (self.item_view_episodes_all, \
78
90
                       self.item_view_episodes_undeleted, \
79
91
                       self.item_view_episodes_downloaded):
83
95
        appmenu.show_all()
84
96
        self.main_window.set_app_menu(appmenu)
85
97
 
 
98
    def on_pause_subscription_button_toggled(self, widget):
 
99
        new_value = not widget.get_active()
 
100
        if new_value != self.channel.feed_update_enabled:
 
101
            self.channel.feed_update_enabled = new_value
 
102
            self.cover_downloader.reload_cover_from_disk(self.channel)
 
103
            self.channel.save()
 
104
            self.update_podcast_list_model(urls=[self.channel.url])
 
105
 
86
106
    def on_rename_button_clicked(self, widget):
87
107
        if self.channel is None:
88
108
            return
182
202
        self.show_message(_('Checking for new episodes...'))
183
203
        self.on_itemUpdate_activate(widget)
184
204
 
 
205
    def on_delete_episodes_button_clicked(self, widget):
 
206
        all_episodes = isinstance(self.channel, PodcastChannelProxy)
 
207
        if all_episodes:
 
208
            self.show_delete_episodes_window()
 
209
        else:
 
210
            self.show_delete_episodes_window(self.channel)
 
211
 
185
212
    def show(self):
186
213
        # Check if we are displaying the "all episodes" view
187
214
        all_episodes = isinstance(self.channel, PodcastChannelProxy)
192
219
                       self.action_update):
193
220
            action.set_visible(not all_episodes)
194
221
 
195
 
        for action in (self.action_check_for_new_episodes, \
196
 
                       self.action_delete_episodes):
197
 
            action.set_visible(all_episodes)
 
222
        self.action_check_for_new_episodes.set_visible(all_episodes)
 
223
        self.action_delete_episodes.set_visible(True)
 
224
 
 
225
        if all_episodes:
 
226
            self.pause_sub_button.hide()
 
227
        else:
 
228
            self.pause_sub_button.show()
 
229
 
 
230
        self.pause_sub_button.set_active(\
 
231
                not self.channel.feed_update_enabled)
198
232
 
199
233
        self.main_window.set_title(self.channel.title)
200
234
        self.main_window.show()