Subversion Repositories basico

Rev

Rev 252 | Rev 255 | 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 -*-
251 t00m 3
# File: mod_win.py
4 t00mlabs 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')
15
 
16
from gi.repository import GLib
17
from gi.repository import GObject
18
from gi.repository import Gtk
19
from gi.repository import Gdk
20
from gi.repository import Gio
21
from gi.repository import Pango
22
from gi.repository.GdkPixbuf import Pixbuf
23
 
243 t00m 24
from basico.core.mod_env import APP
25
from basico.widgets.wdg_menuview import SAPNoteViewMenu
254 t00m 26
from basico.widgets.wdg_visor_sapnotes import SAPNotesVisor
27
from basico.widgets.wdg_visor_annotations import AnnotationsVisor
28
from basico.widgets.wdg_visor_toolbar import VisorToolbar
243 t00m 29
from basico.widgets.wdg_about import About
30
from basico.widgets.wdg_settingsview import SettingsView
31
from basico.widgets.wdg_logviewer import LogViewer
32
from basico.widgets.wdg_annot import AnnotationWidget
33
from basico.widgets.wdg_statusbar import Statusbar
4 t00mlabs 34
 
243 t00m 35
 
236 t00m 36
class GtkAppWindow(Gtk.ApplicationWindow):
4 t00mlabs 37
    def __init__(self, uiapp):
38
        self.setup_controller(uiapp)
39
        self.get_services()
247 t00m 40
        self.app = self.srvgui.get_app()
41
        self.srvgui.add_widget('uiapp', uiapp)
236 t00m 42
        self.setup_window(uiapp)
4 t00mlabs 43
        self.setup_widgets()
230 t00m 44
        self.run()
4 t00mlabs 45
 
106 t00mlabs 46
 
182 t00m 47
    def get_services(self):
247 t00m 48
        self.srvbnr = self.controller.get_service("BNR")
49
        self.srvgui = self.controller.get_service("GUI")
50
        self.srvdtb = self.controller.get_service("DB")
51
        self.srvuif = self.controller.get_service("UIF")
52
        self.srvicm = self.controller.get_service('IM')
53
        self.srvclb = self.controller.get_service('Callbacks')
4 t00mlabs 54
 
141 t00mlabs 55
 
4 t00mlabs 56
    def setup_controller(self, uiapp):
57
        self.controller = uiapp.get_controller()
58
 
59
 
236 t00m 60
    def setup_window(self, uiapp):
243 t00m 61
        Gtk.Window.__init__(self, title=APP['name'], application=uiapp)
247 t00m 62
        icon = self.srvicm.get_icon('basico-component', 48, 48)
4 t00mlabs 63
        self.set_icon(icon)
64
        # FIXME
65
        # From docs: Don’t use this function. It sets the X xlib.Window
66
        # System “class” and “name” hints for a window.
67
        # But I have to do it or it doesn't shows the right title. ???
243 t00m 68
        self.set_wmclass (APP['name'], APP['name'])
69
        self.set_role(APP['name'])
4 t00mlabs 70
        self.set_default_size(1024, 728)
71
        self.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
230 t00m 72
        self.maximize ()
93 t00mlabs 73
        self.setup_headerbar()
4 t00mlabs 74
        self.show_all()
75
 
76
 
77 t00mlabs 77
    def setup_headerbar(self):
247 t00m 78
        hb = self.srvgui.add_widget('gtk_headerbar_container', Gtk.HeaderBar())
77 t00mlabs 79
        hb.set_show_close_button(True)
80
        hb.props.title = "Basico"
79 t00mlabs 81
        hb.props.subtitle = "SAP Notes Manager for SAP Consultants"
231 t00m 82
        lhbox = self.setup_headerbar_left(hb)
83
        hb.pack_start(lhbox)
180 t00m 84
        rhbox = self.setup_headerbar_right(hb)
203 t00m 85
 
180 t00m 86
        hb.pack_end(rhbox)
87
        self.set_titlebar(hb)
88
        hb.show_all()
89
 
182 t00m 90
 
180 t00m 91
    def setup_headerbar_left(self, hb):
231 t00m 92
        # ~ '''Left headerbar side not used by now'''
93
        lhbox = Gtk.HBox()
185 t00m 94
 
231 t00m 95
        ### Dashboard / Visor
96
        hbox = Gtk.HBox()
