Esempio n. 1
0
    def __init__(self):
        self.graph = xdot.Graph()

        self.vbox = gtk.VBox()

        self.widget = DotTipWidget()

        zoomin_button = gtk.Button(stock=gtk.STOCK_ZOOM_IN)
        zoomin_button.connect('clicked', self.widget.on_zoom_in)
        zoomout_button = gtk.Button(stock=gtk.STOCK_ZOOM_OUT)
        zoomout_button.connect('clicked', self.widget.on_zoom_out)
        zoomfit_button = gtk.Button(stock=gtk.STOCK_ZOOM_FIT)
        zoomfit_button.connect('clicked', self.widget.on_zoom_fit)
        zoom100_button = gtk.Button(stock=gtk.STOCK_ZOOM_100)
        zoom100_button.connect('clicked', self.widget.on_zoom_100)

        self.graph_disconnect_button = gtk.ToggleButton('_DISconnect')
        self.graph_disconnect_button.set_active(False)
        self.graph_update_button = gtk.Button('_Update')
        self.graph_update_button.set_sensitive(False)

        bbox = gtk.HButtonBox()
        bbox.add(zoomin_button)
        bbox.add(zoomout_button)
        bbox.add(zoomfit_button)
        bbox.add(zoom100_button)
        bbox.add(self.graph_disconnect_button)
        bbox.add(self.graph_update_button)
        bbox.set_layout(gtk.BUTTONBOX_SPREAD)

        self.vbox.pack_start(self.widget)
        self.vbox.pack_start(bbox, False)
Esempio n. 2
0
    def __init__(self):
        gtk.Window.__init__(self)
        self.set_title('Dot Viewer')
        self.set_default_size(512, 512)
        vbox = gtk.VBox()
        self.add(vbox)

        self.graph = xdot.Graph()
        self.widget = xdot.DotWidget()
        self.uimanager = gtk.UIManager()

        accelgroup = self.uimanager.get_accel_group()
        self.add_accel_group(accelgroup)

        actiongroup = gtk.ActionGroup('Actions')
        actiongroup.add_actions((
            ('Reload', gtk.STOCK_REFRESH, None, None, None, self.on_reload),
            ('ZoomIn', gtk.STOCK_ZOOM_IN, None, None, None,
             self.widget.on_zoom_in),
            ('ZoomOut', gtk.STOCK_ZOOM_OUT, None, None, None,
             self.widget.on_zoom_out),
            ('ZoomFit', gtk.STOCK_ZOOM_FIT, None, None, None,
             self.widget.on_zoom_fit),
            ('Zoom100', gtk.STOCK_ZOOM_100, None, None, None,
             self.widget.on_zoom_100),
        ))
        self.uimanager.insert_action_group(actiongroup, 0)

        self.uimanager.add_ui_from_string(self.ui)
        toolbar = self.uimanager.get_widget('/ToolBar')
        vbox.pack_start(toolbar, False)
        vbox.pack_start(self.widget)
        self.set_focus(self.widget)
        self.show_all()
Esempio n. 3
0
    def __init__(self,
                 suite,
                 suiterc,
                 template_vars,
                 orientation="TB",
                 should_hide=False,
                 start_point_string=None,
                 stop_point_string=None,
                 interactive=True):
        self.suite = suite
        self.suiterc = None
        self.template_vars = template_vars
        self.orientation = orientation
        self.should_hide = should_hide
        self.start_point_string = start_point_string
        self.stop_point_string = stop_point_string
        self.interactive = interactive

        self.outfile = None
        self.disable_output_image = False
        self.file = suiterc
        self.filter_recs = []

        util.setup_icons()
        gtk.Window.__init__(self)
        self.graph = xdot.Graph()
        self.set_icon(util.get_icon())
        self.set_default_size(512, 512)
        self.vbox = gtk.VBox()
        self.add(self.vbox)
        self.widget = xdot.DotWidget()
