diff --git a/step/CMakeLists.txt b/step/CMakeLists.txt index c3c4418..b9c4948 100644 --- a/step/CMakeLists.txt +++ b/step/CMakeLists.txt @@ -1,96 +1,95 @@ ecm_setup_version(${KDE_APPLICATIONS_VERSION} VARIABLE_PREFIX STEP VERSION_HEADER step_version.h) set(step_SRCS arrow.cc clipboard.cc mainwindow.cc worldmodel.cc worldscene.cc worldgraphics.cc worldbrowser.cc propertiesbrowser.cc infobrowser.cc undobrowser.cc itempalette.cc worldfactory.cc stepgraphicsitem.cc particlegraphics.cc polygongraphics.cc gasgraphics.cc gascreationdialog.cc softbodygraphics.cc springgraphics.cc motorgraphics.cc jointgraphics.cc toolgraphics.cc simulationthread.cc unitscalc.cc latexformula.cc messageframe.cc main.cc choicesmodel.cc ) set(step_UIS create_gas_particles.ui create_softbody_items.ui configure_graph.ui configure_meter.ui configure_controller.ui configure_step_general.ui) set(step_KCFGS settings.kcfgc) if(STEPCORE_WITH_QT) add_definitions(-DSTEPCORE_WITH_QT) endif(STEPCORE_WITH_QT) if(STEPCORE_WITH_GSL) add_definitions(-DSTEPCORE_WITH_GSL) endif(STEPCORE_WITH_GSL) if(STEP_WITH_QALCULATE) add_definitions(-DSTEP_WITH_QALCULATE) add_definitions(-DSTEP_WITH_UNITSCALC) add_definitions(${QALCULATE_CFLAGS}) set(qalculate_LIBS ${QALCULATE_LIBRARIES} ${CLN_LIBRARIES}) # To compile with libcln string (REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") add_definitions (-fexceptions) endif(STEP_WITH_QALCULATE) -qt5_add_resources(step_SRCS data/resources.qrc) ki18n_wrap_ui(step_SRCS ${step_UIS}) kconfig_add_kcfg_files(step_SRCS ${step_KCFGS}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ecm_create_qm_loader(step_SRCS step_qt) add_executable(step ${step_SRCS}) target_link_libraries(step stepcore KF5::Crash KF5::I18n KF5::IconThemes KF5::KIOCore KF5::KIOWidgets KF5::TextWidgets KF5::Plotting KF5::NewStuff Qt5::OpenGL Qt5::Widgets ${qalculate_LIBS}) install(TARGETS step ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) install(FILES step.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR}) install(FILES stepui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/step) install(FILES step.knsrc DESTINATION ${KDE_INSTALL_CONFDIR}) install( PROGRAMS org.kde.step.desktop DESTINATION ${KDE_INSTALL_APPDIR} ) add_subdirectory(icons) add_subdirectory(data) diff --git a/step/data/CMakeLists.txt b/step/data/CMakeLists.txt index 57c0b6f..476b5b3 100644 --- a/step/data/CMakeLists.txt +++ b/step/data/CMakeLists.txt @@ -1,71 +1,64 @@ -if(CURRENT_LANG) - set(STEP_BUILD_TRANSLATIONS 1) -endif(CURRENT_LANG) +find_package(PythonInterp) +set(EXTRACTXML_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/extractxml) -if(STEP_BUILD_TRANSLATIONS) +if(PYTHON_EXECUTABLE) - find_package(PythonInterp) - set(EXTRACTXML_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/extractxml) + # STEP_PROCESS_XML_TRANSLATION( [ALL] [INSTALL_DESTINATION ] ...) + macro(STEP_PROCESS_XML_TRANSLATION _lang _po_file _extractxml_args) + set(_xmlfiles_tr) + set(_args ${ARGN}) + set(_addToAll) + set(_installDest) - if(PYTHON_EXECUTABLE) + list(GET _args 0 _tmp) + if("${_tmp}" STREQUAL "ALL") + set(_addToAll ALL) + list(REMOVE_AT _args 0) + endif("${_tmp}" STREQUAL "ALL") - # STEP_PROCESS_XML_TRANSLATION( [ALL] [INSTALL_DESTINATION ] ...) - macro(STEP_PROCESS_XML_TRANSLATION _lang _po_file _extractxml_args) - set(_xmlfiles_tr) - set(_args ${ARGN}) - set(_addToAll) - set(_installDest) + list(GET _args 0 _tmp) + if("${_tmp}" STREQUAL "INSTALL_DESTINATION") + list(GET _args 1 _installDest ) + list(REMOVE_AT _args 0 1) + endif("${_tmp}" STREQUAL "INSTALL_DESTINATION") - list(GET _args 0 _tmp) - if("${_tmp}" STREQUAL "ALL") - set(_addToAll ALL) - list(REMOVE_AT _args 0) - endif("${_tmp}" STREQUAL "ALL") + if(EXISTS ${_po_file}) + get_filename_component(_po_file_we ${_po_file} NAME_WE) + set(_mo_file ${CMAKE_CURRENT_BINARY_DIR}/${_po_file_we}.mo) + add_custom_command(OUTPUT ${_mo_file} + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_mo_file} ${_po_file} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + DEPENDS ${_po_file} + ) - list(GET _args 0 _tmp) - if("${_tmp}" STREQUAL "INSTALL_DESTINATION") - list(GET _args 1 _installDest ) - list(REMOVE_AT _args 0 1) - endif("${_tmp}" STREQUAL "INSTALL_DESTINATION") + foreach(_xmlfile ${_args}) + get_filename_component(_xmlfile_basename ${_xmlfile} NAME) + set(_xmlfile_tr ${CMAKE_CURRENT_BINARY_DIR}/${_xmlfile_basename}) + set(_extractxml_args_copy ${_extractxml_args}) + separate_arguments(_extractxml_args_copy) + add_custom_command(OUTPUT ${_xmlfile_tr} + COMMAND ${EXTRACTXML_EXECUTABLE} --translate --mo-file=${_mo_file} --output-dir=${CMAKE_CURRENT_BINARY_DIR} ${_extractxml_args_copy} ${_xmlfile} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + DEPENDS ${_xmlfile} ${_mo_file} + ) + if(_installDest) + install(FILES ${_xmlfile_tr} DESTINATION ${_installDest}/${_lang}) + endif(_installDest) + list(APPEND _xmlfiles_tr ${_xmlfile_tr}) + endforeach(_xmlfile) - if(EXISTS ${_po_file}) - get_filename_component(_po_file_we ${_po_file} NAME_WE) - set(_mo_file ${CMAKE_CURRENT_BINARY_DIR}/${_po_file_we}.mo) - add_custom_command(OUTPUT ${_mo_file} - COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_mo_file} ${_po_file} - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - DEPENDS ${_po_file} - ) + get_filename_component(DirId ${CMAKE_CURRENT_SOURCE_DIR} NAME) + add_custom_target(${DirId}_${_po_file_we}_xmlfiles_tr ${_addToAll} DEPENDS ${_xmlfiles_tr}) + endif(EXISTS ${_po_file}) + endmacro(STEP_PROCESS_XML_TRANSLATION) - foreach(_xmlfile ${_args}) - get_filename_component(_xmlfile_basename ${_xmlfile} NAME) - set(_xmlfile_tr ${CMAKE_CURRENT_BINARY_DIR}/${_xmlfile_basename}) - set(_extractxml_args_copy ${_extractxml_args}) - separate_arguments(_extractxml_args_copy) - add_custom_command(OUTPUT ${_xmlfile_tr} - COMMAND ${EXTRACTXML_EXECUTABLE} --translate --mo-file=${_mo_file} --output-dir=${CMAKE_CURRENT_BINARY_DIR} ${_extractxml_args_copy} ${_xmlfile} - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - DEPENDS ${_xmlfile} ${_mo_file} - ) - if(_installDest) - install(FILES ${_xmlfile_tr} DESTINATION ${_installDest}/${_lang}) - endif(_installDest) - list(APPEND _xmlfiles_tr ${_xmlfile_tr}) - endforeach(_xmlfile) - - add_custom_target(xmlfiles_tr ${_addToAll} DEPENDS ${_xmlfiles_tr}) - endif(EXISTS ${_po_file}) - endmacro(STEP_PROCESS_XML_TRANSLATION) - - else(PYTHON_EXECUTABLE) - message("Python executable NOT found - Step data translations will not be build") - macro(STEP_PROCESS_XML_TRANSLATION) - endmacro(STEP_PROCESS_XML_TRANSLATION) - endif(PYTHON_EXECUTABLE) - -endif(STEP_BUILD_TRANSLATIONS) +else(PYTHON_EXECUTABLE) + message("Python executable NOT found - Step data translations will not be build") + macro(STEP_PROCESS_XML_TRANSLATION) + endmacro(STEP_PROCESS_XML_TRANSLATION) +endif(PYTHON_EXECUTABLE) add_subdirectory(objectinfo) add_subdirectory(examples) add_subdirectory(tutorials) diff --git a/step/data/Messages.sh b/step/data/Messages.sh index 6b629cc..a8eb48d 100755 --- a/step/data/Messages.sh +++ b/step/data/Messages.sh @@ -1,19 +1,18 @@ #! /bin/sh EXTRACTXML="./extractxml" $EXTRACTXML --extract \ --context='%(filename)s:%(tag)s' --tag-regex='^(?:title|body|p|h[1-6])$' --recursive --strip \ ./objectinfo/*.html --output=objinfo.cpp $EXTRACTXML --extract \ --context='%(tag)s' --tag=name --tag=text --unquote \ --parse-unquoted='--context=HTML:%(tag)s --tag-regex=^(?:title|body|p|h[1-6])$ --recursive --strip' \ ./examples/*.step ./tutorials/*.step --output=examples.cpp -# Temporary commented-out -#$XGETTEXT objinfo.cpp -o $podir/step_objinfo_files.pot -#$XGETTEXT examples.cpp -o $podir/step_example_files.pot +$XGETTEXT objinfo.cpp -o $podir/step_objinfo_files.pot +$XGETTEXT examples.cpp -o $podir/step_example_files.pot rm -f objinfo.cpp rm -f examples.cpp diff --git a/step/data/examples/CMakeLists.txt b/step/data/examples/CMakeLists.txt index 1c3d629..ac83137 100644 --- a/step/data/examples/CMakeLists.txt +++ b/step/data/examples/CMakeLists.txt @@ -1,18 +1,15 @@ FILE(GLOB STEP_EXAMPLE_FILES "*.step") -if(STEP_BUILD_TRANSLATIONS) - - set(po_file ${CMAKE_SOURCE_DIR}/messages/kdeedu/step_example_files.po) - STEP_PROCESS_XML_TRANSLATION(${CURRENT_LANG} ${po_file} - "--context='%(tag)s' --tag=name --tag=text --unquote --parse-unquoted='--context=HTML:%(tag)s --tag-regex=^(?:title|body|p|h[1-6])$$ --recursive --strip'" - ALL INSTALL_DESTINATION ${KDE_INSTALL_DATADIR}/step/examples - ${STEP_EXAMPLE_FILES}) - -else(STEP_BUILD_TRANSLATIONS) - - install(FILES +install(FILES ${STEP_EXAMPLE_FILES} DESTINATION ${KDE_INSTALL_DATADIR}/step/examples) -endif(STEP_BUILD_TRANSLATIONS) - +FILE(GLOB po_files "${CMAKE_SOURCE_DIR}/po/*/step_example_files.po") +foreach(po_file ${po_files}) + get_filename_component(po_dir ${po_file} DIRECTORY) + get_filename_component(CURRENT_LANG ${po_dir} NAME) + STEP_PROCESS_XML_TRANSLATION(${CURRENT_LANG} ${po_file} + "--context='%(tag)s' --tag=name --tag=text --unquote --parse-unquoted='--context=HTML:%(tag)s --tag-regex=^(?:title|body|p|h[1-6])$$ --recursive --strip'" + ALL INSTALL_DESTINATION ${KDE_INSTALL_DATADIR}/step/examples + ${STEP_EXAMPLE_FILES}) +endforeach() diff --git a/step/data/objectinfo/CMakeLists.txt b/step/data/objectinfo/CMakeLists.txt index db13b60..ced89c6 100644 --- a/step/data/objectinfo/CMakeLists.txt +++ b/step/data/objectinfo/CMakeLists.txt @@ -1,10 +1,15 @@ FILE(GLOB INFO_HTML_FILES "*.html") -if(STEP_BUILD_TRANSLATIONS) +install(FILES + ${INFO_HTML_FILES} + DESTINATION ${KDE_INSTALL_DATADIR}/step/objinfo) - set(po_file ${CMAKE_SOURCE_DIR}/messages/kdeedu/step_objinfo_files.po) +FILE(GLOB po_files "${CMAKE_SOURCE_DIR}/po/*/step_objinfo_files.po") +foreach(po_file ${po_files}) + get_filename_component(po_dir ${po_file} DIRECTORY) + get_filename_component(CURRENT_LANG ${po_dir} NAME) STEP_PROCESS_XML_TRANSLATION(${CURRENT_LANG} ${po_file} - "--context='%(filename)s:%(tag)s' --tag-regex='^(?:title|body|p|h[1-6])$$' --recursive --strip" - ALL INSTALL_DESTINATION ${KDE_INSTALL_DATADIR}/step/objinfo - ${INFO_HTML_FILES}) -endif(STEP_BUILD_TRANSLATIONS) + "--context='%(filename)s:%(tag)s' --tag-regex='^(?:title|body|p|h[1-6])$$' --recursive --strip" + ALL INSTALL_DESTINATION ${KDE_INSTALL_DATADIR}/step/objinfo/l10n + ${INFO_HTML_FILES}) +endforeach() diff --git a/step/data/resources.qrc b/step/data/resources.qrc deleted file mode 100644 index 98f63a6..0000000 --- a/step/data/resources.qrc +++ /dev/null @@ -1,23 +0,0 @@ - - - objectinfo/anchor.html - objectinfo/box.html - objectinfo/chargedparticle.html - objectinfo/coulombforce.html - objectinfo/disk.html - objectinfo/gas.html - objectinfo/gasljforce.html - objectinfo/gasparticle.html - objectinfo/gravitationforce.html - objectinfo/linearmotor.html - objectinfo/meter.html - objectinfo/note.html - objectinfo/particle.html - objectinfo/pin.html - objectinfo/polygon.html - objectinfo/softbody.html - objectinfo/spring.html - objectinfo/weightforce.html - objectinfo/world.html - - diff --git a/step/data/tutorials/CMakeLists.txt b/step/data/tutorials/CMakeLists.txt index 6c65820..aa88e90 100644 --- a/step/data/tutorials/CMakeLists.txt +++ b/step/data/tutorials/CMakeLists.txt @@ -1,18 +1,15 @@ FILE(GLOB STEP_TUTORIALS_FILES "*.step") -if(STEP_BUILD_TRANSLATIONS) - - set(po_file ${CMAKE_SOURCE_DIR}/messages/kdeedu/step_example_files.po) - STEP_PROCESS_XML_TRANSLATION(${CURRENT_LANG} ${po_file} - "--context='%(tag)s' --tag=name --tag=text --unquote --parse-unquoted='--context=HTML:%(tag)s --tag-regex=^(?:title|body|p|h[1-6])$$ --recursive --strip'" - ALL INSTALL_DESTINATION ${KDE_INSTALL_DATADIR}/step/tutorials - ${STEP_TUTORIALS_FILES}) - -else(STEP_BUILD_TRANSLATIONS) - - install(FILES +install(FILES ${STEP_TUTORIALS_FILES} DESTINATION ${KDE_INSTALL_DATADIR}/step/tutorials) -endif(STEP_BUILD_TRANSLATIONS) - +FILE(GLOB po_files "${CMAKE_SOURCE_DIR}/po/*/step_example_files.po") +foreach(po_file ${po_files}) + get_filename_component(po_dir ${po_file} DIRECTORY) + get_filename_component(CURRENT_LANG ${po_dir} NAME) + STEP_PROCESS_XML_TRANSLATION(${CURRENT_LANG} ${po_file} + "--context='%(tag)s' --tag=name --tag=text --unquote --parse-unquoted='--context=HTML:%(tag)s --tag-regex=^(?:title|body|p|h[1-6])$$ --recursive --strip'" + ALL INSTALL_DESTINATION ${KDE_INSTALL_DATADIR}/step/tutorials + ${STEP_TUTORIALS_FILES}) +endforeach() diff --git a/step/infobrowser.cc b/step/infobrowser.cc index e02becc..b258b0b 100644 --- a/step/infobrowser.cc +++ b/step/infobrowser.cc @@ -1,256 +1,256 @@ /* This file is part of Step. Copyright (C) 2007 Vladimir Kuznetsov Step is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Step is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Step; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "infobrowser.h" #include "worldmodel.h" #include "settings.h" #include #include #include #include #include #include #include #include #include #include #include InfoBrowser::InfoBrowser(WorldModel* worldModel, QWidget* parent) : QDockWidget(i18n("Context info"), parent), _worldModel(worldModel), _selectionChanged(false) { QWidget* widget = new QWidget(this); setWidget(widget); QVBoxLayout* layout = new QVBoxLayout(widget); layout->setContentsMargins(0,0,0,0); layout->setSpacing(0); _toolBar = new KToolBar(widget); layout->addWidget(_toolBar); _toolBar->setMovable(false); _toolBar->setFloatable(false); _toolBar->setIconDimensions(16); _toolBar->setContextMenuPolicy(Qt::NoContextMenu); _toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); _backAction = _toolBar->addAction(QIcon::fromTheme(QStringLiteral("go-previous")), i18n("Back"), this, SLOT(back())); _backAction->setEnabled(false); _forwardAction = _toolBar->addAction(QIcon::fromTheme(QStringLiteral("go-next")), i18n("Forward"), this, SLOT(forward())); _forwardAction->setEnabled(false); _toolBar->addSeparator(); _syncAction = _toolBar->addAction(QIcon::fromTheme(QStringLiteral("goto-page")), i18n("Sync selection"), this, SLOT(syncSelection())); // XXX: icon _syncAction->setEnabled(false); _followAction = _toolBar->addAction(QIcon::fromTheme(QStringLiteral("note2")), i18n("Follow selection")/*, this, SLOT(syncSelection(bool))*/); // XXX: icon _followAction->setCheckable(true); _followAction->setChecked(true); _toolBar->addSeparator(); _execAction = _toolBar->addAction(QIcon::fromTheme(QStringLiteral("system-run")), i18n("Open in browser"), this, SLOT(openInBrowser())); _execAction->setEnabled(false); _htmlBrowser = new QTextBrowser(widget); _htmlBrowser->setOpenLinks(false); layout->addWidget(_htmlBrowser); connect(_htmlBrowser, &QTextBrowser::anchorClicked, this, [=](const QUrl &url){ openUrl(url); }); connect(_worldModel->selectionModel(), &QItemSelectionModel::currentChanged, this, &InfoBrowser::worldCurrentChanged); syncSelection(); } void InfoBrowser::showEvent(QShowEvent* event) { QDockWidget::showEvent(event); if(_selectionChanged) { _selectionChanged = false; QModelIndex current = _worldModel->selectionModel()->currentIndex(); worldCurrentChanged(current, QModelIndex()); } } void InfoBrowser::worldCurrentChanged(const QModelIndex& /*current*/, const QModelIndex& /*previous*/) { if(isVisible()) { if(_followAction->isChecked()) syncSelection(); else updateSyncSelection(); } else { _selectionChanged = true; } } void InfoBrowser::syncSelection(bool checked) { if(checked) { const QModelIndex current = _worldModel->selectionModel()->currentIndex(); const QUrl url(QStringLiteral("objinfo:").append(current.data(WorldModel::ClassNameRole).toString())); openUrl(url, true); } } void InfoBrowser::updateSyncSelection() { if(_htmlBrowser->source().scheme() == QLatin1String("objinfo")) { QModelIndex current = _worldModel->selectionModel()->currentIndex(); if(_htmlBrowser->source().path() == current.data(WorldModel::ClassNameRole).toString()) { _syncAction->setEnabled(false); return; } } _syncAction->setEnabled(true); } void InfoBrowser::openUrl(const QUrl& url, bool clearHistory, bool fromHistory) { if(url.scheme() == QLatin1String("objinfo")) { if(clearHistory) { _forwardHistory.clear(); _forwardAction->setEnabled(false); _backHistory.clear(); _backAction->setEnabled(false); fromHistory = true; } QString className = url.path(); if(className.isEmpty()) { setHtml("" "\n" "
\n" "
\n" "\n" + i18n( "Documentation" ) + "\n" "
\n" "
\n" "

