diff --git a/src/window.py b/src/window.py index 3f0c5f3..a4ff861 100644 --- a/src/window.py +++ b/src/window.py @@ -5,12 +5,11 @@ @Gtk.Template(resource_path='/org/gnome/siglo/window.ui') class SigloWindow(Gtk.ApplicationWindow): __gtype_name__ = 'SigloWindow' - info_scan_fail = Gtk.Template.Child() info_scan_pass = Gtk.Template.Child() - bbox_scan_fail = Gtk.Template.Child() - bbox_scan_pass = Gtk.Template.Child() + scan_fail_box = Gtk.Template.Child() + scan_pass_box = Gtk.Template.Child() + main_info = Gtk.Template.Child() bt_spinner = Gtk.Template.Child() - sync_time_button = Gtk.Template.Child() def __init__(self, **kwargs): self.manager = None @@ -21,20 +20,20 @@ def done_scanning(self, manager): scan_result = manager.get_scan_result() self.bt_spinner.set_visible(False) if (scan_result): + self.main_info.set_text("Done Scanning...Success") self.info_scan_pass.set_text("InfiniTime Found!\nMac Address: " + manager.get_mac_address()) - self.info_scan_pass.set_visible(True) - self.bbox_scan_pass.set_visible(True) + self.scan_pass_box.set_visible(True) else: - self.info_scan_fail.set_visible(True) - self.bbox_scan_fail.set_visible(True) + self.main_info.set_text("Done Scanning...Failed") + self.scan_fail_box.set_visible(True) @Gtk.Template.Callback() def rescan_button_clicked(self, widget): if self.manager is not None: print("Rescan button clicked...") + self.main_info.set_text("Rescanning...") self.bt_spinner.set_visible(True) - self.info_scan_fail.set_visible(False) - self.bbox_scan_fail.set_visible(False) + self.scan_fail_box.set_visible(False) self.manager.scan_for_infinitime() self.done_scanning(self.manager) @@ -44,8 +43,6 @@ def sync_time_button_clicked(self, widget): print("Sync Time button clicked...") device = InfiniTimeDevice(manager=self.manager, mac_address=self.manager.get_mac_address()) device.connect() - self.info_scan_pass.set_text("InfiniTime Syncing... Success!") - self.bbox_scan_pass.set_visible(False) - self.sync_time_button.set_visible(False) - + self.main_info.set_text("InfiniTime Sync... Success!") + self.scan_pass_box.set_visible(False) diff --git a/src/window.ui b/src/window.ui index fb49e48..52d739e 100644 --- a/src/window.ui +++ b/src/window.ui @@ -8,18 +8,19 @@ 300 - + True False vertical - + True False - center - center - True - True + 20 + Scanning... + + + False @@ -28,11 +29,13 @@ - + + True False + center + center True - default scan pass text - center + True False @@ -41,86 +44,110 @@ - - False - True - Make sure InfiniTime is ON but NOT connected - -To check, go to Settings->Bluetooth->Devices - -Might take a few scans. - center - - - False - True - 2 - - - - + False - center - True - start + vertical - - Rescan + True - True - True - + False + True + default scan pass text + center - True + False True 0 + + + -1 + -1 + True + False + center + vertical + start + + + Time Sync + -1 + -1 + True + True + True + start + True + + + + True + True + 0 + + + + + False + True + 1 + + False True - 3 + 2 - - -1 - -1 + False - center - True vertical - start - - OTA Update + True - True - True - start - 10 + False + True + Make sure InfiniTime is ON but NOT connected + +To check, go to Settings->Bluetooth->Devices + +Might take a few scans. + center - True + False True 0 - - Time Sync - -1 - -1 + True - True - True - start - + False + center + True + start + + + Rescan + True + True + True + + + + True + True + 0 + + - True + False True 1 @@ -129,7 +156,7 @@ Might take a few scans. False True - 4 + 3