Пример #1
0
    def save_to_playlist_callback(self, widget=None):
        filename = gtkutil.get_file_from_filechooser(
            self, save_file=True, save_to='playlist.m3u' )

        if filename is None:
            return False

        if os.path.isfile(filename):
            response = gtkutil.dialog( self.main_window, _('File already exists'),
                _('File already exists'),
                _('The file %s already exists. You can choose another name or '
                  'overwrite the existing file.') % os.path.basename(filename),
                affirmative_button=gtk.STOCK_SAVE,
                negative_button=_('Rename file'))

            if response is None:
                return None

            elif response:
                pass
            elif not response:
                return self.save_to_playlist_callback()

        ext = util.detect_filetype(filename)
        if not self.playlist.save_to_new_playlist(filename, ext):
            self.notify(_('Error saving playlist...'))
            return False

        return True
Пример #2
0
    def save_to_playlist_callback(self, widget=None):
        filename = gtkutil.get_file_from_filechooser(self,
                                                     save_file=True,
                                                     save_to='playlist.m3u')

        if filename is None:
            return False

        if os.path.isfile(filename):
            response = gtkutil.dialog(
                self.main_window,
                _('File already exists'),
                _('File already exists'),
                _('The file %s already exists. You can choose another name or '
                  'overwrite the existing file.') % os.path.basename(filename),
                affirmative_button=gtk.STOCK_SAVE,
                negative_button=_('Rename file'))

            if response is None:
                return None

            elif response:
                pass
            elif not response:
                return self.save_to_playlist_callback()

        ext = util.detect_filetype(filename)
        if not self.playlist.save_to_new_playlist(filename, ext):
            self.notify(_('Error saving playlist...'))
            return False

        return True
Пример #3
0
    def open_file_callback(self, widget=None):
        # set __ingnore__queue_check because we already did the check
        self.__ignore_queue_check = True
        filename = gtkutil.get_file_from_filechooser(self)
        if filename is not None:
            self._play_file(filename)

        self.__ignore_queue_check = False
Пример #4
0
    def open_file_callback(self, widget=None):
        # set __ingnore__queue_check because we already did the check
        self.__ignore_queue_check = True
        filename = gtkutil.get_file_from_filechooser(self)
        if filename is not None:
            self._play_file(filename)

        self.__ignore_queue_check = False
Пример #5
0
 def play_one_callback(self, widget=None):
     filename = gtkutil.get_file_from_filechooser(self)
     if filename is not None:
         self.empty_playlist_callback(None)
         self._play_file(filename)
Пример #6
0
 def open_dir_callback(self, widget=None):
     filename = gtkutil.get_file_from_filechooser(self, folder=True)
     if filename is not None:
         self._play_file(filename)
Пример #7
0
 def add_directory(self, widget):
     directory = gtkutil.get_file_from_filechooser(self.main, folder=True )
     if directory is not None:
         self.playlist.load(directory)
Пример #8
0
 def add_file(self, widget):
     filename = gtkutil.get_file_from_filechooser(self.main)
     if filename is not None:
         self.playlist.load(filename)
Пример #9
0
 def open_dir_callback(self, widget=None):
     filename = gtkutil.get_file_from_filechooser(self, folder=True)
     if filename is not None:
         self._play_file(filename)
Пример #10
0
 def play_one_callback(self, widget=None):
     filename = gtkutil.get_file_from_filechooser(self)
     if filename is not None:
         self.empty_playlist_callback(None)
         self._play_file(filename)
Пример #11
0
 def add_directory(self, widget):
     directory = gtkutil.get_file_from_filechooser(self.main, folder=True)
     if directory is not None:
         self.playlist.load(directory)
Пример #12
0
 def add_file(self, widget):
     filename = gtkutil.get_file_from_filechooser(self.main)
     if filename is not None:
         self.playlist.load(filename)