Add "Force Reset" action

This commit is contained in:
wheaney 2024-07-03 11:32:50 -07:00
parent e54bb1770f
commit 707710c4c7
4 changed files with 12 additions and 2 deletions

@ -1 +1 @@
Subproject commit 2b993a7017f74fedeac6c88bb46a7828b194cd29
Subproject commit abed471a8327867f88e206b36b3555ae30111eb8

@ -1 +1 @@
Subproject commit 50ce02fc9e341d417785bd26abeee9f7305bee6c
Subproject commit 34a349d39efc02f4b65550debd193d29d95a84f9

View File

@ -55,6 +55,10 @@
<attribute name="label" translatable="yes">License Details</attribute>
<attribute name="action">app.license</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Force Reset</attribute>
<attribute name="action">app.reset_driver</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About BreezyDesktop</attribute>
<attribute name="action">app.about</attribute>

View File

@ -64,6 +64,7 @@ class BreezydesktopApplication(Adw.Application):
self.create_action('quit', self.on_quit_action, ['<primary>q'])
self.create_action('about', self.on_about_action)
self.create_action('license', self.on_license_action)
self.create_action('reset_driver', self.on_reset_driver_action)
def do_activate(self):
"""Called when the application is activated.
@ -94,6 +95,11 @@ class BreezydesktopApplication(Adw.Application):
dialog.set_transient_for(self.props.active_window)
dialog.present()
def on_reset_driver_action(self, widget, _):
XRDriverIPC.get_instance().write_control_flags({
'force_quit': True
})
def create_action(self, name, callback, shortcuts=None):
"""Add an application action.