[tuxdroid-svn] r594 - in software/gadgets/light_monitor/trunk: . Light_monitor Light_monitor/Script
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2007-10-09 15:33:28
|
Author: Paul_R Date: 2007-10-09 17:32:49 +0200 (Tue, 09 Oct 2007) New Revision: 594 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Changed the treeview config to enable to select a row with only one click. 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-10-09 14:34:47 UTC (rev 593) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-09 15:32:49 UTC (rev 594) @@ -120,7 +120,8 @@ self.get_widget('cbb_conf_event').set_active(0) self.get_widget('txt_conf_value').set_text('1.0') self.get_widget('txt_conf_time').set_text('0.1') - self.gadget_viewer.connect("row_activated", self.on_row_selected) + self.gadget_viewer.get_selection().connect("changed",self.on_row_selected) + #self.gadget_viewer.connect("row_activated", self.on_row_selected) self.measure.event_tab = _me.get_param('config') self.get_widget('cbb_conf_event').append_text(_me.string('conf_lblChange')) self.get_widget('cbb_conf_event').append_text(_me.string('conf_lblThreshold')) @@ -137,7 +138,7 @@ def update_labels(self): self.get_widget("lbl_conf_event").set_text(_me.string('conf_lblEvent')) self.get_widget("lbl_conf_type").set_text(_me.string('conf_lblType')) - self.get_widget("lbl_conf_value").set_text(_me.string('conf_lblValue')) + self.get_widget("lbclient_conf_value").set_text(_me.string('conf_lblValue')) self.get_widget("lbl_conf_time").set_text(_me.string('conf_lblTime')) self.get_widget("lbl_conf_notified").set_text(_me.string('conf_lblNotified')) self.get_widget("lbl_conf_behavior").set_text(_me.string('conf_lblBehavior')) @@ -155,15 +156,16 @@ # On row selected # ########################################################### - def on_row_selected(self, treeview, path, view_column): - self.iter = self.value_list.get_iter(path) - index = self.value_list.get_value(self.iter, 0) - event = self.value_list.get_value(self.iter, 1) - typet = self.value_list.get_value(self.iter, 2) - value = self.value_list.get_value(self.iter, 3) - time = self.value_list.get_value(self.iter, 4) - notify = self.value_list.get_value(self.iter, 5) - behavior = self.value_list.get_value(self.iter, 6) + def on_row_selected(self, obj): + path = obj.get_selected_rows() + self.__iter = self.value_list.get_iter(path[1][0]) + index = self.value_list.get_value(self.__iter, 0) + event = self.value_list.get_value(self.__iter, 1) + typet = self.value_list.get_value(self.__iter, 2) + value = self.value_list.get_value(self.__iter, 3) + time = self.value_list.get_value(self.__iter, 4) + notify = self.value_list.get_value(self.__iter, 5) + behavior = self.value_list.get_value(self.__iter, 6) if event == _me.string('conf_lblChange'): self.get_widget('cbb_conf_event').set_active(0) @@ -199,15 +201,15 @@ self.get_widget('conf_behavior').set_filename(behavior) else: self.get_widget('conf_behavior').set_filename('None') + - ########################################################### # # On row modified # ########################################################### def on_btn_conf_modify_clicked(self, widget, *args): - index = self.value_list.get_value(self.iter, 0) + index = self.value_list.get_value(self.__iter, 0) self.measure.event_tab = _me.get_param('config') length = len(_me.get_param('config')) @@ -238,11 +240,11 @@ # ########################################################### def on_btn_conf_remove_clicked(self, widget, *args): - index = self.value_list.get_value(self.iter, 0) + index = self.value_list.get_value(self.__iter, 0) self.measure.event_tab =_me.get_param('config') self.measure.event_tab.pop(index - 1) _me.set_param('config', self.measure.event_tab) - self.iter = 0 + self.__iter = 0 self.value_list.clear() for i in range(len(self.measure.event_tab)): self.add_row(i) @@ -280,14 +282,12 @@ def verify_tab(self, tab): for i in range(len(self.measure.event_tab)): if self.measure.event_tab[i][1] == tab[1]: - print '1' if self.measure.event_tab[i][2] == tab[2]: - print '2' if self.measure.event_tab[i][3] == tab[3]: - print '3' if self.measure.event_tab[i][4] == tab[4]: - print '4' - return False + if self.measure.event_tab[i][5] == tab[5]: + if self.measure.event_tab[i][6] == tab[6]: + return False return True ########################################################### @@ -388,7 +388,7 @@ ########################################################### def on_btnBehavior_clicked(self, widget, *args): self.get_widget('conf_behavior').set_filename('None') - index = self.value_list.get_value(self.iter, 0) + index = self.value_list.get_value(self.__iter, 0) print self.measure.event_tab[index-1][6] self.measure.event_tab[index-1][6] = None print self.measure.event_tab[index-1][6] Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-09 14:34:47 UTC (rev 593) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-09 15:32:49 UTC (rev 594) @@ -97,7 +97,7 @@ #determine the coefficients to adjust the curve in the window space coeff_y = float(rect.height / 1124.00) coeff_x = float(rect.width / (self.light_measure_graph.sample - 1)) - + #Fill... context.set_line_width(2.0) context.set_source_rgb(0, 0, 1) context.move_to(rect.x - 2, rect.height + 2) @@ -107,9 +107,8 @@ context.line_to(rect.x + ((i) * coeff_x), rect.height + 5) context.close_path() context.set_source_rgba(1.0, 0, 0, 0.2) - context.fill() - + #and trace the curce context.set_line_width(1.0) context.set_source_rgb(1, 0, 0) context.move_to(rect.x - 2, rect.height + 2) Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-09 14:34:47 UTC (rev 593) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-09 15:32:49 UTC (rev 594) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_name type='str'>light_monitor</gadget_name> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_description type='str'>Light monitor for tux droid</gadget_description> <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/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-09 14:34:47 UTC (rev 593) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-09 15:32:49 UTC (rev 594) @@ -10,6 +10,7 @@ <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <help_text type='str'> </help_text> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> @@ -19,13 +20,11 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <widget_lblValue type='str'>Value (%)</widget_lblValue> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> - <conf_btnRemove type='str'>Remove</conf_btnRemove> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <speaker_name type='str'>Ryan8k</speaker_name> <conf_lblSample type='str'>Samples</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> @@ -42,9 +41,10 @@ <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <widget_lblDrop type='str'>Drop</widget_lblDrop> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Change</widget_lblChange> <widget_lblLight type='str'>Search light</widget_lblLight> @@ -60,6 +60,6 @@ <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblControl type='str'>Control</conf_lblControl> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |