source: smplayer/trunk/src/errordialog.cpp@ 189

Last change on this file since 189 was 188, checked in by Silvan Scherrer, 8 years ago

SMPlayer: update trunk to version 17.1.0

  • Property svn:eol-style set to LF
File size: 2.0 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2017 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#if QT_VERSION >= 0x050000
23#include "myscroller.h"
24#endif
25
26ErrorDialog::ErrorDialog( QWidget* parent, Qt::WindowFlags f )
27 : QDialog(parent, f)
28{
29 setupUi(this);
30
31#if QT_VERSION >= 0x050000
32 MyScroller::setScroller(log->viewport());
33#endif
34
35 text->setOpenExternalLinks(true);
36
37 icon->setText("");
38 icon->setPixmap( Images::icon("crash") );
39
40 intro_label->setText("<html><head/><body><p align=\"left\"><span style=\"font-size:14pt; font-weight:600;\">" + tr("Oops, something went wrong") +"</span></p></body></html>");
41
42 text->setText("");
43 toggleLog(false);
44
45 connect( viewlog_button, SIGNAL(toggled(bool)),
46 this, SLOT(toggleLog(bool)) );
47
48 layout()->setSizeConstraint(QLayout::SetFixedSize);
49}
50
51ErrorDialog::~ErrorDialog() {
52}
53
54void ErrorDialog::setText(QString error) {
55 text->setText(error);
56}
57
58void ErrorDialog::setLog(QString log_text) {
59 log->setPlainText("");
60 log->append(log_text); // To move cursor to the end
61}
62
63void ErrorDialog::toggleLog(bool checked) {
64 log->setVisible(checked);
65
66 if (checked)
67 viewlog_button->setText(tr("Hide log"));
68 else
69 viewlog_button->setText(tr("Show log"));
70}
71
72#include "moc_errordialog.cpp"
Note: See TracBrowser for help on using the repository browser.