Beispiel #1
0
    def accept(self):
        players = self.playerSelections()
        self.team.team_name = self.teamNameEdit.text()
        self.team.email = unicode(self.emailEdit.text()).lower()

        if self.validTeam(players):
            playersOut = [player for player in self.team_players if player not in players]
            subs_made = len(playersOut)
            if subs_made > 0:
                if self.team.subs_used + subs_made > config.MAX_SUBS:
                    QMessageBox.critical(self, "Substitution Error",
                                         "This manager has insufficient substitutions remaining")
                    self.setCurrentPlayers()
                else:
                    playersIn = [player for player in players if player not in self.team_players]
                    form = confirmSubsDialog(playersOut, playersIn, self)
                    if form.exec_():
                        self.team.subs_used += subs_made
                        self.team.total_cost = self.total_cost
                        self.team.formation = self.formation
                        self.team.squad.substitute(playersIn, playersOut, form.datetime)
                        self.confirmSubs(playersIn, playersOut, form.datetime)
                        QDialog.accept(self)
                    else:
                        self.setCurrentPlayers()
            else:
                QDialog.accept(self)

        self.team.save()
    def __init__(self, data, doneExecution, parent=None):
        '''
        Constructor
        '''
        QDialog.__init__(self, parent)
        self._ui = Ui_Dialog()
        self._ui.setupUi(self)

        self._scene = self._ui.MayaviScene.visualisation.scene
        self._scene.background = self.backgroundColour

        self.data = data
        self.data.regCallback = self._regCallback
        self.doneExecution = doneExecution
        self._lockManualRegUpdate = False

        self.selectedObjectName = None

        self._worker = _ExecThread(self.data.register)
        self._worker.update.connect(self._regUpdate)
        self._worker.callback.connect(self._regCallback)

        # print 'init...', self._config

        ### FIX FROM HERE ###
        # create self._objects
        self._initViewerObjects()
        self._setupGui()
        self._makeConnections()
        self._initialiseObjectTable()
        self._updateConfigs()
        self._refresh()
Beispiel #3
0
    def __init__(self, updates, streetdb):
        QDialog.__init__(self)
        self.setupUi(self)
        table = self.tableWidget
        table.setRowCount(len(updates)+1)
        table.setColumnCount(len(common.ATT))
        self.setWindowTitle("Overview")

        for i in range(len(common.ATT)):
            item = QTableWidgetItem(common.ATT_HR[common.ATT[i]])
            table.setItem(0, i, item)
        for i, street in enumerate(updates):
            changes = updates[street]
            row = []
            for z in range(len(common.ATT)):
                found = False
                att = common.ATT[z]
                print(att)
                for change in changes:
                    split = change.split(":")
                    if split[0] == att:
                        row.append(split[1])
                        found = True
                if not found:
                    try:
                        row.append(streetdb[street][att])
                    except KeyError:
                        """print("Error building diagram in Street:", street, " Attribute: ", att) ## Missing field"""
            for x, update in enumerate(row):
                item = QTableWidgetItem(update)
                if "->" in update:
                    item.setForeground(Qt.red)
                print(i+1, x, update)
                table.setItem(i+1, x, item)
        self.load_settings()
Beispiel #4
0
    def __init__(self, low=True, parent=None):
        QDialog.__init__(self, parent)
        self.setupUi(self)

        def bind_slider(check, action):
            def inner(x):
                if check(x):
                    action(x)

            return inner

        bind1 = bind_slider(lambda x: self.slider_from.value() > x,
                            lambda x: self.slider_from.setValue(max(0, x - 1)))

        bind2 = bind_slider(lambda x: self.slider_to.value() < x,
                            lambda x: self.slider_to.setValue(min(100, x + 1)))

        self.slider_to.valueChanged.connect(bind1)
        self.slider_from.valueChanged.connect(bind2)

        self.slider_to.valueChanged.connect(self.update_mask)
        self.slider_from.valueChanged.connect(self.update_mask)
        self.check_inverse.stateChanged.connect(self.update_mask)

        self.buttonBox.rejected.connect(self._clear)
        self.buttonBox.accepted.connect(self._apply_mask)
Beispiel #5
0
 def __init__(self, low=True, parent=None):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.low = low
     self.horizontalSlider.valueChanged.connect(self.update_mask)
     self.buttonBox.rejected.connect(self._clear)
     self.buttonBox.accepted.connect(self._apply_mask)
Beispiel #6
0
 def __init__(self, parent=None):
     QDialog.__init__(self, parent)
     self._wasCanceled = False
     self._autoClose = True
     self._autoReset = True
     self._minimumDuration = 0
     self.canceled.connect(self.cancel)
Beispiel #7
0
 def __init__(self, parent=None):
     QDialog.__init__(self)
     self.parent = parent
     self.ui = AddRolesPop()
     self.ui.setupUi(self)
     self.check_and_add()
     self.ui.addroles_add_button.clicked.connect(self.add_roles)
