Example #1
0
    def __init__(self, parent=None):
        super(ServerConfig, self).__init__(parent)

        serverLabel             = Label({'txt':"Server:"})
        serverCombo             = ComboBox({'items': ['Local: {}'.format(__localServer__), 'Global: {}'.format(__globalServer__)]})
        serverLayout            = HBoxLayout({'addWidget': [serverLabel, serverCombo]})
        serverConfigLayout      = VBoxLayout({'addLayout': [serverLayout]})
        serverConfigGroup       = GroupBox("Server configuration", [serverConfigLayout], 'setLayout')

        projectLabel            = Label({'txt': "Set Project:"})
        projectPath             = LineEdit()
        projectBtn              = Button({'txt': 'Set Path'})
        projectLayout           = HBoxLayout({'addWidget': [projectLabel, projectPath, projectBtn]})
        projectConfigLayout     = VBoxLayout({'addLayout': [projectLayout]})
        projectConfigGroup      = GroupBox("Project configuration", [projectConfigLayout], 'setLayout')

        teamtLabel              = Label({'txt': "Set Team:"})
        teamPath                = LineEdit()
        teamBtn                 = Button({'txt': 'Set Team'})
        teamLayout              = HBoxLayout({'addWidget': [teamtLabel, teamPath, teamBtn]})
        teamConfigLayout        = VBoxLayout({'addLayout': [teamLayout]})
        TeamConfigGroup         = GroupBox("Project configuration", [teamConfigLayout], 'setLayout')

        mainLayout              = VBoxLayout({'addWidget': [serverConfigGroup, projectConfigGroup, TeamConfigGroup], 'addStretch': 1})

        self.setLayout(mainLayout)
Example #2
0
    def buildUI(self):

        browseButton = Button({'txt': "&Browse...", 'cl': self.browse})
        findButton = Button({'txt': "&Find", 'cl': self.find})

        self.fileComboBox = self.createComboBox("*")
        self.textComboBox = self.createComboBox()
        self.directoryComboBox = self.createComboBox(QDir.currentPath())

        fileLabel = Label({'txt': "Named:"})
        textLabel = Label({'txt': "Containing text: "})
        directoryLabel = Label({'txt': "In directory: "})

        self.filesFoundLabel = Label()
        self.createFilesTable()

        buttonsLayout = QHBoxLayout()
        buttonsLayout.addStretch()
        buttonsLayout.addWidget(findButton)

        self.layout = QGridLayout()
        self.layout.addWidget(fileLabel, 0, 0)
        self.layout.addWidget(self.fileComboBox, 0, 1, 1, 2)
        self.layout.addWidget(textLabel, 1, 0)
        self.layout.addWidget(self.textComboBox, 1, 1, 1, 2)
        self.layout.addWidget(directoryLabel, 2, 0)
        self.layout.addWidget(self.directoryComboBox, 2, 1)
        self.layout.addWidget(browseButton, 2, 2)
        self.layout.addWidget(self.filesTable, 3, 0, 1, 3)
        self.layout.addWidget(self.filesFoundLabel, 4, 0)
        self.layout.addLayout(buttonsLayout, 5, 0, 1, 3)
        self.setLayout(self.layout)

        self.resize(700, 300)
Example #3
0
    def __init__(self, parent=None):
        super(ConnectStatus, self).__init__(parent)

        self.parent = parent
        self._server = self.getServer()
        self.serverStatus = Label({
            'wmax': 20,
            'sst': 'Server Connection Status',
        })
        self.internetStatus = Label({
            'wmax': 20,
            'sst': 'Internet Connection Status',
        })
        self.modeStatus = Label({
            'txt': self._mode,
            'sst': 'Operating Mode Status'
        })
        self.updateTimer = DAMGTIMER()
        self.updateTimer.setParent(self)
        self.updateTimer.timeout.connect(self.update_icon)

        self.server_status()
        self.internet_status()
        self.mode_status()
        self.addWidget(self.serverStatus, 0, 0, 1, 1)
        self.addWidget(self.internetStatus, 0, 1, 1, 1)
        self.addWidget(self.modeStatus, 0, 2, 1, 1)

        self.labels.appendList(
            [self.serverStatus, self.internetStatus, self.modeStatus])

        if not self._updatting:
            self.updateTimer.stop()
        else:
            self.updateTimer.start(1000)
