Пример #1
0
    def __init__(self, parent):
        super(ProjectData, self).__init__()
        self._parent = parent
        grid = QGridLayout(self)
        grid.addWidget(QLabel(translations.TR_PROJECT_NAME), 0, 0)
        self.name = QLineEdit()
        if not len(self._parent.project.name):
            self.name.setText(file_manager.get_basename(
                self._parent.project.path))
        else:
            self.name.setText(self._parent.project.name)
        grid.addWidget(self.name, 0, 1)
        grid.addWidget(QLabel(translations.TR_PROJECT_LOCATION), 1, 0)
        self.txtPath = QLineEdit()
        self.txtPath.setReadOnly(True)
        self.txtPath.setText(self._parent.project.path)
        grid.addWidget(self.txtPath, 1, 1)
        grid.addWidget(QLabel(translations.TR_PROJECT_TYPE), 2, 0)
        self.txtType = QLineEdit()
        completer = QCompleter(sorted(settings.PROJECT_TYPES))
        completer.setCompletionMode(QCompleter.UnfilteredPopupCompletion)
        self.txtType.setCompleter(completer)
        self.txtType.setPlaceholderText("python")
        self.txtType.setText(self._parent.project.project_type)
        grid.addWidget(self.txtType, 2, 1)
        grid.addWidget(QLabel(translations.TR_PROJECT_DESCRIPTION), 3, 0)
        self.description = QPlainTextEdit()
        self.description.setPlainText(self._parent.project.description)
        grid.addWidget(self.description, 3, 1)
        grid.addWidget(QLabel(translations.TR_PROJECT_URL), 4, 0)
        self.url = QLineEdit()
        self.url.setText(self._parent.project.url)
        self.url.setPlaceholderText('https://www.{}.com'.format(getuser()))
        grid.addWidget(self.url, 4, 1)
        grid.addWidget(QLabel(translations.TR_PROJECT_LICENSE), 5, 0)
        self.cboLicense = QComboBox()
        self.cboLicense.addItems(LICENCES)
        self.cboLicense.setCurrentIndex(12)
        index = self.cboLicense.findText(self._parent.project.license)
        self.cboLicense.setCurrentIndex(index)
        grid.addWidget(self.cboLicense, 5, 1)

        self.txtExtensions = QLineEdit()
        self.txtExtensions.setText(', '.join(self._parent.project.extensions))
        grid.addWidget(QLabel(translations.TR_PROJECT_EXTENSIONS), 6, 0)
        grid.addWidget(self.txtExtensions, 6, 1)

        grid.addWidget(QLabel(translations.TR_PROJECT_INDENTATION), 7, 0)
        self.spinIndentation = QSpinBox()
        self.spinIndentation.setValue(self._parent.project.indentation)
        self.spinIndentation.setRange(2, 10)
        self.spinIndentation.setValue(4)
        self.spinIndentation.setSingleStep(2)
        grid.addWidget(self.spinIndentation, 7, 1)
        self.checkUseTabs = QComboBox()
        self.checkUseTabs.addItems([
            translations.TR_PREFERENCES_EDITOR_CONFIG_SPACES.capitalize(),
            translations.TR_PREFERENCES_EDITOR_CONFIG_TABS.capitalize()])
        self.checkUseTabs.setCurrentIndex(int(self._parent.project.use_tabs))
        grid.addWidget(self.checkUseTabs, 7, 2)
Пример #2
0
 def _setupUi(self):
     self.setWindowTitle(tr("Error Report"))
     self.resize(553, 349)
     self.verticalLayout = QVBoxLayout(self)
     self.label = QLabel(self)
     self.label.setText(
         tr("Something went wrong. Would you like to send the error report to Hardcoded Software?"
            ))
     self.label.setWordWrap(True)
     self.verticalLayout.addWidget(self.label)
     self.errorTextEdit = QPlainTextEdit(self)
     self.errorTextEdit.setReadOnly(True)
     self.verticalLayout.addWidget(self.errorTextEdit)
     msg = tr(
         "Although the application should continue to run after this error, it may be in an "
         "instable state, so it is recommended that you restart the application."
     )
     self.label2 = QLabel(msg)
     self.label2.setWordWrap(True)
     self.verticalLayout.addWidget(self.label2)
     self.horizontalLayout = QHBoxLayout()
     self.horizontalLayout.addItem(horizontalSpacer())
     self.dontSendButton = QPushButton(self)
     self.dontSendButton.setText(tr("Don\'t Send"))
     self.dontSendButton.setMinimumSize(QSize(110, 0))
     self.horizontalLayout.addWidget(self.dontSendButton)
     self.sendButton = QPushButton(self)
     self.sendButton.setText(tr("Send"))
     self.sendButton.setMinimumSize(QSize(110, 0))
     self.sendButton.setDefault(True)
     self.horizontalLayout.addWidget(self.sendButton)
     self.verticalLayout.addLayout(self.horizontalLayout)
