# Path: umit/icm/agent/Version.py
# PEER_ATTRIBUTE = g_db_helper.get_information(key='peer',default="Desktop Agent")
# 
# Path: umit/icm/agent/gui/dashboard/timeline/TimeLine.py
# class TLHoder(gtk.VBox):
#     
#     def __init__(self,dashboard,connector=None): #maybe import some kinds(report,task,connection,Throttled,Service)
#         """
#         Load timeline for every report(sent or unsent), test successful or failed (website or service)
#         task (done or not), Throttled details(different charts)
#         """ 
#         
#         gtk.VBox.__init__(self)
#         
#         self.connector = connector
#         self.dashboard = dashboard
#         
#         self.base = TimeLineBase(self.connector,self.dashboard)    #Maybe add some items
#         
#         self.__create_widgets()
#         self.__packed_widgets()
#         self.__connect_widgets()
#         
#     def __create_widgets(self):
#         """
#         """
#         # startup data
#         line_filter, start, evts = self.base.grab_data()
#         xlabel = self.base.xlabel
#         glabel = self.base.title_by_graphmode()
#         dlabel = self.base.descr_by_graphmode()
#         
#         #Box
#         self.box = HIGVBox()
#         
#         #graph
#         self.graph_box = gtk.HBox()
#         self.graph = InteractiveGraph(evts, start, x_label=xlabel,
#             y_label=_('Number of events'), graph_label=glabel,
#             descr_label=dlabel, vdiv_labels=self.base.labels,
#             line_filter=line_filter, connector=self.connector)
#         
#         #graph toolbar
#         self.graphtb = TimeLineGraphToolbar(self.graph, self.connector,
#                                             self.base.graph_mode,self.base.graph_kind,
#                                             self.base)
#         
#         #TODO: Add Display Bar in the further
#     
#     def __packed_widgets(self):
#         """
#         """
#         self.graph_box.add(self.graph)
#         
#         self.box._pack_noexpand_nofill(self.graphtb)
#         self.box._pack_expand_fill(self.graph_box)
#         
#         self.add(self.box)
#                 
#         self.show_all()
#         
#     def __connect_widgets(self):
#         """
#         Handle the connector signals
#         """
#         self.connector.connect('data_update',self._update_graph)
#         #TODO: we should add signals for the changes of left treeview
#     
#     def _update_graph(self,obj,*args):
#         """
#         New graph data arrived
#         """    
#         line_filter, start, evts, labels, xlabel, glabel, dlabel = args
#         
#         # new graph data
#         self.graph.start_pts_data = start
#         self.graph.graph_data = evts
#         
#         # find new max value
#         self.graph.find_max_value()
#         
#         # update graph labels
#         self.graph.xlabel = xlabel
#         self.graph.graph_label = glabel
#         self.graph.descr_label = dlabel
#         self.graph.vdiv_labels = labels
#         
#         # do graph animation with new data
#         self.graph.do_animation()                                        


