Beispiel #1
0
    def __init__(self, controller, model, widget, applet):
        AbstractCuemiacView.__init__(self, controller, model)
        CuemiacAlignedWindow.__init__(self, widget, applet)
        self._controller.register_view(self)
        self.applet = applet

        GconfStore.get_instance().connect(
            "entry-width-changed", lambda s, w: self._change_entry_width(w))

        self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_MENU)
        self.applet.set_applet_flags(mateapplet.EXPAND_MINOR)
        self.applet.set_flags(gtk.CAN_FOCUS)
        self.applet.connect("change-orient", self._on_change_orient)

        self._screen_height = self.get_screen().get_height()
        self._screen_width = self.get_screen().get_width()
        self._max_window_height = int(0.8 * self._screen_height)
        self._max_window_width = int(0.6 * self._screen_width)

        self.connect("delete-event", self._controller.on_quit)
        self.connect("destroy-event", self._controller.on_quit)
        self.connect("focus-out-event", self._controller.on_quit)
        self.connect("key-press-event", self.__on_window_key_press_event)

        self.set_title("Deskbar Applet")
        self.set_default_size(self._model.get_window_width(), -1)

        self.set_role("deskbar-search-window")

        entry_width = self._model.get_entry_width()
        # Account for previous default entry width of 20
        if entry_width == 20:
            entry_width = 40
            self._model.set_entry_width(entry_width)
        self._change_entry_width(entry_width)

        # VBox
        self.add(self.vbox_main)

        # Results
        self.results_box = gtk.HBox()
        self.results_box.pack_start(self.scrolled_results)
        self.results_box.pack_start(self.actions_box)

        self.__set_layout_by_orientation(self.applet.get_orient())
        self.resize(*self.size_request())
    def __init__(self, controller, model, widget, applet):
        AbstractCuemiacView.__init__(self, controller, model)
        CuemiacAlignedWindow.__init__(self, widget, applet)
        self._controller.register_view(self)
        self.applet = applet
        
        GconfStore.get_instance().connect("entry-width-changed",
                                          lambda s, w: self._change_entry_width(w))
        
        self.set_type_hint (gtk.gdk.WINDOW_TYPE_HINT_MENU)
        self.applet.set_applet_flags(mateapplet.EXPAND_MINOR)
        self.applet.set_flags(gtk.CAN_FOCUS)
        self.applet.connect("change-orient", self._on_change_orient)
        
        self._screen_height = self.get_screen().get_height ()
        self._screen_width = self.get_screen().get_width ()
        self._max_window_height = int (0.8 * self._screen_height)
        self._max_window_width = int (0.6 * self._screen_width)
        
        self.connect("delete-event", self._controller.on_quit)
        self.connect("destroy-event", self._controller.on_quit)
        self.connect("focus-out-event", self._controller.on_quit)
        self.connect("key-press-event", self.__on_window_key_press_event)
       
        self.set_title("Deskbar Applet")
        self.set_default_size( self._model.get_window_width(), -1 )

        self.set_role("deskbar-search-window")
        
        entry_width = self._model.get_entry_width()
        # Account for previous default entry width of 20
        if entry_width == 20:
            entry_width = 40
            self._model.set_entry_width(entry_width)
        self._change_entry_width(entry_width)
        
        # VBox
        self.add(self.vbox_main)
        
        # Results
        self.results_box = gtk.HBox()
        self.results_box.pack_start(self.scrolled_results)
        self.results_box.pack_start(self.actions_box)
        
        self.__set_layout_by_orientation(self.applet.get_orient())
        self.resize( *self.size_request() )
Beispiel #3
0
 def __init__ (self, widget_to_align_with, applet, history_view):
     """
     @param widget_to_align_with: A widget the popup should align itself to.
     @param applet: A gnomeapplet.Applet instance. However - all that is needed is a .window attribute and a get_orient() method.
     @param history_view: A L{CuemiacHistoryView} instance.
     """
     CuemiacAlignedWindow.__init__ (self, widget_to_align_with, applet, window_type=gtk.WINDOW_POPUP)
     
     self.applet = applet
     self.window_group = None
     self.view = history_view
     
     self.connect('enter-notify-event', self.on_view_enter)
     self.connect('motion-notify-event', self.on_view_motion)
     self.connect('button-press-event', self.on_view_button_press)
     self.connect ("key-press-event", self.on_key_press_event)
         
     self.add (self.view)
     self.view.get_model().connect("row-deleted", self.on_row_deleted)
Beispiel #4
0
    def __init__(self, widget_to_align_with, applet, history_view):
        """
        @param widget_to_align_with: A widget the popup should align itself to.
        @param applet: A mateapplet.Applet instance. However - all that is needed is a .window attribute and a get_orient() method.
        @param history_view: A L{CuemiacHistoryView} instance.
        """
        CuemiacAlignedWindow.__init__(self,
                                      widget_to_align_with,
                                      applet,
                                      window_type=gtk.WINDOW_POPUP)

        self.applet = applet
        self.window_group = None
        self.view = history_view

        self.connect('enter-notify-event', self.on_view_enter)
        self.connect('motion-notify-event', self.on_view_motion)
        self.connect('button-press-event', self.on_view_button_press)
        self.connect("key-press-event", self.on_key_press_event)

        self.add(self.view)
        self.view.get_model().connect("row-deleted", self.on_row_deleted)