146 self.__uninstallButton.setEnabled( |
146 self.__uninstallButton.setEnabled( |
147 self.locationComboBox.count() > 0 and |
147 self.locationComboBox.count() > 0 and |
148 len([itm |
148 len([itm |
149 for itm in self.dictionariesList.selectedItems() |
149 for itm in self.dictionariesList.selectedItems() |
150 if itm.checkState() == Qt.Checked |
150 if itm.checkState() == Qt.Checked |
151 ]) |
151 ]) |
152 ) |
152 ) |
153 |
153 |
154 @pyqtSlot(bool) |
154 @pyqtSlot(bool) |
155 def on_dictionariesUrlEditButton_toggled(self, checked): |
155 def on_dictionariesUrlEditButton_toggled(self, checked): |
156 """ |
156 """ |
327 Note: A dictionary is assumed to be installed, if at least one of its |
327 Note: A dictionary is assumed to be installed, if at least one of its |
328 binary dictionaries (*.bdic) is found in the selected dictionaries |
328 binary dictionaries (*.bdic) is found in the selected dictionaries |
329 location. |
329 location. |
330 """ |
330 """ |
331 if self.locationComboBox.currentText(): |
331 if self.locationComboBox.currentText(): |
332 installedLocales = set([ |
332 installedLocales = { |
333 os.path.splitext(os.path.basename(dic))[0] |
333 os.path.splitext(os.path.basename(dic))[0] |
334 for dic in glob.glob( |
334 for dic in glob.glob( |
335 os.path.join(self.locationComboBox.currentText(), "*.bdic") |
335 os.path.join(self.locationComboBox.currentText(), "*.bdic") |
336 ) |
336 ) |
337 ]) |
337 } |
338 |
338 |
339 for row in range(self.dictionariesList.count()): |
339 for row in range(self.dictionariesList.count()): |
340 itm = self.dictionariesList.item(row) |
340 itm = self.dictionariesList.item(row) |
341 locales = set(itm.data(ManageDictionariesDialog.LocalesRole)) |
341 locales = set(itm.data(ManageDictionariesDialog.LocalesRole)) |
342 if locales.intersection(installedLocales): |
342 if locales.intersection(installedLocales): |