Esempio n. 1
0
class Preferences(Widget):

    key = 'Preferences'

    _msg_user_not_set = "Not configured yet, will be set with the first message received"

    def __init__(self, parent=None):
        super(Preferences, self).__init__(parent)

        # self.resize(200, 100)
        self.setWindowIcon(AppIcon(32, self.key))
        self.setWindowTitle(self.key)
        # self.layout = GeneralSetting(self)
        self.layout = VBoxLayout()
        self.headerGrid = HeaderCheckBoxes(self)
        self.header = GroupBox('Header', parent=self)
        self.header.setLayout(self.headerGrid)

        self.bodyGrid = BodyCheckBoxes(self)
        self.body = GroupBox('Body', parent=self)
        self.body.setLayout(self.bodyGrid)

        self.layout.addWidget(self.header)
        self.layout.addWidget(self.body)

        self.setLayout(self.layout)
Esempio n. 2
0
    def buildUI(self):

        officeBtns = []
        keys = ['TextEditor', 'NoteReminder']
        for key in keys:
            if key in self.appInfo:
                btn = Button({'icon':key, 'tt': self.appInfo[key][2], 'fix': BTNICONSIZE, 'ics': ICONBTNSIZE, 'emit2':[self.signals.showLayout.emit, [FIX_KEYS[key], 'show']]})
                officeBtns.append(btn)

        for key in CONFIG_OFFICE:
            if key in self.appInfo:
                btn = Button({'icon': key, 'tt': self.appInfo[key][2], 'fix': BTNICONSIZE, 'ics': ICONBTNSIZE, 'emit1': [self.signals.executing.emit, self.appInfo[key][2]]})
                officeBtns.append(btn)

        devBtns = []
        for key in CONFIG_DEV:
            if key in self.appInfo:
                btn = Button({'icon': key, 'tt': self.appInfo[key][2], 'fix': BTNICONSIZE, 'ics': ICONBTNSIZE, 'emit1': [self.signals.executing.emit, self.appInfo[key][2]]})
                devBtns.append(btn)

        pyuiBtn = []
        for key in CONFIG_TOOLS:
            if key in self.appInfo:
                btn = Button({'icon': key, 'tt': self.appInfo[key][2], 'fix': BTNICONSIZE, 'ics': ICONBTNSIZE, 'emit2': [self.signals.showLayout.emit, [FIX_KEYS[key], 'show']]})
                pyuiBtn.append(btn)

        extraBtns = []
        for key in CONFIG_EXTRA:
            if key in self.appInfo:
                btn = Button({'icon': key, 'tt': self.appInfo[key][2], 'fix': BTNICONSIZE, 'ics': ICONBTNSIZE, 'emit2': [self.signals.executing.emit, key]})
                extraBtns.append(btn)

        sec1Grp = GroupBox("Office", officeBtns, "IconGrid")
        sec2Grp = GroupBox("Dev", devBtns, "IconGrid")
        sec3Grp = GroupBox("Tools", pyuiBtn, "IconGrid")
        sec4Grp = GroupBox("Extra", extraBtns, "IconGrid")

        self.findEdit = LineEdit()
        findBtn = Button({'txt':"Find Tool"})

        sec5Grp = GroupBox("Find Tool")
        sec5Grid = GridLayout()
        sec5Grid.addWidget(self.findEdit, 0, 0, 1, 7)
        sec5Grid.addWidget(findBtn, 0, 7, 1, 2)
        sec5Grp.setLayout(sec5Grid)

        self.layout.addWidget(sec1Grp, 0, 0, 2, 3)
        self.layout.addWidget(sec2Grp, 2, 0, 2, 3)
        self.layout.addWidget(sec3Grp, 0, 3, 4, 3)
        self.layout.addWidget(sec4Grp, 0, 6, 4, 3)
        self.layout.addWidget(sec5Grp, 4, 0, 1, 9)
