Esempio n. 1
0
    def __init__(self, main):
        super().__init__(main,
                         title=_tr('WL_Dialog_Clear_Table', 'Clear Table'),
                         width=420,
                         no_buttons=True)

        self.label_confirm_clear = wl_labels.Wl_Label_Dialog(
            self.tr('''
                <div>
                    The results in the table have yet been exported. Do you really want to clear the table?
                </div>
            '''), self)

        self.button_yes = QPushButton(self.tr('Yes'), self)
        self.button_no = QPushButton(self.tr('No'), self)

        self.button_yes.clicked.connect(self.accept)
        self.button_no.clicked.connect(self.reject)

        self.wrapper_info.layout().addWidget(self.label_confirm_clear, 0, 0)

        self.wrapper_buttons.layout().addWidget(self.button_yes, 0, 1)
        self.wrapper_buttons.layout().addWidget(self.button_no, 0, 2)

        self.wrapper_buttons.layout().setColumnStretch(0, 1)

        self.set_fixed_height()
Esempio n. 2
0
    def __init__(self, main, text):
        super().__init__(main, width=450)

        self.time_start = time.time()

        self.timer_time_elapsed = QTimer(self)

        self.label_progress = QLabel(text, self)
        self.label_time_elapsed = QLabel(
            _tr('Wl_Dialog_Progress', 'Elapsed Time: 0:00:00'), self)
        self.label_processing = wl_labels.Wl_Label_Dialog(
            _tr(
                'Wl_Dialog_Progress',
                'Please wait. It may take a few seconds to several minutes for the operation to be completed.'
            ), self)

        self.timer_time_elapsed.timeout.connect(self.update_elapsed_time)
        self.timer_time_elapsed.start(1000)

        self.setLayout(wl_layouts.Wl_Layout())
        self.layout().addWidget(self.label_progress, 0, 0)
        self.layout().addWidget(self.label_time_elapsed, 0, 1, Qt.AlignRight)
        self.layout().addWidget(self.label_processing, 1, 0, 1, 2)

        self.layout().setContentsMargins(20, 10, 20, 10)
Esempio n. 3
0
    def __init__(self, main):
        super().__init__(main,
                         title=_tr('Wl_Dialog_Restart_Required',
                                   'Restart Wordless'),
                         width=450,
                         no_buttons=True)

        self.label_restart_exit = wl_labels.Wl_Label_Dialog(
            self.tr('''
                <div>
                    Restart is required for the settings to take effect. Do you want to restart Wordless now?
                </div>

                <div style="font-weight: bold;">
                    Note: All unsaved data and figures will be lost.
                </div>
            '''), self)

        self.button_restart = QPushButton(self.tr('Restart'), self)
        self.button_cancel = QPushButton(self.tr('Cancel'), self)

        self.button_restart.clicked.connect(self.accept)
        self.button_cancel.clicked.connect(self.reject)

        self.wrapper_info.layout().addWidget(self.label_restart_exit, 0, 0)

        self.wrapper_buttons.layout().addWidget(self.button_restart, 0, 1)
        self.wrapper_buttons.layout().addWidget(self.button_cancel, 0, 2)

        self.wrapper_buttons.layout().setColumnStretch(0, 1)

        self.set_fixed_height()
Esempio n. 4
0
    def __init__(self, main, title):
        super().__init__(main, title, width = 560, height = 320, no_buttons = True)

        self.label_err = wl_labels.Wl_Label_Dialog('', self)
        self.table_err_files = wl_tables.Wl_Table(
            self,
            headers = [
                self.tr('Error Type'),
                self.tr('File')
            ]
        )

        self.table_err_files.tab = 'err'

        self.table_err_files.setFixedHeight(220)
        self.table_err_files.model().setRowCount(0)

        self.button_export = QPushButton(self.tr('Export'), self)
        self.button_ok = QPushButton(self.tr('OK'), self)

        self.button_export.clicked.connect(self.table_err_files.exp_all)
        self.button_ok.clicked.connect(self.accept)

        self.wrapper_info.layout().addWidget(self.label_err, 0, 0)
        self.wrapper_info.layout().addWidget(self.table_err_files, 1, 0)

        self.wrapper_buttons.layout().addWidget(self.button_export, 0, 0, Qt.AlignLeft)
        self.wrapper_buttons.layout().addWidget(self.button_ok, 0, 1, Qt.AlignRight)
Esempio n. 5
0
    def __init__(self, main, err_msg):
        super().__init__(main, _tr('Wl_Dialog_Err_Fatal', 'Fatal Error'))

        self.label_err_msg = wl_labels.Wl_Label_Dialog(
            self.tr('''
                <div>A fatal error has occurred, please <b>contact the author for support</b> by emailing to {}!</div>
            ''').format(self.main.email_html),
            self
        )
        self.text_edit_err_msg = QTextEdit(self)

        self.text_edit_err_msg.setPlainText(err_msg)
        self.text_edit_err_msg.setReadOnly(True)

        self.wrapper_info.layout().addWidget(self.label_err_msg, 0, 0)
        self.wrapper_info.layout().addWidget(self.text_edit_err_msg, 1, 0)

        self.button_export.hide()
Esempio n. 6
0
    def __init__(self, main):
        super().__init__(main,
                         title=_tr('Wl_Dialog_Confirm_Exit', 'Exit Wordless'),
                         width=420,
                         no_buttons=True)

        self.label_confirm_exit = wl_labels.Wl_Label_Dialog(
            self.tr('''
                <div>
                    Are you sure you want to exit Wordless?
                </div>
                <div style="font-weight: bold;">
                    Note: All unsaved data and figures will be lost.
                </div>
            '''), self)

        self.checkbox_confirm_on_exit = QCheckBox(
            self.tr('Always confirm on exit'), self)
        self.button_exit = QPushButton(self.tr('Exit'), self)
        self.button_cancel = QPushButton(self.tr('Cancel'), self)

        self.checkbox_confirm_on_exit.stateChanged.connect(
            self.confirm_on_exit_changed)
        self.button_exit.clicked.connect(self.accept)
        self.button_cancel.clicked.connect(self.reject)

        self.wrapper_info.layout().addWidget(self.label_confirm_exit, 0, 0)

        self.wrapper_buttons.layout().addWidget(self.checkbox_confirm_on_exit,
                                                0, 0)
        self.wrapper_buttons.layout().addWidget(self.button_exit, 0, 2)
        self.wrapper_buttons.layout().addWidget(self.button_cancel, 0, 3)

        self.wrapper_buttons.layout().setColumnStretch(1, 1)

        self.load_settings()

        self.set_fixed_height()