Example #4
0
    def change_location_section(self):

        location_groupBox, location_layout = GroupGrid("Change Location")

        location_layout.addWidget(Label({'txt': 'Address Line 1'}), 0, 0, 1, 2)
        location_layout.addWidget(Label({'txt': 'Address Line 2'}), 1, 0, 1, 2)
        location_layout.addWidget(Label({'txt': 'Postal'}), 2, 0, 1, 2)
        location_layout.addWidget(Label({'txt': 'City'}), 3, 0, 1, 2)
        location_layout.addWidget(Label({'txt': 'Country'}), 4, 0, 1, 2)

        self.address1Field              = LineEdit()
        self.address2Field              = LineEdit()
        self.postalField                = LineEdit()
        self.cityField                  = LineEdit()
        self.countryField               = LineEdit()

        change_location_btn = Button({'txt': "Update Location", 'cl': self.update_location})

        location_layout.addWidget(self.address1Field, 0, 2, 1, 4)
        location_layout.addWidget(self.address2Field, 1, 2, 1, 4)
        location_layout.addWidget(self.postalField, 2, 2, 1, 4)
        location_layout.addWidget(self.cityField, 3, 2, 1, 4)
        location_layout.addWidget(self.countryField, 4, 2, 1, 4)
        location_layout.addWidget(change_location_btn, 5, 0, 1, 6)

        return location_groupBox
Example #5
0
    def __init__(self, parent=None):
        super(TaskDetails, self).__init__(parent)

        self.parent = parent
        self.addWidget(Label({'txt': 'Task Mode: '}), 0, 0, 1, 1)
        self.addWidget(Label({'txt': 'Task Type'}), 1, 0, 1, 1)

        self.individualMode = CheckBox('Individual')
        self.groupMode = CheckBox('Group')
        self.departmentMode = CheckBox('Department')

        self.individualMode.stateChanged.connect(self.individual)
        self.groupMode.stateChanged.connect(self.group)
        self.departmentMode.stateChanged.connect(self.department)

        self.researchType = CheckBox('Research')
        self.readingType = CheckBox('Reading')
        self.vfxType = CheckBox('VFX')
        self.researchType.stateChanged.connect(self.research)
        self.readingType.stateChanged.connect(self.reading)
        self.vfxType.stateChanged.connect(self.vfx)

        self.addWidget(self.individualMode, 0, 1, 1, 1)
        self.addWidget(self.groupMode, 0, 2, 1, 1)
        self.addWidget(self.departmentMode, 0, 3, 1, 1)
        self.addWidget(self.researchType, 1, 1, 1, 1)
        self.addWidget(self.readingType, 1, 2, 1, 1)
        self.addWidget(self.vfxType, 1, 3, 1, 1)

        self.taskDetails = PlainTextEdit()
        self.addWidget(self.taskDetails, 2, 0, 8, 8)
Example #6
0
    def __init__(self):
        super(TopTap1Filter, self).__init__()

        self.setTitle('Fillter')
        self.layout = GridLayout(self)
        self.setLayout(self.layout)

        self.overduedCB = CheckBox()
        self.urgentCB = CheckBox()
        self.safetyCB = CheckBox()
        self.allTabCheckBox = CheckBox()
        self.allTabCheckBox.stateChanged.connect(self.allTabCheckBoxStateChanged)

        odl = 0
        ugl = odl + 1
        stl = ugl + 1
        al = stl + 1

        self.layout.addWidget(Label({'txt': 'Overdued', 'sss': 'color: red'}), odl, 0, 1, 2)
        self.layout.addWidget(self.overduedCB, odl, 2, 1, 1)
        self.layout.addWidget(Label({'txt': 'Urgent', 'sss': 'color: orange'}), ugl, 0, 1, 2)
        self.layout.addWidget(self.urgentCB, ugl, 2, 1, 1)
        self.layout.addWidget(Label({'txt': 'Others', 'sss': 'color: green'}), stl, 0, 1, 2)
        self.layout.addWidget(self.safetyCB, stl, 2, 1, 1)
        self.layout.addWidget(Label({'txt': 'All'}), al, 0, 1, 2)
        self.layout.addWidget(self.allTabCheckBox, al, 2, 1, 1)