import pygtk
import gtk, gobject
import os
from deps.higwidgets.higboxes import HIGHBox, HIGVBox,hig_box_space_holder
from umit.icm.agent.Version import PEER_ATTRIBUTE
from umit.icm.agent.gui.dashboard.timeline.TimeLine import TLHoder
from umit.icm.agent.BasePaths import *
from deps.higwidgets.higtables import HIGTable
        Load timeline for every tab in dashboard window
        """
        gtk.VBox.__init__(self)
        
        self.dashboard = dashboard
        self.connector = connector
        
        self.__create_widgets()
        self.__packed_widgets()
        self.__connected_widgets()
        
    def __create_widgets(self):
        """"""        
        #####
        #Box
        self.title_box = gtk.HBox()
        self.box = HIGVBox()
        
        self.timeline = TLHoder(self.dashboard,self.connector)
        self.timeline.show_all()
        
        #######
        #Title
        self.title = gtk.Label(
            "<span size='15000' weight='heavy'>\t\t\t\t Timeline Graph Area(%s) </span>"%(PEER_ATTRIBUTE))        
        self.title.set_use_markup(True)
        self.title.set_selectable(False)      
        
        #########
        #Type Pic

# Path: umit/icm/agent/Version.py
# PEER_ATTRIBUTE = g_db_helper.get_information(key='peer',default="Desktop Agent")
# 
# Path: umit/icm/agent/gui/dashboard/timeline/TimeLine.py
# class TLHoder(gtk.VBox):
#     
#     def __init__(self,dashboard,connector=None): #maybe import some kinds(report,task,connection,Throttled,Service)
#         """
#         Load timeline for every report(sent or unsent), test successful or failed (website or service)
#         task (done or not), Throttled details(different charts)
#         """ 
#         
#         gtk.VBox.__init__(self)
#         
#         self.connector = connector
#         self.dashboard = dashboard
#         
#         self.base = TimeLineBase(self.connector,self.dashboard)    #Maybe add some items
#         
#         self.__create_widgets()
#         self.__packed_widgets()
#         self.__connect_widgets()
#         
#     def __create_widgets(self):
#         """
#         """
#         # startup data
#         line_filter, start, evts = self.base.grab_data()
#         xlabel = self.base.xlabel
#         glabel = self.base.title_by_graphmode()
#         dlabel = self.base.descr_by_graphmode()
#         
#         #Box
#         self.box = HIGVBox()
#         
#         #graph
#         self.graph_box = gtk.HBox()
#         self.graph = InteractiveGraph(evts, start, x_label=xlabel,
#             y_label=_('Number of events'), graph_label=glabel,
#             descr_label=dlabel, vdiv_labels=self.base.labels,
#             line_filter=line_filter, connector=self.connector)
#         
#         #graph toolbar
#         self.graphtb = TimeLineGraphToolbar(self.graph, self.connector,
#                                             self.base.graph_mode,self.base.graph_kind,
#                                             self.base)
#         
#         #TODO: Add Display Bar in the further
#     
#     def __packed_widgets(self):
#         """
#         """
#         self.graph_box.add(self.graph)
#         
#         self.box._pack_noexpand_nofill(self.graphtb)
#         self.box._pack_expand_fill(self.graph_box)
#         
#         self.add(self.box)
#                 
#         self.show_all()
#         
#     def __connect_widgets(self):
#         """
#         Handle the connector signals
#         """
#         self.connector.connect('data_update',self._update_graph)
#         #TODO: we should add signals for the changes of left treeview
#     
#     def _update_graph(self,obj,*args):
#         """
#         New graph data arrived
#         """    
#         line_filter, start, evts, labels, xlabel, glabel, dlabel = args
#         
#         # new graph data
#         self.graph.start_pts_data = start
#         self.graph.graph_data = evts
#         
#         # find new max value
#         self.graph.find_max_value()
#         
#         # update graph labels
#         self.graph.xlabel = xlabel
#         self.graph.graph_label = glabel
#         self.graph.descr_label = dlabel
#         self.graph.vdiv_labels = labels
#         
#         # do graph animation with new data
#         self.graph.do_animation()                                        


# Path: umit/icm/agent/gui/dashboard/timeline/TimeLineGraphViewer.py
import pygtk
import gtk, gobject
import os
from deps.higwidgets.higboxes import HIGHBox, HIGVBox,hig_box_space_holder
from umit.icm.agent.Version import PEER_ATTRIBUTE
from umit.icm.agent.gui.dashboard.timeline.TimeLine import TLHoder
from umit.icm.agent.BasePaths import *
from deps.higwidgets.higtables import HIGTable

        Load timeline for every tab in dashboard window
        """
        gtk.VBox.__init__(self)
        
        self.dashboard = dashboard
        self.connector = connector
        
        self.__create_widgets()
        self.__packed_widgets()
        self.__connected_widgets()
        
    def __create_widgets(self):
        """"""        
        #####
        #Box
        self.title_box = gtk.HBox()
        self.box = HIGVBox()
        
        self.timeline = TLHoder(self.dashboard,self.connector)
        self.timeline.show_all()
        
        #######
        #Title
        self.title = gtk.Label(
            "<span size='15000' weight='heavy'>\t\t\t\t Timeline Graph Area(%s) </span>"%(PEER_ATTRIBUTE))        
        self.title.set_use_markup(True)
        self.title.set_selectable(False)      
        
        #########
        #Type Pic

        if "desktop" in PEER_ATTRIBUTE.lower():