def save_layout_state(self): splitter_state = self.ui.messagesTableAndViewSplitter.saveState() splitter_state2 = self.ui.messageViewWidget.ui.splitter.saveState() settings = AppSettings.get_instance() settings.save("WsPage.messagesTableAndViewSplitter", splitter_state) settings.save("WsPage.messageViewSplitterState", splitter_state2)
def save_layout_state(self): splitter_state = self.ui.requestsTableAndViewSplitter.saveState() splitter_state2 = self.ui.requestViewWidget.ui.splitter.saveState() settings = AppSettings.get_instance() settings.save("HttpPage.requestsTableAndViewSplitterState", splitter_state) settings.save("HttpPage.requestsViewSplitterState", splitter_state2)
def restore_layout_state(self): settings = AppSettings.get_instance() splitterState = settings.get("WsPage.messagesTableAndViewSplitter", None) splitterState2 = settings.get("WsPage.messageViewSplitterState", None) self.ui.messagesTableAndViewSplitter.restoreState(splitterState) self.ui.messageViewWidget.ui.splitter.restoreState(splitterState2)
def __init__(self, editor_item): super(RequestEditPage, self).__init__() self.editor_item = editor_item self.flow = self.editor_item.item() self.request = self.flow.request self.original_flow = self.flow self.ui = Ui_RequestEditPage() self.ui.setupUi(self) self.ui.urlInput.setText(self.editor_item.name) self.layout().setContentsMargins(0, 0, 0, 0) self.ui.examplesTable.setVisible(False) self.ui.toggleExamplesButton.setText("Saved Examples >>") self.settings = AppSettings.get_instance() self.restore_layout_state() self.ui.toggleExamplesButton.clicked.connect( self.toggle_examples_table) self.ui.sendButton.clicked.connect(self.ui.flowView.show_loader) self.ui.sendButton.clicked.connect(self.send_request_async) self.ui.saveButton.clicked.connect(self.save_request) self.ui.methodInput.insertItems(0, self.METHODS) self.ui.flowView.set_show_rendered(False) self.ui.flowView.set_editable(True) self.ui.flowView.set_save_as_example_enabled(False) self.ui.flowView.save_example_button.clicked.connect(self.save_example) self.show_request() self.show_examples() self.request_is_modified = False # save_response_button = QtWidgets.QPushButton('Save Response') # save_response_button.setContentsMargins(10, 10, 10, 10) # self.ui.responseTabs.setCornerWidget(save_response_button) # Form inputs: self.ui.urlInput.returnPressed.connect(self.send_request_async) self.ui.urlInput.textChanged.connect(self.form_field_changed) self.ui.methodInput.currentIndexChanged.connect( self.form_field_changed) self.threadpool = QtCore.QThreadPool() # self.ui.loaderWidget.ui.cancelButton.clicked.connect(self.cancel_request) # Keyboard shortcuts: self.connect( QtWidgets.QShortcut( QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_S), self), QtCore.SIGNAL('activated()'), self.save_request) # TODO: self.connect(QtWidgets.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Enter), self), # QtCore.SIGNAL('activated()'), self.send_request_async) self.ui.examplesTable.example_selected.connect(self.show_example) self.ui.examplesTable.delete_examples.connect(self.delete_examples)
def restore_layout_state(self): settings = AppSettings.get_instance() splitterState = settings.get( "HttpPage.requestsTableAndViewSplitterState", None) splitterState2 = settings.get("HttpPage.requestsViewSplitterState", None) self.ui.requestsTableAndViewSplitter.restoreState(splitterState) self.ui.requestViewWidget.ui.splitter.restoreState(splitterState2)
def save_layout_state(self): geometry = self.saveGeometry() settings = AppSettings.get_instance() settings.save('geometry', geometry)
def restore_layout_state(self): settings = AppSettings.get_instance() geometry = settings.get('geometry', None) if geometry is not None: self.restoreGeometry(geometry)
def save_layout_state(self): splitter_state = self.ui.editorSplitter.saveState() settings = AppSettings.get_instance() settings.save("EditorPage.splitter", splitter_state)
def restore_layout_state(self): settings = AppSettings.get_instance() splitter_state = settings.get("EditorPage.splitter", None) self.ui.editorSplitter.restoreState(splitter_state)