diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-09-30 18:28:00 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-10-02 12:57:04 -0300 |
commit | 057f42dcc2c23b93b872301d01a944fde5025439 (patch) | |
tree | 600c9586961cb407de9ca8a0847138f1f3052e08 /src/leap/bitmask | |
parent | 5fc48bf44bb127d54c001ab2e668dd5bed3c8f2d (diff) |
Add providers combobox with configured providers.
Diffstat (limited to 'src/leap/bitmask')
-rw-r--r-- | src/leap/bitmask/gui/ui/wizard.ui | 171 | ||||
-rw-r--r-- | src/leap/bitmask/gui/wizard.py | 6 |
2 files changed, 151 insertions, 26 deletions
diff --git a/src/leap/bitmask/gui/ui/wizard.ui b/src/leap/bitmask/gui/ui/wizard.ui index 420c74ae..b796b795 100644 --- a/src/leap/bitmask/gui/ui/wizard.ui +++ b/src/leap/bitmask/gui/ui/wizard.ui @@ -134,17 +134,7 @@ </property> </spacer> </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="lnProvider"/> - </item> - <item row="1" column="2"> - <widget class="QPushButton" name="btnCheck"> - <property name="text"> - <string>Check</string> - </property> - </widget> - </item> - <item row="3" column="1"> + <item row="5" column="1"> <spacer name="verticalSpacer_2"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -157,17 +147,7 @@ </property> </spacer> </item> - <item row="1" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>https://</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item row="4" column="0" colspan="3"> + <item row="6" column="0" colspan="3"> <widget class="QGroupBox" name="grpCheckProvider"> <property name="title"> <string>Checking for a valid provider</string> @@ -276,13 +256,73 @@ </layout> </widget> </item> - <item row="2" column="1" colspan="2"> + <item row="4" column="1" colspan="2"> <widget class="QLabel" name="lblProviderSelectStatus"> <property name="text"> <string/> </property> </widget> </item> + <item row="1" column="0" colspan="3"> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>Configure or select a provider</string> + </property> + <layout class="QGridLayout" name="gridLayout_5"> + <item row="0" column="1"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>https://</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QLineEdit" name="lnProvider"/> + </item> + <item row="1" column="2"> + <widget class="QComboBox" name="cbProviders"> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QPushButton" name="btnCheck"> + <property name="text"> + <string>Check</string> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QRadioButton" name="rbNewProvider"> + <property name="text"> + <string>Configure new provider</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QRadioButton" name="rbExistingProvider"> + <property name="text"> + <string>Use existing one</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLabel" name="label_8"> + <property name="text"> + <string>https://</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> </layout> </widget> <widget class="QWizardPage" name="provider_info_page"> @@ -764,12 +804,91 @@ <tabstop>btnRegister</tabstop> <tabstop>rdoRegister</tabstop> <tabstop>rdoLogin</tabstop> - <tabstop>lnProvider</tabstop> - <tabstop>btnCheck</tabstop> </tabstops> <resources> <include location="../../../../../data/resources/mainwindow.qrc"/> <include location="../../../../../data/resources/locale.qrc"/> </resources> - <connections/> + <connections> + <connection> + <sender>rbExistingProvider</sender> + <signal>toggled(bool)</signal> + <receiver>cbProviders</receiver> + <slot>setFocus()</slot> + <hints> + <hint type="sourcelabel"> + <x>167</x> + <y>192</y> + </hint> + <hint type="destinationlabel"> + <x>265</x> + <y>191</y> + </hint> + </hints> + </connection> + <connection> + <sender>rbNewProvider</sender> + <signal>toggled(bool)</signal> + <receiver>lnProvider</receiver> + <slot>setFocus()</slot> + <hints> + <hint type="sourcelabel"> + <x>171</x> + <y>164</y> + </hint> + <hint type="destinationlabel"> + <x>246</x> + <y>164</y> + </hint> + </hints> + </connection> + <connection> + <sender>rbExistingProvider</sender> + <signal>toggled(bool)</signal> + <receiver>lnProvider</receiver> + <slot>setDisabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>169</x> + <y>196</y> + </hint> + <hint type="destinationlabel"> + <x>327</x> + <y>163</y> + </hint> + </hints> + </connection> + <connection> + <sender>rbNewProvider</sender> + <signal>toggled(bool)</signal> + <receiver>cbProviders</receiver> + <slot>setDisabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>169</x> + <y>162</y> + </hint> + <hint type="destinationlabel"> + <x>269</x> + <y>193</y> + </hint> + </hints> + </connection> + <connection> + <sender>rbExistingProvider</sender> + <signal>toggled(bool)</signal> + <receiver>btnCheck</receiver> + <slot>setDisabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>154</x> + <y>193</y> + </hint> + <hint type="destinationlabel"> + <x>498</x> + <y>170</y> + </hint> + </hints> + </connection> + </connections> </ui> diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index 5c00f631..f71ce06b 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -26,6 +26,7 @@ from functools import partial from PySide import QtCore, QtGui from twisted.internet import threads +from leap.bitmask.config.leapsettings import LeapSettings from leap.bitmask.config.providerconfig import ProviderConfig from leap.bitmask.crypto.srpregister import SRPRegister from leap.bitmask.provider.providerbootstrapper import ProviderBootstrapper @@ -141,6 +142,11 @@ class Wizard(QtGui.QWizard): self.ui.label_12.setVisible(False) self.ui.lblProviderPolicy.setVisible(False) + # Load configured providers into wizard + ls = LeapSettings() + providers = ls.get_configured_providers() + self.ui.cbProviders.addItems(providers) + def get_domain(self): return self._domain |