'GTK calls this method after Gtk.Application.run()
Creates instances of the sidebar, terminal, console log and
statusbar to be added to the app window.
Sets up necesary actions on menu and toolbar buttons
Also reads the .xml file from menubar.xml'

def do_startup(self):

    Gtk.Application.do_startup(self)
    self.serverIO = ServerIO(CONF.getLastWorkspace())
    self.serverIO.continously_check_server_connection()
    self.ws_sidebar = WorkspaceSidebar(self.serverIO, self.change_workspace, self.remove_workspace, self.on_new_button, CONF.getLastWorkspace())
    self.hosts_sidebar = HostsSidebar(self.show_host_info, self.serverIO.get_hosts, self.serverIO.get_host, self.icons)
    self.sidebar = Sidebar(self.ws_sidebar.get_box(), self.hosts_sidebar.get_box())
    (host_count, service_count, vuln_count) = (0, 0, 0)
    self.terminal = Terminal(CONF)
    self.console_log = ConsoleLog()
    self.statusbar = Statusbar(self.on_click_notifications, self.on_click_conflicts, host_count, service_count, vuln_count)
    self.notificationsModel = Gtk.ListStore(str)
    action_to_method = {'about': self.on_about, 'quit': self.on_quit, 'preferences': self.on_preferences, 'pluginOptions': self.on_plugin_options, 'faradayPlugin': self.on_faraday_plugin, 'new': self.on_new_button, 'new_terminal': self.on_new_terminal_button, 'open_report': self.on_open_report_button, 'go_to_web_ui': self.on_click_go_to_web_ui_button, 'go_to_documentation': self.on_help_dispatch, 'go_to_faq': self.on_help_dispatch, 'go_to_troubleshooting': self.on_help_dispatch, 'go_to_demos': self.on_help_dispatch, 'go_to_issues': self.on_help_dispatch, 'go_to_forum': self.on_help_dispatch, 'go_to_irc': self.on_help_dispatch, 'go_to_twitter': self.on_help_dispatch, 'go_to_googlegroup': self.on_help_dispatch}
    for (action, method) in action_to_method.items():
        gio_action = Gio.SimpleAction.new(action, None)
        gio_action.connect('activate', method)
        self.add_action(gio_action)
    dirname = os.path.dirname(os.path.abspath(__file__))
    builder = Gtk.Builder.new_from_file((dirname + '/menubar.xml'))
    builder.connect_signals(self)
    appmenu = builder.get_object('appmenu')
    self.set_app_menu(appmenu)
    topmenu = Gio.Menu()
    pluginmenu = Gio.Menu()
    topmenu.append('Faraday    Plugin...', 'app.faradayPlugin')
    plugins = fplugin_utils.get_available_plugins()
    for plugin in sorted(plugins.iterkeys()):
        gio_action = Gio.SimpleAction.new(('fplugin_%s' % plugin), None)
        gio_action.connect('activate', self.type_faraday_plugin_command)
        self.add_action(gio_action)
        item = Gio.MenuItem.new(plugins[plugin]['prettyname'], ('app.fplugin_%s' % plugin))
        pluginmenu.append_item(item)
    fmenu = Gio.Menu()
    fmenu.append_section(None, topmenu)
    fmenu.append_section(None, pluginmenu)
    appmenu.insert_submenu(1, 'Faraday    Plugin', fmenu)
    helpMenu = builder.get_object('Help')
    self.set_menubar(helpMenu)
