예제 #1
0
    def buildUI(self):
        self.query = usql.QuerryDB()
        try:
            self.username, token, cookie, remember = self.query.query_table('curUser')
        except (ValueError, IndexError):
            self.username = '******'

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

        btn1 = Button({'txt':'Account Setting', 'cl': partial(self.showLayout.emit, 'userSetting', 'show')})
        btn2 = Button({'txt':'Log Out', 'cl': partial(self.showLayout.emit, 'login', 'show')})

        btns = [btn1, btn2]

        sec1Grp = GroupBox(self.username, [self.avatar], "ImageView")
        sec2Grp = GroupBox("Setting", btns, "BtnGrid")

        sec3Grp = QGroupBox("Messenger")
        sec3Grid = QGridLayout()
        sec3Grp.setLayout(sec3Grid)

        self.layout.addWidget(sec1Grp, 0, 0, 1, 1)
        self.layout.addWidget(sec2Grp, 1, 0, 1, 1)
        self.layout.addWidget(sec3Grp, 0, 1, 2, 2)

        self.applySetting()
예제 #2
0
    def buildUI(self):

        loginGrp, loginGrid = GroupGrid('Sign in')

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

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

        loginGrid.addWidget(Label({'txt': 'Username'}), 0, 0, 1, 2)
        loginGrid.addWidget(Label({'txt': 'Password'}), 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)

        signupGrp, signupGrid = GroupGrid('Sign up')
        signupBtn = Button({'txt':'Sign up', 'emit2': [self.showLayout.emit, ['signup', 'show']]})

        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)
예제 #3
0
    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)
예제 #4
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)
예제 #5
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)
예제 #6
0
    def buttons_section(self):
        self.btnSection, btn_grid = GroupGrid()

        self.user_agree_checkBox = CheckBox(txt=USER_CHECK_REQUIRED)
        okBtn = Button({
            'txt': 'Create Account',
            'tt': 'Confirm to create an account',
            'cl': self.createBtnClicked
        })
        cancelBtn = Button({
            'txt':
            'Cancel',
            'tt':
            'Go back to Login stage',
            'cl':
            partial(self.signals.emit, 'showLayout', 'SignIn', 'SignIn')
        })
        quitBtn = Button({
            'txt': 'Quit',
            'tt': 'Quit the application',
            'cl': QApplication.quit
        })

        btn_grid.addWidget(self.user_agree_checkBox, 0, 0, 1, 6)
        btn_grid.addWidget(okBtn, 1, 0, 1, 2)
        btn_grid.addWidget(cancelBtn, 1, 2, 1, 2)
        btn_grid.addWidget(quitBtn, 1, 4, 1, 2)
예제 #7
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)
예제 #8
0
    def buildUI(self):
        self.lineInput = QLineEdit()
        self.suggessLabel = Label()

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

        self.answer = QTextEdit()

        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)
예제 #9
0
    def buildUI(self):
        self.scrollArea = QScrollArea()
        self.scrollArea.setWidgetResizable(True)
        TXT = """
            {0}
            
            Version will start from v13 and never change number 13.
            Current stage: Test Beta.
            Warning: Not stable, a lot of bugs.
            Status: Under developing
            
            """.format(VERSION)

        self.content = Label({'txt': TXT, 'alg': 'left', 'link': True})

        self.content.setGeometry(0, 0, 450, 150)
        self.scrollArea.setWidget(self.content)

        closeBtn = Button({
            'txt': 'Close',
            'tt': 'Close window',
            'cl': partial(self.showLayout.emit, self.key, 'hide')
        })

        self.layout.addWidget(self.scrollArea, 0, 0, 8, 4)
        self.layout.addWidget(closeBtn, 8, 3, 1, 1)
예제 #10
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
예제 #11
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
예제 #12
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 new avatar', 'cl': self.setAvaClicked})

        avatar_grid.addWidget(self.userAvatar, 0, 0, 2, 2)
        avatar_grid.addWidget(set_avatarBtn, 2, 0, 1, 2)
예제 #13
0
 def executingButton(self, key, parent):
     if key in self.mainInfo.keys():
         button = Button({
             'txt':
             self.mainInfo[key][0],
             'stt':
             self.mainInfo[key][2],
             'cl':
             partial(parent.signals.emit, 'executing', key),
         })
         button.key = '{0}_{1}_Button'.format(parent.key, key)
         button._name = button.key
         if button.key in self.buttonKeys:
             return self[button.key]
         else:
             button.Type = 'DAMGExecutingButton'
             self.register(button)
             return button
     else:
         return self.buttonConfigError(key)
예제 #14
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})]
                                   })
                        )