Пример #3
0
    def __init__(self, recipe=None, parent=None):
        super(RecipeEditionDialog, self).__init__(parent)

        self.setWindowTitle('Recipe edition')

        self.name = QLineEdit()
        self.description = QPlainTextEdit()
        self.tags = QLineEdit()
        buttons = QDialogButtonBox(QDialogButtonBox.Ok
                                   | QDialogButtonBox.Cancel)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        l = QFormLayout(self)
        l.addRow('Name', self.name)
        l.addRow('Description', self.description)
        l.addRow('Tags', self.tags)
        l.addWidget(buttons)

        if recipe:
            self.recipe = recipe
            self.name.setText(recipe.name)
            self.description.setPlainText(recipe.description)
            self.tags.setText(';'.join(t.name for t in recipe.tags))
        else:
            self.recipe = Recipe('')

        self.accepted.connect(self.save_recipe)
Пример #4
0
    def __init__(self, parent=None):
        super(MigrationWidget, self).__init__(parent, Qt.WindowStaysOnTopHint)
        self._migration = {}
        vbox = QVBoxLayout(self)
        lbl_title = QLabel(self.tr("Current code:"))
        self.current_list = QListWidget()
        lbl_suggestion = QLabel(self.tr("Suggested changes:"))
        self.suggestion = QPlainTextEdit()
        self.suggestion.setReadOnly(True)

        self.btn_apply = QPushButton(self.tr("Apply change!"))
        hbox = QHBoxLayout()
        hbox.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding))
        hbox.addWidget(self.btn_apply)

        vbox.addWidget(lbl_title)
        vbox.addWidget(self.current_list)
        vbox.addWidget(lbl_suggestion)
        vbox.addWidget(self.suggestion)
        vbox.addLayout(hbox)

        self.connect(self.current_list,
                     SIGNAL("itemClicked(QListWidgetItem*)"),
                     self.load_suggestion)
        self.connect(self.btn_apply, SIGNAL("clicked()"), self.apply_changes)

        IDE.register_service('tab_migration', self)
        ExplorerContainer.register_tab(translations.TR_TAB_MIGRATION, self)
Пример #5
0
    def __init__(self):
        super(MigrationWidget, self).__init__()
        self._migration = {}
        vbox = QVBoxLayout(self)
        lbl_title = QLabel(self.tr("Current code:"))
        self.current_list = QListWidget()
        lbl_suggestion = QLabel(self.tr("Suggested changes:"))
        self.suggestion = QPlainTextEdit()
        self.suggestion.setReadOnly(True)

        self.btn_apply = QPushButton(self.tr("Apply change!"))
        hbox = QHBoxLayout()
        hbox.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding))
        hbox.addWidget(self.btn_apply)

        vbox.addWidget(lbl_title)
        vbox.addWidget(self.current_list)
        vbox.addWidget(lbl_suggestion)
        vbox.addWidget(self.suggestion)
        vbox.addLayout(hbox)

        self.connect(self.current_list,
                     SIGNAL("itemClicked(QListWidgetItem*)"),
                     self.load_suggestion)
        self.connect(self.btn_apply, SIGNAL("clicked()"), self.apply_changes)