Esempio n. 4
0
    def __init__(self):
        gtk.Window.__init__(self)
        self.set_icon_from_file(W3AF_ICON)

        self.graph = xdot.Graph()

        window = self

        window.set_title('HTTP Response Cluster')
        window.set_default_size(512, 512)
        vbox = gtk.VBox()
        window.add(vbox)

        self.widget = xdot.DotWidget()

        # Create a UIManager instance
        uimanager = self.uimanager = gtk.UIManager()

        # Add the accelerator group to the toplevel window
        accelgroup = uimanager.get_accel_group()
        window.add_accel_group(accelgroup)

        # Create an ActionGroup
        actiongroup = gtk.ActionGroup('Actions')
        self.actiongroup = actiongroup

        # Create actions
        actiongroup.add_actions((
            ('ZoomIn', gtk.STOCK_ZOOM_IN, None, None, None,
             self.widget.on_zoom_in),
            ('ZoomOut', gtk.STOCK_ZOOM_OUT, None, None, None,
             self.widget.on_zoom_out),
            ('ZoomFit', gtk.STOCK_ZOOM_FIT, None, None, None,
             self.widget.on_zoom_fit),
            ('Zoom100', gtk.STOCK_ZOOM_100, None, None, None,
             self.widget.on_zoom_100),
        ))

        # Add the actiongroup to the uimanager
        uimanager.insert_action_group(actiongroup, 0)

        # Add a UI description
        uimanager.add_ui_from_string(self.ui)

        # Create a Toolbar
        toolbar = uimanager.get_widget('/ToolBar')
        vbox.pack_start(toolbar, False)

        vbox.pack_start(self.widget)

        self.set_focus(self.widget)

        self.show_all()
Esempio n. 5
0
    def update_graph(self):
        """ update dot code based on the interested keys """
        funcs = set(self.interest.keys())
        if len(funcs) <= 0:
            self.widget.graph = xdot.Graph()
            return

        dotcode = "digraph G {"
        for func in funcs:
            dotcode += "\"%s\";" % func
            allFuncs, funsCalled = self.functionsCalled(func)
            for m in (allFuncs & funcs):
                dotcode += "\"%s\" -> \"%s\";" % (func, m)
        dotcode += "}"
        self.set_dotcode(dotcode)

        # saving the data.
        if self.filename is not None:
            fileObj = open(self.filename, "w")
            fileObj.write("// %s\n" % self.working_dir)
            fileObj.write("// %s\n" % ' '.join(funcs))
            fileObj.write(dotcode)
            fileObj.close()
