Ejemplo n.º 1
0
    def __init__(self):

        # Get fonts
        self.heading_font = QtGui.QLabel().font()
        self.heading_font.setBold(True)

        self.note_font = QtGui.QLabel().font()
        self.note_font.setPointSize(self.note_font.pointSize() - 3)

        self.normal_font = QtGui.QLabel().font()
        self.normal_font.setBold(False)

        # Construct dialog
        self.dialog = QtGui.QDialog()
        self.dialog.setModal(True)
        self.dialog.setWindowTitle("Legify Brick Macro")

        # Construct widgets
        box_layout = QtGui.QVBoxLayout(self.dialog)
        box_layout.addWidget(self._construct_dimensions_widgets())
        box_layout.addWidget(self._construct_top_studs_widgets())
        box_layout.addWidget(self._construct_side_studs_widgets())
        box_layout.addWidget(self._construct_pins_widgets())
        box_layout.addWidget(self._construct_holes_widgets())
        box_layout.addWidget(self._construct_button_widgets())

        # Show dialog
        self.dialog.show()
        self.dialog.exec_()
    def __init__(self, parent=None):
        super().__init__(parent=parent)

        self.additional_parameters_window = QtGui.QDialog()
        self.additional_parameters_window.setWindowTitle(
            __("Additional parameters"))

        self.ok_button = QtGui.QPushButton(__("Ok"))
        self.cancel_button = QtGui.QPushButton(__("Cancel"))

        self.ok_button.clicked.connect(self.on_ok)
        self.cancel_button.clicked.connect(self.on_cancel)

        # Button layout definition
        self.eo_button_layout = QtGui.QHBoxLayout()
        self.eo_button_layout.addStretch(1)
        self.eo_button_layout.addWidget(self.ok_button)
        self.eo_button_layout.addWidget(self.cancel_button)

        self.paramintro_layout = QtGui.QHBoxLayout()
        self.paramintro_label = QtGui.QLabel(__("Additional Parameters: "))
        self.export_params = QtGui.QLineEdit()
        self.export_params.setText(Case.the().info.run_additional_parameters)
        self.paramintro_layout.addWidget(self.paramintro_label)
        self.paramintro_layout.addWidget(self.export_params)

        self.additional_parameters_layout = QtGui.QVBoxLayout()
        self.additional_parameters_layout.addLayout(self.paramintro_layout)
        self.additional_parameters_layout.addStretch(1)
        self.additional_parameters_layout.addLayout(self.eo_button_layout)

        self.additional_parameters_window.setLayout(
            self.additional_parameters_layout)
        self.additional_parameters_window.exec_()
Ejemplo n.º 3
0
    def showAboutDialog(self, MainWindow, version):
        aboutDialog = QtGui.QDialog(MainWindow)
        layout = QtGui.QVBoxLayout()
        aboutText = QtGui.QLabel()
        aboutText.setObjectName("aboutText")
        aboutText.setText(
            "<div align=\"center\"><h1>BoarG %s</h1>"
            "<br/>BoarG is a simple GUI for the<br/>version control system boar.<br/>"
            "<a href=\"http://www.boarvcs.com\">www.boarvcs.com</a><br/><br/>"
            "<small>Copyright &copy;2014 - Robert Einhaus</small><br/><br/>"
            "<a href=\"http://boarg.wbbu.de\">boarg.wbbu.de</a><br/><br/><br/>"
            "This program comes with ABSOLUTELY NO WARRANTY.<br/>This is free software, and you"
            "are welcome to<br/>redistribute it under certain conditions.</div>"
            % version)
        layout.addWidget(aboutText)

        hbox = QtGui.QHBoxLayout()
        okButton = QtGui.QPushButton("Ok")
        okButton.clicked.connect(aboutDialog.close)
        licenseButton = QtGui.QPushButton("Show License")
        licenseButton.clicked.connect(
            lambda: self.showLicenseDialog(MainWindow))
        hbox.addWidget(okButton)
        hbox.addWidget(licenseButton)
        layout.addLayout(hbox)

        aboutDialog.setLayout(layout)
        aboutDialog.setObjectName("aboutDialog")
        aboutDialog.setWindowTitle("About")
        aboutDialog.resize(350, 250)
        aboutDialog.exec_()
Ejemplo n.º 4
0
    def showRemoveDirDialog(self, MainWindow):
        removeDirDialog = QtGui.QDialog(MainWindow)
        layout = QtGui.QVBoxLayout()
        removeDirText = QtGui.QLabel()

        selectedDirs = self.dirList.selectedItems()
        for dir in selectedDirs:
            dirStr = dir.text() + "\n\n"

        removeDirText.setText(
            "Are you sure you want to delete the following entries:\n\n" +
            dirStr)
        layout.addWidget(removeDirText)

        hlayout = QtGui.QHBoxLayout()
        yesButton = QtGui.QPushButton("Yes")
        yesButton.clicked.connect(removeDirDialog.accept)
        hlayout.addWidget(yesButton)

        noButton = QtGui.QPushButton("No")
        noButton.clicked.connect(removeDirDialog.reject)
        hlayout.addWidget(noButton)

        layout.addLayout(hlayout)
        removeDirDialog.setLayout(layout)
        removeDirDialog.setObjectName("removeDirDialog")
        removeDirDialog.setWindowTitle("Remove Directory")
        return removeDirDialog.exec_()
Ejemplo n.º 5
0
 def __init__(self, estado, nome):
     super(AvisoReligador, self).__init__()
     self.estado = estado
     self.nome = nome
     self.dialog = QtGui.QDialog(self)
     self.setupUi(self.dialog)
     self.dialog.exec_()
Ejemplo n.º 6
0
 def __init__(self):
     self.app = qg.QApplication(sys.argv)
     self.filesList = []
     self.folderPath = fileRoot
     self.mainDialog = qg.QDialog()
     self.mainLayout = qg.QVBoxLayout()
     self.mainDialog.setLayout(self.mainLayout)
     self.mainDialog.setWindowTitle("Sequential File Selector")
     self.fileListWidget = qg.QListWidget()
     self.fileListWidget.setSelectionMode(
         qg.QAbstractItemView.ExtendedSelection)
     self.mainLayout.addWidget(self.fileListWidget)
     self.buttonLayout = qg.QHBoxLayout()
     self.chooseButton = qg.QPushButton("Choose Folder")
     self.buttonLayout.addWidget(self.chooseButton)
     self.chooseButton.clicked.connect(self.chooseFolder)
     self.printButton = qg.QPushButton("Print Files")
     self.buttonLayout.addWidget(self.printButton)
     self.printButton.clicked.connect(self.printFiles)
     self.cancelButton = qg.QPushButton("Cancel")
     self.cancelButton.clicked.connect(self.cancel)
     self.buttonLayout.addWidget(self.cancelButton)
     self.mainLayout.addLayout(self.buttonLayout)
     self.mainDialog.show()
     sys.exit(self.app.exec_())
Ejemplo n.º 7
0
    def __init__(self):

        self.Dialog = QtGui.QDialog()
        self.setupUi(self.Dialog)
        self.animset = sfm.GetCurrentAnimationSet()
        self.ExpandToolBox()
        self.audiofilepath = None
        self.audioAnalyze = None

        if type(sfmClipEditor.GetSelectedClips()
                [0]) is not vs.movieobjects.CDmeSoundClip:
            self.ErrorBox("One Wav file needs to be selected!")
            return
        ClipName = sfmClipEditor.GetSelectedClips()[0].GetName().replace(
            '\\', '/')

        #we need to search though sfm file cache because CDmeSoundClip does not hold full file path
        with open("build_file_cache.txt", 'r') as inF:
            for line in inF:
                if ClipName in line:

                    self.audiofilepath = re.search(r'game.*?\.wav',
                                                   line).group()[5:]
                    break

        self.Dialog.closeEvent = self.closeEvent
        #allows user to somewhat interact with sfm while script is active. any changes to scene will happen once script is closed
        self.Dialog.show()
        #important!!, any gui that needs to alter animset values for animation needs to be .exec_() else sfm will crash
        self.Dialog.exec_()
