def change_history_depth(self): "Change history max entries""" depth, valid = QInputDialog.getInt( self, _('History'), _('Maximum entries'), self.get_option('max_entries'), 10, 10000) if valid: self.set_option('max_entries', depth)
def change_history_depth(self): "Change history max entries" "" depth, valid = QInputDialog.getInt( self, _("History"), _("Maximum entries"), self.get_option("max_entries"), 10, 10000 ) if valid: self.set_option("max_entries", depth)
def __make_duplicate(self) -> None: """Make current graph symmetric.""" row = self.collection_list.currentRow() if not row > -1: return graph = self.collections[row] dlg = TargetsDialog( "Select the nodes (links) you want to copy.\n" "The duplication will keep adjacency", "", graph.nodes, (), self ) dlg.show() if not dlg.exec_(): dlg.deleteLater() return targets = dlg.targets() dlg.deleteLater() times, ok = QInputDialog.getInt( self, "Make duplicate", "The count of duplication:", 1, 1 ) if not ok: return new_graph = graph.duplicate(targets, times) self.add_collection(new_graph.edges)
def __save_atlas(self) -> None: """Save function as same as type synthesis widget.""" count = self.collection_list.count() if count < 1: return lateral, ok = QInputDialog.getInt(self, "Atlas", "The number of lateral:", 5, 1) if not ok: return file_name = self.output_to("atlas image", qt_image_format) if not file_name: return icon_size = self.collection_list.iconSize() width = icon_size.width() image = self.collection_list.item(0).icon().pixmap(icon_size).toImage() image_main = QImage( QSize(lateral if count > lateral else count, (count // lateral) + bool(count % lateral)) * width, image.format()) image_main.fill(Qt.transparent) painter = QPainter(image_main) for row in range(count): image = self.collection_list.item(row).icon().pixmap( icon_size).toImage() painter.drawImage( QPointF(row % lateral, row // lateral) * width, image) painter.end() pixmap = QPixmap() pixmap.convertFromImage(image_main) pixmap.save(file_name) self.save_reply_box("Atlas", file_name)
def __save_atlas_ask(self) -> int: """Ask when saving the atlas.""" lateral, ok = QInputDialog.getInt(self, "Atlas", "The number of lateral:", 5, 1) if not ok: return 0 return lateral
def customize_zoom(self) -> None: """Customize zoom value.""" value, ok = QInputDialog.getInt(self, "Zoom", "Enter a zoom value:", self.zoom_bar.minimum(), self.zoom_bar.value(), self.zoom_bar.maximum(), 10) if ok: self.zoom_bar.setValue(value)
def change_max_line_count(self): "Change maximum line count" "" mlc, valid = QInputDialog.getInt(self, _('Buffer'), _('Maximum line count'), self.get_option('max_line_count'), 0, 1000000) if valid: self.shell.setMaximumBlockCount(mlc) self.set_option('max_line_count', mlc)
def change_max_line_count(self): "Change maximum line count""" mlc, valid = QInputDialog.getInt(self, _('Buffer'), _('Maximum line count'), self.get_option('max_line_count'), 0, 1000000) if valid: self.shell.setMaximumBlockCount(mlc) self.set_option('max_line_count', mlc)
def change_max_recent_projects(self): """Change max recent projects entries.""" mrf, valid = QInputDialog.getInt( self, _('Projects'), _('Maximum number of recent projects'), self.get_option('max_recent_projects'), 1, 35) if valid: self.set_option('max_recent_projects', mrf)
def change_history_depth(self): "Change history max entries""" depth, valid = QInputDialog.getInt( self, _('History'), _('Maximum entries'), self.get_option('max_entries'), MIN_HISTORY_ENTRIES, MAX_HISTORY_ENTRIES) if valid: self.set_option('max_entries', depth) self.pylint.change_history_limit(depth)
def show_max_results_input(self): """Show input dialog to set maximum amount of results.""" value, valid = QInputDialog.getInt( self, self.get_plugin_title(), _('Set maximum number of results: '), value=self.get_option('max_results'), min=1, step=1, ) if valid: self.set_max_results(value)
def on_goto_cell(self): if isinstance(self.table_view.model, (TableModelForPandasDataframe, TableModelForNumpyArray)): min_row, max_row = 1, self.table_view.model.rowCount(None) current_row = self.table_view.currentIndex().row() + 1 current_col = self.table_view.currentIndex().column() + 1 row, _ = QInputDialog.getInt(self, QCoreApplication.translate('PMGTableViewer','Input Row'), QCoreApplication.translate('PMGTableViewer','Target Row No.:({min}~{max})').format(min=min_row, max=max_row), current_row, min_row, max_row, step=1) if _: self.table_view.on_goto_index(row - 1, 0) else: raise NotImplementedError
def __efd_path(self) -> None: """Elliptical Fourier Descriptors.""" path = self.current_path() n, ok = QInputDialog.getInt(self, "Elliptical Fourier Descriptors", "The number of points:", len(path), 3) if not ok: return dlg = QProgressDialog("Path transform.", "Cancel", 0, 1, self) dlg.setWindowTitle("Elliptical Fourier Descriptors") dlg.show() self.set_path(efd_fitting(path, n)) dlg.setValue(1) dlg.deleteLater()
def change_max_line_count(self, value=None): """" Change maximum line count. """ valid = True if value is None: value, valid = QInputDialog.getInt( self, _('Buffer'), _('Maximum line count'), self.get_conf('max_line_count'), 0, 1000000, ) if valid: self.set_conf('max_line_count', value)
def _changeTimeSpan(self): new_time_span, ok = QInputDialog.getInt( self, 'Input', 'Set new time span value [s]: ') if not ok: return if new_time_span > self.timeSpan: t_end = Time.now() t_init = t_end - new_time_span for pvname, info in self._filled_with_arch_data.items(): self.fill_curve_with_archdata(info['curve'], pvname, t_init.get_iso8601(), t_end.get_iso8601(), info['factor'], info['process_type'], info['process_bin_intvl']) self.timeSpan = new_time_span self.timeSpanChanged.emit()
def _add_fittable_model(self, model_type): if issubclass(model_type, models.Polynomial1D): text, ok = QInputDialog.getInt(self, 'Polynomial1D', 'Enter Polynomial1D degree:') # User decided not to create a model after all if not ok: return model = model_type(int(text)) else: model = model_type() # Grab any user-defined regions so we may initialize parameters only # for the selected data. mask = self.hub.region_mask spec = self._get_selected_plot_data_item().data_item.spectrum # Initialize the parameters model = initialize(model, spec.spectral_axis[mask], spec.flux[mask]) self._add_model(model)
def change_history_depth(self, depth=None): """ Change history max entries. Parameters ---------- depth: int, optional Number of entries to use for the history. If None, an input dialog will be used. Default is None. """ valid = True if depth is None: depth, valid = QInputDialog.getInt( self, _('History'), _('Maximum entries'), self.get_option('max_entries'), 10, 10000, ) if valid: self.set_option('max_entries', depth)
def set_max_results(self, value=None): """ Set maximum amount of results to add to the result browser. Parameters ---------- value: int, optional Number of results. If None an input dialog will be used. Default is None. """ if value is None: value, valid = QInputDialog.getInt( self, self.get_name(), _('Set maximum number of results: '), value=self.get_option('max_results'), min=1, step=1, ) else: valid = True if valid: self.set_option('max_results', value)