source: src-qt4/pc-softwaremanager/ErrorDialog.cpp @ c71b68c

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since c71b68c was c71b68c, checked in by Ken Moore <ken@…>, 18 months ago

Add a bunch of error loggin to the backend processes, and also add a new dialog for displaying these error logs. Also fix the detection of an update failure.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/***************************************************************************
2 *   Copyright (C) 2011 - iXsystems                                       *
3 *   kris@pcbsd.org  *
4 *   tim@pcbsd.org   *
5 *   ken@pcbsd.org   *
6 *                                                                         *
7 *   Permission is hereby granted, free of charge, to any person obtaining *
8 *   a copy of this software and associated documentation files (the       *
9 *   "Software"), to deal in the Software without restriction, including   *
10 *   without limitation the rights to use, copy, modify, merge, publish,   *
11 *   distribute, sublicense, and/or sell copies of the Software, and to    *
12 *   permit persons to whom the Software is furnished to do so, subject to *
13 *   the following conditions:                                             *
14 *                                                                         *
15 *   The above copyright notice and this permission notice shall be        *
16 *   included in all copies or substantial portions of the Software.       *
17 *                                                                         *
18 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
19 *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
20 *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
21 *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
22 *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
23 *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
24 *   OTHER DEALINGS IN THE SOFTWARE.                                       *
25 ***************************************************************************/
26#include "ErrorDialog.h"
27#include "ui_ErrorDialog.h"
28
29ErrorDialog::ErrorDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ErrorDialog){
30  ui->setupUi(this);
31  connect(ui->checkBox, SIGNAL(stateChanged(int)), this, SLOT(updateUI()) );
32}
33
34ErrorDialog::~ErrorDialog(){
35  delete ui;
36}
37
38void ErrorDialog::setDLGTitle(QString title){
39  this->setWindowTitle(title);
40  updateUI();
41}
42
43void ErrorDialog::setDLGMessage(QString message){
44  ui->label->setText(message);
45  updateUI();
46}
47
48void ErrorDialog::setDLGLog(QStringList log){
49  ui->textEdit->clear();
50  ui->textEdit->setText(log.join("\n"));
51  updateUI();
52}
53
54
55void ErrorDialog::updateUI(){
56  if(ui->textEdit->toPlainText().isEmpty()){
57    ui->checkBox->setVisible(FALSE);
58    ui->textEdit->setVisible(FALSE);
59  }else{
60    ui->checkBox->setVisible(TRUE);
61    if(ui->checkBox->isChecked()){ui->textEdit->setVisible(TRUE);}
62    else{ui->textEdit->setVisible(FALSE);}
63  }
64}
65
66void ErrorDialog::on_buttonBox_accepted(){
67  this->close(); 
68}
69
70void ErrorDialog::on_buttonBox_rejected(){
71  this->close(); 
72}
Note: See TracBrowser for help on using the repository browser.