• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

parley

export.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002     Copyright 2008 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
00003  ***************************************************************************/
00004 
00005 /***************************************************************************
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  ***************************************************************************/
00013 
00014 #include "export.h"
00015 
00016 #include "xsldialog.h"
00017 #include "parleydocument.h"
00018 
00019 #include <KStandardDirs>
00020 #include <KUrl>
00021 #include <KDebug>
00022 #include <KFileDialog>
00023 #include <KLocalizedString>
00024 
00025 
00026 void ParleyExport::exportDocument(ParleyDocument* document, QWidget * parent)
00027 {
00028     // first get the new file name and type
00029     QString filter = "*.html|" + i18n("HTML document") + '\n' + KEduVocDocument::pattern(KEduVocDocument::Writing);
00030 
00031     KFileDialog dlg( (document->document()->url().fileName() == i18n("Untitled")) ? "": document->document()->url().path(), filter, parent );
00032     dlg.setOperationMode( KFileDialog::Saving );
00033     dlg.setMode( KFile::File );
00034     dlg.setWindowTitle(i18n("Export As"));
00035     if (dlg.exec() != QDialog::Accepted) {
00036         return;
00037     }
00038 
00039     QString filename = dlg.selectedFile();
00040 
00041     QString documentType = dlg.currentFilter();
00042     kDebug() << documentType;
00043 
00044     // if it's html, use xslt
00045     if (documentType == "*.html") {
00046         XslDialog dlg(filename, document->document(), parent);
00047         dlg.exec();
00048     } else {
00049         document->saveAs(filename);
00050     }
00051 
00052 
00053 //     ui = new Ui::ExportOptions();
00054 //     ui->setupUi(mainWidget());
00055 // 
00056 //     m_sourceFile = file;
00057 //     KUrl fileUrl = file;
00058 //     QString fileName = file.fileName().left(file.fileName().indexOf('.'));
00059 //     fileName.append(".html");
00060 //     fileUrl.setFileName(fileName);
00061 // 
00062 //     ui->fileName->setUrl(fileUrl);
00063 
00064 
00065     // else use libkdeedu
00067 
00068 
00069 }
00070 

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal