| 1 | /* smplayer, GUI front-end for mplayer.
|
|---|
| 2 | Copyright (C) 2006-2013 Ricardo Villalba <rvm@users.sourceforge.net>
|
|---|
| 3 |
|
|---|
| 4 | This program is free software; you can redistribute it and/or modify
|
|---|
| 5 | it under the terms of the GNU General Public License as published by
|
|---|
| 6 | the Free Software Foundation; either version 2 of the License, or
|
|---|
| 7 | (at your option) any later version.
|
|---|
| 8 |
|
|---|
| 9 | This program is distributed in the hope that it will be useful,
|
|---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 12 | GNU General Public License for more details.
|
|---|
| 13 |
|
|---|
| 14 | You should have received a copy of the GNU General Public License
|
|---|
| 15 | along with this program; if not, write to the Free Software
|
|---|
| 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 | #include "errordialog.h"
|
|---|
| 20 | #include "images.h"
|
|---|
| 21 |
|
|---|
| 22 | ErrorDialog::ErrorDialog( QWidget* parent, Qt::WindowFlags f )
|
|---|
| 23 | : QDialog(parent, f)
|
|---|
| 24 | {
|
|---|
| 25 | setupUi(this);
|
|---|
| 26 |
|
|---|
| 27 | icon->setText("");
|
|---|
| 28 | icon->setPixmap( Images::icon("crash") );
|
|---|
| 29 |
|
|---|
| 30 | intro_label->setText("<html><head/><body><p align=\"left\"><span style=\"font-size:14pt; font-weight:600;\">" + tr("Oops, something wrong happened") +"</span></p></body></html>");
|
|---|
| 31 |
|
|---|
| 32 | text->setText("");
|
|---|
| 33 | toggleLog(false);
|
|---|
| 34 |
|
|---|
| 35 | connect( viewlog_button, SIGNAL(toggled(bool)),
|
|---|
| 36 | this, SLOT(toggleLog(bool)) );
|
|---|
| 37 |
|
|---|
| 38 | layout()->setSizeConstraint(QLayout::SetFixedSize);
|
|---|
| 39 | }
|
|---|
| 40 |
|
|---|
| 41 | ErrorDialog::~ErrorDialog() {
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | void ErrorDialog::setText(QString error) {
|
|---|
| 45 | text->setText(error);
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | void ErrorDialog::setLog(QString log_text) {
|
|---|
| 49 | log->setPlainText("");
|
|---|
| 50 | log->append(log_text); // To move cursor to the end
|
|---|
| 51 | }
|
|---|
| 52 |
|
|---|
| 53 | void ErrorDialog::toggleLog(bool checked) {
|
|---|
| 54 | log->setVisible(checked);
|
|---|
| 55 |
|
|---|
| 56 | if (checked)
|
|---|
| 57 | viewlog_button->setText(tr("Hide log"));
|
|---|
| 58 | else
|
|---|
| 59 | viewlog_button->setText(tr("Show log"));
|
|---|
| 60 | }
|
|---|
| 61 |
|
|---|
| 62 | #include "moc_errordialog.cpp"
|
|---|