Beispiel #8
0
    def __init__(self, *args, **kwargs):

        QDialog.__init__(self, *args, **kwargs)
        self.installEventFilter(self)
        self.setWindowTitle(Window.title)

        mainLayout = QVBoxLayout(self)

        wLabelDescription = QLabel("Select Object or Group")

        validator = QIntValidator()

        hLayout = QHBoxLayout()
        wLabel = QLabel("Num Controller : ")
        wLineEdit = QLineEdit()
        wLineEdit.setValidator(validator)
        wLineEdit.setText('5')
        hLayout.addWidget(wLabel)
        hLayout.addWidget(wLineEdit)

        button = QPushButton("Create")

        mainLayout.addWidget(wLabelDescription)
        mainLayout.addLayout(hLayout)
        mainLayout.addWidget(button)

        self.resize(Window.defaultWidth, Window.defaultHeight)

        self.wlineEdit = wLineEdit

        QtCore.QObject.connect(button, QtCore.SIGNAL("clicked()"),
                               self.cmd_create)
    def __init__(self, wdg_detector, key='', parent=None):
        QDialog.__init__(self, parent)
        self.setWindowTitle(wdg_detector.accessibleName())

        # Widgets
        self._txt_key = QLineEdit()
        self._txt_key.setValidator(QRegExpValidator(QRegExp(r"^(?!\s*$).+")))
        self._txt_key.setText(key)

        self._wdg_detector = wdg_detector

        buttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)

        # Layouts
        layout = QFormLayout()
        layout.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow) # Fix for Mac OS
        layout.addRow('Key', self._txt_key)
        layout.addRow(self._wdg_detector)
        layout.addRow(buttons)
        self.setLayout(layout)

        # Signals
        self._txt_key.textChanged.connect(self._onChanged)
        self._txt_key.textChanged.emit('')

        buttons.accepted.connect(self._onOk)
        buttons.rejected.connect(self.reject)
    def __init__(self, parent,silhouette,completeness,homogeneity,v_score,AMI,ARS):
        QDialog.__init__( self, parent )
        layout = QVBoxLayout()

        viewLayout = QFormLayout()
        viewLayout.addRow(QLabel('Silhouette score: '),QLabel(silhouette))
        viewLayout.addRow(QLabel('Completeness: '),QLabel(completeness))
        viewLayout.addRow(QLabel('Homogeneity: '),QLabel(homogeneity))
        viewLayout.addRow(QLabel('V score: '),QLabel(v_score))
        viewLayout.addRow(QLabel('Adjusted mutual information: '),QLabel(AMI))
        viewLayout.addRow(QLabel('Adjusted Rand score: '),QLabel(ARS))

        viewWidget = QGroupBox()
        viewWidget.setLayout(viewLayout)

        layout.addWidget(viewWidget)

        #Accept cancel
        self.acceptButton = QPushButton('Ok')
        self.cancelButton = QPushButton('Cancel')

        self.acceptButton.clicked.connect(self.accept)
        self.cancelButton.clicked.connect(self.reject)

        hbox = QHBoxLayout()
        hbox.addWidget(self.acceptButton)
        hbox.addWidget(self.cancelButton)
        ac = QWidget()
        ac.setLayout(hbox)
        layout.addWidget(ac)
        self.setLayout(layout)
    def __init__(self, data, GFUnfitted, config, fitFunc, resetCallback, distModes, landmarks=None, parent=None):
        '''
        Constructor
        '''
        QDialog.__init__(self, parent)
        self._ui = Ui_Dialog()
        self._ui.setupUi(self)

        self._scene = self._ui.MayaviScene.visualisation.scene
        self._scene.background = self.backgroundColour

        self.selectedObjectName = None
        self._data = data
        self._GFUnfitted = GFUnfitted
        self._GFFitted = copy.deepcopy(self._GFUnfitted)
        self._fitFunc = fitFunc
        self._config = config
        self._resetCallback = resetCallback
        self._distModes = distModes
        self._landmarks = landmarks
        if self._landmarks is not None:
            self._landmarkNames = sorted(self._landmarks.keys())
            print(self._landmarkNames)
        else:
            self._landmarkNames = []

        self._worker = _ExecThread(self._fitFunc)
        self._worker.update.connect(self._fitUpdate)

        self._initViewerObjects()
        self._setupGui()
        self._initialiseSettings()
        self._makeConnections()
        self._initialiseObjectTable()
        self._refresh()
Beispiel #12
0
    def __init__(self):
        QDialog.__init__(self)

        ui.load_ui(self, 'about.ui')
        win_remove_context_help(self)

        self._version.setText('v' + '.'.join([str(x) for x in VERSION]))
    def __init__(self, landmarks, config, predictFunc, predMethods, popClasses, parent=None):
        QDialog.__init__(self, parent)
        self._ui = Ui_Dialog()
        self._ui.setupUi(self)

        self._scene = self._ui.MayaviScene.visualisation.scene
        self._scene.background = self.backgroundColour

        self.selectedObjectName = None
        self._landmarks = landmarks
        self._landmarkNames = sorted(self._landmarks.keys())
        self._predictFunc = predictFunc
        self._predMethods = predMethods
        self._popClasses = popClasses
        self._config = config

        # print 'init...', self._config

        ### FIX FROM HERE ###
        # create self._objects
        self._initViewerObjects()
        self._setupGui()
        self._makeConnections()
        self._initialiseObjectTable()
        self._initialiseSettings()
        self._refresh()

        # self.testPlot()
        # self.drawObjects()
        print('finished init...', self._config)
Beispiel #14
0
 def __init__(self, low=True, parent=None):
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.low = low
     self.horizontalSlider.valueChanged.connect(self.update_mask)
     self.buttonBox.rejected.connect(self._clear)
     self.buttonBox.accepted.connect(self._apply_mask)
Beispiel #15
0
    def accept(self, *args, **kwargs):
        #Validate the input, returning if invalid.

        #The configuration name cannot be empty or only whitespace.
        configuration_name = self.txtName.text().strip()
        if not configuration_name:
            QMessageBox.critical(self, "Missing Name", "You must give this server configuration a name.")
            self.txtName.selectAll()
            self.txtName.setFocus()
            return

        #We check to see if the user entered a valid server configuration.
        if self.ServerTypeTabs.currentWidget() is self.LocalServerTab:
            if not self.validateLocalServerPath():
                QMessageBox.critical(self, "Invalid Path", "The path you entered does not point to a valid Sage installation.")
                self.txtPath.selectAll()
                self.txtPath.setFocus()
                return
        elif self.ServerTypeTabs.currentWidget() is self.NotebookServerTab:
            if not self.validateNotebookServer():
                QMessageBox.critical(self, "Invalid Notebook Server", "The Sage Notebook Server settings you provided are not valid.")
                return


        #Input is valid, so accept.
        QDialog.accept(self)
Beispiel #16
0
    def __init__(self, low=True, parent=None):
        QDialog.__init__(self, parent)
        self.setupUi(self)


        def bind_slider(check, action):
            def inner(x):
                if check(x):
                    action(x)
            return inner


        bind1 = bind_slider(lambda x: self.slider_from.value() > x,
                            lambda x: self.slider_from.setValue(max(0, x-1)))

        bind2 = bind_slider(lambda x: self.slider_to.value() < x,
                            lambda x: self.slider_to.setValue(min(100, x+1)))
        
        self.slider_to.valueChanged.connect(bind1)
        self.slider_from.valueChanged.connect(bind2)

        self.slider_to.valueChanged.connect(self.update_mask)
        self.slider_from.valueChanged.connect(self.update_mask)
        self.check_inverse.stateChanged.connect(self.update_mask)

        self.buttonBox.rejected.connect(self._clear)
        self.buttonBox.accepted.connect(self._apply_mask)
Beispiel #17
0
    def __init__(self, list_options, parent=None):
        QDialog.__init__(self, parent)

        # Variables
        model = _AvailableOptionsListModel()
        for options in list_options:
            model.addOptions(options)

        # Widgets
        lbltext = QLabel('Select the options to import')

        self._combobox = QComboBox()
        self._combobox.setModel(model)

        buttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)

        # Layouts
        layout = QVBoxLayout()
        layout.addWidget(lbltext)
        layout.addWidget(self._combobox)
        layout.addWidget(buttons)
        self.setLayout(layout)

        # Signals
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)
Beispiel #18
0
    def __init__(self, app, hub, html, debug=False):
        QDialog.__init__(self)
        self.app = app
        self.hub = hub
        self.html = addpool.html
        self.debug = debug
        self.url = "file:///" \
            + os.path.join(self.app.property("ResPath"), "www/", html).replace('\\', '/')

        self.is_first_load = True
        self.view = web_core.QWebView(self)

        if not self.debug:
            self.view.setContextMenuPolicy(qt_core.Qt.NoContextMenu)

        self.view.setCursor(qt_core.Qt.ArrowCursor)
        self.view.setZoomFactor(1)

        self.setWindowTitle("Add/Edit Pool :: %s" % APP_NAME)
        self.icon = self._getQIcon('ombre_64x64.png')
        self.setWindowIcon(self.icon)

        layout = QGridLayout()
        layout.addWidget(self.view)
        self.setLayout(layout)

        self.setFixedSize(qt_core.QSize(660, 480))
        self.center()

        self.view.loadFinished.connect(self._load_finished)
        #         self.view.load(qt_core.QUrl(self.url))
        self.view.setHtml(self.html, qt_core.QUrl(self.url))
    def __init__(self, step, parent=None):
        '''
        Constructor
        '''
        QDialog.__init__(self, parent)
        self._ui = Ui_Dialog()
        self._ui.setupUi(self)

        self._scene = self._ui.MayaviScene.visualisation.scene
        self._scene.background = self.backgroundColour

        self.selectedObjectName = None
        self._step = step

        self._worker = _ExecThread(self._step._segment)
        self._worker.update.connect(self._segUpdate)

        self._initViewerObjects()
        self._setupGui()
        self._initialiseSettings()
        self._makeConnections()
        self._initialiseObjectTable()
        self._refresh()

        self._previousProfileModelFile = ''
    def __init__(self, data, GFUnfitted, config, fitFunc, resetCallback, parent=None):
        '''
        Constructor
        '''
        QDialog.__init__(self, parent)
        self._ui = Ui_Dialog()
        self._ui.setupUi(self)

        self._scene = self._ui.MayaviScene.visualisation.scene
        self._scene.background = self.backgroundColour

        self.selectedObjectName = None
        self._data = data
        self._GFUnfitted = GFUnfitted
        self._GFFitted = copy.deepcopy(self._GFUnfitted)
        self._fitFunc = fitFunc
        self._config = config
        self._resetCallback = resetCallback
        
        self._worker = _ExecThread(self._fitFunc)
        self._worker.finalUpdate.connect(self._fitUpdate)
        self._worker.update.connect(self._fitCallback)

        # create self._objects
        self._objects = MayaviViewerObjectsContainer()
        self._objects.addObject('data', MayaviViewerDataPoints('data', self._data, renderArgs=self._dataRenderArgs))
        self._objects.addObject('GF Unfitted', MayaviViewerFieldworkModel('GF Unfitted', self._GFUnfitted, self._GFD, renderArgs=self._GFUnfittedRenderArgs))
        self._objects.addObject('GF Fitted', MayaviViewerFieldworkModel('GF Fitted', self._GFFitted, self._GFD, renderArgs=self._GFFittedRenderArgs))

        self._makeConnections()
        self._initialiseObjectTable()
        self._initialiseSettings()
        self._refresh()