247 t00m 97
        icon = self.srvicm.get_pixbuf_icon('basico-dashboard', 24, 24)
231 t00m 98
        image = Gtk.Image()
99
        image.set_from_pixbuf(icon)
100
        label = Gtk.Label()
101
        hbox.pack_start(image, False, False, 3)
102
        hbox.pack_start(label, False, False, 3)
247 t00m 103
        button = self.srvgui.add_widget('gtk_button_dashboard', Gtk.Button())
231 t00m 104
        button.add(hbox)
105
        button.set_relief(Gtk.ReliefStyle.NONE)
106
        lhbox.pack_start(button, False, False, 0)
247 t00m 107
        button.connect('clicked', self.srvclb.gui_show_dashboard)
77 t00mlabs 108
 
231 t00m 109
        return lhbox
110
 
111
 
180 t00m 112
    def setup_headerbar_right(self, hb):
185 t00m 113
        rhbox = Gtk.HBox()
180 t00m 114
 
153 t00m 115
        ## System Menu
77 t00mlabs 116
        button = Gtk.Button()
247 t00m 117
        icon = self.srvicm.get_pixbuf_icon('basico-menu-system', 24, 24)
81 t00mlabs 118
        image = Gtk.Image()
119
        image.set_from_pixbuf(icon)
120
        button.set_image(image)
77 t00mlabs 121
        button.set_relief(Gtk.ReliefStyle.NONE)
122 t00mlabs 122
        popover = Gtk.Popover.new(button)
247 t00m 123
        self.srvgui.add_widget('gtk_popover_button_menu_system', popover)
124
        button.connect('clicked', self.srvclb.gui_show_popover, popover)
77 t00mlabs 125
        rhbox.pack_end(button, False, False, 0)
79 t00mlabs 126
 
122 t00mlabs 127
        # Popover body
128
        box = Gtk.Box(spacing = 0, orientation="vertical")
237 t00m 129
        popover.add(box)
122 t00mlabs 130
 
153 t00m 131
        ### About
122 t00mlabs 132
        hbox = Gtk.Box(spacing = 0, orientation="horizontal")
247 t00m 133
        icon = self.srvicm.get_pixbuf_icon('basico-about', 48, 48)
122 t00mlabs 134
        image = Gtk.Image()
135
        image.set_from_pixbuf(icon)
136
        label = Gtk.Label("About")
137
        hbox.pack_start(image, False, False, 3)
138
        hbox.pack_start(label, False, False, 3)
139
        button = Gtk.Button()
140
        button.add(hbox)
141
        button.set_relief(Gtk.ReliefStyle.NONE)
247 t00m 142
        button.connect('clicked', self.srvclb.gui_show_about)
122 t00mlabs 143
        box.pack_end(button, False, False, 0)
144
 
216 t00m 145
        # ~ ### Help
146
        # ~ hbox = Gtk.Box(spacing = 0, orientation="horizontal")
247 t00m 147
        # ~ icon = self.srvicm.get_pixbuf_icon('basico-help', 48, 48)
216 t00m 148
        # ~ image = Gtk.Image()
149
        # ~ image.set_from_pixbuf(icon)
150
        # ~ label = Gtk.Label("Help")
151
        # ~ hbox.pack_start(image, False, False, 3)
152
        # ~ hbox.pack_start(label, False, False, 3)
153
        # ~ button = Gtk.Button()
154
        # ~ button.add(hbox)
155
        # ~ button.set_relief(Gtk.ReliefStyle.NONE)
247 t00m 156
        # ~ button.connect('clicked', self.srvclb.gui_show_help)
216 t00m 157
        # ~ box.pack_end(button, False, False, 0)
158
 
159
        ### Log viewer
160
        hbox = Gtk.Box(spacing = 0, orientation="horizontal")
247 t00m 161
        icon = self.srvicm.get_pixbuf_icon('basico-logviewer', 48, 48)
216 t00m 162
        image = Gtk.Image()
163
        image.set_from_pixbuf(icon)
164
        label = Gtk.Label("Log viewer")
165
        hbox.pack_start(image, False, False, 3)
166
        hbox.pack_start(label, False, False, 3)
167
        button = Gtk.Button()
168
        button.add(hbox)
169
        button.set_relief(Gtk.ReliefStyle.NONE)
247 t00m 170
        button.connect('clicked', self.srvclb.gui_show_log)
216 t00m 171
        box.pack_end(button, False, False, 0)
172
 
153 t00m 173
        ### Settings
174
        hbox = Gtk.Box(spacing = 0, orientation="horizontal")
247 t00m 175
        icon = self.srvicm.get_pixbuf_icon('basico-settings', 48, 48)
81 t00mlabs 176
        image = Gtk.Image()
177
        image.set_from_pixbuf(icon)
122 t00mlabs 178
        label = Gtk.Label("Settings")
179
        hbox.pack_start(image, False, False, 3)
180
        hbox.pack_start(label, False, False, 3)
181
        button = Gtk.Button()
182
        button.add(hbox)
79 t00mlabs 183
        button.set_relief(Gtk.ReliefStyle.NONE)
247 t00m 184
        button.connect('clicked', self.srvclb.gui_show_settings)
130 t00mlabs 185
        box.pack_start(button, False, False, 0)
217 t00m 186
 
227 t00m 187
        ### Backup
188
        hbox = Gtk.Box(spacing = 0, orientation="horizontal")
247 t00m 189
        icon = self.srvicm.get_pixbuf_icon('basico-backup-restore', 48, 48)
227 t00m 190
        image = Gtk.Image()
191
        image.set_from_pixbuf(icon)
238 t00m 192
        label = Gtk.Label("Backup/Restore")
227 t00m 193
        hbox.pack_start(image, False, False, 3)
194
        hbox.pack_start(label, False, False, 3)
195
        button = Gtk.Button()
196
        button.add(hbox)
197
        button.set_relief(Gtk.ReliefStyle.NONE)
247 t00m 198
        # ~ button.connect('clicked', self.srvbnr.backup)
227 t00m 199
        box.pack_start(button, False, False, 0)
200
 
237 t00m 201
        box_bnr = Gtk.VBox()
202
        popover_bnr = Gtk.Popover.new(button)
203
        popover_bnr.set_position(Gtk.PositionType.LEFT)
204
        popover_bnr.add(box_bnr)
247 t00m 205
        self.srvgui.add_widget('gtk_popover_button_menu_system', popover_bnr)
206
        button.connect('clicked', self.srvclb.gui_show_popover, popover_bnr)
227 t00m 207
 
247 t00m 208
        button_backup = self.srvuif.create_button('basico-backup', 48, 48, '<b>Backup database</b> ')
209
        button_restore = self.srvuif.create_button('basico-restore', 48, 48, '<b>Restore from backup</b>')
210
        button_restore.connect('clicked', self.srvclb.gui_show_filechooser_restore)
211
        button_cache = self.srvuif.create_button('basico-restore', 48, 48, '<b>Restore from cache</b>')
212
        button_cache.connect('clicked', self.srvbnr.restore_from_cache)
237 t00m 213
        box_bnr.pack_start(button_backup, False, False, 0)
214
        box_bnr.pack_start(button_restore, False, False, 0)
238 t00m 215
        box_bnr.pack_start(button_cache, False, False, 0)
237 t00m 216
 
180 t00m 217
        return rhbox
77 t00mlabs 218
 
219
 
240 t00m 220
    def reveal_filechooser_restore(self, *args):
247 t00m 221
        revealer = self.srvgui.get_widget('gtk_revealer_restore')
240 t00m 222
        revealer.set_reveal_child(True)
223
 
224
 
225
    def file_chooser_button_clicked(self, filechooser):
226
        def find_child_classes(container, cls):
227
            return [widget for widget in container.get_children() if isinstance(widget, cls)]
228
 
229
        widget = find_child_classes(filechooser, Gtk.Button)
230
        self.controller.debug(widget.get_name())
231
 
232
    def file_chooser_close(self, *args):
233
        self.debug(args)
234
 
4 t00mlabs 235
    def setup_widgets(self):
137 t00mlabs 236
        # Mainbox
247 t00m 237
        mainbox = self.srvgui.add_widget('gtk_vbox_container_main', Gtk.VBox())
137 t00mlabs 238
        mainbox.set_hexpand(True)
247 t00m 239
        paned = self.srvgui.add_widget('gtk_hpaned', Gtk.HPaned())
178 t00m 240
        paned.set_property('margin-bottom', 6)
241
        paned.set_wide_handle(False)
164 t00m 242
        paned.set_position(300)
82 t00mlabs 243
 
137 t00mlabs 244
        # Paned
245
        ## Left view
247 t00m 246
        box = self.srvgui.add_widget('gtk_vbox_container_menu_view', Gtk.VBox())
166 t00m 247
        box.set_property('margin-left', 6)
248
        box.set_property('margin-right', 6)
176 t00m 249
        box.set_property('margin-bottom', 0)
166 t00m 250
 
251
        ### Toolbar
252
        toolbar = Gtk.Toolbar()
253
        toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
254
 
255
        #### Filter entry tool
256
        tool = Gtk.ToolItem.new()
257
 
258
        hbox = Gtk.HBox()
247 t00m 259
        viewfilter = self.srvgui.add_widget('gtk_entry_filter_view', Gtk.Entry())
260
        completion = self.srvgui.get_widget('gtk_entrycompletion_viewmenu')
242 t00m 261
        viewfilter.set_completion(completion)
247 t00m 262
        viewfilter.connect('activate', self.srvclb.gui_viewmenu_filter)
175 t00m 263
 
247 t00m 264
        icon = self.srvicm.get_pixbuf_icon('basico-refresh')
175 t00m 265
        viewfilter.set_icon_from_pixbuf(Gtk.EntryIconPosition.PRIMARY, icon)
266
        viewfilter.set_icon_sensitive(Gtk.EntryIconPosition.PRIMARY, True)
267
        viewfilter.set_icon_tooltip_markup (Gtk.EntryIconPosition.PRIMARY, "Refresh and collapse")
268
 
247 t00m 269
        icon = self.srvicm.get_pixbuf_icon('basico-filter')
175 t00m 270
        viewfilter.set_icon_from_pixbuf(Gtk.EntryIconPosition.SECONDARY, icon)
271
        viewfilter.set_icon_sensitive(Gtk.EntryIconPosition.SECONDARY, True)
272
        viewfilter.set_icon_tooltip_markup (Gtk.EntryIconPosition.SECONDARY, "Click here to expand the tree")
273
        viewfilter.set_placeholder_text("Filter this view...")
274
 
275
        def on_icon_pressed(entry, icon_pos, event):
276
            if icon_pos == Gtk.EntryIconPosition.PRIMARY:
247 t00m 277
                viewmenu = self.srvgui.get_widget('viewmenu')
175 t00m 278
                viewmenu.refresh()
279
            elif icon_pos == Gtk.EntryIconPosition.SECONDARY:
247 t00m 280
                self.srvclb.expand_menuview()
175 t00m 281
 
282
        viewfilter.connect("icon-press", on_icon_pressed)
283
 
166 t00m 284
        hbox.pack_start(viewfilter, True, True, 0)
285
        tool.add(hbox)
286
        tool.set_expand(True)
287
        toolbar.insert(tool, -1)
288
 
289
        box.pack_start(toolbar, False, False, 0)
290
 
185 t00m 291
        ### View treeview
137 t00mlabs 292
        scr = Gtk.ScrolledWindow()
293
        scr.set_hexpand(True)
294
        scr.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
164 t00m 295
        scr.set_shadow_type(Gtk.ShadowType.IN)
137 t00mlabs 296
        vwp = Gtk.Viewport()
297
        vwp.set_hexpand(True)
247 t00m 298
        viewsbox = self.srvgui.add_widget('gtk_box_container_views', Gtk.Box())
137 t00mlabs 299
        viewsbox.set_hexpand(True)
300
        vwp.add(viewsbox)
301
        scr.add(vwp)
166 t00m 302
        box.pack_start(scr, True, True, 0)
137 t00mlabs 303
        paned.add1(box)
82 t00mlabs 304
 
137 t00mlabs 305
        ## Right view
213 t00m 306
        box = Gtk.VBox()
137 t00mlabs 307
        box.set_hexpand(True)
247 t00m 308
        stack_main = self.srvgui.add_widget('gtk_stack_main', Gtk.Stack())
220 t00m 309
        stack_main.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT_RIGHT)
310
        stack_main.set_transition_duration(2500)
311
        box.pack_start(stack_main, True, True, 0)
168 t00m 312
 
216 t00m 313
        ### Visor stack
220 t00m 314
        stack_child = self.setup_stack_visor()
315
        stack_main.add_titled(stack_child, "visor", "SAP Notes Visor")
168 t00m 316
 
254 t00m 317
        ### SAP Note Visor tab
318
        # ~ tab_sapnote_visor = self.setup_tab_sapnote_visor()