Example #7
0
    def change_profile_section(self):

        profile_groupBox, profile_layout = GroupGrid("Change Profile")

        profile_layout.addWidget(Label({'txt': 'First Name'}), 0, 0, 1, 2)
        profile_layout.addWidget(Label({'txt': 'Last Name'}), 1, 0, 1, 2)
        profile_layout.addWidget(Label({'txt': 'Your Title'}), 2, 0, 1, 2)
        profile_layout.addWidget(Label({'txt': 'Email'}), 3, 0, 1, 2)
        profile_layout.addWidget(Label({'txt': 'Phone Number'}), 4, 0, 1, 2)

        self.firstnameField             = LineEdit()
        self.lastnameField              = LineEdit()
        self.titleField                 = LineEdit()
        self.emailField                 = LineEdit()
        self.phoneField                 = LineEdit()

        change_profile_btn = Button({'txt': "Update Profile", 'cl': self.update_profile})

        profile_layout.addWidget(self.firstnameField, 0, 2, 1, 4)
        profile_layout.addWidget(self.lastnameField, 1, 2, 1, 4)
        profile_layout.addWidget(self.titleField, 2, 2, 1, 4)
        profile_layout.addWidget(self.emailField, 3, 2, 1, 4)
        profile_layout.addWidget(self.phoneField, 4, 2, 1, 4)
        profile_layout.addWidget(change_profile_btn, 5, 0, 1, 6)

        return profile_groupBox
Example #8
0
    def account_section(self):
        self.accSection, account_grid = GroupGrid("Account")
        self.userField = LineEdit()
        self.pwField = LineEdit({'fn': 'password'})
        self.cfpwField = LineEdit({'fn': 'password'})

        account_grid.addWidget(Label({'txt': 'User Name'}), 0, 0, 1, 2)
        account_grid.addWidget(Label({'txt': 'Password'}), 1, 0, 1, 2)
        account_grid.addWidget(Label({'txt': 'Confirm Password'}), 2, 0, 1, 2)

        account_grid.addWidget(self.userField, 0, 3, 1, 4)
        account_grid.addWidget(self.pwField, 1, 3, 1, 4)
        account_grid.addWidget(self.cfpwField, 2, 3, 1, 4)
Example #9
0
    def __init__(self, task):
        super(TaskInfo, self).__init__()

        with open(task, 'r') as f:
            self._data = json.load(f)

        self.setTitle(self._data['id'])
        self.layout = VBoxLayout()

        self._id = self._data['id']
        self.key = self._id
        self._name = self._data['name']
        self._mode = self._data['mode']
        self._type = self._data['type']

        self._project = self._data['project']
        self._organisation = self._data['organisation']
        self._details = self._data['details']

        self._hour = int(self._data['endtime'].split(':')[0])
        self._minute = int(self._data['endtime'].split(':')[1])
        self._second = int(self._data['endtime'].split(':')[2])

        self._day = int(self._data['enddate'].split('/')[0])
        self._month = int(self._data['enddate'].split('/')[1])
        self._year = int(self._data['enddate'].split('/')[2])

        self.duetime = duetime(self._hour, self._minute, self._second)
        self.duedate = duedate(self._day, self._month, self._year)

        self.task = Task(self._id, self._name, self._mode, self._type, self._project, self._organisation,
                         self.duetime, self.duedate, self._details)

        self._countdown = '{0}:{1}:{2}'.format(self.task.hours, self.task.minutes, self.task.seconds)
        self.task.countdown.connect(self.update_countdown)

        self.task_status = Label({'txt': '{0}'.format(self.task.status)})
        self.task_duedate = Label({'txt': '{0}'.format(self.task._enddate)})
        self.task_duetime = Label({'txt': '{0}'.format(self.task._endtime)})
        self.task_countdown = Label({'txt': '{0}'.format(self._countdown)})

        self.layout.addWidget(self.task_status)
        self.layout.addWidget(self.task_duedate)
        self.layout.addWidget(self.task_duetime)
        self.layout.addWidget(self.task_countdown)

        self.setLayout(self.layout)
        self.setMaximumSize(100, 100)
