예제 #1
0
    def __init__(self, parent=None, show_buttons=True):

        QtGui.QWidget.__init__(self, parent)

        self.show_buttons = show_buttons

        self.setGeometry(200, 400, 500, 400)
        self.setWindowTitle('GUI Logger')
        #self.setWindowIcon(cp.icon_logger)

        self.setFrame()

        self.box_txt = QtGui.QTextEdit()

        #self.tit_title  = QtGui.QLabel('Logger')
        self.tit_status = QtGui.QLabel('Status:')
        self.tit_level = QtGui.QLabel('Verbosity level:')
        self.but_close = QtGui.QPushButton('&Close')
        self.but_save = QtGui.QPushButton('&Save log-file')

        self.list_of_levels = logger.getListOfLevels()
        self.box_level = QtGui.QComboBox(self)
        self.box_level.addItems(self.list_of_levels)
        self.box_level.setCurrentIndex(
            self.list_of_levels.index(cp.log_level.value()))

        self.hboxM = QtGui.QHBoxLayout()
        self.hboxM.addWidget(self.box_txt)

        self.hboxB = QtGui.QHBoxLayout()
        self.hboxB.addWidget(self.tit_status)
        self.hboxB.addStretch(4)
        self.hboxB.addWidget(self.tit_level)
        self.hboxB.addWidget(self.box_level)
        self.hboxB.addStretch(1)
        self.hboxB.addWidget(self.but_save)
        self.hboxB.addWidget(self.but_close)

        self.vbox = QtGui.QVBoxLayout()
        #self.vbox.addWidget(self.tit_title)
        self.vbox.addLayout(self.hboxM)
        self.vbox.addLayout(self.hboxB)
        self.setLayout(self.vbox)

        self.connect(self.but_close, QtCore.SIGNAL('clicked()'), self.onClose)
        self.connect(self.but_save, QtCore.SIGNAL('clicked()'), self.onSave)
        self.connect(self.box_level, QtCore.SIGNAL('currentIndexChanged(int)'),
                     self.onBox)

        self.startGUILog()

        self.showToolTips()
        self.setStyle()

        self.guilogger = self
예제 #2
0
    def __init__ ( self, parent=None, show_buttons=True ) :

        QtGui.QWidget.__init__(self, parent)

        self.show_buttons = show_buttons
        
        self.setGeometry(200, 400, 900, 50)
        self.setWindowTitle('GUI Logger')
        #self.setWindowIcon(cp.icon_logger)

        self.setFrame()

        self.box_txt    = QtGui.QTextEdit()
 
        #self.tit_title  = QtGui.QLabel('Logger')
        self.tit_status = QtGui.QLabel('Status:')
        self.tit_level  = QtGui.QLabel('Verbosity level:')
        self.but_close  = QtGui.QPushButton('&Close') 
        self.but_save   = QtGui.QPushButton('&Save log-file') 

        self.list_of_levels = logger.getListOfLevels()
        self.box_level      = QtGui.QComboBox( self ) 
        self.box_level.addItems(self.list_of_levels)
        self.box_level.setCurrentIndex( self.list_of_levels.index(cp.log_level.value()) )
        
        self.hboxM = QtGui.QHBoxLayout()
        self.hboxM.addWidget( self.box_txt )

        self.hboxB = QtGui.QHBoxLayout()
        self.hboxB.addWidget(self.tit_status)
        self.hboxB.addStretch(4)     
        self.hboxB.addWidget(self.tit_level)
        self.hboxB.addWidget(self.box_level)
        self.hboxB.addStretch(1)     
        self.hboxB.addWidget(self.but_save)
        self.hboxB.addWidget(self.but_close)

        self.vbox  = QtGui.QVBoxLayout()
        #self.vbox.addWidget(self.tit_title)
        self.vbox.addLayout(self.hboxM)
        self.vbox.addLayout(self.hboxB)
        self.setLayout(self.vbox)
        
        self.connect( self.but_close, QtCore.SIGNAL('clicked()'), self.onClose )
        self.connect( self.but_save,  QtCore.SIGNAL('clicked()'), self.onSave  )
        self.connect( self.box_level, QtCore.SIGNAL('currentIndexChanged(int)'), self.onBox  )
 
        self.startGUILog()

        self.showToolTips()
        self.setStyle()

        self.guilogger = self