Add ExportPanel and update Import/Export engines

This commit is contained in:
Grégory Soutadé 2012-02-11 14:02:30 +01:00
parent b533ac0578
commit 67e00fcaa1
5 changed files with 13 additions and 3 deletions

View File

@ -31,7 +31,7 @@ XMLExportEngine::XMLExportEngine()
KissCount::RegisterExportEngine(this);
_shortExt = "xml";
_longExt = _("XML files (*.xml)|*.xml");
_longExt = _("KissCount XML files (*.xml)|*.xml");
}
XMLExportEngine::~XMLExportEngine()
@ -64,6 +64,7 @@ bool XMLExportEngine::SaveAccounts()
// xmlTextWriterWriteAttribute(_writer, (const xmlChar*) "default", (const xmlChar*) (account._default ? "1" : "0"));
// xmlTextWriterWriteAttribute(_writer, (const xmlChar*) "is_owner", (const xmlChar*) (account.is_owner ? "1" : "0"));
xmlTextWriterWriteAttribute(_writer, (const xmlChar*) "virtual", (const xmlChar*) (account._virtual ? "1" : "0"));
xmlTextWriterWriteAttribute(_writer, (const xmlChar*) "hidden", (const xmlChar*) (account.hidden ? "1" : "0"));
xmlTextWriterEndElement(_writer);
}
@ -101,6 +102,7 @@ bool XMLExportEngine::SaveCategories()
xmlTextWriterStartElement(_writer, (const xmlChar*) "category");
xmlTextWriterWriteAttribute(_writer, (const xmlChar*) "id", (const xmlChar*) QString::number(category.id).toStdString().c_str());
xmlTextWriterWriteAttribute(_writer, (const xmlChar*) "parent", (const xmlChar*) QString::number(category.parent).toStdString().c_str());
xmlTextWriterWriteAttribute(_writer, (const xmlChar*) "name", (const xmlChar*) category.name.toStdString().c_str());
xmlTextWriterWriteAttribute(_writer, (const xmlChar*) "font", (const xmlChar*) category.font.toStdString().c_str());
rgb = category.backcolor.blue();

View File

@ -67,6 +67,7 @@ void GrisbiImportEngine::LoadAccount(GrisbiImportEngine* _this, const char** att
ac._default = false;
ac.is_owner = true;
ac._virtual = false;
ac.hidden = false;
_this->_unresolvedAccounts.push_back(ac);
}

View File

@ -57,6 +57,7 @@ int OFXImportEngine::account_cb(const struct OfxAccountData data, void * account
ac._default = false;
ac.is_owner = true;
ac._virtual = false;
ac.hidden = false;
_this->_unresolvedAccounts.push_back(ac);
}

View File

@ -47,6 +47,9 @@ void XMLImportEngine::LoadAccount(XMLImportEngine* _this, const char** attrs)
else if (!strcmp(attrs[i], "virtual"))
ac._virtual = (QString(attrs[i+1]) == "1");
else if (!strcmp(attrs[i], "hidden"))
ac.hidden = (QString(attrs[i+1]) == "1");
}
UNESCAPE_CHARS(ac.name);
@ -115,6 +118,9 @@ void XMLImportEngine::LoadCategory(XMLImportEngine* _this, const char** attrs)
else if (!strcmp(attrs[i], "id"))
cat.id = id = QString(attrs[i+1]).toInt();
else if (!strcmp(attrs[i], "parent"))
cat.parent = id = QString(attrs[i+1]).toInt();
else if (!strcmp(attrs[i], "font"))
cat.font = QString(attrs[i+1]);

View File

@ -25,7 +25,7 @@
//#include "UsersDialog.hpp"
#include "StatsPanel.hpp"
//#include "ImportPanel.hpp"
//#include "ExportPanel.hpp"
#include "ExportPanel.hpp"
#include "wxUI.hpp"
#include "view.hpp"
@ -169,7 +169,7 @@ void wxUI::InitPanels()
ADD_PANEL(SearchPanel);
ADD_PANEL(PreferencesPanel);
// ADD_PANEL(ImportPanel, 4);
// ADD_PANEL(ExportPanel, 5);
ADD_PANEL(ExportPanel);
}
void wxUI::LoadPanels()