Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S Solaar
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pwr-Solaar
  • Solaar
  • Issues
  • #662
Closed
Open
Issue created Jan 29, 2020 by Administrator@rootContributor

Nano re-pairing is not possible and add a Quit Solaar button to also close tray icon

Created by: KenH2000

The following code added to window.py will correct the issues

  1. If you only want to make a quick change to a device and not use the tray icon, you have to close the window, and then also close tray icon to exit the program. A simple fix, is to add a 'Quit Solaar' button to the window.py source. Edit ~/.local/lib/python3.6/site-packages/solaar/ui/window.py, after line 312 add:
#existing code...
	bottom_buttons_box.add(about_button)
#new code...
	close_button = _new_button(_("Quit") + ' ' + NAME, icon_size=_SMALL_BUTTON_ICON_SIZE, clicked=_justclose)
	bottom_buttons_box.add(close_button)

and add the function (also in window.py), which will close both the window and tray icon:

#new code...
def _justclose(self):
	import sys
	sys.exit()

Optional: if you want space between the About and Quit buttons, edit line 310 to add spacing:

#existing code(comment out)...
	#bottom_buttons_box = Gtk.ButtonBox(Gtk.Orientation.HORIZONTAL)
#new code to add button spacing...
	bottom_buttons_box = Gtk.ButtonBox(Gtk.Orientation.HORIZONTAL,spacing=6)
  1. If you pair a Nano device to another receiver, you can not re-pair it back to the original Nano receiver because the 'Pair new device' button is disabled, and cannot be re-enabled by unpairing the original device (unpairing always fails on Nano device). To resolve this issue, force the button visible if the receiver name detected is a 'Nano' device. Edit the window.py source, and edit the function, def _update_receiver_panel(...), after line 598 add the following:
#existing code...
		may_pair &= len(paired_devices) < receiver.max_devices
#new code...
		if "Nano" in receiver.name:
			may_pair=True        
#existing code....
	buttons._pair.set_sensitive(may_pair) 
	buttons._pair.set_visible(True)
Assignee
Assign to
Time tracking