예제 #15
0
    def createButtonsLayout(self):
        self.newScreenshotButton = Button({
            'txt': "New Screenshot",
            'cl': self.newScreenshot
        })
        self.saveScreenshotButton = Button({
            'txt': "Save Screenshot",
            'cl': self.saveScreenshot
        })
        self.quitScreenshotButton = Button({
            'txt':
            "Quit",
            'cl':
            partial(self.showLayout.emit, self.key, 'hide')
        })

        self.buttonsLayout = QHBoxLayout()
        self.buttonsLayout.addStretch()
        self.buttonsLayout.addWidget(self.newScreenshotButton)
        self.buttonsLayout.addWidget(self.saveScreenshotButton)
        self.buttonsLayout.addWidget(self.quitScreenshotButton)
예제 #16
0
    def buildUI(self):
        self.scrollArea = QScrollArea()
        self.scrollArea.setWidgetResizable(True)
        self.content = Label({'txt':CONTRIBUTING, 'alg':'left', 'link': True})

        self.content.setGeometry(0, 0, 350, 400)
        self.scrollArea.setWidget(self.content)

        closeBtn = Button({'txt': 'Close', 'tt': 'Close window', 'cl': partial(self.showLayout.emit, self.key, 'hide')})

        self.layout.addWidget(self.scrollArea, 0, 0, 8, 4)
        self.layout.addWidget(closeBtn, 8, 3, 1, 1)
예제 #17
0
    def showLayoutButton(self, key, parent):
        if key in self.mainInfo.keys():
            if key in ['SignIn', 'SignOut', 'SignUp', 'SwitchAccount']:
                show = key
            else:
                show = 'show'

            button = Button({
                'txt':
                self.mainInfo[key][0],
                'stt':
                self.mainInfo[key][2],
                'cl':
                partial(parent.signals.emit, 'showLayout', key, show),
            })
            button.key = '{0}_{1}_Button'.format(parent.key, key)
            button._name = button.key
            if button.key in self.buttonKeys:
                return self[button.key]
            else:
                button._name = '{0} Button'.format(key)
                button.Type = 'DAMGShowLayoutButton'
                self.register(button)
                return button
        else:
            return self.buttonConfigError(key)
예제 #18
0
 def iconShowLayoutButton(self, key, parent):
     if key in self.mainInfo.keys():
         button = Button({
             'icon':
             key,
             'tt':
             self.mainInfo[key][2],
             'fix':
             BTNICONSIZE,
             'ics':
             ICONBTNSIZE,
             'cl':
             partial(parent.signals.emit, 'showLayout', key, 'show')
         })
         button.key = '{0}_{1}_Button'.format(parent.key, key)
         button._name = button.key
         if button.key in self.buttonKeys:
             return self[button.key]
         else:
             button._name = '{0} Button'.format(key)
             button.Type = 'DAMGOpenBrowserButton'
             self.register(button)
             return button
     else:
         return self.buttonConfigError(key)
예제 #19
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)
예제 #20
0
    def __init__(self, section, name="", parent=None):
        super(ItemWidget, self).__init__(parent)

        self.section = section

        self.item = Label({'txt': name})
        button = Button({
            'txt': "Edit",
            'stt': "Edit character name",
            'cl': self.setText
        })
        layout = QHBoxLayout()
        layout.addWidget(self.item)
        layout.addWidget(button)
        self.setLayout(layout)
예제 #21
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
예제 #22
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)
예제 #23
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
예제 #24
0
    def buildUI(self):
        self.basePth = os.getcwd() + ">"

        self.cmdBtn = Button({
            'txt': 'Run',
            'stt': 'Execute command',
            'cl': self.on_btn_clicked
        })
        # self.cmdBtn.clicked.connect(self.on_btn_clicked)
        # self.cmdBtn.setAutoDefault(True)

        self.terminal = Terminal()
        self.cmdConsole = CommandPrompt()
        self.cmdConsole.returnPressed.connect(self.cmdBtn.click)

        self.layout.addWidget(self.terminal, 0, 0, 4, 8)
        self.layout.addWidget(self.cmdConsole, 4, 0, 1, 6)
        self.layout.addWidget(self.cmdBtn, 4, 6, 1, 2)

        btn1 = Button({'txt': "Create New", 'stt': "Create django project"})
        btn2 = Button({'txt': "Create app", 'stt': "Create django app"})
        btn3 = Button({'txt': "Start Server", 'stt': "Operate running server"})
        btn4 = Button({'txt': "Save preset", 'stt': "Save app preset"})
        btn5 = Button({'txt': "Run Preset", 'stt': "Create data tables"})
        btn6 = Button({'txt': "Create SQL", 'stt': "Create database"})
        btn7 = Button({'txt': "Create Admin", 'stt': "Create Admin Account"})

        self.layout.addWidget(QLabel())

        self.layout.addWidget(btn1, 6, 0, 1, 2)
        self.layout.addWidget(btn2, 6, 2, 1, 2)
        self.layout.addWidget(btn3, 6, 4, 1, 2)
        self.layout.addWidget(btn4, 6, 6, 1, 2)
        self.layout.addWidget(btn5, 7, 0, 1, 2)
        self.layout.addWidget(btn6, 7, 2, 1, 2)
        self.layout.addWidget(btn7, 7, 4, 1, 2)

        self.applySetting()