Пример #6
0
 def __init__(self, parent=None):
     super(MigrationWidget, self).__init__(parent, Qt.WindowStaysOnTopHint)
     self._migration, vbox, hbox = {}, QVBoxLayout(self), QHBoxLayout()
     lbl_title = QLabel(translations.TR_CURRENT_CODE)
     lbl_suggestion = QLabel(translations.TR_SUGGESTED_CHANGES)
     self.current_list, self.suggestion = QListWidget(), QPlainTextEdit()
     self.suggestion.setReadOnly(True)
     self.btn_apply = QPushButton(translations.TR_APPLY_CHANGES + " !")
     self.suggestion.setToolTip(translations.TR_SAVE_BEFORE_APPLY + " !")
     self.btn_apply.setToolTip(translations.TR_SAVE_BEFORE_APPLY + " !")
     # pack up all widgets
     hbox.addSpacerItem(QSpacerItem(1, 0, QSizePolicy.Expanding))
     hbox.addWidget(self.btn_apply)
     vbox.addWidget(lbl_title)
     vbox.addWidget(self.current_list)
     vbox.addWidget(lbl_suggestion)
     vbox.addWidget(self.suggestion)
     vbox.addLayout(hbox)
     # connections
     self.connect(self.current_list,
                  SIGNAL("itemClicked(QListWidgetItem*)"),
                  self.load_suggestion)
     self.connect(self.btn_apply, SIGNAL("clicked()"), self.apply_changes)
     # registers
     IDE.register_service('tab_migration', self)
     ExplorerContainer.register_tab(translations.TR_TAB_MIGRATION, self)
Пример #7
0
 def __init__(self, traceback_msg):
     QWidget.__init__(self)
     vbox = QVBoxLayout(self)
     self._editor = QPlainTextEdit()
     vbox.addWidget(QLabel(self.tr('Traceback')))
     vbox.addWidget(self._editor)
     self._editor.setReadOnly(True)
     self._editor.insertPlainText(traceback_msg)
    def __init__(self, parent):
        super(ProjectData, self).__init__()
        self._parent = parent
        grid = QGridLayout(self)
        grid.addWidget(QLabel(self.tr("Name:")), 0, 0)
        self.name = QLineEdit()
        if self._parent._item.name == '':
            self.name.setText(
                file_manager.get_basename(self._parent._item.path))
        else:
            self.name.setText(self._parent._item.name)
        grid.addWidget(self.name, 0, 1)
        grid.addWidget(QLabel(self.tr("Project Type:")), 1, 0)
        self.txtType = QLineEdit()
        completer = QCompleter(sorted(settings.PROJECT_TYPES))
        completer.setCompletionMode(QCompleter.UnfilteredPopupCompletion)
        self.txtType.setCompleter(completer)
        self.txtType.setText(self._parent._item.projectType)
        grid.addWidget(self.txtType, 1, 1)
        grid.addWidget(QLabel(self.tr("Description:")), 2, 0)
        self.description = QPlainTextEdit()
        self.description.setPlainText(self._parent._item.description)
        grid.addWidget(self.description, 2, 1)
        grid.addWidget(QLabel(self.tr("URL:")), 3, 0)
        self.url = QLineEdit()
        self.url.setText(self._parent._item.url)
        grid.addWidget(self.url, 3, 1)
        grid.addWidget(QLabel(self.tr("Licence:")), 4, 0)
        self.cboLicense = QComboBox()
        self.cboLicense.addItem('Apache License 2.0')
        self.cboLicense.addItem('Artistic License/GPL')
        self.cboLicense.addItem('Eclipse Public License 1.0')
        self.cboLicense.addItem('GNU General Public License v2')
        self.cboLicense.addItem('GNU General Public License v3')
        self.cboLicense.addItem('GNU Lesser General Public License')
        self.cboLicense.addItem('MIT License')
        self.cboLicense.addItem('Mozilla Public License 1.1')
        self.cboLicense.addItem('New BSD License')
        self.cboLicense.addItem('Other Open Source')
        self.cboLicense.addItem('Other')
        self.cboLicense.setCurrentIndex(4)
        index = self.cboLicense.findText(self._parent._item.license)
        self.cboLicense.setCurrentIndex(index)
        grid.addWidget(self.cboLicense, 4, 1)

        self.txtExtensions = QLineEdit()
        self.txtExtensions.setText(', '.join(self._parent._item.extensions))
        grid.addWidget(QLabel(self.tr("Supported Extensions:")), 5, 0)
        grid.addWidget(self.txtExtensions, 5, 1)

        grid.addWidget(QLabel(self.tr("Indentation: ")), 6, 0)
        self.spinIndentation = QSpinBox()
        self.spinIndentation.setValue(self._parent._item.indentation)
        self.spinIndentation.setMinimum(1)
        grid.addWidget(self.spinIndentation, 6, 1)
        self.checkUseTabs = QCheckBox(self.tr("Use Tabs."))
        self.checkUseTabs.setChecked(self._parent._item.useTabs)
        grid.addWidget(self.checkUseTabs, 6, 2)