Esempio n. 6
0
    def __init__(self,
                 suite,
                 suiterc,
                 start_point_string,
                 stop_point_string,
                 template_vars,
                 orientation="TB",
                 subgraphs_on=False,
                 ignore_suicide=True,
                 should_hide=False):
        self.outfile = None
        self.disable_output_image = False
        self.suite = suite
        self.file = suiterc
        self.suiterc = None
        self.orientation = orientation
        self.subgraphs_on = subgraphs_on
        self.template_vars = template_vars
        self.ignore_suicide = ignore_suicide
        self.start_point_string = start_point_string
        self.stop_point_string = stop_point_string
        self.filter_recs = []

        util.setup_icons()

        gtk.Window.__init__(self)

        self.graph = xdot.Graph()

        window = self

        window.set_title('Cylc Suite Dependency Graph Viewer')
        window.set_default_size(512, 512)
        window.set_icon(util.get_icon())
        vbox = gtk.VBox()
        window.add(vbox)

        self.widget = xdot.DotWidget()

        # Create a UIManager instance
        uimanager = self.uimanager = gtk.UIManager()

        # Add the accelerator group to the toplevel window
        accelgroup = uimanager.get_accel_group()
        window.add_accel_group(accelgroup)

        # Create an ActionGroup
        actiongroup = gtk.ActionGroup('Actions')
        self.actiongroup = actiongroup

        # create new stock icons for group and ungroup actions
        imagedir = os.environ['CYLC_DIR'] + '/images/icons'
        factory = gtk.IconFactory()
        for i in ['group', 'ungroup']:
            pixbuf = gtk.gdk.pixbuf_new_from_file(imagedir + '/' + i + '.png')
            iconset = gtk.IconSet(pixbuf)
            factory.add(i, iconset)
        factory.add_default()

        actiongroup.add_actions((
            ('ZoomIn', gtk.STOCK_ZOOM_IN, None, None, 'Zoom In',
             self.widget.on_zoom_in),
            ('ZoomOut', gtk.STOCK_ZOOM_OUT, None, None, 'Zoom Out',
             self.widget.on_zoom_out),
            ('ZoomFit', gtk.STOCK_ZOOM_FIT, None, None, 'Zoom Fit',
             self.widget.on_zoom_fit),
            ('Zoom100', gtk.STOCK_ZOOM_100, None, None, 'Zoom 100',
             self.widget.on_zoom_100),
            ('Group', 'group', 'Group', None, 'Group All Families',
             self.group_all),
            ('UnGroup', 'ungroup', 'Ungroup', None, 'Ungroup All Families',
             self.ungroup_all),
            ('Refresh', gtk.STOCK_REFRESH, None, None, 'Refresh',
             self.on_refresh),
            ('Save', gtk.STOCK_SAVE_AS, None, None, 'Save', self.save_action),
        ))
        actiongroup.add_toggle_actions(
            (('LeftToRight', 'transpose', 'Transpose', None,
              'Transpose the graph', self.on_left_to_right), ))
        actiongroup.add_toggle_actions(
            (('Subgraphs', gtk.STOCK_LEAVE_FULLSCREEN, 'Cycle Point Subgraphs',
              None, 'Organise by cycle point', self.on_subgraphs), ))
        actiongroup.add_toggle_actions(
            (('IgnoreSuicide', gtk.STOCK_CANCEL, 'Ignore Suicide Triggers',
              None, 'Ignore Suicide Triggers', self.on_igsui), ))

        # Add the actiongroup to the uimanager
        uimanager.insert_action_group(actiongroup, 0)

        # Add a UI descrption
        uimanager.add_ui_from_string(self.ui)

        left_to_right_toolitem = uimanager.get_widget('/ToolBar/LeftToRight')
        left_to_right_toolitem.set_active(self.orientation == "LR")

        subgraphs_toolitem = uimanager.get_widget('/ToolBar/Subgraphs')
        subgraphs_toolitem.set_active(self.subgraphs_on)

        igsui_toolitem = uimanager.get_widget('/ToolBar/IgnoreSuicide')
        igsui_toolitem.set_active(self.ignore_suicide)

        # Create a Toolbar

        toolbar = uimanager.get_widget('/ToolBar')
        vbox.pack_start(toolbar, False)
        vbox.pack_start(self.widget)

        eb = gtk.EventBox()
        eb.add(gtk.Label("right-click on nodes to control family grouping"))
        eb.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('#8be'))
        vbox.pack_start(eb, False)

        self.set_focus(self.widget)

        if not should_hide:
            self.show_all()
        self.load_config()
Esempio n. 7
0
    def __init__(self,
                 suite,
                 suiterc,
                 template_vars,
                 orientation="TB",
                 should_hide=False):
        self.outfile = None
        self.disable_output_image = False
        self.suite = suite
        self.file = suiterc
        self.suiterc = None
        self.orientation = orientation
        self.template_vars = template_vars
        self.start_point_string = None
        self.stop_point_string = None
        self.filter_recs = []

        util.setup_icons()

        gtk.Window.__init__(self)

        self.graph = xdot.Graph()

        window = self

        window.set_title('Cylc Suite Runtime Inheritance Graph Viewer')
        window.set_default_size(512, 512)
        window.set_icon(util.get_icon())

        vbox = gtk.VBox()
        window.add(vbox)

        self.widget = xdot.DotWidget()

        # Create a UIManager instance
        uimanager = self.uimanager = gtk.UIManager()

        # Add the accelerator group to the toplevel window
        accelgroup = uimanager.get_accel_group()
        window.add_accel_group(accelgroup)

        # Create an ActionGroup
        actiongroup = gtk.ActionGroup('Actions')
        self.actiongroup = actiongroup

        actiongroup.add_actions((
            ('ZoomIn', gtk.STOCK_ZOOM_IN, None, None, 'Zoom In',
             self.widget.on_zoom_in),
            ('ZoomOut', gtk.STOCK_ZOOM_OUT, None, None, 'Zoom Out',
             self.widget.on_zoom_out),
            ('ZoomFit', gtk.STOCK_ZOOM_FIT, None, None, 'Zoom Fit',
             self.widget.on_zoom_fit),
            ('Zoom100', gtk.STOCK_ZOOM_100, None, None, 'Zoom 100',
             self.widget.on_zoom_100),
            ('Refresh', gtk.STOCK_REFRESH, None, None, 'Refresh',
             self.on_refresh),
            ('Save', gtk.STOCK_SAVE_AS, None, None, 'Save', self.save_action),
        ))
        actiongroup.add_toggle_actions(
            (('LeftToRight', 'transpose', 'Transpose', None,
              'Transpose the graph', self.on_left_to_right), ))

        # Add the actiongroup to the uimanager
        uimanager.insert_action_group(actiongroup, 0)

        # Add a UI descrption
        uimanager.add_ui_from_string(self.ui)

        left_to_right_toolitem = uimanager.get_widget('/ToolBar/LeftToRight')
        left_to_right_toolitem.set_active(self.orientation == "LR")

        # Create a Toolbar

        toolbar = uimanager.get_widget('/ToolBar')
        vbox.pack_start(toolbar, False)
        vbox.pack_start(self.widget)

        self.set_focus(self.widget)

        if not should_hide:
            self.show_all()
        self.load_config()
