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

« back to all changes in this revision

Viewing changes to src/gpodder/gtkui/desktop/preferences.py

  • Committer: Package Import Robot
  • Author(s): tony mancill
  • Date: 2014-03-20 21:41:43 UTC
  • mfrom: (5.2.30 sid)
  • Revision ID: package-import@ubuntu.com-20140320214143-f8ogn4hu7s9j7c43
Tags: 3.6.1-1
* New upstream release (Closes: #742191)
  - Fixes YouTube integration bug.
  - Use LC_ALL=C during manpage generation.
  - Add prefix to path in desktop file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- coding: utf-8 -*-
2
2
#
3
3
# gPodder - A media aggregator and podcast client
4
 
# Copyright (c) 2005-2013 Thomas Perl and the gPodder Team
 
4
# Copyright (c) 2005-2014 Thomas Perl and the gPodder Team
5
5
#
6
6
# gPodder is free software; you can redistribute it and/or modify
7
7
# it under the terms of the GNU General Public License as published by
69
69
        gtk.ListStore.__init__(self, str, str)
70
70
        self._config = config
71
71
        self.append((_('None'), 'none'))
 
72
        self.append((_('iPod'), 'ipod'))        
72
73
        self.append((_('Filesystem-based'), 'filesystem'))
73
74
 
74
75
    def get_index(self):
196
197
        self.combobox_preferred_video_format.add_attribute(cellrenderer, 'text', self.preferred_video_format_model.C_CAPTION)
197
198
        self.combobox_preferred_video_format.set_active(self.preferred_video_format_model.get_index())
198
199
 
 
200
        self._config.connect_gtk_togglebutton('podcast_list_view_all',
 
201
                                              self.checkbutton_show_all_episodes)
 
202
        self._config.connect_gtk_togglebutton('podcast_list_sections',
 
203
                                              self.checkbutton_podcast_sections)
 
204
 
199
205
        self.update_interval_presets = [0, 10, 30, 60, 2*60, 6*60, 12*60]
200
206
        adjustment_update_interval = self.hscale_update_interval.get_adjustment()
201
207
        adjustment_update_interval.upper = len(self.update_interval_presets)-1
577
583
            self.toggle_playlist_interface(True)
578
584
 
579
585
    def toggle_playlist_interface(self, enabled):
580
 
        if enabled and self._config.device_sync.device_type != 'none':
 
586
        if enabled and self._config.device_sync.device_type == 'filesystem':
581
587
            self.btn_playlistfolder.set_sensitive(True)
582
588
            self.btn_playlistfolder.set_label(self._config.device_sync.playlists.folder)
583
589
            self.checkbutton_delete_using_playlists.set_sensitive(True)
614
620
            self.toggle_playlist_interface(self._config.device_sync.playlists.create)
615
621
            self.combobox_on_sync.set_sensitive(True)
616
622
            self.checkbutton_skip_played_episodes.set_sensitive(True)
 
623
        elif device_type == 'ipod':
 
624
            self.btn_filesystemMountpoint.set_label(self._config.device_sync.device_folder)
 
625
            self.btn_filesystemMountpoint.set_sensitive(True)
 
626
            self.checkbutton_create_playlists.set_sensitive(False)
 
627
            self.toggle_playlist_interface(False)
 
628
            self.checkbutton_delete_using_playlists.set_sensitive(False)
 
629
            self.combobox_on_sync.set_sensitive(False)
 
630
            self.checkbutton_skip_played_episodes.set_sensitive(False)
 
631
 
 
632
            children = self.btn_filesystemMountpoint.get_children()
 
633
            if children:
 
634
                label = children.pop()
 
635
                label.set_alignment(0., .5)
 
636
 
617
637
        else:
618
638
            # TODO: Add support for iPod and MTP devices
619
639
            pass
628
648
            filename = fs.get_filename()
629
649
            if self._config.device_sync.device_type == 'filesystem':
630
650
                self._config.device_sync.device_folder = filename
 
651
            elif self._config.device_sync.device_type == 'ipod':
 
652
                self._config.device_sync.device_folder = filename
631
653
            # Request an update of the mountpoint button
632
654
            self.on_combobox_device_type_changed(None)
633
655