Skip to content

Commit

Permalink
Added the QComboBox to input the number of bits for the
Browse files Browse the repository at this point in the history
application that the user wants to download.
  • Loading branch information
dangerouspython committed Apr 28, 2015
1 parent 4c9ca7f commit 1ae2464
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
14 changes: 12 additions & 2 deletions gui/mozregui/ui/intro.ui
Expand Up @@ -36,7 +36,7 @@
<item row="1" column="1">
<widget class="QComboBox" name="bisect_combo"/>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="toolTip">
<string>Search a fix instead of a regression</string>
Expand All @@ -46,13 +46,23 @@
</property>
</widget>
</item>
<item row="2" column="1">
<item row="3" column="1">
<widget class="QCheckBox" name="find_fix">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Bits</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="bits_combo"/>
</item>
</layout>
</item>
</layout>
Expand Down
16 changes: 13 additions & 3 deletions gui/mozregui/wizard.py
Expand Up @@ -48,9 +48,10 @@ def __init__(self):
class IntroPage(WizardPage):
UI_CLASS = Ui_Intro
TITLE = "Starting a bisection"
SUBTITLE = "Please choose an application and a type of bisection."
SUBTITLE = ("Please choose an application, a type of bisection"
"and the number of bits for the application.")
FIELDS = {'application': 'app_combo', 'bisect_type': 'bisect_combo',
'find_fix': 'find_fix'}
'find_fix': 'find_fix', 'bits': 'bits_combo'}
ID = 0

def __init__(self):
Expand All @@ -60,15 +61,24 @@ def __init__(self):
self.ui.app_combo.setModel(self.app_model)
self.bisect_model = QStringListModel()
self.ui.bisect_combo.setModel(self.bisect_model)
self.bits_model = QStringListModel(['32', '64'])
self.ui.bits_combo.setModel(self.bits_model)
if mozinfo.bits == 64:
bits_index = 1
elif mozinfo.bits == 32:
bits_index = 0
self.ui.bits_combo.setCurrentIndex(bits_index)

self.ui.app_combo.currentIndexChanged.connect(self._set_fetch_config)
self.ui.bits_combo.currentIndexChanged.connect(self._set_fetch_config)
self._set_fetch_config(0)

def _set_fetch_config(self, index):
# limit bisection type given the application
bits = int(self.ui.bits_combo.currentText())
old_bisect_index = self.ui.bisect_combo.currentIndex()
self.fetch_config = create_config(
str(self.ui.app_combo.itemText(index)), mozinfo.os, mozinfo.bits)
str(self.ui.app_combo.itemText(index)), mozinfo.os, bits)
bisect_types = ['nightlies']
if self.fetch_config.is_inbound():
bisect_types.append('inbound')
Expand Down

0 comments on commit 1ae2464

Please sign in to comment.