Пример #9
0
    def print_result(self, result, history):
        """
            Print processing result
        """
        self.result = result
        self.history = history

        message = "Filter " + self.history['process'] + "    params: "
        for param in self.history['params'].keys():
            message += " " + param + " : " + str(
                self.history['params'][param]) + " |"

        self.historyBox.appendPlainText(message)

        if result['type'] == "sensor":
            self.draw_chart(self.result['data'])

        elif result['type'] == "sensor list":
            self.draw_multiple_chart(self.result['data'])

        elif result['type'] == "dict list":
            field = QPlainTextEdit()
            field.setReadOnly(True)
            for elem in self.result['data']:
                tmp = ""
                for key in elem.keys():
                    tmp += key + " : " + str(elem[key]) + " "
                field.appendPlainText(tmp)

            self.clear_layout(self.resultFrame.layout())
            self.resultFrame.layout().addWidget(field)

        elif result['type'] == "dict":
            field = QPlainTextEdit()
            field.setReadOnly(True)
            data = self.result['data']
            for key in data.keys():
                field.appendPlainText(key + " : " + str(data[key]))

            self.clear_layout(self.resultFrame.layout())
            self.resultFrame.layout().addWidget(field)
        else:
            print "undefined result"

        self.base_thread.quit()
    def createWidget(self):
        """
        """
        self.inDataEdit = QPlainTextEdit("No settings!")

        mainLayout = QVBoxLayout()
        mainLayout.addWidget(self.inDataEdit)

        self.setLayout(mainLayout)
Пример #11
0
    def create_layout(self):
        self.facadeserver_button = QPushButton(self)
        self.elindevices_button = QPushButton(self)
        self.devlist_edit = QPlainTextEdit(self)
        self.elindevices_button.setText("Get list of devices and 'current' attribute values")

        self.layout = QVBoxLayout(self)
        self.layout.addWidget(self.facadeserver_button, 0)
        self.layout.addWidget(self.elindevices_button, 1)
        self.layout.addWidget(self.devlist_edit, 2)
Пример #12
0
 def __init__(self, traceback_msg):
     QWidget.__init__(self)
     vbox = QVBoxLayout(self)
     self._editor = QPlainTextEdit()
     vbox.addWidget(QLabel(translations.TR_TRACEBACK))
     vbox.addWidget(self._editor)
     self._editor.setReadOnly(True)
     self._editor.setLineWrapMode(0)
     self._editor.insertPlainText(traceback_msg)
     self._editor.selectAll()
Пример #13
0
    def __init__(self):
        QWizardPage.__init__(self)
        self.setTitle('New Project Data')
        self.setSubTitle(
            'Complete the following fields to create the Project Structure')

        g_box = QGridLayout(self)
        #Names of the blanks to complete
        self.lbl_Name = QLabel('New Project Name:')
        self.lbl_Place = QLabel('Project Location:')
        self.lbl_Folder = QLabel('Projet Folder:')
        self.lbl_Description = QLabel('Project Description:')
        self.lbl_License = QLabel('Project License:')
        g_box.addWidget(self.lbl_Name, 0, 0, Qt.AlignRight)
        g_box.addWidget(self.lbl_Place, 1, 0, Qt.AlignRight)
        g_box.addWidget(self.lbl_Folder, 2, 0, Qt.AlignRight)
        g_box.addWidget(self.lbl_Description, 3, 0, Qt.AlignTop)
        g_box.addWidget(self.lbl_License, 4, 0, Qt.AlignRight)

        #Blanks on de right of the grid
        self.txtName = QLineEdit()
        self.registerField('projectName*', self.txtName)
        #Here comes a LineEdit and a PushButton in a HBoxLayout
        h_Place = QHBoxLayout()
        self.txtPlace = QLineEdit()
        self.txtPlace.setReadOnly(True)
        self.registerField('place*', self.txtPlace)
        self.btnExamine = QPushButton('Examine...')
        h_Place.addWidget(self.txtPlace)
        h_Place.addWidget(self.btnExamine)
        #Now lets continue with the rest
        self.txtFolder = QLineEdit()
        self.txtDescription = QPlainTextEdit()
        self.cboLicense = QComboBox()
        self.cboLicense.setFixedWidth(250)
        self.cboLicense.addItem('Apache License 2.0')
        self.cboLicense.addItem('Artistic License/GPL')
        self.cboLicense.addItem('Eclipse Public License 1.0')
        self.cboLicense.addItem('GNU General Public License v2')
        self.cboLicense.addItem('GNU General Public License v3')
        self.cboLicense.addItem('GNU Lesser General Public License')
        self.cboLicense.addItem('MIT License')
        self.cboLicense.addItem('Mozilla Public License 1.1')
        self.cboLicense.addItem('New BSD License')
        self.cboLicense.addItem('Other Open Source')
        self.cboLicense.addItem('Other')
        self.cboLicense.setCurrentIndex(4)
        g_box.addWidget(self.txtName, 0, 1)
        g_box.addLayout(h_Place, 1, 1)
        g_box.addWidget(self.txtFolder, 2, 1)
        g_box.addWidget(self.txtDescription, 3, 1)
        g_box.addWidget(self.cboLicense, 4, 1)

        #Signal
        self.connect(self.btnExamine, SIGNAL('clicked()'), self.load_folder)