Ejemplo n.º 8
0
    def __init__(self):

        super(Ui_RenameClassDialog, self).__init__()
        self.d = QtGui.QDialog()
        self.setupUi(self.d)
        self.old_name = ""
        self.new_name = ""
        self.text_items = []
        self.functions = []
        self.header_files = []

        self.ok_btn.clicked.connect(self.ok_btn_clicked)
        self.cancel_btn.clicked.connect(self.cancel_btn_clicked)
        self.class_cb.editTextChanged.connect(self.oldname_changed)
        self.new_name_edit.textChanged.connect(self.newname_changed)
        self.include_all_cb.stateChanged.connect(self.all_state_changed)
        visual_style.set(self.d)

        self.structname_to_file_table = {}
        self.field_to_struct_table = {}

        for h in proj.header_files():
            hfile = hparser.HFile(h)
            for name in hfile.struct_list():
                self.structname_to_file_table[name] = h
                # for field in hfile.get(name).names():
                #     l = self.field_to_struct_table.get(field, [])
                #     l.append(name)
                #     self.field_to_struct_table[field] = l
        self.struct_completer = QtGui.QCompleter(
            self.structname_to_file_table.keys(), self.d)
        self.struct_completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
        self.class_cb.setCompleter(self.struct_completer)
Ejemplo n.º 9
0
    def __init__(self):

        self.Dialog = QtGui.QDialog()
        self.animset = sfm.GetCurrentAnimationSet()
        self.setupUi(self.Dialog)

        self.ExpandToolBox()
        self.audiofilepath = None
        self.audioAnalyze = None

        if len(sfmClipEditor.GetSelectedClips("CDmeSoundClip")) == 0:
            self.ErrorBox("One Wav file needs to be selected!")
            return

        self.sfmCDmeSoundClip = sfmClipEditor.GetSelectedClips()[0]
        ClipName = self.sfmCDmeSoundClip.GetName().replace('\\', '/')

        if "wav" not in ClipName[-4:]:
            self.ErrorBox("Sound file Needs to be .wav")
            return

#we need to search though sfm mod paths cache because CDmeSoundClip does not contain a full file path

        search_paths = filesystem.valve.GameInfoFile(
            filesystem.valve.mod() + "/gameinfo.txt").getSearchMods()

        for index in range(len(search_paths)):
            if os.path.isfile(search_paths[index] + "/sound/" + ClipName):
                self.audiofilepath = search_paths[index] + "/sound/" + ClipName

        self.Dialog.closeEvent = self.closeEvent
        #allows user to somewhat interact with sfm while script is active. any changes to scene will happen once script is closed
        self.Dialog.show()
        #important!!, any gui that needs to alter animset values for animation needs to be .exec_() else sfm will crash
        self.Dialog.exec_()
Ejemplo n.º 10
0
    def _requestKernelSize(self, slice):
        """ Build the dialogue that allows the user to set the number and updates the main window with the new mask

        :param slice: int
        The current slice displayed on the main window.
        :return:
        """
        map = self._mapGenerator.baselineMap()
        mapShape = map.shape
        self._inputDialog = QtGui.QDialog()
        self._numberInput = NumberInput.Ui_NumberInput()
        self._numberInput.setupUi(self._inputDialog)
        g = self._inputDialog.geometry()
        g.moveTo(900, 300)
        self._inputDialog.setGeometry(g)
        self._numberInput.slider_xKernel.valueChanged.connect(
            self._selectCandidateAortaSeed)
        self._numberInput.slider_yKernel.valueChanged.connect(
            self._selectCandidateAortaSeed)
        self._numberInput.slider_slice.setMaximum(self._mapGenerator.getNz())
        self._numberInput.slider_slice.valueChanged.connect(self._sliceChanged)
        self._numberInput.slider_slice.setValue(slice)
        self._numberInput.spinBox_slice.setValue(slice)
        self._numberInput.spinBox_slice.setMaximum(self._mapGenerator.getNz())
        self._numberInput.spinBox_xKernel.setMaximum(mapShape[2])
        self._numberInput.slider_xKernel.setMaximum(mapShape[2])
        self._numberInput.spinBox_yKernel.setMaximum(mapShape[1])
        self._numberInput.slider_yKernel.setMaximum(mapShape[1])
        self._numberInput.slider_xKernel.setValue(3)
        self._numberInput.slider_yKernel.setValue(13)
        details = '+ The selected aorta seed is shown (single voxel). \n' \
                  '+ You can change the size of the kernel used to find the seed. \n' \
                  '+ Press \'OK\' to generate a mask of the aorta from the seed.'
        self._numberInput.label_description.setText(details)
