def __init__(self): WizardPage.__init__(self) self.fetch_config = None self.app_model = QStringListModel( REGISTRY.names( lambda klass: not getattr(klass, 'disable_in_gui', None))) self.ui.app_combo.setModel(self.app_model) if mozinfo.bits == 64: if mozinfo.os == 'mac': self.bits_model = QStringListModel(['64']) bits_index = 0 else: self.bits_model = QStringListModel(['32', '64']) bits_index = 1 elif mozinfo.bits == 32: self.bits_model = QStringListModel(['32']) bits_index = 0 self.ui.bits_combo.setModel(self.bits_model) self.ui.bits_combo.setCurrentIndex(bits_index) self.build_type_model = QStringListModel() self.ui.app_combo.currentIndexChanged.connect(self._set_fetch_config) self.ui.bits_combo.currentIndexChanged.connect(self._set_fetch_config) self.ui.app_combo.setCurrentIndex( self.ui.app_combo.findText("firefox")) completer = QCompleter() completer.setModel(QStringListModel(branches.get_branches( include_aliases=True), self)) completer.setCaseSensitivity(Qt.CaseInsensitive) self.ui.repository.setCompleter(completer)
def __init__(self): WizardPage.__init__(self) self.fetch_config = None self.app_model = QStringListModel( REGISTRY.names( lambda klass: not getattr(klass, 'disable_in_gui', None))) self.ui.app_combo.setModel(self.app_model) if mozinfo.bits == 64: if mozinfo.os == 'mac': self.bits_model = QStringListModel(['64']) bits_index = 0 else: self.bits_model = QStringListModel(['32', '64']) bits_index = 1 elif mozinfo.bits == 32: self.bits_model = QStringListModel(['32']) bits_index = 0 self.ui.bits_combo.setModel(self.bits_model) self.ui.bits_combo.setCurrentIndex(bits_index) self.build_type_model = QStringListModel() self.ui.app_combo.currentIndexChanged.connect(self._set_fetch_config) self.ui.bits_combo.currentIndexChanged.connect(self._set_fetch_config) self.ui.app_combo.setCurrentIndex( self.ui.app_combo.findText("firefox")) completer = QCompleter(sorted(get_branches()), self) completer.setCaseSensitivity(Qt.CaseInsensitive) self.ui.repository.setCompleter(completer) QApplication.instance().focusChanged.connect(self._on_focus_changed)
def __init__(self): WizardPage.__init__(self) self.fetch_config = None self.app_model = QStringListModel( REGISTRY.names( lambda klass: not getattr(klass, 'disable_in_gui', None))) self.ui.app_combo.setModel(self.app_model) if mozinfo.bits == 64: if mozinfo.os == 'mac': self.bits_model = QStringListModel(['64']) bits_index = 0 else: self.bits_model = QStringListModel(['32', '64']) bits_index = 1 elif mozinfo.bits == 32: self.bits_model = QStringListModel(['32']) bits_index = 0 self.ui.bits_combo.setModel(self.bits_model) self.ui.bits_combo.setCurrentIndex(bits_index) self.build_type_model = QStringListModel() self.ui.app_combo.currentIndexChanged.connect(self._set_fetch_config) self.ui.bits_combo.currentIndexChanged.connect(self._set_fetch_config) self.ui.app_combo.setCurrentIndex( self.ui.app_combo.findText("firefox")) self.ui.repository.textChanged.connect(self._on_repo_changed) completer = QCompleter(sorted(get_branches()), self) completer.setCaseSensitivity(Qt.CaseInsensitive) self.ui.repository.setCompleter(completer) QApplication.instance().focusChanged.connect(self._on_focus_changed)
def test_get_branches(category, present, not_present): names = branches.get_branches(category=category) for name in present: assert name in names for name in not_present: assert name not in names