Example #10
0
    def __init__(self, key=None, parent=None):
        super(InfoWidget, self).__init__(parent)

        self.key = key
        self.parent = parent

        if self.key is None or self.key not in self.content.keys():
            print("KeyError: Key is None, or not in content data: {0}".format(
                self.key))
            return
        else:
            self.context = self.content[self.key]

        self.setWindowTitle(self.key)
        self.setWindowIcon(AppIcon(32, self.key))

        self.layout = GridLayout(self)
        label = Label({'txt': self.content[self.key]})
        btn = Button({'txt': 'Ok', 'cl': self.close})
        btn.setFixedSize(100, 25)

        self.layout.addWidget(label, 0, 0, 6, 6)
        self.layout.addWidget(btn, 6, 6, 1, 1)

        self.setLayout(self.layout)
        self.setSizePolicy(SiPoMin, SiPoMin)
        self.setContentsMargins(1, 1, 1, 1)
Example #11
0
    def __init__(self, parent):
        super(PreviewForm, self).__init__(parent)

        self.encodingComboBox = QComboBox()
        encodingLabel = Label({'txt': "&Encoding:"})
        encodingLabel.setBuddy(self.encodingComboBox)

        self.textEdit = QTextEdit()
        self.textEdit.setLineWrapMode(QTextEdit.NoWrap)
        self.textEdit.setReadOnly(True)

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

        self.encodingComboBox.activated.connect(self.updateTextEdit)
        buttonBox.accepted.connect(self.accept)
        buttonBox.rejected.connect(self.reject)

        mainLayout = QGridLayout()
        mainLayout.addWidget(encodingLabel, 0, 0)
        mainLayout.addWidget(self.encodingComboBox, 0, 1)
        mainLayout.addWidget(self.textEdit, 1, 0, 1, 2)
        mainLayout.addWidget(buttonBox, 2, 0, 1, 2)

        self.setLayout(mainLayout)
        self.setWindowTitle("Choose Encoding")
        self.resize(400, 300)
Example #12
0
    def change_pass_section(self):

        password_groupBox, password_layout = GroupGrid('Change Password')

        self.old_pass                   = LineEdit({'echo': 'password'})
        self.new_pass                   = LineEdit({'echo': 'password'})
        self.confirm_pass               = LineEdit({'echo': 'password'})
        change_pass_btn                 = Button({'txt': 'Change Password', 'cl': self.update_password})

        password_layout.addWidget(Label({'txt': 'Old Password'}), 0, 0, 1, 2)
        password_layout.addWidget(Label({'txt': 'New Password'}), 1, 0, 1, 2)
        password_layout.addWidget(Label({'txt': 'Confirm Password'}), 2, 0, 1, 2)
        password_layout.addWidget(self.old_pass, 0, 2, 1, 4)
        password_layout.addWidget(self.new_pass, 1, 2, 1, 4)
        password_layout.addWidget(self.confirm_pass, 2, 2, 1, 4)
        password_layout.addWidget(change_pass_btn, 3, 0, 1, 6)

        return password_groupBox
Example #13
0
    def __init__(self, layout=None, parent=None):
        super(TabContent, self).__init__(parent)

        if layout is None:
            layout = GridLayout()
            layout.addWidget(Label())

        self.layout = layout
        self.setLayout(self.layout)
Example #14
0
    def step1_layout(self):

        step1_groupBox = QGroupBox("Step 1")
        step1_layout = QFormLayout()
        step1_groupBox.setLayout(step1_layout)

        self.user_account = QLineEdit()
        self.user_email = QLineEdit()

        step1_btn_box = QDialogButtonBox(QDialogButtonBox.Ok
                                         | QDialogButtonBox.Cancel)
        step1_btn_box.accepted.connect(self.on_step1_btn_clicked)
        step1_btn_box.rejected.connect(self.close)

        step1_layout.addRow(Label({'txt': "Username: "******"Email adress: "}), self.user_email)
        step1_layout.addRow(step1_btn_box)

        return step1_groupBox
Example #15
0
    def profile_section(self):
        self.prfSection, profile_grid = GroupGrid("Profile")

        profile_grid.addWidget(Label({'txt': 'First Name'}), 0, 0, 1, 2)
        profile_grid.addWidget(Label({'txt': 'Last Name'}), 1, 0, 1, 2)
        profile_grid.addWidget(Label({'txt': 'Your Title'}), 2, 0, 1, 2)
        profile_grid.addWidget(Label({'txt': 'Email'}), 3, 0, 1, 2)
        profile_grid.addWidget(Label({'txt': 'Phone Number'}), 4, 0, 1, 2)

        self.titleField = LineEdit()
        self.firstnameField = LineEdit()
        self.lastnameField = LineEdit()
        self.emailField = LineEdit()
        self.phoneField = LineEdit()

        profile_grid.addWidget(self.firstnameField, 0, 2, 1, 4)
        profile_grid.addWidget(self.lastnameField, 1, 2, 1, 4)
        profile_grid.addWidget(self.titleField, 2, 2, 1, 4)
        profile_grid.addWidget(self.emailField, 3, 2, 1, 4)
        profile_grid.addWidget(self.phoneField, 4, 2, 1, 4)
Example #16
0
    def location_section(self):
        self.conSection, conGrid = GroupGrid("Location")

        conGrid.addWidget(Label({'txt': "Address Line 1"}), 0, 0, 1, 2)
        conGrid.addWidget(Label({'txt': "Address Line 2"}), 1, 0, 1, 2)
        conGrid.addWidget(Label({'txt': "Postal"}), 2, 0, 1, 2)
        conGrid.addWidget(Label({'txt': "City"}), 3, 0, 1, 2)
        conGrid.addWidget(Label({'txt': "Country"}), 4, 0, 1, 2)

        self.addressLine1 = LineEdit()
        self.addressLine2 = LineEdit()
        self.postalCode = LineEdit()
        self.city = LineEdit()
        self.country = LineEdit()

        conGrid.addWidget(self.addressLine1, 0, 2, 1, 4)
        conGrid.addWidget(self.addressLine2, 1, 2, 1, 4)
        conGrid.addWidget(self.city, 2, 2, 1, 4)
        conGrid.addWidget(self.postalCode, 3, 2, 1, 4)
        conGrid.addWidget(self.country, 4, 2, 1, 4)
Example #17
0
    def __init__(self, section, name="", parent=None):
        super(ItemWidget, self).__init__(parent)

        self.section    = section
        self.item       = Label({'txt': name})
        self.setLayout(
                        HBoxLayout({'setLayout': [self.item, 
                                                  Button({'txt' :"Edit", 
                                                          'stt' :"Edit character name", 
                                                          'cl'  : self.setText})]
                                   })
                        )
Example #18
0
    def buildUI(self):
        layout = GridLayout()

        for i in range(5):
            layout.addWidget(Label({'txt': " "}), 0, i, 1, 1)
            i += 1

        for button in self.buttonManager.tagButtonsFooterWidget(self.parent):
            layout.addWidget(button, 0, i, 1, 2)
            i = i + 2

        return layout
Example #19
0
    def security_section(self):

        self.serSection, questions_grid = GroupGrid("Security Question")

        self.ques1 = ComboBox(
            {'items': [str(i) for i in QUESTIONS.split('\n')]})
        self.answ2 = LineEdit()

        self.ques2 = ComboBox(
            {'items': [str(i) for i in QUESTIONS.split('\n')]})
        self.answ1 = LineEdit()

        questions_grid.addWidget(Label({'txt': 'Question 1'}), 0, 0, 1, 3)
        questions_grid.addWidget(Label({'txt': 'Answer 1'}), 1, 0, 1, 3)
        questions_grid.addWidget(Label({'txt': 'Question 2'}), 2, 0, 1, 3)
        questions_grid.addWidget(Label({'txt': 'Answer 2'}), 3, 0, 1, 3)

        questions_grid.addWidget(self.ques1, 0, 3, 1, 6)
        questions_grid.addWidget(self.answ1, 1, 3, 1, 6)
        questions_grid.addWidget(self.ques2, 2, 3, 1, 6)
        questions_grid.addWidget(self.answ2, 3, 3, 1, 6)
Example #20
0
    def __init__(self, threadManager, parent=None):
        super(Notification, self).__init__(parent)

        self.parent         = parent
        self.threadManager  = threadManager

        self.usage_cpu      = Label({'txt': 'cpu: 0%'})
        self.usage_ram      = Label({'txt': 'ram: 0%'})
        self.usage_gpu      = Label({'txt': 'gpu: 0%'})
        self.usage_disk     = Label({'txt': 'dsk: 0%'})


        self.timeClock      = DigitalClock(self)
        self.dateClock      = DigitalDate(self)

        d = self.dateClock.currentDate().day()
        m = self.dateClock.currentDate().month()
        y = self.dateClock.currentDate().year()
        dt = datetime.date(y, m, d)
        wk = dt.isocalendar()[1]

        self.weekNumber = Label({'txt': 'Weeknumber: {0}'.format(wk)})

        worker = self.threadManager.serviceThread()
        worker.cpu.connect(self.update_cpu_useage)
        worker.ram.connect(self.update_ram_useage)
        worker.gpu.connect(self.update_gpu_useage)
        worker.disk.connect(self.update_disk_useage)
        worker.start()

        self.labels = [self.usage_cpu, self.usage_ram, self.usage_gpu, self.usage_disk, self.timeClock, self.dateClock]

        self.addWidget(self.usage_cpu, 0, 0, 1, 1)
        self.addWidget(self.usage_ram, 0, 1, 1, 1)
        self.addWidget(self.usage_gpu, 1, 0, 1, 1)
        self.addWidget(self.usage_disk, 1, 1, 1, 1)
        self.addWidget(self.weekNumber, 2, 0, 1, 2)
        self.addWidget(self.timeClock, 3, 0, 1, 1)
        self.addWidget(self.dateClock, 3, 1, 1, 1)
Example #21
0
    def buildUI(self):
        self.screenshotLabel = Label({
            'alg': 'center',
            'sizePolicy': ['expanding', 'expanding'],
            'smin': [240, 160]
        })

        self.createOptionsGroupBox()
        self.createButtonsLayout()

        self.layout.addWidget(self.screenshotLabel, 0, 0, 9, 16)
        self.layout.addWidget(self.optionsGroupBox, 10, 0, 1, 16)
        self.layout.addLayout(self.buttonsLayout, 11, 0, 1, 16)
Example #22
0
    def buildHeaderCheckBoxes(self):
        self.buildToolBarCheckBoxes()
        self.buildMenuCheckBoxes()
        self.buildServerStatusCheckBoxes()
        self.headerCB = CheckBox('Header')
        self.headerCB.stateChanged.connect(self.headerStateChanged)

        mnl = self.la
        csl = mnl + 1
        tbl = csl + 1
        hdl = tbl + 1

        self.addWidget(Label({'txt': 'Menus'}), mnl, 0, 1, 1)
        self.addWidget(self.allMenuCB, mnl, 1, 1, 1)
        self.addWidget(self.mnAppCB, mnl, 2, 1, 1)
        self.addWidget(self.mnGoCB, mnl, 3, 1, 1)
        self.addWidget(self.mnOfficeCB, mnl, 4, 1, 1)
        self.addWidget(self.mnToolsCB, mnl, 5, 1, 1)
        self.addWidget(self.mnDevCB, mnl, 6, 1, 1)
        self.addWidget(self.mnLibCB, mnl, 7, 1, 1)
        self.addWidget(self.mnHelpCB, mnl, 8, 1, 1)

        self.addWidget(Label({'txt': 'Tool Bar: '}), tbl, 0, 1, 1)
        self.addWidget(self.allToolBarCB, tbl, 1, 1, 1)
        self.addWidget(self.tbTDCB, tbl, 2, 1, 1)
        self.addWidget(self.tbVfxCB, tbl, 3, 1, 1)
        self.addWidget(self.tbArtCB, tbl, 4, 1, 1)
        self.addWidget(self.tbTexCB, tbl, 5, 1, 1)
        self.addWidget(self.tbPostCB, tbl, 6, 1, 1)

        self.addWidget(Label({'txt': 'Connect Status'}), csl, 0, 1, 1)
        self.addWidget(self.allConnectCB, csl, 1, 1, 1)
        self.addWidget(self.serverCB, csl, 2, 1, 1)
        self.addWidget(self.onlineCB, csl, 3, 1, 1)
        self.addWidget(self.modeCB, csl, 4, 1, 1)

        self.addWidget(Label({'txt': 'Header'}), hdl, 0, 1, 1)
        self.addWidget(self.headerCB, hdl, 1, 1, 1)
Example #23
0
    def buildBodyCheckBoxes(self):
        self.buildNotificationCheckBoxes()
        self.bodyCB = CheckBox('Body')
        self.bodyCB.stateChanged.connect(self.bodyStateChanged)

        ntl = self.la
        bdl = ntl + 1

        self.addWidget(Label({'txt': 'Notification'}), ntl, 0, 1, 1)
        self.addWidget(self.allNotifiCB, ntl, 1, 1, 1)
        self.addWidget(self.cpuCB, ntl, 2, 1, 1)
        self.addWidget(self.ramCB, ntl, 3, 1, 1)
        self.addWidget(self.gpuCB, ntl, 4, 1, 1)
        self.addWidget(self.diskCB, ntl, 5, 1, 1)
        self.addWidget(self.timeCB, ntl, 6, 1, 1)
        self.addWidget(self.dateCB, ntl, 7, 1, 1)

        self.addWidget(Label({'txt': 'Body'}), bdl, 0, 1, 1)
        self.addWidget(self.bodyCB, bdl, 1, 1, 1)


        self.la = bdl + 1
        return self.la
Example #24
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
Example #25
0
    def avatar_section(self):
        self.avaSection, avatar_grid = GroupGrid("Avatar")

        self.userAvatar = Label({
            'pxm': 'default',
            'scc': True,
            'sfs': [100, 100]
        })

        set_avatarBtn = Button({
            'txt': 'Set Avatar',
            'tt': 'Choose a showLayout_new avatar',
            'cl': self.setAvaClicked
        })

        avatar_grid.addWidget(self.userAvatar, 0, 0, 2, 2)
        avatar_grid.addWidget(set_avatarBtn, 2, 0, 1, 2)
Example #26
0
    def buildUI(self):
        self.avatar_section()
        self.account_section()
        self.profile_section()
        self.location_section()
        self.security_section()
        self.buttons_section()

        self.layout.addWidget(Label({'txt': "ALL FIELD ARE REQUIRED!!!"}), 0,
                              0, 1, 6)
        self.layout.addWidget(self.avaSection, 1, 0, 1, 2)
        self.layout.addWidget(self.accSection, 1, 2, 1, 4)
        self.layout.addWidget(self.prfSection, 2, 0, 1, 6)
        self.layout.addWidget(self.conSection, 3, 0, 1, 6)
        self.layout.addWidget(self.serSection, 4, 0, 1, 6)
        self.layout.addWidget(self.btnSection, 5, 0, 1, 6)

        self.applySetting()
Example #27
0
    def change_avatar_section(self):

        try:
            self.username, token, cookie, remember = self.query.query_table('curUser')
        except (ValueError, IndexError):
            self.username = '******'

        avatar_groupBox, avatar_layout = GroupGrid('Change Avatar')

        self.avatar = Label()
        self.avatar.setPixmap(QPixmap.fromImage(QImage(get_avatar_image(self.username))))
        self.avatar.setScaledContents(True)
        self.avatar.setFixedSize(100, 100)

        change_avatar_btn = Button({'txt':'Change Avatar', 'cl': self.update_avatar})
        avatar_layout.addWidget(self.avatar)
        avatar_layout.addWidget(change_avatar_btn)

        return avatar_groupBox
Example #28
0
    def buildUI(self):

        loginGrp, loginGrid = GroupGrid('Sign in')

        self.userTF = LineEdit()
        self.pwTF = LineEdit({'fn': 'password'})
        self.userCB = CheckBox('Remember me?')

        forgot_pw_btn = Button({
            'txt':
            'Forgot your password?',
            'cl':
            partial(self.signals.emit, 'showLayout', 'ForgotPassword', 'show')
        })
        login_btn = Button({'txt': 'Log in', 'cl': self.signInClicked})
        cancel_btn = Button({'txt': 'Cancel', 'cl': QApplication.quit})

        signupGrp, signupGrid = GroupGrid('Sign up')
        signupBtn = Button({
            'txt':
            'Sign up',
            'cl':
            partial(self.signals.emit, 'showLayout', 'SignUp', 'show')
        })

        loginGrid.addWidget(usernameLabel, 0, 0, 1, 2)
        loginGrid.addWidget(passwordLabel, 1, 0, 1, 2)
        loginGrid.addWidget(self.userTF, 0, 2, 1, 4)
        loginGrid.addWidget(self.pwTF, 1, 2, 1, 4)
        loginGrid.addWidget(self.userCB, 2, 1, 1, 2)
        loginGrid.addWidget(login_btn, 2, 3, 1, 3)
        loginGrid.addWidget(forgot_pw_btn, 3, 0, 1, 3)
        loginGrid.addWidget(cancel_btn, 3, 3, 1, 3)

        signupGrid.addWidget(Label({'txt': SIGNUP}), 0, 0, 1, 6)
        signupGrid.addWidget(signupBtn, 1, 0, 1, 6)

        self.layout.addWidget(loginGrp, 0, 0, 1, 1)
        self.layout.addWidget(signupGrp, 1, 0, 1, 1)
