Permalink
Browse files

Display a message when an error occured

  • Loading branch information...
1 parent a7cdc29 commit 331a9524272f9f412d82e0dde04a229e691a66b0 @chouquette chouquette committed Feb 19, 2010
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -27,10 +27,11 @@
<file alias="wizard_watermark">resources/images/wizard_watermark.png</file>
<file alias="keyboard">resources/images/keyboard.png</file>
<file alias="marker_start">resources/images/marker_start.png</file>
- <file alias="marker_stop">resources/images/marker_stop.png</file>
+ <file alias="marker_stop">resources/images/marker_stop.png</file>
<file alias="undo">resources/images/undo.png</file>
<file alias="redo">resources/images/redo.png</file>
<file alias="configure">resources/images/configure.png</file>
+ <file alias="error">resources/images/error.png</file>
</qresource>
<qresource prefix="/text">
<file>AUTHORS</file>
@@ -33,6 +33,7 @@
#include <QPalette>
#include <QSettings>
#include <QTime>
+#include <QTimer>
ImportController::ImportController(QWidget *parent) :
QDialog(parent),
@@ -74,6 +75,8 @@ ImportController::ImportController(QWidget *parent) :
m_ui->forwardButton->setEnabled( true );
m_ui->progressBar->setHidden( true );
+ m_ui->errorLabelImg->hide();
+ m_ui->errorLabel->hide();
connect( m_ui->treeView, SIGNAL( clicked( QModelIndex ) ),
this, SLOT( treeViewClicked( QModelIndex ) ) );
@@ -450,5 +453,17 @@ ImportController::mediaLoaded()
void
ImportController::failedToLoad( Media *media )
{
+ m_ui->errorLabel->setText( tr( "Failed to load %1").arg(
+ media->getFileInfo()->fileName() ) );
+ m_ui->errorLabelImg->show();
+ m_ui->errorLabel->show();
+ QTimer::singleShot( 3000, this, SLOT( hideErrors() ) );
mediaDeletion( media->getUuid() );
}
+
+void
+ImportController::hideErrors()
+{
+ m_ui->errorLabelImg->hide();
+ m_ui->errorLabel->hide();
+}
@@ -103,6 +103,7 @@ class ImportController : public QDialog
void treeViewDoubleClicked( const QModelIndex& index );
void mediaLoaded();
void failedToLoad( Media* media );
+ void hideErrors();
signals:
void mediaSelected( Media* );
@@ -14,7 +14,7 @@
<string>Import</string>
</property>
<property name="windowIcon">
- <iconset resource="../../../../ressources.qrc">
+ <iconset>
<normaloff>:/images/images/vlmc.png</normaloff>:/images/images/vlmc.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
@@ -31,13 +31,49 @@
<string/>
</property>
<property name="icon">
- <iconset resource="../../../../ressources.qrc">
+ <iconset>
<normaloff>:/images/forward</normaloff>:/images/forward</iconset>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_9">
+ <item>
+ <layout class="QHBoxLayout" name="errorLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMinimumSize</enum>
+ </property>
+ <item>
+ <widget class="QLabel" name="errorLabelImg">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap>:/images/error</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="errorLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="value">
@@ -197,9 +233,7 @@
<zorder>buttonBox</zorder>
<zorder>stackViewContainer</zorder>
</widget>
- <resources>
- <include location="../../../../ressources.qrc"/>
- </resources>
+ <resources/>
<connections>
<connection>
<sender>buttonBox</sender>

0 comments on commit 331a952

Please sign in to comment.