mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 07:29:33 -05:00
added error dialog forget commit
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@416 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
96ee910c5f
commit
a8eec5d9d6
60
retroshare-gui/src/apps/smplayer/errordialog.cpp
Normal file
60
retroshare-gui/src/apps/smplayer/errordialog.cpp
Normal file
@ -0,0 +1,60 @@
|
||||
/* smplayer, GUI front-end for mplayer.
|
||||
Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "errordialog.h"
|
||||
#include "images.h"
|
||||
|
||||
ErrorDialog::ErrorDialog( QWidget* parent, Qt::WindowFlags f )
|
||||
: QDialog(parent, f)
|
||||
{
|
||||
setupUi(this);
|
||||
|
||||
icon->setText("");
|
||||
icon->setPixmap( Images::icon("warning") );
|
||||
|
||||
text->setText("");
|
||||
toggleLog(false);
|
||||
|
||||
connect( viewlog_button, SIGNAL(toggled(bool)),
|
||||
this, SLOT(toggleLog(bool)) );
|
||||
|
||||
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
}
|
||||
|
||||
ErrorDialog::~ErrorDialog() {
|
||||
}
|
||||
|
||||
void ErrorDialog::setText(QString error) {
|
||||
text->setText(error);
|
||||
}
|
||||
|
||||
void ErrorDialog::setLog(QString log_text) {
|
||||
log->setPlainText("");
|
||||
log->append(log_text); // To move cursor to the end
|
||||
}
|
||||
|
||||
void ErrorDialog::toggleLog(bool checked) {
|
||||
log->setVisible(checked);
|
||||
|
||||
if (checked)
|
||||
viewlog_button->setText(tr("Hide log"));
|
||||
else
|
||||
viewlog_button->setText(tr("Show log"));
|
||||
}
|
||||
|
||||
#include "moc_errordialog.cpp"
|
40
retroshare-gui/src/apps/smplayer/errordialog.h
Normal file
40
retroshare-gui/src/apps/smplayer/errordialog.h
Normal file
@ -0,0 +1,40 @@
|
||||
/* smplayer, GUI front-end for mplayer.
|
||||
Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _ERRORDIALOG_H_
|
||||
#define _ERRORDIALOG_H_
|
||||
|
||||
#include "ui_errordialog.h"
|
||||
|
||||
class ErrorDialog : public QDialog, public Ui::ErrorDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ErrorDialog( QWidget* parent = 0, Qt::WindowFlags f = 0 );
|
||||
~ErrorDialog();
|
||||
|
||||
public slots:
|
||||
void setText(QString error);
|
||||
void setLog(QString log_text);
|
||||
|
||||
protected slots:
|
||||
void toggleLog(bool);
|
||||
};
|
||||
|
||||
#endif
|
166
retroshare-gui/src/apps/smplayer/errordialog.ui
Normal file
166
retroshare-gui/src/apps/smplayer/errordialog.ui
Normal file
@ -0,0 +1,166 @@
|
||||
<ui version="4.0" >
|
||||
<class>ErrorDialog</class>
|
||||
<widget class="QDialog" name="ErrorDialog" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>435</width>
|
||||
<height>338</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>MPlayer Error</string>
|
||||
</property>
|
||||
<property name="windowIcon" >
|
||||
<iconset/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="icon" >
|
||||
<property name="text" >
|
||||
<string>icon</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="text" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Error</string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="viewlog_button" >
|
||||
<property name="text" >
|
||||
<string>Show log</string>
|
||||
</property>
|
||||
<property name="checkable" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="button_box" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons" >
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="log" >
|
||||
<property name="readOnly" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>button_box</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>ErrorDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>button_box</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>ErrorDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
Loading…
Reference in New Issue
Block a user