Ejemplo n.º 11
0
    def findSelectedClass(self) :
    	className = self.app.tab_edit.selectedText
    	d = QtGui.QDialog(self)
    	rowMatched = -1
    	for row in range(0, self.classCount) :
    	    edit = QtGui.QPlainTextEdit(self.tab.item(row, 0).text(), d)
    	    cname = edit.toPlainText()
    	    if cname == className :
    	    	rowMatched = row
    	    	break
    	
    	if rowMatched > -1 :
    	    item = self.tab.item(rowMatched, 0)
    	    self.tab.scrollToItem(item)
    	    item.setBackground(Layout.activePassColour)
    	    
    	    if self.selClassName == className :  # second time clicked
    	        self.findSourceForClass(rowMatched)
    	#else :
    	#    QtGui.QSound.play()
    	        
    	self.selClassName = className

    # end of findSelectedClass
    
# end of class Classes (tab widget)
Ejemplo n.º 12
0
    def naca_dialog(self):
        dialog = QtGui.QDialog()
        layout = QtGui.QFormLayout(dialog)
        dialog.setLayout(layout)
        button_box = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok
                                            | QtGui.QDialogButtonBox.Cancel)
        q_nacadigits = QtGui.QLineEdit()
        q_nacadigits.setText("2412")
        q_numpoints = QtGui.QSpinBox()
        q_numpoints.setRange(10, 500)
        q_numpoints.setValue(50)

        def dialog_accept(*args):
            commands.make_naca(q_nacadigits.text(), q_numpoints.value())
            dialog.close()
            self.accept()

        def dialog_reject(*args):
            dialog.close()

        button_box.accepted.connect(dialog_accept)
        button_box.rejected.connect(dialog_reject)

        layout.addRow(QtGui.QLabel("naca digits [string]"), q_nacadigits)
        layout.addRow(QtGui.QLabel("numpoints per side"), q_numpoints)
        layout.addRow(button_box)
        dialog.exec()
Ejemplo n.º 13
0
 def createDatabase(self):
     #Step 2
     print("In create database")
     # Create a dialog box
     self.myDialog = QtGui.QDialog(self)
     self.myDialog.setWindowTitle("Create Database")
     # Create a grid layout
     layout = QtGui.QGridLayout()
     label = QtGui.QLabel("Give a name:")
     self.dbBox = QtGui.QLineEdit()
     layout.addWidget(label, 0, 0)
     layout.addWidget(self.dbBox, 0, 1)
     # Add Ok and Cancel buttons
     buttons = QtGui.QDialogButtonBox()
     buttons.setOrientation(QtCore.Qt.Horizontal)
     buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole)
     buttons.addButton("Ok", QtGui.QDialogButtonBox.AcceptRole)
     # Connect the Ok button to create function
     self.myDialog.connect(buttons, QtCore.SIGNAL("accepted()"),
                           self.create)
     # Connect the Cancel with closing the dialog
     self.myDialog.connect(buttons, QtCore.SIGNAL("rejected()"),
                           self.myDialog.close)
     # Add buttons to the dialog box at row 1 column 0 with rowspan 1 and columnspan 1
     layout.addWidget(buttons, 1, 0, 1, 1, QtCore.Qt.AlignCenter)
     # Add layout to dialog
     self.myDialog.setLayout(layout)
     # Run the dialog
     self.myDialog.exec_()
