Subversion Repositories basico

Rev

Rev 166 | Rev 169 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 t00mlabs 1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
# File: window.py
4
# Author: Tomás Vírseda
5
# License: GPL v3
6
# Description: Gtk.ApplicationWindow implementation
7
 
8
import os
9
import stat
10
import time
11
import platform
12
 
13
import gi
14
gi.require_version('Gtk', '3.0')
138 t00mlabs 15
#~ gi.require_version('WebKit', '3.0')
4 t00mlabs 16
 
17
from gi.repository import GLib
18
from gi.repository import GObject
19
from gi.repository import Gtk
20
from gi.repository import Gdk
21
from gi.repository import Gio
22
from gi.repository import Pango
138 t00mlabs 23
#~ from gi.repository import WebKit
4 t00mlabs 24
from gi.repository.GdkPixbuf import Pixbuf
25
 
142 t00mlabs 26
from .widgets import Statusbar
133 t00mlabs 27
from .service import Service
4 t00mlabs 28
 
29
 
30
MONOSPACE_FONT = 'Lucida Console' if platform.system() == 'Windows' else 'monospace'
31
 
133 t00mlabs 32
class GtkAppWindow(Gtk.ApplicationWindow, Service):
4 t00mlabs 33
    def __init__(self, uiapp):
34
        self.setup_controller(uiapp)
35
        self.get_services()
142 t00mlabs 36
        self.log = self.controller.log
4 t00mlabs 37
        self.gui.add_widget('uiapp', uiapp)
38
        self.gui.set_key('cmbvalue', 'search')
39
        self.settings = {}
40
        self.settings['fullscreen'] = False
41
        self.current_notes = {}
42
 
43
        self.setup_window()
141 t00mlabs 44
        self.controller.debug("Window setup correctly")
4 t00mlabs 45
        self.setup_widgets()
141 t00mlabs 46
        self.controller.debug("Widgets setup correctly")
137 t00mlabs 47
        #~ self.setup_app()
4 t00mlabs 48
 
106 t00mlabs 49
 
4 t00mlabs 50
 
141 t00mlabs 51
 
4 t00mlabs 52
    def setup_controller(self, uiapp):
53
        self.uiapp = uiapp
54
        self.controller = uiapp.get_controller()
55
 
56
 
57
    def setup_window(self):
58
        app_title = self.controller.get_app_info('name')
59
        Gtk.Window.__init__(self, title=app_title, application=self.uiapp)
60
        self.gui.add_widget('mainwindow', self)
153 t00m 61
        icon = self.im.get_icon('basico', 48, 48)
4 t00mlabs 62
        self.set_icon(icon)
63
        # FIXME
64
        # From docs: Don’t use this function. It sets the X xlib.Window
65
        # System “class” and “name” hints for a window.
66
        # But I have to do it or it doesn't shows the right title. ???
67
        self.set_wmclass (app_title, app_title)
68
        self.set_role(app_title)
69
        self.set_default_size(1024, 728)
70
        self.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
93 t00mlabs 71
 
72
        # HEADERBAR WIDGETS
73
        self.setup_headerbar()
4 t00mlabs 74
        self.show_all()
75
 
76
 
77 t00mlabs 77
    def setup_headerbar(self):
78
        #~# Header Bar
79
        hb = self.gui.add_widget("HeaderBar", Gtk.HeaderBar())
80
        hb.set_show_close_button(True)
81
        hb.props.title = "Basico"
79 t00mlabs 82
        hb.props.subtitle = "SAP Notes Manager for SAP Consultants"
77 t00mlabs 83
 
79 t00mlabs 84
        lhbox = Gtk.HBox() # Left side of title bar
85
        mhbox = Gtk.HBox() # Mid side of title bar
86
        rhbox = Gtk.HBox() # Right side of title bar
77 t00mlabs 87
 
79 t00mlabs 88
        # Left side titlebar
131 t00mlabs 89
        button = self.gui.add_widget('tgbShowMenuView', Gtk.ToggleButton())
141 t00mlabs 90
        #~ button.connect('toggled', self.workplace.show_menu_view)
91
        button.set_active(False)
131 t00mlabs 92
        icon = self.im.get_image_icon('gtk-select-color')
93
        button.add(icon)
94
        lhbox.pack_start(button, False, False, 3)