Beispiel #21
0
    def bake(self):
        
        self.bakeWidget = QDialog( self )
        
        def doCommand():
            ctlsGroup = []
            for widget in self.mainWindow.w_ctlListGroup.getChildrenWidgets():
                ctls = widget.items
                allExists=True
                for ctl in ctls:
                    if not pymel.core.objExists( ctl ): 
                        allExists=False
                        break
                if not allExists: continue
                ctlsGroup.append( ctls )
            mainCtl = self.mainWindow.w_mainCtl.lineEdit.text()
            minFrame = int( self.bakeWidget.le_minFrame.text() )
            maxFrame = int( self.bakeWidget.le_maxFrame.text() )
            BaseCommands.bake( mainCtl, ctlsGroup, minFrame, maxFrame )

        
        def closeCommand():
            self.bakeWidget.close()


        validator = QIntValidator( self )
        
        minFrame = pymel.core.playbackOptions( q=1, min=0 )
        maxFrame = pymel.core.playbackOptions( q=1, max=1 )
        
        mainLayout = QVBoxLayout( self.bakeWidget )
        
        timeRangeLayout = QHBoxLayout()
        l_minFrame = QLabel( "Min Frame : " )
        le_minFrame = QLineEdit(); le_minFrame.setValidator( validator )
        l_maxFrame = QLabel( "Max Frame : " )
        le_maxFrame = QLineEdit(); le_maxFrame.setValidator( validator )
        timeRangeLayout.addWidget( l_minFrame )
        timeRangeLayout.addWidget( le_minFrame )
        timeRangeLayout.addWidget( l_maxFrame )
        timeRangeLayout.addWidget( le_maxFrame )
        
        le_minFrame.setText( str( int(minFrame) ) )
        le_maxFrame.setText( str( int(maxFrame) ) )
        
        buttonsLayout = QHBoxLayout()
        b_bake = QPushButton( "Bake" )
        b_close = QPushButton( "Close" )
        buttonsLayout.addWidget( b_bake )
        buttonsLayout.addWidget( b_close )
        
        mainLayout.addLayout( timeRangeLayout )
        mainLayout.addLayout( buttonsLayout )
        
        QtCore.QObject.connect( b_bake,  QtCore.SIGNAL( "clicked()" ), doCommand )
        QtCore.QObject.connect( b_close, QtCore.SIGNAL( "clicked()" ), closeCommand )
        self.bakeWidget.show()

        self.bakeWidget.le_minFrame = le_minFrame
        self.bakeWidget.le_maxFrame = le_maxFrame
Beispiel #22
0
    def __init__(self, ignored_plugins, do_not_show_errors, resource_files, updater_settings, parent=None):
        QDialog.__init__(self, parent)
        self._ui = Ui_AdvancedDialog()
        self._ui.setupUi(self)
        self._makeConnections()
        self._recommendedPlugins = 0  # need to implement
        self._installedPlugins = 0  # need to implement
        self.fillInstalledPackagesList()
        self._setupToolTips()
        self._pluginUpdater = PluginUpdater()
        self._plugins_to_update = {}
        self._ui.updateAllButton.setEnabled(False)
        self._ui.updateButton.setEnabled(False)
        self._ui.label_2.setText('Please analyse your plugins to check for updates.')

        self._updaterSettings = updater_settings
        self.setUpdaterSettings()

        self._resourceFiles = resource_files
        self.fillResourcesList()
        self.resourceFilenameLineEdit()

        self._ignoredPlugins = ignored_plugins
        self.fillIgnoreList()

        self._doNotShowErrors = do_not_show_errors
        self.setErrorsCheckBox()

        self._2to3Directory = self._pluginUpdater.locate2to3Script()
        if self._2to3Directory:
            self._ui.dir2to3.setText(self._2to3Directory)

        # will need ot modify
        if self._ui.virtEnvLocation.text() == 'a':
            self._ui.modifyVELocation.setText('Setup')
Beispiel #23
0
    def accept(self):
        """Accept event."""

        while str(self.ui.lineEditPath.text()) == '':
            self.searchPath()

        self.preferences['title'] = self.ui.lineEditTitle.text()
        self.preferences['author'] = str(self.ui.lineEditAuthor.text())
        self.preferences['description'] = str(
            self.ui.textEditDescription.toPlainText())

        self.preferences['pdf'] = {}
        self.preferences['pdf']['path'] = str(self.ui.lineEditPath.text())
        self.preferences['pdf'][
            'auto_open'] = self.ui.checkBoxAutoOpen.isChecked()

        self.preferences['pdf']['mode'] = self.ui.comboBoxMode.currentText()

        self.preferences['pdf'][
            'margin_left'] = self.ui.doubleSpinBoxLeft.value()
        self.preferences['pdf'][
            'margin_right'] = self.ui.doubleSpinBoxRight.value()
        self.preferences['pdf']['margin_top'] = self.ui.doubleSpinBoxTop.value(
        )
        self.preferences['pdf'][
            'margin_bottom'] = self.ui.doubleSpinBoxBottom.value()

        self.preferences['pdf']['font'] = self.ui.comboBoxFont.currentText()
        self.preferences['pdf']['size'] = self.ui.spinBoxSize.value()

        QDialog.accept(self)
