Skip to content

Commit

Permalink
Move about page implementation from talipot-gui library to software
Browse files Browse the repository at this point in the history
Turn the page into a dialog.

Display third party info in a scrollable QTextBrowser and rework content.

Update OGDF website URL and stop hardcoding its version.
  • Loading branch information
anlambert committed Nov 30, 2023
1 parent 13f523a commit 614236f
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 185 deletions.
48 changes: 0 additions & 48 deletions library/talipot-gui/include/talipot/AboutPage.h

This file was deleted.

45 changes: 0 additions & 45 deletions library/talipot-gui/src/AboutPageUtils.cpp

This file was deleted.

22 changes: 1 addition & 21 deletions library/talipot-gui/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ SET(SRCS
FileDownloader.cpp
ColorScalesManager.cpp
ScientificDoubleSpinBox.cpp
AboutPage.cpp
FontIconDialog.cpp
FontIcon.cpp
ViewActionsManager.cpp
Expand All @@ -97,12 +96,7 @@ QTX_SET_INCLUDES_AND_DEFINITIONS()
ADD_DEFINITIONS(-DQT_DLL -DQT_THREAD_SUPPORT)

SET(PYTHON_PART_SRCS PythonVersionChecker.cpp)
SET(TLPGUI_PYTHON_COMPILE_DEFINITIONS
TLP_PYTHON="${PYTHON_VERSION}"
SIP_VERSION="${SIP_VERSION_STR}"
CPP_STANDARD="${CMAKE_CXX_STANDARD}"
CPP_COMPILER_ID="${CMAKE_CXX_COMPILER_ID}"
CPP_COMPILER_VERSION="${CMAKE_CXX_COMPILER_VERSION}")
SET(TLPGUI_PYTHON_COMPILE_DEFINITIONS TLP_PYTHON="${PYTHON_VERSION}")

IF(MSYS2_PYTHON)
SET(TLPGUI_PYTHON_COMPILE_DEFINITIONS
Expand All @@ -113,25 +107,14 @@ ENDIF(MSYS2_PYTHON)
SET_SOURCE_FILES_PROPERTIES(
PythonVersionChecker.cpp PROPERTIES COMPILE_DEFINITIONS
"${TLPGUI_PYTHON_COMPILE_DEFINITIONS}")
SET_SOURCE_FILES_PROPERTIES(
AboutPageUtils.cpp PROPERTIES COMPILE_DEFINITIONS
"${TLPGUI_PYTHON_COMPILE_DEFINITIONS}")

ADD_LIBRARY(talipot-gui-python STATIC ${PYTHON_PART_SRCS})

TARGET_LINK_LIBRARIES(talipot-gui-python ${QT_LIBRARIES})
SET_TARGET_PROPERTIES(talipot-gui-python PROPERTIES POSITION_INDEPENDENT_CODE
ON)

ADD_LIBRARY(talipot-about-page-utils STATIC AboutPageUtils.cpp)

TARGET_LINK_LIBRARIES(talipot-about-page-utils ${QT_LIBRARIES})
SET_TARGET_PROPERTIES(talipot-about-page-utils
PROPERTIES POSITION_INDEPENDENT_CODE ON)

QT_WRAP_UI(
UI_HEADERS
../designer/AboutPage.ui
../designer/ColorScaleConfigDialog.ui
../designer/Vec3fEditor.ui
../designer/CopyPropertyDialog.ui
Expand Down Expand Up @@ -163,7 +146,6 @@ QT_WRAP_UI(

QT_WRAP_CPP(
MOC_SRCS
../include/talipot/AboutPage.h
../include/talipot/CaptionGraphicsItem.h
../include/talipot/CaptionGraphicsSubItems.h
../include/talipot/CaptionItem.h
Expand Down Expand Up @@ -257,8 +239,6 @@ TARGET_LINK_LIBRARIES(

TARGET_LINK_LIBRARIES(${LibTalipotGUIName} talipot-gui-python)

TARGET_LINK_LIBRARIES(${LibTalipotGUIName} talipot-about-page-utils)

INSTALL(
TARGETS ${LibTalipotGUIName}
RUNTIME DESTINATION ${TalipotBinInstallDir}
Expand Down
36 changes: 25 additions & 11 deletions software/talipot/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SET(SRCS
src/main.cpp
src/AboutDialog.cpp
src/AlgorithmRunner.cpp
src/AlgorithmRunnerItem.cpp
src/ExpandableGroupBox.cpp
Expand All @@ -17,13 +18,23 @@ SET(SRCS
src/TalipotMainWindow.cpp
src/ThemeUtils.cpp)

SET(ABOUT_COMPILE_DEFINITIONS
SIP_VERSION="${SIP_VERSION_STR}" CPP_STANDARD="${CMAKE_CXX_STANDARD}"
CPP_COMPILER_ID="${CMAKE_CXX_COMPILER_ID}"
CPP_COMPILER_VERSION="${CMAKE_CXX_COMPILER_VERSION}")

SET_SOURCE_FILES_PROPERTIES(
src/AboutDialog.cpp PROPERTIES COMPILE_DEFINITIONS
"${ABOUT_COMPILE_DEFINITIONS}")

QTX_SET_INCLUDES_AND_DEFINITIONS()
QTXWEB_SET_INCLUDES_AND_DEFINITIONS()

QT_ADD_RESOURCES(RCC_SRCS resources/TalipotApp.qrc OPTIONS -name TalipotApp)

QT_WRAP_CPP(
MOC_SRCS
include/AboutDialog.h
include/AlgorithmRunner.h
include/AlgorithmRunnerItem.h
include/ExpandableGroupBox.h
Expand All @@ -43,6 +54,7 @@ QT_WRAP_CPP(

QT_WRAP_UI(
UI_SRCS
designer/AboutDialog.ui
designer/AlgorithmRunner.ui
designer/AlgorithmRunnerItem.ui
designer/GraphHierarchiesEditor.ui
Expand All @@ -60,13 +72,17 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/utils/crash_handler include/
${CMAKE_CURRENT_BINARY_DIR})

INCLUDE_DIRECTORIES(
${TalipotCoreBuildInclude} ${TalipotCoreInclude} ${TalipotOGLInclude}
${TalipotPythonInclude} ${TalipotGUIInclude} ${OPENGL_INCLUDE_DIR})
${TalipotCoreBuildInclude}
${TalipotCoreInclude}
${TalipotOGLInclude}
${TalipotPythonInclude}
${TalipotGUIInclude}
${OPENGL_INCLUDE_DIR}
${OGDFInclude})

TALIPOT_SET_CXX_FLAGS("${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")

IF(WIN32)

STRING(TIMESTAMP CURRENT_YEAR "%Y")

INCLUDE(generate_product_version)
Expand All @@ -90,7 +106,6 @@ IF(WIN32)
"talipot.exe")

SET(SRCS ${SRCS} ${VersionFiles})

ENDIF(WIN32)

ADD_EXECUTABLE(talipot ${SRCS} ${RCC_SRCS} ${MOC_SRCS} ${UI_SRCS})
Expand All @@ -111,7 +126,6 @@ INSTALL(
ARCHIVE DESTINATION ${TalipotLibInstallDir})

IF(WIN32)

SET(TALIPOT_FIXUP_BUNDLE
ON
CACHE
Expand All @@ -130,6 +144,7 @@ IF(WIN32)
DESTINATION ${TalipotBinInstallDir})
INSTALL(DIRECTORY ${QT_PLUGINS_DIR}/platforms
DESTINATION ${TalipotBinInstallDir})

IF(EXISTS ${QT_PLUGINS_DIR}/styles)
INSTALL(DIRECTORY ${QT_PLUGINS_DIR}/styles
DESTINATION ${TalipotBinInstallDir})
Expand All @@ -151,11 +166,13 @@ IF(WIN32)
"${CMAKE_INSTALL_PREFIX}/bin/imageformats/qsvg.dll"
"${CMAKE_INSTALL_PREFIX}/bin/platforms/qwindows.dll"
"${FIXUP_BUNDLE_LIBS}")

IF(MSVC)
SET(FIXUP_BUNDLE_LIBS
"${CMAKE_INSTALL_PREFIX}/bin/OGDF-talipot-${TalipotMajorVersion}_${TalipotMinorVersion}.dll"
"${FIXUP_BUNDLE_LIBS}")
"${CMAKE_INSTALL_PREFIX}/bin/OGDF-talipot-${TalipotMajorVersion}_${TalipotMinorVersion}.dll"
"${FIXUP_BUNDLE_LIBS}")
ENDIF(MSVC)

STRING(REPLACE "\\" "/" FIXUP_BUNDLE_LIBS "${FIXUP_BUNDLE_LIBS}")
STRING(REPLACE ";" "\;" FIXUP_BUNDLE_LIBS "${FIXUP_BUNDLE_LIBS}")

Expand All @@ -169,6 +186,7 @@ IF(WIN32)
SET(ENV{PATH} \"${PYTHON_HOME_PATH}\;${PATH_ESCAPED}\")
SET(gp_cmd_paths \"${GP_CMD_PATH}\")
FIXUP_BUNDLE(\"${APP}\" \"${FIXUP_BUNDLE_LIBS}\" \"${LIB_DIRS}\")")

# When generating Talipot installers using MSYS2, we need to bundle OpenSSL
# libraries in order for the Geographic view to work correctly. As Qt5 does
# not link directly to OpenSSL for license issue and thus use a dynamic
Expand All @@ -187,7 +205,6 @@ IF(WIN32)
ENDIF(WIN32)

IF(LINUX)

SET(TALIPOT_LINUX_DESKTOP_REGISTRATION
ON
CACHE
Expand All @@ -196,7 +213,6 @@ IF(LINUX)
)

IF(TALIPOT_LINUX_DESKTOP_REGISTRATION)

CONFIGURE_FILE(
resources/linux_desktop/Talipot.desktop.in
${CMAKE_CURRENT_BINARY_DIR}/Talipot-${TalipotVersion}.desktop)
Expand Down Expand Up @@ -247,7 +263,5 @@ IF(LINUX)
COMMAND update-desktop-database ${DESKTOP_CONFIG_INSTALL_PREFIX}/share/applications
COMMAND update-mime-database ${DESKTOP_CONFIG_INSTALL_PREFIX}/share/mime
OUTPUT_QUIET ERROR_QUIET)")

ENDIF(TALIPOT_LINUX_DESKTOP_REGISTRATION)

ENDIF(LINUX)
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutPage</class>
<widget class="QWidget" name="AboutPage">
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>546</height>
<width>600</width>
<height>500</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>600</width>
<height>500</height>
</size>
</property>
<property name="windowTitle">
<string>About Talipot</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
Expand Down Expand Up @@ -75,9 +78,9 @@
<item>
<layout class="QHBoxLayout" name="aboutVersionLayout">
<item>
<widget class="QLabel" name="dependenciesInfo">
<property name="text">
<string>Dependencies information</string>
<widget class="QTextBrowser" name="dependenciesInfo">
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
Expand Down Expand Up @@ -117,8 +120,6 @@
</item>
</layout>
</widget>
<resources>
<include location="../resources/TalipotGUIResource.qrc"/>
</resources>
<resources/>
<connections/>
</ui>
39 changes: 39 additions & 0 deletions software/talipot/include/AboutDialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
*
* Copyright (C) 2019-2023 The Talipot developers
*
* Talipot is a fork of Tulip, created by David Auber
* and the Tulip development Team from LaBRI, University of Bordeaux
*
* See the AUTHORS file at the top-level directory of this distribution
* License: GNU General Public License version 3, or any later version
* See top-level LICENSE file for more information
*
*/

#ifndef TALIPOT_ABOUT_DIALOG_H
#define TALIPOT_ABOUT_DIALOG_H

#include <talipot/config.h>

#include <QDialog>

namespace Ui {
class AboutDialog;
}

class AboutDialog : public QDialog {
Q_OBJECT
public:
explicit AboutDialog(QWidget *parent = nullptr);
~AboutDialog() override;

private slots:

void openUrlInBrowser(const QString &url);

private:
Ui::AboutDialog *_ui;
};

#endif // TALIPOT_ABOUT_DIALOG_H
Loading

0 comments on commit 614236f

Please sign in to comment.