Example #1
0
  def __init__(self, args):
    super(App, self).__init__(args)
    
    # Read SMD packages.  Since ScavengeDialog is not shown, effectively modal
    # TODO 1000 is arbitrary, seems large enough for the contrib directory, but fragile
    progress = QProgressDialog("Reading SMD packages...", "Abort", 0, 1000)
    # progress.setWindowModality(Qt.WindowModal)
    progress.show()
    progress.setValue(0)
    directory = FritzingFootprintDirectory()
    directory.initSMDWithProgress(progress)
    progress.setValue(1000) # close progress
    
    dialog = ScavengeDialog(directory)
    dialog.exec_()
    
    if dialog.result() == QDialog.Accepted:
      msgBox = QMessageBox()
      msgBox.setWindowTitle(App.appName)
      msgBox.setText(r"""Part created.  To use the part, restart Fritzing, search parts by name of the chosen package, and drag the part to "Mine" bin.""");
      msgBox.exec_()