Пример #14
0
 def ShowWorking(self):
     getcontext().prec = 3
     working = QPlainTextEdit()
     working.setWindowTitle("Kc calculation")
     reactants = []
     products = []
     for x in self._CurrentReaction.GetReactants():
         if x.GetUsed():
             reactants.append(x)
     for x in self._CurrentReaction.GetProducts():
         if x.GetUsed():
             products.append(x)
     working.appendPlainText("Concentration = moles / volume")
     volume = self._CurrentReaction.GetVolume()
     working.appendPlainText("Volume = "+str(volume)+" dm^3")
     pvalues = []
     rvalues = []
     for x in products:
         working.appendPlainText("Concentration of "+x.GetFormula()+" = "+str(Decimal(x.GetConcentration(volume)) + Decimal(0.0))+" mol dm^-3")
         pvalues.append(x.GetConcentration(volume))
         pvalues.append(x.GetSRatio())
     for x in reactants:
         working.appendPlainText("Concentration of "+x.GetFormula()+" = "+str(Decimal(x.GetConcentration(volume)) + Decimal(0.0))+" mol dm^-3")
         rvalues.append(x.GetConcentration(volume))
         rvalues.append(x.GetSRatio())
     kcvalue = "Value of Kc ="
     x = 0
     while x < len(pvalues):
         kcvalue += " ("+str(Decimal(pvalues[x]) + Decimal(0.0))+")^"
         x += 1
         kcvalue += str(pvalues[x])
         x += 1
     kcvalue += " /"
     x = 0
     while x < len(rvalues):
         kcvalue += " ("+str(Decimal(rvalues[x]) + Decimal(0.0))+")^"
         x += 1
         kcvalue += str(rvalues[x])
         x += 1
     working.appendPlainText(kcvalue)
     rproductsum = 0
     for x in reactants:
         rproductsum += x.GetSRatio()
     pproductsum = 0
     for x in products:
         pproductsum += x.GetSRatio()
     working.appendPlainText("There are "+str(len(reactants))+" reactants, with units mol dm^-3.")
     working.appendPlainText("The product of these units is mol^"+str(rproductsum)+" dm^"+str(rproductsum * -3)+".")
     working.appendPlainText("There are "+str(len(products))+" products, with units mol dm^-3.")
     working.appendPlainText("The product of these units is mol^"+str(pproductsum)+" dm^"+str(pproductsum * -3)+".")
     working.appendPlainText("The product units must be divided by the reactant units, so")
     working.appendPlainText(self._CurrentReaction.GetKc())
     self._ExtraWindows.append(working)
     working.show()
Пример #15
0
    def __init__(self, tree, dataset, master, parent=None):
        QWidget.__init__(self, parent)
        Control.__init__(self, tree, dataset, master)
        self.tree = tree
        self.dataset = dataset
        self.master = master
        self.setObjectName(tree.internalName)

        self.setLayout(QGridLayout())
        self.textWidget = QPlainTextEdit()  # TODO: Subclass to receive drop events from item model views
        self.layout().addWidget(self.textWidget, 0, 0, 1, 1)
