Use a single data field for gitlab repos

Julien LepillerThu Aug 22 18:08:41+0200 2019

0f98ff0

Use a single data field for gitlab repos

offlate/systems/git.py

5555
        os.remove(self.basedir + "/old")
5656
5757
    def send(self, interface):
58-
        pass
58+
        raise Exception("Unimplemented method in concrete class: send")
5959
6060
    def save(self):
61-
        pass
61+
        raise Exception("Unimplemented method in concrete class: save")
6262
6363
    def content(self):
6464
        return {'default': []}

offlate/systems/gitlab.py

2222
        GitProject.__init__(self, conf, name, lang, data)
2323
2424
    def updateURI(self):
25-
        self.uri = self.data['site'] + "/" + self.data['project'] + ".git"
25+
        self.uri = self.data['repo']

offlate/ui/new.py

100100
            'widget': self.transifexOrganisation})
101101
102102
        # Gitlab
103-
        self.gitlabSite = QLineEdit()
104-
        self.gitlabSite.textChanged.connect(self.modify)
105-
        gitlabSiteLabel = QLabel(self.tr('hosting website'))
106-
        self.additionalFields[GITLAB].append({'label': gitlabSiteLabel,
107-
            'widget': self.gitlabSite})
108-
        self.gitlabProject = QLineEdit()
109-
        self.gitlabProject.textChanged.connect(self.modify)
110-
        gitlabProjectLabel = QLabel(self.tr('project part'))
111-
        self.additionalFields[GITLAB].append({'label': gitlabProjectLabel,
112-
            'widget': self.gitlabProject})
113-
        self.gitlabFileTypeCombo = QComboBox()
114-
        self.gitlabFileTypeCombo.addItem(format_list[0])
115-
        self.gitlabFileTypeCombo.addItem(format_list[1])
116-
        self.gitlabFileTypeCombo.addItem(format_list[2])
117-
        self.gitlabFileTypeCombo.currentIndexChanged.connect(self.modify)
118-
        gitlabFileTypeLabel = QLabel(self.tr('Translation type'))
119-
        self.additionalFields[GITLAB].append({'label': gitlabFileTypeLabel,
120-
            'widget': self.gitlabFileTypeCombo})
121-
        self.gitlabLocations = MultipleLineEdit()
122-
        self.gitlabLocations.textChanged.connect(self.modify)
123-
        gitlabLocationsLabel = QLabel(self.tr('Locations'))
124-
        self.additionalFields[GITLAB].append({'label': gitlabLocationsLabel,
125-
            'widget': self.gitlabLocations})
103+
        self.gitlabRepo = QLineEdit()
104+
        self.gitlabRepo.textChanged.connect(self.modify)
105+
        gitlabRepoLabel = QLabel(self.tr('repository'))
106+
        self.additionalFields[GITLAB].append({'label': gitlabRepoLabel,
107+
            'widget': self.gitlabRepo})
126108
        if self.system == GITLAB:
127-
            self.gitlabSite.setText(self.info['site'])
128-
            self.gitlabProject.setText(self.info['project'])
129-
            self.gitlabFileTypeCombo.setCurrentIndex(self.info['format'])
130-
            self.gitlabLocations.setText(self.info['locations'])
109+
            self.gitlabRepo.setText(self.info['repo'])
131110
132111
        self.setLayout(hbox)
133112

150129
        if data['system'] == TRANSIFEX:
151130
            self.transifexOrganisation.setText(data['organisation'])
152131
        if data['system'] == GITLAB:
153-
            self.gitlabSite.setText(data['site'])
154-
            self.gitlabProject.setText(data['project'])
155-
            self.gitlabFileTypeCombo.setCurrentIndex(data['format'])
156-
            self.gitlabLocations.setText(data['locations'])
132+
            self.gitlabRepo.setText(data['repo'])
157133
158134
    def filter(self):
159135
        search = self.searchfield.text()