mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
button to fix device pairing
This commit is contained in:
@@ -107,6 +107,16 @@ class DeviceManager:
|
||||
return self.data_singleton.current_device.supported()
|
||||
|
||||
|
||||
def reset_device_pairing(self):
|
||||
# first, unpair it
|
||||
if self.data_singleton.current_device == None:
|
||||
return
|
||||
self.data_singleton.current_device.ld.unpair()
|
||||
# next, pair it again
|
||||
self.data_singleton.current_device.ld.pair()
|
||||
QMessageBox.information(None, "Pairing Reset", "Your device's pairing was successfully reset. Refresh the device list before applying.")
|
||||
|
||||
|
||||
def add_skip_setup(self, files_to_restore: list[FileToRestore]):
|
||||
if self.skip_setup and not self.get_current_device_supported():
|
||||
# add the 2 skip setup files
|
||||
|
||||
@@ -119,6 +119,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
self.ui.allowWifiApplyingChk.clicked.connect(self.on_allowWifiApplyingChk_toggled)
|
||||
self.ui.skipSetupChk.clicked.connect(self.on_skipSetupChk_toggled)
|
||||
|
||||
self.ui.resetPairBtn.clicked.connect(self.on_resetPairBtn_clicked)
|
||||
|
||||
## MOBILE GESTALT PAGE ACTIONS
|
||||
self.ui.dynamicIslandDrp.activated.connect(self.on_dynamicIslandDrp_activated)
|
||||
self.ui.rdarFixChk.clicked.connect(self.on_rdarFixChk_clicked)
|
||||
@@ -178,6 +180,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
|
||||
self.ui.sidebarDiv2.hide()
|
||||
self.ui.applyPageBtn.hide()
|
||||
|
||||
self.ui.resetPairBtn.hide()
|
||||
else:
|
||||
self.ui.devicePicker.setEnabled(True)
|
||||
# populate the ComboBox with device names
|
||||
@@ -202,6 +206,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
self.ui.euEnablerPageContent.setDisabled(False)
|
||||
self.ui.springboardOptionsPageContent.setDisabled(False)
|
||||
self.ui.internalOptionsPageContent.setDisabled(False)
|
||||
|
||||
self.ui.resetPairBtn.show()
|
||||
|
||||
# update the selected device
|
||||
self.ui.devicePicker.setCurrentIndex(0)
|
||||
@@ -244,7 +250,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
self.ui.featureFlagsPageBtn.hide()
|
||||
else:
|
||||
self.device_manager.set_current_device(index=None)
|
||||
self.ui.featureFlagsPageBtn.hide()
|
||||
|
||||
# update the interface
|
||||
self.updateInterfaceForNewDevice()
|
||||
@@ -514,6 +519,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
# save the setting
|
||||
self.settings.setValue("skip_setup", checked)
|
||||
|
||||
# Device Options
|
||||
def on_resetPairBtn_clicked(self):
|
||||
self.device_manager.reset_device_pairing()
|
||||
|
||||
|
||||
## APPLY PAGE
|
||||
def on_chooseGestaltBtn_clicked(self):
|
||||
|
||||
Reference in New Issue
Block a user