Merge pull request #1564 from SaptakS/replace-map-flags
Replace maps with flags
@ -551,6 +551,11 @@ class AutoConnectUseBridgeWidget(QtWidgets.QWidget):
|
|||||||
self.description_label.setWordWrap(True)
|
self.description_label.setWordWrap(True)
|
||||||
|
|
||||||
# Detection preference
|
# Detection preference
|
||||||
|
self.use_bridge = True
|
||||||
|
self.no_bridge = QtWidgets.QRadioButton(
|
||||||
|
strings._("gui_autoconnect_no_bridge")
|
||||||
|
)
|
||||||
|
self.no_bridge.toggled.connect(self._toggle_no_bridge)
|
||||||
self.detect_automatic_radio = QtWidgets.QRadioButton(
|
self.detect_automatic_radio = QtWidgets.QRadioButton(
|
||||||
strings._("gui_autoconnect_bridge_detect_automatic")
|
strings._("gui_autoconnect_bridge_detect_automatic")
|
||||||
)
|
)
|
||||||
@ -560,6 +565,7 @@ class AutoConnectUseBridgeWidget(QtWidgets.QWidget):
|
|||||||
)
|
)
|
||||||
self.detect_manual_radio.toggled.connect(self._detect_manual_toggled)
|
self.detect_manual_radio.toggled.connect(self._detect_manual_toggled)
|
||||||
detect_layout = QtWidgets.QVBoxLayout()
|
detect_layout = QtWidgets.QVBoxLayout()
|
||||||
|
detect_layout.addWidget(self.no_bridge)
|
||||||
detect_layout.addWidget(self.detect_automatic_radio)
|
detect_layout.addWidget(self.detect_automatic_radio)
|
||||||
detect_layout.addWidget(self.detect_manual_radio)
|
detect_layout.addWidget(self.detect_manual_radio)
|
||||||
|
|
||||||
@ -577,8 +583,12 @@ class AutoConnectUseBridgeWidget(QtWidgets.QWidget):
|
|||||||
self.country_combobox.setStyleSheet(
|
self.country_combobox.setStyleSheet(
|
||||||
common.gui.css["autoconnect_countries_combobox"]
|
common.gui.css["autoconnect_countries_combobox"]
|
||||||
)
|
)
|
||||||
|
self.country_combobox.setIconSize(QtCore.QSize(26, 20))
|
||||||
for country_code in countries:
|
for country_code in countries:
|
||||||
self.country_combobox.addItem(countries[country_code], country_code)
|
icon = QtGui.QIcon(
|
||||||
|
GuiCommon.get_resource_path(os.path.join("images", "countries", f"{country_code.lower()}.png"))
|
||||||
|
)
|
||||||
|
self.country_combobox.addItem(icon, countries[country_code], country_code)
|
||||||
|
|
||||||
# Task label
|
# Task label
|
||||||
self.task_label = QtWidgets.QLabel()
|
self.task_label = QtWidgets.QLabel()
|
||||||
@ -588,18 +598,12 @@ class AutoConnectUseBridgeWidget(QtWidgets.QWidget):
|
|||||||
|
|
||||||
# Buttons
|
# Buttons
|
||||||
self.connect_button = QtWidgets.QPushButton(
|
self.connect_button = QtWidgets.QPushButton(
|
||||||
strings._("gui_autoconnect_bridge_start")
|
strings._("gui_autoconnect_start")
|
||||||
)
|
)
|
||||||
self.connect_button.clicked.connect(self._connect_clicked)
|
self.connect_button.clicked.connect(self._connect_clicked)
|
||||||
self.connect_button.setFixedWidth(150)
|
self.connect_button.setFixedWidth(150)
|
||||||
self.connect_button.setStyleSheet(common.gui.css["autoconnect_start_button"])
|
self.connect_button.setStyleSheet(common.gui.css["autoconnect_start_button"])
|
||||||
|
|
||||||
self.try_again_button = QtWidgets.QPushButton(
|
|
||||||
strings._("gui_autoconnect_try_again_without_a_bridge")
|
|
||||||
)
|
|
||||||
self.try_again_button.clicked.connect(self._try_again_clicked)
|
|
||||||
self.try_again_button.setStyleSheet(common.gui.css["autoconnect_start_button"])
|
|
||||||
|
|
||||||
self.configure_button = QtWidgets.QPushButton(
|
self.configure_button = QtWidgets.QPushButton(
|
||||||
strings._("gui_autoconnect_configure")
|
strings._("gui_autoconnect_configure")
|
||||||
)
|
)
|
||||||
@ -628,7 +632,6 @@ class AutoConnectUseBridgeWidget(QtWidgets.QWidget):
|
|||||||
|
|
||||||
cta_layout = QtWidgets.QHBoxLayout()
|
cta_layout = QtWidgets.QHBoxLayout()
|
||||||
cta_layout.addWidget(self.connect_button)
|
cta_layout.addWidget(self.connect_button)
|
||||||
cta_layout.addWidget(self.try_again_button)
|
|
||||||
cta_layout.addWidget(self.configure_button)
|
cta_layout.addWidget(self.configure_button)
|
||||||
cta_layout.addStretch()
|
cta_layout.addStretch()
|
||||||
cta_widget = QtWidgets.QWidget()
|
cta_widget = QtWidgets.QWidget()
|
||||||
@ -651,21 +654,24 @@ class AutoConnectUseBridgeWidget(QtWidgets.QWidget):
|
|||||||
|
|
||||||
def hide_buttons(self):
|
def hide_buttons(self):
|
||||||
self.connect_button.hide()
|
self.connect_button.hide()
|
||||||
self.try_again_button.hide()
|
|
||||||
self.configure_button.hide()
|
self.configure_button.hide()
|
||||||
self.description_label.hide()
|
self.description_label.hide()
|
||||||
self.error_label.hide()
|
self.error_label.hide()
|
||||||
|
self.no_bridge.hide()
|
||||||
self.detect_automatic_radio.hide()
|
self.detect_automatic_radio.hide()
|
||||||
self.detect_manual_radio.hide()
|
self.detect_manual_radio.hide()
|
||||||
|
|
||||||
def show_buttons(self):
|
def show_buttons(self):
|
||||||
self.connect_button.show()
|
self.connect_button.show()
|
||||||
self.try_again_button.show()
|
|
||||||
self.description_label.show()
|
self.description_label.show()
|
||||||
self.configure_button.show()
|
self.configure_button.show()
|
||||||
|
self.no_bridge.show()
|
||||||
self.detect_automatic_radio.show()
|
self.detect_automatic_radio.show()
|
||||||
self.detect_manual_radio.show()
|
self.detect_manual_radio.show()
|
||||||
|
|
||||||
|
def _toggle_no_bridge(self):
|
||||||
|
self.use_bridge = not self.use_bridge
|
||||||
|
|
||||||
def _detect_automatic_toggled(self):
|
def _detect_automatic_toggled(self):
|
||||||
self.country_combobox.setEnabled(False)
|
self.country_combobox.setEnabled(False)
|
||||||
self.country_combobox.hide()
|
self.country_combobox.hide()
|
||||||
@ -680,16 +686,11 @@ class AutoConnectUseBridgeWidget(QtWidgets.QWidget):
|
|||||||
self.connection_status_label.setText(
|
self.connection_status_label.setText(
|
||||||
strings._("gui_autoconnect_trying_to_connect_to_tor")
|
strings._("gui_autoconnect_trying_to_connect_to_tor")
|
||||||
)
|
)
|
||||||
self.connect_clicked.emit()
|
print(self.use_bridge)
|
||||||
|
if not self.use_bridge:
|
||||||
def _try_again_clicked(self):
|
|
||||||
self.connection_status_label.setText(
|
|
||||||
strings._("gui_autoconnect_trying_to_connect_to_tor")
|
|
||||||
)
|
|
||||||
self.country_combobox.setEnabled(False)
|
|
||||||
self.country_combobox.hide()
|
|
||||||
self.hide_buttons()
|
|
||||||
self.try_again_clicked.emit()
|
self.try_again_clicked.emit()
|
||||||
|
else:
|
||||||
|
self.connect_clicked.emit()
|
||||||
|
|
||||||
def _open_tor_settings(self):
|
def _open_tor_settings(self):
|
||||||
self.open_tor_settings.emit()
|
self.open_tor_settings.emit()
|
||||||
|
BIN
desktop/onionshare/resources/images/countries/ad.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
desktop/onionshare/resources/images/countries/ae.png
Normal file
After Width: | Height: | Size: 490 B |
BIN
desktop/onionshare/resources/images/countries/af.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
desktop/onionshare/resources/images/countries/ag.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
desktop/onionshare/resources/images/countries/ai.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
desktop/onionshare/resources/images/countries/al.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
desktop/onionshare/resources/images/countries/am.png
Normal file
After Width: | Height: | Size: 392 B |
BIN
desktop/onionshare/resources/images/countries/ao.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
desktop/onionshare/resources/images/countries/aq.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
desktop/onionshare/resources/images/countries/ar.png
Normal file
After Width: | Height: | Size: 813 B |
BIN
desktop/onionshare/resources/images/countries/as.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
desktop/onionshare/resources/images/countries/at.png
Normal file
After Width: | Height: | Size: 406 B |
BIN
desktop/onionshare/resources/images/countries/au.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
desktop/onionshare/resources/images/countries/aw.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
desktop/onionshare/resources/images/countries/ax.png
Normal file
After Width: | Height: | Size: 728 B |
BIN
desktop/onionshare/resources/images/countries/az.png
Normal file
After Width: | Height: | Size: 1006 B |
BIN
desktop/onionshare/resources/images/countries/ba.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
desktop/onionshare/resources/images/countries/bb.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
desktop/onionshare/resources/images/countries/bd.png
Normal file
After Width: | Height: | Size: 784 B |
BIN
desktop/onionshare/resources/images/countries/be.png
Normal file
After Width: | Height: | Size: 384 B |
BIN
desktop/onionshare/resources/images/countries/bf.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
desktop/onionshare/resources/images/countries/bg.png
Normal file
After Width: | Height: | Size: 398 B |
BIN
desktop/onionshare/resources/images/countries/bh.png
Normal file
After Width: | Height: | Size: 938 B |
BIN
desktop/onionshare/resources/images/countries/bi.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
desktop/onionshare/resources/images/countries/bj.png
Normal file
After Width: | Height: | Size: 473 B |
BIN
desktop/onionshare/resources/images/countries/bl.png
Normal file
After Width: | Height: | Size: 383 B |
BIN
desktop/onionshare/resources/images/countries/bm.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
desktop/onionshare/resources/images/countries/bn.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
desktop/onionshare/resources/images/countries/bo.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
desktop/onionshare/resources/images/countries/bq.png
Normal file
After Width: | Height: | Size: 398 B |
BIN
desktop/onionshare/resources/images/countries/br.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
desktop/onionshare/resources/images/countries/bs.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
desktop/onionshare/resources/images/countries/bt.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
desktop/onionshare/resources/images/countries/bv.png
Normal file
After Width: | Height: | Size: 751 B |
BIN
desktop/onionshare/resources/images/countries/bw.png
Normal file
After Width: | Height: | Size: 395 B |
BIN
desktop/onionshare/resources/images/countries/by.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
desktop/onionshare/resources/images/countries/bz.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
desktop/onionshare/resources/images/countries/ca.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
desktop/onionshare/resources/images/countries/cc.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
desktop/onionshare/resources/images/countries/cd.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
desktop/onionshare/resources/images/countries/cf.png
Normal file
After Width: | Height: | Size: 968 B |
BIN
desktop/onionshare/resources/images/countries/cg.png
Normal file
After Width: | Height: | Size: 537 B |
BIN
desktop/onionshare/resources/images/countries/ch.png
Normal file
After Width: | Height: | Size: 489 B |
BIN
desktop/onionshare/resources/images/countries/ci.png
Normal file
After Width: | Height: | Size: 383 B |
BIN
desktop/onionshare/resources/images/countries/ck.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
desktop/onionshare/resources/images/countries/cl.png
Normal file
After Width: | Height: | Size: 828 B |
BIN
desktop/onionshare/resources/images/countries/cm.png
Normal file
After Width: | Height: | Size: 664 B |
BIN
desktop/onionshare/resources/images/countries/cn.png
Normal file
After Width: | Height: | Size: 1007 B |
BIN
desktop/onionshare/resources/images/countries/co.png
Normal file
After Width: | Height: | Size: 406 B |
BIN
desktop/onionshare/resources/images/countries/cr.png
Normal file
After Width: | Height: | Size: 427 B |
BIN
desktop/onionshare/resources/images/countries/cu.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
desktop/onionshare/resources/images/countries/cv.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
desktop/onionshare/resources/images/countries/cw.png
Normal file
After Width: | Height: | Size: 894 B |
BIN
desktop/onionshare/resources/images/countries/cx.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
desktop/onionshare/resources/images/countries/cy.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
desktop/onionshare/resources/images/countries/cz.png
Normal file
After Width: | Height: | Size: 687 B |
BIN
desktop/onionshare/resources/images/countries/de.png
Normal file
After Width: | Height: | Size: 402 B |
BIN
desktop/onionshare/resources/images/countries/dj.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
desktop/onionshare/resources/images/countries/dk.png
Normal file
After Width: | Height: | Size: 411 B |
BIN
desktop/onionshare/resources/images/countries/dm.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
desktop/onionshare/resources/images/countries/do.png
Normal file
After Width: | Height: | Size: 994 B |
BIN
desktop/onionshare/resources/images/countries/dz.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
desktop/onionshare/resources/images/countries/ec.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
desktop/onionshare/resources/images/countries/ee.png
Normal file
After Width: | Height: | Size: 389 B |
BIN
desktop/onionshare/resources/images/countries/eg.png
Normal file
After Width: | Height: | Size: 984 B |
BIN
desktop/onionshare/resources/images/countries/eh.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
desktop/onionshare/resources/images/countries/er.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
desktop/onionshare/resources/images/countries/es.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
desktop/onionshare/resources/images/countries/et.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
desktop/onionshare/resources/images/countries/fi.png
Normal file
After Width: | Height: | Size: 478 B |
BIN
desktop/onionshare/resources/images/countries/fj.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
desktop/onionshare/resources/images/countries/fk.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
desktop/onionshare/resources/images/countries/fo.png
Normal file
After Width: | Height: | Size: 618 B |
BIN
desktop/onionshare/resources/images/countries/fr.png
Normal file
After Width: | Height: | Size: 383 B |
BIN
desktop/onionshare/resources/images/countries/ga.png
Normal file
After Width: | Height: | Size: 398 B |
BIN
desktop/onionshare/resources/images/countries/gb.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
desktop/onionshare/resources/images/countries/gd.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
desktop/onionshare/resources/images/countries/ge.png
Normal file
After Width: | Height: | Size: 834 B |
BIN
desktop/onionshare/resources/images/countries/gf.png
Normal file
After Width: | Height: | Size: 383 B |
BIN
desktop/onionshare/resources/images/countries/gg.png
Normal file
After Width: | Height: | Size: 685 B |
BIN
desktop/onionshare/resources/images/countries/gh.png
Normal file
After Width: | Height: | Size: 849 B |
BIN
desktop/onionshare/resources/images/countries/gi.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
desktop/onionshare/resources/images/countries/gl.png
Normal file
After Width: | Height: | Size: 1002 B |
BIN
desktop/onionshare/resources/images/countries/gm.png
Normal file
After Width: | Height: | Size: 438 B |
BIN
desktop/onionshare/resources/images/countries/gn.png
Normal file
After Width: | Height: | Size: 379 B |
BIN
desktop/onionshare/resources/images/countries/gp.png
Normal file
After Width: | Height: | Size: 383 B |
BIN
desktop/onionshare/resources/images/countries/gq.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
desktop/onionshare/resources/images/countries/gr.png
Normal file
After Width: | Height: | Size: 760 B |
BIN
desktop/onionshare/resources/images/countries/gs.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
desktop/onionshare/resources/images/countries/gt.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
desktop/onionshare/resources/images/countries/gu.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
desktop/onionshare/resources/images/countries/gw.png
Normal file
After Width: | Height: | Size: 815 B |
BIN
desktop/onionshare/resources/images/countries/gy.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
desktop/onionshare/resources/images/countries/hk.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
desktop/onionshare/resources/images/countries/hm.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
desktop/onionshare/resources/images/countries/hn.png
Normal file
After Width: | Height: | Size: 671 B |
BIN
desktop/onionshare/resources/images/countries/hr.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
desktop/onionshare/resources/images/countries/ht.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
desktop/onionshare/resources/images/countries/hu.png
Normal file
After Width: | Height: | Size: 414 B |