diff --git a/data/MainWindow.ui b/data/MainWindow.ui index e822436..42b541e 100755 --- a/data/MainWindow.ui +++ b/data/MainWindow.ui @@ -19,55 +19,109 @@ vertical 5 - + True False - 8 - vertical - 13 - + True False - center - center + 8 + vertical 13 - True - + True - True - True + False + center + center + 13 + True - + True - False - vertical + True + True - + True False - ppm-powersave-button.svg + vertical + + + True + False + ppm-powersave-button.svg + + + False + True + 0 + + + + + True + False + POWERSAVE + + + False + True + 1 + + - - False - True - 0 - + + + False + True + 0 + + + + + True + True + True - + True False - POWERSAVE + vertical + + + True + False + ppm-performance-button.svg + + + False + True + 0 + + + + + True + False + PERFORMANCE + + + False + True + 1 + + - - False - True - 1 - + + False + True + 1 + @@ -77,20 +131,26 @@ - + True - True - True + False + center + center + 8 + 8 + vertical + 13 + True True False - vertical + 8 - + True False - ppm-performance-button.svg + On Power: False @@ -99,55 +159,21 @@ - + + 200 True False - PERFORMANCE + center + center False True + end 1 - - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - center - center - 8 - 8 - vertical - 13 - True - - - True - False - 8 - - - True - False - On Power: - False True @@ -155,37 +181,62 @@ - - 200 + True False - center - center + 8 + + + True + False + On Battery: + + + False + True + 0 + + + + + 200 + True + False + center + center + + + False + True + end + 1 + + False True - end - 1 + 2 False True - 0 + 1 True False + center 8 True False - On Battery: + Switch to Powersave : False @@ -194,18 +245,39 @@ - - 200 + True False - center - center + 8 + + + True + False + % + + + False + True + 0 + + + + + 20 + True + True + + + False + True + 1 + + False True - end - 1 + 2 @@ -215,41 +287,33 @@ 2 - - - False - True - 1 - - - - - True - False - center - 8 - + + Stop charging the battery at 80% True - False - Switch to Powersave : + True + False + center + center + right + True False True - 0 + 3 - + True False - 8 + vertical True False - % + Screen Brightness: False @@ -258,10 +322,18 @@ - - 20 + True True + 31 + 31 + adjustment1 + on + on + 100 + 1 + 0 + False False @@ -273,80 +345,411 @@ False True - 2 + 5 - False - True - 2 + main + main - - Stop charging the battery at 80% + True True - False - center - center - right - True - - - False - True - 3 - - - - - True - False - vertical + 13 + 13 + 5 + 5 - + True False - Screen Brightness: - - - False - True - 0 - - - - - True - True - 31 - 31 - adjustment1 - on - on - 100 - 1 - 0 - False + + + True + False + vertical + 3 + + + True + False + + + True + False + Manage power for USB + + + False + True + 0 + + + + + True + True + + + False + True + end + 1 + + + + + False + True + 0 + + + + + True + False + + + True + False + Manage power for PCI + + + False + True + 0 + + + + + True + True + + + False + True + end + 1 + + + + + False + True + 1 + + + + + True + False + + + True + False + Manage power for SCSI + + + False + True + 0 + + + + + True + True + + + False + True + end + 1 + + + + + False + True + 2 + + + + + True + False + + + True + False + Manage power for Block Devices + + + False + True + 0 + + + + + True + True + + + False + True + end + 1 + + + + + False + True + 3 + + + + + True + False + + + True + False + Manage power for I2C + + + False + True + 0 + + + + + True + True + + + False + True + end + 1 + + + + + False + True + 4 + + + + + True + False + + + True + False + Manage power for Audio + + + False + True + 0 + + + + + True + True + + + False + True + end + 1 + + + + + False + True + 5 + + + + + True + False + + + True + False + Manage power for Bluetooth + + + False + True + 0 + + + + + True + True + + + False + True + end + 1 + + + + + False + True + 6 + + + + + True + False + + + True + False + Manage power for GPU + + + False + True + 0 + + + + + True + True + + + False + True + end + 1 + + + + + False + True + 7 + + + + + True + False + + + True + False + Manage power for Network + + + False + True + 0 + + + + + True + True + + + False + True + end + 1 + + + + + False + True + 8 + + + + + True + False + + + False + True + 9 + + + + + True + False + + + True + False + Enable Unstable Features + + + False + True + 0 + + + + + True + True + + + False + True + end + 1 + + + + + False + True + 10 + + + + + + + - - False - True - 1 - - False - True - 5 + settings + settings + 1 - False + True True 1 @@ -403,7 +806,7 @@ Pardus Power Manager True - + True True True @@ -412,7 +815,7 @@ True False - dialog-information-symbolic + open-menu-symbolic @@ -438,6 +841,153 @@ + + False + ui_button_menu + + + True + False + 5 + 5 + 5 + 5 + vertical + + + True + True + True + none + + + True + False + 5 + + + True + False + documentinfo-symbolic + + + False + True + 0 + + + + + True + False + About + + + False + True + 1 + + + + + + + False + True + 0 + + + + + True + True + True + none + + + True + False + 5 + + + True + False + settings-configure-symbolic + + + False + True + 0 + + + + + True + False + Advances Settings + + + False + True + 1 + + + + + + + False + True + 1 + + + + + True + True + True + none + + + True + False + 5 + + + True + False + go-home-symbolic + + + False + True + 0 + + + + + True + False + Main Page + + + False + True + 1 + + + + + + + False + True + 2 + + + + + 350 False diff --git a/src/client/MainWindow.py b/src/client/MainWindow.py index 34bb925..49a3286 100755 --- a/src/client/MainWindow.py +++ b/src/client/MainWindow.py @@ -98,6 +98,7 @@ def init(self): self.combobox_init() self.spinbutton_init() self.value_init() + self.settings_init() self.connect_signal() if not charge_stop_available(): self.o("ui_checkbox_battery_treshold").set_visible(False) @@ -132,6 +133,25 @@ def connect_signal(self): self.o("ui_spinbutton_switch_to_performance").connect("value-changed",self.save_settings) self.o("ui_button_about").connect("clicked",self.__about_event) self.o("ui_button_warning").connect("clicked",self.__warning_event) + self.o("ui_button_menu").connect("clicked",self.__menu_event) + self.o("ui_button_settings").connect("clicked",self.__settings_event) + self.o("ui_button_home").connect("clicked",self.__home_event) + + + def __settings_event(self, widget): + self.o("ui_stack_main").set_visible_child_name("settings") + self.o("ui_button_home").show() + self.o("ui_button_settings").hide() + + + def __home_event(self, widget): + self.o("ui_stack_main").set_visible_child_name("main") + self.o("ui_button_home").hide() + self.o("ui_button_settings").show() + + def __menu_event(self, widget): + self.o("ui_popover_menu").popup() + def __warning_event(self, widget): self.o("ui_popover_warning").popup() @@ -140,6 +160,17 @@ def __about_event(self, widget): self.o("ui_about_dialog").run() self.o("ui_about_dialog").hide() + +###### settings ###### + + def settings_init(self): + self.__home_event(None) + # Update settings buttons + for name in ["usb", "pci","scsi","block","i2c","audio","bluetooth","gpu","network","unstable"]: + self.o("ui_switch_"+name).set_active(get(name, True, "power")) + self.o("ui_switch_"+name).connect("state-set",self.save_settings) + + ###### widget init ###### def combobox_init(self): @@ -256,6 +287,10 @@ def save_settings(self, a=None, b=None): # service data["service"] = {} data["service"]["enabled"] = True + # power + data["power"]={} + for name in ["usb", "pci","scsi","block","i2c","audio","bluetooth","gpu","network"]: + data["power"][name] = self.o("ui_switch_"+name).get_active() # modes data["modes"] = {} ac_w = self.o("ui_combobox_acmode")