(self)
Activate the Import Options dialog for the  current item.
Activate the Import Options dialog for the  current item.
Activate the Import Options dialog for the current item .
def _activate_import_dialog(self):
        """Activate the Import Options dialog for the  current item."""
        item = self.current_item()
        assert item is not None
        dlg = CSVImportDialog(
            self, windowTitle="Import Options", sizeGripEnabled=True,
        )
        dlg.setWindowModality(Qt.WindowModal)
        dlg.setAttribute(Qt.WA_DeleteOnClose)
        settings = self._local_settings()
        settings.beginGroup(qname(type(dlg)))
        size = settings.value("size", QSize(), type=QSize)  # type: QSize
        if size.isValid():
            dlg.resize(size)

        path = item.data(ImportItem.PathRole)
        options = item.data(ImportItem.OptionsRole)
        dlg.setPath(path)  # Set path before options so column types can
        if isinstance(options, Options):
            dlg.setOptions(options)

        def update():
            newoptions = dlg.options()
            item.setData(newoptions, ImportItem.OptionsRole)
            # update local recent paths list
            self._note_recent(path, newoptions)
            if newoptions != options:
                self._invalidate()
        dlg.accepted.connect(update)

        def store_size():
            settings.setValue("size", dlg.size())
        dlg.finished.connect(store_size)
        dlg.show()
def _activate_import_dialog ( self ) : item = self . current_item ( ) assert item is not None dlg = CSVImportDialog ( self , windowTitle = "Import Options" , sizeGripEnabled = True , ) dlg . setWindowModality ( Qt . WindowModal ) dlg . setAttribute ( Qt . WA_DeleteOnClose ) settings = self . _local_settings ( ) settings . beginGroup ( qname ( type ( dlg ) ) ) size = settings . value ( "size" , QSize ( ) , type = QSize ) # type: QSize if size . isValid ( ) : dlg . resize ( size ) path = item . data ( ImportItem . PathRole ) options = item . data ( ImportItem . OptionsRole ) dlg . setPath ( path ) # Set path before options so column types can if isinstance ( options , Options ) : dlg . setOptions ( options ) def update ( ) : newoptions = dlg . options ( ) item . setData ( newoptions , ImportItem . OptionsRole ) # update local recent paths list self . _note_recent ( path , newoptions ) if newoptions != options : self . _invalidate ( ) dlg . accepted . connect ( update ) def store_size ( ) : settings . setValue ( "size" , dlg . size ( ) ) dlg . finished . connect ( store_size ) dlg . show ( )