Exemple #1
0
    def __init__(self, erd, transactions):
        super(TransactionsEditor, self).__init__()
        self.set_margin(20)

        self.transactions = transactions
        self.erd = erd

        self._transaction_list = ControlList()
        self._add_transaction_button = ControlButton('Dodaj transakcję')
        self._edit_transaction_button = ControlButton('Edytuj transakcję')
        self._remove_transaction_button = ControlButton('Usuń transakcję')

        self._add_transaction_button.value = self.__add_transaction_action
        self._edit_transaction_button.value = self.__edit_transaction_action
        self._remove_transaction_button.value = self.__remove_transaction_action

        self._transaction_list.readonly = True

        self.formset = [
            '_transaction_list',
            ('_add_transaction_button', '_edit_transaction_button',
             '_remove_transaction_button')
        ]

        self.populate()
Exemple #2
0
    def __init__(self, erd, project, rules):
        super(Stage4Window, self).__init__('Etap 4')
        self.set_margin(20)

        self._entities_combo = CustomEntityCombo(erd.entities)
        self._rules_list = ControlList()
        self._add_rule_button = ControlButton('Dodaj regułę')
        self._fix_button = ControlButton('Popraw regułę')
        self._remove_rule_button = ControlButton('Usuń regułę')
        self._save_button = ControlButton('Zapisz')

        self.erd = erd
        self._project = project
        self.rules = rules

        self._save_button.value = self.__save_action
        self._fix_button.value = self.__fix_action
        self._add_rule_button.value = self.__add_rule_action
        self._remove_rule_button.value = self.__remove_rule_action
        self._rules_list.readonly = True
        self._entities_combo.parent = self

        self.formset = ['Etap 4 - popraw odmianę w automatycznie wygenerowanych regułach i dopisz kilka własnych',
                        ('Wyświetlam reguły dla kategorii: ', '_entities_combo'), '_rules_list', ('_add_rule_button', '_fix_button', '_remove_rule_button'), '_save_button']

        if not rules:
            self.populate_rules()

        self.populate()
Exemple #3
0
    def __init__(self, erd):
        super(ForeignKeysEditor, self).__init__()

        self.erd = erd

        if self.erd.entities:
            self.entity = self.erd.entities[0]
        else:
            self.entity = Entity('', '', [])

        self._keys_list = ControlList()
        self._entity_combo = EntityCombo(self.erd.entities)
        self._entity_combo.parent = self
        self._add_fk_button = ControlButton('Dodaj klucz obcy')
        self._edit_fk_button = ControlButton('Edytuj klucz obcy')
        self._remove_fk_button = ControlButton('Usuń klucz obcy')

        self._add_fk_button.value = self.__add_fk_action
        self._edit_fk_button.value = self.__edit_fk_action
        self._remove_fk_button.value = self.__remove_fk_action

        self._keys_list.readonly = True

        self.formset = [
            'Etap 10 - sprawdz automatycznie wygenerowane klucz obce i w razie potrzeby je popraw',
            ('Wyświetlam klucz obec dla encji: ', '_entity_combo'),
            '_keys_list',
            ('_add_fk_button', '_edit_fk_button', '_remove_fk_button')
        ]

        self.populate()
Exemple #4
0
 def __init__(self, msg, yes_action=None, no_action=None, \
              title='PyGitLatex Dialog'):
     super(YesNoDialog,self).__init__(title)
     self.yes_action = yes_action
     self.no_action = no_action
     self.btnYes = ControlButton('Yes')
     self.btnYes.value = self.yes_clicked
     self.btnNo = ControlButton('No')
     self.btnNo.value = self.no_clicked
     self.set_margin(10)
     self.formset = [msg,(' ','btnYes','btnNo',' ')]