95
 
157 t00m 96
        menuviews = self.gui.add_widget('mnuBtnViews', Gtk.Button())
130 t00mlabs 97
        hbox = Gtk.HBox()
98
        label = self.gui.add_widget('lblViewCurrent', Gtk.Label())
141 t00mlabs 99
        label.set_xalign(0.0)
130 t00mlabs 100
        image = self.gui.add_widget('imgViewCurrent', Gtk.Image())
101
        hbox.pack_start(image, False, False, 3)
102
        hbox.pack_start(label, False, False, 3)
103
        menuviews.add(hbox)
104
        lhbox.pack_start(menuviews, False, False, 3)
105
 
81 t00mlabs 106
        imgtitlebar = self.gui.add_widget('imgtitlebar', Gtk.Image())
101 t00mlabs 107
        imgtitlebar.set_visible(False)
108
        imgtitlebar.set_no_show_all(True)
79 t00mlabs 109
        lbltitlebar = self.gui.add_widget("lbltitlebar", Gtk.Label())
141 t00mlabs 110
        lbltitlebar.set_xalign(0.0)
111
        lbltitlebar.set_justify(Gtk.Justification.LEFT)
130 t00mlabs 112
        lbltitlebar.set_visible(False)
113
        lbltitlebar.set_no_show_all(True)
81 t00mlabs 114
        lhbox.pack_start(imgtitlebar, False, False, 3)
115
        lhbox.pack_start(lbltitlebar, False, False, 3)
116
        lhbox.show_all()
79 t00mlabs 117
        hb.pack_start(lhbox)
77 t00mlabs 118
 
79 t00mlabs 119
        # Middle side titlebar
130 t00mlabs 120
        label = self.gui.add_widget('lblSelectedNotes', Gtk.Label())
121
        #~ label.set_markup('<b><small>0</small>/0 of <big>%d</big></b>' % self.db.get_total())
122
        button = self.gui.add_widget('mnuBtnActions', Gtk.MenuButton())
123
        button.set_relief(Gtk.ReliefStyle.NONE)
124
        button.set_no_show_all(False)
125
        button.set_visible(False)
126
        button.add(label)
127
        mhbox.pack_start(button, False, False, 0)
128
 
78 t00mlabs 129
        # Right side titlebar
153 t00m 130
        ## Import menu
130 t00mlabs 131
        btnactions = self.gui.add_widget('mnuBtnImport', Gtk.MenuButton())
132
        btnactions.set_always_show_image(True)
133
        btnactions.set_property("use-popover", True)
134
        btnactions.set_relief(Gtk.ReliefStyle.NONE)
135
        imgwpimport = Gtk.Image()
150 t00m 136
        icon = self.im.get_pixbuf_icon('menu-add-new', 24, 24)
130 t00mlabs 137
        imgwpimport.set_from_pixbuf(icon)
138
        btnactions.add(imgwpimport)
139
        #~ actions_menu = self.gui.get_widget('actions_menu')
140
        #~ btnactions.set_menu_model(actions_menu)
141
        rhbox.pack_start(btnactions, False, False, 0)
142
 
153 t00m 143
        ## System Menu
77 t00mlabs 144
        button = Gtk.Button()
122 t00mlabs 145
        #~ button.set_tooltip_markup('<big><b>About</b></big>')
155 t00m 146
        icon = self.im.get_pixbuf_icon('menu-system', 24, 24)
81 t00mlabs 147
        image = Gtk.Image()
148
        image.set_from_pixbuf(icon)
149
        button.set_image(image)
77 t00mlabs 150
        button.set_relief(Gtk.ReliefStyle.NONE)
122 t00mlabs 151
        popover = Gtk.Popover.new(button)
150 t00m 152
        self.gui.add_widget('popover-right-menu', popover)
122 t00mlabs 153
        button.connect('clicked', self.cb.show_popover_menu, popover)
154
        #~ button.connect('clicked', self.uiapp.cb_show_about)
77 t00mlabs 155
        rhbox.pack_end(button, False, False, 0)
79 t00mlabs 156
 
122 t00mlabs 157
        # Popover body
158
        box = Gtk.Box(spacing = 0, orientation="vertical")
159
 
153 t00m 160
        ### About
