[tuxdroid-svn] r550 - in software/gadgets/light_monitor/trunk: . Light_monitor Light_monitor/Script
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2007-09-28 13:33:01
|
Author: Paul_R Date: 2007-09-28 15:32:51 +0200 (Fri, 28 Sep 2007) New Revision: 550 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/settings.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Added the sample and rate config in the settings window. These settings are linked with the sample and rate in the widget window Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade 2007-09-28 13:10:23 UTC (rev 549) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade 2007-09-28 13:32:51 UTC (rev 550) @@ -182,7 +182,7 @@ <property name="can_focus">True</property> <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> <property name="window_placement">GTK_CORNER_TOP_LEFT</property> <child> @@ -469,8 +469,38 @@ <property name="y">32</property> </packing> </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + <child> + <widget class="GtkFixed" id="fixed8"> + <property name="height_request">68</property> + <property name="visible">True</property> + <child> + <widget class="GtkButton" id="btn_conf_remove"> + <property name="width_request">62</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Remove</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_btn_conf_remove_clicked"/> + </widget> + <packing> + <property name="x">96</property> + <property name="y">8</property> + </packing> + </child> + + <child> <widget class="GtkButton" id="btn_conf_add"> <property name="width_request">62</property> <property name="height_request">29</property> @@ -483,10 +513,28 @@ <signal name="clicked" handler="on_btn_conf_add_clicked"/> </widget> <packing> - <property name="x">640</property> - <property name="y">32</property> + <property name="x">16</property> + <property name="y">8</property> </packing> </child> + + <child> + <widget class="GtkButton" id="btn_conf_modify"> + <property name="width_request">62</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Modify</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_btn_conf_modify_clicked" last_modification_time="Fri, 28 Sep 2007 09:09:13 GMT"/> + </widget> + <packing> + <property name="x">176</property> + <property name="y">8</property> + </packing> + </child> </widget> <packing> <property name="padding">0</property> @@ -496,45 +544,101 @@ </child> <child> - <widget class="GtkFixed" id="fixed8"> - <property name="height_request">68</property> + <widget class="GtkFixed" id="fixed9"> + <property name="height_request">60</property> <property name="visible">True</property> <child> - <widget class="GtkButton" id="btn_conf_modify"> - <property name="width_request">62</property> - <property name="height_request">29</property> + <widget class="GtkLabel" id="lbl_conf_sample"> + <property name="width_request">100</property> + <property name="height_request">20</property> <property name="visible">True</property> + <property name="label" translatable="yes">Sample :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">24</property> + <property name="y">16</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="txt_conf_sample"> + <property name="width_request">72</property> + <property name="height_request">24</property> + <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Modify</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_modify_clicked" last_modification_time="Fri, 28 Sep 2007 09:09:13 GMT"/> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> </widget> <packing> - <property name="x">640</property> - <property name="y">35</property> + <property name="x">136</property> + <property name="y">14</property> </packing> </child> <child> - <widget class="GtkButton" id="btn_conf_remove"> - <property name="width_request">62</property> - <property name="height_request">29</property> + <widget class="GtkEntry" id="txt_conf_rate"> + <property name="width_request">72</property> + <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Remove</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_remove_clicked"/> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> </widget> <packing> - <property name="x">640</property> - <property name="y">0</property> + <property name="x">318</property> + <property name="y">14</property> </packing> </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_rate"> + <property name="width_request">100</property> + <property name="height_request">20</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Rate :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">232</property> + <property name="y">16</property> + </packing> + </child> </widget> <packing> <property name="padding">0</property> Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak 2007-09-28 13:10:23 UTC (rev 549) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak 2007-09-28 13:32:51 UTC (rev 550) @@ -182,7 +182,7 @@ <property name="can_focus">True</property> <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> <property name="window_placement">GTK_CORNER_TOP_LEFT</property> <child> @@ -469,70 +469,70 @@ <property name="y">32</property> </packing> </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + <child> + <widget class="GtkFixed" id="fixed8"> + <property name="height_request">68</property> + <property name="visible">True</property> + <child> - <widget class="GtkButton" id="btn_conf_add"> + <widget class="GtkButton" id="btn_conf_remove"> <property name="width_request">62</property> <property name="height_request">29</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Add</property> + <property name="label" translatable="yes">Remove</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_add_clicked"/> + <signal name="clicked" handler="on_btn_conf_remove_clicked"/> </widget> <packing> - <property name="x">640</property> - <property name="y">32</property> + <property name="x">96</property> + <property name="y">8</property> </packing> </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - <child> - <widget class="GtkFixed" id="fixed8"> - <property name="height_request">68</property> - <property name="visible">True</property> - <child> - <widget class="GtkButton" id="btn_conf_modify"> + <widget class="GtkButton" id="btn_conf_add"> <property name="width_request">62</property> <property name="height_request">29</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Modify</property> + <property name="label" translatable="yes">Add</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_modify_clicked" last_modification_time="Fri, 28 Sep 2007 09:09:13 GMT"/> + <signal name="clicked" handler="on_btn_conf_add_clicked"/> </widget> <packing> - <property name="x">640</property> - <property name="y">35</property> + <property name="x">16</property> + <property name="y">8</property> </packing> </child> <child> - <widget class="GtkButton" id="btn_conf_remove"> + <widget class="GtkButton" id="btn_conf_modify"> <property name="width_request">62</property> <property name="height_request">29</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Remove</property> + <property name="label" translatable="yes">Modify</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_remove_clicked"/> + <signal name="clicked" handler="on_btn_conf_modify_clicked" last_modification_time="Fri, 28 Sep 2007 09:09:13 GMT"/> </widget> <packing> - <property name="x">640</property> - <property name="y">0</property> + <property name="x">176</property> + <property name="y">8</property> </packing> </child> </widget> Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-09-28 13:10:23 UTC (rev 549) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-09-28 13:32:51 UTC (rev 550) @@ -11,6 +11,7 @@ Constructor """ SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + self.measure = _me.get_param('measure') def new(self): """ @@ -61,6 +62,9 @@ txt = _me.string('gui_conf_accept_bt') self.get_widget("label5").set_text(txt) + + self.get_widget('txt_conf_rate').set_text(_me.get_param('Rate')) + self.get_widget('txt_conf_sample').set_text(_me.get_param('Sample')) def updates_specifics(self): @@ -72,7 +76,6 @@ # ########################################################### def make_viewtree(self): - self.measure = _me.get_param('measure') self.index_column = gtk.TreeViewColumn('Index') self.index_column.set_min_width(50) self.index_cell = gtk.CellRendererText() @@ -309,6 +312,11 @@ """ On button 'accept' clicked """ + _me.set_param('Rate', float(self.get_widget('txt_conf_rate').get_text())) + _me.set_param('Sample',float(self.get_widget('txt_conf_sample').get_text())) + self.measure.rate = _me.get_param('Rate') + self.measure.sample = _me.get_param('Sample') + _me.set_var('notify_delay', int(self.get_widget("delay_spinbutton").get_value())) self.get_widget("window1").destroy() Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp 2007-09-28 13:10:23 UTC (rev 549) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp 2007-09-28 13:32:51 UTC (rev 550) @@ -42,6 +42,7 @@ measure.threshold_behavior = _me.get_param('behavior_file_threshold') measure.change_behavior = _me.get_param('behavior_file_change') +measure.event_tab = _me.get_param('config') tux.monitoring.insert(0x1B, measure.on_light_level) Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-09-28 13:10:23 UTC (rev 549) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-09-28 13:32:51 UTC (rev 550) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_description type='str'>Light monitor for tux droid</gadget_description> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_name type='str'>light_monitor</gadget_name> <gadget_version type='str'>0.0.1</gadget_version> - <gadget_name type='str'>light_monitor</gadget_name> - <gadget_description type='str'>Light monitor for tux droid</gadget_description> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-09-28 13:10:23 UTC (rev 549) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-09-28 13:32:51 UTC (rev 550) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <drop_rad type='bool'>False</drop_rad> + <drop type='str'>10</drop> <increase_rad type='bool'>True</increase_rad> <changeU_time type='str'>0</changeU_time> <changeD_rad type='bool'>True</changeD_rad> @@ -17,7 +17,7 @@ <drop_time type='str'>10</drop_time> <changeU type='str'>0</changeU> <raise_time type='str'>10</raise_time> - <drop type='str'>10</drop> + <drop_rad type='bool'>False</drop_rad> <Sample type='str'>500</Sample> <threshold_chk type='bool'>True</threshold_chk> <Rate type='str'>0.1</Rate> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-09-28 13:10:23 UTC (rev 549) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-09-28 13:32:51 UTC (rev 550) @@ -4,6 +4,7 @@ <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <widget_lblControl type='str'>Control</widget_lblControl> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <speaker_name type='str'>Ryan8k</speaker_name> <help_text type='str'>Bla bla bla bla</help_text> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> <widget_lblChangeU type='str'>Raise and drop</widget_lblChangeU> @@ -11,21 +12,20 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <widget_lblEvent type='str'>Event</widget_lblEvent> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <gui_conf_about_title type='str'>About</gui_conf_about_title> - <widget_lblValue type='str'>Value (%)</widget_lblValue> <widget_lblChange type='str'>Change</widget_lblChange> <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> <widget_lblDrop type='str'>Drop</widget_lblDrop> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> - <speaker_name type='str'>Ryan8k</speaker_name> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <widget_lblValue type='str'>Value (%)</widget_lblValue> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <name_to_read type='str'>Light monitor</name_to_read> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |