~ubuntu-branches/debian/sid/gtg/sid

« back to all changes in this revision

Viewing changes to GTG/core/plugins/api.py

  • Committer: Package Import Robot
  • Author(s): Luca Falavigna
  • Date: 2013-05-05 14:23:30 UTC
  • mfrom: (17.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130505142330-a1lmq91yf5ld4zoq
Tags: 0.3-2
* Upload to unstable.
* debian/control:
  - Use canonical URIs for VCS fields
* debian/install:
  - Install bash-completion script.
* debian/links:
  - gtcli link must point to gtcli, not gtg.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
            self.__task_id = None
62
62
 
63
63
#=== Accessor methods ========================================================
64
 
 
65
64
    def is_editor(self):
66
65
        """
67
66
        Returns true if this is an Editor API
99
98
        return self.__ui
100
99
 
101
100
#=== Changing the UI =========================================================
102
 
 
103
101
    def add_menu_item(self, item):
104
102
        """Adds a menu entry to the Plugin Menu of the Main Window
105
103
        (task browser).
176
174
                Log.debug("Error removing the toolbar item in the TaskEditor:"
177
175
                          "%s" % e)
178
176
 
 
177
    def set_bgcolor_func(self, func=None):
 
178
        """ Set a function which defines a background color for each task
 
179
 
 
180
        NOTE: This function stronglye depend on browser and could be easily
 
181
        broken by changes in browser code
 
182
        """
 
183
        browser = self.__ui
 
184
 
 
185
        # set default bgcolor?
 
186
        if func is None:
 
187
            func = browser.tv_factory.task_bg_color
 
188
 
 
189
        for pane in browser.vtree_panes.itervalues():
 
190
            pane.set_bg_color(func, 'bg_color')
 
191
            pane.basetree.get_basetree().refresh_all()
 
192
 
179
193
#=== file saving/loading ======================================================
180
 
 
181
194
    def load_configuration_object(self, plugin_name, filename, \
182
195
                                  basedir=xdg_config_home):
183
196
        dirname = os.path.join(basedir, 'gtg/plugins', plugin_name)