Exemple #5
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')]
Exemple #7
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()
Exemple #8
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()
Exemple #9
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()
Exemple #10
0
    def __init__(self, erd, project):
        super(Stage8Window, self).__init__()
        self.set_margin(20)
        self.erd = erd
        self.project = project

        self._save_button = ControlButton('Zapisz')

        self._save_button.value = self.__save_action

        self.formset = ['Etap 8 - wszystkie dane są już uzupełnione, wystarczy że naciścniesz zapisz', '_save_button']
Exemple #11
0
    def __init__(self, erd, project):
        super(Stage12Window, self).__init__()
        self.set_margin(20)

        self.erd = erd
        self.project = project

        self._label = ControlLabel('Etap 12')
        self._save_button = ControlButton('Zapisz')

        self._save_button.value = self.__save_action

        self.formset = ['_label', '_save_button']
    def __init__(self, perspectives, users):
        super(PerspectivesEditor, self).__init__()
        self.set_margin(20)

        self.perspectives = perspectives
        self.users = users

        self._perspectives_list = ControlList()
        self._add_perspective_button = ControlButton('Dodaj perspektywę')
        self._edit_perspective_button = ControlButton('Edytuj perspektywę')
        self._remove_perspective_button = ControlButton('Usuń perspektywę')

        self._add_perspective_button.value = self.__add_perspective_action
        self._edit_perspective_button.value = self.__edit_perspective_action
        self._remove_perspective_button.value = self.__remove_perspective_action

        self._perspectives_list.readonly = True

        self.formset = ['_perspectives_list',
                        ('_add_perspective_button', '_edit_perspective_button', '_remove_perspective_button')]

        self.populate()
Exemple #13
0
    def __init__(self, erd, project):
        super(Stage11Window, self).__init__()
        self.set_margin(20)
        self.erd = erd
        self.project = project

        self._label = ControlLabel(
            'W tym etapie nie musisz niczego poprawiać, po prostu kliknij zapisz :)'
        )
        self._save_button = ControlButton('Zapisz')
        self._save_button.value = self.__save_action

        self.formset = ['_label', '_save_button']
Exemple #14
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()
    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()
Exemple #16
0
 def __init__(self, repo):
     super(GitAddFiles,self).__init__('Git: Add Files')
     self.repo = repo
     self.lstModFiles = ControlList('Modified Files:')
     self.lstModFiles.readonly = True
     for item in self.repo.index.diff(None):
         self.lstModFiles += [item.a_path]
     self.lstNewFiles = ControlList('Untracked Files:')
     self.lstNewFiles.readonly = True
     for file in self.repo.untracked_files:
         self.lstNewFiles += [file]
     self.btnAddFiles = ControlButton('Add Files')
     self.btnAddFiles.value = self.add_files
     self.btnAddAllFiles = ControlButton('Add All Files')
     self.btnAddAllFiles.value = self.add_all_files
     self.btnCancel = ControlButton('Cancel')
     self.btnCancel.value = self.close
     self.set_margin(10)
     self.formset = ['info:Select files to add to the project.', \
                     'lstModFiles', \
                     'lstNewFiles', \
                     ('btnAddAllFiles','btnAddFiles'), \
                     'btnCancel']
Exemple #17
0
    def __init__(self, erd, entity=None, attribute=None):
        super(ForeignKeyEditor, self).__init__()

        self.erd = erd
        self.entity = entity
        self.attribute = attribute

        self._fk_entity_combo = EntityCombo(self.erd.entities)
        self._fk_entity_combo.parent = self
        self._save_button = ControlButton('Zapisz')
        self._save_button.value = self.__save_action

        self.populate()

        self.formset = ['_fk_entity_combo', '_save_button']
Exemple #18
0
    def __init__(self, erd, project):
        super(Stage10Window, self).__init__()
        self.set_margin(20)
        self.erd = erd
        self.project = project

        self._editor = ControlEmptyWidget()
        self._editor.value = ForeignKeysEditor(self.erd)

        self._save_button = ControlButton('Zapisz')
        self._save_button.value = self.__save_action

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

        add_foreign_keys(self.erd)