Ejemplo n.º 14
0
    def __init__(self):

        super(Ui_RenameVarDialog, self).__init__()
        self.d = QtGui.QDialog()
        self.setupUi(self.d)
        self.old_name = ""
        self.new_name = ""
        self.vars = []
        self.functions = []

        self.ok_btn.clicked.connect(self.ok_btn_clicked)
        self.cancel_btn.clicked.connect(self.cancel_btn_clicked)
        self.old_name_edit.textChanged.connect(self.oldname_changed)
        self.new_name_edit.textChanged.connect(self.newname_changed)
        visual_style.set(self.d)

        self.structname_to_file_table = {}
        self.field_to_struct_table = {}

        for h in proj.header_files():
            hfile = hparser.HFile(h)
            for name in hfile.struct_list():
                self.structname_to_file_table[name] = h
                for field in hfile.get(name).names():
                    l = self.field_to_struct_table.get(field, [])
                    l.append(name)
                    self.field_to_struct_table[field] = l
    def __init__(self, parent=None):
        self.dialog = None
        self.dialog = QtGui.QDialog()
        self.dialog.resize(360,400)
        self.dialog.setWindowTitle("About...")

        info = QtGui.QTextEdit("<h2>INFORMATION</h2><hr><br>This macro helps managing aliases inside FreeCAD Spreadsheet workbench. It is able to create, delete, move aliases and create a 'part family' group of files.<br><h2>USAGE</h2><hr><ul><li><b>set aliases</b>: based on first column (A column), it will create aliases for the range given. If an alias is already set for any other cell the command won't work, it will be needed to clear them before setting them again.</li><li><b>Clear aliases</b>: it will clear all aliases inside the given range of cells (only one column).</li><li><b>Move aliases</b>: it will clear and set aliases <b>from</b> a given column <b>to</b> a new one.</li><li><b>Generate part family</b>: it will create different files for each column in a range. It will add to the original name a suffix based on first row. If an alias is already set for any other cell the command won't work, it will be needed to clear them before running the command.</li></ul><h2>LICENCE</h2><hr>Original work done by <b>tarihatari</b> (<a href='https://github.com/tarihatari/FreeCAD_Macros'>https://github.com/tarihatari/FreeCAD_Macros</a>)<br>Improved by <b>Pablo Gil Fernandez</b><br><br>Copyright (c) 2016 tarihatari & Pablo Gil Fernandez<br><br>This work is licensed under GNU Lesser General Public License (LGPL).<br>To view a copy of this license, visit <a href='https://www.gnu.org/licenses/lgpl-3.0.html'>https://www.gnu.org/licenses/lgpl-3.0.html</a>.<br>")
        info.setReadOnly(True)
        info.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)

        okbox = QtGui.QDialogButtonBox(self.dialog)
        okbox.setOrientation(QtCore.Qt.Horizontal)
        okbox.setStandardButtons(QtGui.QDialogButtonBox.Close)
        okbox.setFocus()

        grid2 = QtGui.QGridLayout()
        grid2.setSpacing(10)
        grid2.addWidget(info, 0, 0)
        grid2.addWidget(okbox, 1, 0)

        self.dialog.setLayout(grid2)

        QtCore.QObject.connect(okbox, QtCore.SIGNAL("rejected()"), self.close)
        QtCore.QMetaObject.connectSlotsByName(self.dialog)
        self.dialog.show()
        self.dialog.exec_()
