Commit da497b4e authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

use new KPToolDialog API

parent f2192218
......@@ -94,12 +94,10 @@ enum ProcessState
STOP_PROCESS
};
BatchProcessImagesDialog::BatchProcessImagesDialog(const KUrl::List& urlList, Interface* const interface,
const QString& caption, QWidget* const parent)
BatchProcessImagesDialog::BatchProcessImagesDialog(const KUrl::List& urlList, const QString& caption, QWidget* const parent)
: KPToolDialog(parent),
m_listFile2Process_iterator(0),
m_selectedImageFiles(urlList),
m_interface(interface),
m_ui(new Ui::BatchProcessImagesDialog())
{
setCaption(caption);
......@@ -170,7 +168,7 @@ void BatchProcessImagesDialog::setupUi()
"all original image files will be removed after processing."));
m_ui->m_destinationUrl->setMode(KFile::Directory | KFile::LocalOnly);
ImageCollection album = m_interface->currentAlbum();
ImageCollection album = iface()->currentAlbum();
if (album.isValid())
{
QString url;
......@@ -402,7 +400,7 @@ bool BatchProcessImagesDialog::startProcess()
m_listFiles->setCurrentItem(item);
// Lock current item into KIPI host application
KPFileReadLocker(m_interface, item->pathSrc());
KPFileReadLocker(iface(), item->pathSrc());
if (prepareStartProcess(item, targetAlbum) == false) // If there is a problem during the
{ // preparation -> pass to the next item!
......@@ -629,12 +627,12 @@ void BatchProcessImagesDialog::slotFinished()
KUrl::List urlList;
urlList.append(src);
urlList.append(dest);
m_interface->refreshImages(urlList);
iface()->refreshImages(urlList);
if (!item->overWrote())
{
// Do not add an entry if there was an image at the location already.
bool ok = m_interface->addImage(dest, errmsg);
bool ok = iface()->addImage(dest, errmsg);
if (!ok)
{
......@@ -676,7 +674,7 @@ void BatchProcessImagesDialog::slotFinished()
}
else
{
m_interface->delImage(item->pathSrc());
iface()->delImage(item->pathSrc());
}
}
break;
......
......@@ -69,8 +69,7 @@ public:
// Don't forget to add the 'm_Type' and 'm_labelType' implementation in the constructor of
// children dialog class.
BatchProcessImagesDialog(const KUrl::List& urlList, Interface* const interface,
const QString& caption, QWidget* const parent = 0);
BatchProcessImagesDialog(const KUrl::List& urlList, const QString& caption, QWidget* const parent = 0);
~BatchProcessImagesDialog();
protected:
......@@ -105,8 +104,6 @@ protected:
QString m_previewOutput;
KUrl::List m_selectedImageFiles;
Interface* m_interface;
// --------------------------------------------------------------------------------------------------------
// Standards functions
......
......@@ -208,51 +208,44 @@ void Plugin_BatchProcessImages::slotActivate()
if (from == "batch_convert_images")
{
m_ConvertImagesDialog = new ConvertImagesDialog(urlList, interface,
kapp->activeWindow());
m_ConvertImagesDialog = new ConvertImagesDialog(urlList, kapp->activeWindow());
m_ConvertImagesDialog->show();
}
else if (from == "batch_rename_images")
{
QPointer<RenameImagesDialog> dlg;
dlg = new RenameImagesDialog(urlList, interface, kapp->activeWindow());
dlg = new RenameImagesDialog(urlList, kapp->activeWindow());
dlg->exec();
delete dlg;
}
else if (from == "batch_border_images")
{
m_BorderImagesDialog = new BorderImagesDialog(urlList, interface,
kapp->activeWindow());
m_BorderImagesDialog = new BorderImagesDialog(urlList, kapp->activeWindow());
m_BorderImagesDialog->show();
}
else if (from == "batch_color_images")
{
m_ColorImagesDialog = new ColorImagesDialog(urlList, interface,
kapp->activeWindow());
m_ColorImagesDialog = new ColorImagesDialog(urlList, kapp->activeWindow());
m_ColorImagesDialog->show();
}
else if (from == "batch_filter_images")
{
m_FilterImagesDialog = new FilterImagesDialog(urlList, interface,
kapp->activeWindow());
m_FilterImagesDialog = new FilterImagesDialog(urlList, kapp->activeWindow());
m_FilterImagesDialog->show();
}
else if (from == "batch_effect_images")
{
m_EffectImagesDialog = new EffectImagesDialog(urlList, interface,
kapp->activeWindow());
m_EffectImagesDialog = new EffectImagesDialog(urlList, kapp->activeWindow());
m_EffectImagesDialog->show();
}
else if (from == "batch_recompress_images")
{
m_RecompressImagesDialog = new RecompressImagesDialog(urlList,
interface, kapp->activeWindow());
m_RecompressImagesDialog = new RecompressImagesDialog(urlList, kapp->activeWindow());
m_RecompressImagesDialog->show();
}
else if (from == "batch_resize_images")
{
m_ResizeImagesDialog = new ResizeImagesDialog(urlList, interface,
kapp->activeWindow());
m_ResizeImagesDialog = new ResizeImagesDialog(urlList, kapp->activeWindow());
m_ResizeImagesDialog->show();
}
else
......
......@@ -53,8 +53,8 @@
namespace KIPIBatchProcessImagesPlugin
{
BorderImagesDialog::BorderImagesDialog(const KUrl::List& urlList, Interface* interface, QWidget* parent)
: BatchProcessImagesDialog(urlList, interface, i18n("Batch-Bordering Images"), parent)
BorderImagesDialog::BorderImagesDialog(const KUrl::List& urlList, QWidget* parent)
: BatchProcessImagesDialog(urlList, i18n("Batch-Bordering Images"), parent)
{
m_nbItem = m_selectedImageFiles.count();
......
......@@ -38,7 +38,7 @@ class BorderImagesDialog : public BatchProcessImagesDialog
public:
BorderImagesDialog(const KUrl::List& urlList, Interface* interface, QWidget* parent = 0);
BorderImagesDialog(const KUrl::List& urlList, QWidget* parent = 0);
~BorderImagesDialog();
private Q_SLOTS:
......
......@@ -52,8 +52,8 @@
namespace KIPIBatchProcessImagesPlugin
{
ColorImagesDialog::ColorImagesDialog(const KUrl::List& urlList, Interface* interface, QWidget *parent)
: BatchProcessImagesDialog(urlList, interface, i18n("Batch Image-Color Processing"), parent)
ColorImagesDialog::ColorImagesDialog(const KUrl::List& urlList, QWidget *parent)
: BatchProcessImagesDialog(urlList, i18n("Batch Image-Color Processing"), parent)
{
m_nbItem = m_selectedImageFiles.count();
......
......@@ -38,7 +38,7 @@ class ColorImagesDialog : public BatchProcessImagesDialog
public:
ColorImagesDialog(const KUrl::List& images, Interface* interface, QWidget* parent = 0);
ColorImagesDialog(const KUrl::List& images, QWidget* parent = 0);
~ColorImagesDialog();
private Q_SLOTS:
......
......@@ -57,8 +57,8 @@
namespace KIPIBatchProcessImagesPlugin
{
ConvertImagesDialog::ConvertImagesDialog(const KUrl::List& urlList, Interface* interface, QWidget* parent)
: BatchProcessImagesDialog(urlList, interface, i18n("Batch Convert Images"), parent)
ConvertImagesDialog::ConvertImagesDialog(const KUrl::List& urlList, QWidget* parent)
: BatchProcessImagesDialog(urlList, i18n("Batch Convert Images"), parent)
{
setOptionBoxTitle(i18n("Image Conversion Options"));
......
......@@ -38,7 +38,7 @@ class ConvertImagesDialog : public BatchProcessImagesDialog
public:
ConvertImagesDialog(const KUrl::List& images, Interface* interface, QWidget* parent = 0);
ConvertImagesDialog(const KUrl::List& images, QWidget* parent = 0);
~ConvertImagesDialog();
private Q_SLOTS:
......
......@@ -51,8 +51,8 @@
namespace KIPIBatchProcessImagesPlugin
{
EffectImagesDialog::EffectImagesDialog(const KUrl::List& urlList, Interface* interface, QWidget* parent)
: BatchProcessImagesDialog(urlList, interface, i18n("Batch Image Effects"), parent)
EffectImagesDialog::EffectImagesDialog(const KUrl::List& urlList, QWidget* parent)
: BatchProcessImagesDialog(urlList, i18n("Batch Image Effects"), parent)
{
m_nbItem = m_selectedImageFiles.count();
......
......@@ -38,7 +38,7 @@ class EffectImagesDialog : public BatchProcessImagesDialog
public:
EffectImagesDialog(const KUrl::List& images, Interface* interface, QWidget* parent = 0);
EffectImagesDialog(const KUrl::List& images, QWidget* parent = 0);
~EffectImagesDialog();
private Q_SLOTS:
......
......@@ -51,8 +51,8 @@
namespace KIPIBatchProcessImagesPlugin
{
FilterImagesDialog::FilterImagesDialog(const KUrl::List& urlList, Interface* interface, QWidget *parent)
: BatchProcessImagesDialog(urlList, interface, i18n("Batch Image Filtering"), parent)
FilterImagesDialog::FilterImagesDialog(const KUrl::List& urlList, QWidget *parent)
: BatchProcessImagesDialog(urlList, i18n("Batch Image Filtering"), parent)
{
m_nbItem = m_selectedImageFiles.count();
......
......@@ -38,7 +38,7 @@ class FilterImagesDialog : public BatchProcessImagesDialog
public:
FilterImagesDialog(const KUrl::List& images, Interface* interface, QWidget* parent = 0);
FilterImagesDialog(const KUrl::List& images, QWidget* parent = 0);
~FilterImagesDialog();
private Q_SLOTS:
......
......@@ -51,8 +51,8 @@
namespace KIPIBatchProcessImagesPlugin
{
RecompressImagesDialog::RecompressImagesDialog(const KUrl::List& urlList, Interface* interface, QWidget* parent)
: BatchProcessImagesDialog(urlList, interface, i18n("Batch Recompress Images"), parent)
RecompressImagesDialog::RecompressImagesDialog(const KUrl::List& urlList, QWidget* parent)
: BatchProcessImagesDialog(urlList, i18n("Batch Recompress Images"), parent)
{
m_nbItem = m_selectedImageFiles.count();
......
......@@ -38,7 +38,7 @@ class RecompressImagesDialog : public BatchProcessImagesDialog
public:
RecompressImagesDialog(const KUrl::List& images, Interface* interface, QWidget* parent = 0);
RecompressImagesDialog(const KUrl::List& images, QWidget* parent = 0);
~RecompressImagesDialog();
private Q_SLOTS:
......
......@@ -45,7 +45,7 @@
namespace KIPIBatchProcessImagesPlugin
{
RenameImagesDialog::RenameImagesDialog(const KUrl::List& images, Interface* interface, QWidget* parent)
RenameImagesDialog::RenameImagesDialog(const KUrl::List& images, QWidget* parent)
: KPToolDialog(parent)
{
setCaption(i18n("Rename Images"));
......@@ -75,7 +75,7 @@ RenameImagesDialog::RenameImagesDialog(const KUrl::List& images, Interface* inte
QWidget* box = new QWidget(this);
QVBoxLayout* lay = new QVBoxLayout(box);
m_widget = new RenameImagesWidget(box, interface, images);
m_widget = new RenameImagesWidget(box, iface(), images);
lay->addWidget(m_widget);
setMainWidget(box);
......
......@@ -51,7 +51,7 @@ class RenameImagesDialog : public KPToolDialog
public:
RenameImagesDialog(const KUrl::List& images, Interface* interface, QWidget* parent);
RenameImagesDialog(const KUrl::List& images, QWidget* parent);
~RenameImagesDialog();
private:
......
......@@ -142,8 +142,8 @@ const QString ResizeImagesDialog::ResizeImagesDialogPriv::RC_GROUP_NAME = "Resiz
typedef QList<ResizeTool>::iterator ResizeToolIterator;
ResizeImagesDialog::ResizeImagesDialog(const KUrl::List& urlList, Interface* interface, QWidget* parent)
: BatchProcessImagesDialog(urlList, interface, i18n("Batch Resize Images"), parent),
ResizeImagesDialog::ResizeImagesDialog(const KUrl::List& urlList, QWidget* parent)
: BatchProcessImagesDialog(urlList, i18n("Batch Resize Images"), parent),
d(new ResizeImagesDialogPriv(this))
{
......
......@@ -36,7 +36,7 @@ class ResizeImagesDialog : public BatchProcessImagesDialog
public:
ResizeImagesDialog(const KUrl::List& images, KIPI::Interface* interface, QWidget* parent = 0);
ResizeImagesDialog(const KUrl::List& images, QWidget* parent = 0);
~ResizeImagesDialog();
private Q_SLOTS:
......
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