예제 #25
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)
예제 #26
0
 def startFileButton(self, key, parent):
     if key in self.mainInfo.keys():
         button = Button({
             'txt': self.mainInfo[key][0],
             'stt': self.mainInfo[key][2],
             'cl': partial(os.startfile, key)
         })
         button.key = '{0}_{1}_Button'.format(parent.key, key)
         button._name = button.key
         if button.key in self.buttonKeys:
             return self[button.key]
         else:
             button._name = '{0} Button'.format(key)
             button.Type = 'DAMGStartFileButton'
             self.register(button)
             return button
     else:
         return self.buttonConfigError(key)
예제 #27
0
    def buildUI(self):

        btn1 = Button({
            'txt': 'New Project',
            'tt': 'Create New Project',
            'cl': partial(self.showLayout.emit, 'newProj', 'show')
        })
        btn2 = Button({
            'txt': 'New Group',
            'tt': 'Create New Group',
            'cl': partial(self.showLayout.emit, 'newGrp', 'show')
        })
        btn3 = Button({
            'txt': 'Your Projects',
            'tt': 'Your Projects',
            'cl': partial(self.showLayout.emit, 'yourPrj', 'show')
        })
        btn4 = Button({
            'txt': 'Find crew',
            'tt': 'Find crew',
            'cl': partial(self.showLayout.emit, 'findCrew', 'show')
        })
        btn5 = Button({
            'txt': 'Get crew',
            'tt': 'Check applicant',
            'cl': partial(self.showLayout.emit, 'getCrew', 'show')
        })
        btn6 = Button({
            'txt': 'Your crew',
            'tt': 'Your crew',
            'cl': partial(self.showLayout.emit, 'yourCrew', 'show')
        })

        sec1Grp = GroupBox("Project", [btn1, btn2, btn3], "BtnGrid")
        sec2Grp = GroupBox("Crew", [btn4, btn5, btn6], "BtnGrid")

        sec3Grp = QGroupBox('Info')
        sec3Grid = QGridLayout()
        sec3Grp.setLayout(sec3Grid)

        self.layout.addWidget(sec1Grp, 0, 0, 3, 3)
        self.layout.addWidget(sec2Grp, 3, 0, 3, 3)
        self.layout.addWidget(sec3Grp, 0, 3, 6, 6)
예제 #28
0
 def showRestoreButton(self, key, parent):
     if key in self.mainInfo.keys():
         button = Button({
             'txt':
             self.mainInfo[key][0],
             'stt':
             self.mainInfo[key][2],
             'cl':
             partial(parent.signals.emit, 'showLayout', key, 'showRestore'),
         })
         button.key = '{0}_{1}_Button'.format(parent.key, key)
         button._name = button.key
         if button.key in self.buttonKeys:
             return self[button.key]
         else:
             button._name = '{0} Button'.format(key)
             button.Type = 'DAMGShowNormalButton'
             self.register(button)
             return button
     else:
         return self.buttonConfigError(key)
예제 #29
0
 def tagOpenBrowserButton(self, tagName, parent):
     if tagName in self.tags.keys():
         button = Button({
             'tag':
             tagName,
             'fix':
             BTNTAGSIZE,
             'ics':
             TAGBTNSIZE,
             'cl':
             partial(parent.signals.emit, 'openBrowser', self.tags[tagName])
         })
         button.key = '{0}_{1}_Button'.format(parent.key, tagName)
         button._name = button.key
         if button.key in self.buttonKeys:
             return self[button.key]
         else:
             button._name = '{0} Button'.format(tagName)
             button.Type = 'DAMGOpenBrowserButton'
             self.register(button)
             return button
     else:
         return self.buttonConfigError(tagName)