122 t00mlabs 161
        hbox = Gtk.Box(spacing = 0, orientation="horizontal")
162
        icon = self.im.get_pixbuf_icon('about', 24, 24)
163
        image = Gtk.Image()
164
        image.set_from_pixbuf(icon)
165
        label = Gtk.Label("About")
166
        hbox.pack_start(image, False, False, 3)
167
        hbox.pack_start(label, False, False, 3)
168
        button = Gtk.Button()
169
        button.add(hbox)
170
        button.set_relief(Gtk.ReliefStyle.NONE)
136 t00mlabs 171
        button.connect('clicked', self.cb.show_about)
122 t00mlabs 172
        box.pack_end(button, False, False, 0)
173
 
153 t00m 174
        ### Help
122 t00mlabs 175
        hbox = Gtk.Box(spacing = 0, orientation="horizontal")
153 t00m 176
        icon = self.im.get_pixbuf_icon('basico-help', 24, 24)
93 t00mlabs 177
        image = Gtk.Image()
178
        image.set_from_pixbuf(icon)
122 t00mlabs 179
        label = Gtk.Label("Help")
180
        hbox.pack_start(image, False, False, 3)
181
        hbox.pack_start(label, False, False, 3)
182
        button = Gtk.Button()
183
        button.add(hbox)
93 t00mlabs 184
        button.set_relief(Gtk.ReliefStyle.NONE)
185
        button.connect('clicked', self.cb.show_help)
122 t00mlabs 186
        box.pack_end(button, False, False, 0)
93 t00mlabs 187
 
153 t00m 188
        ### Log viewer
122 t00mlabs 189
        hbox = Gtk.Box(spacing = 0, orientation="horizontal")
153 t00m 190
        icon = self.im.get_pixbuf_icon('basico-logviewer', 24, 24)
191
        image = Gtk.Image()
192
        image.set_from_pixbuf(icon)
193
        label = Gtk.Label("Log viewer")
194
        hbox.pack_start(image, False, False, 3)
195
        hbox.pack_start(label, False, False, 3)
196
        button = Gtk.Button()
197
        button.add(hbox)
198
        button.set_relief(Gtk.ReliefStyle.NONE)
199
        button.connect('clicked', self.cb.show_log)
200
        box.pack_end(button, False, False, 0)
201
 
202
        ### Settings
203
        hbox = Gtk.Box(spacing = 0, orientation="horizontal")
155 t00m 204
        icon = self.im.get_pixbuf_icon('basico-settings', 24, 24)
81 t00mlabs 205
        image = Gtk.Image()
206
        image.set_from_pixbuf(icon)
122 t00mlabs 207
        label = Gtk.Label("Settings")
208
        hbox.pack_start(image, False, False, 3)
209
        hbox.pack_start(label, False, False, 3)
210
        button = Gtk.Button()
211
        button.add(hbox)
79 t00mlabs 212
        button.set_relief(Gtk.ReliefStyle.NONE)
122 t00mlabs 213
        button.connect('clicked', self.cb.show_settings)
130 t00mlabs 214
        box.pack_start(button, False, False, 0)
122 t00mlabs 215
        popover.add(box)
77 t00mlabs 216
        hb.pack_end(rhbox)
79 t00mlabs 217
        hb.set_custom_title(mhbox)
77 t00mlabs 218
        self.set_titlebar(hb)
219
        hb.show_all()
220
 
221
 
84 t00mlabs 222
 
110 t00mlabs 223
    def setup_popover_settings(self, widget):
224
        #Creating a popover
225
        popover = Gtk.Popover.new(widget)
226
        #~ popover.set_size_request(50,100)
227
 
228
        box = Gtk.Box(spacing = 10, orientation="vertical")
112 t00mlabs 229
        hboxfs = Gtk.Box(spacing = 10, orientation="horizontal")
230
        lblfs = Gtk.Label('Fullscreen')
231
        swFullScreen = self.gui.add_widget('fullscreen', Gtk.Switch())
232
        swFullScreen.connect('state-set', self.uif.fullscreen)
233
        hboxfs.pack_start(lblfs, True, True, 6)
234
        hboxfs.pack_start(swFullScreen, True, True, 6)
235
        hboxfs.set_homogeneous(True)
236
        box.add(hboxfs)