Ejemplo n.º 16
0
	def getName(self):
		u'''
		弹出命名窗口
		'''
		inputName = QtGui.QDialog(self)
		#

		inNameL = QtGui.QLabel('命名')
		inNameLE = QtGui.QLineEdit('')
		inNameDBB = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Save|QtGui.QDialogButtonBox.Cancel)


		inputNameMainLay = QtGui.QVBoxLayout()
		inputNameMainLay.addWidget(inNameL)
		inputNameMainLay.addWidget(inNameLE)
		inputNameMainLay.addWidget(inNameDBB)

		inputName.setLayout(inputNameMainLay)



		callback = partial(self.nameDialogAccept,inNameLE)
		inNameDBB.accepted.connect(callback)
		inNameDBB.accepted.connect(inputName.accept)
		inNameDBB.rejected.connect(self.nameDialogReject)
		inNameDBB.rejected.connect(inputName.reject)


		inputName.show()
		inputName.exec_()
		return  self.buttonName
Ejemplo n.º 17
0
    def __init__(self):
        self.dialog = None

        self.dialog = QtGui.QDialog()
        self.dialog.resize(280,110)

        self.dialog.setWindowTitle("Apothem Based Prism")
        la = QtGui.QVBoxLayout(self.dialog)

        iN1 = QtGui.QLabel("Distance Between Flats")
        la.addWidget(iN1)
        self.d1 = QtGui.QLineEdit()
        la.addWidget(self.d1)

        iN2 = QtGui.QLabel("Number Of Sides (Best results - use even numbers)")
        la.addWidget(iN2)
        self.d2 = QtGui.QLineEdit()
        la.addWidget(self.d2)

        iN3 = QtGui.QLabel("Prism Height")
        la.addWidget(iN3)
        self.d3 = QtGui.QLineEdit()
        la.addWidget(self.d3)

        okbox = QtGui.QDialogButtonBox(self.dialog)
        okbox.setOrientation(QtCore.Qt.Horizontal)
        okbox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        la.addWidget(okbox)
        QtCore.QObject.connect(okbox, QtCore.SIGNAL("accepted()"), self.priSm)
        QtCore.QObject.connect(okbox, QtCore.SIGNAL("rejected()"), self.close)
        QtCore.QMetaObject.connectSlotsByName(self.dialog)
        self.dialog.show()
        self.dialog.exec_()
Ejemplo n.º 18
0
    def on_actionExport_triggered(self):
        nm = QtGui.QDialog()
        nm.ui = Ui_export()
        nm.ui.setupUi(nm)
        if nm.exec_() == nm.Accepted:

            noise_rate = nm.ui.noise_rate_slider.value() / 100
            ang_noise_dir = nm.ui.ang_noise_dir_slider.value() / 100
            dist_noise_dir = nm.ui.dist_noise_dir_slider.value() / 100
            dist_ratio = int(nm.ui.dist_ratio_lineedit.text())
            total_scan = int(nm.ui.total_scan_lineedit.text())

            fname = QtGui.QFileDialog.getSaveFileName(self, "Save File",
                                                      "map.log", "log")

            map_exporter = MapExporter(noise_rate, ang_noise_dir,
                                       dist_noise_dir, dist_ratio, total_scan)

            ep = Thread(target=self.__do_export, args=(map_exporter, fname))
            ep.start()

            self.progbar.move(self.rect().center())
            self.progbar.setRange(0, self.mc.getPosList(total_scan) - 1)
            self.progbar.show()
            self.progbar.valueChanged.connect(self.progbar.setValue)
Ejemplo n.º 19
0
    def _new_roi(self):
        dialog = QtGui.QDialog(self)
        dialog.setWindowTitle("New ROI")
        vbox = QtGui.QVBoxLayout()
        dialog.setLayout(vbox)

        optbox = OptionBox()
        optbox.add("ROI name", TextOption(), key="name")
        optbox.add("Data space from", DataOption(self.ivm), key="grid")
        vbox.addWidget(optbox)

        buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok
                                         | QtGui.QDialogButtonBox.Cancel)
        buttons.accepted.connect(dialog.accept)
        buttons.rejected.connect(dialog.reject)
        vbox.addWidget(buttons)

        ok = dialog.exec_()
        if ok:
            roiname = optbox.option("name").value
            grid = self.ivm.data[optbox.option("grid").value].grid
            roidata = np.zeros(grid.shape, dtype=np.int)
            self.ivm.add(NumpyData(roidata, grid=grid, roi=True, name=roiname),
                         make_current=True)

            # Throw away old history. FIXME is this right, should we keep existing data and history?
            # Also should we cache old history in case we go back to this ROI?
            self._history = []
            self._undo_btn.setEnabled(False)
            self.options.option("roi").value = roiname