Exemple #19
0
    def __init__(self, erd, transactions, users, perspectives, rules):
        super(InitialDataEditor,
              self).__init__('Edytor podstawowych danych projektu')
        self.set_margin(10)

        self.erd = erd
        self.transactions = transactions
        self.users = users
        self.perspectives = perspectives
        self.rules = rules

        self._label = ControlLabel(
            'W tym oknie wpisz podstawowe dane dotyczące Twojego projektu')
        self._erd_button = ControlButton('ERD')
        self._transactions_button = ControlButton('Transakcje')
        self._users_button = ControlButton('Użytkownicy')
        self._perspectives_button = ControlButton('Perspektywy')
        self._panel = ControlEmptyWidget()

        self._erd_button.value = self.__erd_action
        self._transactions_button.value = self.__transactions_action
        self._users_button.value = self.__users_action
        self._perspectives_button.value = self.__perspectives_action

        self.formset = [
            '_label',
            (
                '_erd_button',
                # '_users_button',
                # '_transactions_button',
                # perspectives editor commented out for now

                # '_perspectives_button'
            ),
            '_panel'
        ]
Exemple #20
0
    def __init__(self, project):
        super(Stage5Window, self).__init__('Etap 5')
        self.set_margin(40)

        self._save_button = ControlButton('Zapisz')

        self._project = project

        self._save_button.value = self.__save_action

        self._project = project

        self.stage = self._project.get_stage(5)

        self.formset = ['Generowanie etapu 5 nie zostało jeszcze zaimplementowane - w projekcie znajdzie się tylko nagłówek z tytułem etapu', '_save_button']
Exemple #21
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()
Exemple #22
0
    def __init__(self, erd, users):
        super(UsersEditor, self).__init__()
        self.set_margin(20)

        self.users = users
        self.erd = erd

        self._user_list = ControlList()
        self._add_user_button = ControlButton('Dodaj użytkownika')
        self._edit_user_button = ControlButton('Edytuj użytkownika')
        self._remove_user_button = ControlButton('Usuń użytkownika')

        self._add_user_button.value = self.__add_user_action
        self._edit_user_button.value = self.__edit_user_action
        self._remove_user_button.value = self.__remove_user_action

        self._user_list.readonly = True

        self.formset = [
            '_user_list',
            ('_add_user_button', '_edit_user_button', '_remove_user_button')
        ]

        self.populate()
Exemple #23
0
    def __init__(self, erd, project):
        super(Stage3Window, self).__init__('Etap 3')
        self.set_margin(40)

        self._save_button = ControlButton('Zapisz')

        self.erd = erd
        self._project = project

        self._save_button.value = self.__save_action

        self._project = project

        self.stage = self._project.get_stage(3)

        self.formset = ['Wszystko już gotowe, naciśnij zapisz', '_save_button']
Exemple #24
0
    def __init__(self, erd, transactions, project):
        super(Stage6Window, self).__init__()
        self.set_margin(20)

        self._label = ControlLabel(
            'Generowanie etapu 6 nie zostało jeszcze zaimplementowane - w projekcie znajdzie się tylko nagłówek z tytułem etapu'
        )
        self._save_button = ControlButton('Zapisz')

        self._save_button.value = self.__save_action

        self.erd = erd
        self.transactions = transactions

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

        self._project = project
Exemple #25
0
    def __init__(self, erd, project, rules):
        super(Stage7Window, self).__init__()
        self.set_margin(20)
        self.erd = erd
        self.project = project
        self.rules = rules

        self._entities_relationships_list = ControlList()
        self._save_button = ControlButton('Zapisz')

        self._entities_relationships_list.readonly = True
        self._save_button.value = self.__save_action

        self.populate()

        self.formset = [
            'Etap 7, definicje encji i związków - sprawdz czy wszystkie encje i związki znajdują się na liście, w razie potrzeby popraw błędy w edytorze ERD',
            '_entities_relationships_list', '_save_button'
        ]