Beispiel #24
0
    def __init__(self, app, *args, **kwargs):
        QDialog.__init__(self, *args, **kwargs)
        self.app = app
        self.closed = False
        self.sort_order = None
        self.ui = Ui_List()
        self.ui.setupUi(self)
        self.setWindowIcon(get_icon())

        self.notebooksModel = QStandardItemModel()
        self.ui.notebooksList.setModel(self.notebooksModel)
        self.ui.notebooksList.selection.connect(self.selection_changed)
        self.ui.notebooksList.setContextMenuPolicy(Qt.CustomContextMenu)
        self.ui.notebooksList.customContextMenuRequested.connect(self.notebook_context_menu)

        self.notesModel = QStandardItemModel()
        self.notesModel.setHorizontalHeaderLabels(
            [self.tr('Title'), self.tr('Last Updated')])

        self.ui.notesList.setModel(self.notesModel)
        self.ui.notesList.doubleClicked.connect(self.note_dblclicked)
        self.ui.notesList.setContextMenuPolicy(Qt.CustomContextMenu)
        self.ui.notesList.customContextMenuRequested.connect(self.note_context_menu)
        self.ui.notesList.header().sortIndicatorChanged.connect(self.sort_order_updated)

        self.ui.newNotebookBtn.setIcon(QIcon.fromTheme('folder-new'))
        self.ui.newNotebookBtn.clicked.connect(self.new_notebook)

        self.ui.newNoteBtn.setIcon(QIcon.fromTheme('document-new'))
        self.ui.newNoteBtn.clicked.connect(self.new_note)

        self.ui.newNoteBtn.setShortcut(QKeySequence(self.tr('Ctrl+n')))
        self.ui.newNotebookBtn.setShortcut(QKeySequence(self.tr('Ctrl+Shift+n')))
        QShortcut(QKeySequence(self.tr('Ctrl+q')), self, self.close)
Beispiel #25
0
 def closeEvent(self, event):
     """ Handles the user requesting the window to close.
     """
     # If the 'Handler' allowed the window to close, then pass the request
     # along to the standard Qt event handler, which will close the window:
     if getattr(self, "_closed", False):
         QDialog.closeEvent(self, event)
    def __init__(self, fig):
        QDialog.__init__(self)
        self.fig = fig
        main_layout = QVBoxLayout()
        self.setLayout(main_layout)
        top_widget = QWidget()
        bottom_widget = QWidget()
        main_layout.addWidget(top_widget)
        main_layout.addWidget(bottom_widget)
        top_layout = QHBoxLayout()
        bottom_layout = QHBoxLayout()
        top_widget.setLayout(top_layout)
        bottom_widget.setLayout(bottom_layout)

        self.atext = qHotField("annotation", unicode, "the_text")
        top_layout.addWidget(self.atext)
        self.segment_number = qHotField("Segment", int, 1)
        top_layout.addWidget(self.segment_number)
        qmy_button(top_layout, self.annotate_it, "annotate")
        self.over = qHotField("over", int, -70)
        bottom_layout.addWidget(self.over)
        self.up = qHotField('up', int, 30)
        bottom_layout.addWidget(self.up)
        qmy_button(bottom_layout, self.remove_annotations, "remove all")
        qmy_button(bottom_layout, self.remove_last_annotation, "remove last")
        self.annotations = []
Beispiel #27
0
    def __init__(self, parent, header, device_settings, firmware_settings,
                 error_codes, *args):
        QDialog.__init__(self, parent, *args)
        self.setGeometry(300, 200, 570, 450)
        self.setWindowTitle("Device information")
        table_model = DeviceInformationTable(self, header, device_settings)
        dev_settings_table = QTableView()
        dev_settings_table.setModel(table_model)

        table_model = DeviceInformationTable(self, header, firmware_settings)
        fw_settings_table = QTableView()
        fw_settings_table.setModel(table_model)

        table_model = DeviceInformationTable(self, header, error_codes)
        error_code_table = QTableView()
        error_code_table.setModel(table_model)

        # set font
        # font = QFont("monospace", 10)
        font = QFont("", 10)
        dev_settings_table.setFont(font)
        fw_settings_table.setFont(font)
        # set column width to fit contents (set font first!)
        dev_settings_table.resizeColumnsToContents()
        fw_settings_table.resizeColumnsToContents()
        error_code_table.resizeColumnsToContents()

        tab_view = QTabWidget()
        tab_view.addTab(dev_settings_table, "User settings")
        tab_view.addTab(fw_settings_table, "Firmware settings")
        tab_view.addTab(error_code_table, "Error Codes")

        layout = QVBoxLayout(self)
        layout.addWidget(tab_view)
        self.setLayout(layout)
 def __init__(self, parent=None):
     '''
     Constructor
     '''
     QDialog.__init__(self, parent)
     self._ui = Ui_CreditsDialog()
     self._ui.setupUi(self)
     
     creditsTab = QTabWidget()
     creditSections = info.CREDITS.keys()
     for creditSection in creditSections:
         creditTab = QWidget()
         creditsTab.addTab(creditTab, creditSection)
         vbox = QVBoxLayout(creditTab)
         creditList = ""
         for person in info.CREDITS[creditSection]:
             creditList += ("\n%s [%s]" % (person['name'], person['email']))
         creditLabel = QLabel()
         creditLabel.setStyleSheet("QLabel { background-color : white}")
         creditLabel.setText(creditList)
         creditLabel.setAlignment(Qt.AlignTop | Qt.AlignLeft)
         vbox.addWidget(creditLabel)
     
     vbox = QVBoxLayout()
     vbox.setContentsMargins(0, 0, 0, 0)
     vbox.addWidget(creditsTab)
     self._ui.frame_CreditsTab.setLayout(vbox)
