コード例 #1
0
ファイル: gtkmain.py プロジェクト: achafamo/panucci
    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
ファイル: gtkmain.py プロジェクト: achafamo/panucci
    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
ファイル: gtkmain.py プロジェクト: achafamo/panucci
 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
ファイル: gtkmain.py プロジェクト: achafamo/panucci
 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
ファイル: gtkplaylist.py プロジェクト: achafamo/panucci
 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
ファイル: gtkplaylist.py プロジェクト: achafamo/panucci
 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)