Esempio n. 3
0
    def __init__(self, parent=None):
        super(UpdatePage, self).__init__(parent)

        updateGroup         = GroupBox("Package selection")
        systemCheckBox      = CheckBox("Update system")
        appsCheckBox        = CheckBox("Update applications")
        docsCheckBox        = CheckBox("Update documentation")

        packageGroup        = GroupBox("Existing packages")

        packageList         = QListWidget()
        qtItem              = QListWidgetItem(packageList)
        qtItem.setText("Qt")

        qsaItem             = QListWidgetItem(packageList)
        qsaItem.setText("QSA")

        teamBuilderItem     = QListWidgetItem(packageList)
        teamBuilderItem.setText("Teambuilder")

        startUpdateButton   = Button({'txt':"Start update"})

        updateLayout        = VBoxLayout({'addWidget': [systemCheckBox, appsCheckBox, docsCheckBox]})
        # updateLayout.addWidget(systemCheckBox)
        # updateLayout.addWidget(appsCheckBox)
        # updateLayout.addWidget(docsCheckBox)
        updateGroup.setLayout(updateLayout)

        packageLayout       = QVBoxLayout()
        packageLayout.addWidget(packageList)
        packageGroup.setLayout(packageLayout)

        mainLayout          = QVBoxLayout()
        mainLayout.addWidget(updateGroup)
        mainLayout.addWidget(packageGroup)
        mainLayout.addSpacing(12)
        mainLayout.addWidget(startUpdateButton)
        mainLayout.addStretch(1)

        self.setLayout(mainLayout)
Esempio n. 4
0
    def step2_layout(self):

        step2_groupBox = GroupBox("Step 2")
        step2_layout = VBoxLayout()
        step2_groupBox.setLayout(step2_layout)

        self.question1 = Label({'txt': "Question 1"})
        self.question2 = Label({'txt': "Question 2"})

        self.answer1 = LineEdit()
        self.answer2 = LineEdit()

        step2_btn_box = QDialogButtonBox(QDialogButtonBox.Ok
                                         | QDialogButtonBox.Cancel)
        step2_btn_box.accepted.connect(self.on_step2_btn_clicked)
        step2_btn_box.rejected.connect(self.close)

        step2_layout.addWidget(self.question1)
        step2_layout.addWidget(self.answer1)
        step2_layout.addWidget(self.question2)
        step2_layout.addWidget(self.answer2)
        step2_layout.addWidget(step2_btn_box)

        return step2_groupBox
Esempio n. 5
0
class TaskManager(Widget):

    key = 'TaskManager'

    def __init__(self, parent=True):
        super(TaskManager, self).__init__(parent)

        self.parent = parent
        self.setWindowTitle('Task Manager')
        self.layout = VBoxLayout()
        line1 = HBoxLayout()
        line2 = HBoxLayout()

        self.infoGrp = GroupBox('Task Info')
        self.taskInfo = TaskInfo(self)
        self.infoGrp.setLayout(self.taskInfo)
        line1.addWidget(self.infoGrp)

        self.detailsGrp = GroupBox('Details')
        self.taskDetails = TaskDetails(self)
        self.detailsGrp.setLayout(self.taskDetails)
        line1.addWidget(self.detailsGrp)

        self.layout.addLayout(line1)
        self.layout.addLayout(line2)

        self.okButton = Button({'txt': 'Ok', 'cl': self.executeTask})
        self.cancelButton = Button({'txt': 'Cancel', 'cl': self.hideEvent})
        line2.addWidget(self.okButton)
        line2.addWidget(self.cancelButton)

        self.setLayout(self.layout)
        self.setMinimumWidth(750)

    def executeTask(self):

        h = int(self.taskInfo.hour.text())
        m = int(self.taskInfo.minute.text())
        s = int(self.taskInfo.second.text())
        self.duetime = duetime(h, m, s)

        y = int(self.taskInfo.year.text())
        mo = int(self.taskInfo.month.text())
        d = int(self.taskInfo.day.text())
        self.duedate = duedate(d, mo, y)

        id = self.taskInfo.taskID.text()
        name = self.taskInfo.taskName.text()
        type = self.taskDetails.taskType
        mode = self.taskDetails.taskMode
        project = [
            self.taskInfo.projectID.text(),
            self.taskInfo.projectName.text()
        ]
        organisation = [
            self.taskInfo.organisationID.text(),
            self.taskInfo.organisationName.text()
        ]
        details = self.taskDetails.taskDetails.toPlainText()

        Task(id, name, mode, type, project, organisation, self.duetime,
             self.duedate, details)
        self.parent.topTabUI.tab1.update_tasks()

    def resizeEvent(self, event):
        w = int(self.width())
        self.infoGrp.setMaximumWidth(w / 3)


# -------------------------------------------------------------------------------------------------------------
# Created by panda on 19/11/2019 - 12:48 AM
# © 2017 - 2018 DAMGteam. All rights reserved