SVN commit 1138346 by bport: Add html export to KPresenter M +5 -1 part/CMakeLists.txt A part/KPrHtmlExport.cpp [License: LGPL (v2+)] A part/KPrHtmlExport.h [License: LGPL (v2+)] A part/KPrHtmlExportUiDelegate.cpp [License: LGPL (v2+)] A part/KPrHtmlExportUiDelegate.h [License: LGPL (v2+)] M +28 -2 part/KPrView.cpp M +3 -0 part/KPrView.h M +3 -0 part/kpresenter.rc A part/ui/KPrHtmlExport.ui A part/ui/KPrHtmlExportDialog.cpp [License: LGPL (v2+)] A part/ui/KPrHtmlExportDialog.h [License: LGPL (v2+)] M +1 -0 templates/CMakeLists.txt A templates/exportHTML (directory) A templates/exportHTML/CMakeLists.txt A templates/exportHTML/slides.html A templates/exportHTML/templates (directory) A templates/exportHTML/templates/CMakeLists.txt AM templates/exportHTML/templates/Default.zip A templates/exportHTML/toc.html --- trunk/koffice/kpresenter/part/CMakeLists.txt #1138345:1138346 @@ -60,6 +60,8 @@ KPrPageSelectStrategyFixed.cpp KPrPageSelectStrategyActive.cpp KPrDurationParser.cpp + KPrHtmlExport.cpp + KPrHtmlExportUiDelegate.cpp commands/KPrAnimationCreateCommand.cpp commands/KPrPageEffectSetCommand.cpp @@ -102,6 +104,7 @@ ui/KPrConfigureSlideShowDialog.cpp ui/KPrConfigurePresenterViewDialog.cpp ui/KPrPresentationToolWidget.cpp + ui/KPrHtmlExportDialog.cpp tools/KPrPlaceholderTool.cpp tools/KPrPlaceholderToolFactory.cpp @@ -112,11 +115,12 @@ ui/KPrConfigureSlideShow.ui ui/KPrConfigurePresenterView.ui ui/KPrPresentationTool.ui + ui/KPrHtmlExport.ui ) kde4_add_library(kpresenterprivate SHARED ${kpresenterprivate_LIB_SRCS}) -target_link_libraries(kpresenterprivate kopageapp kowidgets ${KDE4_PHONON_LIBRARY} ${QT_QTOPENGL_LIBRARY}) +target_link_libraries(kpresenterprivate kopageapp kowidgets ${KDE4_PHONON_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY}) target_link_libraries(kpresenterprivate LINK_INTERFACE_LIBRARIES kopageapp) set_target_properties(kpresenterprivate PROPERTIES VERSION ${GENERIC_KOFFICE_LIB_VERSION} SOVERSION ${GENERIC_KOFFICE_LIB_SOVERSION} ) --- trunk/koffice/kpresenter/part/KPrView.cpp #1138345:1138346 @@ -1,6 +1,8 @@ /* This file is part of the KDE project Copyright (C) 2006-2007 Thorsten Zachmann Copyright (C) 2008 Carlos Licea + Copyright (C) 2009 Benjamin Port + Copyright (C) 2009 Yannick Motta This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,12 +25,15 @@ #include #include #include +#include +#include #include #include #include #include #include +#include #include "KPrDocument.h" #include "KPrPage.h" @@ -43,12 +48,12 @@ #include "commands/KPrSetCustomSlideShowsCommand.h" #include "dockers/KPrPageLayoutDockerFactory.h" #include "dockers/KPrPageLayoutDocker.h" - +#include "KPrHtmlExport.h" #include "KPrCustomSlideShows.h" #include "ui/KPrCustomSlideShowsDialog.h" #include "ui/KPrConfigureSlideShowDialog.h" #include "ui/KPrConfigurePresenterViewDialog.h" -#include +#include "ui/KPrHtmlExportDialog.h" #include KPrView::KPrView( KPrDocument *document, QWidget *parent ) @@ -140,6 +145,10 @@ setXMLFile( "kpresenter.rc" ); // do special kpresenter stuff here + m_actionExportHtml = new KAction(i18n("Export as HTML..."), this); + actionCollection()->addAction("file_export_html", m_actionExportHtml); + connect(m_actionExportHtml, SIGNAL(triggered()), this, SLOT(exportToHtml())); + m_actionViewModeNormal = new KAction(i18n("Normal"), this); m_actionViewModeNormal->setCheckable(true); m_actionViewModeNormal->setChecked(true); @@ -275,4 +284,21 @@ delete dialog; } +void KPrView::exportToHtml() +{ + KPrHtmlExportDialog *dialog = new KPrHtmlExportDialog(kopaDocument()->pages(),koDocument()->documentInfo()->aboutInfo("title"), + koDocument()->documentInfo()->authorInfo("creator"), this); + if (dialog->exec() == QDialog::Accepted && !dialog->checkedSlides().isEmpty()) { + // Get the export directory + KUrl directoryUrl = KFileDialog::getExistingDirectoryUrl(); + if (directoryUrl.isValid()) { + directoryUrl.adjustPath(KUrl::AddTrailingSlash); + KPrHtmlExport exportHtml; + exportHtml.exportHtml(KPrHtmlExport::Parameter(dialog->templateUrl(), this, dialog->checkedSlides(), + directoryUrl, dialog->author(), + dialog->title(), dialog->slidesNames(), dialog->openBrowser())); + } + } +} + #include "KPrView.moc" --- trunk/koffice/kpresenter/part/KPrView.h #1138345:1138346 @@ -1,5 +1,6 @@ /* This file is part of the KDE project Copyright (C) 2006-2007 Thorsten Zachmann + Copyright (C) 2009 Benjamin Port This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -91,6 +92,7 @@ void dialogCustomSlideShows(); void configureSlideShow(); void configurePresenterView(); + void exportToHtml(); private: KActionMenu *m_actionStartPresentation; @@ -98,6 +100,7 @@ KAction *m_actionViewModeNormal; KAction *m_actionViewModeNotes; KAction *m_actionCreateCustomSlideShowsDialog; + KAction *m_actionExportHtml; KPrViewModePresentation *m_presentationMode; KoPAViewMode *m_normalMode; --- trunk/koffice/kpresenter/part/kpresenter.rc #1138345:1138346 @@ -2,6 +2,9 @@ + + + &Edit --- trunk/koffice/kpresenter/templates/CMakeLists.txt #1138345:1138346 @@ -1,6 +1,7 @@ add_subdirectory( common_icon ) add_subdirectory( Screen ) +add_subdirectory( exportHTML ) #add_subdirectory( Screenpresentations ) #add_subdirectory( A4 ) #add_subdirectory( legal )