Esempio n. 8
0
    def __init__(self, envName, dp):
        gtk.Window.__init__(self)
        self.dbProxy = dp
        self.graph = xdot.Graph()

        window = self

        window.set_title(envName + ' Context Model')
        if (envName != ''):
            self.environment = self.dbProxy.dimensionObject(
                envName, 'environment')
        window.set_default_size(512, 512)
        vbox = gtk.VBox()
        window.add(vbox)

        self.widget = ContextDotWidget()

        # Create a UIManager instance
        uimanager = self.uimanager = gtk.UIManager()

        # Add the accelerator group to the toplevel window
        accelgroup = uimanager.get_accel_group()
        window.add_accel_group(accelgroup)

        # Create an ActionGroup
        actiongroup = gtk.ActionGroup('Actions')
        self.actiongroup = actiongroup

        # Create actions
        actiongroup.add_actions((
            ('Refresh', gtk.STOCK_REFRESH, None, None, None, self.on_refresh),
            ('Print', gtk.STOCK_PRINT, None, None, None, self.on_print),
            ('ZoomIn', gtk.STOCK_ZOOM_IN, None, None, None,
             self.widget.on_zoom_in),
            ('ZoomOut', gtk.STOCK_ZOOM_OUT, None, None, None,
             self.widget.on_zoom_out),
            ('ZoomFit', gtk.STOCK_ZOOM_FIT, None, None, None,
             self.widget.on_zoom_fit),
            ('Zoom100', gtk.STOCK_ZOOM_100, None, None, None,
             self.widget.on_zoom_100),
        ))

        # Add the actiongroup to the uimanager
        uimanager.insert_action_group(actiongroup, 0)

        # Add a UI descrption
        uimanager.add_ui_from_string(self.ui)

        # Create a Toolbar
        toolbar = uimanager.get_widget('/ToolBar')
        vbox.pack_start(toolbar, False)

        cBox = gtk.HBox()
        vbox.pack_start(cBox, False)
        environmentFrame = gtk.Frame()
        environmentFrame.set_label("Environment")
        environmentFrame.set_shadow_type(gtk.SHADOW_ETCHED_IN)
        cBox.pack_start(environmentFrame)
        self.environmentCombo = gtk.ComboBoxEntry()
        environmentFrame.add(self.environmentCombo)

        vbox.pack_start(self.widget)

        lBox = gtk.HBox()
        vbox.pack_start(lBox, False)
        lFrame = gtk.Frame()
        lFrame.set_label("Layout")
        lFrame.set_shadow_type(gtk.SHADOW_ETCHED_IN)
        lBox.pack_start(lFrame)
        self.layoutCombo = gtk.ComboBoxEntry()
        lFrame.add(self.layoutCombo)

        layoutModel = gtk.ListStore(str)
        layoutModel.append(['Hierarchical'])
        layoutModel.append(['Spring'])
        layoutModel.append(['Radial'])
        layoutModel.append(['Circular'])
        self.layoutCombo.set_model(layoutModel)
        self.layoutCombo.set_text_column(0)

        self.layoutCombo.set_active(0)
        self.layoutHandlerId = self.layoutCombo.connect(
            'changed', self.onLayoutChange)
        self.set_focus(self.widget)
        self.show_all()
Esempio n. 9
0
    def __init__(self, suite, suiterc, template_vars,
            template_vars_file, watch, orientation="TB" ):
        self.outfile = None
        self.disable_output_image = False
        self.suite = suite
        self.file = suiterc
        self.suiterc = None
        self.watch = []
        self.orientation = orientation
        self.template_vars = template_vars
        self.template_vars_file = template_vars_file

        gtk.Window.__init__(self)

        self.graph = xdot.Graph()

        window = self

        window.set_title('Suite Runtime Namespace Graph Viewer')
        window.set_default_size(512, 512)
        window.set_icon( util.get_icon() )

        vbox = gtk.VBox()
        window.add(vbox)

        self.widget = xdot.DotWidget()

        # Create a UIManager instance
        uimanager = self.uimanager = gtk.UIManager()

        # Add the accelerator group to the toplevel window
        accelgroup = uimanager.get_accel_group()
        window.add_accel_group(accelgroup)

        # Create an ActionGroup
        actiongroup = gtk.ActionGroup('Actions')
        self.actiongroup = actiongroup

        # create new stock icons for group and ungroup actions
        imagedir = os.environ[ 'CYLC_DIR' ] + '/images/icons'
        factory = gtk.IconFactory()
        for i in [ 'group', 'ungroup' ]:
            pixbuf = gtk.gdk.pixbuf_new_from_file( imagedir + '/' + i + '.png' )
            iconset = gtk.IconSet(pixbuf)
            factory.add( i, iconset )
        factory.add_default()

        # Create actions
        actiongroup.add_actions((
            ('ZoomIn', gtk.STOCK_ZOOM_IN, None, None, 'Zoom In', self.widget.on_zoom_in),
            ('ZoomOut', gtk.STOCK_ZOOM_OUT, None, None, 'Zoom Out', self.widget.on_zoom_out),
            ('ZoomFit', gtk.STOCK_ZOOM_FIT, None, None, 'Zoom Fit', self.widget.on_zoom_fit),
            ('Zoom100', gtk.STOCK_ZOOM_100, None, None, 'Zoom 100', self.widget.on_zoom_100),
            ('Save', gtk.STOCK_SAVE_AS, None, None, 'Save', self.save_action ),
        ))
        actiongroup.add_toggle_actions((
            ('Landscape', gtk.STOCK_JUMP_TO, None, None, 'Landscape', self.on_landscape),
        ))

        # Add the actiongroup to the uimanager
        uimanager.insert_action_group(actiongroup, 0)

        # Add a UI descrption
        uimanager.add_ui_from_string(self.ui)

        landscape_toolitem = uimanager.get_widget('/ToolBar/Landscape')
        landscape_toolitem.set_active(self.orientation == "LR")

        # Create a Toolbar

        toolbar = uimanager.get_widget('/ToolBar')
        vbox.pack_start(toolbar, False)
        vbox.pack_start(self.widget)

        #eb = gtk.EventBox()
        #eb.add( gtk.Label( "right-click on nodes to control family grouping" ) )
        #eb.modify_bg( gtk.STATE_NORMAL, gtk.gdk.color_parse( '#8be' ) ) 
        #vbox.pack_start( eb, False )

        self.set_focus(self.widget)

        # find all suite.rc include-files
        self.rc_mtimes = {}
        self.rc_last_mtimes = {}
        for rc in watch:
            while True:
                try:
                    self.rc_last_mtimes[rc] = os.stat(rc).st_mtime
                except OSError:
                    # this happens occasionally when the file is being edited ... 
                    print >> sys.stderr, "Failed to get rc file mod time, trying again in 1 second"
                    time.sleep(1)
                else:
                    #self.rc_mtimes[rc] = self.rc_last_mtimes[rc]
                    break

        self.show_all()
        while True:
            if self.load_config():
                break
            else:
                time.sleep(1)
Esempio n. 10
0
    def __init__(self):
        gtk.Window.__init__(self)
        self.graph = xdot.Graph()
        window = self
        window.set_default_size(800, 600)
        window.set_position(gtk.WIN_POS_CENTER)
        DBConnection.open_connection()

        # Global variables needed for interface.
        self.pid = None
        self.tid = None
        self.aid = None
        self.selectparent = False
        self.selectchild = False
        self.tooltips = gtk.Tooltips()

        # Treeview containing all tags.
        self.taglist = gtk.ListStore(str)
        self.tagtree = gtk.TreeView(self.taglist)
        tagselection = self.tagtree.get_selection()
        tagselection.set_mode(gtk.SELECTION_MULTIPLE)
        self.tagtree.set_enable_search(True)
        self.tagtree.set_search_column(0)
        self.tagtree.get_selection().connect(
            'changed', lambda s: self.on_tagtreeview_selection_changed(s))
        self.tagtree.append_column(
            gtk.TreeViewColumn("", gtk.CellRendererText(), text=0))
        self.tagtree.set_headers_visible(False)

        # Treeview containing projects.
        self.projectlist = gtk.ListStore(int, str, str)
        self.projecttree = gtk.TreeView(self.projectlist)
        self.projecttree.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
        self.projecttree.set_enable_search(True)
        self.projecttree.set_search_column(1)
        self.projecttree.append_column(
            gtk.TreeViewColumn("Projects",
                               gtk.CellRendererText(),
                               text=1,
                               foreground=2))
        self.projecttree.get_selection().connect(
            'changed', lambda s: self.on_projecttreeview_selection_changed(s))
        self.projecttree.set_headers_visible(False)

        # Treeview containing actions
        self.actionlist = gtk.ListStore(int, str, int, bool)
        self.actiontree = gtk.TreeView(self.actionlist)
        self.actiontree.get_selection().connect(
            'changed', lambda s: self.on_actiontreeview_selection_changed(s))
        actionselection = self.tagtree.get_selection()
        actionselection.set_mode(gtk.SELECTION_MULTIPLE)
        self.checkbox = gtk.CellRendererToggle()
        self.checkbox.set_property('activatable', True)
        self.column1 = gtk.TreeViewColumn("Completed", self.checkbox)
        self.column1.add_attribute(self.checkbox, "active", 3)
        self.column1.set_max_width(100)
        self.checkbox.connect('toggled', self.on_action_toggled,
                              self.actionlist)
        self.actiontree.append_column(self.column1)
        self.actiontree.append_column(
            gtk.TreeViewColumn("Action", gtk.CellRendererText(), text=1))
        self.actiontree.set_headers_visible(False)

        # Code to visualise the properties of a project.
        self.projectproperties = gtk.VBox()
        self.projectproperties.set_size_request(175, 155)
        label = gtk.Label()
        label.set_alignment(0, 0)
        label.set_markup("<big><b>Project Details</b></big>")
        self.projectproperties.pack_start(label, False)
        label = gtk.Label("Name")
        label.set_alignment(0.0, 0.0)
        self.projectproperties.pack_start(label, False)
        self.ProjectNameEntry = gtk.Entry(max=50)
        self.ProjectNameEntry.set_sensitive(False)
        self.ProjectNameEntry.modify_text(gtk.STATE_INSENSITIVE,
                                          gtk.gdk.color_parse("#000000"))
        self.projectproperties.pack_start(self.ProjectNameEntry, False)
        hbox = gtk.HBox()
        vbox = gtk.VBox()
        label = gtk.Label("Status")
        label.set_alignment(0.0, 0.0)
        vbox.pack_start(label)
        self.ProjectStatusCombo = gtk.combo_box_new_text()
        for status in statuslist:
            self.ProjectStatusCombo.append_text(status)
        self.handlerid = self.ProjectStatusCombo.connect(
            'changed', self.on_status_change_project)
        vbox.pack_start(self.ProjectStatusCombo)
        self.ProjectPriorityEntry = gtk.Entry(max=3)
        self.ProjectPriorityEntry.set_sensitive(False)
        self.ProjectPriorityEntry.modify_text(gtk.STATE_INSENSITIVE,
                                              gtk.gdk.color_parse("#000000"))
        hbox.pack_start(vbox, False)
        vbox = gtk.VBox()
        label = gtk.Label("Priority")
        label.set_alignment(0.0, 0.0)
        vbox.pack_start(label)
        vbox.pack_start(self.ProjectPriorityEntry)
        hbox.pack_start(vbox)
        self.projectproperties.pack_start(hbox, False, padding=5)

        # Code to visualise the properties of a task.
        self.TaskProperties = gtk.VBox()
        self.TaskProperties.set_size_request(200, 155)
        header = gtk.HBox()
        label = gtk.Label()
        label.set_alignment(0, 0)
        label.set_markup("<big><b>Task</b></big>")
        header.pack_start(label)
        image = gtk.Image()
        image.set_from_file("data/add.png")
        btnaddtask = gtk.Button()
        self.tooltips.set_tip(btnaddtask, "Add Task")
        btnaddtask.add(image)
        btnaddtask.connect('clicked', self.add_task)
        image = gtk.Image()
        image.set_from_file("data/remove.png")
        btnremtask = gtk.Button()
        self.tooltips.set_tip(btnremtask, "Remove Task")
        btnremtask.add(image)
        btnremtask.connect('clicked', self.remove_task)
        image = gtk.Image()
        image.set_from_file("data/edit.png")
        btnedttask = gtk.Button()
        self.tooltips.set_tip(btnedttask, "Edit Task")
        btnedttask.add(image)
        btnedttask.connect('clicked', self.edit_task)
        header.pack_start(btnaddtask, False)
        header.pack_start(btnremtask, False)
        header.pack_start(btnedttask, False)
        self.TaskProperties.pack_start(header, False)
        label = gtk.Label("Name")
        label.set_alignment(0, 0)
        self.TaskProperties.pack_start(label, False)
        self.TaskNameEntry = gtk.Entry(max=50)
        self.TaskNameEntry.set_sensitive(False)
        self.TaskNameEntry.modify_text(gtk.STATE_INSENSITIVE,
                                       gtk.gdk.color_parse("#000000"))
        self.TaskProperties.pack_start(self.TaskNameEntry, False)
        hbox = gtk.HBox()
        vbox = gtk.VBox()
        label = gtk.Label("Status")
        label.set_alignment(0, 0)
        vbox.pack_start(label)
        self.TaskStatusCombo = gtk.combo_box_new_text()
        for status in statuslist:
            self.TaskStatusCombo.append_text(status)
        self.TaskStatusCombo.connect('changed', self.on_status_change_task)
        vbox.pack_start(self.TaskStatusCombo)
        self.TaskDueDateEntry = gtk.Entry(max=10)
        self.TaskDueDateEntry.set_sensitive(False)
        self.TaskDueDateEntry.modify_text(gtk.STATE_INSENSITIVE,
                                          gtk.gdk.color_parse("#000000"))
        hbox.pack_start(vbox, False)
        vbox = gtk.VBox()
        label = gtk.Label("Due Date")
        label.set_alignment(0, 0)
        vbox.pack_start(label)
        vbox.pack_start(self.TaskDueDateEntry)
        hbox.pack_start(vbox)
        self.TaskProperties.pack_start(hbox, False, padding=5)
        hbox = gtk.HBox()
        btntoggleparent = gtk.Button('Toggle Parent')
        btntoggleparent.connect('clicked', self.toggle_parent_selection)
        hbox.pack_start(btntoggleparent)
        btntogglechild = gtk.Button('Toggle Child')
        btntogglechild.connect('clicked', self.toggle_child_selection)
        hbox.pack_start(btntogglechild)
        self.TaskProperties.pack_start(hbox)

        # Code to visualise all actions belonging to a task.
        self.actions = gtk.VBox()
        self.actions.set_size_request(400, 155)
        header = gtk.HBox()
        label = gtk.Label()
        label.set_alignment(0, 0)
        label.set_markup("<big><b>Actions</b></big>")
        header.pack_start(label)
        image = gtk.Image()
        image.set_from_file("data/add.png")
        btnaddact = gtk.Button()
        self.tooltips.set_tip(btnaddact, "Add Action")
        btnaddact.add(image)
        btnaddact.connect('clicked', self.add_action)
        image = gtk.Image()
        image.set_from_file("data/remove.png")
        btnremact = gtk.Button()
        self.tooltips.set_tip(btnremact, "Remove Action")
        btnremact.add(image)
        btnremact.connect('clicked', self.remove_action)
        image = gtk.Image()
        image.set_from_file("data/edit.png")
        btnedtact = gtk.Button()
        self.tooltips.set_tip(btnedtact, "Edit Action")
        btnedtact.add(image)
        btnedtact.connect('clicked', self.edit_action)
        btncnvact = gtk.Button('To Task')
        self.tooltips.set_tip(btncnvact, "Convert Action to Task")
        btncnvact.connect('clicked', self.convert_action_to_task)
        header.pack_start(btnaddact, False)
        header.pack_start(btnremact, False)
        header.pack_start(btnedtact, False)
        header.pack_start(btncnvact, False)
        self.actions.pack_start(header, False)
        scroller = gtk.ScrolledWindow()
        scroller.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
        scroller.add(self.actiontree)
        self.actions.pack_start(scroller)

        #set xdot
        self.widget = xdot.DotWidget()

        # Create a UIManager instance
        uimanager = self.uimanager = gtk.UIManager()

        # Add the accelerator group to the toplevel windowilttei
        accelgroup = uimanager.get_accel_group()
        window.add_accel_group(accelgroup)

        # Create an ActionGroup
        actiongroup = gtk.ActionGroup('actions')
        self.actiongroup = actiongroup

        # Create actions
        actiongroup.add_actions((
            ('ZoomIn', gtk.STOCK_ZOOM_IN, None, None, None,
             self.widget.on_zoom_in),
            ('ZoomOut', gtk.STOCK_ZOOM_OUT, None, None, None,
             self.widget.on_zoom_out),
            ('ZoomFit', gtk.STOCK_ZOOM_FIT, None, None, None,
             self.widget.on_zoom_fit),
            ('Zoom100', gtk.STOCK_ZOOM_100, None, None, None,
             self.widget.on_zoom_100),
        ))

        # Add the actiongroup to the uimanager
        uimanager.insert_action_group(actiongroup, 0)

        # Add a UI description
        uimanager.add_ui_from_string(self.ui)

        # Set up layout
        hbox = gtk.HBox()
        window.add(hbox)

        #set Tag/Project box
        self.navbox = gtk.VBox()
        self.navbox.set_size_request(175, 300)
        header = gtk.HBox()
        label = gtk.Label()
        label.set_alignment(0, 0)
        label.set_markup("<big><b>Categories</b></big>")
        header.pack_start(label)
        self.navbox.pack_start(header, False)
        scroller = gtk.ScrolledWindow()
        scroller.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
        scroller.add(self.tagtree)
        self.navbox.pack_start(scroller)
        hseparator = gtk.HSeparator()
        self.navbox.pack_start(hseparator, False)
        header = gtk.HBox()
        label = gtk.Label()
        label.set_alignment(0, 0)
        label.set_markup("<big><b>Projects</b></big>")
        header.pack_start(label)
        image = gtk.Image()
        image.set_from_file("data/add.png")
        btnaddpro = gtk.Button()
        self.tooltips.set_tip(btnaddpro, "Add Project")
        btnaddpro.add(image)
        btnaddpro.connect('clicked', self.add_project)
        image = gtk.Image()
        image.set_from_file("data/remove.png")
        btnrempro = gtk.Button()
        self.tooltips.set_tip(btnrempro, "Remove Project")
        btnrempro.add(image)
        btnrempro.connect('clicked', self.remove_project)
        image = gtk.Image()
        image.set_from_file("data/edit.png")
        btnedtpro = gtk.Button()
        self.tooltips.set_tip(btnedtpro, "Edit Project")
        btnedtpro.add(image)
        btnedtpro.connect('clicked', self.edit_project)
        header.pack_start(btnaddpro, False)
        header.pack_start(btnrempro, False)
        header.pack_start(btnedtpro, False)
        self.navbox.pack_start(header, False)
        scroller = gtk.ScrolledWindow()
        scroller.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
        scroller.add(self.projecttree)
        self.navbox.pack_start(scroller)
        hbox.pack_start(self.navbox, False)
        vseparator = gtk.VSeparator()
        hbox.pack_start(vseparator, False)
        vbox = gtk.VBox()
        hbox.pack_start(vbox)

        # Setup property box
        hbox = gtk.HBox()
        hbox.pack_start(self.projectproperties, False)
        vseparator = gtk.VSeparator()
        hbox.pack_start(vseparator, False, padding=3)
        hbox.pack_start(self.TaskProperties, False)
        vseparator = gtk.VSeparator()
        hbox.pack_start(vseparator, False, padding=3)
        hbox.pack_start(self.actions, False)

        # Create a Toolbar
        toolbar = uimanager.get_widget('/ToolBar')
        vbox.pack_start(toolbar, False)

        vbox.pack_start(self.widget)
        hseparator = gtk.HSeparator()
        vbox.pack_start(hseparator, False)
        vbox.pack_start(hbox, False)

        self.set_focus(self.widget)
        self.refresh_tags()
        self.refresh_projects()
        self.widget.connect('clicked', self.on_url_clicked)
        self.show_all()