Exemplo n.º 1
0
def import_tags(exaile):
    '''
        Function to show a dialog that allows the user to import grouping
        tags from a directory of their choosing.
    '''
    def _on_uris_selected(widget, uris):
        import_dialog = GtImporter(exaile, uris)
        import_dialog.show()

    file_dialog = dialogs.DirectoryOpenDialog(
        title=_('Select directory to import grouping tags from'))
    file_dialog.connect('uris-selected', _on_uris_selected)
    file_dialog.run()
    file_dialog.destroy()
Exemplo n.º 2
0
    def on_open_directories_item_activate(self, menuitem):
        """
            Shows a dialog to open directories
        """
        def on_uris_selected(dialog, uris):
            uris.reverse()

            if len(uris) > 0:
                self.controller.open_uri(uris.pop(), play=True)

            for uri in uris:
                self.controller.open_uri(uri, play=False)

        dialog = dialogs.DirectoryOpenDialog(self.window)
        # Selecting empty folders is useless
        dialog.props.create_folders = False
        dialog.connect('uris-selected', on_uris_selected)
        dialog.show()
Exemplo n.º 3
0
 def export_playlist_files(self, pl):
     '''
         Exports the playlist files to a URI
         
         @uri where we want it to be saved
     '''
     
     if pl is None:
         return 
     
     def _on_uri(uri):
         pl_files = [track.get_loc_for_io() for track in pl]
         dialog = dialogs.FileCopyDialog( pl_files, uri, 
             _('Exporting %s') % pl.name )
         dialog.do_copy()
         
     dialog = dialogs.DirectoryOpenDialog(title=_('Choose directory to export files to'))
     dialog.set_select_multiple(False)
     dialog.connect( 'uris-selected', lambda widget, uris: _on_uri(uris[0]))
     dialog.run()
     dialog.destroy()
Exemplo n.º 4
0
 def open_dirs_cb(*args):
     dialog = dialogs.DirectoryOpenDialog(get_main().window)
     dialog.props.create_folders = False
     dialog.connect('uris-selected',
                    lambda d, uris: get_main().controller.open_uris(uris))
     dialog.show()