Beispiel #29
0
 def __init__(self):
     '''
     Constructor
     '''
     
     QDialog.__init__(self)
     self._initGUI()
    def __init__(self, landmarks, config, predictFunc, predMethods, popClasses, parent=None):
        '''
        Constructor
        '''
        QDialog.__init__(self, parent)
        self._ui = Ui_Dialog()
        self._ui.setupUi(self)

        self._scene = self._ui.MayaviScene.visualisation.scene
        self._scene.background = self.backgroundColour

        self.selectedObjectName = None
        self._landmarks = landmarks
        self._landmarkNames = sorted(self._landmarks.keys())
        self._predictFunc = predictFunc
        self._predMethods = predMethods
        self._popClasses = popClasses
        self._config = config

        # print 'init...', self._config

        ### FIX FROM HERE ###
        # create self._objects
        self._initViewerObjects()
        self._setupGui()
        self._makeConnections()
        self._initialiseObjectTable()
        self._initialiseSettings()
        self._refresh()

        # self.testPlot()
        # self.drawObjects()
        print 'finished init...', self._config
    def __init__(self,
                 sourceData,
                 targetData,
                 config,
                 registerFunc,
                 regMethods,
                 manualTransformFunc,
                 parent=None):
        '''
        Constructor
        '''
        QDialog.__init__(self, parent)
        self._ui = Ui_Dialog()
        self._ui.setupUi(self)

        self._scene = self._ui.MayaviScene.visualisation.scene
        self._scene.background = self.backgroundColour

        self.selectedObjectName = None
        self._sourceData = sourceData
        self._targetData = targetData
        self._sourceDataAligned = None
        self._registerFunc = registerFunc
        self._regMethods = regMethods
        self._manualTransform = manualTransformFunc
        self._config = config
        self._enableManualUpdate = True

        self._worker = _ExecThread(self._registerFunc)
        self._worker.update.connect(self._regUpdate)

        # print 'init...', self._config

        # create self._objects
        self._objects = MayaviViewerObjectsContainer()
        self._objects.addObject(
            'source',
            MayaviViewerDataPoints('source',
                                   self._sourceData,
                                   renderArgs=self._sourceRenderArgs))
        self._objects.addObject(
            'target',
            MayaviViewerDataPoints('target',
                                   self._targetData,
                                   renderArgs=self._targetRenderArgs))
        self._objects.addObject(
            'registered',
            MayaviViewerDataPoints('registered',
                                   self._sourceData,
                                   renderArgs=self._registeredRenderArgs))

        self._setupGui()
        self._makeConnections()
        self._initialiseObjectTable()
        self._initialiseSettings()
        self._refresh()

        # self.testPlot()
        # self.drawObjects()
        print('finished init...', self._config)
Beispiel #32
0
    def __init__(self):
        '''
        Constructor
        '''

        QDialog.__init__(self)
        self._initGUI()
Beispiel #33
0
 def accept(self):
     settings = QSettings()
     settings.setValue("DB/File", self.file.text())
     settings.setValue("SMTP/Server", self.smtp_server.text())
     settings.setValue("HTTP Proxy/IP", self.http_proxy_ip.text())
     settings.setValue("HTTP Proxy/Enabled", bool(self.http_proxy.isChecked()) and bool(self.http_proxy_ip.text()))
     QDialog.accept(self)
Beispiel #34
0
 def __init__(self, parent=None):
     """
     Constructor
     """
     QDialog.__init__(self, parent)
     self._ui = Ui_LicenseDialog()
     self._ui.setupUi(self)
Beispiel #35
0
 def __init__(self, dept_id, mainWindow):
     QDialog.__init__(self)
     self.mainWindow = mainWindow
     self.dept_id = dept_id
     self.db = DbHandler('norm.db')
     self.db.open()
     self.hardware_list = self.db.getHardware()
 def accept(self):
     # Override accept so we can first validate
     if self.is_valid():
         category_name = self.addEditCatLineEdit.text().strip()
         try:
             with session_scope() as session:
                 if self.edit_cat_id is not None:
                     category = session.query(Category).get(
                         int(self.edit_cat_id))
                     category.category_name = category_name
                     logger.debug('Edited cat with id %s' %
                                  self.edit_cat_id)
                 else:
                     category = Category(category_name=category_name)
                     session.add(category)
                     logger.debug('Added cat with name %s' % category_name)
         except exc.IntegrityError as int_exc:
             logger.debug(int_exc)
             QMessageBox.warning(self, "Already exists warning",
                                 unicode('This category already exists'))
             self.addEditCatLineEdit.setFocus()
             self.selectAll()
             return
         except Exception as uexc:
             logger.error(str(uexc))
             QMessageBox.warning(self, "Unexpected Error",
                                 unicode('Could not edit category.'))
             return
         else:
             # All good, accept after triggering tree refresh with sig
             self.categories_changed.emit()
             QDialog.accept(self)
