• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeutils
  • Sitemap
  • Contact Us
 

ark

jobtracker.cpp

Go to the documentation of this file.
00001 /*
00002  * ark -- archiver for the KDE project
00003  *
00004  * Copyright (C) 2007 Henrique Pinto <henrique.pinto@kdemail.net>
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  *
00020  */
00021 #include "jobtracker.h"
00022 
00023 #include <KIconLoader>
00024 #include <QTimer>
00025 
00026 JobTrackerWidget::JobTrackerWidget( QWidget *parent )
00027     : QFrame( parent )
00028 {
00029     setupUi( this );
00030 }
00031 
00032 JobTracker::JobTracker( QWidget *parent )
00033     : KAbstractWidgetJobTracker( parent ), m_currentJob( 0 )
00034 {
00035     m_ui = new JobTrackerWidget( parent );
00036     m_ui->hide();
00037 }
00038 
00039 void JobTracker::description( KJob *job, const QString &title, const QPair< QString, QString > &f1, const QPair< QString, QString > &f2 )
00040 {
00041     Q_UNUSED( job );
00042     Q_UNUSED( f1 );
00043     Q_UNUSED( f2 );
00044     m_ui->descriptionLabel->setText( QString( "<b>%1</b>" ).arg( title ) );
00045 }
00046 
00047 void JobTracker::infoMessage( KJob *job, const QString &plain, const QString &rich )
00048 {
00049     Q_UNUSED( job );
00050     Q_UNUSED( rich );
00051     m_ui->informationLabel->setText( plain );
00052     m_ui->informationLabel->show();
00053 }
00054 
00055 void JobTracker::warning( KJob *job, const QString &plain, const QString &rich )
00056 {
00057     Q_UNUSED( job );
00058     Q_UNUSED( rich );
00059     m_ui->informationLabel->setText( plain );
00060 }
00061 
00062 void JobTracker::registerJob( KJob *job )
00063 {
00064     KJobTrackerInterface::registerJob( job );
00065     m_ui->show();
00066     m_ui->informationLabel->hide();
00067     m_currentJob = job;
00068 }
00069 
00070 void JobTracker::unregisterJob( KJob *job )
00071 {
00072     m_ui->hide();
00073     m_currentJob = 0;
00074     KJobTrackerInterface::unregisterJob( job );
00075 }
00076 
00077 void JobTracker::timeOut()
00078 {
00079     m_ui->hide();
00080 }
00081 
00082 void JobTracker::finished( KJob *job )
00083 {
00084     QTimer::singleShot( 1500, this, SLOT( timeOut() ) );
00085     m_ui->informationLabel->setText( i18n( "Operation finished." ) );
00086     KJobTrackerInterface::unregisterJob( job );
00087 }

ark

Skip menu "ark"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdelirc
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • kjots
  • klaptopdaemon
  • kmilo
  • ksim
  • ktimer
  • kwallet
  • superkaramba
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal