1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "UBExportCFF.h"
#include "UBCFFAdaptor.h"
#include "document/UBDocumentProxy.h"
#include "core/UBDocumentManager.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
UBExportCFF::UBExportCFF(QObject *parent)
: UBExportAdaptor(parent)
{
}
UBExportCFF::~UBExportCFF()
{
}
QString UBExportCFF::exportName()
{
return tr("Export to IWB");
}
QString UBExportCFF::exportExtention()
{
return QString(".iwb");
}
void UBExportCFF::persist(UBDocumentProxy* pDocument)
{
QString src = pDocument->persistencePath();
if (!pDocument)
return;
QString filename = askForFileName(pDocument, tr("Export as IWB File"));
if (filename.length() > 0)
{
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
if (mIsVerbose)
UBApplication::showMessage(tr("Exporting document..."));
UBCFFAdaptor toIWBExporter;
if (toIWBExporter.convertUBZToIWB(src, filename))
{
if (mIsVerbose)
UBApplication::showMessage(tr("Export successful."));
}
else
if (mIsVerbose)
UBApplication::showMessage(tr("Export failed."));
showErrorsList(toIWBExporter.getConversionMessages());
QApplication::restoreOverrideCursor();
}
}