\n" + i18n("No current object.") + "

\n" "
\n" "
\n" "", fromHistory, url ); return; } - QString fileName = QStringLiteral(":/objectinfo/%1.html").arg(className.toLower()); + QString fileName = KLocalizedString::localizedFilePath(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("objinfo/%1.html").arg(className.toLower()))); if(!fileName.isEmpty()) { QFile file(fileName); if(file.open(QIODevice::ReadOnly | QIODevice::Text)) { setHtml(QString::fromUtf8(file.readAll()), fromHistory, url); return; } else { qWarning() << "Could not open help file at location:" << fileName; } } setHtml("" "\n" "
\n" "
\n" "\n" + i18n( "Documentation error" ) + "\n" "
\n" "
\n" "

\n" + i18n("Documentation for %1 not available. ", QCoreApplication::translate("ObjectClass", className.toUtf8().constData())) + i18n("You can help Step by writing it!") + "

\n" "
\n" "
\n" "", fromHistory, url ); show(); } else if(url.scheme() == QLatin1String("https") || url.scheme() == QLatin1String("http")) { // do not clear history when open external URL QDesktopServices::openUrl(url); } else { qWarning() << "Unknown URL scheme detected, skipping:" << url; } } void InfoBrowser::setHtml(const QString& data, bool fromHistory, const QUrl& url) { if(!fromHistory) { _forwardAction->setEnabled(false); _forwardHistory.clear(); QString oldUrl = _htmlBrowser->source().url(); if(!oldUrl.isEmpty()) { _backHistory << oldUrl; _backAction->setEnabled(true); } } if(url.scheme() == QLatin1String("http")) { _execAction->setEnabled(true); } else { _execAction->setEnabled(false); } _htmlBrowser->setSource(url); _htmlBrowser->setHtml(data); updateSyncSelection(); } void InfoBrowser::back() { Q_ASSERT(!_backHistory.isEmpty()); QString url(_backHistory.takeLast()); if(_backHistory.isEmpty()) _backAction->setEnabled(false); QString curUrl = _htmlBrowser->source().url(); if(!curUrl.isEmpty()) { _forwardHistory << curUrl; _forwardAction->setEnabled(true); } openUrl(QUrl(url), false, true); } void InfoBrowser::forward() { Q_ASSERT(!_forwardHistory.isEmpty()); QString url(_forwardHistory.takeLast()); if(_forwardHistory.isEmpty()) _forwardAction->setEnabled(false); QString curUrl = _htmlBrowser->source().url(); if(!curUrl.isEmpty()) { _backHistory << curUrl; _backAction->setEnabled(true); } openUrl(QUrl(url), false, true); } void InfoBrowser::openInBrowser() { if(_htmlBrowser->source().scheme() == QLatin1String("https")) { QDesktopServices::openUrl(_htmlBrowser->source()); } }