class LogSetDialog(QtGui.QDialog):
    """
    Manage popup of log setting dialog
    """

    def __init__(self, log_mgr, parent=None):
        super(LogSetDialog, self).__init__(parent)
        self.log_ui = Ui_LogSettings()
        self.log_ui.setupUi(self)
        self.log_mgr = log_mgr

        self.log_setting_model = LogSettingsModel(self.log_mgr)
        self.level_edit_delegate = DebugLevelDelegate()
        self.log_ui.log_levels.setModel(self.log_setting_model)
        self.log_ui.log_levels.resizeColumnsToContents()
        self.log_ui.log_levels.verticalHeader().setVisible(False)
        self.log_ui.log_levels.setItemDelegateForColumn(1, self.level_edit_delegate)
        self.log_ui.log_done.clicked.connect(self.close_logsetting_dialog)
        self.log_setting_model.getComponents()
        self.log_setting_model.dataChanged.connect(self.log_setting_model.updateSetting)

    def show_logsetting_dialog(self):
        self.show()

    def close_logsetting_dialog(self):
        self.hide()
Exemple #2
0
class LogSetDialog(QtGui.QDialog):
    '''
    Manage popup of log setting dialog
    '''
    def __init__(self, log_mgr, parent=None):
        super(LogSetDialog, self).__init__(parent)
        self.log_ui = Ui_LogSettings()
        self.log_ui.setupUi(self)
        self.log_mgr = log_mgr

        self.log_setting_model = LogSettingsModel(self.log_mgr)
        self.level_edit_delegate = DebugLevelDelegate()
        self.log_ui.log_levels.setModel(self.log_setting_model)
        self.log_ui.log_levels.resizeColumnsToContents()
        self.log_ui.log_levels.verticalHeader().setVisible(False)
        self.log_ui.log_levels.setItemDelegateForColumn(
            1, self.level_edit_delegate)
        self.log_ui.log_done.clicked.connect(self.close_logsetting_dialog)
        self.log_setting_model.getComponents()
        self.log_setting_model.dataChanged.connect(
            self.log_setting_model.updateSetting)

    def show_logsetting_dialog(self):
        self.show()

    def close_logsetting_dialog(self):
        self.hide()