110 t00mlabs 237
        popover.add(box)
238
 
239
        return popover
240
 
241
 
4 t00mlabs 242
    def setup_menus(self):
106 t00mlabs 243
        pass
4 t00mlabs 244
 
74 t00mlabs 245
 
4 t00mlabs 246
    def show_home_page(self, *args):
247
        notebook = self.gui.get_widget('notebook')
248
        notebook.set_current_page(0)
249
 
74 t00mlabs 250
 
4 t00mlabs 251
    def show_settings_page(self, *args):
101 t00mlabs 252
        sapnoteview = self.gui.get_widget('viewmenu')
4 t00mlabs 253
        sapnoteview.set_view('settings')
83 t00mlabs 254
        notebook = self.gui.get_widget('mainbox')
255
        notebook.set_current_page(5)
4 t00mlabs 256
 
74 t00mlabs 257
 
258
    def show_stats_page(self, *args):
101 t00mlabs 259
        sapnoteview = self.gui.get_widget('viewmenu')
74 t00mlabs 260
        sapnoteview.set_view('stats')
261
        notebook = self.gui.get_widget('notebook')
262
        notebook.set_current_page(4)
263
 
264
 
4 t00mlabs 265
    def show_browser_page(self, *args):
266
        notebook = self.gui.get_widget('notebook')
267
        notebook.set_current_page(1)
268
 
269
 
74 t00mlabs 270
    def hide_props_window(self):
271
        hpnnotes = self.gui.get_widget('hpnNotesManager')
272
        boxprops = self.gui.get_widget('boxPropsWidget')
273
        size = hpnnotes.get_allocation()
4 t00mlabs 274
 
74 t00mlabs 275
        boxprops.set_no_show_all(True)
276
        boxprops.hide()
277
        hpnnotes.set_position(size.width)
4 t00mlabs 278
 
74 t00mlabs 279
 
280
    def show_props_window(self):
281
        hpnnotes = self.gui.get_widget('hpnNotesManager')
282
        boxprops = self.gui.get_widget('boxPropsWidget')
283
        size = hpnnotes.get_allocation()
284
 
285
        boxprops.set_no_show_all(False)
286
        boxprops.show_all()
287
        hpnnotes.show_all()
288
        hpnnotes.set_position(size.width/5*3)
289
 
290
 
291
    def switch_props_window(self, *args):
292
        tgbprops = self.gui.get_widget('tgbShowManage')
293
 
294
        if tgbprops.get_active():
295
            self.show_props_window()
296
        else:
297
            self.hide_props_window()
298
 
299
 
4 t00mlabs 300
    def setup_widgets(self):
137 t00mlabs 301
        # Mainbox
142 t00mlabs 302
        mainbox = self.gui.add_widget('mainbox', Gtk.VBox())
137 t00mlabs 303
        mainbox.set_hexpand(True)
304
        paned = self.gui.add_widget('paned', Gtk.HPaned())
305
        paned.set_wide_handle(True)
164 t00m 306
        paned.set_position(300)
82 t00mlabs 307
 
137 t00mlabs 308
        # Paned
309
        ## Left view
166 t00m 310
        box = self.gui.add_widget('boxMenuView', Gtk.VBox())
311
        box.set_property('margin-left', 6)
312
        box.set_property('margin-right', 6)
313
        box.set_property('margin-bottom', 6)
137 t00mlabs 314
        box.set_hexpand(True)
166 t00m 315
 
316
        ### Toolbar
317
        toolbar = Gtk.Toolbar()
318
        toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
319
        toolbar.set_hexpand(True)
320
 
321
        #### Filter entry tool
322
        tool = Gtk.ToolItem.new()
323
 
324
        hbox = Gtk.HBox()
325
        widget = Gtk.HBox()
326
        label = Gtk.Label('Filter')
327
        icon = self.im.get_new_image_icon('basico-filter', 24, 24)
168 t00m 328
        widget.pack_start(icon, False, False, 3)
166 t00m 329
        widget.pack_start(label, False, False, 0)
330
        viewfilter = self.gui.add_widget('viewfilter', Gtk.Entry())
331
        viewfilter.connect('changed', self.cb.filter_viewmenu)
168 t00m 332
        hbox.pack_start(widget, False, False, 3)
