~ubuntu-branches/ubuntu/hardy/deskbar-applet/hardy-proposed

« back to all changes in this revision

Viewing changes to deskbar/ui/CuemiacWindowController.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-08-14 10:55:21 UTC
  • mfrom: (1.1.32 upstream)
  • Revision ID: james.westby@ubuntu.com-20070814105521-e8vbl4dy65zs7ozn
Tags: 2.19.90.1-0ubuntu1
* New upstream version:
  Changes:
  - Pressing enter executes default action. Pressing right displays actions.
  - Only alter label on duplicate matches if more than one 
    action is available
  - Clear actions TreeView if query changed, too
  - Wrap messages in the info area if they are too long
  - Clear actions TreeView if selection has changed
  - Added version to description of module
  - Fixed: Save and restore OpenDesktopFileAction correctly
  - Set correct icon for ISwitchWindowHandler
  - Fixed small error in web_address.py handler
  - Fixed bug #464732: Import subprocess before using it.
  - Fixed bug #464735: NotImplementedError misspelled
  - Fixed bug #464736: "loggin" typo in get_url_host exception handler
  - Fixed bug #464739: on_install_handler says module when it meant mod_id
  - Fixed bug #464768: pygtk < 2.8.0 compat code refers to 
                       obsolete DeskbarAppletButton name 
  - Fixed couple of bugs in beagle and history handlers. 
    Fixes bug #465212: 'BeagleLiveHandler' object has 
    no attribute 'set_delay'
  - Fixed bug #388508: web_address.py", line 32: startswith on None
  - Added action that sends file via e-mail as attachment
  - Adjusted default values in GConf
  - Mark applet icon insensitive when loading/initializing
  - Removed geek options from preferences dialog
  - Fixed: Module order won't be saved if reordered with Drag & Drop
  - Remake of the GUI. History is now in ComboBox. Menu and 
    statusbar is gone. Matches and actions treeview is only visible     
    if search entry has been entered.
  - Added button besides combobox to clear history
  - Added mnemonic to focus history combobox
  - Only show either matches treeview or actions treeview
  - Save and restore window position.
  - Moved handlers to modules directory
  - Honor "clear_entry" setting
  - Mark UI sensitive if modules have been loaded and before they 
    have been initialized
  - Connect to keybinding-activated signal after modules have been loaded
  - Added application name to epiphany, galeon and mozilla handlers
  - If two matches with same hash get merged alter the label
  - Pressing down on last item selects first item. 
    Pressing up on first item selects last item.
  - Categories will be skipped when navigating with up/down keys
  - Added possibility to start Deskbar unininstalled out of the box
  - Set skip-taskbar-hint to True
  - Pressing escape always clears the entry and treeviews and 
    closes the window
  - Mouse click executes default action. Ctrl+click displays list of actions.
* debian/patches/01_fix_python_interpreter.patch:
  - updated
* debian/patches/01_gpm_methods_naming_update.patch:
  - updated
* debian/patches/80-intltoolize.patch:
  - updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
        self._view.receive_focus(time)
21
21
        
22
22
    def on_quit(self, *args):
23
 
        self._view.get_toplevel().hide()
 
23
        window = self._view.get_toplevel()
 
24
        x, y = window.get_position()
 
25
        self._model.set_window_x(x)
 
26
        self._model.set_window_y(y)
 
27
        window.hide()
24
28
        return True
25
29
 
26
30
    def on_show_about(self, sender):
27
31
        show_about(self._view.get_toplevel())
28
32
        
29
33
    def on_toggle_history(self, sender):
30
 
        val = not self._view.is_history_visible()
 
34
        val = self._view.is_history_visible()
31
35
        self._model.set_show_history( val )
32
 
        self._view.show_history( val )
33
36
        
34
37
    def on_show_preferences(self, sender):
35
38
        prefs = DeskbarPreferences(self._model)
36
39
        prefs.show_run_hide(self._view.get_toplevel())
37
40
        
38
41
    def on_query_entry_changed(self, entry):
39
 
        self._view.treeview_model.clear()
 
42
        self._view.clear_results()
 
43
        self._view.clear_actions()
40
44
        self._model.stop_queries()
41
45
        # TODO: abort previous searches
42
46
        qstring = entry.get_text().strip()
43
47
        if (qstring != ""):
 
48
            self._view.show_results()
44
49
            self._model.query( qstring )
45
50
        else:
46
 
            self._view.treeview_model.clear()
 
51
            self._view.clear_all()
47
52
            
48
53
    def on_query_entry_key_press_event(self, entry, event):
49
 
        # TODO: discard still running query threads
50
 
        if (event.keyval == gtk.keysyms.Escape):
51
 
            self._view.clear_all()
52
 
            return False
53
 
        
54
54
        # For key UP to browse in history, we have either to be already in history mode, or have an empty text entry to trigger hist. mode
55
55
        up_history_condition = self._model.get_history().get_current() != None or (self._model.get_history().get_current() == None and entry.get_text() == "")
56
56
        # For key DOWN to browse history, we have to be already in history mode. Down cannot trigger history mode in that orient.
98
98
        # This emits a match-selected from the cview
99
99
        self._view.cview.emit ("row-activated", path, column)
100
100
        
 
101
    def on_treeview_cursor_changed(self, treeview):
 
102
        self._view.update_entry_icon ()
 
103
        
101
104
    def on_match_selected(self, treeview, text, match_obj, event):
102
105
        if len(match_obj.get_actions()) == 1:
103
106
            action = match_obj.get_actions()[0]
106
109
            self._view.display_actions(match_obj.get_actions(), text)
107
110
        else:
108
111
            raise Exception("Match has no action")
 
112
     
 
113
    def on_do_default_action(self, treeview, text, match_obj, event):
 
114
        action = match_obj.get_default_action()
 
115
        if action == None:
 
116
            action = match_obj.get_actions()[0]
 
117
        self.on_action_selected(treeview, text, action, event)
109
118
        
110
119
    def on_action_selected(self, treeview, text, action, event):
111
120
        self._model.get_history().add(text, action)
112
 
        
113
121
        action.activate(text)
 
122
        if self._model.get_clear_entry():
 
123
            self._view.get_entry().set_text("")
114
124
        if self._model.get_hide_after_action():
115
 
                self.on_quit()
 
125
            self.on_quit()
116
126
        
117
127
    def on_clear_history(self, sender):
118
128
        self._model.get_history().clear()
136
146
        
137
147
    def on_category_added (self, widget, cat, path):
138
148
        if cat.get_id() not in self._model.get_collapsed_cat():
139
 
            self._view.cview.expand_row (path, False)
140
 
            
141
 
    def on_window_resized(self, window, event):
142
 
        self._model.set_window_width( window.allocation.width )
143
 
        self._model.set_window_height( window.allocation.height )
144
 
        
145
 
    def on_sidebar_width_changed(self, sidebar, value):
146
 
        self._model.set_sidebar_width( sidebar.get_position() )
147
 
        
148
 
    def on_resultsview_width_changed(self, results_hpaned, value):
149
 
        self._model.set_resultsview_width( results_hpaned.get_position() )
 
 
b'\\ No newline at end of file'
 
149
            self._view.cview.expand_row (path, False)
 
 
b'\\ No newline at end of file'