Beispiel #37
0
    def __init__(self, app, *args, **kwargs):
        QDialog.__init__(self, *args, **kwargs)
        self.app = app
        self.closed = False
        self.sort_order = None
        self.ui = Ui_List()
        self.ui.setupUi(self)
        self.setWindowIcon(get_icon())

        self.notebooksModel = QStandardItemModel()
        self.ui.notebooksList.setModel(self.notebooksModel)
        self.ui.notebooksList.selection.connect(self.selection_changed)
        self.ui.notebooksList.setContextMenuPolicy(Qt.CustomContextMenu)
        self.ui.notebooksList.customContextMenuRequested.connect(
            self.notebook_context_menu)

        self.notesModel = QStandardItemModel()
        self.notesModel.setHorizontalHeaderLabels(
            [self.tr('Title'), self.tr('Last Updated')])

        self.ui.notesList.setModel(self.notesModel)
        self.ui.notesList.doubleClicked.connect(self.note_dblclicked)
        self.ui.notesList.setContextMenuPolicy(Qt.CustomContextMenu)
        self.ui.notesList.customContextMenuRequested.connect(
            self.note_context_menu)
        self.ui.notesList.header().sortIndicatorChanged.connect(
            self.sort_order_updated)

        self.ui.newNotebookBtn.setIcon(QIcon.fromTheme('folder-new'))
        self.ui.newNotebookBtn.clicked.connect(self.new_notebook)

        self.ui.newNoteBtn.setIcon(QIcon.fromTheme('document-new'))
        self.ui.newNoteBtn.clicked.connect(self.new_note)
Beispiel #38
0
 def __init__(self, app, *args, **kwargs):
     QDialog.__init__(self, *args, **kwargs)
     self.app = app
     self.closed = False
     self.startup_path = os.path.expanduser('~/.config/autostart/')
     self.startup_file = os.path.join(self.startup_path, 'everpad.desktop')
     self.ui = Ui_Dialog()
     self.ui.setupUi(self)
     self.ui.webView.hide()
     self.setWindowIcon(get_icon())
     for delay in (5, 10, 15, 30):
         self.ui.syncDelayBox.addItem(self.tr('%d minutes') % delay,
             userData=str(delay * 60 * 1000),
         )
     self.ui.syncDelayBox.addItem(self.tr('One hour'), userData='3600000')
     self.ui.syncDelayBox.addItem(self.tr('Manual'), userData='-1')
     active_index = self.ui.syncDelayBox.findData(str(
         self.app.provider.get_sync_delay(),
     ))
     self.ui.syncDelayBox.setCurrentIndex(active_index)
     self.ui.syncDelayBox.currentIndexChanged.connect(self.delay_changed)
     self.ui.tabWidget.currentChanged.connect(self.update_tabs)
     self.ui.authBtn.clicked.connect(self.change_auth)
     self.ui.autoStart.stateChanged.connect(self.auto_start_state)
     self.ui.noteFont.currentFontChanged.connect(self.font_changed)
     self.ui.noteSize.valueChanged.connect(self.font_size_changed)
     self.ui.blackTray.stateChanged.connect(self.tray_changed)
     self.update_tabs()
Beispiel #39
0
 def __init__(self, parent=None):
     QDialog.__init__(self)
     self.parent = parent
     self.ui = AssignUserPop()
     self.ui.setupUi(self)
     self.ui.adduser_add_button.clicked.connect(self.add_user)
     self.fill_users()
Beispiel #40
0
    def __init__(self, state, parent=None):
        QDialog.__init__(self, parent)
        self._ui = Ui_ConfigureDialog()
        self._ui.setupUi(self)

        self.setState(state)
        self.validate()
        self._makeConnections()
Beispiel #41
0
    def __init__(self):
        '''
        Constructor
        '''
        QDialog.__init__(self)

        self._initGUI()
        self.athleteProfile = False
Beispiel #42
0
 def __init__(self, parent=None):
     QDialog.__init__(self, parent)
     self._ui = Ui_AboutDialog()
     self._ui.setupUi(self)
     text = self._ui.aboutTextLabel.text()
     self._ui.aboutTextLabel.setText(
         text.replace('##version##', info.VERSION_STRING))
     self._makeConnections()
Beispiel #43
0
    def __init__(self, device=None, simulator=None):
        QDialog.__init__(self)
        self.ui = Ui()
        self.ui.setupUi(self)

        self.device = device
        self.simulator = simulator
        self.demo = None
Beispiel #44
0
 def __init__(self):
     '''
     Constructor
     '''
     QDialog.__init__(self)
     
     self._initGUI()
     self.athleteProfile = False
Beispiel #45
0
 def __init__(self, parent=None):
     QDialog.__init__(self)
     self.parent = parent
     self.ui = NewGroupPop()
     self.ui.setupUi(self)
     self.ui.newgroup_create_button.clicked.connect(self.create_group)
     self.ui.newgroup_name_linedit.textChanged.connect(
         lambda: auto_capital(linedit=self.ui.newgroup_name_linedit))