Пример #16
0
 def __init__(self, parent=None):
     super(ListEditor, self).__init__(parent)
     self.setWindowTitle("Engellenecek Domain Adı")
     self.tableView = QPlainTextEdit()
     layout = QVBoxLayout()
     layout.addWidget(self.tableView)
     self.kaydetButton = QPushButton("Tamam")
     self.kaydetButton.setStyleSheet("background-color: rgb(0,250,0);")
     self.kaydetButton.clicked.connect(self.listeyiKapat)
     layout.addWidget(self.kaydetButton, 0, Qt.AlignRight)
     self.setLayout(layout)
Пример #17
0
    def __init__(self, parent):
        super(ProjectMetadata, self).__init__()
        self._parent = parent

        vbox = QVBoxLayout(self)
        vbox.addWidget(QLabel(translations.TR_PROJECT_METADATA_RELATED))
        self.txt_projects = QPlainTextEdit()
        vbox.addWidget(self.txt_projects)
        vbox.addWidget(QLabel(translations.TR_PROJECT_METADATA_TIP))

        paths = '\n'.join(self._parent.project.related_projects)
        self.txt_projects.setPlainText(paths)
Пример #18
0
    def addToWidget(self, vbox):
        self.text = QPlainTextEdit(self.canMonitor)
        self.text.setReadOnly(True)
        vbox.addWidget(self.text)

        hbox = QHBoxLayout()
        hbox.setAlignment(Qt.AlignRight | Qt.AlignBottom)
        self.clearButton = QPushButton("Clear", self.canMonitor)
        self.clearButton.clicked.connect(self._clearText)
        hbox.addWidget(self.clearButton)

        vbox.addLayout(hbox)
Пример #19
0
    def __init__(self, authors, translators, parent=None):
        super(CreditsDialog, self).__init__(parent)
        self.parent = parent

        authorsLabel = QPlainTextEdit(authors)
        authorsLabel.setReadOnly(True)
        translatorsLabel = QPlainTextEdit(translators)
        translatorsLabel.setReadOnly(True)
        TabWidget = QTabWidget()
        TabWidget.addTab(authorsLabel, self.tr('Written by'))
        TabWidget.addTab(translatorsLabel, self.tr('Translated by'))
        closeQPB = QPushButton(self.tr('&Close'))

        hlayout = utils.add_to_layout('h', None, closeQPB)
        vlayout = utils.add_to_layout('v', TabWidget, hlayout)

        self.setLayout(vlayout)
        closeQPB.clicked.connect(self.close)

        self.setMinimumSize(QSize(335, 370))
        self.setMaximumSize(QSize(335, 370))
        self.setWindowTitle(self.tr('Credits'))
