Commit ba91e644 authored by Cyrille Berger's avatar Cyrille Berger

add an option to choose between binary or ascii

svn path=/trunk/koffice/; revision=1048203
parent 82e76c29
add_subdirectory(tests)
include_directories( ${KRITA_INCLUDES} )
include_directories( ${KRITA_INCLUDES} ${CMAKE_CURRENT_fSOURCE_DIR} )
set(kritappmimport_PART_SRCS
kis_ppm_import.cpp
......@@ -18,6 +18,8 @@ set(kritappmexport_PART_SRCS
kis_ppm_export.cpp
)
kde4_add_ui_files(kritappmexport_PART_SRCS kis_wdg_options_ppm.ui )
kde4_add_plugin(kritappmexport WITH_PREFIX ${kritappmexport_PART_SRCS})
target_link_libraries(kritappmexport kritaui )
......
......@@ -21,8 +21,12 @@
#include <KGenericFactory>
#include <KoFilterChain.h>
#include <KDialog>
#include <kis_debug.h>
#include "ui_kis_wdg_options_ppm.h"
typedef KGenericFactory<KisPPMExport> KisPPMExportFactory;
K_EXPORT_COMPONENT_FACTORY(libkritappmexport, KisPPMExportFactory("kofficefilters"))
......@@ -40,5 +44,32 @@ KoFilter::ConversionStatus KisPPMExport::convert(const QByteArray& from, const Q
if (from != "application/x-krita")
return KoFilter::NotImplemented;
KDialog* kdb = new KDialog(0);
kdb->setWindowTitle(i18n("PPM Export Options"));
kdb->setButtons(KDialog::Ok | KDialog::Cancel);
Ui::WdgOptionsPPM optionsPPM;
QWidget* wdg = new QWidget(kdb);
optionsPPM.setupUi(wdg);
kdb->setMainWidget(wdg);
if (kdb->exec() == QDialog::Rejected) {
return KoFilter::OK; // FIXME Cancel doesn't exist :(
}
// if (KoID(cs->id()) == KoID("GRAYA") || KoID(cs->id()) == KoID("GRAYA16")) {
// return alpha ? PNG_COLOR_TYPE_GRAY_ALPHA : PNG_COLOR_TYPE_GRAY;
// }
// if (KoID(cs->id()) == KoID("RGBA") || KoID(cs->id()) == KoID("RGBA16")) {
// return alpha ? PNG_COLOR_TYPE_RGB_ALPHA : PNG_COLOR_TYPE_RGB;
// }
//
// KMessageBox::error(0, i18n("Cannot export images in %1.\n", cs->name())) ;
abort();
}
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WdgOptionsPPM</class>
<widget class="QWidget" name="WdgOptionsPPM">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>243</width>
<height>94</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Type:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="type">
<item>
<property name="text">
<string>Binary</string>
</property>
</item>
<item>
<property name="text">
<string>Ascii</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>46</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
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