Commit 513a42b9 authored by Henrique Pinto's avatar Henrique Pinto
Browse files

* Change the cursor to indicate the "loading" state

svn path=/branches/work/libarchive-based-ark/ark/; revision=689502
parent f54c0bad
......@@ -324,6 +324,9 @@ void ArchiveModel::setArchive( Arch *archive )
connect( m_archive, SIGNAL( newEntry( const ArchiveEntry& ) ),
this, SLOT( slotNewEntry( const ArchiveEntry& ) ) );
connect( m_archive, SIGNAL( opened( bool ) ),
this, SIGNAL( loadingFinished() ) );
emit loadingStarted();
m_archive->open();
}
reset();
......
......@@ -46,6 +46,10 @@ class ArchiveModel: public QAbstractItemModel
void setArchive( Arch *archive );
signals:
void loadingStarted();
void loadingFinished();
private slots:
void slotNewEntry( const ArchiveEntry& entry );
......
......@@ -22,8 +22,12 @@
#include "archivemodel.h"
#include <KParts/GenericFactory>
#include <KApplication>
#include <KAboutData>
#include <KDebug>
#include <QTreeView>
#include <QCursor>
typedef KParts::GenericFactory<Part> Factory;
K_EXPORT_COMPONENT_FACTORY( libarkpartnew, Factory );
......@@ -36,6 +40,11 @@ Part::Part( QWidget *parentWidget, QObject *parent, const QStringList& args )
setXMLFile( "ark_part_new.rc" );
setWidget( m_view );
m_view->setModel( m_model );
connect( m_model, SIGNAL( loadingStarted() ),
this, SLOT( slotLoadingStarted() ) );
connect( m_model, SIGNAL( loadingFinished() ),
this, SLOT( slotLoadingFinished() ) );
}
Part::~Part()
......@@ -64,3 +73,13 @@ QStringList Part::supportedMimeTypes() const
{
return Arch::supportedMimeTypes();
}
void Part::slotLoadingStarted()
{
QApplication::setOverrideCursor( QCursor( Qt::WaitCursor ) );
}
void Part::slotLoadingFinished()
{
QApplication::restoreOverrideCursor();
}
......@@ -42,6 +42,10 @@ class Part: public KParts::ReadWritePart, public Interface
QStringList supportedMimeTypes() const;
private slots:
void slotLoadingStarted();
void slotLoadingFinished();
private:
ArchiveModel *m_model;
QTreeView *m_view;
......
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