Пример #20
0
    def __init__(self, parent):
        QFrame.__init__(self, parent)
        self.textpad = QPlainTextEdit(self)
        self.setLayout(QHBoxLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.layout().addWidget(self.textpad)

        self.setFrameStyle(QFrame.Box | QFrame.Sunken)
        self.setStyleSheet("QPlainTextEdit{background:transparent;}")

        settings = self.window().platform.getSettings()
        text = settings.value("textpad", "")
        self.textpad.setPlainText(text)
Пример #21
0
    def __init__(self, parent=None, code=''):
        super(CodePastingDialog, self).__init__(parent)
        self.setWindowTitle(self.tr("Enviar a Pastebin"))
        self.setMinimumSize(700, 500)
        self._parent = parent
        container = QVBoxLayout(self)

        # Thread
        self.thread = code_pasting.Thread()
        self.connect(self.thread, SIGNAL("finished()"), self._paste_result)
        # Campos
        fields_box = QGridLayout()
        fields_box.addWidget(QLabel(self.tr("Expirar después de:")), 0, 0)
        self._spin_expire = QSpinBox()
        self._spin_expire.setSuffix(self.tr(" Días"))
        self._spin_expire.setMinimum(1)
        fields_box.addWidget(self._spin_expire, 0, 1)
        fields_box.addWidget(QLabel(self.tr("Acceso:")), 1, 0)
        self._combo_access = QComboBox()
        self._combo_access.addItems([self.tr("Público"), self.tr("Privado")])
        fields_box.addWidget(self._combo_access, 1, 1)
        fields_box.addWidget(QLabel(self.tr("Nombre:")), 2, 0)
        self._line_filename = QLineEdit()
        place_holder_text = parent.get_active_editor().filename
        self._line_filename.setPlaceholderText(place_holder_text)
        fields_box.addWidget(self._line_filename, 2, 1)
        fields_box.addWidget(QLabel(self.tr("Descripción:")), 3, 0)

        # Editor
        self._code_editor = QPlainTextEdit()
        self._set_editor_style(self._code_editor)
        self._code_editor.setPlainText(code)

        hbox = QHBoxLayout()
        hbox.addItem(QSpacerItem(0, 1, QSizePolicy.Expanding))
        btn_paste = QPushButton(self.tr("Enviar"))
        hbox.addWidget(btn_paste)
        btn_cancel = QPushButton(self.tr("Cancelar"))
        hbox.addWidget(btn_cancel)

        container.addLayout(fields_box)
        container.addWidget(self._code_editor)
        container.addLayout(hbox)

        # Loading widget
        self.loading_widget = loading_widget.LoadingWidget(self)
        self.loading_widget.hide()

        # Conexiones
        self.connect(btn_cancel, SIGNAL("clicked()"), self.close)
        self.connect(btn_paste, SIGNAL("clicked()"), self._emit_data)
Пример #22
0
    def __init__(self, tree, dataset, master, parent=None):
        QWidget.__init__(self, parent)
        Control.__init__(self, tree, dataset, master)

        self.setLayout(QVBoxLayout())
        self.setContentsMargins(0, 0, 0, 0)
        self.cb = QComboBox()
        self.idsEdit = QPlainTextEdit()

        self.layout().addWidget(self.cb)
        self.layout().addWidget(self.idsEdit)

        self.options = []
        self.setOptions(tree.subelements_top("Option"))
Пример #23
0
    def __init__(self):
        super(TestWindow, self).__init__()
        self.setWindowTitle("LivePlot Example Runner")
        layout = QHBoxLayout(self)
        button_layout = QVBoxLayout()
        time_layout = QHBoxLayout()
        time_spin = QSpinBox()
        self.timer = QTimer()
        time_spin.valueChanged.connect(self.timer.setInterval)
        self.timer.timeout.connect(self.iterate)
        self.progress_bar = QProgressBar()
        time_spin.setValue(50)
        time_spin.setRange(0, 1000)
        time_layout.addWidget(QLabel("Sleep Time (ms)"))
        time_layout.addWidget(time_spin)
        button_layout.addLayout(time_layout)

        tests = {
            'plot y': test_plot_y,
            'plot xy': test_plot_xy,
            'plot parametric': test_plot_xy_parametric,
            'plot z': test_plot_z,
            'plot huge': test_plot_huge,
            'append y': test_append_y,
            'append xy': test_append_xy,
            'append z': test_append_z,
        }
        fn_text_widget = QPlainTextEdit()
        fn_text_widget.setMinimumWidth(500)

        def make_set_iterator(iter):
            def set_iterator():
                fn_text_widget.setPlainText(inspect.getsource(iter))
                QApplication.instance().processEvents()
                self.iterator = iter()
                self.timer.start()

            return set_iterator

        for name, iter in tests.items():
            button = QPushButton(name)
            button.clicked.connect(make_set_iterator(iter))
            button_layout.addWidget(button)

        layout.addLayout(button_layout)
        text_layout = QVBoxLayout()
        text_layout.addWidget(fn_text_widget)
        text_layout.addWidget(self.progress_bar)
        layout.addLayout(text_layout)
Пример #24
0
    def __createLayout(self, parent):
        " Helper to create the viewer layout "

        # Messages list area
        self.messages = QPlainTextEdit(parent)
        self.messages.setLineWrapMode(QPlainTextEdit.NoWrap)
        self.messages.setFont(QFont(GlobalData().skin.baseMonoFontFace))
        self.messages.setReadOnly(True)
        self.messages.setMaximumBlockCount(MAX_LINES)

        # Default font size is good enough for most of the systems.
        # 12.0 might be good only in case of the XServer on PC (Xming).
        # self.messages.setFontPointSize( 12.0 )

        # Buttons
        self.selectAllButton = QAction(PixmapCache().getIcon('selectall.png'),
                                       'Select all', self)
        self.selectAllButton.triggered.connect(self.messages.selectAll)
        self.copyButton = QAction(PixmapCache().getIcon('copytoclipboard.png'),
                                  'Copy to clipboard', self)
        self.copyButton.triggered.connect(self.messages.copy)
        spacer = QWidget()
        spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.clearButton = QAction(PixmapCache().getIcon('trash.png'),
                                   'Clear all', self)
        self.clearButton.triggered.connect(self.__clear)

        # Toolbar
        self.toolbar = QToolBar()
        self.toolbar.setOrientation(Qt.Vertical)
        self.toolbar.setMovable(False)
        self.toolbar.setAllowedAreas(Qt.LeftToolBarArea)
        self.toolbar.setIconSize(QSize(16, 16))
        self.toolbar.setFixedWidth(28)
        self.toolbar.setContentsMargins(0, 0, 0, 0)
        self.toolbar.addAction(self.selectAllButton)
        self.toolbar.addAction(self.copyButton)
        self.toolbar.addWidget(spacer)
        self.toolbar.addAction(self.clearButton)

        # layout
        layout = QHBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)
        layout.addWidget(self.toolbar)
        layout.addWidget(self.messages)

        self.setLayout(layout)
        return