Exemple #26
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()
Exemple #27
0
    def __init__(self, erd):
        super(
            ErdReader,
            self,
        ).__init__('ERD reader')
        self.set_margin(20)

        self.erd = erd

        self._entity_list = ControlList('Encje', "1")

        self._relationship_list = ControlList('Związki', '1')

        self._entity_editor = ControlEmptyWidget()
        self._relationship_editor = ControlEmptyWidget()

        self._add_entity_button = ControlButton(u'Dodaj encję')
        self._edit_entity_button = ControlButton(u'Edytuj encję')
        self._remove_entity_button = ControlButton(u'Usuń encję')
        self._add_relationship_button = ControlButton(u'Dodaj związek')
        self._edit_relationship_button = ControlButton(u'Edytuj związek')
        self._remove_relationship_button = ControlButton(u'Usuń związek')

        self._add_entity_button.value = self.__add_entity_action
        self._add_relationship_button.value = self.__add_relationship_action
        self._edit_entity_button.value = self.__edit_entity_action
        self._edit_relationship_button.value = self.__edit_relationship_action
        self._remove_entity_button.value = self.__remove_entity_action
        self._remove_relationship_button.value = self.__remove_relationship_action

        self.formset = [
            '_entity_list',
            ('_add_entity_button', '_edit_entity_button',
             '_remove_entity_button'),
            '_entity_editor',
            '_relationship_list',
            ('_add_relationship_button', '_edit_relationship_button',
             '_remove_relationship_button'),
            '_relationship_editor',
        ]

        self._entity_list.readonly = True
        self._entity_list.select_entire_row = True
        self._relationship_list.readonly = True
        self._relationship_list.select_entire_row = True

        self._populate()
Exemple #28
0
    def __init__(self, project):
        super(Stage1Window, self).__init__('Etap 1')
        self.set_margin(20)

        self._topic_edit_text = ControlTextArea('Temat')
        self._objective_edit_text = ControlTextArea('Cel')
        self._range_edit_text = ControlTextArea('Zakres')
        self._users_edit_text = ControlTextArea(u'Użytkownicy')
        self._save_button = ControlButton('Zapisz')

        self._save_button.value = self.__save_action

        self._project = project

        self.stage = self._project.stages[1]

        self.populate()

        self.formset = [
            '_topic_edit_text', '_objective_edit_text', '_range_edit_text',
            '_users_edit_text', '_save_button'
        ]
Exemple #29
0
    def __init__(self, project):
        super(Stage2Window, self).__init__('Etap 2')
        self.set_margin(20)

        self._reality_description_text_edit = ControlTextArea('Szczegółowy opis wycinka rzeczywistości')
        self._dictionary_text_edit = ControlTextArea('Słownik pojęć')
        self._users_text_edit = ControlTextArea('Użytkownicy i zakres uprawnień')
        self._functional_requirements_text_edit = ControlTextArea('Wymagania funkcjonalne')
        self._nonfunctional_requirements_text_edit = ControlTextArea('Wymagania niefunkcjonalne')
        self._existing_database_text_edit = ControlTextArea('Analiza isniejącej bazy danych')
        self._cost_text_edit = ControlTextArea('Analiza kosztów')
        self._save_button = ControlButton('Zapisz')

        self._save_button.value = self.__save_action

        self._project = project

        self.stage = self._project.stages[2]

        self.populate()

        self.formset = ['_reality_description_text_edit', '_dictionary_text_edit', '_users_text_edit',
                        '_functional_requirements_text_edit', '_nonfunctional_requirements_text_edit',
                        '_existing_database_text_edit', '_cost_text_edit', '_save_button']
Exemple #30
0
 def __init__(self, msg, title='PyGitLatex Message'):
     super(MessageWindow, self).__init__(title)
     self.btnOk = ControlButton('Okay')
     self.btnOk.value = self.close
     self.set_margin(10)
     self.formset = [msg,(' ','btnOk',' ')]