Commit 3097da1c authored by Dag Andersen's avatar Dag Andersen
Browse files

Remove dependency on KHtml

This also removes the introductory pages,
but these should be cver by the documentation.
parent 73181c3c
......@@ -150,11 +150,11 @@ if(KF5Activities_FOUND)
set(HAVE_KACTIVITIES TRUE)
endif()
find_package(KF5KHtml)
set_package_properties(KF5KHtml PROPERTIES
PURPOSE "Required for rich text support"
TYPE REQUIRED
)
#find_package(KF5KHtml)
#set_package_properties(KF5KHtml PROPERTIES
#PURPOSE "Required for rich text support"
#TYPE REQUIRED
#)
find_package(KF5Holidays)
set_package_properties(KF5Holidays PROPERTIES
......
......@@ -145,8 +145,6 @@ set(planprivate_LIB_SRCS
kptinsertfiledlg.cpp
kptloadsharedprojectsdialog.cpp
about/aboutpage.cpp
KPlatoXmlLoader.cpp
)
......
......@@ -257,7 +257,6 @@ void MainDocument::setProject(Project *project)
connect(m_project, &Project::nodeChanged, this, &MainDocument::slotNodeChanged);
connect(m_project, &Project::sigCalculationFinished, this, &MainDocument::slotCalculationFinished);
}
m_aboutPage.setProject(project);
QString dir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
if (!dir.isEmpty()) {
......
......@@ -31,7 +31,6 @@
#include "kptconfig.h"
#include "kptwbsdefinition.h"
#include "kptxmlloaderobject.h"
#include "about/aboutpage.h"
#include "KoDocument.h"
......@@ -130,8 +129,6 @@ public:
bool insertProject(Project &project, Node *parent, Node *after);
bool mergeResources(Project &project);
KPlatoAboutPage &aboutPage() { return m_aboutPage; }
bool extractFiles(KoStore *store, Package *package);
bool extractFile(KoStore *store, Package *package, const Document *doc);
......@@ -254,8 +251,6 @@ private:
QList<QUrl> m_skipUrls;
QMap<QDateTime, Project*> m_mergedPackages;
KPlatoAboutPage m_aboutPage;
QDomDocument m_reports;
bool m_viewlistModified;
......
......@@ -25,7 +25,6 @@
#include "kptmaindocument.h"
#include "kptfactory.h"
#include "welcome/WelcomeView.h"
#include "kpthtmlview.h"
#include "Help.h"
#include "calligraplansettings.h"
#include "kptdebug.h"
......@@ -163,7 +162,6 @@ void Part::createStarUpWidget(KoMainWindow *parent)
startUpWidget = new QStackedWidget(parent);
startUpWidget->addWidget(createWelcomeView(parent));
startUpWidget->addWidget(createIntroductionView());
}
void Part::finish()
......@@ -188,7 +186,6 @@ QWidget *Part::createWelcomeView(KoMainWindow *mw)
connect(v, &WelcomeView::loadSharedResources, doc, &MainDocument::insertResourcesFile);
connect(v, &WelcomeView::recentProject, mw, &KoMainWindow::slotFileOpenRecent);
connect(v, &WelcomeView::showIntroduction, this, &Part::slotShowIntroduction);
connect(v, &WelcomeView::projectCreated, doc, &MainDocument::slotProjectCreated);
connect(v, &WelcomeView::finished, this, &Part::finish);
......@@ -197,50 +194,6 @@ QWidget *Part::createWelcomeView(KoMainWindow *mw)
return v;
}
void Part::slotShowIntroduction()
{
startUpWidget->setCurrentIndex(1);
slotOpenUrlRequest(static_cast<HtmlView*>(startUpWidget->currentWidget()), QUrl("about:plan/main"));
}
void Part::slotOpenUrlRequest(HtmlView *v, const QUrl &url)
{
debugPlan<<url;
if (url.scheme() == QLatin1String("about")) {
if (url.url() == QLatin1String("about:close")) {
startUpWidget->setCurrentIndex(0);
return;
}
if (url.url().startsWith(QLatin1String("about:plan"))) {
MainDocument *doc = static_cast<MainDocument*>(document());
doc->aboutPage().generatePage(v->htmlPart(), url);
return;
}
}
if (url.scheme() == QLatin1String("help")) {
KHelpClient::invokeHelp("", url.fileName());
return;
}
// try to open the url
debugPlan<<url<<"is external, discard";
new KRun(url, currentMainwindow());
}
QWidget *Part::createIntroductionView()
{
HtmlView *v = new HtmlView(this, document(), startUpWidget);
v->htmlPart().setJScriptEnabled(false);
v->htmlPart().setJavaEnabled(false);
v->htmlPart().setMetaRefreshEnabled(false);
v->htmlPart().setPluginsEnabled(false);
slotOpenUrlRequest(v, QUrl("about:plan/main"));
connect(v, &KPlato::HtmlView::openUrlRequest, this, &KPlato::Part::slotOpenUrlRequest);
return v;
}
void Part::configure(KoMainWindow *mw)
{
//debugPlan;
......
......@@ -33,7 +33,6 @@ class QStackedWidget;
namespace KPlato
{
class MainDocument;
class HtmlView;
class PLAN_EXPORT Part : public KoPart
{
......@@ -63,8 +62,6 @@ public Q_SLOTS:
void finish();
protected Q_SLOTS:
void slotShowIntroduction();
void slotOpenUrlRequest(KPlato::HtmlView *v, const QUrl &url);
void openTemplate(const QUrl& url) override;
void slotOpenTemplate(const QUrl& url);
......@@ -74,7 +71,6 @@ protected Q_SLOTS:
protected:
void createStarUpWidget(KoMainWindow *parent);
QWidget *createWelcomeView(KoMainWindow *parent);
QWidget *createIntroductionView();
private:
KPlato::MainDocument *m_document;
......
......@@ -103,7 +103,6 @@
#include "kptpertresult.h"
#include "kptinsertfiledlg.h"
#include "kptloadsharedprojectsdialog.h"
#include "kpthtmlview.h"
#include "about/aboutpage.h"
#include "kptlocaleconfigmoneydialog.h"
#include "kptflatproxymodel.h"
......@@ -196,7 +195,6 @@ View::View(KoPart *part, MainDocument *doc, QWidget *parent)
////////////////////////////////////////////////////////////////////////////////////////////////////
// Add sub views
createIntroductionView();
// The menu items
// ------ File
......@@ -258,11 +256,6 @@ View::View(KoPart *part, MainDocument *doc, QWidget *parent)
connect(actionOpenReportFile, QAction::triggered, this, &View::slotOpenReportFile);
#endif
// ------ Help
actionIntroduction = new QAction(koIcon("dialog-information"), i18n("Introduction to Plan"), this);
actionCollection()->addAction("plan_introduction", actionIntroduction);
connect(actionIntroduction, &QAction::triggered, this, &View::slotIntroduction);
// ------ Popup
actionOpenNode = new QAction(koIcon("document-edit"), i18n("Edit..."), this);
actionCollection()->addAction("node_properties", actionOpenNode);
......@@ -762,46 +755,6 @@ ViewInfo View::defaultCategoryInfo(const QString &type) const
return vi;
}
void View::slotOpenUrlRequest(HtmlView *v, const QUrl &url)
{
debugPlan<<url;
if (url.scheme() == QLatin1String("about")) {
if (url.url() == QLatin1String("about:close")) {
int view = m_visitedViews.count() < 2 ? qMin(m_defaultView, m_tab->count()-1) : m_visitedViews.at(m_visitedViews.count() - 2);
debugPlan<<"Prev:"<<view<<m_visitedViews;
m_tab->setCurrentIndex(view);
return;
}
if (url.url().startsWith(QLatin1String("about:plan"))) {
getPart()->aboutPage().generatePage(v->htmlPart(), url);
return;
}
}
if (url.scheme() == QLatin1String("help")) {
KHelpClient::invokeHelp("", url.fileName());
return;
}
// try to open the url
debugPlan<<url<<"is external, try to open";
new KRun(url, mainWindow());
}
ViewBase *View::createIntroductionView()
{
HtmlView *v = new HtmlView(getKoPart(), getPart(), m_tab);
v->htmlPart().setJScriptEnabled(false);
v->htmlPart().setJavaEnabled(false);
v->htmlPart().setMetaRefreshEnabled(false);
v->htmlPart().setPluginsEnabled(false);
slotOpenUrlRequest(v, QUrl("about:plan/main"));
connect(v, &HtmlView::openUrlRequest, this, &View::slotOpenUrlRequest);
m_tab->addWidget(v);
return v;
}
ViewBase *View::createResourceAppointmentsGanttView(ViewListItem *cat, const QString &tag, const QString &name, const QString &tip, int index)
{
ResourceAppointmentsGanttView *v = new ResourceAppointmentsGanttView(getKoPart(), getPart(), m_tab);
......@@ -1966,12 +1919,6 @@ void View::slotDefineWBSFinished(int result)
dia->deleteLater();
}
void View::slotIntroduction()
{
m_tab->setCurrentIndex(0);
}
Calendar *View::currentCalendar()
{
ViewBase *v = dynamic_cast<ViewBase*>(m_tab->currentWidget());
......
......@@ -84,7 +84,6 @@ class ResourceGroup;
class Relation;
class Context;
class ViewAdaptor;
class HtmlView;
class ReportView;
class ReportDesignDialog;
......@@ -179,8 +178,6 @@ public Q_SLOTS:
void slotCreateView();
void slotIntroduction();
void openRelationDialog(KPlato::Node *par, KPlato::Node *child);
void slotEditRelation(KPlato::Relation *rel);
void slotAddRelation(KPlato::Node *par, KPlato::Node *child, int linkType);
......@@ -258,8 +255,6 @@ protected Q_SLOTS:
void slotMailWorkpackage(KPlato::Node *node, KPlato::Resource *resource = nullptr);
void slotPublishWorkpackages(const QList<KPlato::Node*> &nodes, KPlato::Resource *resource, bool mailTo);
void slotOpenUrlRequest(KPlato::HtmlView *v, const QUrl &url);
void createReportView(const QDomDocument &doc);
void saveTaskModule(const QUrl &url, KPlato::Project *project);
......@@ -281,8 +276,6 @@ protected:
ViewBase *currentView() const;
ViewBase *createIntroductionView();
private Q_SLOTS:
void slotActionDestroyed(QObject *o);
void slotViewListItemRemoved(KPlato::ViewListItem *item);
......@@ -383,9 +376,6 @@ private:
// ------ Settings
QAction *actionConfigure;
// ------ Help
QAction *actionIntroduction;
// ------ Popup
QAction *actionOpenNode;
QAction *actionTaskProgress;
......
......@@ -96,8 +96,6 @@ set(planui_LIB_SRCS
kptworkpackagemergedialog.cpp
kptrecalculatedialog.cpp
kpthtmlview.cpp
locale/localemon.cpp
kptlocaleconfigmoneydialog.cpp
......@@ -166,13 +164,12 @@ target_link_libraries(planui
PUBLIC
planmain
planmodels
KF5::KHtml
KF5::TextWidgets
PRIVATE
KChart
KF5::ItemViews
KF5::IconThemes
KF5::Archive
KF5::TextWidgets
KF5::KIOCore
KF5::KIOFileWidgets
KF5::KIOWidgets
......
......@@ -156,14 +156,6 @@ WelcomeView::WelcomeView(KoPart *part, KoDocument *doc, QWidget *parent)
"<nl/>This enables you to quickly open projects you have worked on recently."
"</para>"));
Help::add(ui.introductionBtn,
xi18nc("@info:whatsthis",
"<title>Introduction to <application>Plan</application></title>"
"<para>"
"These introductory pages gives you hints and tips on what"
" you can use <application>Plan</application> for, and how to use it."
"</para>"));
Help::add(ui.contextHelp,
xi18nc("@info:whatsthis",
"<title>Context help</title>"
......@@ -199,7 +191,6 @@ WelcomeView::WelcomeView(KoPart *part, KoDocument *doc, QWidget *parent)
connect(ui.newProjectBtn, &QAbstractButton::clicked, this, &WelcomeView::slotNewProject);
connect(ui.createResourceFileBtn, &QAbstractButton::clicked, this, &WelcomeView::slotCreateResourceFile);
connect(ui.openProjectBtn, &QAbstractButton::clicked, this, &WelcomeView::slotOpenProject);
connect(ui.introductionBtn, &QAbstractButton::clicked, this, &WelcomeView::showIntroduction);
connect(ui.recentProjects, &QAbstractItemView::activated, this, &WelcomeView::slotRecentFileSelected);
......
......@@ -64,7 +64,6 @@ Q_SIGNALS:
void newProject();
void openProject();
void recentProject(const QUrl &file, KoPart *part);
void showIntroduction();
void selectDefaultView();
void loadSharedResources(const QUrl &url, const QUrl &projects);
void openExistingFile(const QUrl &url);
......
......@@ -231,14 +231,10 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="introductionBtn">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Introduction</string>
</property>
<property name="icon">
<iconset theme="help-hint">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
<item>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment