[Kde-imaging] extragear/graphics/kipi-plugins/acquireimages
Gilles Caulier
caulier.gilles at gmail.com
Mon Oct 12 12:54:58 CEST 2009
SVN commit 1034269 by cgilles:
Acquire Image kipi-plugins : stand alone version of plugin. It can be started of kipi host now.
Kare, i think your code from kdegraphics/ksaneplugin can be replaced by this one when kipi-pugins
will be moved to kdegraphics. No need to duplicates this code. What do you think about ?
CCMAIL: kare.sars at iki.fi
CCMAIL: kde-imaging at kde.org
M +24 -0 CMakeLists.txt
AM aboutdata.h [License: GPL (v2+)]
M +6 -5 plugin_acquireimages.cpp
M +13 -23 scandialog.cpp
M +3 -1 scandialog.h
AM scangui.cpp [License: GPL (v2+)]
A scangui.desktop
--- trunk/extragear/graphics/kipi-plugins/acquireimages/CMakeLists.txt #1034268:1034269
@@ -19,3 +19,27 @@
INSTALL(TARGETS kipiplugin_acquireimages DESTINATION ${PLUGIN_INSTALL_DIR})
INSTALL(FILES kipiplugin_acquireimages.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+
+# =======================================================
+# Stand alone version of acquireimages plugin
+
+SET(scangui_SRCS scangui.cpp
+ scandialog.cpp
+ saveimgthread.cpp
+ )
+
+KDE4_ADD_APP_ICON(scangui_SRCS "scanner")
+
+KDE4_ADD_EXECUTABLE(scangui ${scangui_SRCS})
+
+TARGET_LINK_LIBRARIES(scangui
+ ${KDE4_KIO_LIBS}
+ ${KIPI_LIBRARIES}
+ ${KSANE_LIBRARY}
+ ${KEXIV2_LIBRARIES}
+ ${KDCRAW_LIBRARIES}
+ kipiplugins
+ )
+
+INSTALL(TARGETS scangui ${INSTALL_TARGETS_DEFAULT_ARGS})
+INSTALL(FILES scangui.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
** trunk/extragear/graphics/kipi-plugins/acquireimages/aboutdata.h #property svn:eol-style
+ native
--- trunk/extragear/graphics/kipi-plugins/acquireimages/plugin_acquireimages.cpp #1034268:1034269
@@ -41,15 +41,16 @@
#include <libksane/ksane.h>
-// Local includes
-
-#include "scandialog.h"
-
// LibKIPI includes
#include <libkipi/imagecollection.h>
#include <libkipi/interface.h>
+// Local includes
+
+#include "aboutdata.h"
+#include "scandialog.h"
+
using namespace KIPIAcquireImagesPlugin;
K_PLUGIN_FACTORY( AcquireImagesFactory, registerPlugin<Plugin_AcquireImages>(); )
@@ -113,7 +114,7 @@
if (!m_scanDlg)
{
- m_scanDlg = new ScanDialog(m_interface, m_saneWidget, kapp->activeWindow());
+ m_scanDlg = new ScanDialog(m_interface, m_saneWidget, kapp->activeWindow(), new ScanDialogAboutData);
}
else
{
--- trunk/extragear/graphics/kipi-plugins/acquireimages/scandialog.cpp #1034268:1034269
@@ -28,6 +28,7 @@
#include <QDateTime>
#include <QPushButton>
#include <QPointer>
+#include <QDir>
// KDE includes
@@ -56,7 +57,7 @@
// Local includes
-#include "kpaboutdata.h"
+#include "aboutdata.h"
#include "pluginsversion.h"
#include "saveimgthread.h"
@@ -84,11 +85,13 @@
KSaneIface::KSaneWidget *saneWidget;
};
-ScanDialog::ScanDialog(KIPI::Interface* kinterface, KSaneIface::KSaneWidget* saneWidget, QWidget* /*parent*/)
+ScanDialog::ScanDialog(KIPI::Interface* kinterface, KSaneIface::KSaneWidget* saneWidget,
+ QWidget* /*parent*/, ScanDialogAboutData *about)
: KDialog(0), d(new ScanDialogPriv)
{
d->saneWidget = saneWidget;
d->interface = kinterface;
+ d->about = about;
d->saveThread = new SaveImgThread(this);
setButtons(Help|Close);
@@ -99,25 +102,6 @@
// -- About data and help button ----------------------------------------
- d->about = new KIPIPlugins::KPAboutData(ki18n("Acquire images"),
- 0,
- KAboutData::License_GPL,
- ki18n("A Kipi plugin to acquire images using a flat scanner"),
- ki18n("(c) 2003-2009, Gilles Caulier\n"
- "(c) 2007-2009, Kare Sars"));
-
- d->about->addAuthor(ki18n("Gilles Caulier"),
- ki18n("Author"),
- "caulier dot gilles at gmail dot com");
-
- d->about->addAuthor(ki18n("Kare Sars"),
- ki18n("Developer"),
- "kare dot sars at kolumbus dot fi");
-
- d->about->addAuthor(ki18n("Angelo Naselli"),
- ki18n("Developer"),
- "anaselli at linux dot it");
-
KHelpMenu* helpMenu = new KHelpMenu(this, d->about, false);
helpMenu->menu()->removeAction(helpMenu->menu()->actions().first());
QAction *handbook = new QAction(i18n("Handbook"), this);
@@ -197,9 +181,13 @@
QString defaultMimeType("image/png");
QString defaultFileName("image.png");
QString format("PNG");
+ QString place = QDir::homePath();
- QPointer<KFileDialog> imageFileSaveDialog = new KFileDialog(d->interface->currentAlbum().uploadPath(), QString(), 0);
+ if (d->interface)
+ d->interface->currentAlbum().uploadPath();
+ QPointer<KFileDialog> imageFileSaveDialog = new KFileDialog(place, QString(), 0);
+
imageFileSaveDialog->setModal(false);
imageFileSaveDialog->setOperationMode(KFileDialog::Saving);
imageFileSaveDialog->setMode(KFile::File);
@@ -288,7 +276,9 @@
if (!sucess)
KMessageBox::error(0, i18n("Cannot save \"%1\" file", url.fileName()));
- d->interface->refreshImages( KUrl::List(url) );
+ if (d->interface)
+ d->interface->refreshImages( KUrl::List(url) );
+
unsetCursor();
setEnabled(true);
}
--- trunk/extragear/graphics/kipi-plugins/acquireimages/scandialog.h #1034268:1034269
@@ -46,6 +46,7 @@
namespace KIPIAcquireImagesPlugin
{
+class ScanDialogAboutData;
class ScanDialogPriv;
class ScanDialog : public KDialog
@@ -54,7 +55,8 @@
public:
- ScanDialog(KIPI::Interface* interface, KSaneIface::KSaneWidget* saneWidget, QWidget* parent);
+ ScanDialog(KIPI::Interface* interface, KSaneIface::KSaneWidget* saneWidget,
+ QWidget* parent, ScanDialogAboutData *about);
~ScanDialog();
protected:
** trunk/extragear/graphics/kipi-plugins/acquireimages/scangui.cpp #property svn:eol-style
+ native
More information about the Kde-imaging
mailing list