319
        # ~ stack_main.add_titled(stack_child, "visor", "SAP Notes Visor")
320
 
321
        ### Annotation Visor tab
322
        # ~ tab_annotation_visor = self.setup_tab_annotations_visor()
323
        # ~ stack_main.add_titled(stack_child, "visor", "SAP Notes Visor")
324
 
215 t00m 325
        ### About stack
220 t00m 326
        stack_child = self.setup_stack_about()
327
        stack_main.add_titled(stack_child, "about", "About Basico")
207 t00m 328
 
220 t00m 329
        ### Log stack
330
        stack_child = self.setup_stack_log()
331
        stack_main.add_titled(stack_child, "log", "Log Viewer")
216 t00m 332
 
215 t00m 333
        ### Settings stack
220 t00m 334
        stack_child = self.setup_stack_settings()
335
        stack_main.add_titled(stack_child, "settings", "Basico Settings")
215 t00m 336
 
218 t00m 337
        ## Annotations
247 t00m 338
        boxannotations = self.srvgui.add_widget('gtk_vbox_container_annotations', Gtk.VBox())
220 t00m 339
 
247 t00m 340
        stack_annot = self.srvgui.add_widget('gtk_stack_annotation', Gtk.Stack())
220 t00m 341
        stack_annot.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT_RIGHT)
342
        stack_annot.set_transition_duration(2500)
343
 
344
        stack_child = self.setup_stack_annotation()
345
        stack_annot.add_titled(stack_child, "comment", "New comment")
346
        stack_annot.child_set_property (stack_child, "icon-name", "basico-comments")
347
 
348
        # ~ stack_child = self.setup_stack_annotation_link()
349
        # ~ stack_annot.add_titled(stack_child, "link", "New link")
350
        # ~ stack_annot.child_set_property (stack_child, "icon-name", "basico-browse")
351
 
247 t00m 352
        self.srvuif.set_widget_visibility('gtk_vbox_container_annotations', False)
220 t00m 353
        boxannotations.add(stack_annot)
354
 
355
 
218 t00m 356
        box.pack_start(boxannotations, True, True, 6)
137 t00mlabs 357
        paned.add2(box)
142 t00mlabs 358
        mainbox.pack_start(paned, True, True, 0)
82 t00mlabs 359
 
162 t00m 360
        # Statusbar
247 t00m 361
        statusbar = self.srvgui.add_widget('widget_statusbar', Statusbar(self.controller))
142 t00mlabs 362
        mainbox.pack_start(statusbar, False, False, 0)
363
 
203 t00m 364
        # Menu Views
365
        vbox = Gtk.VBox()
247 t00m 366
        viewsbox = self.srvgui.get_widget('gtk_box_container_views')
367
        viewmenu = self.srvgui.add_widget('viewmenu', SAPNoteViewMenu(self.controller))
203 t00m 368
        viewmenu.set_hexpand(True)
369
        viewmenu.set_vexpand(True)
370
        vbox.pack_start(viewmenu, True, True, 0)
247 t00m 371
        self.srvgui.swap_widget(viewsbox, vbox)
203 t00m 372
 
137 t00mlabs 373
        self.add(mainbox)
374
        self.show_all()
82 t00mlabs 375
 
376
 
214 t00m 377
    def setup_stack_visor(self):
378
        box = Gtk.VBox()
379
        box.set_hexpand(True)
380
 
381
        ### Toolbar
247 t00m 382
        boxtoolbar = self.srvgui.add_widget('gtk_hbox_container_toolbar', Gtk.HBox())
214 t00m 383
        box.pack_start(boxtoolbar, False, False, 0)
254 t00m 384
        visortoolbar = self.srvgui.add_widget('visortoolbar', VisorToolbar(self.controller))
247 t00m 385
        self.srvgui.swap_widget(boxtoolbar, visortoolbar)
214 t00m 386
 
387
        ### Visor
254 t00m 388
        notebook = self.srvgui.add_widget('gtk_notebook_visor', Gtk.Notebook())
389
 
390
        visor_sapnotes = self.setup_tab_sapnote_visor()
391
        notebook.append_page(visor_sapnotes, Gtk.Label('SAP Notes'))
392
 
393
        visor_annotations_page = self.setup_tab_annotations_visor()
