# -*- coding: iso-8859-15 -*-

class UserInterface(Eficas):    
    """
    Class implementing the main user interface.
    
    @signal appendStderr(string) emitted to write data to stderr logger
    @signal appendStdout(string) emitted to write data to stdout logger
    @signal preferencesChanged() emitted after the preferences were changed
    """
    def __init__(self):
        """
        Constructor
        
        @param loc locale to be used by the UI (string)
        @param splash reference to the splashscreen (UI.SplashScreen.SplashScreen)
        """
        Eficas.__init__(self)

        # Generate the debug server object
        dbs = DebugServer()
        
        # Create main layout type 4 (floating windows)
        
        # Create the view manager depending on the configuration setting
        self.viewmanager = MyTabview(self, self, dbs) #MyTabview, MyWorkspace, Listspace
        self.setCentralWidget(self.viewmanager)
        
                     
        self.connect(self,PYSIGNAL('preferencesChanged'),
                     self.viewmanager.handlePreferencesChanged)
        
        self.connect(self.viewmanager,PYSIGNAL('lastEditorClosed'),
                     self.handleLastEditorClosed)
        self.connect(self.viewmanager,PYSIGNAL('editorOpened'),
                     self.handleEditorOpened)
                     
        
        
        # Initialise the instance variables.
        self.currentProg = None
        self.isProg = 0
        self.utEditorOpen = 0
        self.utProjectOpen = 0
        
        self.inDragDrop = 0
        self.setAcceptDrops(1)


        
    def handleLastEditorClosed(self):
        """
        Public slot to handle the lastEditorClosed signal.
        """
        pass
        
    def handleEditorOpened(self, fn):
        """
        Public slot to handle the editorOpened signal.
        
        @param fn filename of the opened editor (string)
        """
        pass
        
    def fileOpen(self, prog=None):
        self.viewmanager.handleOpen(prog)


