[umbrello/frameworks] /: Merge remote-tracking branch 'origin/master' into frameworks
Ralf Habacker
ralf.habacker at freenet.de
Wed Nov 9 13:02:39 UTC 2016
Git commit 51a80ad0ee1a75eece18f92dcdc7fd2bc07cb965 by Ralf Habacker.
Committed on 09/11/2016 at 13:01.
Pushed by habacker into branch 'frameworks'.
Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
CMakeLists.txt
doc/CMakeLists.txt
umbrello/CMakeLists.txt
umbrello/uml.cpp
unittests/CMakeLists.txt
M +1 -0 CMakeLists.txt
M +66 -0 doc/CMakeLists.txt
M +73 -0 doc/welcome.docbook
M +4 -6 umbrello/CMakeLists.txt
M +4 -3 umbrello/cmds.h
M +22 -12 umbrello/uml.cpp
M +1 -0 umbrello/uml.h
M +61 -1 umbrello/umlappprivate.h
M +4 -0 umbrello/umlscene.cpp
M +1 -0 unittests/CMakeLists.txt
http://commits.kde.org/umbrello/51a80ad0ee1a75eece18f92dcdc7fd2bc07cb965
diff --cc doc/CMakeLists.txt
index 891c030,bd2a1d4..c0bbde2
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@@ -1,2 -1,89 +1,68 @@@
-if (NOT BUILD_KF5)
- set(KDOCTOOLS_CUSTOMIZATION_DIR "${KDE4_DATA_INSTALL_DIR}/ksgmltools2/customization")
- set(KDOCTOOLS_MEINPROC_EXECUTABLE meinproc4)
-else()
- set(KDOCTOOLS_CUSTOMIZATION_DIR "${KDOCTOOLS_DATA_INSTALL_DIR}/kdoctools/customization")
-endif()
++set(KDOCTOOLS_CUSTOMIZATION_DIR "${KDOCTOOLS_DATA_INSTALL_DIR}/kdoctools/customization")
+
+ function(_kdoctools_create_target_name out in)
+ string(REGEX REPLACE "^${CMAKE_BINARY_DIR}/?" "" in "${in}")
+ string(REGEX REPLACE "[^0-9a-zA-Z]+" "-" tmp "${in}")
+ set(${out} ${tmp} PARENT_SCOPE)
+ endfunction()
+
+ function (kdoctools_create_article docbook)
+ # Parse arguments
+ set(options)
+ set(oneValueArgs INSTALL_DESTINATION SUBDIR)
+ set(multiValueArgs)
+ cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if(NOT DEFINED ARGS_SUBDIR)
+ message(FATAL_ERROR "SUBDIR needs to be defined when calling kdoctools_create_article")
+ endif()
+
+ # Init vars
+ get_filename_component(docbook ${docbook} ABSOLUTE)
+ file(RELATIVE_PATH src_doc ${CMAKE_CURRENT_SOURCE_DIR} ${docbook})
+ get_filename_component(src_dir ${src_doc} DIRECTORY)
+ get_filename_component(_name ${docbook} NAME_WE)
+ set(build_dir ${CMAKE_CURRENT_BINARY_DIR}/${src_dir})
+ set(build_html ${build_dir}/${_name}.html)
+
+ # current directory is the docbook directory, but if this is empty, the
+ # globs which finds the docbooks and the images will be empty too as
+ # they will expand into "/*.docbook" and "/*.png"
+ if (src_dir STREQUAL "")
+ set(src_dir ".")
+ endif ()
+
+ # Create some place to store our files
+ file(MAKE_DIRECTORY ${build_dir})
+
+ #Bootstrap
+ if (_kdoctoolsBootStrapping)
+ set(_bootstrapOption "--srcdir=${KDocTools_BINARY_DIR}/src")
+ elseif (CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ set(_bootstrapOption "--srcdir=${KDOCTOOLS_DATA_INSTALL_DIR}/kdoctools")
+ else ()
+ set(_bootstrapOption)
+ endif ()
+ set(_ssheet "${KDOCTOOLS_CUSTOMIZATION_DIR}/kde-chunk.xsl")
+
+ add_custom_command(OUTPUT ${build_html}
+ COMMAND ${KDOCTOOLS_MEINPROC_EXECUTABLE} --check ${_bootstrapOption} -o ${build_html} ${src_doc}
+ DEPENDS ${src_doc} ${_ssheet}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+ _kdoctools_create_target_name(_targ_html ${build_html})
+ add_custom_target(${_targ_html} ALL DEPENDS ${build_html})
+
+ set(installDest "${ARGS_INSTALL_DESTINATION}")
+ if(installDest)
+ set(subdir "${ARGS_SUBDIR}")
+ # file(GLOB images ${src_dir}/*.png)
+ # install(FILES ${build_doc} ${src_docs} ${images} DESTINATION ${installDest}/${subdir})
+ install(FILES ${build_html} DESTINATION ${installDest}/${subdir})
+ endif()
+ endfunction()
+
########### install files ###############
-if(BUILD_KF5)
- file(READ "index.docbook" index_file)
- string(REPLACE "4.2" "4.5" index_file "${index_file}")
- string(REPLACE "kdex.dtd" "kdedbx45.dtd" index_file "${index_file}")
- file(WRITE "index-kf5.docbook" "${index_file}")
- kdoctools_create_handbook(index-kf5.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR umbrello)
-
- file(READ "welcome.docbook" index_file)
- string(REPLACE "4.2" "4.5" index_file "${index_file}")
- string(REPLACE "kdex.dtd" "kdedbx45.dtd" index_file "${index_file}")
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/welcome.docbook "${index_file}")
- kdoctools_create_article(${CMAKE_CURRENT_BINARY_DIR}/welcome.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR umbrello)
-
-else()
- kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR umbrello)
- kdoctools_create_article(welcome.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR umbrello)
-endif()
-
+kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR umbrello)
++kdoctools_create_article(welcome.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR umbrello)
diff --cc doc/welcome.docbook
index 0000000,4890627..8c7ba8b
mode 000000,100644..100644
--- a/doc/welcome.docbook
+++ b/doc/welcome.docbook
@@@ -1,0 -1,73 +1,73 @@@
+ <?xml version="1.0" ?>
+
-<!DOCTYPE article PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN"
- "dtd/kdex.dtd" [
++<!DOCTYPE article PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN"
++ "dtd/kdex45.dtd" [
+ <!ENTITY umbrello "<application>Umbrello &UML; Modeller</application>">
+ <!ENTITY kappname "&umbrello;">
+ <!ENTITY UML "<acronym>UML</acronym>">
+ <!ENTITY % addindex "IGNORE">
+ <!ENTITY % English "INCLUDE"><!-- change language only here -->
+ <!-- Do not define any other entities; instead, use the entities
+ from kde-genent.entities and $LANG/user.entities. -->
+ ]>
+
+ <article id="Welcome" lang="&language;">
+ <articleinfo>
+ <title>Welcome</title>
+ </articleinfo>
+
+ <para>
+ Welcome to &umbrello; an &UML; diagram tool that can support you
+ in the software development process.
+ Especially during the analysis and design phases of this process, &umbrello; will help you to
+ get a high quality product. &UML; can also be used to document your software designs to help you and your
+ fellow developers.
+ </para>
+ <para>
+ To start working with UML you may create a new diagram from one of the following diagram types:
+ </para>
+ <itemizedlist>
+
+ <listitem><para><emphasis><ulink url="use-case-diagram">Use Case
+ Diagram</ulink></emphasis> - show actors (people or other users of the
+ system), use cases (the scenarios when they use the system), and their
+ relationships</para> </listitem>
+
+ <listitem><para><emphasis><ulink url="class-diagram">Class
+ Diagram</ulink></emphasis> - show classes and the relationships between
+ them</para> </listitem>
+
+ <listitem><para><emphasis><ulink url="sequence-diagram">Sequence
+ Diagram</ulink></emphasis> - show objects and a sequence of method calls
+ they make to other objects.</para> </listitem>
+
+ <listitem><para><emphasis><ulink
+ url="collaboration-diagram">Collaboration
+ Diagram</ulink></emphasis> - show objects and their relationship,
+ putting emphasis on the objects that participate in the message exchange</para>
+ </listitem>
+
+ <listitem><para><emphasis><ulink url="state-diagram">State
+ Diagram</ulink></emphasis> - show states, state changes and events in an
+ object or a part of the system</para> </listitem>
+
+ <listitem><para><emphasis><ulink url="activity-diagram">Activity
+ Diagram</ulink></emphasis> - show activities and the changes from one
+ activity to another with the events occurring in some part of the
+ system</para></listitem>
+
+ <listitem><para><emphasis><ulink url="component-diagram">Component
+ Diagram</ulink></emphasis> - show the high level programming components
+ (such as KParts or Java Beans).</para></listitem>
+
+ <listitem><para><emphasis><ulink
+ url="deployment-diagram">Deployment Diagram</ulink></emphasis> - show
+ the instances of the components and their
+ relationships.</para></listitem>
+
+ <listitem><para><emphasis><ulink
+ url="entity-relationship-diagram">Entity Relationship Diagram</ulink></emphasis> - show
+ data and the relationships and constraints between the data.</para></listitem>
+
+ </itemizedlist>
+ </article>
diff --cc umbrello/CMakeLists.txt
index 6c14345,64643bf..1f7e0f5
--- a/umbrello/CMakeLists.txt
+++ b/umbrello/CMakeLists.txt
@@@ -525,41 -505,66 +522,42 @@@ set(umbrello_SRC
)
set(LIB_BUILD_MODE STATIC)
-
-if(NOT BUILD_KF5)
- if(CMAKE_MAJOR_VERSION LESS 3)
- qt4_add_resources(libumbrello_SRCS icons.qrc)
- else()
- list(APPEND libumbrello_SRCS icons.qrc)
- endif()
- kde4_add_library(libumbrello ${LIB_BUILD_MODE} ${libumbrello_SRCS})
- set_target_properties(libumbrello PROPERTIES OUTPUT_NAME umbrello)
- target_link_libraries(libumbrello
- Qt4::QtCore
- Qt4::QtGui
- Qt4::QtXml
- Qt4::QtWebKit
- ${LIBXML2_LIBRARIES}
- ${LIBXSLT_LIBRARIES}
- ${KDE4_KTEXTEDITOR_LIBS}
- ${KDE4_KFILE_LIBS}
- )
- kde4_add_app_icon(umbrello_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi*-apps-umbrello.png")
- kde4_add_executable(umbrello ${umbrello_SRCS})
- target_link_libraries(umbrello ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${KDE4_KTEXTEDITOR_LIBS} ${KDE4_KFILE_LIBS} libumbrello)
+if(CMAKE_MAJOR_VERSION LESS 3)
+ qt5_add_resources(libumbrello_SRCS icons.qrc ui.qrc)
else()
- if(CMAKE_MAJOR_VERSION LESS 3)
- qt5_add_resources(libumbrello_SRCS icons.qrc ui.qrc)
- else()
- list(APPEND libumbrello_SRCS icons.qrc ui.qrc)
- endif()
- add_library(libumbrello ${LIB_BUILD_MODE} ${libumbrello_SRCS})
- set_target_properties(libumbrello PROPERTIES OUTPUT_NAME umbrello)
- target_link_libraries(libumbrello
- Qt5::Widgets
- Qt5::Xml
- Qt5::PrintSupport
- Qt5::Svg
- Qt5::WebKitWidgets
- KF5::Archive
- KF5::Completion
- KF5::CoreAddons
- KF5::I18n
- KF5::IconThemes
- KF5::KIOCore
- KF5::TextEditor
- KF5::WidgetsAddons
- KF5::XmlGui
- ${LIBXSLT_LIBRARIES}
- ${LIBXML2_LIBRARIES}
- )
- ecm_add_app_icon(umbrello_SRCS
- ICONS
- ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi16-apps-umbrello.png
- ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi22-apps-umbrello.png
- ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi32-apps-umbrello.png
- ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi48-apps-umbrello.png
- ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi64-apps-umbrello.png
- ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi128-apps-umbrello.png
- )
- add_executable(umbrello ${umbrello_SRCS})
- target_link_libraries(umbrello libumbrello)
+ list(APPEND libumbrello_SRCS icons.qrc ui.qrc)
endif()
+add_library(libumbrello ${LIB_BUILD_MODE} ${libumbrello_SRCS})
+set_target_properties(libumbrello PROPERTIES OUTPUT_NAME umbrello)
+target_link_libraries(libumbrello
+ Qt5::Widgets
+ Qt5::Xml
+ Qt5::PrintSupport
+ Qt5::Svg
++ Qt5::WebKitWidgets
+ KF5::Archive
+ KF5::Completion
+ KF5::CoreAddons
+ KF5::I18n
+ KF5::IconThemes
+ KF5::KIOCore
+ KF5::TextEditor
+ KF5::WidgetsAddons
+ KF5::XmlGui
+ ${LIBXSLT_LIBRARIES}
+ ${LIBXML2_LIBRARIES}
+)
+ecm_add_app_icon(umbrello_SRCS
+ ICONS
+ ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi16-apps-umbrello.png
+ ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi22-apps-umbrello.png
+ ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi32-apps-umbrello.png
+ ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi48-apps-umbrello.png
+ ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi64-apps-umbrello.png
+ ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi128-apps-umbrello.png
+)
+add_executable(umbrello ${umbrello_SRCS})
+target_link_libraries(umbrello libumbrello)
if(LIB_BUILD_MODE EQUAL SHARED)
install(TARGETS libumbrello ${INSTALL_TARGETS_DEFAULT_ARGS} )
endif()
diff --cc umbrello/uml.cpp
index 8ff44ff,532c5c4..2fb03b7
--- a/umbrello/uml.cpp
+++ b/umbrello/uml.cpp
@@@ -874,14 -940,8 +868,8 @@@ void UMLApp::initView(
m_listView->setDocument(m_doc);
m_listView->init();
m_listDock->setWidget(m_listView);
- connect(m_listDock, SIGNAL(visibilityChanged(bool)), viewShowTree, SLOT(setChecked(bool)));
+ connect(m_listDock, &QDockWidget::visibilityChanged, viewShowTree, &QAction::setChecked);
- m_debugDock = new QDockWidget(i18n("&Debug"), this);
- m_debugDock->setObjectName(QLatin1String("DebugDock"));
- addDockWidget(Qt::LeftDockWidgetArea, m_debugDock);
- m_debugDock->setWidget(Tracer::instance());
- connect(m_debugDock, &QDockWidget::visibilityChanged, viewShowLog, &QAction::setChecked);
-
// create the documentation viewer
m_documentationDock = new QDockWidget(i18n("Doc&umentation"), this);
m_documentationDock->setObjectName(QLatin1String("DocumentationDock"));
@@@ -901,8 -961,21 +889,21 @@@
m_pQUndoView->setCleanIcon(Icon_Utils::SmallIcon(Icon_Utils::it_UndoView));
m_pQUndoView->setStack(m_pUndoStack);
m_cmdHistoryDock->setWidget(m_pQUndoView);
- connect(m_cmdHistoryDock, SIGNAL(visibilityChanged(bool)), viewShowCmdHistory, SLOT(setChecked(bool)));
+ connect(m_cmdHistoryDock, &QDockWidget::visibilityChanged, viewShowCmdHistory, &QAction::setChecked);
+ m_d->createDiagramsWindow();
+ #ifdef ENABLE_UML_OBJECTS_WINDOW
+ m_d->createObjectsWindow();
+ #endif
+ m_d->createStereotypesWindow();
+ m_d->createWelcomeWindow();
+
+ m_debugDock = new QDockWidget(i18n("&Debug"), this);
+ m_debugDock->setObjectName(QLatin1String("DebugDock"));
+ addDockWidget(Qt::LeftDockWidgetArea, m_debugDock);
+ m_debugDock->setWidget(Tracer::instance());
+ connect(m_debugDock, SIGNAL(visibilityChanged(bool)), viewShowLog, SLOT(setChecked(bool)));
+
// create the log viewer
m_logDock = new QDockWidget(i18n("&Log"), this);
m_logDock->setObjectName(QLatin1String("LogDock"));
diff --cc umbrello/umlappprivate.h
index c136709,fac7fcc..f764aca
--- a/umbrello/umlappprivate.h
+++ b/umbrello/umlappprivate.h
@@@ -136,10 -158,57 +148,58 @@@ public slots
parent->addDockWidget(Qt::LeftDockWidgetArea, stereotypesWindow);
viewStereotypesWindow = parent->actionCollection()->add<KToggleAction>(QLatin1String("view_stereotypes_window"));
- connect(viewStereotypesWindow, SIGNAL(triggered(bool)), stereotypesWindow, SLOT(setVisible(bool)));
+ viewStereotypesWindow->setText(i18n("Stereotypes"));
+ connect(viewStereotypesWindow, &KToggleAction::triggered, stereotypesWindow, &StereotypesWindow::setVisible);
}
+ void createWelcomeWindow()
+ {
+ QString file = findWelcomeFile();
+ if (file.isEmpty())
+ return;
+ QString html = readWelcomeFile(file);
+ // qDebug() << html;
+ welcomeWindow = new QDockWidget(i18n("Welcome"), parent);
+ welcomeWindow->setObjectName(QLatin1String("WelcomeDock"));
+ QWebView *view = new QWebView;
+ view->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
+ view->setContextMenuPolicy(Qt::NoContextMenu);
+ connect(view, SIGNAL(linkClicked(const QUrl)), this, SLOT(slotWelcomeWindowLinkClicked(const QUrl)));
+ view->setHtml(html);
+ view->show();
+ welcomeWindow->setWidget(view);
+ parent->addDockWidget(Qt::RightDockWidgetArea, welcomeWindow);
+
+ viewWelcomeWindow = parent->actionCollection()->add<KToggleAction>(QLatin1String("view_welcome_window"));
+ connect(viewWelcomeWindow, SIGNAL(triggered(bool)), welcomeWindow, SLOT(setVisible(bool)));
+ }
+
+ void slotWelcomeWindowLinkClicked(const QUrl &url)
+ {
+ //qDebug() << url;
+ if (url.scheme() == QLatin1String("mailto") || url.scheme().startsWith(QLatin1String("http"))) {
+ QDesktopServices::openUrl(url);
+ return;
+ }
+ QStringList list = url.toString().split(QLatin1Char('-'));
+ list.removeLast();
+ QString key;
+ foreach(const QString s, list) {
+ QString a = s;
+ a[0] = a[0].toUpper();
+ key.append(a);
+ }
+ Uml::DiagramType::Enum type = Uml::DiagramType::fromString(key);
+ if (type == Uml::DiagramType::Undefined)
+ return;
+ QString diagramName = UMLApp::app()->document()->createDiagramName(type);
+ if (!diagramName.isEmpty())
+ UMLApp::app()->executeCommand(new Uml::CmdCreateDiagram(UMLApp::app()->document(), type, diagramName));
+ }
+
+ private:
+ QString findWelcomeFile();
+ QString readWelcomeFile(const QString &file);
};
#endif
More information about the kde-doc-english
mailing list