Python PyQt5.QtWidgets.QDialog() Examples

The following are code examples for showing how to use PyQt5.QtWidgets.QDialog(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: openeo-qgis-plugin   Author: Open-EO   File: openeo_connector_dialog.py    Apache License 2.0 6 votes vote down vote up
def pr_info(self):
        process_info_result = self.connection.list_processes()
        selected_process = str(self.processBox.currentText())
        for pr_info in process_info_result:
            if str(pr_info['id']) == selected_process:
                if "description" in pr_info:
                    self.infoWindow2 = QDialog(parent=self)
                    self.hbox2 = QHBoxLayout()
                    self.infoBox = QTextEdit()
                    if "returns" in pr_info:
                        self.infoBox.setText(
                            str(str(pr_info['id']) + ': ' + str(pr_info['description']) + "\n\n Returns: \n" + str(
                                pr_info['returns']['description'])))
                    else:
                        self.infoBox.setText(
                            str(str(pr_info['id']) + ': ' + str(pr_info['description'])))
                    self.infoBox.setReadOnly(True)
                    self.infoBox.setMinimumWidth(500)
                    self.infoBox.setMinimumHeight(500)
                    self.hbox2.addWidget(self.infoBox)
                    self.infoWindow2.setLayout(self.hbox2)
                    #self.infoWindow2.setGeometry(400, 400, 600, 350)
                    self.infoWindow2.setWindowTitle('Process Information')
                    self.infoWindow2.show()
                    # self.processgraphEdit.setText(str(pr_info['id']) + ": " + str(pr_info['description'])) 
Example 2
Project: openeo-qgis-plugin   Author: Open-EO   File: openeo_connector_dialog.py    Apache License 2.0 6 votes vote down vote up
def pg_info_job(self, row):
        """
        Returns detailed information about a the process graph of a batch job in a PopUp-Window:
        :param row: Integer number of the row the button is clicked.
        """
        job_id = self.jobsTableWidget.item(row, 1).text()
        process_graph_job = self.connection.pg_info_job(job_id)

        self.infoWindow4 = QDialog(parent=self)
        self.hbox5 = QVBoxLayout()
        self.infoBox4 = QTextEdit()
        self.infoBox4.setText(json.dumps(process_graph_job, indent=4))
        self.infoBox4.setReadOnly(True)
        self.infoBox4.setMinimumWidth(500)
        self.infoBox4.setMinimumHeight(800)
        self.copy_and_adaptBtn = QPushButton('Copy and Adapt Job Process Graph in QGIS Plugin')
        self.copy_and_adaptBtn.move(20, 10)
        self.hbox5.addWidget(self.infoBox4)
        self.hbox5.addWidget(self.copy_and_adaptBtn)
        self.infoWindow4.setLayout(self.hbox5)
        #self.infoWindow4.setGeometry(400, 400, 600, 450)
        self.infoWindow4.setWindowTitle('Job Process Graph')
        self.infoWindow4.show()
        self.copy_and_adaptBtn.clicked.connect(self.copy_and_adapt_job) 
Example 3
Project: openeo-qgis-plugin   Author: Open-EO   File: openeo_connector_dialog.py    Apache License 2.0 6 votes vote down vote up
def pg_info_service(self, row):
        """
        Returns detailed information about a the process graph of a batch job in a PopUp-Window:
        :param row: Integer number of the row the button is clicked.
        """
        service_id = self.servicesTableWidget.item(row, 1).text()
        process_graph_service = self.connection.pg_info_service(service_id)

        self.infoWindow6 = QDialog(parent=self)
        self.hbox8 = QVBoxLayout()
        self.infoBox5 = QTextEdit()
        self.infoBox5.setText(json.dumps(process_graph_service, indent=4))
        self.infoBox5.setReadOnly(True)
        self.infoBox5.setMinimumWidth(500)
        self.infoBox5.setMinimumHeight(800)
        self.copy_adaptBtn = QPushButton('Copy and Adapt Service Process Graph in QGIS Plugin')
        self.copy_adaptBtn.move(120, 280)
        self.hbox8.addWidget(self.infoBox5)
        self.hbox8.addWidget(self.copy_adaptBtn, Qt.RightButton)
        self.infoWindow6.setLayout(self.hbox8)
        #self.infoWindow6.setGeometry(400, 400, 600, 450)
        self.infoWindow6.setWindowTitle('Service Process Graph')
        self.infoWindow6.show()
        self.copy_adaptBtn.clicked.connect(self.copy_and_adapt_service) 
Example 4
Project: openeo-qgis-plugin   Author: Open-EO   File: openeo_connector_dialog.py    Apache License 2.0 6 votes vote down vote up
def show_error_message(self, msg):
        """
                Shows a detailed information about
                a the error of a batch job in a PopUp-Window:
                :param msg: Error message that should be shown in the window.
                """
        #service_id = self.servicesTableWidget.item(row, 1).text()
        #process_graph_service = self.connection.pg_info_service(service_id)

        self.infoWindow6 = QDialog(parent=self)
        self.hbox8 = QVBoxLayout()
        self.infoBox5 = QTextEdit()
        self.infoBox5.setText(msg)
        self.infoBox5.setReadOnly(True)
        self.infoBox5.setMinimumWidth(500)
        self.infoBox5.setMinimumHeight(800)
        self.hbox8.addWidget(self.infoBox5)
        self.infoWindow6.setLayout(self.hbox8)
        # self.infoWindow6.setGeometry(400, 400, 600, 450)
        self.infoWindow6.setWindowTitle('Error Message')
        self.infoWindow6.show() 
Example 5
Project: BBoxEE   Author: persts   File: annotator_dialog.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None):
        """Class init function."""
        QtWidgets.QDialog.__init__(self)
        self.setupUi(self)
        self.setWindowTitle('Select Model')
        self.last_dir = '.'

        # TODO: Split this up into smaller components
        self.pushButtonTensorflow.clicked.connect(self.tensorflow_selected)
        self.pushButtonTFGraph.clicked.connect(self.get_inference_graph)
        self.interence_graph = None
        self.pushButtonLabelMap.clicked.connect(self.get_label_map)
        self.label_map = None

        self.pushButtonYolo.clicked.connect(self.yolo_selected)
        self.data_config = None
        self.pushButtonDataConfig.clicked.connect(self.get_data_config)
        self.network_config = None
        self.pushButtonNetworkConfig.clicked.connect(self.get_network_config)
        self.weights = None
        self.pushButtonWeights.clicked.connect(self.get_weights) 
Example 6
Project: NaiveMusic   Author: NaiveMusic   File: sheetView.py    GNU General Public License v3.0 6 votes vote down vote up
def key_clicked(self):
        sender = self.sender()
        if self.mc.getCurTrackID() is None:
            warnDialog = QtWidgets.QDialog(self)
            warnLabel = QtWidgets.QLabel('Please select an track first!',
                                         warnDialog)
            warnLabel.move(100, 100)
            warnDialog.setWindowTitle("Alert")
            warnDialog.resize(500, 200)
            warnDialog.setWindowModality(QtCore.Qt.ApplicationModal)
            warnDialog.exec_()
            return
        # Change below
        print(sender.objectName())
        key = sender.objectName().split('_')[1]
        self.mc.playSingle(KEY_TOP - int(key))
        # Change above 
Example 7
Project: IDAngr   Author: andreafioraldi   File: init_gui.py    BSD 2-Clause "Simplified" License 6 votes vote down vote up
def __init__(self):
        QtWidgets.QDialog.__init__(self)
        
        self.ui = Ui_IDAngrConnectDialog()
        self.ui.setupUi(self)
        
        host = "localhost"
        port = manage.DEFAULT_SERVER_PORT
        
        try:
            if os.path.exists(config_file):
                with open(config_file) as f:
                    config = json.load(f)
                host = config["host"]
                port = config["port"]
                self.ui.saveBox.setChecked(config["save"])
                self.ui.localBox.setChecked(config["local"])
        except: pass
        
        self.ui.hostTxt.setText(host)
        self.ui.portTxt.setText(str(port)) 
Example 8
Project: IDAngr   Author: andreafioraldi   File: main_gui.py    BSD 2-Clause "Simplified" License 6 votes vote down vote up
def get_mem(addr):
        dialog = IDAngrAddMemDialog()
        dialog.set_addr(addr)
        r = dialog.exec_()
        if r == QtWidgets.QDialog.Accepted:
            addr = dialog.ui.addrTextEdit.displayText()
            try:
                addr = int(addr, 16)
            except:
                QtWidgets.QMessageBox(QtWidgets.QMessageBox.Critical, 'Error', "Address not in hex format").exec_()
                return None
            length = dialog.ui.lenTextEdit.displayText()
            try:
                length = int(length)
            except:
                QtWidgets.QMessageBox(QtWidgets.QMessageBox.Critical, 'Error', "Length not in dec format").exec_()
                return None
            return (addr, length)
        return None 
Example 9
Project: IDAngr   Author: andreafioraldi   File: main_gui.py    BSD 2-Clause "Simplified" License 6 votes vote down vote up
def __init__(self):
        global _idangr_ctx
        QtWidgets.QDialog.__init__(self)
        
        self.ui = Ui_IDAngrExecDialog()
        self.ui.setupUi(self)
        
        if _idangr_ctx.find_lambda:
            self.ui.findCondEdit.setPlainText(_idangr_ctx.find_lambda)
        if _idangr_ctx.avoid_lambda:
            self.ui.avoidCondEdit.setPlainText(_idangr_ctx.avoid_lambda)

        self.ui.simprocsBox.setChecked(get_memory_type() == SIMPROCS_FROM_CLE)
        self.ui.textloaderBox.setChecked(get_memory_type() == USE_CLE_MEMORY)
        self.ui.gotloaderBox.setChecked(get_memory_type() == ONLY_GOT_FROM_CLE)
        self.ui.execallBox.setChecked(get_memory_type() == GET_ALL_DISCARD_CLE)
        
        self.fh = PythonHighlighter(self.ui.findCondEdit.document())
        self.ah = PythonHighlighter(self.ui.avoidCondEdit.document()) 
Example 10
Project: PyRHEED   Author: yux1991   File: graph_3D_surface.py    MIT License 6 votes vote down vote up
def show_2d_contour(self,path, insideGraph3D = False, min=0.0, max=1.0, radius_min=0, radius_max=10, number_of_levels=50, colormap='jet'):
        window = QtWidgets.QDialog()
        layout = QtWidgets.QVBoxLayout(window)
        figure = plt.figure()
        canvas = FigureCanvas(figure)
        toolbar = NavigationToolbar(canvas,window)
        figure.clear()
        if not path == None:
            if os.path.splitext(path)[1] == '.txt':
                radius,theta,intensity = self.convert_to_RTI(path)
                levels = np.linspace(min,max,number_of_levels)
                ax = figure.add_subplot(111,polar = True)
                ax.contourf(theta,radius,intensity,levels=levels,cmap=colormap)
                ax.set_ylim(radius_min,radius_max)
                canvas.draw()
            else:
                self.raise_error('[Error: wrong file type] Please choose a *.txt file')
        else:
            self.raise_error('[Error: no file] Please choose a valid file first')
        layout.addWidget(toolbar)
        layout.addWidget(canvas)
        window.setWindowTitle("2D Contour")
        window.show()
        if insideGraph3D:
            window.finished.connect(self.contour_plot_finished) 
Example 11
Project: PyRHEED   Author: yux1991   File: preference.py    MIT License 6 votes vote down vote up
def main(self):
        self.windowDefault = dict(self.config['windowDefault'].items())
        self.propertiesDefault = dict(self.config['propertiesDefault'].items())
        self.canvasDefault = dict(self.config['canvasDefault'].items())
        self.chartDefault = dict(self.config['chartDefault'].items())
        self.DefaultSettings_Dialog = QtWidgets.QDialog()
        self.DefaultSettings_DialogGrid = QtWidgets.QGridLayout(self.DefaultSettings_Dialog)
        self.tab = self.refresh_tab(self.config)
        buttonBox = QtWidgets.QDialogButtonBox()
        buttonBox.addButton("Accept",QtWidgets.QDialogButtonBox.AcceptRole)
        buttonBox.addButton("Reset",QtWidgets.QDialogButtonBox.ResetRole)
        buttonBox.addButton("Quit",QtWidgets.QDialogButtonBox.DestructiveRole)
        buttonBox.setCenterButtons(True)
        buttonBox.findChildren(QtWidgets.QPushButton)[0].clicked.connect(self.accept)
        buttonBox.findChildren(QtWidgets.QPushButton)[1].clicked.connect(self.reset)
        buttonBox.findChildren(QtWidgets.QPushButton)[2].clicked.connect(self.DefaultSettings_Dialog.reject)
        self.DefaultSettings_DialogGrid.addWidget(self.tab,0,0)
        self.DefaultSettings_DialogGrid.addWidget(buttonBox,1,0)
        self.DefaultSettings_DialogGrid.setContentsMargins(0,0,0,0)
        self.DefaultSettings_Dialog.setWindowTitle("Default Settings")
        self.DefaultSettings_Dialog.setWindowModality(QtCore.Qt.ApplicationModal)
        self.DefaultSettings_Dialog.resize(self.tab.minimumSizeHint())
        self.DefaultSettings_Dialog.showNormal()
        self.DefaultSettings_Dialog.exec_() 
Example 12
Project: idapython   Author: mr-tz   File: highlight_instructions.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None):
        QtWidgets.QDialog.__init__(self, parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowCloseButtonHint)
        self.setWindowTitle("Highlighter v%s" % __version__)
        highlighter_layout = QtWidgets.QVBoxLayout()

        button_highlight = QtWidgets.QPushButton("&Highlight instructions")
        button_highlight.setDefault(True)
        button_highlight.clicked.connect(self.highlight)
        highlighter_layout.addWidget(button_highlight)

        button_clear = QtWidgets.QPushButton("&Clear all highlights")
        button_clear.clicked.connect(self.clear_colors)
        highlighter_layout.addWidget(button_clear)

        button_cancel = QtWidgets.QPushButton("&Close")
        button_cancel.clicked.connect(self.close)
        highlighter_layout.addWidget(button_cancel)

        self.setMinimumWidth(180)
        self.setLayout(highlighter_layout) 
Example 13
Project: idapython   Author: mr-tz   File: highlight_instructions.py    GNU General Public License v3.0 6 votes vote down vote up
def highlight(self):
        self.done(QtWidgets.QDialog.Accepted)
        highlighters = []
        if HIGHLIGHT_CALLS:
            highlighters.append(CallHighlighter(Colors.MINT))
        if HIGHLIGHT_PUSHES:
            highlighters.append(PushHighlighter(Colors.CORNFLOWER))
        if HIGHLIGHT_ANTI_VM:
            highlighters.append(AntiVmHighlighter(Colors.FLAMINGO))
        if HIGHLIGHT_ANTI_DEBUG:
            highlighters.append(AntiDebugHighlighter(Colors.FLAMINGO))
            # do this once per binary
            AntiDebugHighlighter.highlight_anti_debug_api_calls()
        if HIGHLIGHT_SUSPICIOUS_INSTRUCTIONS:
            highlighters.append(SuspicousInstructionHighlighter(Colors.FLAMINGO))
        highlight_instructions(highlighters) 
Example 14
Project: quick-edit   Author: xizeyoupan   File: mainwindow.py    GNU General Public License v3.0 6 votes vote down vote up
def eventFilter(self, obj, event):
        if obj == self.label_5:
            if event.type() == QtCore.QEvent.Enter:
                self.textidchange = True
                self._ = self.parent().config['reactKey']
                self.parent().config['reactKey'] = 2  # 使所有键响应
            elif event.type() == QtCore.QEvent.Leave:
                self.textidchange = False
                self.parent().config['reactKey'] = self._  # 复原
        elif obj == self.label_7:
            if event.type() == QtCore.QEvent.Enter:
                self.imgidchange = True
                self._ = self.parent().config['reactKey']
                self.parent().config['reactKey'] = 2
            elif event.type() == QtCore.QEvent.Leave:
                self.imgidchange = False
                self.parent().config['reactKey'] = self._

        if event.type() == QtCore.QEvent.KeyPress:
            if self.textidchange:
                self.textidlab.setText(str(self.parent().last_key_id))
            elif self.imgidchange:
                self.imgidlab.setText(str(self.parent().last_key_id))

        return QtWidgets.QDialog.eventFilter(self, obj, event) 
Example 15
Project: gaitutils   Author: jjnurminen   File: qt_dialogs.py    GNU General Public License v3.0 6 votes vote down vote up
def qt_matplotlib_window(fig):
    """Show matplotlib figure fig in new Qt window. Window is returned"""
    _mpl_win = QtWidgets.QDialog()
    # _mpl_win.setGeometry(100, 100, 1500, 1000)
    _mpl_win._canvas = FigureCanvas(fig)
    _mpl_win._canvas.setSizePolicy(
        QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
    )
    _mpl_win._canvas.updateGeometry()  # not sure if this does anything
    toolbar = NavigationToolbar(_mpl_win._canvas, _mpl_win)
    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(toolbar)
    layout.addWidget(_mpl_win._canvas)
    layout.setSpacing(0)
    _mpl_win.setLayout(layout)
    _mpl_win._canvas.draw()
    _mpl_win.show()
    return _mpl_win 
Example 16
Project: gaitutils   Author: jjnurminen   File: _gaitmenu.py    GNU General Public License v3.0 6 votes vote down vote up
def accept(self):
        """ Update config and close dialog, if widget inputs are ok. Otherwise
        show an error dialog """
        self.hetu = self.lnHetu.text().strip()
        self.fullname = self.lnFullName.text().strip()
        self.report_notes = str(self.txtNotes.toPlainText()).strip()
        if self.check_info:
            ok = self.fullname and check_hetu(self.hetu)
        else:
            ok = not self.hetu or check_hetu(self.hetu)
        if ok:
            self.done(QtWidgets.QDialog.Accepted)  # or call superclass accept
        else:
            msg = 'Please enter a valid name and hetu'
            if not self.check_info:
                msg += ' (or leave empty)'
            qt_message_dialog(msg) 
Example 17
Project: GeoMop   Author: GeoMop   File: docker_machine_start_dialog.py    GNU General Public License v3.0 6 votes vote down vote up
def exec(self):
        if not self._start_docker_machine():
            msg_box = QtWidgets.QMessageBox(self)
            msg_box.setWindowTitle("Error")
            msg_box.setIcon(QtWidgets.QMessageBox.Critical)
            msg_box.setText("Unable to start Docker Machine.")
            msg_box.exec()

            return QtWidgets.QDialog.Rejected

        if self._is_docker_machine_running():
            return QtWidgets.QDialog.Accepted

        self._timer.start(1000)

        return super().exec() 
Example 18
Project: serial-tool   Author: damogranlabs   File: setupDialog.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, serialSettings: serComm.SerialCommSettings = None):
        """
        Serial settings dialog.
            @param serialSettings: if None, new blank (default settings) are applied. Otherwise, pre-set default given values
        """
        QtWidgets.QDialog.__init__(self)
        self.ui = Ui_SerialSetupDialog()
        self.ui.setupUi(self)

        if serialSettings is None:
            self.dialogSettings: serComm.SerialCommSettings = serComm.SerialCommSettings()
        else:
            self.dialogSettings: serComm.SerialCommSettings = serialSettings

        self.applySettingsOnClose = False

        self.connectSignalsToSlots()

        self.setDialogValues(self.dialogSettings) 
Example 19
Project: Bezier-Curve-Interactive-Displayer   Author: PerpetualSmile   File: bezier.py    MIT License 6 votes vote down vote up
def __init__(self):
        app = QtWidgets.QApplication(sys.argv)
        MainWindow = QtWidgets.QMainWindow()
        super().setupUi(MainWindow)
        self.flag = False
        self.figure_list = []
        self.initial_button()
        self.action_connect()
        self.initial_figure()
        self.Dialog = QtWidgets.QDialog()
        self.ui_2 = table_ui.Ui_Form()
        self.ui_2.setupUi(self.Dialog)
        self.Dialog2 = QtWidgets.QDialog()
        self.ui_3 = about_ui.Ui_Dialog()
        self.ui_3.setupUi(self.Dialog2)
        MainWindow.show()
        sys.exit(app.exec_()) 
Example 20
Project: Pyquino   Author: kmolLin   File: machine_mointor.py    GNU Affero General Public License v3.0 6 votes vote down vote up
def __test__send(self):
        data = str("G29"+'\n')
        print('0')
        #if self._serial_context_.isRunning():
        print("1")
        if len(data) > 0:
            print("2")
            self._serial_context_.send(data, 0)
            print(data)
    

#    def __run__(self):
 #       import sys
  #      print("123")
  #      app = QtWidgets.QApplication(sys.argv)
  #      Dialog = QtWidgets.QDialog()
  #      ui = Ui_Dialog()
  #      ui.setupUi(Dialog)
  #      Dialog.show()
  #       sys.exit(app.exec_()) 
Example 21
Project: radie   Author: dvincentwest   File: dataframeview.py    GNU General Public License v2.0 6 votes vote down vote up
def viewDataFrame(df: StructuredDataFrame):
    """
    Construct a TableView Dialog to view DataFrameContents)

    Parameters
    ----------
    df : StructuredDataFrame
    """

    # TODO: Implement Copy Function

    dialog = QtWidgets.QDialog(None)
    layout = QtWidgets.QVBoxLayout(dialog)
    layout.setContentsMargins(0, 0, 0, 0)
    view = QtWidgets.QTableView(None)
    view.setModel(PandasModel(df))
    layout.addWidget(view)
    dialog.exec_() 
Example 22
Project: Kuninstaller   Author: kubaz122   File: app.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, iconsize, sorting, autoremove, icons):
        QtWidgets.QDialog.__init__(self)
        self.ui = settings.Ui_Dialog()
        self.ui.setupUi(self)
        
        self.changeSettings()
        btn = self.ui.buttonBox.button(QtWidgets.QDialogButtonBox.Apply)
        btn.clicked.connect(self.applySettingsConnect)
        btn = self.ui.buttonBox.button(QtWidgets.QDialogButtonBox.Ok)
        btn.clicked.connect(self.okSettingsConnect)
        
        self.ui.checkBox.setChecked(sorting)
        self.ui.checkBox_2.setChecked(autoremove)
        self.ui.spinBox.setValue(iconsize)
        self.ui.checkBox_3.setChecked(icons)
        
        self.ui.checkBox.stateChanged.connect(self.changeSettings)
        self.ui.spinBox.valueChanged.connect(self.changeSettings)
        self.ui.checkBox_2.stateChanged.connect(self.changeSettings)
        self.ui.checkBox_3.stateChanged.connect(self.changeSettings) 
Example 23
Project: pywerami   Author: ondrolexa   File: mainapp.py    GNU General Public License v3.0 5 votes vote down vote up
def accept(self):
        settings = QtCore.QSettings("LX", "pywerami")
        #settings.setValue("scale", float(self.scale.text()))
        settings.setValue("nan", self.nan.text())
        QtWidgets.QDialog.accept(self) 
Example 24
Project: openeo-qgis-plugin   Author: Open-EO   File: band_dialog.py    Apache License 2.0 5 votes vote down vote up
def multiple_bands(self):
        """
        Produces a checkable QListWidget
        :return: Of all bands, only the selected bands are returned.
        """
        self.allBandBtn.setStyleSheet("background-color: white")
        self.multipleBandBtn.setStyleSheet("background-color: white")
        if self.multipleBandBtn.clicked:
            self.multipleBandBtn.setStyleSheet("background-color: lightgray")

        #self.processgraphBands.clear()
        self.band_window = QDialog(parent=self)
        self.hbox4 = QVBoxLayout()
        self.bandBox = QListWidget()

        for band in self.all_bands:
            # Set Checkbox before band
            self.item = QListWidgetItem(self.bandBox)
            self.item.setFlags(self.item.flags() | QtCore.Qt.ItemIsUserCheckable)
            self.item.setCheckState(Qt.Unchecked)
            self.item.setText(str(band))

        self.bandBox.sortItems()
        self.bandBox.setMinimumWidth(150)
        self.bandBox.setMinimumHeight(200)
        self.band_window.setWindowTitle('Select Multiple Bands')
        self.takeBandsButton = QPushButton('Save Choice of Bands')

        self.hbox4.addWidget(self.bandBox)
        self.hbox4.addWidget(self.takeBandsButton)
        self.band_window.setLayout(self.hbox4)
        #self.band_window.setGeometry(400, 400, 600, 450)

        self.takeBandsButton.setMinimumWidth(100)
        self.takeBandsButton.setMinimumWidth(50)
        self.takeBandsButton.clicked.connect(self.save_band_choice2)
        #self.takeBandsButton.setGeometry(420, 25, 150, 31)
        self.band_window.show() 
Example 25
Project: openeo-qgis-plugin   Author: Open-EO   File: openeo_connector_dialog.py    Apache License 2.0 5 votes vote down vote up
def load_job_from_hub(self):
        try:
            example_jobs_URL = requests.get('http://hub.openeo.org/api/process_graphs', timeout=5)
        except:
            example_jobs_URL = []

        examples_job_list = example_jobs_URL.json()

        # Get names and process graphs of all available processes (7)
        self.example_jobs = []

        for item in examples_job_list:
            job = Job(title=item['title'], process_graph=item['process_graph'])
            self.example_jobs.append(job)

        # Open a window, where desired job can be selected
        self.example_jobs_window = QDialog(parent=self)
        hbox6 = QHBoxLayout()
        self.exampleJobBox = QListWidget()
        for job in self.example_jobs:
            job_item = QListWidgetItem(self.exampleJobBox)
            job_item.setFlags(
                job_item.flags() | QtCore.Qt.ItemIsSelectable)  # only one item can be selected this time
            job_item.setSelected(False)
            job_item.setText(job.title)  # add Titles as QListWidgetItems

        self.exampleJobBox.setMinimumWidth(500)

        closeWindowBtn = QPushButton('Show process graph \n and close window')
        hbox6.addWidget(self.exampleJobBox)
        hbox6.addWidget(closeWindowBtn)
        closeWindowBtn.clicked.connect(self.pick_job_from_hub)
        self.example_jobs_window.setLayout(hbox6)
        self.example_jobs_window.setWindowTitle('Select a Job')
        self.example_jobs_window.show() 
Example 26
Project: openeo-qgis-plugin   Author: Open-EO   File: openeo_connector_dialog.py    Apache License 2.0 5 votes vote down vote up
def user_manual(self):
        self.umWindow = QDialog(parent=self)
        self.grid = QGridLayout()

        # User Manual Text
        self.text = QLabel()
        user_manual_text = open(os.path.join(os.path.dirname(__file__), './user_manual_text.txt')).read()
        self.text.setText(str(user_manual_text))
        # Title
        self.title = QLabel()
        self.title.setText("User Manual \n ")
        self.startText = QLabel()
        self.startText.setText("1. At first, please focus on the upper part (header) of the openEO Plugin. "
                               "There, you can choose a back-end and enter your login credentials. \nBy clicking"
                               "the “Connect”-Button, you will be connected with the chosen back-end. \nIf the connection "
                               "was successful you will see it in the Status text. \n")
        # openEO Header Image
        self.image = QLabel()
        self.image.setPixmap(QPixmap(os.path.join(os.path.dirname(__file__), 'openEO_plugin_header.png')))

        self.grid.setSpacing(4)
        self.grid.addWidget(self.title, 0, 0)
        self.grid.addWidget(self.startText, 1, 0)
        self.grid.addWidget(self.image, 2, 0)
        self.grid.addWidget(self.text, 4, 0)
        self.umWindow.setLayout(self.grid)
        self.umWindow.setWindowTitle('User Manual')
        self.umWindow.show()

        self.jobsTableWidget.setColumnCount(7)
        self.jobsTableWidget.setHorizontalHeaderLabels(['Job Id', 'Description/Error', 'Submission Date', 'Status',
                                                        'Execute', 'Display', 'Information'])
        header = self.jobsTableWidget.horizontalHeader()
        header.setSectionResizeMode(0, QtWidgets.QHeaderView.ResizeToContents)
        header.setSectionResizeMode(1, QtWidgets.QHeaderView.Stretch)
        header.setSectionResizeMode(2, QtWidgets.QHeaderView.ResizeToContents) 
Example 27
Project: openeo-qgis-plugin   Author: Open-EO   File: openeo_connector_dialog.py    Apache License 2.0 5 votes vote down vote up
def service_info(self, row):
        service_id = self.servicesTableWidget.item(row, 1).text()
        service_info = self.connection.service_info(service_id)
        self.infoWindow5 = QDialog(parent=self)
        self.hbox7 = QHBoxLayout()
        self.infoBox2 = QTextEdit()
        self.infoBox2.setText(str(service_info))
        self.infoBox2.setReadOnly(True)
        self.hbox7.addWidget(self.infoBox2)
        self.infoWindow5.setLayout(self.hbox7)
        #self.infoWindow5.setGeometry(400, 400, 600, 450)
        self.infoWindow5.setWindowTitle('Service Information')
        self.infoWindow5.show() 
Example 28
Project: openeo-qgis-plugin   Author: Open-EO   File: openeo_connector_dialog.py    Apache License 2.0 5 votes vote down vote up
def send_job(self):
        """
        Sends the current process graph to the backend to create a new job.
        """
        title_window = QDialog(parent=self)

        title = QLineEdit()
        ok_button = QPushButton()
        cancel_button = QPushButton()

        title.setMinimumWidth(200)

        ok_button.setText("Ok")
        cancel_button.setText("Cancel")

        ok_button.clicked.connect(lambda: self.send_job_backend(title.text(), title_window))
        cancel_button.clicked.connect(title_window.reject)

        vbox = QVBoxLayout()
        vbox.addWidget(title)

        hbox = QHBoxLayout()
        hbox.addWidget(ok_button)
        hbox.addWidget(cancel_button)

        vbox.addLayout(hbox)
        title_window.setLayout(vbox)
        title_window.setWindowTitle('Choose Title')
        title_window.show() 
Example 29
Project: pytentiostat   Author: juami   File: mainwindow_GUI.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def show_exp(self):
        """
        Initializes the 'Experiment Type' window

        Returns
        ------
        exp: the Ui_Experiment object

        """
        self.window = QtWidgets.QDialog()
        self.exp = Ui_Experiment()
        self.exp.setupUi(self.window)
        self.window.show()
        return self.exp 
Example 30
Project: cct   Author: awacha   File: logindialog.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, credo, onlinemode:bool):
        self.credo = weakref.proxy(credo)
        QtWidgets.QDialog.__init__(self, None)
        self.setupUi(self)
        self.onlineCheckBox.setChecked(onlinemode) 
Example 31
Project: MeiTingTrunk   Author: Xunius   File: merge_name_dialog.py    GNU General Public License v3.0 5 votes vote down vote up
def openPDFViewer(self, filepath):
        '''Open a dialog showing the PDF viewer

        Args:
            filepath (str): rel or abs file path of the attachment to open.
        '''

        # if a file newly added and has not been saved, it would be an abs
        if not os.path.isabs(filepath):
            lib_folder=self.settings.value('saving/current_lib_folder', type=str)
            filepath=os.path.join(lib_folder, filepath)

        try:
            diag=QtWidgets.QDialog(self)
            diag.setWindowTitle(os.path.split(filepath)[1])
            diag.setWindowFlags(
                    Qt.Window |
                    Qt.WindowTitleHint |
                    Qt.WindowSystemMenuHint |
                    Qt.WindowMinimizeButtonHint |
                    Qt.WindowMaximizeButtonHint |
                    Qt.WindowCloseButtonHint |
                    Qt.WindowStaysOnTopHint
                    )

            diag.resize(700,600)
            va=QtWidgets.QVBoxLayout(diag)

            pdfframe=PDFFrame(diag)
            va.addWidget(pdfframe)

            pdfframe.loadFile(lib_folder, filepath)

            diag.show()
        except:
            LOGGER.warning('Failed to launch pdf viewer.') 
Example 32
Project: Lector   Author: BasioMeusPuga   File: definitionsdialog.py    GNU General Public License v3.0 5 votes vote down vote up
def color_background(self, set_initial=False):
        if set_initial:
            background = self.parent.settings['dialog_background']
        else:
            self.previous_position = self.pos()
            self.parent.get_color()
            background = self.parent.settings['dialog_background']

        # Calculate inverse color for the background so that
        # the text doesn't look blank
        r, g, b, alpha = background.getRgb()
        inv_average = 255 - (r + g + b) // 3
        if 100 < inv_average < 150:
            inv_average = 255

        foreground = QtGui.QColor(
            inv_average, inv_average, inv_average, alpha)

        self.setStyleSheet(
            "QDialog {{background-color: {0}}}".format(background.name()))
        self.definitionView.setStyleSheet(
            "QTextBrowser {{color:{0}; background-color: {1}}}".format(
                foreground.name(), background.name()))

        if not set_initial:
            self.show() 
Example 33
Project: Lector   Author: BasioMeusPuga   File: metadatadialog.py    GNU General Public License v3.0 5 votes vote down vote up
def color_background(self, set_initial=False):
        if set_initial:
            background = self.parent.settings['dialog_background']
        else:
            self.previous_position = self.pos()
            self.parent.get_color()
            background = self.parent.settings['dialog_background']

        self.setStyleSheet(
            "QDialog {{background-color: {0}}}".format(background.name()))
        self.coverView.setStyleSheet(
            "QGraphicsView {{background-color: {0}}}".format(background.name()))

        if not set_initial:
            self.show() 
Example 34
Project: pdash   Author: CPChain   File: dialog.py    GNU General Public License v3.0 5 votes vote down vote up
def style(self):
        return """
            QDialog {
                /*background: #fafafa;*/
                background: blue;
                border:1px solid #cccccc;
                border-radius:5px;
            }
            QWidget#main {
                background:#fafafa;
                border:1px solid #cccccc;
                border-bottom-left-radius:5px;
                border-bottom-right-radius:5px;

            }
            QFrame#header {
                background:#eeeeee;
                border:1px solid #cccccc;
                border-top-left-radius:5px;
                border-top-right-radius:5px;
                text-align:left;
                padding-top: 5px;
                padding-bottom:5px;
                padding-left: 15px;
                padding-right: 15px;
            }
            QLabel#title {
                font-size:16px;
                color:#333333;
                font-weight: 500;
            }
            QLabel#close_btn {
                font-size: 16px;
                color: #ee4040;
            }
            QWidget#main Qlabel{
                font-size:14px;
                color:#000000;
            }
        """ 
Example 35
Project: BBoxEE   Author: persts   File: annotation_assistant.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        """Class init function."""
        QtWidgets.QDialog.__init__(self, parent)
        self.setupUi(self)
        self.setWindowTitle('Annotation Assitant')
        self.setModal(True)
        self.set_labels(['N/A'])
        self.pb_submit.clicked.connect(self.submit) 
Example 36
Project: BBoxEE   Author: persts   File: coco_dialog.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        QtWidgets.QDialog.__init__(self, parent)
        self.setWindowTitle('COCO Information')
        self.setMinimumSize(500, 0)
        self.setModal(True)
        date_created = datetime.datetime.now().strftime('%Y-%m-%d %H:%S:%I')
        self.info = {'description': '',
                     'url': '',
                     'version': '',
                     'year': '',
                     'contributor': '',
                     'date_created': date_created}
        self.desc = QtWidgets.QLineEdit()
        self.desc.textChanged.connect(self.update)
        self.url = QtWidgets.QLineEdit()
        self.url.textChanged.connect(self.update)
        self.version = QtWidgets.QLineEdit()
        self.version.textChanged.connect(self.update)
        self.year = QtWidgets.QLineEdit()
        self.year.textChanged.connect(self.update)
        self.contrib = QtWidgets.QLineEdit()
        self.contrib.textChanged.connect(self.update)

        layout = QtWidgets.QFormLayout(self)
        layout.addRow("Description", self.desc)
        layout.addRow("Url", self.url)
        layout.addRow("Version", self.version)
        layout.addRow("Year", self.year)
        layout.addRow("Contributor", self.contrib) 
Example 37
Project: PyFluxPro   Author: OzFlux   File: pfp_top_level.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def do_file_split():
    Dialog = QtWidgets.QDialog()
    ui = split_dialog.Ui_Dialog()
    ui.setupUi(Dialog)
    ui.pushButton_InputFileName.clicked.connect(lambda:do_file_split_browse_input_filename(ui))
    ui.pushButton_OutputFileName.clicked.connect(lambda:do_file_split_browse_output_filename(ui))
    ui.pushButton_Run.clicked.connect(lambda:do_file_split_run(ui))
    ui.pushButton_Quit.clicked.connect(lambda:do_file_split_quit(ui))
    ui.info = {}
    ui.Dialog = Dialog
    Dialog.show()
    Dialog.exec_() 
Example 38
Project: visma   Author: aerospaceresearch   File: window.py    GNU General Public License v3.0 5 votes vote down vote up
def popupBrowser(self):
        w = QDialog(self)
        w.resize(600, 500)
        w.setWindowTitle('Wiki')
        web = QWebEngineView(w)
        web.load(QUrl('https://github.com/aerospaceresearch/visma/wiki'))
        web.resize(600, 500)
        web.show()
        w.show() 
Example 39
Project: plexdesktop   Author: coryo   File: extra_widgets.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, media_object, parent=None):
        super().__init__(parent)
        self.setWindowTitle('Preferences')
        self.form = QtWidgets.QFormLayout(self)
        server = media_object.container.server
        settings = server.container(media_object.key)
        self.ids = []
        for item in settings['_children']:
            itype = item['type']
            if itype == 'bool':
                input_widget = QtWidgets.QCheckBox()
                input_widget.setCheckState(QtCore.Qt.Checked if item['value'] == 'true' else QtCore.Qt.Unchecked)
            elif itype == 'enum':
                input_widget = QtWidgets.QComboBox()
                input_widget.addItems(item['values'].split('|'))
                input_widget.setCurrentIndex(int(item['value']))
            elif itype == 'text':
                input_widget = QtWidgets.QLineEdit(item['value'])
                if item['secure'] == 'true':
                    input_widget.setEchoMode(QtWidgets.QLineEdit.PasswordEchoOnEdit)
            else:
                input_widget = QtWidgets.QLabel('...')
            self.form.addRow(QtWidgets.QLabel(item['label']), input_widget)
            self.ids.append((item['id'], input_widget))

        self.buttons = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self)
        self.form.addRow(self.buttons)
        self.buttons.rejected.connect(self.reject)
        self.buttons.accepted.connect(self.accept)
        if self.exec_() == QtWidgets.QDialog.Accepted:
            media_object.container.server.request(media_object.key + '/set', params=self.extract_values()) 
Example 40
Project: plexdesktop   Author: coryo   File: extra_widgets.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        s = plexdesktop.settings.Settings()
        self.setWindowTitle('Preferences')
        self.form = QtWidgets.QFormLayout(self)

        i = QtWidgets.QComboBox()
        i.addItems(plexdesktop.style.Style.Instance().themes)
        i.setCurrentIndex(i.findText(s.value('theme')))
        self.form.addRow(QtWidgets.QLabel('theme'), i)

        bf = QtWidgets.QSpinBox()
        bf.setValue(int(s.value('browser_font', 9)))
        self.form.addRow(QtWidgets.QLabel('browser font size'), bf)

        icon_size = QtWidgets.QLineEdit(str(s.value('thumb_size', 240)))
        icon_size.setValidator(QtGui.QIntValidator(0, 300))
        self.form.addRow(QtWidgets.QLabel('thumbnail size'), icon_size)

        widget_player = QtWidgets.QCheckBox()
        widget_player.setCheckState(QtCore.Qt.Checked if bool(int(s.value('widget_player', 0))) else QtCore.Qt.Unchecked)
        self.form.addRow(QtWidgets.QLabel('use widget player'), widget_player)

        self.buttons = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel,
            QtCore.Qt.Horizontal, self)
        self.form.addRow(self.buttons)
        self.buttons.rejected.connect(self.reject)
        self.buttons.accepted.connect(self.accept)

        if self.exec_() == QtWidgets.QDialog.Accepted:
            # s = Settings()
            theme = i.currentText()
            s.setValue('theme', theme)
            plexdesktop.style.Style.Instance().theme(theme)

            s.setValue('browser_font', bf.value())

            s.setValue('thumb_size', int(icon_size.text()))

            s.setValue('widget_player', 1 if widget_player.checkState() == QtCore.Qt.Checked else 0) 
Example 41
Project: dottorrent-gui   Author: kz26   File: gui.py    GNU General Public License v3.0 5 votes vote down vote up
def showAboutDialog(self):
        qdlg = QtWidgets.QDialog()
        ad = Ui_AboutDialog()
        ad.setupUi(qdlg)
        ad.programVersionLabel.setText("version {}".format(__version__))
        ad.dtVersionLabel.setText("(dottorrent {})".format(
            dottorrent.__version__))
        qdlg.exec_() 
Example 42
Project: IDAngr   Author: andreafioraldi   File: init_gui.py    BSD 2-Clause "Simplified" License 5 votes vote down vote up
def go():
        dialog = IDAngrConnectDialog()
        r = dialog.exec_()
        if r == QtWidgets.QDialog.Accepted:
            if dialog.ui.saveBox.isChecked():
                config = {
                    "host": dialog.ui.hostTxt.displayText(),
                    "port": int(dialog.ui.portTxt.displayText()),
                    "save": True,
                    "local": dialog.ui.localBox.isChecked()
                }
                mkpath(user_data_dir("IDAngr", "IDA Pro"))
                with open(config_file, "w") as f:
                    json.dump(config, f, indent=4)
            
            try:
                if dialog.ui.localBox.isChecked():
                    manage.init(use_pin=dialog.ui.pinBox.isChecked())
                else:
                    manage.init(True, dialog.ui.hostTxt.displayText(), int(dialog.ui.portTxt.displayText()), use_pin=dialog.ui.pinBox.isChecked())
            except Exception as ee:
                QtWidgets.QMessageBox(QtWidgets.QMessageBox.Critical, 'IDAngr init error', str(ee)).exec_()
                return False
            
            return True
        return False 
Example 43
Project: IDAngr   Author: andreafioraldi   File: main_gui.py    BSD 2-Clause "Simplified" License 5 votes vote down vote up
def __init__(self, text, title):
        QtWidgets.QDialog.__init__(self)
        self.text = text
        self.ui = Ui_IDAngrTextViewer()
        self.ui.setupUi(self)
        if title:
            self.setWindowTitle(title)
        self.ui.plainTextEdit.setPlainText(str(text))
        self.ui.plainBox.toggled.connect(self.plain_toggled)
        self.ui.hexBox.toggled.connect(self.hex_toggled)
        self.ui.pyBox.toggled.connect(self.py_toggled) 
Example 44
Project: IDAngr   Author: andreafioraldi   File: main_gui.py    BSD 2-Clause "Simplified" License 5 votes vote down vote up
def __init__(self):
        QtWidgets.QDialog.__init__(self)
        
        self.ui = Ui_IDAngrAddMem()
        self.ui.setupUi(self)
        
        self.ui.lenTextEdit.setText(str(load_project().arch.bits / 8)) 
Example 45
Project: IDAngr   Author: andreafioraldi   File: main_gui.py    BSD 2-Clause "Simplified" License 5 votes vote down vote up
def go(folder, title="Saveds"):
        dialog = IDAngrSavedsDialog(folder, title)
        r = dialog.exec_()
        if r == QtWidgets.QDialog.Accepted:
            return dialog.ui.codeView.toPlainText() 
Example 46
Project: IDAngr   Author: andreafioraldi   File: main_gui.py    BSD 2-Clause "Simplified" License 5 votes vote down vote up
def __init__(self, item, text=""):
        QtWidgets.QDialog.__init__(self)
        
        self.ui = Ui_IDAngrConstraintsDialog()
        self.ui.setupUi(self)
        
        if type(item) in (int, long):
            item = hex(item)
        
        self.ui.constrEdit.setPlainText(text)
        self.setWindowTitle("Edit Constraints - " + str(item))
        self.h = PythonHighlighter(self.ui.constrEdit.document())
        
        self.ui.savedsBtn.clicked.connect(self.saveds_clicked) 
Example 47
Project: IDAngr   Author: andreafioraldi   File: main_gui.py    BSD 2-Clause "Simplified" License 5 votes vote down vote up
def go(item):
        global _idangr_ctx
        if item in _idangr_ctx.constraints:
            dialog = IDAngrConstraintsDialog(item, _idangr_ctx.constraints[item][0])
        else:
            dialog = IDAngrConstraintsDialog(item, "# add your constraints to the var 'sym' using the var 'state'\n")
        
        r = dialog.exec_()
        if r == QtWidgets.QDialog.Accepted:
            code = dialog.ui.constrEdit.toPlainText()
            func = "def constr_func(sym, state):\n"
            for line in code.split("\n"):
                func += "\t" + line + "\n"
            try:
                if manage.is_remote():
                    manage.remote_exec(func)
                else:
                    exec(func) in globals()
            except Exception as ee:
                QtWidgets.QMessageBox(QtWidgets.QMessageBox.Critical, 'Constraints Code - Python Error', str(ee)).exec_()
                return
            
            if manage.is_remote():
                _idangr_ctx.constraints[item] = (code, manage.remote_eval("constr_func"))
            else:
                _idangr_ctx.constraints[item] = (code, constr_func) 
Example 48
Project: chinese-support-redux   Author: luoliyan   File: about.py    GNU General Public License v3.0 5 votes vote down vote up
def showAbout():
    dialog = QDialog(mw)

    label = QLabel()
    label.setStyleSheet('QLabel { font-size: 14px; }')

    contributors = [
        'Alex Griffin',
        'Chris Hatch',
        'Roland Sieker',
        'Thomas TEMPÉ',
    ]

    text = '''
<div style="font-weight: bold">Chinese Support Redux v%s</div><br>
<div><span style="font-weight: bold">
    Maintainer</span>: Joseph Lorimer &lt;[email protected]&gt;</div>
<div><span style="font-weight: bold">Contributors</span>: %s</div>
<div><span style="font-weight: bold">Website</span>: <a href="%s">%s</a></div>
<div style="font-size: 12px">
    <br>Based on the Chinese Support add-on by Thomas TEMPÉ and many others.
    <br>If your name is missing from here, please open an issue on GitHub.
</div>
''' % (__version__, ', '.join(contributors), CSR_GITHUB_URL, CSR_GITHUB_URL)

    label.setText(text)
    label.setOpenExternalLinks(True)

    buttonBox = QDialogButtonBox(QDialogButtonBox.Ok)
    buttonBox.accepted.connect(dialog.accept)

    layout = QVBoxLayout()
    layout.addWidget(label)
    layout.addWidget(buttonBox)

    dialog.setLayout(layout)
    dialog.setWindowTitle('About')
    dialog.exec_() 
Example 49
Project: idapython   Author: mr-tz   File: highlight_instructions.py    GNU General Public License v3.0 5 votes vote down vote up
def clear_colors(self):
        self.done(QtWidgets.QDialog.Accepted)
        highlighters = []
        highlighters.append(ClearHighlighter())
        highlight_instructions(highlighters) 
Example 50
Project: 7i76e   Author: jethornton   File: 7i76e.py    MIT License 5 votes vote down vote up
def on_actionAbout_triggered(self):
		dialog = QtWidgets.QDialog()
		dialog.ui = aboutDialog()
		dialog.ui.setupUi(dialog)
		dialog.ui.versionLB.setText('Version {}'.format(self.version))
		dialog.ui.systemLB.setText(self.pcStats.system)
		dialog.ui.releaseLB.setText('Kernel {}'.format(self.pcStats.release))
		dialog.ui.machineLB.setText('Processor {}'.format(self.pcStats.machine))
		if sys.maxsize > 2**32: # test for 64bit OS
			dialog.ui.bitsLB.setText('64 bit OS')
		else:
			dialog.ui.bitsLB.setText('32 bit OS')
		dialog.exec_()