class DependenciesDialog(QDialog): def __init__(self, parent): QDialog.__init__(self, parent) self.setWindowTitle("Spyder %s: %s" % (__version__, _("Optional Dependencies"))) self.setModal(True) self.view = DependenciesTableView(self, []) important_mods = ["rope", "pyflakes", "IPython", "matplotlib"] self.label = QLabel( _( "Spyder depends on several Python modules to " "provide additional functionality for its " "plugins. The table below shows the required " "and installed versions (if any) of all of " "them.<br><br>" "Although Spyder can work without any of these " "modules, it's strongly recommended that at " "least you try to install <b>%s</b> and " "<b>%s</b> to have a much better experience." ) % (", ".join(important_mods[:-1]), important_mods[-1]) ) self.label.setWordWrap(True) self.label.setAlignment(Qt.AlignJustify) self.label.setContentsMargins(5, 8, 12, 10) btn = QPushButton(_("Copy to clipboard")) self.connect(btn, SIGNAL("clicked()"), self.copy_to_clipboard) bbox = QDialogButtonBox(QDialogButtonBox.Ok) self.connect(bbox, SIGNAL("accepted()"), SLOT("accept()")) hlayout = QHBoxLayout() hlayout.addWidget(btn) hlayout.addStretch() hlayout.addWidget(bbox) vlayout = QVBoxLayout() vlayout.addWidget(self.label) vlayout.addWidget(self.view) vlayout.addLayout(hlayout) self.setLayout(vlayout) self.resize(560, 350) def set_data(self, dependencies): self.view.model.set_data(dependencies) self.view.adjust_columns() self.view.sortByColumn(0, Qt.DescendingOrder) def copy_to_clipboard(self): from spyderlib.dependencies import status QApplication.clipboard().setText(status())
class DependenciesDialog(QDialog): def __init__(self, parent): QDialog.__init__(self, parent) self.setWindowTitle("Spyder %s: %s" % (__version__, _("Optional Dependencies"))) self.setWindowIcon(ima.icon('tooloptions')) self.setModal(True) self.view = DependenciesTableView(self, []) important_mods = ['rope', 'pyflakes', 'IPython', 'matplotlib'] self.label = QLabel( _("Spyder depends on several Python modules to " "provide additional functionality for its " "plugins. The table below shows the required " "and installed versions (if any) of all of " "them.<br><br>" "Although Spyder can work without any of these " "modules, it's strongly recommended that at " "least you try to install <b>%s</b> and " "<b>%s</b> to have a much better experience.") % (', '.join(important_mods[:-1]), important_mods[-1])) self.label.setWordWrap(True) self.label.setAlignment(Qt.AlignJustify) self.label.setContentsMargins(5, 8, 12, 10) btn = QPushButton(_("Copy to clipboard"), ) btn.clicked.connect(self.copy_to_clipboard) bbox = QDialogButtonBox(QDialogButtonBox.Ok) bbox.accepted.connect(self.accept) hlayout = QHBoxLayout() hlayout.addWidget(btn) hlayout.addStretch() hlayout.addWidget(bbox) vlayout = QVBoxLayout() vlayout.addWidget(self.label) vlayout.addWidget(self.view) vlayout.addLayout(hlayout) self.setLayout(vlayout) self.resize(630, 420) def set_data(self, dependencies): self.view.model.set_data(dependencies) self.view.adjust_columns() self.view.sortByColumn(0, Qt.DescendingOrder) def copy_to_clipboard(self): from spyderlib.dependencies import status QApplication.clipboard().setText(status())
class DependenciesDialog(QDialog): def __init__(self, parent): QDialog.__init__(self, parent) self.setWindowTitle("Spyder %s: %s" % (__version__, _("Dependencies"))) self.setWindowIcon(ima.icon('tooloptions')) self.setModal(True) self.view = DependenciesTableView(self, []) opt_mods = ['NumPy', 'Matplotlib', 'Pandas', 'SymPy'] self.label = QLabel(_("Spyder depends on several Python modules to " "provide the right functionality for all its " "panes. The table below shows the required " "and installed versions (if any) of all of " "them.<br><br>" "<b>Note</b>: You can safely use Spyder " "without the following modules installed: " "<b>%s</b> and <b>%s</b>") % (', '.join(opt_mods[:-1]), opt_mods[-1])) self.label.setWordWrap(True) self.label.setAlignment(Qt.AlignJustify) self.label.setContentsMargins(5, 8, 12, 10) btn = QPushButton(_("Copy to clipboard"), ) btn.clicked.connect(self.copy_to_clipboard) bbox = QDialogButtonBox(QDialogButtonBox.Ok) bbox.accepted.connect(self.accept) hlayout = QHBoxLayout() hlayout.addWidget(btn) hlayout.addStretch() hlayout.addWidget(bbox) vlayout = QVBoxLayout() vlayout.addWidget(self.label) vlayout.addWidget(self.view) vlayout.addLayout(hlayout) self.setLayout(vlayout) self.resize(630, 420) def set_data(self, dependencies): self.view.model.set_data(dependencies) self.view.adjust_columns() self.view.sortByColumn(0, Qt.DescendingOrder) def copy_to_clipboard(self): from spyderlib.dependencies import status QApplication.clipboard().setText(status())
class DependenciesDialog(QDialog): def __init__(self, parent): QDialog.__init__(self, parent) self.setWindowTitle("Spyder %s: %s" % (__version__, _("Dependencies"))) self.setWindowIcon(ima.icon('tooloptions')) self.setModal(True) self.view = DependenciesTableView(self, []) opt_mods = ['NumPy', 'Matplotlib', 'Pandas', 'SymPy'] self.label = QLabel( _("Spyder depends on several Python modules to " "provide the right functionality for all its " "panes. The table below shows the required " "and installed versions (if any) of all of " "them.<br><br>" "<b>Note</b>: You can safely use Spyder " "without the following modules installed: " "<b>%s</b> and <b>%s</b>") % (', '.join(opt_mods[:-1]), opt_mods[-1])) self.label.setWordWrap(True) self.label.setAlignment(Qt.AlignJustify) self.label.setContentsMargins(5, 8, 12, 10) btn = QPushButton(_("Copy to clipboard"), ) btn.clicked.connect(self.copy_to_clipboard) bbox = QDialogButtonBox(QDialogButtonBox.Ok) bbox.accepted.connect(self.accept) hlayout = QHBoxLayout() hlayout.addWidget(btn) hlayout.addStretch() hlayout.addWidget(bbox) vlayout = QVBoxLayout() vlayout.addWidget(self.label) vlayout.addWidget(self.view) vlayout.addLayout(hlayout) self.setLayout(vlayout) self.resize(630, 420) def set_data(self, dependencies): self.view.model.set_data(dependencies) self.view.adjust_columns() self.view.sortByColumn(0, Qt.DescendingOrder) def copy_to_clipboard(self): from spyderlib.dependencies import status QApplication.clipboard().setText(status())