예제 #30
0
    def buildUI(self):

        MESSAGE = "DUE TO THE POSSIBILITY OF USING RENDER FARM SERVICE, PLEAE SET PROJECT PATH TO E DRIVE\n " \
                  "IF YOU DO NOT USE RENDER FARM, DRIVE E IS STILL PREFER."

        TITLE = "SET UP NEW PROJECT"

        # Title
        headGrp, headGrid = self.styleGB()
        headGrid.addWidget(Label({'txt': TITLE}))

        # Project Info
        prjInfGrp, prjInfGrid = self.styleGB("Project Info")

        self.prjLong = QLineEdit("DAMG team project")
        self.prjShort = QLineEdit("damg")
        self.prjPth = QLineEdit("E:/")

        setPthBtn = Button({
            'txt': "Set Path",
            'stt': "Set project path",
            'cl': self.onSetPthBtnClicked
        })

        prjInfGrid.addWidget(Label({'txt': "Project Name"}), 0, 0, 1, 1)
        prjInfGrid.addWidget(self.prjLong, 0, 1, 1, 1)
        prjInfGrid.addWidget(Label({'txt': "Abbreviated as"}), 0, 2, 1, 1)
        prjInfGrid.addWidget(self.prjShort, 0, 3, 1, 1)
        prjInfGrid.addWidget(setPthBtn, 1, 0, 1, 1)
        prjInfGrid.addWidget(self.prjPth, 1, 1, 1, 3)

        # Notice!!!
        noticeGrp, noticeGrid = self.styleGB("NOTE!!!")
        noticeGrid.addWidget(Label({'txt': MESSAGE}), 0, 0, 1, 4)

        # Project details
        prjDetailGrp, prjDetailGrid = self.styleGB("Project Details")

        self.prjMode = QComboBox()
        self.prjMode.addItem("Studio Mode")
        self.prjMode.addItem("Group Mode")

        self.numOfChar = QLineEdit("1")
        self.numOfChar.setValidator(QIntValidator())
        self.numOfChar.textChanged.connect(partial(self.populate_lst, "char"))

        self.numOfEnv = QLineEdit("1")
        self.numOfEnv.setValidator(QIntValidator())
        self.numOfEnv.textChanged.connect(partial(self.populate_lst, "env"))

        self.numOfProp = QLineEdit("1")
        self.numOfProp.setValidator(QIntValidator())
        self.numOfProp.textChanged.connect(partial(self.populate_lst, "prop"))

        self.numOfSeq = QLineEdit("1")
        self.numOfSeq.setValidator(QIntValidator())
        self.numOfSeq.textChanged.connect(partial(self.populate_lst, "seq"))

        prjDetailGrid.addWidget(Label({'txt': "Project Mode"}), 0, 0, 1, 1)
        prjDetailGrid.addWidget(self.prjMode, 0, 1, 1, 1)
        prjDetailGrid.addWidget(Label({'txt': "Character: "}), 1, 0, 1, 1)
        prjDetailGrid.addWidget(self.numOfChar, 2, 0, 1, 1)
        prjDetailGrid.addWidget(Label({'txt': "Environment: "}), 1, 1, 1, 1)
        prjDetailGrid.addWidget(self.numOfEnv, 2, 1, 1, 1)
        prjDetailGrid.addWidget(Label({'txt': "Props: "}), 1, 2, 1, 1)
        prjDetailGrid.addWidget(self.numOfProp, 2, 2, 1, 1)
        prjDetailGrid.addWidget(Label({'txt': "Sequences: "}), 1, 3, 1, 1)
        prjDetailGrid.addWidget(self.numOfSeq, 2, 3, 1, 1)

        # Asset details
        charGrp, self.charLst = self.styleGBLst("Character List")
        envGrp, self.envLst = self.styleGBLst("Environment List")
        propGrp, self.propLst = self.styleGBLst("Props List")

        # Shot details
        seqGrp, self.seqLst = self.styleGBLst("Sequences List")

        # Buttons
        btnGrp, btnGrid = self.styleGB()

        prjLstBtn = Button({'txt': "Project List", 'stt': "Project List"})
        crewLstBtn = Button({'txt': "Crews List", 'stt': "Crews List"})
        newPrjBtn = Button({
            'txt': "Create Project",
            'stt': "Create New Project"
        })
        cancelBtn = Button({'txt': "Cancel", 'stt': "Cancel"})

        btnGrid.addWidget(prjLstBtn, 0, 0)
        btnGrid.addWidget(crewLstBtn, 0, 1)
        btnGrid.addWidget(newPrjBtn, 0, 2)
        btnGrid.addWidget(cancelBtn, 0, 3)

        self.layout.addWidget(headGrp, 0, 0, 1, 4)
        self.layout.addWidget(prjInfGrp, 1, 0, 2, 4)
        self.layout.addWidget(noticeGrp, 3, 0, 1, 4)
        self.layout.addWidget(prjDetailGrp, 5, 0, 3, 4)
        self.layout.addWidget(charGrp, 8, 0, 1, 1)
        self.layout.addWidget(envGrp, 8, 1, 1, 1)
        self.layout.addWidget(propGrp, 8, 2, 1, 1)
        self.layout.addWidget(seqGrp, 8, 3, 1, 1)
        self.layout.addWidget(btnGrp, 9, 0, 1, 4)

        self.applySetting()