Example #29
0
    def buildUI(self):

        self.layout = GridLayout(self)
        self.lineInput = LineEdit()
        self.lineInput.textChanged.connect(self.getText)

        self.suggessLabel = Label()

        searchBtn = Button({'txt': 'Translate', 'cl': self.btn_clicked})
        yesBtn = Button({'txt': 'Yes', 'cl': self.btn_clicked})
        noBtn = Button({'txt': 'No', 'cl': self.btn_clicked})

        self.answer = QTextEdit()
        self.answer.setPlainText(" ")

        self.layout.addWidget(self.lineInput, 0, 0, 1, 3)
        self.layout.addWidget(self.suggessLabel, 1, 0, 1, 3)
        self.layout.addWidget(searchBtn, 2, 0, 1, 1)
        self.layout.addWidget(yesBtn, 2, 1, 1, 1)
        self.layout.addWidget(noBtn, 2, 2, 1, 1)
        self.layout.addWidget(self.answer, 3, 0, 4, 3)

        self.setLayout(self.layout)
Example #30
0
    def __init__(self, parent=None):
        super(TaskInfo, self).__init__(parent)

        self.parent = parent

        self.addWidget(Label({'txt': 'Task Name: '}), 0, 0, 1, 1)
        self.taskName = LineEdit()
        self.addWidget(self.taskName, 0, 1, 1, 3)

        self.addWidget(Label({'txt': 'Task ID: '}), 1, 0, 1, 1)
        self.taskID = LineEdit()
        self.addWidget(self.taskID, 1, 1, 1, 3)

        self.addWidget(Label({'txt': 'Project ID: '}), 2, 0, 1, 1)
        self.projectID = LineEdit()
        self.addWidget(self.projectID, 2, 1, 1, 3)

        self.addWidget(Label({'txt': 'Project Name: '}), 3, 0, 1, 1)
        self.projectName = LineEdit()
        self.addWidget(self.projectName, 3, 1, 1, 3)

        self.addWidget(Label({'txt': 'Organisation ID: '}), 4, 0, 1, 1)
        self.organisationID = LineEdit()
        self.addWidget(self.organisationID, 4, 1, 1, 3)

        self.addWidget(Label({'txt': 'Organisation Name: '}), 5, 0, 1, 1)
        self.organisationName = LineEdit()
        self.addWidget(self.organisationName, 5, 1, 1, 3)

        self.addWidget(Label({'txt': 'Duetime'}), 7, 0, 1, 1)
        self.addWidget(Label({'txt': 'Hour'}), 6, 1, 1, 1)
        self.addWidget(Label({'txt': 'Minute'}), 6, 2, 1, 1)
        self.addWidget(Label({'txt': 'Second'}), 6, 3, 1, 1)
        self.addWidget(Label({'txt': 'Duedate'}), 9, 0, 1, 1)
        self.addWidget(Label({'txt': 'Day'}), 8, 1, 1, 1)
        self.addWidget(Label({'txt': 'Month'}), 8, 2, 1, 1)
        self.addWidget(Label({'txt': 'Year'}), 8, 3, 1, 1)

        self.year = LineEdit()
        self.month = LineEdit()
        self.day = LineEdit()
        self.hour = LineEdit()
        self.minute = LineEdit()
        self.second = LineEdit()

        for le in [
                self.year, self.month, self.day, self.hour, self.minute,
                self.second
        ]:
            le.setValidator(QIntValidator())

        self.addWidget(self.hour, 7, 1, 1, 1)
        self.addWidget(self.minute, 7, 2, 1, 1)
        self.addWidget(self.second, 7, 3, 1, 1)
        self.addWidget(self.day, 9, 1, 1, 1)
        self.addWidget(self.month, 9, 2, 1, 1)
        self.addWidget(self.year, 9, 3, 1, 1)