示例#1
0
    def __init__(self, erd, transactions, transaction=None):
        super(TransactionEditor, self).__init__()
        self.set_margin(10)
        self.transactions = transactions
        self.erd = erd

        self._name_edit_text = ControlText('Nazwa transakcji')
        self._entity_combo = ControlCombo()
        self._type_combo = TypeCombo(self._entity_combo)
        self._description_edit_text = ControlText('Opis transakcji')
        self._conditions_edit_text = ControlText('Uwarunkowania transakcji')
        self._save_button = ControlButton('Zapisz transakcję')
        self._save_button.value = self.__save_action

        self._type_combo.add_item(Transaction.OTHER)
        self._type_combo.add_item(Transaction.ADD)
        self._type_combo.add_item(Transaction.EDIT)
        self._type_combo.add_item(Transaction.REMOVE)

        for entity in self.erd.entities:
            self._entity_combo.add_item(entity.name_singular)

        self._entity_combo.setVisible(False)

        self.formset = [
            '_name_edit_text', '_type_combo', '_entity_combo',
            '_description_edit_text', '_conditions_edit_text', '_save_button'
        ]

        if transaction is not None:
            self.transaction = transaction
        else:
            self.transaction = Transaction('', '', '')

        self.populate()
示例#2
0
    def __init__(self, attributes, attribute=None):
        super(AttributeEditor, self).__init__()
        self.set_margin(10)

        self.attributes = attributes
        self.attribute = attribute

        self._name_edit_text = ControlText()
        self._type_combo = ControlCombo()
        self._description_edit_text = ControlText('Opis')
        self._is_key_checkbox = ControlCheckBox('Czy kluczowy')
        self._is_obligatory_checkbox = ControlCheckBox(
            u'Atrybut obligatoryjny (brak zaznaczenia - opcjonalny)')
        self._is_unique_checkbox = IsUniqueCheckBox(self._is_key_checkbox)
        self._save_attribute_button = ControlButton('Zapisz')

        self._save_attribute_button.value = self.__save_attribute_action

        self.formset = [('Nazwa: ', '_name_edit_text'),
                        ('Typ: ', '_type_combo'), '_description_edit_text',
                        '_is_key_checkbox', '_is_obligatory_checkbox',
                        '_is_unique_checkbox', '_save_attribute_button']

        self._type_combo.add_item(Types.INT.name, Types.INT)
        self._type_combo.add_item(Types.INT_POSITIVE.name, Types.INT_POSITIVE)
        self._type_combo.add_item(Types.INT_NEGATIVE.name, Types.INT_NEGATIVE)
        self._type_combo.add_item(Types.DATE.name, Types.DATE)
        self._type_combo.add_item(Types.STRING.name, Types.STRING)

        self.populate()
示例#3
0
    def __init__(self, erd, relationship=None):
        super(RelationshipEditor, self).__init__()
        self.set_margin(10)
        self.erd = erd

        self._left_entity_combo = ControlCombo()
        self._left_multiplicity_combo = ControlCombo()
        self._relationship_name_edit_text = ControlText()
        self._right_multiplicity_combo = ControlCombo()
        self._right_entity_combo = ControlCombo()
        self._save_button = ControlButton(u'Zapisz')

        self._save_button.value = self.__save_relationship_action

        for entity in erd.entities:
            self._left_entity_combo.add_item(entity.name_singular)
            self._right_entity_combo.add_item(entity.name_singular)
        multiplicities = ['0,1', '1,1', '0,N', '1,N']
        for mul in multiplicities:
            self._left_multiplicity_combo.add_item(mul)
            self._right_multiplicity_combo.add_item(mul)

        self.formset = [('_left_entity_combo', '_left_multiplicity_combo',
                         '_relationship_name_edit_text',
                         '_right_multiplicity_combo', '_right_entity_combo'),
                        '_save_button']

        if relationship is not None:
            self.relationship = relationship
        else:
            self.relationship = Relationship('', '', '', '', '')

        self.populate()
示例#4
0
 def __init__(self, repo):
     super(GitCommit,self).__init__('Git: Commit message')
     self.repo = repo
     self.txtCommitMsg = ControlText()
     self.btnCommit = ControlButton('Commit')
     self.btnCommit.value = self.git_commit
     self.btnCancel = ControlButton('Cancel')
     self.btnCancel.value = self.close
     self.set_margin(10)
     self.formset = ['info:Input a commit message', \
                     'txtCommitMsg',('btnCommit','btnCancel')]
 def __init__(self):
     super(GitAskPass, self).__init__('Git: Authentication')
     #self.repo = repo
     self.txtInput = ControlText()
     self.txtInput.form.lineEdit.setEchoMode(QLineEdit.Password)
     self.txtInput.key_pressed_event = self.check_for_enter
     self.btnSubmit = ControlButton('Submit')
     self.btnSubmit.value = self.submit
     self.btnCancel = ControlButton('Cancel')
     self.btnCancel.value = self.cancel
     self.set_margin(10)
     self.formset = ['info:'+sys.argv[1], 'txtInput', \
                     ('btnSubmit','btnCancel')]