166 t00m 333
        hbox.pack_start(viewfilter, True, True, 0)
334
        tool.add(hbox)
335
        tool.set_expand(True)
336
        toolbar.insert(tool, -1)
337
 
338
        box.pack_start(toolbar, False, False, 0)
339
 
340
        #### View treeview
137 t00mlabs 341
        scr = Gtk.ScrolledWindow()
342
        scr.set_hexpand(True)
343
        scr.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
164 t00m 344
        scr.set_shadow_type(Gtk.ShadowType.IN)
137 t00mlabs 345
        vwp = Gtk.Viewport()
346
        vwp.set_hexpand(True)
347
        viewsbox = self.gui.add_widget('viewsbox', Gtk.Box())
348
        viewsbox.set_hexpand(True)
349
        vwp.add(viewsbox)
350
        scr.add(vwp)
166 t00m 351
        box.pack_start(scr, True, True, 0)
137 t00mlabs 352
        paned.add1(box)
82 t00mlabs 353
 
137 t00mlabs 354
        ## Right view
168 t00m 355
        box = self.gui.add_widget('boxVisor', Gtk.VBox())
137 t00mlabs 356
        box.set_hexpand(True)
168 t00m 357
 
358
        boxtoolbar = self.gui.add_widget('boxtoolbar', Gtk.HBox())
359
        box.pack_start(boxtoolbar, False, False, 0)
360
 
137 t00mlabs 361
        scr = self.gui.add_widget('scrVisor', Gtk.ScrolledWindow())
168 t00m 362
        scr.set_shadow_type(Gtk.ShadowType.IN)
137 t00mlabs 363
        scr.set_hexpand(True)
364
        scr.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
365
        vwp = Gtk.Viewport()
366
        vwp.set_hexpand(True)
367
        notesbox = self.gui.add_widget('notesbox', Gtk.Box())
368
        notesbox.set_hexpand(True)
168 t00m 369
        notesbox.set_vexpand(True)
137 t00mlabs 370
        vwp.add(notesbox)
371
        scr.add(vwp)
168 t00m 372
        box.pack_start(scr, True, True, 0)
137 t00mlabs 373
        paned.add2(box)
142 t00mlabs 374
        mainbox.pack_start(paned, True, True, 0)
82 t00mlabs 375
 
162 t00m 376
        # Statusbar
142 t00mlabs 377
        statusbar = self.gui.add_widget('statusbar', Statusbar(self.controller))
378
        mainbox.pack_start(statusbar, False, False, 0)
379
 
137 t00mlabs 380
        self.add(mainbox)
381
        self.show_all()
82 t00mlabs 382
 
141 t00mlabs 383
        # Finally, activate Workplace
384
        self.controller.get_service('Workplace')
82 t00mlabs 385
 
137 t00mlabs 386
 
387
 
74 t00mlabs 388
    def setup_props_window(self):
389
        imgtitle = self.gui.get_widget('imgPropsTitle')
390
        icon = self.im.get_icon('fingerprint', 48, 48)
391
        imgtitle.set_from_pixbuf (icon)
392
        model = Gtk.TreeStore(str, str)
393
        trvprops = self.gui.add_widget('trvprops', Gtk.TreeView())
394
        trvprops.set_model(model)
395
 
396
        # Property
397
        renderer = Gtk.CellRendererText()
398
        renderer.set_alignment(1.0, 0.5)
399
        column = Gtk.TreeViewColumn('Property', renderer, markup=0)
400
        column.set_visible(True)
401
        column.set_expand(False)
402
        column.set_clickable(True)
403
        column.set_sort_indicator(True)
404
        trvprops.append_column(column)
405
 
406
        # Value
407
        renderer = Gtk.CellRendererText()
408
        renderer.set_alignment(0.0, 0.5)
409
        column = Gtk.TreeViewColumn('Value', renderer, markup=1)
410
        column.set_visible(True)
411
        column.set_expand(True)
412
        column.set_clickable(True)
413
        column.set_sort_indicator(True)
414
        trvprops.append_column(column)
415
        trvprops.show_all()
416
 
417
        trvprops.set_headers_visible(True)
418
        trvprops.set_enable_search(True)
419
        trvprops.set_grid_lines(Gtk.TreeViewGridLines.NONE)
420
        trvprops.set_search_column(1)
