105
105
self.window = self.builder.get_object("window_main")
106
106
self.entry_search = self.builder.get_object("entry_search") #text search entry for all screenlets
107
107
self.iconview_available_screenlets = self.builder.get_object("iconview_available_screenlets") #the icon view for all screenlets
109
109
# Load the manager's icon and the fallback icon for individual screenlets missing an icon
110
110
self.pixbuf = gtk.gdk.pixbuf_new_from_file(screenlets.INSTALL_PREFIX + '/share/icons/screenlets.svg')
111
111
self.noimg = gtk.gdk.pixbuf_new_from_file_at_size(
199
199
self.screenlets[s] = slinfo
201
201
# Set/Update an attribute indicating if the screenlet is running
202
self.screenlets[s].active = list_r.count(s + 'Screenlet') > 0
202
# self.screenlets[s].active = list_r.count(s + 'Screenlet') > 0
205
205
def load_model (self):
728
728
else: screenlets.show_error(None,_("No HTML code found"))
731
def selection_changed (self, iconview):
732
"""Callback for handling selection changes in the IconView."""
733
# create a list of widgets to enable/disable
734
widgets = [self.cb_autostart, self.button_add,
737
self.button_reset, self.button_shortcut,
740
# set the scrolled window's size
741
self.slwindow.set_size_request(560, 300)
743
# get the currently selected icon in the iconview
744
info = self.get_selection()
746
# set the description label
747
self.label_info.set_markup('<big><b>%s </b>%s by %s</big>\n%s' % (info.name,
748
info.version, info.author, info.info))
749
# enable all of the widgets in the above list
750
for widget in widgets:
751
widget.set_sensitive(True)
753
self.cb_autostart.set_active(info.autostart)
754
self.button_delete.set_sensitive(not info.system)
756
# set the description label
757
self.label_info.set_label('')
759
# disable all of the widgets
760
for widget in widgets:
761
widget.set_sensitive(False)
763
self.cb_autostart.set_active(False)
765
732
def item_activated (self, iconview, item):
766
733
"""Callback for handling doubleclick/ENTER in the IconView."""
804
771
def temp_file_changed (self, file_obj, path):
805
772
self.load_screenlets()
806
773
self.load_model()
809
775
def start (self):
776
"""Start the main gtk loop."""
812
#"delete_event" is called when user is closing window using window manager button
779
def on_window_main_destroy(self, widget, data=None):
780
"""Callback function for Gmain_window destroy signal"""
813
783
def delete_event (self, widget, event):
784
"""This function is called when user is closing window using window manager button """
814
785
gtk.widget_pop_colormap()
815
786
log.info("%s: Quit!", APP_NAME)
816
787
return False #"return True" would prevent windows manager from closing application
818
789
@dbus.service.method(IFACE)
819
790
def quit (self, *args):
791
"""Quit from the main gtk loop."""
820
792
log.info("Closing : %s", APP_NAME)
823
def on_window_main_destroy(self, widget, data=None):
826
795
if __name__ == '__main__':
827
796
app = ScreenletsManager()