示例#6
0
    def __init__(self, erd, entity=None):
        super(EntityEditor, self).__init__()
        self.set_margin(10)

        self.erd = erd
        if entity is not None:
            self.entity = self.erd.get_entity_by_name(entity)
        else:
            self.entity = Entity('', '', [])

        self._entity_name_singular = ControlText()
        self._entity_name_plural = ControlText()
        self._add_attribute_button = ControlButton(u'Dodaj atrybut')
        self._edit_attribute_button = ControlButton(u'Edytuj atrybut')
        self._remove_attribute_button = ControlButton(u'Usuń atrybut')
        self._attributes_list = ControlList()
        self._description_edit_text = ControlText()
        self._is_strong_checkbox = ControlCheckBox(
            u'Jest silna (brak zaznaczenia - słaba)')
        self._save_entity_button = ControlButton(u'Zapisz')

        self._add_attribute_button.value = self.__add_attribute_button_action
        self._edit_attribute_button.value = self.__edit_attribute_button_action
        self._remove_attribute_button.value = self.__remove_attribute_action
        self._save_entity_button.value = self.__save_entity_button_action

        self._attributes_list.readonly = True

        self.formset = [
            (u'Nazwa encji (liczba pojedyńcza): ', '_entity_name_singular'),
            (u'Nazwa encji (liczba mnoga):', '_entity_name_plural'),
            ('Opis encji: ', '_description_edit_text'),
            ('Atrybuty: ', '_attributes_list', '_add_attribute_button',
             '_edit_attribute_button', '_remove_attribute_button'),
            '_is_strong_checkbox', '_save_entity_button'
        ]

        self.populate()
示例#7
0
    def __init__(self, perspectives, perspective=None):
        super(PerspectiveEditor, self).__init__()
        self.perspectives = perspectives

        if perspective is not None:
            self.perspective = perspective
        else:
            self.perspective = Perspective('', [], None)

        self._name_edit_text = ControlText('Nazwa perspektywy')
        self._save_button = ControlButton('Zapisz')
        self._save_button.value = self.__save_action

        self.populate()
示例#8
0
    def __init__(self, erd, users, user=None):
        super(UserEditor, self).__init__()
        self.users = users
        self.erd = erd

        if user is not None:
            self.user = user
        else:
            self.user = User('', '')

        self._name_edit_text = ControlText('Nazwa użytkownika')
        self._save_button = ControlButton('Zapisz')
        self._save_button.value = self.__save_action

        self.populate()
示例#9
0
    def __init__(self, rules, rule=None, entity=''):
        super(RuleEditor, self).__init__()
        self.set_margin(20)

        self.rules = rules

        self._rule_content_edit_text = ControlText()
        self._save_button = ControlButton('Zapisz')

        if rule is None:
            self.rule = Rule('', left_entity_name=entity, right_entity_name='')
        else:
            self.rule = rule

        self._save_button.value = self.__save_action

        self.formset = ['', '_rule_content_edit_text', '_save_button']

        self.populate()
示例#10
0
    def __init__(self):
        super(PyGitLatex,self).__init__('PyGitLatex')
        
        # basic data attributes
        
        self.repo = None
        self.rgit = None
        self.remote_name = 'origin'
        self.branch_name = 'master'
        self.local_proj_name = None

        # define controls
        
        self.dirProjectDir = ControlDir('Project Directory')
        self.dirProjectDir.click = self.set_project_dir
        
        self.btnGitStatus = ControlButton('Status')
        self.btnGitStatus.value = self.git_status
        self.btnGitAdd = ControlButton('Add')
        self.btnGitAdd.value = self.git_add
        self.btnGitCommit = ControlButton('Commit')
        self.btnGitCommit.value = self.git_commit
        self.btnGitLog = ControlButton('Log')
        self.btnGitLog.value = self.git_log
        self.btnGitPull = ControlButton('Pull')
        self.btnGitPull.value = self.git_pull
        self.btnGitPush = ControlButton('Push')
        self.btnGitPush.value = self.git_push
        self.txaGitConsole = ControlTextArea('Git Output')
        self.txtGitCommand = ControlText('Git Command')
        self.txtGitCommand.key_pressed_event = self.check_git_command_event
        self.btnGitRun = ControlButton('Run Command')
        self.btnGitRun.value = self.parse_git_command
        self.btnGitClear = ControlButton('Clear Ouput')
        self.btnGitClear.value = self.clear_git_console
        
        self.filTexFile = ControlFile('Latex File')
        self.btnTexCompile = ControlButton('Compile')
        self.btnTexView = ControlButton('View')
        self.btnTexEdit = ControlButton('Edit')
        self.btnTexBlame = ControlButton('Blame')
        self.btnTexSrcDiff = ControlButton('Source Diff')
        self.btnTexPdfDiff = ControlButton('PDF Diff')
        self.txaTexConsole = ControlTextArea('Latex Output')
        self.txtTexCommand = ControlText('Latex Command')
        self.btnTexRun = ControlButton('Run Command')
        self.btnTexClear = ControlButton('Clear Ouput')
        
        # set up the layout of the GUI
        
        self.set_margin(10)
        self.formset = [ \
            'dirProjectDir', \
            {'a:Git':
                [('btnGitStatus','btnGitAdd','btnGitCommit'), \
                 ('btnGitLog','btnGitPull','btnGitPush'), \
                 'txaGitConsole', \
                 'txtGitCommand', \
                 (' ','btnGitClear','btnGitRun')], \
             'b:Latex':
                ['filTexFile', \
                 ('btnTexCompile','btnTexView','btnTexEdit'), \
                 ('btnTexBlame','btnTexSrcDiff','btnTexPdfDiff'),\
                 'txaTexConsole', \
                 'txtTexCommand', \
                 (' ','btnTexClear','btnTexRun')] \
            } \
        ]
        self.mainmenu = [ \
            {'File': [{'Initialize Project':self.init_project}, \
                      {'Clone Project':self.clone_project}, \
                      '-', \
                      {'Exit':self.exit_app}] \
            } \
        ]