Ejemplo n.º 20
0
    def createTool(self):
        PathLog.track()
        tool = PathToolBit.Factory.Create()

        def accept():
            self.editor.accept()
            self.dialog.done(1)
            self.updateTools(tool.Label)

        def reject():
            FreeCAD.ActiveDocument.openTransaction(translate('PathToolBit', 'Uncreate ToolBit'))
            self.editor.reject()
            self.dialog.done(0)
            FreeCAD.ActiveDocument.removeObject(tool.Name)
            FreeCAD.ActiveDocument.commitTransaction()

        self.dialog = QtGui.QDialog(self.form)
        layout = QtGui.QVBoxLayout(self.dialog)
        self.editor = PathToolBitEdit.ToolBitEditor(tool, self.dialog)
        self.editor.setupUI()
        self.buttons = QtGui.QDialogButtonBox(
                QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel,
                QtCore.Qt.Horizontal, self.dialog)
        layout.addWidget(self.buttons)
        self.buttons.accepted.connect(accept)
        self.buttons.rejected.connect(reject)
        print(self.dialog.exec_())
Ejemplo n.º 21
0
    def __init__(self, gui):
        Parametric.__init__(self, gui)        
        
        self.name     = self.gui.ParCurve_name_2
        self.la       = self.gui.ParCurve_a_2
        self.lb       = self.gui.ParCurve_b_2
        self.lx       = self.gui.ParCurve_x_2
        self.ly       = self.gui.ParCurve_y_2
        self.ltmin    = self.gui.ParCurve_tmin_2
        self.ltmax    = self.gui.ParCurve_tmax_2
        self.ltstep   = self.gui.ParCurve_tstep_2
        
        self.lpolar      = self.gui.checkBox_polar_2
        self.cb_points   = self.gui.checkBox_points_2       
        self.cb_polyline = self.gui.checkBox_polyline_2
        self.cb_bspline  = self.gui.checkBox_bspline_2
        self.cb_bezier   = self.gui.checkBox_bezier_2
        
        self.cb_close    = self.gui.checkBox_close_2
        self.cb_face     = self.gui.checkBox_face_2

        self.cb_face.setEnabled(False) 
        self.close  = False
        self.face   = False

        self.combox = self.gui.ParCurve_comboBox_2
        
        self.dialog = QtGui.QDialog()
        self.dialog.resize(280,110)
        self.dialog.setWindowTitle("2D Parametric Curve Editor") 
        self.dialog.ui = ParCurveEdit.tableWidget2D(database="Parametric2D.dat")
        self.dialog.ui.setupUi(self.dialog, self.combox)
Ejemplo n.º 22
0
 def __init__(self, item):
     super(RecloserDialog, self).__init__()
     self.dialog = QtGui.QDialog(self)
     self.item = item
     self.scene = self.item.scene()
     self.setupUi(self.dialog)
     self.dialog.exec_()
Ejemplo n.º 23
0
    def config(self):
        import preferences_dialog

        Dialog = QtGui.QDialog(Window)
        ui = preferences_dialog.PreferencesDialog(self.depts)
        ui.setupUi(Dialog)
        Dialog.show()
Ejemplo n.º 24
0
    def __init__(self, parent=None):
        super(BlockReplacementButton, self).__init__()

        self.replacementList = BlockReplacementList()
        self.replacementDialog = QtGui.QDialog(QtGui.qApp.mainWindow)

        self.replacementOk = QtGui.QPushButton(self.tr("OK"))
        self.replacementOk.clicked.connect(self.replacementDialog.accept)

        self.replacementDialog.setWindowTitle(self.tr("Choose blocks to replace"))
        self.replacementDialog.setLayout(Column(self.replacementList,
                                                Row(None, self.replacementOk)))

        self.oldBlockButton = BlockTypeButton(multipleSelect=True)
        self.newBlockButton = BlockTypeButton()
        self.advancedButton = QtGui.QPushButton(self.tr("Advanced..."))

        self.simpleButton = QtGui.QPushButton(self.tr("No, simple!"))
        self.simpleButton.setVisible(False)
        self.simpleButton.clicked.connect(self.goSimple)

        self.setLayout(Column(self.oldBlockButton,
                              self.newBlockButton,
                              self.advancedButton,
                              self.simpleButton,
                              margin=0))

        self.oldBlockButton.blocksChanged.connect(self.simpleBlocksChanged)
        self.newBlockButton.blocksChanged.connect(self.simpleBlocksChanged)
        self.advancedButton.clicked.connect(self.displayDialog)
Ejemplo n.º 25
0
    def addEquipment(self):
        from add_dialog import AddDialog

        Dialog = QtGui.QDialog(Window)
        ui = AddDialog(self.deptComboBox.currentIndex() + 1, self)
        ui.setupUi(Dialog)
        Dialog.show()
Ejemplo n.º 26
0
def main():

    # Parse command line arguments.
    parser = argparse.ArgumentParser(
        description=
        'This script open an interactive tree view with all settings of a biogeochemical model.'
    )
    parser.add_argument(
        'path',
        help=
        'Path to a YAML file with the model configuration (typically fabm.yaml)',
        nargs='?',
        default='fabm.yaml')
    args = parser.parse_args()

    # Create model object
    model = pyfabm.Model(args.path)

    # Create Qt application object
    app = QtGui.QApplication([' '])

    # Create dialog box with model configuration tree.
    dialog = QtGui.QDialog()
    dialog.setWindowTitle('Configure model')
    layout = QtGui.QHBoxLayout()
    tree = pyfabm.gui_qt.TreeView(model, dialog)
    layout.addWidget(tree)
    dialog.setLayout(layout)
    dialog.show()

    # Show dialog
    ret = app.exec_()
Ejemplo n.º 27
0
def preferencesDialog():
    """Preferences dialog."""

    def onAccepted():
        """Close dialog on button close."""
        dia.done(1)

    def onFinished():
        """Delete dialog on close."""
        dia.deleteLater()

    dia = QtGui.QDialog(mw)
    dia.resize(800, 450)
    dia.setWindowTitle("Autoload")
    dia.setObjectName("Autoload")
    lo = QtGui.QVBoxLayout()
    dia.setLayout(lo)
    btnCl = QtGui.QPushButton("Close", dia)
    btnCl.setDefault(True)
    loCl = QtGui.QHBoxLayout()
    loCl.addStretch(1)
    loCl.addWidget(btnCl)
    w = widget(dia)
    lo.addWidget(w)
    lo.insertLayout(1, loCl)
    dia.finished.connect(onFinished)
    btnCl.clicked.connect(onAccepted)
    return dia
Ejemplo n.º 28
0
 def on_pushButtonZoom_clicked(self):
     if os.path.exists(self.fname + '.svg'):
         zdialog = QtGui.QDialog()
         webView = QtWebKit.QWebView(zdialog)
         zdialog.setWindowTitle('Zoom')
         webView.load(QtCore.QUrl(self.fname + '.svg'))
         webView.show()
         zdialog.exec_()
Ejemplo n.º 29
0
 def showAddSpell(self):
     Dialog = QtGui.QDialog()
     asw = AddSpellWindow(self.db)
     asw.setupUi(Dialog)
     if Dialog.exec_():
         spell_dict = asw.generate_spell_dict()
         self.db.add_spell_dict(spell_dict)
         self.reloadModel()
Ejemplo n.º 30
0
 def __init__(self, item):
     super(RecloserDialog, self).__init__()
     self.dialog = QtGui.QDialog(self)
     self.elementTitle = "Interrupção"
     self.item = item
     self.scene = self.item.scene()
     self.setupUi(self.dialog)
     self.dialog.exec_()