void ProtoBufExport::Record(clang::RecordDecl const *record) { exportData([&](ct::proto::Envelope &env) { ct::proto::RecordDef *rec; if (clang::CXXRecordDecl const *cxxRecord = clang::dyn_cast<clang::CXXRecordDecl>(record)) { auto cRecord = env.mutable_c_record(); rec = cRecord->mutable_base(); std::for_each(cxxRecord->bases_begin(), cxxRecord->bases_end(), [&](clang::CXXBaseSpecifier const &base) { mapper.ResolveType(*cRecord->add_parents(), base.getType()); }); } else { rec = env.mutable_record(); } if (record->isClass()) { rec->set_variant(ct::proto::RecordDef_Variant_CLASS); } else if (record->isStruct()) { rec->set_variant(ct::proto::RecordDef_Variant_STRUCT); } else if (record->isUnion()) { rec->set_variant(ct::proto::RecordDef_Variant_UNION); } else { rec->set_variant(ct::proto::RecordDef_Variant_UNKNOWN); } mapper.ResolveType(*rec->mutable_internal_type(), clang::QualType(record->getTypeForDecl(), 0)); mapper.ResolveName(*rec->mutable_name(), *record); if (record->hasBody()) { mapper.ResolveLocation(*rec->mutable_definition(), record->getBody()->getSourceRange()); } }); }
void ProtoBufExport::TypeDef(clang::TypedefNameDecl const *typeDefinition) { exportData([&](ct::proto::Envelope &env) { auto tdef = env.mutable_tdef(); mapper.ResolveName(*tdef->mutable_name(), *typeDefinition); mapper.ResolveType(*tdef->mutable_mappedtype(), typeDefinition->getUnderlyingType()); }); }
bool Compiler::compile(const QString &url, QDataStream &output) { Q_D(Compiler); bool ret = compile(url); if (ret) { ret = createExportStructures(); if (d->basePathSet) { QString newUrl = d->basePath; int lastSlash = url.lastIndexOf('/'); if (lastSlash == -1) newUrl.append(url); else if (lastSlash < url.length() - 1) newUrl.append(url.mid(lastSlash + 1)); QUrl url; if (newUrl.startsWith(":/")) url.setUrl("qrc:" + newUrl); else url.setUrl("file:" + newUrl); d->compilation->url = url; d->compilation->urlString = url.toString(); } if (ret) ret = exportData(output); } delete takeCompilation(); return ret; }
void ProtoBufExport::TemplateParam(clang::TemplateTypeParmDecl const *param, clang::NamedDecl const *owner) { exportData([&](ct::proto::Envelope &env) { auto parm = env.mutable_tmpl_param(); mapper.ResolveType(*parm->mutable_own_type(), clang::QualType(param->getTypeForDecl(), 0)); mapper.ResolveName(*parm->mutable_owner_name(), *owner); }); }
void ProtoBufExport::Include(clang::FileEntry const *origin, clang::FileEntry const *target) { exportData([&](ct::proto::Envelope &env) { auto incl = env.mutable_include(); incl->set_origin(origin->getName()); incl->set_target(target->getName()); }); }
void ProtoBufExport::LocalVariable(clang::VarDecl const *varDecl) { exportData([&](ct::proto::Envelope &env) { auto var = env.mutable_var(); mapper.ResolveName(*var->mutable_name(), *varDecl); mapper.ResolveType(*var->mutable_own_type(), varDecl->getType()); var->set_kind(ct::proto::Var_VarKind_LOCAL); }); }
void ProtoBufExport::ParameterVariable(clang::ParmVarDecl const *param) { exportData([&](ct::proto::Envelope &env) { auto var = env.mutable_var(); mapper.ResolveName(*var->mutable_name(), *param); mapper.ResolveType(*var->mutable_own_type(), param->getType()); var->set_kind(ct::proto::Var_VarKind_PARAMETER); }); }
void ProtoBufExport::Enum(clang::EnumDecl const *enumDef) { exportData([&](ct::proto::Envelope &env) { auto e = env.mutable_enum_def(); mapper.ResolveName(*e->mutable_name(), *enumDef); if (enumDef->hasBody()) { mapper.ResolveLocation(*e->mutable_definition(), enumDef->getBody()->getSourceRange()); } }); }
void ProtoBufExport::MemberVariable(clang::FieldDecl const *field) { exportData([&](ct::proto::Envelope &env) { auto c_var = env.mutable_c_var(); mapper.ResolveType(*c_var->mutable_parent(), clang::QualType(field->getParent()->getTypeForDecl(), 0)); auto var = c_var->mutable_base(); mapper.ResolveName(*var->mutable_name(), *field); mapper.ResolveType(*var->mutable_own_type(), field->getType()); var->set_kind(ct::proto::Var_VarKind_CLASS); }); }
void GraphExport::accept() { ui->buttonBox->setEnabled(false); if(exportData()) QDialog::accept(); else Utils::showErrorBox(tr("Failed to open output file!"), this); ui->buttonBox->setEnabled(true); }
/** Exports the currently selected item. */ void medDatabaseView::onExportSelectedItemRequested(void) { if(!this->selectedIndexes().count()) return; QModelIndex index = this->selectedIndexes().first(); if(!index.isValid()) return; medAbstractDatabaseItem *item = NULL; if(QSortFilterProxyModel *proxy = dynamic_cast<QSortFilterProxyModel *>(this->model())) item = static_cast<medAbstractDatabaseItem *>(proxy->mapToSource(index).internalPointer()); if(item) { if(item->dataIndex().isValidForSeries()) { emit exportData(item->dataIndex()); } else if(item->dataIndex().isValidForStudy()) { for (int i = 0; i<item->childCount(); i++) emit exportData(item->child(i)->dataIndex()); } if(item->dataIndex().isValidForPatient()) { for (int i = 0; i<item->childCount(); i++) { medAbstractDatabaseItem *study = item->child(i); for (int j = 0; j<study->childCount(); j++) { emit exportData(study->child(j)->dataIndex()); } } } } }
void ProtoBufExport::Template(clang::VarTemplateDecl const *Template) { std::unordered_set<TypeMapper::PtrInt> specialized_types; gatherSpecializationTypes<clang::VarTemplateDecl>(specialized_types, *Template); exportData([&](ct::proto::Envelope &env) { auto tmpl = env.mutable_tmpl(); mapper.ResolveName(*tmpl->mutable_attached_name(), *Template->getTemplatedDecl()); for (auto id : specialized_types) { tmpl->add_specializations()->set_type_id(id); } }); }
hkDemo::Result PackfileImportExport::stepDemo() { if( m_physicsData == HK_NULL ) { m_error = "Could not load file"; return DEMO_ERROR; } if( m_options.m_reload ) { m_options.m_reload = 0; exportData(); } return hkDefaultPhysicsDemo::stepDemo(); }
void ExporterPluginView::exportToClipboard() { if (!m_view->selection()) { return; } QMimeData *data = new QMimeData(); QString s; QTextStream output( &s, QIODevice::WriteOnly ); exportData(true, output); data->setHtml(s); data->setText(s); QApplication::clipboard()->setMimeData(data); }
void ProtoBufExport::Friend(clang::FriendDecl const *friends) { exportData([&](ct::proto::Envelope &env) { auto fdef = env.mutable_friend_(); if (clang::TagDecl const *tag = clang::dyn_cast<clang::TagDecl>(friends->getDeclContext())) { mapper.ResolveType(*fdef->mutable_origin(), clang::QualType(tag->getTypeForDecl(), 0)); } else { llvm_unreachable("Unable to discover type for friend relation"); } if (friends->getFriendType()) { mapper.ResolveType(*fdef->mutable_type_friend(), friends->getFriendType()->getType()); } else { mapper.ResolveName(*fdef->mutable_friend_(), *friends->getFriendDecl()); } }); }
/** Exports the currently selected item. */ void medDatabaseView::onExportSelectedItemRequested(void) { if(!this->selectedIndexes().count()) return; QModelIndex index = this->selectedIndexes().first(); if(!index.isValid()) return; medAbstractDatabaseItem *item = NULL; if(QSortFilterProxyModel *proxy = dynamic_cast<QSortFilterProxyModel *>(this->model())) item = static_cast<medAbstractDatabaseItem *>(proxy->mapToSource(index).internalPointer()); if(item) emit exportData(item->dataIndex()); }
void DataOutputWidget::slotCopySelected() { if (m_model->rowCount() <= 0) return; while (m_model->canFetchMore()) m_model->fetchMore(); if (!m_view->selectionModel()->hasSelection()) m_view->selectAll(); QString text; QTextStream stream(&text); exportData(stream); if (!text.isEmpty()) kapp->clipboard()->setText(text); }
Donations::Donations(QWidget *parent) : QWidget(parent) { setupUi(this); connect(dateFrom, SIGNAL(dateChanged(QDate)), this, SLOT(searchData())); connect(dateUntil, SIGNAL(dateChanged(QDate)), this, SLOT(searchData())); connect(btnExport, SIGNAL(clicked()), this, SLOT(exportData())); connect(btnEmail, SIGNAL(clicked()), this, SLOT(sendEmail())); connect(sectionList, SIGNAL(currentIndexChanged(int)), this, SLOT(selectSection())); connect(yearList, SIGNAL(itemSelectionChanged()), this, SLOT(selectYear())); tableModel = new QSqlQueryModel(tableView); donationsModel = new QSqlQueryModel(donationsTable); fileImport = false; loadData(); loadSectionDonations(); }
EMessageBoxReturn Dialog::DoModal() { importData(); PreModal(); EMessageBoxReturn ret = modal_dialog_show(m_window, m_modal); ASSERT_NOTNULL(m_window); if(ret == eIDOK) { exportData(); } gtk_widget_hide(GTK_WIDGET(m_window)); PostModal(m_modal.ret); return m_modal.ret; }
/** \brief Called when plot task starts running 1. Export the region or part of the region of interest into survex file 2. Run the survex program 3. Read the 3d file data 4. Update the survey data */ void cwLinePlotTask::runTask() { // qDebug() << "\n-------------------------------------"; if(!isRunning()) { done(); return; } // qDebug() << "Running line plot task"; //Clear the previous results Result.clear(); //Change all the cave names, such that survex can handle them correctly encodeCaveNames(); //Initilize the cave station lookup, from previous run initializeCaveStationLookups(); Time.start(); exportData(); }
void ProtoBufExport::Function(clang::FunctionDecl const *function) { exportData([&](ct::proto::Envelope &env) { ct::proto::FunctionDef *func; if (clang::CXXMethodDecl const *method = clang::dyn_cast<clang::CXXMethodDecl>(function)) { auto c_func = env.mutable_c_func(); func = c_func->mutable_base(); mapper.ResolveType(*c_func->mutable_parent(), clang::QualType(method->getParent()->getTypeForDecl(), 0)); c_func->set_static_(method->isStatic()); c_func->set_virtual_(method->isVirtual()); } else { func = env.mutable_func(); } mapper.ResolveName(*func->mutable_name(), *function); mapper.ResolveType(*func->mutable_return_type(), function->getReturnType()); if (function->hasBody()) { mapper.ResolveLocation(*func->mutable_body(), function->getBody()->getSourceRange()); } }); }
JsonWebKey CryptoKeyRSA::exportJwk() const { JsonWebKey result; result.kty = "RSA"; result.key_ops = usages(); result.ext = extractable(); auto keyData = exportData(); const auto& rsaKeyData = downcast<CryptoKeyDataRSAComponents>(*keyData); // public key result.n = base64URLEncode(rsaKeyData.modulus()); result.e = base64URLEncode(rsaKeyData.exponent()); if (rsaKeyData.type() == CryptoKeyDataRSAComponents::Type::Public) return result; // private key result.d = base64URLEncode(rsaKeyData.privateExponent()); if (!rsaKeyData.hasAdditionalPrivateKeyParameters()) return result; result.p = base64URLEncode(rsaKeyData.firstPrimeInfo().primeFactor); result.q = base64URLEncode(rsaKeyData.secondPrimeInfo().primeFactor); result.dp = base64URLEncode(rsaKeyData.firstPrimeInfo().factorCRTExponent); result.dq = base64URLEncode(rsaKeyData.secondPrimeInfo().factorCRTExponent); result.qi = base64URLEncode(rsaKeyData.secondPrimeInfo().factorCRTCoefficient); if (rsaKeyData.otherPrimeInfos().isEmpty()) return result; Vector<RsaOtherPrimesInfo> oth; for (auto info : rsaKeyData.otherPrimeInfos()) { RsaOtherPrimesInfo otherInfo; otherInfo.r = base64URLEncode(info.primeFactor); otherInfo.d = base64URLEncode(info.factorCRTExponent); otherInfo.t = base64URLEncode(info.factorCRTCoefficient); oth.append(WTFMove(otherInfo)); } result.oth = WTFMove(oth); return result; }
void ExporterPluginView::exportToFile() { KUrl url = KFileDialog::getSaveUrl(m_view->document()->documentName(), "text/html", m_view, i18n("Export File as HTML")); if ( url.isEmpty() ) { return; } QString filename; if ( url.isLocalFile() ) { filename = url.toLocalFile(); } else { ///TODO: cleanup! don't let the temp files lay around KTemporaryFile tmp; // ### only used for network export tmp.setAutoRemove(false); tmp.open(); filename = tmp.fileName(); } KSaveFile savefile(filename); if (savefile.open()) { QTextStream outputStream ( &savefile ); exportData(false, outputStream); savefile.finalize(); //check error? } // else // {/*ERROR*/} if ( !url.isLocalFile() ) { KIO::NetAccess::upload( filename, url, 0 ); } }
LRESULT PropPageTextStyles::onExport(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { tstring x = _T(""); if(WinUtil::browseFile(x, m_hWnd, true, x, types, defExt) == IDOK) { SimpleXML xml; xml.addTag("DCPlusPlus"); xml.stepIn(); xml.addTag("Settings"); xml.stepIn(); string type("type"), curType("string"); exportData("Font", TEXT_FONT); curType = "int"; exportData("BackgroundColor", BACKGROUND_COLOR); exportData("TextColor", TEXT_COLOR); exportData("DownloadBarColor", DOWNLOAD_BAR_COLOR); exportData("UploadBarColor", UPLOAD_BAR_COLOR); exportData("TextGeneralBackColor", TEXT_GENERAL_BACK_COLOR); exportData("TextGeneralForeColor", TEXT_GENERAL_FORE_COLOR); exportData("TextGeneralBold", TEXT_GENERAL_BOLD); exportData("TextGeneralItalic", TEXT_GENERAL_ITALIC); exportData("TextMyOwnBackColor", TEXT_MYOWN_BACK_COLOR); exportData("TextMyOwnForeColor", TEXT_MYOWN_FORE_COLOR); exportData("TextMyOwnBold", TEXT_MYOWN_BOLD); exportData("TextMyOwnItalic", TEXT_MYOWN_ITALIC); exportData("TextPrivateBackColor", TEXT_PRIVATE_BACK_COLOR); exportData("TextPrivateForeColor", TEXT_PRIVATE_FORE_COLOR); exportData("TextPrivateBold", TEXT_PRIVATE_BOLD); exportData("TextPrivateItalic", TEXT_PRIVATE_ITALIC); exportData("TextSystemBackColor", TEXT_SYSTEM_BACK_COLOR); exportData("TextSystemForeColor", TEXT_SYSTEM_FORE_COLOR); exportData("TextSystemBold", TEXT_SYSTEM_BOLD); exportData("TextSystemItalic", TEXT_SYSTEM_ITALIC); exportData("TextServerBackColor", TEXT_SERVER_BACK_COLOR); exportData("TextServerForeColor", TEXT_SERVER_FORE_COLOR); exportData("TextServerBold", TEXT_SERVER_BOLD); exportData("TextServerItalic", TEXT_SERVER_ITALIC); exportData("TextTimestampBackColor", TEXT_TIMESTAMP_BACK_COLOR); exportData("TextTimestampForeColor", TEXT_TIMESTAMP_FORE_COLOR); exportData("TextTimestampBold", TEXT_TIMESTAMP_BOLD); exportData("TextTimestampItalic", TEXT_TIMESTAMP_ITALIC); exportData("TextMyNickBackColor", TEXT_MYNICK_BACK_COLOR); exportData("TextMyNickForeColor", TEXT_MYNICK_FORE_COLOR); exportData("TextMyNickBold", TEXT_MYNICK_BOLD); exportData("TextMyNickItalic", TEXT_MYNICK_ITALIC); exportData("TextFavBackColor", TEXT_FAV_BACK_COLOR); exportData("TextFavForeColor", TEXT_FAV_FORE_COLOR); exportData("TextFavBold", TEXT_FAV_BOLD); exportData("TextFavItalic", TEXT_FAV_ITALIC); exportData("TextURLBackColor", TEXT_URL_BACK_COLOR); exportData("TextURLForeColor", TEXT_URL_FORE_COLOR); exportData("TextURLBold", TEXT_URL_BOLD); exportData("TextURLItalic", TEXT_URL_ITALIC); exportData("BoldAuthorsMess", BOLD_AUTHOR_MESS); exportData("ProgressTextDown", PROGRESS_TEXT_COLOR_DOWN); exportData("ProgressTextUp", PROGRESS_TEXT_COLOR_UP); exportData("ErrorColor", ERROR_COLOR); exportData("ProgressOverrideColors", PROGRESS_OVERRIDE_COLORS); exportData("MenubarTwoColors", MENUBAR_TWO_COLORS); exportData("MenubarLeftColor", MENUBAR_LEFT_COLOR); exportData("MenubarRightColor", MENUBAR_RIGHT_COLOR); exportData("MenubarBumped", MENUBAR_BUMPED); exportData("Progress3DDepth", PROGRESS_3DDEPTH); exportData("ProgressOverrideColors2", PROGRESS_OVERRIDE_COLORS2); exportData("TextOPBackColor", TEXT_OP_BACK_COLOR); exportData("TextOPForeColor", TEXT_OP_FORE_COLOR); exportData("TextOPBold", TEXT_OP_BOLD); exportData("TextOPItalic", TEXT_OP_ITALIC); exportData("SearchAlternateColour", SEARCH_ALTERNATE_COLOUR); exportData("ProgressBackColor", PROGRESS_BACK_COLOR); exportData("ProgressCompressColor", PROGRESS_COMPRESS_COLOR); exportData("ProgressSegmentColor", PROGRESS_SEGMENT_COLOR); exportData("ColorDone", COLOR_DONE); exportData("ColorDownloaded", COLOR_DOWNLOADED); exportData("ColorRunning", COLOR_RUNNING); exportData("IgnoredColor", IGNORED_COLOR); exportData("FavoriteColor", FAVORITE_COLOR); exportData("NormalColour", NORMAL_COLOUR); exportData("PasiveColor", PASIVE_COLOR); exportData("OpColor", OP_COLOR); exportData("ProgressbaroDCStyle", PROGRESSBAR_ODC_STYLE); try { File ff(Text::fromT(x) , File::WRITE, File::CREATE | File::TRUNCATE); BufferedOutputStream<false> f(&ff); f.write(SimpleXML::utf8Header); xml.toXML(&f); f.flush(); ff.close(); } catch(const FileException&) { // ... } } return 0; }
void DataOutputWidget::slotExport() { if (m_model->rowCount() <= 0) return; while (m_model->canFetchMore()) m_model->fetchMore(); if (!m_view->selectionModel()->hasSelection()) m_view->selectAll(); ExportWizard wizard(this); if (wizard.exec() != QDialog::Accepted) return; bool outputInDocument = wizard.field("outDocument").toBool(); bool outputInClipboard = wizard.field("outClipboard").toBool(); bool outputInFile = wizard.field("outFile").toBool(); bool exportColumnNames = wizard.field("exportColumnNames").toBool(); bool exportLineNumbers = wizard.field("exportLineNumbers").toBool(); Options opt = NoOptions; if (exportColumnNames) opt |= ExportColumnNames; if (exportLineNumbers) opt |= ExportLineNumbers; bool quoteStrings = wizard.field("checkQuoteStrings").toBool(); bool quoteNumbers = wizard.field("checkQuoteNumbers").toBool(); QChar stringsQuoteChar = (quoteStrings) ? wizard.field("quoteStringsChar").toString().at(0) : '\0'; QChar numbersQuoteChar = (quoteNumbers) ? wizard.field("quoteNumbersChar").toString().at(0) : '\0'; QString fieldDelimiter = wizard.field("fieldDelimiter").toString(); if (outputInDocument) { Kate::MainWindow *mw = Kate::application()->activeMainWindow(); KTextEditor::View *kv = mw->activeView(); if (!kv) return; QString text; QTextStream stream(&text); exportData(stream, stringsQuoteChar, numbersQuoteChar, fieldDelimiter, opt); kv->insertText(text); kv->setFocus(); } else if (outputInClipboard) { QString text; QTextStream stream(&text); exportData(stream, stringsQuoteChar, numbersQuoteChar, fieldDelimiter, opt); kapp->clipboard()->setText(text); } else if (outputInFile) { QString url = wizard.field("outFileUrl").toString(); QFile data(url); if (data.open(QFile::WriteOnly | QFile::Truncate)) { QTextStream stream(&data); exportData(stream, stringsQuoteChar, numbersQuoteChar, fieldDelimiter, opt); stream.flush(); } else { KMessageBox::error(this, i18nc("@info", "Unable to open file <filename>%1</filename>").arg(url)); } } }
void Dialog::HideDlg() { ASSERT_MESSAGE(m_window != 0, "dialog was not constructed"); exportData(); gtk_widget_hide(GTK_WIDGET(m_window)); }
LRESULT PropPageTextStyles::onExport(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { tstring x = _T(""); if(WinUtil::browseFile(x, m_hWnd, true, x, types, defExt) == IDOK) { SimpleXML xml; xml.addTag("DCPlusPlus"); xml.stepIn(); xml.addTag("Settings"); xml.stepIn(); string type("type"), curType("string"); exportData("Font", TEXT_FONT); curType = "int"; exportData("BackgroundColor", BACKGROUND_COLOR); exportData("TextColor", TEXT_COLOR); exportData("DownloadBarColor", DOWNLOAD_BAR_COLOR); exportData("UploadBarColor", UPLOAD_BAR_COLOR); exportData("TextGeneralBackColor", TEXT_GENERAL_BACK_COLOR); exportData("TextGeneralForeColor", TEXT_GENERAL_FORE_COLOR); exportData("TextGeneralBold", TEXT_GENERAL_BOLD); exportData("TextGeneralItalic", TEXT_GENERAL_ITALIC); exportData("TextMyOwnBackColor", TEXT_MYOWN_BACK_COLOR); exportData("TextMyOwnForeColor", TEXT_MYOWN_FORE_COLOR); exportData("TextMyOwnBold", TEXT_MYOWN_BOLD); exportData("TextMyOwnItalic", TEXT_MYOWN_ITALIC); exportData("TextPrivateBackColor", TEXT_PRIVATE_BACK_COLOR); exportData("TextPrivateForeColor", TEXT_PRIVATE_FORE_COLOR); exportData("TextPrivateBold", TEXT_PRIVATE_BOLD); exportData("TextPrivateItalic", TEXT_PRIVATE_ITALIC); exportData("TextSystemBackColor", TEXT_SYSTEM_BACK_COLOR); exportData("TextSystemForeColor", TEXT_SYSTEM_FORE_COLOR); exportData("TextSystemBold", TEXT_SYSTEM_BOLD); exportData("TextSystemItalic", TEXT_SYSTEM_ITALIC); exportData("TextServerBackColor", TEXT_SERVER_BACK_COLOR); exportData("TextServerForeColor", TEXT_SERVER_FORE_COLOR); exportData("TextServerBold", TEXT_SERVER_BOLD); exportData("TextServerItalic", TEXT_SERVER_ITALIC); exportData("TextTimestampBackColor", TEXT_TIMESTAMP_BACK_COLOR); exportData("TextTimestampForeColor", TEXT_TIMESTAMP_FORE_COLOR); exportData("TextTimestampBold", TEXT_TIMESTAMP_BOLD); exportData("TextTimestampItalic", TEXT_TIMESTAMP_ITALIC); exportData("TextMyNickBackColor", TEXT_MYNICK_BACK_COLOR); exportData("TextMyNickForeColor", TEXT_MYNICK_FORE_COLOR); exportData("TextMyNickBold", TEXT_MYNICK_BOLD); exportData("TextMyNickItalic", TEXT_MYNICK_ITALIC); exportData("TextFavBackColor", TEXT_FAV_BACK_COLOR); exportData("TextFavForeColor", TEXT_FAV_FORE_COLOR); exportData("TextFavBold", TEXT_FAV_BOLD); exportData("TextFavItalic", TEXT_FAV_ITALIC); exportData("TextURLBackColor", TEXT_URL_BACK_COLOR); exportData("TextURLForeColor", TEXT_URL_FORE_COLOR); exportData("TextURLBold", TEXT_URL_BOLD); exportData("TextURLItalic", TEXT_URL_ITALIC); exportData("ProgressTextDown", PROGRESS_TEXT_COLOR_DOWN); exportData("ProgressTextUp", PROGRESS_TEXT_COLOR_UP); exportData("ErrorColor", ERROR_COLOR); exportData("ProgressOverrideColors", PROGRESS_OVERRIDE_COLORS); exportData("MenubarTwoColors", MENUBAR_TWO_COLORS); exportData("MenubarLeftColor", MENUBAR_LEFT_COLOR); exportData("MenubarRightColor", MENUBAR_RIGHT_COLOR); exportData("MenubarBumped", MENUBAR_BUMPED); exportData("Progress3DDepth", PROGRESS_3DDEPTH); exportData("ProgressOverrideColors2", PROGRESS_OVERRIDE_COLORS2); exportData("TextOPBackColor", TEXT_OP_BACK_COLOR); exportData("TextOPForeColor", TEXT_OP_FORE_COLOR); exportData("TextOPBold", TEXT_OP_BOLD); exportData("TextOPItalic", TEXT_OP_ITALIC); exportData("TextNormBackColor", TEXT_NORM_BACK_COLOR); exportData("TextNormForeColor", TEXT_NORM_FORE_COLOR); exportData("TextNormBold", TEXT_NORM_BOLD); exportData("TextNormItalic", TEXT_NORM_ITALIC); exportData("SearchAlternateColour", SEARCH_ALTERNATE_COLOUR); exportData("ProgressBackColor", PROGRESS_BACK_COLOR); exportData("ProgressCompressColor", PROGRESS_COMPRESS_COLOR); exportData("ProgressSegmentColor", PROGRESS_SEGMENT_COLOR); exportData("ColorDone", COLOR_DONE); exportData("ColorDownloaded", COLOR_DOWNLOADED); exportData("ColorRunning", COLOR_RUNNING); exportData("ReservedSlotColor", RESERVED_SLOT_COLOR); exportData("IgnoredColor", IGNORED_COLOR); exportData("FavoriteColor", FAVORITE_COLOR); exportData("NormalColour", NORMAL_COLOUR); exportData("PasiveColor", PASIVE_COLOR); exportData("OpColor", OP_COLOR); exportData("ProgressbaroDCStyle", PROGRESSBAR_ODC_STYLE); exportData("UnderlineLinks", UNDERLINE_LINKS); exportData("UnderlineDupes", UNDERLINE_DUPES); exportData("TextDupeBackColor", TEXT_DUPE_BACK_COLOR); exportData("TextDupeColor", DUPE_COLOR); exportData("TextDupeBold", TEXT_DUPE_BOLD); exportData("TextDupeItalic", TEXT_DUPE_ITALIC); exportData("TextQueueBackColor", TEXT_QUEUE_BACK_COLOR); exportData("QueueColor", QUEUE_COLOR); exportData("TextQueueBold", TEXT_QUEUE_BOLD); exportData("TextQueueItalic", TEXT_QUEUE_ITALIC); exportData("UnderlineQueue", UNDERLINE_QUEUE); //tabs exportData("tabactivebg", TAB_ACTIVE_BG); exportData("TabActiveText", TAB_ACTIVE_TEXT); exportData("TabActiveBorder", TAB_ACTIVE_BORDER); exportData("TabInactiveBg", TAB_INACTIVE_BG); exportData("TabInactiveBgDisconnected", TAB_INACTIVE_BG_DISCONNECTED); exportData("TabInactiveText", TAB_INACTIVE_TEXT); exportData("TabInactiveBorder", TAB_INACTIVE_BORDER); exportData("TabInactiveBgNotify", TAB_INACTIVE_BG_NOTIFY); exportData("TabDirtyBlend", TAB_DIRTY_BLEND); exportData("BlendTabs", BLEND_TABS); exportData("TabSize", TAB_SIZE); xml.stepOut(); if(!HighlightManager::getInstance()->emptyList()) HighlightManager::getInstance()->save(xml); /* Don't export icon stuff, user might have absolute path for toolbars. Icon packs can be included by editing the .dctheme example. curType = "string"; string empty = ""; xml.addTag("Icons"); xml.stepIn(); exportData("IconPath", ICON_PATH); xml.addTag("ToolbarImage", empty); xml.addChildAttrib(curType, curType); xml.addTag("ToolbarHot", empty); xml.addChildAttrib(type, curType); xml.stepOut(); */ try { File ff(Text::fromT(x) , File::WRITE, File::CREATE | File::TRUNCATE); BufferedOutputStream<false> f(&ff); f.write(SimpleXML::utf8Header); xml.toXML(&f); f.flush(); ff.close(); } catch(const FileException&) { // ... } } return 0; }
void ExportWizard::accept() { QString finishText = buttonText(QWizard::FinishButton); if (finishText == tr("Finish")) { QDialog::accept(); return; } QString key = exportInfo->getSource(); QSqlDatabase source = QSqlDatabase::database(strMap.value(key)); if (field("txtRadio").toBool()) { QString directory = field("txtName").toString(); exportTxt(source, directory); } else if (field("accessRadio").toBool()) { QString accessName = field("accessName").toString(); QSqlDatabase target = QSqlDatabase::addDatabase("QODBC", "QODBCTempConnect"); target.setDatabaseName("DRIVER={Microsoft Access driver (*.mdb, *.accdb)};FIL={MS Access};DBQ=" + accessName); if (!target.open()) return; exportData(source, target); } else if (field("sqlserverRadio").toBool()) { QString databaseName = field("sqlserverDatabaseName").toString(); QString hostName = field("sqlserverHostName").toString(); QString dsn = "Driver={sql server};server=" + hostName + ";database=" + databaseName; QSqlDatabase target = QSqlDatabase::addDatabase("QODBC", "QODBCTempConnect"); target.setDatabaseName(dsn); QString userName = field("sqlserverUserName").toString(); if (!userName.isEmpty()) target.setUserName(userName); QString password = field("sqlserverPassword").toString(); if (!password.isEmpty()) target.setPassword(password); QString port = field("sqlserverPort").toString(); if (!port.isEmpty()) { bool ok; int i = port.toInt(&ok); if (ok) target.setPort(i); } if (target.open()) { exportData(source, target); } } else if (field("excelRadio").toBool()) { QString excelName = field("excelName").toString(); exportExcel(source, excelName); } else { QString directory = field("xmlName").toString(); exportXml(source, directory); } }
void ProtoBufExport::InputChanged(clang::FileEntry const *file) { exportData([&](ct::proto::Envelope &env) { auto input = env.mutable_input(); input->set_file_path(file->getName()); }); }