421
        #~ trvprops.connect('row-activated', self.double_click)
422
        selection = trvprops.get_selection()
423
        selection.set_mode(Gtk.SelectionMode.SINGLE)
424
        #~ trvprops.set_search_entry(self.pname)
425
 
426
        container = self.gui.get_widget('boxProps')
427
        self.gui.swap_widget(container, trvprops)
428
 
429
    def set_notes_manager_pane_position(self, pane, rectangle):
133 t00mlabs 430
        #~ self.controller.debug(type(pane.get_allocation()))
74 t00mlabs 431
        position = rectangle.width/5*3
432
        pane.set_position(position)
133 t00mlabs 433
        self.debug("Pane position: %s" % position)
74 t00mlabs 434
 
435
 
4 t00mlabs 436
    def __completion_func(self, completion, key, iter):
437
        model = completion.get_model()
438
        text = model.get_value(iter, 0)
439
        if key.upper() in text.upper():
440
            return True
441
        return False
442
 
443
 
444
    def setup_combobox_completions(self, key):
445
        model = Gtk.ListStore(str)
446
        search = self.gui.get_widget("stySearchInfo")
447
        completion = Gtk.EntryCompletion()
448
        completion.set_model(model)
449
        completion.set_text_column(0)
450
        completion.set_match_func(self.__completion_func)
451
        search.set_completion(completion)
452
 
74 t00mlabs 453
        stats = self.db.get_stats()
4 t00mlabs 454
 
455
        try:
456
            items = list(stats[key])
457
            items.sort()
458
            for item in items:
459
                model.append([item])
460
        except:
461
            pass
462
 
463
 
464
    def cb_combobox_changed(self, combobox):
465
        model = combobox.get_model()
466
        treeiter = combobox.get_active_iter()
467
        key = model[treeiter][0]
468
        self.gui.set_key('cmbvalue', key)
469
        self.setup_combobox_completions(key)
470
 
471
 
74 t00mlabs 472
    def setup_combobox_search(self):
473
        combobox = self.gui.get_widget('cmbSearchInfo')
4 t00mlabs 474
        model = Gtk.TreeStore(str, str)
475
        combobox.set_model(model)
476
 
477
        ## key
478
        cell = Gtk.CellRendererText()
479
        cell.set_visible(False)
480
        combobox.pack_start(cell, True)
481
        combobox.add_attribute(cell, 'text', 0)
482
 
483
        ## value
484
        cell = Gtk.CellRendererText()
485
        cell.set_alignment(0.0, 0.5)
486
        combobox.pack_start(cell, expand=False)
487
        combobox.add_attribute(cell, 'markup', 1)
488
        combobox.connect('changed', self.cb_combobox_changed)
489
 
101 t00mlabs 490
        model.append(None, ['search', 'Search in all database'])
491
        model.append(None, ['project', 'Filter by project name'])
492
        model.append(None, ['task', 'Filter by task name'])
493
        model.append(None, ['component', 'Filter by component'])
494
        model.append(None, ['category', 'Filter by category'])
495
        model.append(None, ['type', 'Filter by type'])
496
        model.append(None, ['id', 'Filter by Id'])
497
        model.append(None, ['title', 'Filter by title'])
498
        model.append(None, ['priority', 'Filter by priority'])
499
        model.append(None, ['version', 'Filter by version'])
4 t00mlabs 500
        #~ model.append(None, ['released', 'Filter by release date'])
501
 
502
        combobox.set_active(0)
503
 
504
 
505
    def get_services(self):
506
        """Load services to be used in this class
507
        """
508
        self.gui = self.controller.get_service("GUI")
509
        self.app = self.gui.get_app()
74 t00mlabs 510
        self.db = self.controller.get_service("DB")
4 t00mlabs 511
        self.uif = self.controller.get_service("UIF")
512
        self.prefs = self.controller.get_service("Settings")
513
        self.im = self.controller.get_service('IM')
514
        self.cb = self.controller.get_service('Callbacks')
141 t00mlabs 515
        #~ self.workplace = self.controller.get_service('Workplace')
4 t00mlabs 516
 
517
 
518
    def swap_widget(self, container, combobox):
519
        """Shortcut to GUI.swap_widget method
520
        """
521
        self.gui.swap_widget(container, combobox)