Commit 331a9524 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Display a message when an error occured

parent a7cdc29f
...@@ -27,10 +27,11 @@ ...@@ -27,10 +27,11 @@
<file alias="wizard_watermark">resources/images/wizard_watermark.png</file> <file alias="wizard_watermark">resources/images/wizard_watermark.png</file>
<file alias="keyboard">resources/images/keyboard.png</file> <file alias="keyboard">resources/images/keyboard.png</file>
<file alias="marker_start">resources/images/marker_start.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="undo">resources/images/undo.png</file>
<file alias="redo">resources/images/redo.png</file> <file alias="redo">resources/images/redo.png</file>
<file alias="configure">resources/images/configure.png</file> <file alias="configure">resources/images/configure.png</file>
<file alias="error">resources/images/error.png</file>
</qresource> </qresource>
<qresource prefix="/text"> <qresource prefix="/text">
<file>AUTHORS</file> <file>AUTHORS</file>
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <QPalette> #include <QPalette>
#include <QSettings> #include <QSettings>
#include <QTime> #include <QTime>
#include <QTimer>
ImportController::ImportController(QWidget *parent) : ImportController::ImportController(QWidget *parent) :
QDialog(parent), QDialog(parent),
...@@ -74,6 +75,8 @@ ImportController::ImportController(QWidget *parent) : ...@@ -74,6 +75,8 @@ ImportController::ImportController(QWidget *parent) :
m_ui->forwardButton->setEnabled( true ); m_ui->forwardButton->setEnabled( true );
m_ui->progressBar->setHidden( true ); m_ui->progressBar->setHidden( true );
m_ui->errorLabelImg->hide();
m_ui->errorLabel->hide();
connect( m_ui->treeView, SIGNAL( clicked( QModelIndex ) ), connect( m_ui->treeView, SIGNAL( clicked( QModelIndex ) ),
this, SLOT( treeViewClicked( QModelIndex ) ) ); this, SLOT( treeViewClicked( QModelIndex ) ) );
...@@ -450,5 +453,17 @@ ImportController::mediaLoaded() ...@@ -450,5 +453,17 @@ ImportController::mediaLoaded()
void void
ImportController::failedToLoad( Media *media ) 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() ); mediaDeletion( media->getUuid() );
} }
void
ImportController::hideErrors()
{
m_ui->errorLabelImg->hide();
m_ui->errorLabel->hide();
}
...@@ -103,6 +103,7 @@ class ImportController : public QDialog ...@@ -103,6 +103,7 @@ class ImportController : public QDialog
void treeViewDoubleClicked( const QModelIndex& index ); void treeViewDoubleClicked( const QModelIndex& index );
void mediaLoaded(); void mediaLoaded();
void failedToLoad( Media* media ); void failedToLoad( Media* media );
void hideErrors();
signals: signals:
void mediaSelected( Media* ); void mediaSelected( Media* );
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<string>Import</string> <string>Import</string>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="../../../../ressources.qrc"> <iconset>
<normaloff>:/images/images/vlmc.png</normaloff>:/images/images/vlmc.png</iconset> <normaloff>:/images/images/vlmc.png</normaloff>:/images/images/vlmc.png</iconset>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_11"> <layout class="QVBoxLayout" name="verticalLayout_11">
...@@ -31,13 +31,49 @@ ...@@ -31,13 +31,49 @@
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../../ressources.qrc"> <iconset>
<normaloff>:/images/forward</normaloff>:/images/forward</iconset> <normaloff>:/images/forward</normaloff>:/images/forward</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_9"> <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> <item>
<widget class="QProgressBar" name="progressBar"> <widget class="QProgressBar" name="progressBar">
<property name="value"> <property name="value">
...@@ -197,9 +233,7 @@ ...@@ -197,9 +233,7 @@
<zorder>buttonBox</zorder> <zorder>buttonBox</zorder>
<zorder>stackViewContainer</zorder> <zorder>stackViewContainer</zorder>
</widget> </widget>
<resources> <resources/>
<include location="../../../../ressources.qrc"/>
</resources>
<connections> <connections>
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment