Skip to content

Commit

Permalink
BatchProgressDialog => KPBatchProgressDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
cgilles committed Feb 26, 2012
1 parent e8b2f41 commit a6310c5
Show file tree
Hide file tree
Showing 20 changed files with 457 additions and 389 deletions.
2 changes: 1 addition & 1 deletion common/libkipiplugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SET(kipiplugins_LIB_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/tools/kpaboutdata.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tools/imageio/iccjpeg.c
${CMAKE_CURRENT_SOURCE_DIR}/tools/threads/kpactionthreadbase.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tools/threads/kpweaverobserver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/batchprogressdialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/kpbatchprogressdialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/kpimagedialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/kpwizardpage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/kpoutputdialog.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Date : 2004-05-04
* Description : Batch progress dialog
*
* Copyright (C) 2004-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2004-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
Expand All @@ -20,7 +20,7 @@
*
* ============================================================ */

#include "batchprogressdialog.moc"
#include "kpbatchprogressdialog.moc"

// Qt includes

Expand All @@ -44,11 +44,11 @@
namespace KIPIPlugins
{

class BatchProgressItem : public QListWidgetItem
class KPBatchProgressItem : public QListWidgetItem
{
public:

BatchProgressItem(QListWidget* parent, const QString& message, int messageType)
KPBatchProgressItem(QListWidget* const parent, const QString& message, int messageType)
: QListWidgetItem(message, parent)
{
// Set the icon.
Expand Down Expand Up @@ -85,11 +85,11 @@ BatchProgressItem(QListWidget* parent, const QString& message, int messageType)

// ----------------------------------------------------------------------

class BatchProgressWidget::BatchProgressWidgetPriv
class KPBatchProgressWidget::KPBatchProgressWidgetPriv
{
public:

BatchProgressWidgetPriv()
KPBatchProgressWidgetPriv()
{
progress = 0;
actionsList = 0;
Expand All @@ -100,8 +100,8 @@ class BatchProgressWidget::BatchProgressWidgetPriv
QListWidget* actionsList;
};

BatchProgressWidget::BatchProgressWidget(QWidget* parent)
: KVBox(parent), d(new BatchProgressWidgetPriv)
KPBatchProgressWidget::KPBatchProgressWidget(QWidget* const parent)
: KVBox(parent), d(new KPBatchProgressWidgetPriv)
{
setContextMenuPolicy(Qt::CustomContextMenu);
layout()->setSpacing(KDialog::spacingHint());
Expand All @@ -123,60 +123,60 @@ BatchProgressWidget::BatchProgressWidget(QWidget* parent)
this, SLOT(slotContextMenu()));
}

BatchProgressWidget::~BatchProgressWidget()
KPBatchProgressWidget::~KPBatchProgressWidget()
{
delete d;
}

QListWidget* BatchProgressWidget::listView() const
QListWidget* KPBatchProgressWidget::listView() const
{
return d->actionsList;
}

QProgressBar* BatchProgressWidget::progressBar() const
QProgressBar* KPBatchProgressWidget::progressBar() const
{
return d->progress;
}

void BatchProgressWidget::addedAction(const QString& text, int type)
void KPBatchProgressWidget::addedAction(const QString& text, int type)
{
BatchProgressItem* item = new BatchProgressItem(d->actionsList, text, type);
KPBatchProgressItem* item = new KPBatchProgressItem(d->actionsList, text, type);
d->actionsList->setCurrentItem(item);
}

void BatchProgressWidget::reset()
void KPBatchProgressWidget::reset()
{
d->actionsList->clear();
d->progress->setValue(0);
}

void BatchProgressWidget::setProgress(int current, int total)
void KPBatchProgressWidget::setProgress(int current, int total)
{
d->progress->setMaximum(total);
d->progress->setValue(current);
}

int BatchProgressWidget::progress() const
int KPBatchProgressWidget::progress() const
{
return d->progress->value();
}

int BatchProgressWidget::total() const
int KPBatchProgressWidget::total() const
{
return d->progress->maximum();
}

void BatchProgressWidget::setTotal(int total)
void KPBatchProgressWidget::setTotal(int total)
{
d->progress->setMaximum(total);
}

void BatchProgressWidget::setProgress(int current)
void KPBatchProgressWidget::setProgress(int current)
{
d->progress->setValue(current);
}

void BatchProgressWidget::slotContextMenu()
void KPBatchProgressWidget::slotContextMenu()
{
KMenu popmenu(this);
KAction* action = new KAction(KIcon("edit-copy"), i18n("Copy to Clipboard"), this);
Expand All @@ -187,7 +187,7 @@ void BatchProgressWidget::slotContextMenu()
popmenu.exec(QCursor::pos());
}

void BatchProgressWidget::slotCopy2ClipBoard()
void KPBatchProgressWidget::slotCopy2ClipBoard()
{
QString textInfo;

Expand All @@ -204,37 +204,37 @@ void BatchProgressWidget::slotCopy2ClipBoard()

// ---------------------------------------------------------------------------------

class BatchProgressDialog::BatchProgressDialogPriv
class KPBatchProgressDialog::KPBatchProgressDialogPriv
{
public:

BatchProgressDialogPriv()
KPBatchProgressDialogPriv()
{
box = 0;
}

BatchProgressWidget* box;
KPBatchProgressWidget* box;
};

BatchProgressDialog::BatchProgressDialog(QWidget* parent, const QString& caption)
: KDialog(parent), d(new BatchProgressDialogPriv)
KPBatchProgressDialog::KPBatchProgressDialog(QWidget* const parent, const QString& caption)
: KDialog(parent), d(new KPBatchProgressDialogPriv)
{
setCaption(caption);
setButtons(Cancel);
setDefaultButton(Cancel);
setModal(true);

d->box = new BatchProgressWidget(this);
d->box = new KPBatchProgressWidget(this);
setMainWidget(d->box);
resize(600, 400);
}

BatchProgressDialog::~BatchProgressDialog()
KPBatchProgressDialog::~KPBatchProgressDialog()
{
delete d;
}

BatchProgressWidget* BatchProgressDialog::progressWidget() const
KPBatchProgressWidget* KPBatchProgressDialog::progressWidget() const
{
return d->box;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Date : 2004-05-04
* Description : Batch progress dialog
*
* Copyright (C) 2004-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2004-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
Expand All @@ -22,8 +22,8 @@

/** @file batchprogressdialog.h */

#ifndef BATCHPROGRESSDIALOG_H
#define BATCHPROGRESSDIALOG_H
#ifndef KPBATCHPROGRESSDIALOG_H
#define KPBATCHPROGRESSDIALOG_H

// KDE includes

Expand Down Expand Up @@ -51,14 +51,14 @@ enum ActionMessageType

// --------------------------------------------------------------------------------------

class KIPIPLUGINS_EXPORT BatchProgressWidget : public KVBox
class KIPIPLUGINS_EXPORT KPBatchProgressWidget : public KVBox
{
Q_OBJECT

public:

explicit BatchProgressWidget(QWidget* parent=0);
~BatchProgressWidget();
explicit KPBatchProgressWidget(QWidget* const parent=0);
~KPBatchProgressWidget();

QListWidget* listView() const;
QProgressBar* progressBar() const;
Expand All @@ -82,27 +82,27 @@ private Q_SLOTS:

private:

class BatchProgressWidgetPriv;
BatchProgressWidgetPriv* const d;
class KPBatchProgressWidgetPriv;
KPBatchProgressWidgetPriv* const d;
};

// --------------------------------------------------------------------------------------

class KIPIPLUGINS_EXPORT BatchProgressDialog : public KDialog
class KIPIPLUGINS_EXPORT KPBatchProgressDialog : public KDialog
{
Q_OBJECT

public:

explicit BatchProgressDialog(QWidget* parent=0, const QString& caption=QString());
~BatchProgressDialog();
explicit KPBatchProgressDialog(QWidget* const parent=0, const QString& caption=QString());
~KPBatchProgressDialog();

BatchProgressWidget* progressWidget() const;
KPBatchProgressWidget* progressWidget() const;

private:

class BatchProgressDialogPriv;
BatchProgressDialogPriv* const d;
class KPBatchProgressDialogPriv;
KPBatchProgressDialogPriv* const d;
};

} // namespace KIPIPlugins
Expand Down
33 changes: 16 additions & 17 deletions flashexport/flashmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Date : 2009-11-13
* Description : a plugin to blend bracketed images.
*
* Copyright (C) 2009-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2009-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
Expand All @@ -25,6 +25,7 @@
// KDE includes

#include <kdebug.h>
#include <kapplication.h>

// LibKIPI includes

Expand All @@ -35,8 +36,8 @@
#include "aboutdata.h"
#include "importwizarddlg.h"
#include "simpleviewer.h"
#include <kapplication.h>

using namespace KIPIPlugins;

namespace KIPIFlashExportPlugin
{
Expand All @@ -45,15 +46,14 @@ class FlashManager::FlashManagerPriv
{
public:

FlashManagerPriv()
FlashManagerPriv()
{
iface = 0;
about = 0;
wizard = 0;
simple = 0;
}


SimpleViewerSettingsContainer* containerSettings;

Interface* iface;
Expand All @@ -63,10 +63,9 @@ class FlashManager::FlashManagerPriv
ImportWizardDlg* wizard;

SimpleViewer* simple;

};

FlashManager::FlashManager(QObject* parent)
FlashManager::FlashManager(QObject* const parent)
: QObject(parent), d(new FlashManagerPriv)
{
}
Expand All @@ -82,11 +81,11 @@ FlashManager::~FlashManager()
void FlashManager::initSimple()
{
// it cannot be initialized in main function because interface pointer is null.
d->simple = new SimpleViewer(d->iface,this);
kDebug() << "simpleview Initialized...";
d->simple = new SimpleViewer(d->iface,this);
kDebug() << "simpleview Initialized...";
}

void FlashManager::setAbout(FlashExportAboutData* about)
void FlashManager::setAbout(FlashExportAboutData* const about)
{
d->about = about;
}
Expand All @@ -96,7 +95,7 @@ FlashExportAboutData* FlashManager::about() const
return d->about;
}

void FlashManager::setIface(Interface* iface)
void FlashManager::setIface(Interface* const iface)
{
d->iface = iface;
}
Expand All @@ -106,17 +105,17 @@ Interface* FlashManager::iface() const
return d->iface;
}

bool FlashManager::installPlugin(KUrl url)
bool FlashManager::installPlugin(const KUrl& url)
{
if(d->simple->unzip(url.path()))
return true;
else
return false;
if(d->simple->unzip(url.path()))
return true;
else
return false;
}

SimpleViewer* FlashManager::simpleView() const
{
return d->simple;
return d->simple;
}

void FlashManager::run()
Expand All @@ -126,7 +125,7 @@ void FlashManager::run()

void FlashManager::startWizard()
{
d->wizard = new ImportWizardDlg(this,kapp->activeWindow());
d->wizard = new ImportWizardDlg(this, kapp->activeWindow());
d->wizard->show();
}

Expand Down
Loading

0 comments on commit a6310c5

Please sign in to comment.