# Path: umit/icm/agent/I18N.py
#     LC_ALL = locale.setlocale(locale.LC_ALL,'')
#     LC_ALL = locale.setlocale(locale.LC_ALL, None)        
# LANG = None
# ENC = None
#     LANG = "en_US"
#     LANG = "zh_CN"
#     LANG = "pt"
#     LANG = "ja"
#     LANG, ENC = locale.getdefaultlocale()
#     ENC = "utf8"
#     LANG = "en_US"   
# 
# Path: umit/icm/agent/gui/dashboard/timeline/TimeLineGraphBase.py
# def colors_from_file_gdk():
# def colors_from_file():
#     def __init__(self,connector,dashboard):
#     def __conector_widgets(self):
#     def _handle_selection(self,obj,selection):
#     def grab_data(self):
#     def update_grabber(self):
#     def descr_by_graphmode(self):
#     def title_by_graphmode(self, useselection=False):
#         def adjust(date):
#     def bounds_by_graphmode(self):
#     def _update_graph_data(self,obj,*args):
#     def _update_date(self,obj,arg):
# class TimeLineBase(CalendarManager, DataGrabber):
# 
# Path: umit/icm/agent/gui/dashboard/timeline/TimeLineGraphBase.py
# def colors_from_file_gdk():
# def colors_from_file():
#     def __init__(self,connector,dashboard):
#     def __conector_widgets(self):
#     def _handle_selection(self,obj,selection):
#     def grab_data(self):
#     def update_grabber(self):
#     def descr_by_graphmode(self):
#     def title_by_graphmode(self, useselection=False):
#         def adjust(date):
#     def bounds_by_graphmode(self):
#     def _update_graph_data(self,obj,*args):
#     def _update_date(self,obj,arg):
# class TimeLineBase(CalendarManager, DataGrabber):
# 
# Path: umit/icm/agent/gui/dashboard/timeline/TimeLineGraphBase.py
# def colors_from_file_gdk():
# def colors_from_file():
#     def __init__(self,connector,dashboard):
#     def __conector_widgets(self):
#     def _handle_selection(self,obj,selection):
#     def grab_data(self):
#     def update_grabber(self):
#     def descr_by_graphmode(self):
#     def title_by_graphmode(self, useselection=False):
#         def adjust(date):
#     def bounds_by_graphmode(self):
#     def _update_graph_data(self,obj,*args):
#     def _update_date(self,obj,arg):
# class TimeLineBase(CalendarManager, DataGrabber):


import pygtk
import gtk, gobject
from umit.icm.agent.I18N import _
from umit.icm.agent.gui.dashboard.timeline.TimeLineGraphBase import view_mode,view_mode_order
from umit.icm.agent.gui.dashboard.timeline.TimeLineGraphBase import view_kind,view_kind_order
from umit.icm.agent.gui.dashboard.timeline.TimeLineGraphBase import view_mode_descr 
        box = gtk.HBox()
        box.pack_start(img,False,False,0)
        self.refresh_button.add(box)

        
    def __pack_widgets(self):
        """
        Layout widgets.
        """
        self.pack_start(self.select_label, False, False, 0)
        self.pack_start(self.date_select, False, False, 0)
        self.pack_start(self.refresh_button, False, False, 0)
        
    def __connected_widgets(self):
        """
        """
        self.connector.connect('date_changed', self._update_current_date)
        self.refresh_button.connect("clicked", self._date_change)
        self.connector.connect('tab_changed', self._update_tab)        
        
    def _date_change(self,event):
        """
        send new date
        """
        self.connector.emit('date_update', self.date_select.get_value_as_int())

    def _update_current_date(self, event):
        """
        Update spinbutton and values based on new date.
        """

# Path: umit/icm/agent/I18N.py
#     LC_ALL = locale.setlocale(locale.LC_ALL,'')
#     LC_ALL = locale.setlocale(locale.LC_ALL, None)        
# LANG = None
# ENC = None
#     LANG = "en_US"
#     LANG = "zh_CN"
#     LANG = "pt"
#     LANG = "ja"
#     LANG, ENC = locale.getdefaultlocale()
#     ENC = "utf8"
#     LANG = "en_US"   
# 
# Path: umit/icm/agent/gui/dashboard/timeline/TimeLineGraphBase.py
# def colors_from_file_gdk():
# def colors_from_file():
#     def __init__(self,connector,dashboard):
#     def __conector_widgets(self):
#     def _handle_selection(self,obj,selection):
#     def grab_data(self):
#     def update_grabber(self):
#     def descr_by_graphmode(self):
#     def title_by_graphmode(self, useselection=False):
#         def adjust(date):
#     def bounds_by_graphmode(self):
#     def _update_graph_data(self,obj,*args):
#     def _update_date(self,obj,arg):
# class TimeLineBase(CalendarManager, DataGrabber):
# 
# Path: umit/icm/agent/gui/dashboard/timeline/TimeLineGraphBase.py
# def colors_from_file_gdk():
# def colors_from_file():
#     def __init__(self,connector,dashboard):
#     def __conector_widgets(self):
#     def _handle_selection(self,obj,selection):
#     def grab_data(self):
#     def update_grabber(self):
#     def descr_by_graphmode(self):
#     def title_by_graphmode(self, useselection=False):
#         def adjust(date):
#     def bounds_by_graphmode(self):
#     def _update_graph_data(self,obj,*args):
#     def _update_date(self,obj,arg):
# class TimeLineBase(CalendarManager, DataGrabber):
# 
# Path: umit/icm/agent/gui/dashboard/timeline/TimeLineGraphBase.py
# def colors_from_file_gdk():
# def colors_from_file():
#     def __init__(self,connector,dashboard):
#     def __conector_widgets(self):
#     def _handle_selection(self,obj,selection):
#     def grab_data(self):
#     def update_grabber(self):
#     def descr_by_graphmode(self):
#     def title_by_graphmode(self, useselection=False):
#         def adjust(date):
#     def bounds_by_graphmode(self):
#     def _update_graph_data(self,obj,*args):
#     def _update_date(self,obj,arg):
# class TimeLineBase(CalendarManager, DataGrabber):


# Path: umit/icm/agent/gui/dashboard/timeline/TimeLineGraphToolbar.py
import pygtk
import gtk, gobject
from umit.icm.agent.I18N import _
from umit.icm.agent.gui.dashboard.timeline.TimeLineGraphBase import view_mode,view_mode_order
from umit.icm.agent.gui.dashboard.timeline.TimeLineGraphBase import view_kind,view_kind_order
from umit.icm.agent.gui.dashboard.timeline.TimeLineGraphBase import view_mode_descr 

        box = gtk.HBox()
        box.pack_start(img,False,False,0)
        self.refresh_button.add(box)

        
    def __pack_widgets(self):
        """
        Layout widgets.
        """
        self.pack_start(self.select_label, False, False, 0)
        self.pack_start(self.date_select, False, False, 0)
        self.pack_start(self.refresh_button, False, False, 0)
        
    def __connected_widgets(self):
        """
        """
        self.connector.connect('date_changed', self._update_current_date)
        self.refresh_button.connect("clicked", self._date_change)
        self.connector.connect('tab_changed', self._update_tab)        
        
    def _date_change(self,event):
        """
        send new date
        """
        self.connector.emit('date_update', self.date_select.get_value_as_int())

    def _update_current_date(self, event):
        """
        Update spinbutton and values based on new date.
        """

        cur_mode = view_mode_descr[self.timeline_base.graph_mode]