Beispiel #46
0
 def __init__(self, parent=None):
     QDialog.__init__(self)
     self.parent = parent
     self.ui = NewUserPop()
     self.ui.setupUi(self)
     self.ui.newuser_save_button.clicked.connect(self.save_user)
     self.ui.newuser_name_linedit.textChanged.connect(
         lambda: auto_capital(linedit=self.ui.newuser_name_linedit))
Beispiel #47
0
 def __init__(self, depts):
     QDialog.__init__(self)
     self.depts = depts
     self.removedDepts = []
     self.db = DbHandler('norm.db')
     self.db.open()
     self.depts = self.db.getDepts()
     self.nextId = self.db.nextDeptId()
Beispiel #48
0
 def __init__(self):
     logger.info('Inside CategoryAddDialogue')
     QDialog.__init__(self)
     self.category = Ui_new_category()
     self.category.setupUi(self)
     self.newcategory = CategoryOfProduct()
     self.category.categorydialogue_newcategory_linedit.textChanged.connect(
         lambda: self.auto_capital(self.category.categorydialogue_newcategory_linedit))
     self.category.categorydialogue_addcategory_button.clicked.connect(self.add_category)
 def __init__(self, parent=None):
     '''
     Constructor
     '''
     QDialog.__init__(self, parent)
     self._ui = Ui_ConfigureDialog()
     self._ui.setupUi(self)
     
     self._makeConnections()
Beispiel #50
0
 def __init__(self, parent, rows=None, cells=None, *args, **kwargs):
     QDialog.__init__(self, parent, *args, **kwargs)
     self.ui = Ui_TableInsertDialog()
     self.ui.setupUi(self)
     self.setWindowIcon(get_icon())
     if rows:  # typecasting sucks
         self.ui.rows.setText(str(int(rows)))
     if cells:
         self.ui.columns.setText(str(int(cells)))
Beispiel #51
0
 def __init__(self, parent, rows=None, cells=None, *args, **kwargs):
     QDialog.__init__(self, parent, *args, **kwargs)
     self.ui = Ui_TableInsertDialog()
     self.ui.setupUi(self)
     self.setWindowIcon(get_icon())
     if rows:  # typecasting sucks
         self.ui.rows.setText(str(int(rows)))
     if cells:
         self.ui.columns.setText(str(int(cells)))
Beispiel #52
0
 def __init__(self, parent=None):
     '''
     Constructor
     '''
     QDialog.__init__(self, parent)
     self.ui = Ui_AtomSizeDialog()
     self.ui.setupUi(self)
     self.old_dial_value = self.ui.dial.value()
     self._value = self.ui.doubleSpinBox.value()
    def __init__(self, state, parent=None):
        QDialog.__init__(self, parent)
        self._ui = Ui_ConfigureDialog()
        self._ui.setupUi(self)
        self._ui.identifierLineEdit.setStyleSheet(REQUIRED_STYLE_SHEET)

        self.setState(state)
        self.validate()
        self._makeConnections()
Beispiel #54
0
  def __init__(self, parent, appargs):
    QDialog.__init__(self, parent)
    self.setupUi(self)
    self._app = esky.Esky(sys.executable,
        "http://10.78.55.218/pyrite/downloads")
    self._appargs = appargs

    self.connectActions()
    self.updateView()
Beispiel #55
0
 def __init__(self, athlete):
     '''
     Constructor
     '''
     QDialog.__init__(self)
     
     self.setWindowTitle("Pushup form")
     self.athlete = athlete
     self.pushupForm = QFormLayout()
     self.createGUI()
Beispiel #56
0
 def __init__(self, athletesList):
     '''
     Constructor
     '''  
     QDialog.__init__(self)
     self.setWindowTitle("Profile Selection")
     
     self.athletesList = athletesList
         
     self._initGUI()      
 def __init__(self, parent=None):
     '''
     Constructor
     '''
     QDialog.__init__(self, parent)
     self._ui = Ui_AboutDialog()
     self._ui.setupUi(self)
     text = self._ui.aboutTextLabel.text()
     self._ui.aboutTextLabel.setText(text.replace('##version##', info.VERSION_STRING))
     self._makeConnections()
Beispiel #58
-1
    def __init__(self, *args, **kwargs ):
        
        QDialog.__init__( self, *args, **kwargs )
        self.installEventFilter( self )
        self.setWindowTitle( Window.title )
    
        mainLayout = QVBoxLayout( self )
        
        wLabelDescription = QLabel( "Select Object or Group" )
        
        validator = QIntValidator()
        
        hLayout = QHBoxLayout()
        wLabel = QLabel( "Num Controller : " )
        wLineEdit= QLineEdit();wLineEdit.setValidator(validator); wLineEdit.setText( '5' )
        hLayout.addWidget( wLabel )
        hLayout.addWidget( wLineEdit )
        
        button = QPushButton( "Create" )
        
        mainLayout.addWidget( wLabelDescription )
        mainLayout.addLayout( hLayout )
        mainLayout.addWidget( button )

        self.resize(Window.defaultWidth,Window.defaultHeight)
        
        self.wlineEdit = wLineEdit
        
        QtCore.QObject.connect( button, QtCore.SIGNAL( "clicked()" ), self.cmd_create )