135
135
values['open_command'] = ""
137
gui_values = self.specto.watch_db.plugin_dict[values['type']].get_add_gui_info()
137
if hasattr(self.specto.watch_db.plugin_dict[values['type']], 'get_add_gui_info'):
138
gui_values = self.specto.watch_db.plugin_dict[values['type']].get_add_gui_info()
138
139
window_options = self.watch_options[values['type']]
140
141
for key in window_options:
183
184
self.notifier.remove_notifier_entry(self.watch.id)
184
185
self.specto.watch_db.remove(self.watch.id) #remove the watch
185
186
self.specto.watch_io.remove_watch(self.watch.name)
186
self.notifier.tray.show_tooltip()
187
if self.notifier.tray:
188
self.notifier.tray.show_tooltip()
188
190
def clear_clicked(self, widget):
189
191
""" Clear the log window. """
203
205
def create_edit_gui(self):
204
206
""" Create the gui for the different kinds of watches. """
205
207
vbox_options = self.wTree.get_widget("vbox_watch_options")
208
watch_type = self.watch.type
209
self.watch_options[watch_type] = []
207
211
self.table.destroy()
211
watch_type = self.watch.type
212
values = self.specto.watch_db.plugin_dict[watch_type].get_add_gui_info()
216
if self.specto.watch_db.plugin_dict[watch_type].dbus_watch == True:
217
self.wTree.get_widget("refresh").hide()
218
self.wTree.get_widget("refresh_unit").hide()
219
self.wTree.get_widget("label_refresh1").hide()
223
if hasattr(self.specto.watch_db.plugin_dict[watch_type], 'get_add_gui_info'):
224
values = self.specto.watch_db.plugin_dict[watch_type].get_add_gui_info()
213
228
watch_values = self.watch.get_values()
215
230
if watch_values['command'] != "":
230
245
# Create the options gui
231
self.table = gtk.Table(rows=len(values), columns=2, homogeneous=False)
232
self.table.set_row_spacings(6)
233
self.table.set_col_spacings(6)
234
self.watch_options[watch_type] = {}
237
for value, widget in values:
238
table, _widget = widget.get_widget()
239
widget.set_value(watch_values[value])
240
self.table.attach(table, 0, 1, i, i + 1)
241
self.watch_options[watch_type].update({value: widget})
245
vbox_options.pack_start(self.table, False, False, 0)
247
self.table = gtk.Table(rows=len(values), columns=2, homogeneous=False)
248
self.table.set_row_spacings(6)
249
self.table.set_col_spacings(6)
250
self.watch_options[watch_type] = {}
253
for value, widget in values:
254
table, _widget = widget.get_widget()
255
widget.set_value(watch_values[value])
256
self.table.attach(table, 0, 1, i, i + 1)
257
self.watch_options[watch_type].update({value: widget})
261
vbox_options.pack_start(self.table, False, False, 0)
247
263
def command_toggled(self, widget):
248
264
sensitive = self.wTree.get_widget("check_command").get_active()