394
        notebook.append_page(
395
            visor_annotations_page,
396
            Gtk.Image.new_from_icon_name(
397
                "help-about",
398
                Gtk.IconSize.MENU
399
            )
400
        )
401
        self.controller.debug(visor_sapnotes == visor_annotations_page)
402
        box.pack_start(notebook, True, True, 0)
403
 
404
        return box
405
 
406
    def setup_tab_sapnote_visor(self):
407
        box = Gtk.VBox()
408
        box.set_hexpand(True)
409
 
410
        # ~ ### Toolbar
411
        # ~ boxtoolbar = self.srvgui.add_widget('gtk_hbox_container_toolbar', Gtk.HBox())
412
        # ~ box.pack_start(boxtoolbar, False, False, 0)
413
        # ~ visortoolbar = self.srvgui.add_widget('visortoolbar', SAPNoteViewVisorToolbar(self.controller))
414
        # ~ self.srvgui.swap_widget(boxtoolbar, visortoolbar)
415
 
416
        ### Visor
214 t00m 417
        scr = Gtk.ScrolledWindow()
418
        scr.set_hexpand(True)
419
        scr.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
420
        vwp = Gtk.Viewport()
421
        vwp.set_hexpand(True)
254 t00m 422
        visor = self.srvgui.add_widget('visor_sapnotes', SAPNotesVisor(self.controller))
214 t00m 423
        visor.set_hexpand(True)
424
        visor.set_vexpand(True)
425
        vwp.add(visor)
426
        scr.add(vwp)
427
        box.pack_start(scr, True, True, 0)
428
        visor.show_all()
429
        box.show_all()
430
        return box
215 t00m 431
 
432
 
254 t00m 433
    def setup_tab_annotations_visor(self):
434
        box = Gtk.VBox()
435
        box.set_hexpand(True)
436
 
437
        # ~ ### Toolbar
438
        # ~ boxtoolbar = self.srvgui.add_widget('gtk_hbox_container_toolbar', Gtk.HBox())
439
        # ~ box.pack_start(boxtoolbar, False, False, 0)
440
        # ~ visortoolbar = self.srvgui.add_widget('visortoolbar', SAPNoteViewVisorToolbar(self.controller))
441
        # ~ self.srvgui.swap_widget(boxtoolbar, visortoolbar)
442
 
443
        ### Visor
444
        scr = Gtk.ScrolledWindow()
445
        scr.set_hexpand(True)
446
        scr.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
447
        vwp = Gtk.Viewport()
448
        vwp.set_hexpand(True)
449
        visor = self.srvgui.add_widget('visor_annotations', AnnotationsVisor(self.controller))
450
        visor.set_hexpand(True)
451
        visor.set_vexpand(True)
452
        vwp.add(visor)
453
        scr.add(vwp)
454
        box.pack_start(scr, True, True, 0)
455
        visor.show_all()
456
        box.show_all()
457
        return box
458
 
215 t00m 459
    def setup_stack_about(self):
460
        box = Gtk.VBox()
461
        box.set_hexpand(True)
247 t00m 462
        about = self.srvgui.add_widget('widget_about', About())
216 t00m 463
        box.pack_start(about, True, True, 0)
215 t00m 464
        box.show_all()
465
        return box
466
 
467
 
468
    def setup_stack_settings(self):
469
        box = Gtk.VBox()
470
        box.set_hexpand(True)
247 t00m 471
        settings = self.srvgui.add_widget('widget_settings', SettingsView(self.controller))
215 t00m 472
        box.pack_start(settings, True, True, 0)
473
        box.show_all()
474
        return box
216 t00m 475
 
476
    def setup_stack_log(self):
477
        box = Gtk.VBox()
478
        box.set_hexpand(True)
247 t00m 479
        logviewer = self.srvgui.add_widget('widget_logviewer', LogViewer(self.controller))
216 t00m 480
        box.pack_start(logviewer, True, True, 0)
481
        box.show_all()
482
        return box
220 t00m 483
 
484
 
485
    def setup_stack_annotation(self):
247 t00m 486
        return self.srvgui.add_widget('widget_annotation', AnnotationWidget(self.controller))
230 t00m 487
 
488
 
489
    def run(self):
247 t00m 490
        viewmenu = self.srvgui.get_widget('viewmenu')
230 t00m 491
        viewmenu.set_view('annotation')
247 t00m 492
        self.srvclb.gui_show_dashboard()
493
        # ~ self.srvclb.gui_show_about()