Пример #25
0
    def __init__(self):
        super(UpdateDialog, self).__init__()
        vbox = QVBoxLayout(self)
        self.closed = False
        self.setModal(True)
        self.resize(500, 250)

        vbox.addWidget(QLabel(u"Actualización de la lista de episodios:"))
        self.text = QPlainTextEdit()
        self.text.setReadOnly(True)
        vbox.addWidget(self.text)

        bbox = QDialogButtonBox(QDialogButtonBox.Cancel)
        bbox.rejected.connect(self.reject)
        vbox.addWidget(bbox)
Пример #26
0
    def __init__(self, parent):
        super(ProjectMetadata, self).__init__()
        self._parent = parent

        vbox = QVBoxLayout(self)
        vbox.addWidget(QLabel(self.tr(
                        "Insert the path of Python Projects related"
                        "to this one in order\nto improve Code Completion.")))
        self.txt_projects = QPlainTextEdit()
        vbox.addWidget(self.txt_projects)
        vbox.addWidget(QLabel(
            self.tr("Split your paths using newlines [ENTER].")))

        paths = '\n'.join(self._parent._item.related_projects)
        self.txt_projects.setPlainText(paths)
Пример #27
0
    def setApplication(self, app):
        assert (self._widget is None)

        widget = QPlainTextEdit()
        widget.setWindowTitle(u"Error Console")
        widget.resize(486, 300)
        widget.appendHtml(
            u'<span style="color: green">'
            u'An unhandled error occurred.<br>'
            u'Sorry for the inconvinience.<br>'
            u'Please copy the following text into a bug report:<br><br>'
            u'</span>')
        app.aboutToQuit.connect(self.restoreStdErr)
        self._write.connect(self._write_handler)
        self._flush.connect(self._flush_handler)
        self._widget = widget
    def __init__(self, display_name, source_name):
        self.display_name = display_name
        self.source_name = source_name  # FIXME: need to handle rotated logs
        self.last_filename = os.path.join(get_home_path(), display_name)
        self.content = ''
        self.edit = QPlainTextEdit()
        self.normal_font = self.edit.font()
        self.monospace_font = QFont('monospace')

        self.edit.setUndoRedoEnabled(False)
        self.edit.setReadOnly(True)
        self.edit.setWordWrapMode(QTextOption.NoWrap)
        self.edit.setPlainText(
            'Click "Refresh" to download {0}.'.format(display_name))

        self.monospace_font.setStyleHint(QFont.TypeWriter)
Пример #29
0
    def __init__(self, display_name, absolute_name, tab, deletable=True):
        self.display_name = display_name  # is unique
        self.absolute_name = absolute_name  # is also unique
        self.tab = tab
        self.deletable = deletable
        self.index = -1
        self.modified = False
        self.content = None
        self.edit = QPlainTextEdit()

        font = QFont('monospace')
        font.setStyleHint(QFont.TypeWriter)

        self.edit.setWordWrapMode(QTextOption.NoWrap)
        self.edit.setFont(font)
        self.edit.textChanged.connect(self.check_content)
Пример #30
0
    def createWidget(self):
        """
        """
        self.inDataEdit = QPlainTextEdit()
        
        exportButton = QPushButton("&Import")
        exportButton.clicked.connect(self.onImport)

        createTsLayout = QHBoxLayout()
        createTsLayout.addWidget(exportButton)
        
        mainLayout = QVBoxLayout()
        mainLayout.addWidget(QLabel("Imported/Exported json data: "))
        mainLayout.addWidget(self.inDataEdit)
        mainLayout.addLayout(createTsLayout)
        
        self.setLayout(mainLayout)