Merged muonspin/musrfit:root6 into master
This commit is contained in:
commit
c4da2c4ec0
@ -1,9 +1,11 @@
|
|||||||
#--- mupp for Qt > 5.0 --------------------------------------------------------
|
#--- mupp for Qt = 5.x --------------------------------------------------------
|
||||||
|
|
||||||
#--- Find includes in corresponding build directories -------------------------
|
#--- Find includes in corresponding build directories -------------------------
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
#--- instruct CMake to run moc automatically when needed ----------------------
|
#--- instruct CMake to run moc automatically when needed ----------------------
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
#--- deal with the resources --------------------------------------------------
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
#--- define mupp version ------------------------------------------------------
|
#--- define mupp version ------------------------------------------------------
|
||||||
set(mupp_VERSION 1.0.0)
|
set(mupp_VERSION 1.0.0)
|
||||||
@ -34,9 +36,6 @@ add_custom_target(
|
|||||||
|
|
||||||
add_subdirectory(plotter)
|
add_subdirectory(plotter)
|
||||||
|
|
||||||
qt5_add_resources(qrc_mupp.cpp mupp.qrc)
|
|
||||||
set_property(SOURCE qrc_mupp.cpp PROPERTY SKIP_AUTOMOC ON) # needed for cmake 3.x
|
|
||||||
|
|
||||||
set(GENERATED_HEADER_FILES
|
set(GENERATED_HEADER_FILES
|
||||||
mupp_version.h
|
mupp_version.h
|
||||||
)
|
)
|
||||||
@ -55,10 +54,10 @@ if (APPLE)
|
|||||||
set(RESOURCE_FILES icons/mupp.icns)
|
set(RESOURCE_FILES icons/mupp.icns)
|
||||||
add_executable(mupp
|
add_executable(mupp
|
||||||
MACOSX_BUNDLE ${GENERATED_HEADER_FILES} ${MUPP_SOURCE_FILES}
|
MACOSX_BUNDLE ${GENERATED_HEADER_FILES} ${MUPP_SOURCE_FILES}
|
||||||
qrc_mupp.cpp ${RESOURCE_FILES}
|
mupp.qrc ${RESOURCE_FILES}
|
||||||
)
|
)
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
add_executable(mupp ${GENERATED_HEADER_FILES} ${MUPP_SOURCE_FILES} qrc_mupp.cpp)
|
add_executable(mupp ${GENERATED_HEADER_FILES} ${MUPP_SOURCE_FILES} mupp.qrc)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
#--- check if project source is repo ------------------------------------------
|
#--- check if project source is repo ------------------------------------------
|
||||||
@ -89,7 +88,7 @@ target_include_directories(mupp
|
|||||||
)
|
)
|
||||||
|
|
||||||
#--- use the Widgets and XML modules from Qt5 ---------------------------------
|
#--- use the Widgets and XML modules from Qt5 ---------------------------------
|
||||||
target_link_libraries(mupp Qt5::Widgets Qt5::Xml)
|
target_link_libraries(mupp PRIVATE Qt5::Widgets Qt5::Xml)
|
||||||
|
|
||||||
#--- if macOS make an app rather than just a command line executable ----------
|
#--- if macOS make an app rather than just a command line executable ----------
|
||||||
set_target_properties(mupp PROPERTIES
|
set_target_properties(mupp PROPERTIES
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#--- musrStep for Qt > 5.0 ----------------------------------------------------
|
#--- musrStep for Qt = 5.x ----------------------------------------------------
|
||||||
|
|
||||||
#--- check if project source is repo ------------------------------------------
|
#--- check if project source is repo ------------------------------------------
|
||||||
if (IS_GIT_REPO)
|
if (IS_GIT_REPO)
|
||||||
@ -7,6 +7,13 @@ else (IS_GIT_REPO)
|
|||||||
set(HAVE_GIT_REV_H "")
|
set(HAVE_GIT_REV_H "")
|
||||||
endif (IS_GIT_REPO)
|
endif (IS_GIT_REPO)
|
||||||
|
|
||||||
|
#--- instruct CMake to run moc automatically when needed ----------------------
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
#--- deal with the resources --------------------------------------------------
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
set(qt_libs Qt5::Core Qt5::Widgets Qt5::Svg)
|
set(qt_libs Qt5::Core Qt5::Widgets Qt5::Svg)
|
||||||
|
|
||||||
set(musrStep_src
|
set(musrStep_src
|
||||||
@ -14,34 +21,17 @@ set(musrStep_src
|
|||||||
musrStep.cpp
|
musrStep.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# Instruct CMake to run moc automatically when needed
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
|
|
||||||
#[==[
|
|
||||||
# as35 currently CMAKE_AUTOUIC -> ON doesn't work since it requires the ui-files
|
|
||||||
# in the same directory as the cpp-files.
|
|
||||||
# Create code from a list of Qt designer ui files
|
|
||||||
set(CMAKE_AUTOUIC ON)
|
|
||||||
#]==]
|
|
||||||
set(CMAKE_AUTOUIC OFF)
|
|
||||||
|
|
||||||
# add qt/rcc
|
|
||||||
qt5_add_resources(musrStep_rcc musrStep.qrc)
|
|
||||||
|
|
||||||
# remove generated files from automoc and autouic
|
|
||||||
set_property(SOURCE qrc_musrStep.cpp PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
|
|
||||||
set(macosx_icon icons/musrStep.icns)
|
set(macosx_icon icons/musrStep.icns)
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
add_executable(musrStep MACOSX_BUNDLE
|
add_executable(musrStep MACOSX_BUNDLE
|
||||||
${musrStep_src}
|
${musrStep_src}
|
||||||
${musrStep_rcc}
|
musrStep.qrc
|
||||||
${macosx_icon}
|
${macosx_icon}
|
||||||
)
|
)
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
add_executable(musrStep
|
add_executable(musrStep
|
||||||
${musrStep_src}
|
${musrStep_src}
|
||||||
${musrStep_rcc}
|
musrStep.qrc
|
||||||
)
|
)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
@ -59,7 +49,7 @@ target_compile_options(musrStep
|
|||||||
"${HAVE_GIT_REV_H}"
|
"${HAVE_GIT_REV_H}"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(musrStep ${qt_libs})
|
target_link_libraries(musrStep PRIVATE ${qt_libs})
|
||||||
|
|
||||||
#--- installation info --------------------------------------------------------
|
#--- installation info --------------------------------------------------------
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#--- musrWiz for Qt > 5.0 -----------------------------------------------------
|
#--- musrWiz for Qt = 5.x -----------------------------------------------------
|
||||||
|
|
||||||
#--- check if project source is repo ------------------------------------------
|
#--- check if project source is repo ------------------------------------------
|
||||||
if (IS_GIT_REPO)
|
if (IS_GIT_REPO)
|
||||||
@ -7,6 +7,13 @@ else (IS_GIT_REPO)
|
|||||||
set(HAVE_GIT_REV_H "")
|
set(HAVE_GIT_REV_H "")
|
||||||
endif (IS_GIT_REPO)
|
endif (IS_GIT_REPO)
|
||||||
|
|
||||||
|
#--- instruct CMake to run moc automatically when needed ----------------------
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
#--- deal with the resources --------------------------------------------------
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
set(qt_libs Qt5::Core Qt5::Widgets Qt5::Svg Qt5::Xml)
|
set(qt_libs Qt5::Core Qt5::Widgets Qt5::Svg Qt5::Xml)
|
||||||
|
|
||||||
set(musrWiz_src
|
set(musrWiz_src
|
||||||
@ -18,34 +25,17 @@ set(musrWiz_src
|
|||||||
musrWiz.cpp
|
musrWiz.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# Instruct CMake to run moc automatically when needed
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
|
|
||||||
#[==[
|
|
||||||
# as35 currently CMAKE_AUTOUIC -> ON doesn't work since it requires the ui-files
|
|
||||||
# in the same directory as the cpp-files.
|
|
||||||
# Create code from a list of Qt designer ui files
|
|
||||||
set(CMAKE_AUTOUIC ON)
|
|
||||||
#]==]
|
|
||||||
set(CMAKE_AUTOUIC OFF)
|
|
||||||
|
|
||||||
# add qt/rcc
|
|
||||||
qt5_add_resources(musrWiz_rcc musrWiz.qrc)
|
|
||||||
|
|
||||||
# remove generated files from automoc and autouic
|
|
||||||
set_property(SOURCE qrc_musrWiz.cpp PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
|
|
||||||
set(macosx_icon icons/musrWiz.icns)
|
set(macosx_icon icons/musrWiz.icns)
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
add_executable(musrWiz MACOSX_BUNDLE
|
add_executable(musrWiz MACOSX_BUNDLE
|
||||||
${musrWiz_src}
|
${musrWiz_src}
|
||||||
${musrWiz_rcc}
|
musrWiz.qrc
|
||||||
${macosx_icon}
|
${macosx_icon}
|
||||||
)
|
)
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
add_executable(musrWiz
|
add_executable(musrWiz
|
||||||
${musrWiz_src}
|
${musrWiz_src}
|
||||||
${musrWiz_rcc}
|
musrWiz.qrc
|
||||||
)
|
)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
@ -63,7 +53,7 @@ target_compile_options(musrWiz
|
|||||||
"${HAVE_GIT_REV_H}"
|
"${HAVE_GIT_REV_H}"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(musrWiz ${qt_libs})
|
target_link_libraries(musrWiz PRIVATE ${qt_libs})
|
||||||
|
|
||||||
#--- installation info --------------------------------------------------------
|
#--- installation info --------------------------------------------------------
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
@ -1,167 +1,141 @@
|
|||||||
#--- musredit for Qt > 5.0 ----------------------------------------------------
|
#--- musredit for Qt = 5.x ----------------------------------------------------
|
||||||
|
|
||||||
#--- check if project source is repo ------------------------------------------
|
#--- check if project source is repo ------------------------------------------
|
||||||
if (IS_GIT_REPO)
|
if (IS_GIT_REPO)
|
||||||
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
||||||
else (IS_GIT_REPO)
|
else (IS_GIT_REPO)
|
||||||
set(HAVE_GIT_REV_H "")
|
set(HAVE_GIT_REV_H "")
|
||||||
endif (IS_GIT_REPO)
|
endif (IS_GIT_REPO)
|
||||||
|
|
||||||
set(qt_libs Qt5::Core Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Svg Qt5::PrintSupport)
|
#--- instruct CMake to run moc automatically when needed ----------------------
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
set(musredit_src
|
#--- create code from a list of Qt designer ui files --------------------------
|
||||||
PTextEdit.cpp
|
set(CMAKE_AUTOUIC ON)
|
||||||
PSubTextEdit.cpp
|
#--- add forms to the uic search path -----------------------------------------
|
||||||
PAdmin.cpp
|
set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/forms)
|
||||||
PFindDialog.cpp
|
#--- deal with the resources --------------------------------------------------
|
||||||
PReplaceDialog.cpp
|
set(CMAKE_AUTORCC ON)
|
||||||
PReplaceConfirmationDialog.cpp
|
|
||||||
PFitOutputHandler.cpp
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
PDumpOutputHandler.cpp
|
|
||||||
PPrefsDialog.cpp
|
set(qt_libs Qt5::Core Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Svg Qt5::PrintSupport)
|
||||||
PGetMusrFTOptionsDialog.cpp
|
|
||||||
PGetTitleBlockDialog.cpp
|
set(musredit_src
|
||||||
PGetParameterBlockDialog.cpp
|
PTextEdit.cpp
|
||||||
PGetTheoryBlockDialog.cpp
|
PSubTextEdit.cpp
|
||||||
PGetFunctionsBlockDialog.cpp
|
PAdmin.cpp
|
||||||
PGetAsymmetryRunBlockDialog.cpp
|
PFindDialog.cpp
|
||||||
PGetSingleHistoRunBlockDialog.cpp
|
PReplaceDialog.cpp
|
||||||
PGetNonMusrRunBlockDialog.cpp
|
PReplaceConfirmationDialog.cpp
|
||||||
PGetFourierBlockDialog.cpp
|
PFitOutputHandler.cpp
|
||||||
PGetPlotBlockDialog.cpp
|
PDumpOutputHandler.cpp
|
||||||
PMsr2DataDialog.cpp
|
PPrefsDialog.cpp
|
||||||
PChangeDefaultPathsDialog.cpp
|
PGetMusrFTOptionsDialog.cpp
|
||||||
PMusrEditAbout.cpp
|
PGetTitleBlockDialog.cpp
|
||||||
main.cpp
|
PGetParameterBlockDialog.cpp
|
||||||
)
|
PGetTheoryBlockDialog.cpp
|
||||||
|
PGetFunctionsBlockDialog.cpp
|
||||||
set(musredit_ui
|
PGetAsymmetryRunBlockDialog.cpp
|
||||||
forms/PFindDialog.ui
|
PGetSingleHistoRunBlockDialog.cpp
|
||||||
forms/PReplaceDialog.ui
|
PGetNonMusrRunBlockDialog.cpp
|
||||||
forms/PReplaceConfirmationDialog.ui
|
PGetFourierBlockDialog.cpp
|
||||||
forms/PMusrEditAbout.ui
|
PGetPlotBlockDialog.cpp
|
||||||
forms/PPrefsDialog.ui
|
PMsr2DataDialog.cpp
|
||||||
forms/PGetMusrFTOptionsDialog.ui
|
PChangeDefaultPathsDialog.cpp
|
||||||
forms/PGetTitleBlockDialog.ui
|
PMusrEditAbout.cpp
|
||||||
forms/PGetParameterBlockDialog.ui
|
main.cpp
|
||||||
forms/PGetTheoryBlockDialog.ui
|
)
|
||||||
forms/PGetFunctionsBlockDialog.ui
|
|
||||||
forms/PGetAsymmetryRunBlockDialog.ui
|
set(musredit_ui
|
||||||
forms/PGetSingleHistoRunBlockDialog.ui
|
forms/PFindDialog.ui
|
||||||
forms/PGetNonMusrRunBlockDialog.ui
|
forms/PReplaceDialog.ui
|
||||||
forms/PGetFourierBlockDialog.ui
|
forms/PReplaceConfirmationDialog.ui
|
||||||
forms/PGetPlotBlockDialog.ui
|
forms/PMusrEditAbout.ui
|
||||||
forms/PMsr2DataDialog.ui
|
forms/PPrefsDialog.ui
|
||||||
forms/PChangeDefaultPathsDialog.ui
|
forms/PGetMusrFTOptionsDialog.ui
|
||||||
)
|
forms/PGetTitleBlockDialog.ui
|
||||||
|
forms/PGetParameterBlockDialog.ui
|
||||||
# Instruct CMake to run moc automatically when needed
|
forms/PGetTheoryBlockDialog.ui
|
||||||
set(CMAKE_AUTOMOC ON)
|
forms/PGetFunctionsBlockDialog.ui
|
||||||
|
forms/PGetAsymmetryRunBlockDialog.ui
|
||||||
#[==[
|
forms/PGetSingleHistoRunBlockDialog.ui
|
||||||
# as35 currently CMAKE_AUTOUIC -> ON doesn't work since it requires the ui-files
|
forms/PGetNonMusrRunBlockDialog.ui
|
||||||
# in the same directory as the cpp-files.
|
forms/PGetFourierBlockDialog.ui
|
||||||
# Create code from a list of Qt designer ui files
|
forms/PGetPlotBlockDialog.ui
|
||||||
set(CMAKE_AUTOUIC ON)
|
forms/PMsr2DataDialog.ui
|
||||||
#]==]
|
forms/PChangeDefaultPathsDialog.ui
|
||||||
set(CMAKE_AUTOUIC OFF)
|
)
|
||||||
|
|
||||||
# call qt/uic
|
if (APPLE)
|
||||||
qt5_wrap_ui(out_ui ${musredit_ui})
|
if (${CMAKE_HOST_SYSTEM_VERSION} GREATER_EQUAL "20.3.0")
|
||||||
# add qt/rcc
|
set(macosx_icon_name musredit-bigsur.icns)
|
||||||
qt5_add_resources(musredit_rcc musredit.qrc)
|
else()
|
||||||
|
set(macosx_icon_name musredit.icns)
|
||||||
# remove generated files from automoc and autouic
|
endif()
|
||||||
set_property(SOURCE ui_PFindDialog.h PROPERTY SKIP_AUTOMOC ON)
|
set(macosx_icon "icons/${macosx_icon_name}")
|
||||||
set_property(SOURCE ui_PReplaceDialog.h PROPERTY SKIP_AUTOMOC ON)
|
message(STATUS "macosx_icon: ${macosx_icon}")
|
||||||
set_property(SOURCE ui_PReplaceConfirmationDialog.h PROPERTY SKIP_AUTOMOC ON)
|
add_executable(musredit MACOSX_BUNDLE
|
||||||
set_property(SOURCE ui_PMusrEditAbout.h PROPERTY SKIP_AUTOMOC ON)
|
${musredit_src}
|
||||||
set_property(SOURCE ui_PPrefsDialog.h PROPERTY SKIP_AUTOMOC ON)
|
${musredit_ui}
|
||||||
set_property(SOURCE ui_PGetMusrFTOptionsDialog.h PROPERTY SKIP_AUTOMOC ON)
|
musredit.qrc
|
||||||
set_property(SOURCE ui_PGetTitleBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
${macosx_icon}
|
||||||
set_property(SOURCE ui_PGetParameterBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
)
|
||||||
set_property(SOURCE ui_PGetTheoryBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
else (APPLE)
|
||||||
set_property(SOURCE ui_PGetFunctionsBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
add_executable(musredit
|
||||||
set_property(SOURCE ui_PGetAsymmetryRunBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
${musredit_src}
|
||||||
set_property(SOURCE ui_PGetSingleHistoRunBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
${musredit_ui}
|
||||||
set_property(SOURCE ui_PGetNonMusrRunBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
musredit.qrc
|
||||||
set_property(SOURCE ui_PGetFourierBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
)
|
||||||
set_property(SOURCE ui_PGetPlotBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
endif (APPLE)
|
||||||
set_property(SOURCE ui_PMsr2DataDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PChangeDefaultPathsDialog.h PROPERTY SKIP_AUTOMOC ON)
|
target_include_directories(musredit
|
||||||
set_property(SOURCE qrc_musredit.cpp PROPERTY SKIP_AUTOMOC ON)
|
BEFORE PRIVATE
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||||
if (APPLE)
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
if (${CMAKE_HOST_SYSTEM_VERSION} GREATER_EQUAL "20.3.0")
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
|
||||||
set(macosx_icon_name musredit-bigsur.icns)
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../..>
|
||||||
else()
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../../..>
|
||||||
set(macosx_icon_name musredit.icns)
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include>
|
||||||
endif()
|
)
|
||||||
set(macosx_icon "icons/${macosx_icon_name}")
|
|
||||||
message(STATUS "macosx_icon: ${macosx_icon}")
|
target_compile_options(musredit
|
||||||
add_executable(musredit MACOSX_BUNDLE
|
PRIVATE
|
||||||
${musredit_src}
|
"${HAVE_GIT_REV_H}"
|
||||||
${out_ui}
|
)
|
||||||
${musredit_rcc}
|
|
||||||
${macosx_icon}
|
target_link_libraries(musredit PRIVATE ${qt_libs})
|
||||||
)
|
|
||||||
else (APPLE)
|
#--- installation info --------------------------------------------------------
|
||||||
add_executable(musredit
|
if (APPLE)
|
||||||
${musredit_src}
|
set_target_properties(musredit PROPERTIES
|
||||||
${out_ui}
|
MACOSX_BUNDLE TRUE
|
||||||
${musredit_rcc}
|
MACOSX_BUNDLE_BUNDLE_NAME "musredit"
|
||||||
)
|
MACOSX_BUNDLE_INFO_STRING "musrfit: musredit simplifies the handling of the msr-files for uSR fitting."
|
||||||
endif (APPLE)
|
MACOSX_BUNDLE_ICON_FILE "${macosx_icon_name}"
|
||||||
|
MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION}"
|
||||||
target_include_directories(musredit
|
MACOSX_BUNDLE_GUI_IDENTIFIER "ch.psi.lmu.musredit"
|
||||||
BEFORE PRIVATE
|
MACOSX_BUNDLE_COPYRIGHT "Andreas Suter"
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
RESOURCE ${macosx_icon}
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
)
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
|
endif (APPLE)
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../..>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../../..>
|
if (APPLE)
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include>
|
install( TARGETS musredit
|
||||||
)
|
BUNDLE DESTINATION /Applications
|
||||||
|
)
|
||||||
target_compile_options(musredit
|
else (APPLE)
|
||||||
PRIVATE
|
install( TARGETS musredit
|
||||||
"${HAVE_GIT_REV_H}"
|
RUNTIME DESTINATION bin
|
||||||
)
|
)
|
||||||
|
endif (APPLE)
|
||||||
target_link_libraries(musredit ${qt_libs})
|
|
||||||
|
#--- documentation installation info ------------------------------------------
|
||||||
#--- installation info --------------------------------------------------------
|
install(
|
||||||
if (APPLE)
|
DIRECTORY
|
||||||
set_target_properties(musredit PROPERTIES
|
${CMAKE_SOURCE_DIR}/doc/examples
|
||||||
MACOSX_BUNDLE TRUE
|
${CMAKE_SOURCE_DIR}/doc/html
|
||||||
MACOSX_BUNDLE_BUNDLE_NAME "musredit"
|
${CMAKE_SOURCE_DIR}/doc/memos
|
||||||
MACOSX_BUNDLE_INFO_STRING "musrfit: musredit simplifies the handling of the msr-files for uSR fitting."
|
DESTINATION
|
||||||
MACOSX_BUNDLE_ICON_FILE "${macosx_icon_name}"
|
${CMAKE_INSTALL_PREFIX}/share/doc/musrfit
|
||||||
MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION}"
|
MESSAGE_NEVER
|
||||||
MACOSX_BUNDLE_GUI_IDENTIFIER "ch.psi.lmu.musredit"
|
)
|
||||||
MACOSX_BUNDLE_COPYRIGHT "Andreas Suter"
|
|
||||||
RESOURCE ${macosx_icon}
|
|
||||||
)
|
|
||||||
endif (APPLE)
|
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
install( TARGETS musredit
|
|
||||||
BUNDLE DESTINATION /Applications
|
|
||||||
)
|
|
||||||
else (APPLE)
|
|
||||||
install( TARGETS musredit
|
|
||||||
RUNTIME DESTINATION bin
|
|
||||||
)
|
|
||||||
endif (APPLE)
|
|
||||||
|
|
||||||
#--- documentation installation info ------------------------------------------
|
|
||||||
install(
|
|
||||||
DIRECTORY
|
|
||||||
${CMAKE_SOURCE_DIR}/doc/examples
|
|
||||||
${CMAKE_SOURCE_DIR}/doc/html
|
|
||||||
${CMAKE_SOURCE_DIR}/doc/memos
|
|
||||||
DESTINATION
|
|
||||||
${CMAKE_INSTALL_PREFIX}/share/doc/musrfit
|
|
||||||
MESSAGE_NEVER
|
|
||||||
)
|
|
||||||
|
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
#--- mupp for Qt > 6.0 --------------------------------------------------------
|
#--- mupp for Qt = 6.x --------------------------------------------------------
|
||||||
|
|
||||||
#--- Find includes in corresponding build directories -------------------------
|
#--- Find includes in corresponding build directories -------------------------
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
#--- instruct CMake to run moc automatically when needed ----------------------
|
#--- instruct CMake to run moc automatically when needed ----------------------
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
#--- deal with the resources --------------------------------------------------
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
#--- define mupp version ------------------------------------------------------
|
#--- define mupp version ------------------------------------------------------
|
||||||
set(mupp_VERSION 1.0.0)
|
set(mupp_VERSION 1.0.0)
|
||||||
@ -34,9 +36,6 @@ add_custom_target(
|
|||||||
|
|
||||||
add_subdirectory(plotter)
|
add_subdirectory(plotter)
|
||||||
|
|
||||||
qt6_add_resources(qrc_mupp.cpp mupp.qrc)
|
|
||||||
set_property(SOURCE qrc_mupp.cpp PROPERTY SKIP_AUTOMOC ON) # needed for cmake 3.x
|
|
||||||
|
|
||||||
set(GENERATED_HEADER_FILES
|
set(GENERATED_HEADER_FILES
|
||||||
mupp_version.h
|
mupp_version.h
|
||||||
)
|
)
|
||||||
@ -55,10 +54,10 @@ if (APPLE)
|
|||||||
set(RESOURCE_FILES icons/mupp.icns)
|
set(RESOURCE_FILES icons/mupp.icns)
|
||||||
add_executable(mupp
|
add_executable(mupp
|
||||||
MACOSX_BUNDLE ${GENERATED_HEADER_FILES} ${MUPP_SOURCE_FILES}
|
MACOSX_BUNDLE ${GENERATED_HEADER_FILES} ${MUPP_SOURCE_FILES}
|
||||||
qrc_mupp.cpp ${RESOURCE_FILES}
|
mupp.qrc ${RESOURCE_FILES}
|
||||||
)
|
)
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
add_executable(mupp ${GENERATED_HEADER_FILES} ${MUPP_SOURCE_FILES} qrc_mupp.cpp)
|
add_executable(mupp ${GENERATED_HEADER_FILES} ${MUPP_SOURCE_FILES} mupp.qrc)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
#--- check if project source is repo ------------------------------------------
|
#--- check if project source is repo ------------------------------------------
|
||||||
@ -89,7 +88,7 @@ target_include_directories(mupp
|
|||||||
)
|
)
|
||||||
|
|
||||||
#--- use the Widgets and XML modules from Qt5 ---------------------------------
|
#--- use the Widgets and XML modules from Qt5 ---------------------------------
|
||||||
target_link_libraries(mupp Qt6::Widgets Qt6::Xml)
|
target_link_libraries(mupp PRIVATE Qt6::Widgets Qt6::Xml)
|
||||||
|
|
||||||
#--- if macOS make an app rather than just a command line executable ----------
|
#--- if macOS make an app rather than just a command line executable ----------
|
||||||
set_target_properties(mupp PROPERTIES
|
set_target_properties(mupp PROPERTIES
|
||||||
|
@ -1082,7 +1082,7 @@ void PmuppGui::addX(QString param)
|
|||||||
if (!param.isEmpty()) {
|
if (!param.isEmpty()) {
|
||||||
// check that param exists
|
// check that param exists
|
||||||
if (fParamList->findItems(param, Qt::MatchCaseSensitive).empty()) {
|
if (fParamList->findItems(param, Qt::MatchCaseSensitive).empty()) {
|
||||||
QMessageBox::critical(this, "**ERROR**", QString("Parameter X '%1' not found").arg(param));
|
QMessageBox::critical(this, "ERROR", QString("Parameter X '%1' not found").arg(param));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
paramName = param;
|
paramName = param;
|
||||||
@ -1125,7 +1125,7 @@ void PmuppGui::addY(QString param)
|
|||||||
if (!param.isEmpty()) {
|
if (!param.isEmpty()) {
|
||||||
// check that param exists
|
// check that param exists
|
||||||
if (fParamList->findItems(param, Qt::MatchCaseSensitive).empty()) {
|
if (fParamList->findItems(param, Qt::MatchCaseSensitive).empty()) {
|
||||||
QMessageBox::critical(this, "**ERROR**", QString("Parameter Y '%1' not found").arg(param));
|
QMessageBox::critical(this, "ERROR", QString("Parameter Y '%1' not found").arg(param));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
paramName = param;
|
paramName = param;
|
||||||
@ -1141,7 +1141,7 @@ void PmuppGui::addY(QString param)
|
|||||||
|
|
||||||
// make sure that any x-parameter selection is already present
|
// make sure that any x-parameter selection is already present
|
||||||
if (fViewX->count() == 0) {
|
if (fViewX->count() == 0) {
|
||||||
QMessageBox::warning(this, "**WARNING**", "It is compulsory to have at least one x-parameter set\nbefore trying to add a y-parameter.");
|
QMessageBox::warning(this, "WARNING", "It is compulsory to have at least one x-parameter set\nbefore trying to add a y-parameter.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1150,7 +1150,7 @@ void PmuppGui::addY(QString param)
|
|||||||
if (idx == -1)
|
if (idx == -1)
|
||||||
return;
|
return;
|
||||||
if (fXY[idx].getCollectionTag() != fColList->currentRow()) {
|
if (fXY[idx].getCollectionTag() != fColList->currentRow()) {
|
||||||
QMessageBox::warning(this, "**WARNING**", "x/y parameters need to originate from the same collection.");
|
QMessageBox::warning(this, "WARNING", "x/y parameters need to originate from the same collection.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1338,7 +1338,7 @@ void PmuppGui::check(QString varStr, QVector<int> idx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count == idx.size()) {
|
if (count == idx.size()) {
|
||||||
QMessageBox::information(this, "**INFO**", "Parsing successful.");
|
QMessageBox::information(this, "INFO", "Parsing successful.");
|
||||||
}
|
}
|
||||||
fVarDlg->raise();
|
fVarDlg->raise();
|
||||||
fVarDlg->setFocus();
|
fVarDlg->setFocus();
|
||||||
@ -1750,7 +1750,7 @@ void PmuppGui::dropOnViewY(QListWidgetItem *item)
|
|||||||
if (fViewX->count() == 0) {
|
if (fViewX->count() == 0) {
|
||||||
fViewY->removeItemWidget(item);
|
fViewY->removeItemWidget(item);
|
||||||
delete item;
|
delete item;
|
||||||
QMessageBox::warning(this, "**WARNING**", "It is compulsory to have at least one x-parameter set\nbefore trying to add a y-parameter.");
|
QMessageBox::warning(this, "WARNING", "It is compulsory to have at least one x-parameter set\nbefore trying to add a y-parameter.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1826,7 +1826,7 @@ void PmuppGui::createMacro()
|
|||||||
|
|
||||||
QFile file(fMacroName);
|
QFile file(fMacroName);
|
||||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Couldn't open macro file for writting.");
|
QMessageBox::critical(this, "ERROR", "Couldn't open macro file for writting.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1869,7 +1869,7 @@ void PmuppGui::createMacro()
|
|||||||
xx = getValues(collName, xLabel, ok);
|
xx = getValues(collName, xLabel, ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("Couldn't get x-axis data from '%1', coll: '%2'").arg(xLabel).arg(collName);
|
QString msg = QString("Couldn't get x-axis data from '%1', coll: '%2'").arg(xLabel).arg(collName);
|
||||||
QMessageBox::critical(this, "**ERROR**", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
getMinMax(xx, xMin, xMax);
|
getMinMax(xx, xMin, xMax);
|
||||||
@ -1886,19 +1886,19 @@ void PmuppGui::createMacro()
|
|||||||
yy = getValues(collName, yLabel, ok);
|
yy = getValues(collName, yLabel, ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("Couldn't get y-axis data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
QString msg = QString("Couldn't get y-axis data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
||||||
QMessageBox::critical(this, "**ERROR**", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yyPosErr = getPosErr(collName, yLabel, ok);
|
yyPosErr = getPosErr(collName, yLabel, ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("Couldn't get y-axis pos. error data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
QString msg = QString("Couldn't get y-axis pos. error data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
||||||
QMessageBox::critical(this, "**ERROR**", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yyNegErr = getNegErr(collName, yLabel, ok);
|
yyNegErr = getNegErr(collName, yLabel, ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("Couldn't get y-axis neg. error data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
QString msg = QString("Couldn't get y-axis neg. error data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
||||||
QMessageBox::critical(this, "**ERROR**", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yLabel = substituteDefaultLabels(yLabel);
|
yLabel = substituteDefaultLabels(yLabel);
|
||||||
@ -2015,7 +2015,7 @@ void PmuppGui::plot()
|
|||||||
{
|
{
|
||||||
// check if there is something to be plotted
|
// check if there is something to be plotted
|
||||||
if (fXY.size() == 0) {
|
if (fXY.size() == 0) {
|
||||||
QMessageBox::information(this, "plot", "No parameter list present.");
|
QMessageBox::information(this, "PLOT", "No parameter list present.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2058,7 +2058,7 @@ void PmuppGui::plot()
|
|||||||
xx = getValues(collName, xLabel, ok);
|
xx = getValues(collName, xLabel, ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("Couldn't get x-axis data from '%1', coll: '%2'").arg(xLabel).arg(collName);
|
QString msg = QString("Couldn't get x-axis data from '%1', coll: '%2'").arg(xLabel).arg(collName);
|
||||||
QMessageBox::critical(this, "**ERROR**", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2073,21 +2073,21 @@ void PmuppGui::plot()
|
|||||||
yy = getValues(collName, yLabel, ok);
|
yy = getValues(collName, yLabel, ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("Couldn't get y-axis data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
QString msg = QString("Couldn't get y-axis data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
||||||
QMessageBox::critical(this, "**ERROR**", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yyy.push_back(yy);
|
yyy.push_back(yy);
|
||||||
yyPosErr = getPosErr(collName, yLabel, ok);
|
yyPosErr = getPosErr(collName, yLabel, ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("Couldn't get y-axis pos. error data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
QString msg = QString("Couldn't get y-axis pos. error data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
||||||
QMessageBox::critical(this, "**ERROR**", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yyyPosErr.push_back(yyPosErr);
|
yyyPosErr.push_back(yyPosErr);
|
||||||
yyNegErr = getNegErr(collName, yLabel, ok);
|
yyNegErr = getNegErr(collName, yLabel, ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("Couldn't get y-axis neg. error data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
QString msg = QString("Couldn't get y-axis neg. error data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
||||||
QMessageBox::critical(this, "**ERROR**", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yyyNegErr.push_back(yyNegErr);
|
yyyNegErr.push_back(yyNegErr);
|
||||||
@ -2103,21 +2103,21 @@ void PmuppGui::plot()
|
|||||||
yy = getValues(collName, yLabel, ok);
|
yy = getValues(collName, yLabel, ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("Couldn't get y-axis data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
QString msg = QString("Couldn't get y-axis data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
||||||
QMessageBox::critical(this, "**ERROR**", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yyy.push_back(yy);
|
yyy.push_back(yy);
|
||||||
yyPosErr = getPosErr(collName, yLabel, ok);
|
yyPosErr = getPosErr(collName, yLabel, ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("Couldn't get y-axis pos. error data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
QString msg = QString("Couldn't get y-axis pos. error data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
||||||
QMessageBox::critical(this, "**ERROR**", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yyyPosErr.push_back(yyPosErr);
|
yyyPosErr.push_back(yyPosErr);
|
||||||
yyNegErr = getNegErr(collName, yLabel, ok);
|
yyNegErr = getNegErr(collName, yLabel, ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("Couldn't get y-axis neg. error data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
QString msg = QString("Couldn't get y-axis neg. error data from '%1', coll: '%2'").arg(yLabel).arg(collName);
|
||||||
QMessageBox::critical(this, "**ERROR**", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yyyNegErr.push_back(yyNegErr);
|
yyyNegErr.push_back(yyNegErr);
|
||||||
@ -2237,7 +2237,7 @@ void PmuppGui::startMuppPlot()
|
|||||||
|
|
||||||
fMuppPlot = new QProcess(this);
|
fMuppPlot = new QProcess(this);
|
||||||
if (fMuppPlot == nullptr) {
|
if (fMuppPlot == nullptr) {
|
||||||
QMessageBox::critical(0, "**ERROR**", "Couldn't invoke QProcess for mupp_plot!");
|
QMessageBox::critical(this, "ERROR", "Couldn't invoke QProcess for mupp_plot!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2253,10 +2253,7 @@ void PmuppGui::startMuppPlot()
|
|||||||
if (!fMuppPlot->waitForStarted()) {
|
if (!fMuppPlot->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd);
|
QString msg(tr("Could not execute the output command: ")+cmd);
|
||||||
QMessageBox::critical( 0,
|
QMessageBox::critical(this, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2296,7 +2293,7 @@ void PmuppGui::handleCmds()
|
|||||||
fMacroName = tok[1];
|
fMacroName = tok[1];
|
||||||
createMacro();
|
createMacro();
|
||||||
} else if (cmd.startsWith("path")) { // cmd: path <macro_path>
|
} else if (cmd.startsWith("path")) { // cmd: path <macro_path>
|
||||||
QMessageBox::information(0, "INFO", "set's eventually the path for the macros to be saved.");
|
QMessageBox::information(this , "INFO", "set's eventually the path for the macros to be saved.");
|
||||||
// will set the path to where to save the macro
|
// will set the path to where to save the macro
|
||||||
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
||||||
if (tok.size() != 2) {
|
if (tok.size() != 2) {
|
||||||
@ -2316,7 +2313,7 @@ void PmuppGui::handleCmds()
|
|||||||
QString fullPath = env.value(envVar); // get environment variable value if present, otherwise "" is returned
|
QString fullPath = env.value(envVar); // get environment variable value if present, otherwise "" is returned
|
||||||
if (fullPath.isEmpty()) {
|
if (fullPath.isEmpty()) {
|
||||||
fMacroPath = "";
|
fMacroPath = "";
|
||||||
QMessageBox::critical(0, "ERROR", QString("Environment variable '%1' not present. Typo?!").arg(envVar.prepend("$")));
|
QMessageBox::critical(this, "ERROR", QString("Environment variable '%1' not present. Typo?!").arg(envVar.prepend("$")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fMacroPath.replace(envVar.prepend("$"), fullPath);
|
fMacroPath.replace(envVar.prepend("$"), fullPath);
|
||||||
@ -2328,13 +2325,13 @@ void PmuppGui::handleCmds()
|
|||||||
if (tok.size() > 1)
|
if (tok.size() > 1)
|
||||||
addX(tok[1]);
|
addX(tok[1]);
|
||||||
else
|
else
|
||||||
QMessageBox::critical(0, "ERROR", QString("Found command 'x' without variable."));
|
QMessageBox::critical(this, "ERROR", QString("Found command 'x' without variable."));
|
||||||
} else if (cmd.startsWith("y")) {
|
} else if (cmd.startsWith("y")) {
|
||||||
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
||||||
if (tok.size() > 1)
|
if (tok.size() > 1)
|
||||||
addY(tok[1]);
|
addY(tok[1]);
|
||||||
else
|
else
|
||||||
QMessageBox::critical(0, "ERROR", QString("Found command 'y' without variable."));
|
QMessageBox::critical(this, "ERROR", QString("Found command 'y' without variable."));
|
||||||
} else if (cmd.startsWith("ditto")) {
|
} else if (cmd.startsWith("ditto")) {
|
||||||
addDitto();
|
addDitto();
|
||||||
} else if (cmd.startsWith("rmx")) {
|
} else if (cmd.startsWith("rmx")) {
|
||||||
@ -2342,17 +2339,17 @@ void PmuppGui::handleCmds()
|
|||||||
if (tok.size() > 1)
|
if (tok.size() > 1)
|
||||||
removeX(tok[1]);
|
removeX(tok[1]);
|
||||||
else
|
else
|
||||||
QMessageBox::critical(0, "ERROR", QString("Found command 'rmx' without variable."));
|
QMessageBox::critical(this, "ERROR", QString("Found command 'rmx' without variable."));
|
||||||
} else if (cmd.startsWith("rmy")) {
|
} else if (cmd.startsWith("rmy")) {
|
||||||
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
||||||
if (tok.size() > 1)
|
if (tok.size() > 1)
|
||||||
removeY(tok[1]);
|
removeY(tok[1]);
|
||||||
else
|
else
|
||||||
QMessageBox::critical(0, "ERROR", QString("Found command 'rmy' without variable."));
|
QMessageBox::critical(this, "ERROR", QString("Found command 'rmy' without variable."));
|
||||||
} else if (cmd.startsWith("norm")) {
|
} else if (cmd.startsWith("norm")) {
|
||||||
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
QStringList tok = cmd.split(" ", Qt::SkipEmptyParts);
|
||||||
if (tok.size() != 2) {
|
if (tok.size() != 2) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "found wrong norm cmd, will ignore it.");
|
QMessageBox::critical(this, "ERROR", "found wrong norm cmd, will ignore it.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!tok[1].trimmed().compare("true", Qt::CaseInsensitive)) {
|
if (!tok[1].trimmed().compare("true", Qt::CaseInsensitive)) {
|
||||||
@ -2360,7 +2357,7 @@ void PmuppGui::handleCmds()
|
|||||||
} else if (!tok[1].trimmed().compare("false", Qt::CaseInsensitive)) {
|
} else if (!tok[1].trimmed().compare("false", Qt::CaseInsensitive)) {
|
||||||
fNormalizeAction->setChecked(false);
|
fNormalizeAction->setChecked(false);
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(this, "**ERROR**", "found wrong norm cmd, will ignore it.");
|
QMessageBox::critical(this, "ERROR", "found wrong norm cmd, will ignore it.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (cmd.startsWith("add var")) {
|
} else if (cmd.startsWith("add var")) {
|
||||||
@ -2626,7 +2623,7 @@ void PmuppGui::selectCollection(QString cmd)
|
|||||||
if (ival < fColList->count())
|
if (ival < fColList->count())
|
||||||
fColList->setCurrentRow(ival);
|
fColList->setCurrentRow(ival);
|
||||||
else
|
else
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
QString("Found Row Selection %1 which is > #Selections=%2").arg(ival).arg(fColList->count()));
|
QString("Found Row Selection %1 which is > #Selections=%2").arg(ival).arg(fColList->count()));
|
||||||
} else { // assume it is a collection name
|
} else { // assume it is a collection name
|
||||||
for (int i=0; i<fColList->count(); i++) {
|
for (int i=0; i<fColList->count(); i++) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#--- musrStep for Qt > 6.0 ----------------------------------------------------
|
#--- musrStep for Qt = 6.x ----------------------------------------------------
|
||||||
|
|
||||||
#--- check if project source is repo ------------------------------------------
|
#--- check if project source is repo ------------------------------------------
|
||||||
if (IS_GIT_REPO)
|
if (IS_GIT_REPO)
|
||||||
@ -7,6 +7,13 @@ else (IS_GIT_REPO)
|
|||||||
set(HAVE_GIT_REV_H "")
|
set(HAVE_GIT_REV_H "")
|
||||||
endif (IS_GIT_REPO)
|
endif (IS_GIT_REPO)
|
||||||
|
|
||||||
|
#--- instruct CMake to run moc automatically when needed ----------------------
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
#--- deal with the resources --------------------------------------------------
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
set(qt_libs Qt6::Core Qt6::Widgets Qt6::Svg)
|
set(qt_libs Qt6::Core Qt6::Widgets Qt6::Svg)
|
||||||
|
|
||||||
set(musrStep_src
|
set(musrStep_src
|
||||||
@ -14,34 +21,17 @@ set(musrStep_src
|
|||||||
musrStep.cpp
|
musrStep.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# Instruct CMake to run moc automatically when needed
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
|
|
||||||
#[==[
|
|
||||||
# as35 currently CMAKE_AUTOUIC -> ON doesn't work since it requires the ui-files
|
|
||||||
# in the same directory as the cpp-files.
|
|
||||||
# Create code from a list of Qt designer ui files
|
|
||||||
set(CMAKE_AUTOUIC ON)
|
|
||||||
#]==]
|
|
||||||
set(CMAKE_AUTOUIC OFF)
|
|
||||||
|
|
||||||
# add qt/rcc
|
|
||||||
qt6_add_resources(musrStep_rcc musrStep.qrc)
|
|
||||||
|
|
||||||
# remove generated files from automoc and autouic
|
|
||||||
set_property(SOURCE qrc_musrStep.cpp PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
|
|
||||||
set(macosx_icon icons/musrStep.icns)
|
set(macosx_icon icons/musrStep.icns)
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
add_executable(musrStep MACOSX_BUNDLE
|
add_executable(musrStep MACOSX_BUNDLE
|
||||||
${musrStep_src}
|
${musrStep_src}
|
||||||
${musrStep_rcc}
|
musrStep.qrc
|
||||||
${macosx_icon}
|
${macosx_icon}
|
||||||
)
|
)
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
add_executable(musrStep
|
add_executable(musrStep
|
||||||
${musrStep_src}
|
${musrStep_src}
|
||||||
${musrStep_rcc}
|
musrStep.qrc
|
||||||
)
|
)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
@ -59,7 +49,7 @@ target_compile_options(musrStep
|
|||||||
"${HAVE_GIT_REV_H}"
|
"${HAVE_GIT_REV_H}"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(musrStep ${qt_libs})
|
target_link_libraries(musrStep PRIVATE ${qt_libs})
|
||||||
|
|
||||||
#--- installation info --------------------------------------------------------
|
#--- installation info --------------------------------------------------------
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
@ -167,7 +167,7 @@ PMusrStep::PMusrStep(const char *fln, QWidget *parent) :
|
|||||||
fValid = true;
|
fValid = true;
|
||||||
} else {
|
} else {
|
||||||
QString msg = QString("Failed to read msr-file: %1 (status=%2)").arg(fMsrFileName).arg(status);
|
QString msg = QString("Failed to read msr-file: %1 (status=%2)").arg(fMsrFileName).arg(status);
|
||||||
QMessageBox::critical(0, "ERROR", msg);
|
QMessageBox::critical(nullptr, "ERROR", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
int height;
|
int height;
|
||||||
@ -261,7 +261,7 @@ void PMusrStep::handleCellChanged(int row, int column)
|
|||||||
if ((fParamTable->item(row, column)->checkState() == Qt::Checked) &&
|
if ((fParamTable->item(row, column)->checkState() == Qt::Checked) &&
|
||||||
((str == "0") || (str == "0.0"))) {
|
((str == "0") || (str == "0.0"))) {
|
||||||
fParamTable->item(row, column)->setCheckState(Qt::Unchecked);
|
fParamTable->item(row, column)->setCheckState(Qt::Unchecked);
|
||||||
QMessageBox::warning(0, "WARNING", "You cannot select a fixed value (step == 0).");
|
QMessageBox::warning(nullptr, "WARNING", "You cannot select a fixed value (step == 0).");
|
||||||
}
|
}
|
||||||
} else if (column == 2) {
|
} else if (column == 2) {
|
||||||
str = fParamTable->item(row, column)->text();
|
str = fParamTable->item(row, column)->text();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#--- musrWiz for Qt > 6.0 -----------------------------------------------------
|
#--- musrWiz for Qt = 6.x -----------------------------------------------------
|
||||||
|
|
||||||
#--- check if project source is repo ------------------------------------------
|
#--- check if project source is repo ------------------------------------------
|
||||||
if (IS_GIT_REPO)
|
if (IS_GIT_REPO)
|
||||||
@ -7,6 +7,13 @@ else (IS_GIT_REPO)
|
|||||||
set(HAVE_GIT_REV_H "")
|
set(HAVE_GIT_REV_H "")
|
||||||
endif (IS_GIT_REPO)
|
endif (IS_GIT_REPO)
|
||||||
|
|
||||||
|
#--- instruct CMake to run moc automatically when needed ----------------------
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
#--- deal with the resources --------------------------------------------------
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
set(qt_libs Qt6::Core Qt6::Widgets Qt6::Svg Qt6::Xml)
|
set(qt_libs Qt6::Core Qt6::Widgets Qt6::Svg Qt6::Xml)
|
||||||
|
|
||||||
set(musrWiz_src
|
set(musrWiz_src
|
||||||
@ -18,34 +25,17 @@ set(musrWiz_src
|
|||||||
musrWiz.cpp
|
musrWiz.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# Instruct CMake to run moc automatically when needed
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
|
|
||||||
#[==[
|
|
||||||
# as35 currently CMAKE_AUTOUIC -> ON doesn't work since it requires the ui-files
|
|
||||||
# in the same directory as the cpp-files.
|
|
||||||
# Create code from a list of Qt designer ui files
|
|
||||||
set(CMAKE_AUTOUIC ON)
|
|
||||||
#]==]
|
|
||||||
set(CMAKE_AUTOUIC OFF)
|
|
||||||
|
|
||||||
# add qt/rcc
|
|
||||||
qt6_add_resources(musrWiz_rcc musrWiz.qrc)
|
|
||||||
|
|
||||||
# remove generated files from automoc and autouic
|
|
||||||
set_property(SOURCE qrc_musrWiz.cpp PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
|
|
||||||
set(macosx_icon icons/musrWiz.icns)
|
set(macosx_icon icons/musrWiz.icns)
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
add_executable(musrWiz MACOSX_BUNDLE
|
add_executable(musrWiz MACOSX_BUNDLE
|
||||||
${musrWiz_src}
|
${musrWiz_src}
|
||||||
${musrWiz_rcc}
|
musrWiz.qrc
|
||||||
${macosx_icon}
|
${macosx_icon}
|
||||||
)
|
)
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
add_executable(musrWiz
|
add_executable(musrWiz
|
||||||
${musrWiz_src}
|
${musrWiz_src}
|
||||||
${musrWiz_rcc}
|
musrWiz.qrc
|
||||||
)
|
)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
@ -63,7 +53,7 @@ target_compile_options(musrWiz
|
|||||||
"${HAVE_GIT_REV_H}"
|
"${HAVE_GIT_REV_H}"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(musrWiz ${qt_libs})
|
target_link_libraries(musrWiz PRIVATE ${qt_libs})
|
||||||
|
|
||||||
#--- installation info --------------------------------------------------------
|
#--- installation info --------------------------------------------------------
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
@ -96,7 +96,7 @@ bool PFuncXMLParser::parse(QIODevice *device)
|
|||||||
if (fXml.hasError()) {
|
if (fXml.hasError()) {
|
||||||
QString msg;
|
QString msg;
|
||||||
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
||||||
QMessageBox::critical(0, "**ERROR**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(nullptr, "ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ bool PFuncXMLParser::startElement()
|
|||||||
QXmlStreamAttributes qAttr = fXml.attributes();
|
QXmlStreamAttributes qAttr = fXml.attributes();
|
||||||
if (qAttr.count() != 2) {
|
if (qAttr.count() != 2) {
|
||||||
errMsg = QString("theo_map should have 2 attributes, called 'no', and 'name', found %1").arg(qAttr.count());
|
errMsg = QString("theo_map should have 2 attributes, called 'no', and 'name', found %1").arg(qAttr.count());
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
PParam map;
|
PParam map;
|
||||||
@ -149,7 +149,7 @@ bool PFuncXMLParser::startElement()
|
|||||||
ival = str.toInt(&ok);
|
ival = str.toInt(&ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
errMsg = QString("theo_map attribute 'no' is not a number (%1)").arg(str);
|
errMsg = QString("theo_map attribute 'no' is not a number (%1)").arg(str);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
map.setNumber(ival);
|
map.setNumber(ival);
|
||||||
@ -160,7 +160,7 @@ bool PFuncXMLParser::startElement()
|
|||||||
// check that all necessary attributes where found
|
// check that all necessary attributes where found
|
||||||
if ((map.getName() == "UnDef") || (map.getNumber() == -1)) {
|
if ((map.getName() == "UnDef") || (map.getNumber() == -1)) {
|
||||||
errMsg = QString("found theo_map with missing attribute(s)");
|
errMsg = QString("found theo_map with missing attribute(s)");
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
fTheoTemplate.appendMap(map);
|
fTheoTemplate.appendMap(map);
|
||||||
@ -168,7 +168,7 @@ bool PFuncXMLParser::startElement()
|
|||||||
QXmlStreamAttributes qAttr = fXml.attributes();
|
QXmlStreamAttributes qAttr = fXml.attributes();
|
||||||
if ((qAttr.count() != 4) && (qAttr.count() != 6)) {
|
if ((qAttr.count() != 4) && (qAttr.count() != 6)) {
|
||||||
errMsg = QString("template_param should have 4 or 6 attributes, called\n'no', 'name', 'value', 'step', ['boundLow', 'boundHigh'] found %1").arg(qAttr.count());
|
errMsg = QString("template_param should have 4 or 6 attributes, called\n'no', 'name', 'value', 'step', ['boundLow', 'boundHigh'] found %1").arg(qAttr.count());
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
PParam param;
|
PParam param;
|
||||||
@ -177,7 +177,7 @@ bool PFuncXMLParser::startElement()
|
|||||||
ival = str.toInt(&ok);
|
ival = str.toInt(&ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
errMsg = QString("template_param attribute 'no' is not a number (%1)").arg(str);
|
errMsg = QString("template_param attribute 'no' is not a number (%1)").arg(str);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
param.setNumber(ival);
|
param.setNumber(ival);
|
||||||
@ -189,7 +189,7 @@ bool PFuncXMLParser::startElement()
|
|||||||
dval = str.toDouble(&ok);
|
dval = str.toDouble(&ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
errMsg = QString("template_param attribute 'value' is not a number (%1)").arg(str);
|
errMsg = QString("template_param attribute 'value' is not a number (%1)").arg(str);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
param.setValue(dval);
|
param.setValue(dval);
|
||||||
@ -198,7 +198,7 @@ bool PFuncXMLParser::startElement()
|
|||||||
dval = str.toDouble(&ok);
|
dval = str.toDouble(&ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
errMsg = QString("template_param attribute 'step' is not a number (%1)").arg(str);
|
errMsg = QString("template_param attribute 'step' is not a number (%1)").arg(str);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
param.setStep(dval);
|
param.setStep(dval);
|
||||||
@ -378,7 +378,7 @@ bool PInstrumentDefXMLParser::parse(QIODevice *device)
|
|||||||
if (fXml.hasError()) {
|
if (fXml.hasError()) {
|
||||||
QString msg;
|
QString msg;
|
||||||
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
||||||
QMessageBox::critical(0, "**ERROR**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(nullptr, "ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -419,12 +419,12 @@ bool PInstrumentDefXMLParser::startElement()
|
|||||||
QXmlStreamAttributes qAttr = fXml.attributes();
|
QXmlStreamAttributes qAttr = fXml.attributes();
|
||||||
if (qAttr.count() != 1) {
|
if (qAttr.count() != 1) {
|
||||||
errMsg = QString("instrument should have 1 attribute, called 'name', found %1").arg(qAttr.count());
|
errMsg = QString("instrument should have 1 attribute, called 'name', found %1").arg(qAttr.count());
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (fInstituteName == "") {
|
if (fInstituteName == "") {
|
||||||
errMsg = QString("found instrument without institute set.");
|
errMsg = QString("found instrument without institute set.");
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// create an instrument object
|
// create an instrument object
|
||||||
@ -633,13 +633,13 @@ bool PInstrumentDefXMLParser::characters()
|
|||||||
case eNoOfDetectors:
|
case eNoOfDetectors:
|
||||||
if (fSetup == 0) {
|
if (fSetup == 0) {
|
||||||
errMsg = "setup object not found.";
|
errMsg = "setup object not found.";
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ival = str.toInt(&ok);
|
ival = str.toInt(&ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
errMsg = QString("Setup Error: No of Detectors = '%1', which is not an int.").arg(str);
|
errMsg = QString("Setup Error: No of Detectors = '%1', which is not an int.").arg(str);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
fSetup->setNoOfDetectors(ival);
|
fSetup->setNoOfDetectors(ival);
|
||||||
@ -664,7 +664,7 @@ bool PInstrumentDefXMLParser::characters()
|
|||||||
strList = str.split(' ', Qt::SkipEmptyParts);
|
strList = str.split(' ', Qt::SkipEmptyParts);
|
||||||
if (strList.size() != 2) {
|
if (strList.size() != 2) {
|
||||||
errMsg = QString("Found wrong Asymmetry background range: '%1'").arg(str);
|
errMsg = QString("Found wrong Asymmetry background range: '%1'").arg(str);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
start = strList[0].toInt(&ok);
|
start = strList[0].toInt(&ok);
|
||||||
@ -692,7 +692,7 @@ bool PInstrumentDefXMLParser::characters()
|
|||||||
bool PInstrumentDefXMLParser::endDocument()
|
bool PInstrumentDefXMLParser::endDocument()
|
||||||
{
|
{
|
||||||
if (fInstituteName == "") {
|
if (fInstituteName == "") {
|
||||||
QMessageBox::critical(0, "FATAL ERROR", "Didn't find any institute name in the instrument definitions.");
|
QMessageBox::critical(nullptr, "FATAL ERROR", "Didn't find any institute name in the instrument definitions.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,7 +765,7 @@ bool PMusrWizDefaultXMLParser::parse(QIODevice *device)
|
|||||||
if (fXml.hasError()) {
|
if (fXml.hasError()) {
|
||||||
QString msg;
|
QString msg;
|
||||||
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
||||||
QMessageBox::critical(0, "**ERROR**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(nullptr, "ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -876,7 +876,7 @@ PAdmin::PAdmin() : QObject()
|
|||||||
path = std::getenv("HOME");
|
path = std::getenv("HOME");
|
||||||
pathFln = path + "/.musrfit/musrWiz/musrWiz.xml";
|
pathFln = path + "/.musrfit/musrWiz/musrWiz.xml";
|
||||||
if (loadMusrWizDefault(pathFln)) {
|
if (loadMusrWizDefault(pathFln)) {
|
||||||
QMessageBox::warning(0, "WARNING", "Couldn't find musrWiz.xml file.");
|
QMessageBox::warning(nullptr, "WARNING", "Couldn't find musrWiz.xml file.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -889,7 +889,7 @@ PAdmin::PAdmin() : QObject()
|
|||||||
pathFln = path + "/.musrfit/musrWiz/musrfit_funcs.xml";
|
pathFln = path + "/.musrfit/musrWiz/musrfit_funcs.xml";
|
||||||
if (loadMusrfitFunc(pathFln)) {
|
if (loadMusrfitFunc(pathFln)) {
|
||||||
fValid = false;
|
fValid = false;
|
||||||
QMessageBox::critical(0, "FATAL ERROR", "Couldn't find any musrfit function definitions.");
|
QMessageBox::critical(nullptr, "FATAL ERROR", "Couldn't find any musrfit function definitions.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -918,7 +918,7 @@ PAdmin::PAdmin() : QObject()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
QMessageBox::critical(0, "FATAL ERROR", "Couldn't find any instrument definition.");
|
QMessageBox::critical(nullptr, "FATAL ERROR", "Couldn't find any instrument definition.");
|
||||||
fValid = false;
|
fValid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1215,7 +1215,7 @@ int PAdmin::loadMusrWizDefault(QString fln)
|
|||||||
cout << "**INFO** '" << pathName.toLatin1().data() << "' did not exist, hence it is created." << endl;
|
cout << "**INFO** '" << pathName.toLatin1().data() << "' did not exist, hence it is created." << endl;
|
||||||
} else {
|
} else {
|
||||||
QString msg = QString("Couldn't create '%1'. Please check.").arg(pathName);
|
QString msg = QString("Couldn't create '%1'. Please check.").arg(pathName);
|
||||||
QMessageBox::critical(0, "ERROR", msg);
|
QMessageBox::critical(nullptr, "ERROR", msg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1224,7 +1224,7 @@ int PAdmin::loadMusrWizDefault(QString fln)
|
|||||||
PMusrWizDefaultXMLParser handler(fln, this);
|
PMusrWizDefaultXMLParser handler(fln, this);
|
||||||
if (!handler.isValid()) {
|
if (!handler.isValid()) {
|
||||||
QString errMsg = QString("Error parsing %1 file.").arg(fln);
|
QString errMsg = QString("Error parsing %1 file.").arg(fln);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -1248,7 +1248,7 @@ int PAdmin::loadMusrfitFunc(QString fln)
|
|||||||
cout << "**INFO** '" << pathName.toLatin1().data() << "' did not exist, hence it is created." << endl;
|
cout << "**INFO** '" << pathName.toLatin1().data() << "' did not exist, hence it is created." << endl;
|
||||||
} else {
|
} else {
|
||||||
QString msg = QString("Couldn't create '%1'. Please check.").arg(pathName);
|
QString msg = QString("Couldn't create '%1'. Please check.").arg(pathName);
|
||||||
QMessageBox::critical(0, "ERROR", msg);
|
QMessageBox::critical(nullptr, "ERROR", msg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1257,7 +1257,7 @@ int PAdmin::loadMusrfitFunc(QString fln)
|
|||||||
PFuncXMLParser handler(fln, this);
|
PFuncXMLParser handler(fln, this);
|
||||||
if (!handler.isValid()) {
|
if (!handler.isValid()) {
|
||||||
QString errMsg = QString("Error parsing %1 musrfit func file.").arg(fln);
|
QString errMsg = QString("Error parsing %1 musrfit func file.").arg(fln);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -1286,7 +1286,7 @@ int PAdmin::loadInstrumentDef(QString path, QString fln)
|
|||||||
cout << "**INFO** '" << pathName.toLatin1().data() << "' did not exist, hence it is created." << endl;
|
cout << "**INFO** '" << pathName.toLatin1().data() << "' did not exist, hence it is created." << endl;
|
||||||
} else {
|
} else {
|
||||||
QString msg = QString("Couldn't create '%1'. Please check.").arg(pathName);
|
QString msg = QString("Couldn't create '%1'. Please check.").arg(pathName);
|
||||||
QMessageBox::critical(0, "ERROR", msg);
|
QMessageBox::critical(nullptr, "ERROR", msg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1297,7 +1297,7 @@ int PAdmin::loadInstrumentDef(QString path, QString fln)
|
|||||||
PInstrumentDefXMLParser handler(pathFln, this);
|
PInstrumentDefXMLParser handler(pathFln, this);
|
||||||
if (!handler.isValid()) {
|
if (!handler.isValid()) {
|
||||||
QString errMsg = QString("Error parsing %1 instrument def file.").arg(pathFln);
|
QString errMsg = QString("Error parsing %1 instrument def file.").arg(pathFln);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -553,7 +553,7 @@ void PIntroPage::handleFitType(int idx)
|
|||||||
{
|
{
|
||||||
if ( (idx != FIT_TYPE_SINGLE_HISTO) &&
|
if ( (idx != FIT_TYPE_SINGLE_HISTO) &&
|
||||||
(idx != FIT_TYPE_ASYMMETRY) ){
|
(idx != FIT_TYPE_ASYMMETRY) ){
|
||||||
QMessageBox::warning(0, "WARNING", "Currently only fit type: single histo and asymmetry available.");
|
QMessageBox::warning(this, "WARNING", "Currently only fit type: single histo and asymmetry available.");
|
||||||
fFitType->setCurrentIndex(FIT_TYPE_SINGLE_HISTO);
|
fFitType->setCurrentIndex(FIT_TYPE_SINGLE_HISTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -580,7 +580,7 @@ void PIntroPage::checkSetup(int idx)
|
|||||||
case MEASURE_LF:
|
case MEASURE_LF:
|
||||||
setup = instru->getLFSetups();
|
setup = instru->getLFSetups();
|
||||||
measure = "LF";
|
measure = "LF";
|
||||||
QMessageBox::information(0, "INFO", "Not yet implemented.");
|
QMessageBox::information(this, "INFO", "Not yet implemented.");
|
||||||
break;
|
break;
|
||||||
case MEASURE_UNDEF:
|
case MEASURE_UNDEF:
|
||||||
default:
|
default:
|
||||||
@ -589,7 +589,7 @@ void PIntroPage::checkSetup(int idx)
|
|||||||
|
|
||||||
if (setup.size() == 0) {
|
if (setup.size() == 0) {
|
||||||
QString msg = QString("Didn't find any setup for:\nInstitute: %1\nInstrument: %2").arg(fInstitute->currentText()).arg(fInstrument->currentText());
|
QString msg = QString("Didn't find any setup for:\nInstitute: %1\nInstrument: %2").arg(fInstitute->currentText()).arg(fInstrument->currentText());
|
||||||
QMessageBox::critical(0, "ERROR", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
} else if (setup.size() == 1) {
|
} else if (setup.size() == 1) {
|
||||||
if (setup[0].getName() == "Default") {
|
if (setup[0].getName() == "Default") {
|
||||||
@ -907,7 +907,7 @@ void PTheoPage::checkTheory()
|
|||||||
ok = analyzeTokens(line[i], 0);
|
ok = analyzeTokens(line[i], 0);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString str = QString("**ERROR** in line %1.\n funX takes no parameter.").arg(i+1);
|
QString str = QString("**ERROR** in line %1.\n funX takes no parameter.").arg(i+1);
|
||||||
QMessageBox::critical(0, "Check Theory", str);
|
QMessageBox::critical(this, "Check Theory", str);
|
||||||
// eventually it would be nice to highlight the faulty line
|
// eventually it would be nice to highlight the faulty line
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -915,7 +915,7 @@ void PTheoPage::checkTheory()
|
|||||||
ok = analyzeTokens(line[i], 0);
|
ok = analyzeTokens(line[i], 0);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString str = QString("**ERROR** in line %1.\n mapX takes no parameter.").arg(i+1);
|
QString str = QString("**ERROR** in line %1.\n mapX takes no parameter.").arg(i+1);
|
||||||
QMessageBox::critical(0, "Check Theory", str);
|
QMessageBox::critical(this, "Check Theory", str);
|
||||||
// eventually it would be nice to highlight the faulty line
|
// eventually it would be nice to highlight the faulty line
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -924,14 +924,14 @@ void PTheoPage::checkTheory()
|
|||||||
func = fAdmin->getMusrfitFunc(strList[0]);
|
func = fAdmin->getMusrfitFunc(strList[0]);
|
||||||
if (func.getName() == "UnDef") { // function not found
|
if (func.getName() == "UnDef") { // function not found
|
||||||
QString str = QString("**ERROR** in line %1, '%2' is not a recognized musrfit function.").arg(i+1).arg(line[i]);
|
QString str = QString("**ERROR** in line %1, '%2' is not a recognized musrfit function.").arg(i+1).arg(line[i]);
|
||||||
QMessageBox::critical(0, "Check Theory", str);
|
QMessageBox::critical(this, "Check Theory", str);
|
||||||
// eventually it would be nice to highlight the faulty line
|
// eventually it would be nice to highlight the faulty line
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ok = analyzeTokens(line[i], func.getNoOfParam());
|
ok = analyzeTokens(line[i], func.getNoOfParam());
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString str = QString("**ERROR** in line %1.\n %2 takes %3 parameter.").arg(i+1).arg(func.getName()).arg(func.getNoOfParam());
|
QString str = QString("**ERROR** in line %1.\n %2 takes %3 parameter.").arg(i+1).arg(func.getName()).arg(func.getNoOfParam());
|
||||||
QMessageBox::critical(0, "Check Theory", str);
|
QMessageBox::critical(this, "Check Theory", str);
|
||||||
// eventually it would be nice to highlight the faulty line
|
// eventually it would be nice to highlight the faulty line
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -952,7 +952,7 @@ void PTheoPage::checkTheory()
|
|||||||
|
|
||||||
QObject *obj = sender();
|
QObject *obj = sender();
|
||||||
if (obj == fCheckTheo)
|
if (obj == fCheckTheo)
|
||||||
QMessageBox::information(0, "Check Theory", "Theory seems to be OK.");
|
QMessageBox::information(this, "Check Theory", "Theory seems to be OK.");
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@ -1013,7 +1013,7 @@ bool PTheoPage::analyzeTokens(QString str, int noOfTokens)
|
|||||||
dealWithMap(tok[0], stokNo, 0);
|
dealWithMap(tok[0], stokNo, 0);
|
||||||
} else {
|
} else {
|
||||||
QString msg = QString("Found map of the form '%1'.\nThis is NOT a legal map!").arg(tok[0]);
|
QString msg = QString("Found map of the form '%1'.\nThis is NOT a legal map!").arg(tok[0]);
|
||||||
QMessageBox::critical(0, "analyzeTokens", msg);
|
QMessageBox::critical(this, "analyzeTokens", msg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (tok[0].startsWith("fun")) {
|
} else if (tok[0].startsWith("fun")) {
|
||||||
@ -1024,7 +1024,7 @@ bool PTheoPage::analyzeTokens(QString str, int noOfTokens)
|
|||||||
dealWithFun(stokNo);
|
dealWithFun(stokNo);
|
||||||
} else {
|
} else {
|
||||||
QString msg = QString("Found fun of the form '%1'.\nThis is NOT a legal function!").arg(tok[0]);
|
QString msg = QString("Found fun of the form '%1'.\nThis is NOT a legal function!").arg(tok[0]);
|
||||||
QMessageBox::critical(0, "analyzeTokens", msg);
|
QMessageBox::critical(this, "analyzeTokens", msg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1043,7 +1043,7 @@ bool PTheoPage::analyzeTokens(QString str, int noOfTokens)
|
|||||||
dealWithParam(tok[0], paramNo, i);
|
dealWithParam(tok[0], paramNo, i);
|
||||||
} else if (!tok[i].startsWith("map") && !tok[i].startsWith("fun")) {
|
} else if (!tok[i].startsWith("map") && !tok[i].startsWith("fun")) {
|
||||||
QString msg = QString("Found parameter of the form '%1'.\nThis is NOT a legal parameter!").arg(tok[i]);
|
QString msg = QString("Found parameter of the form '%1'.\nThis is NOT a legal parameter!").arg(tok[i]);
|
||||||
QMessageBox::critical(0, "analyzeTokens", msg);
|
QMessageBox::critical(this, "analyzeTokens", msg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1060,7 +1060,7 @@ bool PTheoPage::analyzeTokens(QString str, int noOfTokens)
|
|||||||
dealWithMap(tok[0], mapNo, i);
|
dealWithMap(tok[0], mapNo, i);
|
||||||
} else {
|
} else {
|
||||||
QString msg = QString("Found map of the form '%1'.\nThis is NOT a legal map!").arg(tok[i]);
|
QString msg = QString("Found map of the form '%1'.\nThis is NOT a legal map!").arg(tok[i]);
|
||||||
QMessageBox::critical(0, "analyzeTokens", msg);
|
QMessageBox::critical(this, "analyzeTokens", msg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1078,7 +1078,7 @@ bool PTheoPage::analyzeTokens(QString str, int noOfTokens)
|
|||||||
dealWithFun(funNo);
|
dealWithFun(funNo);
|
||||||
} else {
|
} else {
|
||||||
QString msg = QString("Found function of the form '%1'.\nThis is NOT a legal function!").arg(tok[i]);
|
QString msg = QString("Found function of the form '%1'.\nThis is NOT a legal function!").arg(tok[i]);
|
||||||
QMessageBox::critical(0, "analyzeTokens", msg);
|
QMessageBox::critical(this, "analyzeTokens", msg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2015,7 +2015,7 @@ int PMusrWiz::writeMsrFile(int result)
|
|||||||
// no msr-file name given, hence generate it
|
// no msr-file name given, hence generate it
|
||||||
if (fMsrData->getMsrFileName() == QString("")) {
|
if (fMsrData->getMsrFileName() == QString("")) {
|
||||||
if (fMsrData->getRunNumber() == -1) {
|
if (fMsrData->getRunNumber() == -1) {
|
||||||
QMessageBox::critical(0, "ERROR", "No run number given! Won't do anything.");
|
QMessageBox::critical(this, "ERROR", "No run number given! Won't do anything.");
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
fMsrData->setMsrFileName(QString("%1").arg(fMsrData->getRunNumber()));
|
fMsrData->setMsrFileName(QString("%1").arg(fMsrData->getRunNumber()));
|
||||||
@ -2062,7 +2062,7 @@ int PMusrWiz::writeMsrFileSingleHisto()
|
|||||||
QFile fln(pathFileName);
|
QFile fln(pathFileName);
|
||||||
|
|
||||||
if (!fln.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
if (!fln.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
QMessageBox::critical(0, "ERROR", "Cannot open file for writting.");
|
QMessageBox::critical(this, "ERROR", "Cannot open file for writting.");
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2104,7 +2104,7 @@ int PMusrWiz::writeMsrFileSingleHisto()
|
|||||||
PInstrument *instru = fAdmin->getInstrument(fMsrData->getInstitute(), fMsrData->getInstrument());
|
PInstrument *instru = fAdmin->getInstrument(fMsrData->getInstitute(), fMsrData->getInstrument());
|
||||||
if (instru == 0) {
|
if (instru == 0) {
|
||||||
QString msg = QString("No setups found for %1: %2").arg(fMsrData->getInstitute(), fMsrData->getInstrument());
|
QString msg = QString("No setups found for %1: %2").arg(fMsrData->getInstitute(), fMsrData->getInstrument());
|
||||||
QMessageBox::critical(0, "ERROR", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
PSetup *setup = 0;
|
PSetup *setup = 0;
|
||||||
@ -2124,7 +2124,7 @@ int PMusrWiz::writeMsrFileSingleHisto()
|
|||||||
}
|
}
|
||||||
if (setup == 0) {
|
if (setup == 0) {
|
||||||
QString msg = QString("No setups found for %1: %2: %3").arg(fMsrData->getInstitute(), fMsrData->getInstrument()).arg(fMsrData->getSetup());
|
QString msg = QString("No setups found for %1: %2: %3").arg(fMsrData->getInstitute(), fMsrData->getInstrument()).arg(fMsrData->getSetup());
|
||||||
QMessageBox::critical(0, "ERROR", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return -5;
|
return -5;
|
||||||
}
|
}
|
||||||
int noOfDetec = setup->getNoOfLogicalDetectors();
|
int noOfDetec = setup->getNoOfLogicalDetectors();
|
||||||
@ -2295,7 +2295,7 @@ int PMusrWiz::writeMsrFileAsymmetry()
|
|||||||
QFile fln(pathFileName);
|
QFile fln(pathFileName);
|
||||||
|
|
||||||
if (!fln.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
if (!fln.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
QMessageBox::critical(0, "ERROR", "Cannot open file for writting.");
|
QMessageBox::critical(this, "ERROR", "Cannot open file for writting.");
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2337,7 +2337,7 @@ int PMusrWiz::writeMsrFileAsymmetry()
|
|||||||
PInstrument *instru = fAdmin->getInstrument(fMsrData->getInstitute(), fMsrData->getInstrument());
|
PInstrument *instru = fAdmin->getInstrument(fMsrData->getInstitute(), fMsrData->getInstrument());
|
||||||
if (instru == 0) {
|
if (instru == 0) {
|
||||||
QString msg = QString("No setups found for %1: %2").arg(fMsrData->getInstitute(), fMsrData->getInstrument());
|
QString msg = QString("No setups found for %1: %2").arg(fMsrData->getInstitute(), fMsrData->getInstrument());
|
||||||
QMessageBox::critical(0, "ERROR", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
PSetup *setup = 0;
|
PSetup *setup = 0;
|
||||||
@ -2357,7 +2357,7 @@ int PMusrWiz::writeMsrFileAsymmetry()
|
|||||||
}
|
}
|
||||||
if (setup == 0) {
|
if (setup == 0) {
|
||||||
QString msg = QString("No setups found for %1: %2: %3").arg(fMsrData->getInstitute(), fMsrData->getInstrument()).arg(fMsrData->getSetup());
|
QString msg = QString("No setups found for %1: %2: %3").arg(fMsrData->getInstitute(), fMsrData->getInstrument()).arg(fMsrData->getSetup());
|
||||||
QMessageBox::critical(0, "ERROR", msg);
|
QMessageBox::critical(this, "ERROR", msg);
|
||||||
return -5;
|
return -5;
|
||||||
}
|
}
|
||||||
int noOfDetec = setup->getNoOfLogicalAsymDetectors();
|
int noOfDetec = setup->getNoOfLogicalAsymDetectors();
|
||||||
@ -2579,5 +2579,5 @@ QString PMusrWiz::getRunName(PInstrument *instru)
|
|||||||
*/
|
*/
|
||||||
void PMusrWiz::help()
|
void PMusrWiz::help()
|
||||||
{
|
{
|
||||||
QMessageBox::information(0, "Help", "Eventually there will be a help here.");
|
QMessageBox::information(this, "Help", "Eventually there will be a help here.");
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
|||||||
arguments << pathFln;
|
arguments << pathFln;
|
||||||
QProcess::startDetached(musrt0, arguments, "./");
|
QProcess::startDetached(musrt0, arguments, "./");
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::warning(0, "WARNING", "Couldn't find musrt0 :-(.\n Only the msr-file has been generated.");
|
QMessageBox::warning(nullptr, "WARNING", "Couldn't find musrt0 :-(.\n Only the msr-file has been generated.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#--- musredit for Qt > 6.0 ----------------------------------------------------
|
#--- musredit for Qt = 6.x ----------------------------------------------------
|
||||||
|
|
||||||
#--- check if project source is repo ------------------------------------------
|
#--- check if project source is repo ------------------------------------------
|
||||||
if (IS_GIT_REPO)
|
if (IS_GIT_REPO)
|
||||||
@ -7,6 +7,17 @@ else (IS_GIT_REPO)
|
|||||||
set(HAVE_GIT_REV_H "")
|
set(HAVE_GIT_REV_H "")
|
||||||
endif (IS_GIT_REPO)
|
endif (IS_GIT_REPO)
|
||||||
|
|
||||||
|
#--- instruct CMake to run moc automatically when needed ----------------------
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
#--- create code from a list of Qt designer ui files --------------------------
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
#--- add forms to the uic search path -----------------------------------------
|
||||||
|
set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/forms)
|
||||||
|
#--- deal with the resources --------------------------------------------------
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
set(qt_libs Qt6::Core Qt6::Widgets Qt6::Network Qt6::Xml Qt6::Svg Qt6::PrintSupport)
|
set(qt_libs Qt6::Core Qt6::Widgets Qt6::Network Qt6::Xml Qt6::Svg Qt6::PrintSupport)
|
||||||
|
|
||||||
set(musredit_src
|
set(musredit_src
|
||||||
@ -55,42 +66,6 @@ set(musredit_ui
|
|||||||
forms/PChangeDefaultPathsDialog.ui
|
forms/PChangeDefaultPathsDialog.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
# Instruct CMake to run moc automatically when needed
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
|
|
||||||
#[==[
|
|
||||||
# as35 currently CMAKE_AUTOUIC -> ON doesn't work since it requires the ui-files
|
|
||||||
# in the same directory as the cpp-files.
|
|
||||||
# Create code from a list of Qt designer ui files
|
|
||||||
set(CMAKE_AUTOUIC ON)
|
|
||||||
#]==]
|
|
||||||
set(CMAKE_AUTOUIC OFF)
|
|
||||||
|
|
||||||
# call qt/uic
|
|
||||||
qt6_wrap_ui(out_ui ${musredit_ui})
|
|
||||||
# add qt/rcc
|
|
||||||
qt6_add_resources(musredit_rcc musredit.qrc)
|
|
||||||
|
|
||||||
# remove generated files from automoc and autouic
|
|
||||||
set_property(SOURCE ui_PFindDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PReplaceDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PReplaceConfirmationDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PMusrEditAbout.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PPrefsDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PGetMusrFTOptionsDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PGetTitleBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PGetParameterBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PGetTheoryBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PGetFunctionsBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PGetAsymmetryRunBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PGetSingleHistoRunBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PGetNonMusrRunBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PGetFourierBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PGetPlotBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PMsr2DataDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE ui_PChangeDefaultPathsDialog.h PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
set_property(SOURCE qrc_musredit.cpp PROPERTY SKIP_AUTOMOC ON)
|
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
if (${CMAKE_HOST_SYSTEM_VERSION} GREATER_EQUAL "20.3.0")
|
if (${CMAKE_HOST_SYSTEM_VERSION} GREATER_EQUAL "20.3.0")
|
||||||
set(macosx_icon_name musredit-bigsur.icns)
|
set(macosx_icon_name musredit-bigsur.icns)
|
||||||
@ -100,15 +75,15 @@ if (APPLE)
|
|||||||
set(macosx_icon "icons/${macosx_icon_name}")
|
set(macosx_icon "icons/${macosx_icon_name}")
|
||||||
add_executable(musredit MACOSX_BUNDLE
|
add_executable(musredit MACOSX_BUNDLE
|
||||||
${musredit_src}
|
${musredit_src}
|
||||||
${out_ui}
|
${musredit_ui}
|
||||||
${musredit_rcc}
|
musredit.qrc
|
||||||
${macosx_icon}
|
${macosx_icon}
|
||||||
)
|
)
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
add_executable(musredit
|
add_executable(musredit
|
||||||
${musredit_src}
|
${musredit_src}
|
||||||
${out_ui}
|
${musredit_ui}
|
||||||
${musredit_rcc}
|
musredit.qrc
|
||||||
)
|
)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
@ -127,7 +102,7 @@ target_compile_options(musredit
|
|||||||
"${HAVE_GIT_REV_H}"
|
"${HAVE_GIT_REV_H}"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(musredit ${qt_libs})
|
target_link_libraries(musredit PRIVATE ${qt_libs})
|
||||||
|
|
||||||
#--- installation info --------------------------------------------------------
|
#--- installation info --------------------------------------------------------
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
@ -61,8 +61,12 @@ PAdminXMLParser::PAdminXMLParser(const QString& fln, PAdmin *admin) : fAdmin(adm
|
|||||||
fFunc = false;
|
fFunc = false;
|
||||||
|
|
||||||
QFile file(fln);
|
QFile file(fln);
|
||||||
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
if (!file.open(QFile::ReadOnly | QFile::Text) || (file.size()==0)) {
|
||||||
// warning and create default - STILL MISSING
|
// warning and create default
|
||||||
|
QMessageBox::StandardButton ret = QMessageBox::warning(nullptr, "WARNING", "The musredit_startup.xml is corrupted. Create a default one?", QMessageBox::Yes | QMessageBox::No);
|
||||||
|
if (ret == QMessageBox::Yes) {
|
||||||
|
fAdmin->createMusreditStartupFile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fValid = parse(&file);
|
fValid = parse(&file);
|
||||||
@ -100,7 +104,7 @@ bool PAdminXMLParser::parse(QIODevice *device)
|
|||||||
if (fXml.hasError()) {
|
if (fXml.hasError()) {
|
||||||
QString msg;
|
QString msg;
|
||||||
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
||||||
QMessageBox::critical(0, "**ERROR**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(nullptr, "ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -699,14 +703,14 @@ QString PAdminXMLParser::expandPath(const QString &str)
|
|||||||
token.remove('$');
|
token.remove('$');
|
||||||
if (!procEnv.contains(token)) {
|
if (!procEnv.contains(token)) {
|
||||||
msg = QString("Couldn't find '%1'. Some things might not work properly").arg(token);
|
msg = QString("Couldn't find '%1'. Some things might not work properly").arg(token);
|
||||||
QMessageBox::warning(0, "**WARNING**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::warning(nullptr, "WARNING", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
newStr = "";
|
newStr = "";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
path = procEnv.value(token, "");
|
path = procEnv.value(token, "");
|
||||||
if (path.isEmpty()) {
|
if (path.isEmpty()) {
|
||||||
msg = QString("Couldn't expand '%1'. Some things might not work properly").arg(token);
|
msg = QString("Couldn't expand '%1'. Some things might not work properly").arg(token);
|
||||||
QMessageBox::warning(0, "**WARNING**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::warning(nullptr, "WARNING", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
newStr = "";
|
newStr = "";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -807,9 +811,9 @@ PAdmin::PAdmin() : QObject()
|
|||||||
QFileInfo info(str);
|
QFileInfo info(str);
|
||||||
if (info.exists()) {
|
if (info.exists()) {
|
||||||
if (!info.isExecutable())
|
if (!info.isExecutable())
|
||||||
QMessageBox::critical(0, "ERROR", "musrfit found but not recognized as executable.\nPlease check!");
|
QMessageBox::critical(nullptr, "ERROR", "musrfit found but not recognized as executable.\nPlease check!");
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(0, "ERROR", "musrfit not found.\nHave you set the necessary system variables properly?\nPlease check the manual.\nBefore you can use musrfit, this needs to be fixed.");
|
QMessageBox::critical(nullptr, "ERROR", "musrfit not found.\nHave you set the necessary system variables properly?\nPlease check the manual.\nBefore you can use musrfit, this needs to be fixed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if system variables are set properly
|
// check if system variables are set properly
|
||||||
@ -827,7 +831,7 @@ PAdmin::PAdmin() : QObject()
|
|||||||
}
|
}
|
||||||
if (sysVarMissing) {
|
if (sysVarMissing) {
|
||||||
msg += "Please set this/these system variables.";
|
msg += "Please set this/these system variables.";
|
||||||
QMessageBox::warning(0, "WARNING", msg);
|
QMessageBox::warning(nullptr, "WARNING", msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -907,13 +911,13 @@ int PAdmin::loadPrefs(QString fln)
|
|||||||
if (QFile::exists(fln)) { // administration file present
|
if (QFile::exists(fln)) { // administration file present
|
||||||
PAdminXMLParser handler(fln, this);
|
PAdminXMLParser handler(fln, this);
|
||||||
if (!handler.isValid()) {
|
if (!handler.isValid()) {
|
||||||
QMessageBox::critical(0, "**ERROR**",
|
QMessageBox::critical(nullptr, "ERROR",
|
||||||
"Error parsing musredit_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
"Error parsing musredit_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(0, "**ERROR**",
|
QMessageBox::critical(nullptr, "ERROR",
|
||||||
"Couldn't find the musredit_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
"Couldn't find the musredit_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1042,7 +1046,7 @@ int PAdmin::savePrefs(QString pref_fln)
|
|||||||
file.close();
|
file.close();
|
||||||
} else {
|
} else {
|
||||||
QString msg("Failed to write musredit_startup.xml. Neither a local nor a global copy found.");
|
QString msg("Failed to write musredit_startup.xml. Neither a local nor a global copy found.");
|
||||||
QMessageBox::warning(0, "WARNING", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::warning(nullptr, "WARNING", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -1132,7 +1136,7 @@ void PAdmin::saveRecentFiles()
|
|||||||
file.close();
|
file.close();
|
||||||
} else {
|
} else {
|
||||||
QString msg("Failed to write musredit_startup.xml. Neither a local nor a global copy found.");
|
QString msg("Failed to write musredit_startup.xml. Neither a local nor a global copy found.");
|
||||||
QMessageBox::warning(0, "WARNING", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::warning(nullptr, "WARNING", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1161,13 +1165,13 @@ void PAdmin::createMusreditStartupFile()
|
|||||||
QFile fres(":/musredit_startup.xml.in");
|
QFile fres(":/musredit_startup.xml.in");
|
||||||
if (!fres.exists()) {
|
if (!fres.exists()) {
|
||||||
QString msg = QString("Neither couldn't find nor create musredit_startup.xml. Things are likely not to work.");
|
QString msg = QString("Neither couldn't find nor create musredit_startup.xml. Things are likely not to work.");
|
||||||
QMessageBox::critical(0, "ERROR", msg);
|
QMessageBox::critical(nullptr, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fres.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (!fres.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
QString msg = QString("Couldn't open internal resource file musredit_startup.xml.in. Things are likely not to work.");
|
QString msg = QString("Couldn't open internal resource file musredit_startup.xml.in. Things are likely not to work.");
|
||||||
QMessageBox::critical(0, "ERROR", msg);
|
QMessageBox::critical(nullptr, "ERROR", msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// text stream for fres
|
// text stream for fres
|
||||||
|
@ -92,7 +92,7 @@ bool PDefaultPathsXMLParser::parse(QIODevice *device)
|
|||||||
if (fXml.hasError()) {
|
if (fXml.hasError()) {
|
||||||
QString msg;
|
QString msg;
|
||||||
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
||||||
QMessageBox::critical(0, "**ERROR**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(nullptr, "ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ PDefaultPaths::PDefaultPaths() : QObject()
|
|||||||
PDefaultPathsXMLParser handler(fPrefPathName, this);
|
PDefaultPathsXMLParser handler(fPrefPathName, this);
|
||||||
if (!handler.isValid()) {
|
if (!handler.isValid()) {
|
||||||
fValid = false;
|
fValid = false;
|
||||||
QMessageBox::critical(0, "ERROR",
|
QMessageBox::critical(nullptr, "ERROR",
|
||||||
"Error parsing musrfit_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
"Error parsing musrfit_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
|
@ -83,10 +83,7 @@ PDumpOutputHandler::PDumpOutputHandler(QVector<QString> &cmd)
|
|||||||
if ( !fProc->waitForStarted() ) {
|
if ( !fProc->waitForStarted() ) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( 0,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
done(0);
|
done(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,10 +87,7 @@ PFitOutputHandler::PFitOutputHandler(QString workingDirectory, QVector<QString>
|
|||||||
if ( !fProc->waitForStarted() ) {
|
if ( !fProc->waitForStarted() ) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
done(0);
|
done(0);
|
||||||
}
|
}
|
||||||
fProcPID = fProc->processId();
|
fProcPID = fProc->processId();
|
||||||
|
@ -282,15 +282,12 @@ QString PGetAsymmetryRunBlockDialog::getPacking(bool &present)
|
|||||||
void PGetAsymmetryRunBlockDialog::helpContent()
|
void PGetAsymmetryRunBlockDialog::helpContent()
|
||||||
{
|
{
|
||||||
if (fHelpUrl.isEmpty()) {
|
if (fHelpUrl.isEmpty()) {
|
||||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
QMessageBox::information(this, "INFO", "Will eventually show a help window");
|
||||||
} else {
|
} else {
|
||||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal Error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,118 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
|
|
||||||
PGetDefaultDialog.cpp
|
|
||||||
|
|
||||||
Author: Andreas Suter
|
|
||||||
e-mail: andreas.suter@psi.ch
|
|
||||||
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
* Copyright (C) 2009-2021 by Andreas Suter *
|
|
||||||
* andreas.suter@psi.ch *
|
|
||||||
* *
|
|
||||||
* This program 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. *
|
|
||||||
* *
|
|
||||||
* This program 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 this program; if not, write to the *
|
|
||||||
* Free Software Foundation, Inc., *
|
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QComboBox>
|
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
#include "PHelp.h"
|
|
||||||
|
|
||||||
#include "PGetDefaultDialog.h"
|
|
||||||
|
|
||||||
#define INSTITUTE_PSI 0
|
|
||||||
#define INSTITUTE_RAL 1
|
|
||||||
#define INSTITUTE_TRIUMF 2
|
|
||||||
#define INSTITUTE_JPARC 3
|
|
||||||
|
|
||||||
#define FILE_FORMAT_NEXUS 0
|
|
||||||
#define FILE_FORMAT_ROOT_NPP 1
|
|
||||||
#define FILE_FORMAT_ROOT_PPC 2
|
|
||||||
#define FILE_FORMAT_PSIBIN 3
|
|
||||||
#define FILE_FORMAT_MUD 4
|
|
||||||
#define FILE_FORMAT_WKM 5
|
|
||||||
#define FILE_FORMAT_ASCII 6
|
|
||||||
#define FILE_FORMAT_DB 7
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Constructor
|
|
||||||
*
|
|
||||||
* \param helpUrl help url for the default dialog
|
|
||||||
*/
|
|
||||||
PGetDefaultDialog::PGetDefaultDialog(const QString helpUrl) : fHelpUrl(helpUrl)
|
|
||||||
{
|
|
||||||
setupUi(this);
|
|
||||||
|
|
||||||
setModal(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Finds the name of the institute in the combo box and selects it.
|
|
||||||
*
|
|
||||||
* \param str name of the institute
|
|
||||||
*/
|
|
||||||
void PGetDefaultDialog::setInstitute(const QString &str) {
|
|
||||||
|
|
||||||
for (int i=0; i<fInstitute_comboBox->count(); i++) {
|
|
||||||
if (fInstitute_comboBox->itemText(i).toLower() == str.toLower()) {
|
|
||||||
fInstitute_comboBox->setCurrentIndex(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Finds the file format in the combo box and selects it.
|
|
||||||
*
|
|
||||||
* \param str file format
|
|
||||||
*/
|
|
||||||
void PGetDefaultDialog::setFileFormat(const QString &str)
|
|
||||||
{
|
|
||||||
|
|
||||||
for (int i=0; i<fFileFormat_comboBox->count(); i++) {
|
|
||||||
if (fFileFormat_comboBox->itemText(i).toLower() == str.toLower()) {
|
|
||||||
fFileFormat_comboBox->setCurrentIndex(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Generates a help content window showing the description fitting the default dialog.
|
|
||||||
*/
|
|
||||||
void PGetDefaultDialog::helpContent()
|
|
||||||
{
|
|
||||||
#ifdef _WIN32GCC
|
|
||||||
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
|
|
||||||
#else
|
|
||||||
PHelp *help = new PHelp(fHelpUrl);
|
|
||||||
help->show();
|
|
||||||
#endif // _WIN32GCC
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
// END
|
|
||||||
//---------------------------------------------------------------------------
|
|
@ -1,69 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
|
|
||||||
PGetDefaultDialog.h
|
|
||||||
|
|
||||||
Author: Andreas Suter
|
|
||||||
e-mail: andreas.suter@psi.ch
|
|
||||||
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
* Copyright (C) 2010-2021 by Andreas Suter *
|
|
||||||
* andreas.suter@psi.ch *
|
|
||||||
* *
|
|
||||||
* This program 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. *
|
|
||||||
* *
|
|
||||||
* This program 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 this program; if not, write to the *
|
|
||||||
* Free Software Foundation, Inc., *
|
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
#ifndef _PGETDEFAULTDIALOG_H_
|
|
||||||
#define _PGETDEFAULTDIALOG_H_
|
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QLineEdit>
|
|
||||||
#include <QComboBox>
|
|
||||||
|
|
||||||
#include "ui_PGetDefaultDialog.h"
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Handels the default dialog which is used to generate a default asymmetry or
|
|
||||||
* single histogram msr input file.
|
|
||||||
*/
|
|
||||||
class PGetDefaultDialog : public QDialog, private Ui::PGetDefaultDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
PGetDefaultDialog(const QString helpUrl = "");
|
|
||||||
virtual ~PGetDefaultDialog() {}
|
|
||||||
|
|
||||||
virtual const QString getRunFileName() const { return fRunFileName_lineEdit->text(); }
|
|
||||||
virtual const QString getBeamline() const { return fBeamline_lineEdit->text(); }
|
|
||||||
virtual const QString getInstitute() const { return fInstitute_comboBox->currentText(); }
|
|
||||||
virtual const QString getFileFormat() const { return fFileFormat_comboBox->currentText(); }
|
|
||||||
|
|
||||||
virtual void setBeamline(const QString &str) { fBeamline_lineEdit->setText(str); }
|
|
||||||
virtual void setInstitute(const QString &str);
|
|
||||||
virtual void setFileFormat(const QString &str);
|
|
||||||
|
|
||||||
protected slots:
|
|
||||||
virtual void helpContent();
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString fHelpUrl; ///< help url for the default dialog
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // _PGETDEFAULTDIALOG_H_
|
|
@ -82,14 +82,14 @@ void PGetFourierBlockDialog::checkPhaseParameter()
|
|||||||
ival = str.toInt(&ok);
|
ival = str.toInt(&ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
fPhase_lineEdit->clear();
|
fPhase_lineEdit->clear();
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"Allowed phase entries are either a parameter number,\n or an parXX entry, where XX is a parameter number",
|
"Allowed phase entries are either a parameter number,\n or an parXX entry, where XX is a parameter number",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
fPhase_lineEdit->setFocus();
|
fPhase_lineEdit->setFocus();
|
||||||
}
|
}
|
||||||
} else { // neither a parXX nor a number
|
} else { // neither a parXX nor a number
|
||||||
fPhase_lineEdit->clear();
|
fPhase_lineEdit->clear();
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"Allowed phase entries are either a parameter number,\n or an parXX entry, where XX is a parameter number",
|
"Allowed phase entries are either a parameter number,\n or an parXX entry, where XX is a parameter number",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
fPhase_lineEdit->setFocus();
|
fPhase_lineEdit->setFocus();
|
||||||
@ -130,15 +130,12 @@ void PGetFourierBlockDialog::fillFourierBlock()
|
|||||||
void PGetFourierBlockDialog::helpContent()
|
void PGetFourierBlockDialog::helpContent()
|
||||||
{
|
{
|
||||||
if (fHelpUrl.isEmpty()) {
|
if (fHelpUrl.isEmpty()) {
|
||||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
QMessageBox::information(this, "INFO", "Will eventually show a help window");
|
||||||
} else {
|
} else {
|
||||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal Error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,15 +106,12 @@ void PGetFunctionsBlockDialog::addFunction()
|
|||||||
void PGetFunctionsBlockDialog::helpContent()
|
void PGetFunctionsBlockDialog::helpContent()
|
||||||
{
|
{
|
||||||
if (fHelpUrl.isEmpty()) {
|
if (fHelpUrl.isEmpty()) {
|
||||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
QMessageBox::information(this, "INFO", "Will eventually show a help window");
|
||||||
} else {
|
} else {
|
||||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal Error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -585,15 +585,12 @@ void PGetMusrFTOptionsDialog::averagedPerDataSet(int state)
|
|||||||
void PGetMusrFTOptionsDialog::helpContent()
|
void PGetMusrFTOptionsDialog::helpContent()
|
||||||
{
|
{
|
||||||
if (fHelpUrl.isEmpty()) {
|
if (fHelpUrl.isEmpty()) {
|
||||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
QMessageBox::information(this, "INFO", "Will eventually show a help window");
|
||||||
} else {
|
} else {
|
||||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal Error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,15 +155,12 @@ QString PGetNonMusrRunBlockDialog::getFitRange(bool &valid)
|
|||||||
void PGetNonMusrRunBlockDialog::helpContent()
|
void PGetNonMusrRunBlockDialog::helpContent()
|
||||||
{
|
{
|
||||||
if (fHelpUrl.isEmpty()) {
|
if (fHelpUrl.isEmpty()) {
|
||||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
QMessageBox::information(this, "INFO", "Will eventually show a help window");
|
||||||
} else {
|
} else {
|
||||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal Error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ void PGetParameterBlockDialog::paramAdd()
|
|||||||
// get name
|
// get name
|
||||||
str = fName_lineEdit->text();
|
str = fName_lineEdit->text();
|
||||||
if (str.isEmpty()) {
|
if (str.isEmpty()) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"empty parameter name not allowed!",
|
"empty parameter name not allowed!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
@ -120,7 +120,7 @@ void PGetParameterBlockDialog::paramAdd()
|
|||||||
// get value
|
// get value
|
||||||
str = fValue_lineEdit->text();
|
str = fValue_lineEdit->text();
|
||||||
if (str.isEmpty()) {
|
if (str.isEmpty()) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"empty parameter value not allowed!",
|
"empty parameter value not allowed!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
@ -135,7 +135,7 @@ void PGetParameterBlockDialog::paramAdd()
|
|||||||
// get step
|
// get step
|
||||||
str = fStep_lineEdit->text();
|
str = fStep_lineEdit->text();
|
||||||
if (str.isEmpty()) {
|
if (str.isEmpty()) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"empty parameter step not allowed!",
|
"empty parameter step not allowed!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
@ -156,7 +156,7 @@ void PGetParameterBlockDialog::paramAdd()
|
|||||||
bool ok;
|
bool ok;
|
||||||
double val = str.toDouble(&ok);
|
double val = str.toDouble(&ok);
|
||||||
if (!ok && (str != "none")) {
|
if (!ok && (str != "none")) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"invalid lower boundary! Must be a double are the key word 'none'",
|
"invalid lower boundary! Must be a double are the key word 'none'",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
@ -172,7 +172,7 @@ void PGetParameterBlockDialog::paramAdd()
|
|||||||
str = fUpper_lineEdit->text();
|
str = fUpper_lineEdit->text();
|
||||||
val = str.toDouble(&ok);
|
val = str.toDouble(&ok);
|
||||||
if (!ok && (str != "none")) {
|
if (!ok && (str != "none")) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"invalid upper boundary! Must be a double are the key word 'none'",
|
"invalid upper boundary! Must be a double are the key word 'none'",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
@ -218,15 +218,12 @@ void PGetParameterBlockDialog::paramAdd()
|
|||||||
void PGetParameterBlockDialog::helpContent()
|
void PGetParameterBlockDialog::helpContent()
|
||||||
{
|
{
|
||||||
if (fHelpUrl.isEmpty()) {
|
if (fHelpUrl.isEmpty()) {
|
||||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
QMessageBox::information(this, "INFO", "Will eventually show a help window");
|
||||||
} else {
|
} else {
|
||||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal Error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ void PGetPlotBlockDialog::addPlot()
|
|||||||
// lower x-/time range
|
// lower x-/time range
|
||||||
str = fXRangeLow_lineEdit->text();
|
str = fXRangeLow_lineEdit->text();
|
||||||
if (str.isEmpty()) {
|
if (str.isEmpty()) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"empty lower time-/x-range name not allowed!",
|
"empty lower time-/x-range name not allowed!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
@ -111,7 +111,7 @@ void PGetPlotBlockDialog::addPlot()
|
|||||||
// upper x-/time range
|
// upper x-/time range
|
||||||
str = fXRangeUp_lineEdit->text();
|
str = fXRangeUp_lineEdit->text();
|
||||||
if (str.isEmpty()) {
|
if (str.isEmpty()) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"empty upper time-/x-range name not allowed!",
|
"empty upper time-/x-range name not allowed!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
@ -125,7 +125,7 @@ void PGetPlotBlockDialog::addPlot()
|
|||||||
// check y-range: either none given or both
|
// check y-range: either none given or both
|
||||||
if ((fYRangeLow_lineEdit->text().isEmpty() && !fYRangeUp_lineEdit->text().isEmpty()) ||
|
if ((fYRangeLow_lineEdit->text().isEmpty() && !fYRangeUp_lineEdit->text().isEmpty()) ||
|
||||||
(!fYRangeLow_lineEdit->text().isEmpty() && fYRangeUp_lineEdit->text().isEmpty())) {
|
(!fYRangeLow_lineEdit->text().isEmpty() && fYRangeUp_lineEdit->text().isEmpty())) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"Only fully empty y-range, or give lower AND upper y-range is acceptable!\n Will ignore the y-range",
|
"Only fully empty y-range, or give lower AND upper y-range is acceptable!\n Will ignore the y-range",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
} else if (!fYRangeLow_lineEdit->text().isEmpty() && !fYRangeUp_lineEdit->text().isEmpty()) {
|
} else if (!fYRangeLow_lineEdit->text().isEmpty() && !fYRangeUp_lineEdit->text().isEmpty()) {
|
||||||
@ -159,15 +159,12 @@ void PGetPlotBlockDialog::addPlot()
|
|||||||
void PGetPlotBlockDialog::helpContent()
|
void PGetPlotBlockDialog::helpContent()
|
||||||
{
|
{
|
||||||
if (fHelpUrl.isEmpty()) {
|
if (fHelpUrl.isEmpty()) {
|
||||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
QMessageBox::information(this, "INFO", "Will eventually show a help window");
|
||||||
} else {
|
} else {
|
||||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal Error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,15 +281,12 @@ QString PGetSingleHistoRunBlockDialog::getLifetimeCorrection(bool &present)
|
|||||||
void PGetSingleHistoRunBlockDialog::helpContent()
|
void PGetSingleHistoRunBlockDialog::helpContent()
|
||||||
{
|
{
|
||||||
if (fHelpUrl.isEmpty()) {
|
if (fHelpUrl.isEmpty()) {
|
||||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
QMessageBox::information(this, "INFO", "Will eventually show a help window");
|
||||||
} else {
|
} else {
|
||||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal Error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,15 +125,12 @@ void PGetTheoryBlockDialog::addMultiply()
|
|||||||
void PGetTheoryBlockDialog::helpContent()
|
void PGetTheoryBlockDialog::helpContent()
|
||||||
{
|
{
|
||||||
if (fHelpUrl.isEmpty()) {
|
if (fHelpUrl.isEmpty()) {
|
||||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
QMessageBox::information(this, "INFO", "Will eventually show a help window");
|
||||||
} else {
|
} else {
|
||||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal Error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,15 +53,12 @@ PGetTitleBlockDialog::PGetTitleBlockDialog(const QString helpUrl) : fHelpUrl(hel
|
|||||||
void PGetTitleBlockDialog::helpContent()
|
void PGetTitleBlockDialog::helpContent()
|
||||||
{
|
{
|
||||||
if (fHelpUrl.isEmpty()) {
|
if (fHelpUrl.isEmpty()) {
|
||||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
QMessageBox::information(this, "INFO", "Will eventually show a help window");
|
||||||
} else {
|
} else {
|
||||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal Error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,15 +222,12 @@ void PMsr2DataDialog::fitOnlyChanged(int buttonState)
|
|||||||
void PMsr2DataDialog::helpContent()
|
void PMsr2DataDialog::helpContent()
|
||||||
{
|
{
|
||||||
if (fHelpUrl.isEmpty()) {
|
if (fHelpUrl.isEmpty()) {
|
||||||
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
|
QMessageBox::information(this, "INFO", "Will eventually show a help window");
|
||||||
} else {
|
} else {
|
||||||
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
bool ok = QDesktopServices::openUrl(QUrl(fHelpUrl, QUrl::TolerantMode));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fHelpUrl);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal Error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ void PSubTextEdit::insertAsymRunBlock()
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
str += workStr;
|
str += workStr;
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"Given map not valid, will add a default map line",
|
"Given map not valid, will add a default map line",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
str += "map 0 0 0 0 0 0 0 0 0 0\n";
|
str += "map 0 0 0 0 0 0 0 0 0 0\n";
|
||||||
@ -268,7 +268,7 @@ void PSubTextEdit::insertAsymRunBlock()
|
|||||||
workStr = dlg->getBackground(valid);
|
workStr = dlg->getBackground(valid);
|
||||||
str += workStr;
|
str += workStr;
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"Either <b>background</b> or <b>backgr.fix</b> is needed!\nWill set <b>background</b> to 0..10, please correct!",
|
"Either <b>background</b> or <b>backgr.fix</b> is needed!\nWill set <b>background</b> to 0..10, please correct!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
@ -278,7 +278,7 @@ void PSubTextEdit::insertAsymRunBlock()
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
str += workStr;
|
str += workStr;
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"Not all Data entries are present.Fix is needed!\nWill not set anything!",
|
"Not all Data entries are present.Fix is needed!\nWill not set anything!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
@ -288,7 +288,7 @@ void PSubTextEdit::insertAsymRunBlock()
|
|||||||
if (present) {
|
if (present) {
|
||||||
str += workStr;
|
str += workStr;
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::warning(this, "**ERROR**",
|
QMessageBox::warning(this, "ERROR",
|
||||||
"T0's not given, assume that they are present in the data file!",
|
"T0's not given, assume that they are present in the data file!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
@ -297,7 +297,7 @@ void PSubTextEdit::insertAsymRunBlock()
|
|||||||
workStr = dlg->getFitRange(valid);
|
workStr = dlg->getFitRange(valid);
|
||||||
str += workStr;
|
str += workStr;
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"No valid fit range is given.Fix is needed!\nWill add a default one!",
|
"No valid fit range is given.Fix is needed!\nWill add a default one!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
@ -306,7 +306,7 @@ void PSubTextEdit::insertAsymRunBlock()
|
|||||||
workStr = dlg->getPacking(present);
|
workStr = dlg->getPacking(present);
|
||||||
str += workStr;
|
str += workStr;
|
||||||
if (!present) {
|
if (!present) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"No valid packing/binning is given.Fix is needed!\nWill add a default one!",
|
"No valid packing/binning is given.Fix is needed!\nWill add a default one!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
@ -347,7 +347,7 @@ void PSubTextEdit::insertSingleHistRunBlock()
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
str += workStr;
|
str += workStr;
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"Given map not valid, will add a default map line",
|
"Given map not valid, will add a default map line",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
str += "map 0 0 0 0 0 0 0 0 0 0\n";
|
str += "map 0 0 0 0 0 0 0 0 0 0\n";
|
||||||
@ -375,7 +375,7 @@ void PSubTextEdit::insertSingleHistRunBlock()
|
|||||||
workStr = dlg->getBackground(valid);
|
workStr = dlg->getBackground(valid);
|
||||||
str += workStr;
|
str += workStr;
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"Either <b>background</b>, <b>backgr.fix</b>, or <b>backgr.fit</b> is needed!\nWill set <b>background</b> to 0..10, please correct!",
|
"Either <b>background</b>, <b>backgr.fix</b>, or <b>backgr.fit</b> is needed!\nWill set <b>background</b> to 0..10, please correct!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
@ -385,7 +385,7 @@ void PSubTextEdit::insertSingleHistRunBlock()
|
|||||||
if (present) {
|
if (present) {
|
||||||
str += workStr;
|
str += workStr;
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::warning(this, "**ERROR**",
|
QMessageBox::warning(this, "ERROR",
|
||||||
"T0's not given, assume that they are present in the data file!",
|
"T0's not given, assume that they are present in the data file!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
@ -395,7 +395,7 @@ void PSubTextEdit::insertSingleHistRunBlock()
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
str += workStr;
|
str += workStr;
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"Not all Data entries are present.Fix is needed!\nWill not set anything!",
|
"Not all Data entries are present.Fix is needed!\nWill not set anything!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
@ -404,7 +404,7 @@ void PSubTextEdit::insertSingleHistRunBlock()
|
|||||||
workStr = dlg->getFitRange(valid);
|
workStr = dlg->getFitRange(valid);
|
||||||
str += workStr;
|
str += workStr;
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"No valid fit range is given.Fix is needed!\nWill add a default one!",
|
"No valid fit range is given.Fix is needed!\nWill add a default one!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
@ -413,7 +413,7 @@ void PSubTextEdit::insertSingleHistRunBlock()
|
|||||||
workStr = dlg->getPacking(present);
|
workStr = dlg->getPacking(present);
|
||||||
str += workStr;
|
str += workStr;
|
||||||
if (!present) {
|
if (!present) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"No valid packing/binning is given.Fix is needed!\nWill add a default one!",
|
"No valid packing/binning is given.Fix is needed!\nWill add a default one!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
@ -453,7 +453,7 @@ void PSubTextEdit::insertNonMusrRunBlock()
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
str += workStr;
|
str += workStr;
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"Given map not valid, will add a default map line",
|
"Given map not valid, will add a default map line",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
str += "map 0 0 0 0 0 0 0 0 0 0\n";
|
str += "map 0 0 0 0 0 0 0 0 0 0\n";
|
||||||
@ -464,7 +464,7 @@ void PSubTextEdit::insertNonMusrRunBlock()
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
str += workStr;
|
str += workStr;
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"Not all xy-data entries are present.Fix is needed!\nWill not set anything!",
|
"Not all xy-data entries are present.Fix is needed!\nWill not set anything!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
@ -473,7 +473,7 @@ void PSubTextEdit::insertNonMusrRunBlock()
|
|||||||
workStr = dlg->getFitRange(valid);
|
workStr = dlg->getFitRange(valid);
|
||||||
str += workStr;
|
str += workStr;
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"No valid fit range is given.Fix is needed!\nWill add a default one!",
|
"No valid fit range is given.Fix is needed!\nWill add a default one!",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ PTextEdit::PTextEdit( QWidget *parent )
|
|||||||
fFileSystemWatcherActive = true;
|
fFileSystemWatcherActive = true;
|
||||||
fFileSystemWatcher = new QFileSystemWatcher();
|
fFileSystemWatcher = new QFileSystemWatcher();
|
||||||
if (fFileSystemWatcher == nullptr) {
|
if (fFileSystemWatcher == nullptr) {
|
||||||
QMessageBox::information(this, "**ERROR**", "Couldn't invoke QFileSystemWatcher!");
|
QMessageBox::information(this, "ERROR", "Couldn't invoke QFileSystemWatcher!");
|
||||||
} else {
|
} else {
|
||||||
connect( fFileSystemWatcher, SIGNAL(fileChanged(const QString&)), this, SLOT(fileChanged(const QString&)));
|
connect( fFileSystemWatcher, SIGNAL(fileChanged(const QString&)), this, SLOT(fileChanged(const QString&)));
|
||||||
}
|
}
|
||||||
@ -1280,7 +1280,7 @@ void PTextEdit::fileOpenRecent()
|
|||||||
void PTextEdit::fileReload()
|
void PTextEdit::fileReload()
|
||||||
{
|
{
|
||||||
if ( fFilenames.find( currentEditor() ) == fFilenames.end() ) {
|
if ( fFilenames.find( currentEditor() ) == fFilenames.end() ) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Cannot reload a file not previously saved ;-)");
|
QMessageBox::critical(this, "ERROR", "Cannot reload a file not previously saved ;-)");
|
||||||
} else {
|
} else {
|
||||||
int index = fTabWidget->currentIndex();
|
int index = fTabWidget->currentIndex();
|
||||||
QString fln = *fFilenames.find( currentEditor() );
|
QString fln = *fFilenames.find( currentEditor() );
|
||||||
@ -1308,7 +1308,7 @@ void PTextEdit::fileOpenPrefs()
|
|||||||
} else if (result == 0) { // default dir
|
} else if (result == 0) { // default dir
|
||||||
fln = fAdmin->getDefaultPrefPathName();
|
fln = fAdmin->getDefaultPrefPathName();
|
||||||
msg = QString("Current Default Preferences Path-Name:\n") + fln;
|
msg = QString("Current Default Preferences Path-Name:\n") + fln;
|
||||||
if (QMessageBox::information(this, "Info", msg, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel)
|
if (QMessageBox::information(this, "INFO", msg, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel)
|
||||||
return;
|
return;
|
||||||
} else if (result == 1) { // custom dir
|
} else if (result == 1) { // custom dir
|
||||||
fln = QFileDialog::getOpenFileName( this, tr("Open Prefs"),
|
fln = QFileDialog::getOpenFileName( this, tr("Open Prefs"),
|
||||||
@ -1318,7 +1318,7 @@ void PTextEdit::fileOpenPrefs()
|
|||||||
|
|
||||||
if (fAdmin->loadPrefs(fln)) {
|
if (fAdmin->loadPrefs(fln)) {
|
||||||
msg = QString("Prefs from '") + fln + QString("' loaded.");
|
msg = QString("Prefs from '") + fln + QString("' loaded.");
|
||||||
QMessageBox::information(nullptr, "Info", msg);
|
QMessageBox::information(nullptr, "INFO", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure that dark/plain icon scheme is properly loaded
|
// make sure that dark/plain icon scheme is properly loaded
|
||||||
@ -1354,7 +1354,7 @@ void PTextEdit::fileSave()
|
|||||||
} else {
|
} else {
|
||||||
QFile file( *fFilenames.find( currentEditor() ) );
|
QFile file( *fFilenames.find( currentEditor() ) );
|
||||||
if ( !file.open( QIODevice::WriteOnly ) ) {
|
if ( !file.open( QIODevice::WriteOnly ) ) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Couldn't save the file!\nDisk full?\nNo write access?");
|
QMessageBox::critical(this, "ERROR", "Couldn't save the file!\nDisk full?\nNo write access?");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QTextStream ts( &file );
|
QTextStream ts( &file );
|
||||||
@ -1411,7 +1411,7 @@ void PTextEdit::fileSavePrefs()
|
|||||||
} else if (result == 0) { // default dir
|
} else if (result == 0) { // default dir
|
||||||
fln = fAdmin->getDefaultPrefPathName();
|
fln = fAdmin->getDefaultPrefPathName();
|
||||||
msg = QString("Current Default Preferences Path-Name:\n") + fln;
|
msg = QString("Current Default Preferences Path-Name:\n") + fln;
|
||||||
if (QMessageBox::information(this, "Info", msg, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel)
|
if (QMessageBox::information(this, "INFO", msg, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel)
|
||||||
return;
|
return;
|
||||||
} else if (result == 1) { // custom dir
|
} else if (result == 1) { // custom dir
|
||||||
fln = QFileDialog::getSaveFileName( this,
|
fln = QFileDialog::getSaveFileName( this,
|
||||||
@ -1422,7 +1422,7 @@ void PTextEdit::fileSavePrefs()
|
|||||||
if ( !fln.isEmpty() ) {
|
if ( !fln.isEmpty() ) {
|
||||||
fAdmin->savePrefs(fln);
|
fAdmin->savePrefs(fln);
|
||||||
msg = QString("Prefs to '") + fln + QString("' saved.");
|
msg = QString("Prefs to '") + fln + QString("' saved.");
|
||||||
QMessageBox::information(nullptr, "Info", msg);
|
QMessageBox::information(nullptr, "INFO", msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1515,10 +1515,10 @@ void PTextEdit::fileClose(const bool check)
|
|||||||
int idx = fTabWidget->currentIndex();
|
int idx = fTabWidget->currentIndex();
|
||||||
|
|
||||||
if ((fTabWidget->tabText(idx).indexOf("*")>0) && check) {
|
if ((fTabWidget->tabText(idx).indexOf("*")>0) && check) {
|
||||||
int result = QMessageBox::warning(this, "**WARNING**",
|
int result = QMessageBox::warning(this, "WARNING",
|
||||||
"Do you really want to close this file.\nChanges will be lost",
|
"Do you really want to close this file.\nChanges will be lost",
|
||||||
"Close", "Cancel");
|
QMessageBox::Close, QMessageBox::Cancel);
|
||||||
if (result == 1) // Cancel
|
if (result == QMessageBox::Cancel)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1545,10 +1545,10 @@ void PTextEdit::fileCloseAll()
|
|||||||
// check if there are any unsaved tabs
|
// check if there are any unsaved tabs
|
||||||
for (int i=0; i<fTabWidget->count(); i++) {
|
for (int i=0; i<fTabWidget->count(); i++) {
|
||||||
if (fTabWidget->tabText(i).indexOf("*") > 0) {
|
if (fTabWidget->tabText(i).indexOf("*") > 0) {
|
||||||
int result = QMessageBox::warning(this, "**WARNING**",
|
int result = QMessageBox::warning(this, "WARNING",
|
||||||
"Do you really want to close all files.\nChanges of unsaved files will be lost",
|
"Do you really want to close all files.\nChanges of unsaved files will be lost",
|
||||||
"Close", "Cancel");
|
QMessageBox::Close, QMessageBox::Cancel);
|
||||||
if (result == 1) // Cancel
|
if (result == QMessageBox::Cancel)
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1582,10 +1582,10 @@ void PTextEdit::fileCloseAllOthers()
|
|||||||
// check if there are any unsaved tabs
|
// check if there are any unsaved tabs
|
||||||
for (int i=0; i<fTabWidget->count(); i++) {
|
for (int i=0; i<fTabWidget->count(); i++) {
|
||||||
if (fTabWidget->tabText(i).indexOf("*") > 0) {
|
if (fTabWidget->tabText(i).indexOf("*") > 0) {
|
||||||
int result = QMessageBox::warning(this, "**WARNING**",
|
int result = QMessageBox::warning(this, "WARNING",
|
||||||
"Do you really want to close all files.\nChanges of unsaved files will be lost",
|
"Do you really want to close all files.\nChanges of unsaved files will be lost",
|
||||||
"Close", "Cancel");
|
QMessageBox::Close, QMessageBox::Cancel);
|
||||||
if (result == 1) // Cancel
|
if (result == QMessageBox::Cancel)
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1625,10 +1625,10 @@ void PTextEdit::fileExit()
|
|||||||
// check if there are still some modified files open
|
// check if there are still some modified files open
|
||||||
for (int i=0; i < fTabWidget->count(); i++) {
|
for (int i=0; i < fTabWidget->count(); i++) {
|
||||||
if (fTabWidget->tabText(i).indexOf("*") > 0) {
|
if (fTabWidget->tabText(i).indexOf("*") > 0) {
|
||||||
int result = QMessageBox::warning(this, "**WARNING**",
|
int result = QMessageBox::warning(this, "WARNING",
|
||||||
"Do you really want to exit from the applcation.\nChanges will be lost",
|
"Do you really want to exit from the applcation.\nChanges will be lost",
|
||||||
"Exit", "Cancel");
|
QMessageBox::Close, QMessageBox::Cancel);
|
||||||
if (result == 1) // Cancel
|
if (result == QMessageBox::Cancel)
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1726,13 +1726,13 @@ void PTextEdit::editFind()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fFindReplaceData == nullptr) {
|
if (fFindReplaceData == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke find data structure, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(this, "ERROR", "Couldn't invoke find data structure, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PFindDialog *dlg = new PFindDialog(fFindReplaceData, currentEditor()->textCursor().hasSelection());
|
PFindDialog *dlg = new PFindDialog(fFindReplaceData, currentEditor()->textCursor().hasSelection());
|
||||||
if (dlg == nullptr) {
|
if (dlg == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke find dialog, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(this, "ERROR", "Couldn't invoke find dialog, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1818,13 +1818,13 @@ void PTextEdit::editFindAndReplace()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fFindReplaceData == nullptr) {
|
if (fFindReplaceData == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke find&replace data structure, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(this, "ERROR", "Couldn't invoke find&replace data structure, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PReplaceDialog *dlg = new PReplaceDialog(fFindReplaceData, currentEditor()->textCursor().hasSelection());
|
PReplaceDialog *dlg = new PReplaceDialog(fFindReplaceData, currentEditor()->textCursor().hasSelection());
|
||||||
if (dlg == nullptr) {
|
if (dlg == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke find&replace dialog, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(this, "ERROR", "Couldn't invoke find&replace dialog, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1998,7 +1998,7 @@ void PTextEdit::musrWiz()
|
|||||||
|
|
||||||
QProcess *proc = new QProcess(this);
|
QProcess *proc = new QProcess(this);
|
||||||
if (proc == nullptr) {
|
if (proc == nullptr) {
|
||||||
QMessageBox::critical(nullptr, "**ERROR**", "Couldn't invoke QProcess!");
|
QMessageBox::critical(nullptr, "ERROR", "Couldn't invoke QProcess!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2019,10 +2019,7 @@ void PTextEdit::musrWiz()
|
|||||||
if (!proc->waitForStarted()) {
|
if (!proc->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2044,7 +2041,7 @@ void PTextEdit::musrCalcChisq()
|
|||||||
|
|
||||||
QString tabLabel = fTabWidget->tabText(fTabWidget->currentIndex());
|
QString tabLabel = fTabWidget->tabText(fTabWidget->currentIndex());
|
||||||
if (tabLabel == "noname") {
|
if (tabLabel == "noname") {
|
||||||
QMessageBox::critical(this, "**ERROR**", "For a fit a real msr-file is needed.");
|
QMessageBox::critical(this, "ERROR", "For a fit a real msr-file is needed.");
|
||||||
return;
|
return;
|
||||||
} else if (tabLabel == "noname*") {
|
} else if (tabLabel == "noname*") {
|
||||||
fileSaveAs();
|
fileSaveAs();
|
||||||
@ -2077,7 +2074,7 @@ void PTextEdit::musrFit()
|
|||||||
|
|
||||||
QString tabLabel = fTabWidget->tabText(fTabWidget->currentIndex());
|
QString tabLabel = fTabWidget->tabText(fTabWidget->currentIndex());
|
||||||
if (tabLabel == "noname") {
|
if (tabLabel == "noname") {
|
||||||
QMessageBox::critical(this, "**ERROR**", "For a fit a real msr-file is needed.");
|
QMessageBox::critical(this, "ERROR", "For a fit a real msr-file is needed.");
|
||||||
return;
|
return;
|
||||||
} else if (tabLabel == "noname*") {
|
} else if (tabLabel == "noname*") {
|
||||||
fileSaveAs();
|
fileSaveAs();
|
||||||
@ -2196,7 +2193,7 @@ void PTextEdit::musrMsr2Data()
|
|||||||
PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam, fAdmin->getHelpUrl("msr2data"));
|
PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam, fAdmin->getHelpUrl("msr2data"));
|
||||||
|
|
||||||
if (dlg == nullptr) {
|
if (dlg == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke msr2data dialog, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(this, "ERROR", "Couldn't invoke msr2data dialog, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2218,7 +2215,7 @@ void PTextEdit::musrMsr2Data()
|
|||||||
// analyze parameters
|
// analyze parameters
|
||||||
switch (dlg->getRunTag()) {
|
switch (dlg->getRunTag()) {
|
||||||
case -1: // not valid
|
case -1: // not valid
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"No valid run list input found :-(\nCannot do anything.",
|
"No valid run list input found :-(\nCannot do anything.",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
@ -2231,13 +2228,13 @@ void PTextEdit::musrMsr2Data()
|
|||||||
fi.setFile(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + runListFileName);
|
fi.setFile(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + runListFileName);
|
||||||
if (!fi.exists()) {
|
if (!fi.exists()) {
|
||||||
str = QString("Run List File '%1' doesn't exist.").arg(runListFileName);
|
str = QString("Run List File '%1' doesn't exist.").arg(runListFileName);
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
str, QMessageBox::Ok, QMessageBox::NoButton);
|
str, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: // never should reach this point
|
default: // never should reach this point
|
||||||
QMessageBox::critical(this, "**ERROR**",
|
QMessageBox::critical(this, "ERROR",
|
||||||
"No idea how you could reach this point.\nPlease contact the developers.",
|
"No idea how you could reach this point.\nPlease contact the developers.",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
@ -2428,7 +2425,7 @@ void PTextEdit::musrMsr2Data()
|
|||||||
file = new QFile(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + fMsr2DataParam->runListFileName);
|
file = new QFile(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + fMsr2DataParam->runListFileName);
|
||||||
if (!file->open(QIODevice::ReadOnly)) {
|
if (!file->open(QIODevice::ReadOnly)) {
|
||||||
str = QString("Couldn't open run list file %1, sorry.").arg(fMsr2DataParam->runListFileName);
|
str = QString("Couldn't open run list file %1, sorry.").arg(fMsr2DataParam->runListFileName);
|
||||||
QMessageBox::critical(this, "**ERROR**", str.toLatin1(), QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(this, "ERROR", str.toLatin1(), QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2478,7 +2475,7 @@ void PTextEdit::musrMsr2Data()
|
|||||||
file = new QFile(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + fMsr2DataParam->runListFileName);
|
file = new QFile(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + fMsr2DataParam->runListFileName);
|
||||||
if (!file->open(QIODevice::ReadOnly)) {
|
if (!file->open(QIODevice::ReadOnly)) {
|
||||||
str = QString("Couldn't open run list file %1, sorry.").arg(fMsr2DataParam->runListFileName);
|
str = QString("Couldn't open run list file %1, sorry.").arg(fMsr2DataParam->runListFileName);
|
||||||
QMessageBox::critical(this, "**ERROR**", str.toLatin1(), QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(this, "ERROR", str.toLatin1(), QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2526,7 +2523,7 @@ void PTextEdit::musrView()
|
|||||||
|
|
||||||
QString tabLabel = fTabWidget->tabText(fTabWidget->currentIndex());
|
QString tabLabel = fTabWidget->tabText(fTabWidget->currentIndex());
|
||||||
if (tabLabel == "noname") {
|
if (tabLabel == "noname") {
|
||||||
QMessageBox::critical(this, "**ERROR**", "For a view a real mlog/msr-file is needed.");
|
QMessageBox::critical(this, "ERROR", "For a view a real mlog/msr-file is needed.");
|
||||||
return;
|
return;
|
||||||
} else if (tabLabel == "noname*") {
|
} else if (tabLabel == "noname*") {
|
||||||
fileSaveAs();
|
fileSaveAs();
|
||||||
@ -2578,10 +2575,7 @@ void PTextEdit::musrView()
|
|||||||
if (!proc->waitForStarted()) {
|
if (!proc->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2599,7 +2593,7 @@ void PTextEdit::musrViewFinished(int exitCode, QProcess::ExitStatus)
|
|||||||
msg += QString("* cannot read data-file.\n");
|
msg += QString("* cannot read data-file.\n");
|
||||||
msg += QString("* many more things can go wrong.\n");
|
msg += QString("* many more things can go wrong.\n");
|
||||||
msg += QString("Please check!");
|
msg += QString("Please check!");
|
||||||
QMessageBox::critical(nullptr, tr("Fatal Error"), msg, tr("Quit"));
|
QMessageBox::critical(nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2614,7 +2608,7 @@ void PTextEdit::musrT0()
|
|||||||
|
|
||||||
QString tabLabel = fTabWidget->tabText(fTabWidget->currentIndex());
|
QString tabLabel = fTabWidget->tabText(fTabWidget->currentIndex());
|
||||||
if (tabLabel == "noname") {
|
if (tabLabel == "noname") {
|
||||||
QMessageBox::critical(this, "**ERROR**", "For a view a real mlog/msr-file is needed.");
|
QMessageBox::critical(this, "ERROR", "For a view a real mlog/msr-file is needed.");
|
||||||
return;
|
return;
|
||||||
} else if (tabLabel == "noname*") {
|
} else if (tabLabel == "noname*") {
|
||||||
fileSaveAs();
|
fileSaveAs();
|
||||||
@ -2653,10 +2647,7 @@ void PTextEdit::musrT0()
|
|||||||
if (!proc->waitForStarted()) {
|
if (!proc->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2672,7 +2663,7 @@ void PTextEdit::musrFT()
|
|||||||
PGetMusrFTOptionsDialog *dlg = new PGetMusrFTOptionsDialog(*fFilenames.find( currentEditor() ), fMusrFTPrevCmd, fAdmin->getHelpUrl("musrFT"));
|
PGetMusrFTOptionsDialog *dlg = new PGetMusrFTOptionsDialog(*fFilenames.find( currentEditor() ), fMusrFTPrevCmd, fAdmin->getHelpUrl("musrFT"));
|
||||||
|
|
||||||
if (dlg == nullptr) {
|
if (dlg == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR** musrFT", "Couldn't invoke musrFT Options Dialog.");
|
QMessageBox::critical(this, "ERROR musrFT", "Couldn't invoke musrFT Options Dialog.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2693,10 +2684,7 @@ void PTextEdit::musrFT()
|
|||||||
if (!proc->waitForStarted()) {
|
if (!proc->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2714,7 +2702,7 @@ void PTextEdit::musrPrefs()
|
|||||||
PPrefsDialog *dlg = new PPrefsDialog(fAdmin);
|
PPrefsDialog *dlg = new PPrefsDialog(fAdmin);
|
||||||
|
|
||||||
if (dlg == nullptr) {
|
if (dlg == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR** musrPrefs", "Couldn't invoke Preferences Dialog.");
|
QMessageBox::critical(this, "ERROR musrPrefs", "Couldn't invoke Preferences Dialog.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2770,7 +2758,7 @@ void PTextEdit::musrSetSteps()
|
|||||||
// make sure I have a saved msr-file to work on
|
// make sure I have a saved msr-file to work on
|
||||||
QString tabLabel = fTabWidget->tabText(fTabWidget->currentIndex());
|
QString tabLabel = fTabWidget->tabText(fTabWidget->currentIndex());
|
||||||
if (tabLabel == "noname") {
|
if (tabLabel == "noname") {
|
||||||
QMessageBox::critical(this, "**ERROR**", "For musrStep a real mlog/msr-file is needed.");
|
QMessageBox::critical(this, "ERROR", "For musrStep a real mlog/msr-file is needed.");
|
||||||
return;
|
return;
|
||||||
} else if (tabLabel == "noname*") {
|
} else if (tabLabel == "noname*") {
|
||||||
fileSaveAs();
|
fileSaveAs();
|
||||||
@ -2796,7 +2784,7 @@ void PTextEdit::musrSetSteps()
|
|||||||
|
|
||||||
QProcess *proc = new QProcess(this);
|
QProcess *proc = new QProcess(this);
|
||||||
if (proc == nullptr) {
|
if (proc == nullptr) {
|
||||||
QMessageBox::critical(nullptr, "**ERROR**", "Couldn't invoke QProcess!");
|
QMessageBox::critical(nullptr, "ERROR", "Couldn't invoke QProcess!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2817,10 +2805,7 @@ void PTextEdit::musrSetSteps()
|
|||||||
if (!proc->waitForStarted()) {
|
if (!proc->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2984,10 +2969,7 @@ void PTextEdit::mupp()
|
|||||||
if (!proc->waitForStarted()) {
|
if (!proc->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd);
|
QString msg(tr("Could not execute the output command: ")+cmd);
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3001,10 +2983,7 @@ void PTextEdit::helpContents()
|
|||||||
bool ok = QDesktopServices::openUrl(QUrl(fAdmin->getHelpUrl("main"), QUrl::TolerantMode));
|
bool ok = QDesktopServices::openUrl(QUrl(fAdmin->getHelpUrl("main"), QUrl::TolerantMode));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fAdmin->getHelpUrl("main"));
|
QString msg = QString("<p>Sorry: Couldn't open default web-browser for the help.<br>Please try: <a href=\"%1\">musrfit docu</a> in your web-browser.").arg(fAdmin->getHelpUrl("main"));
|
||||||
QMessageBox::critical( nullptr,
|
QMessageBox::critical( nullptr, tr("FATAL ERROR"), msg, QMessageBox::Close );
|
||||||
tr("Fatal Error"),
|
|
||||||
msg,
|
|
||||||
tr("Quit") );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3037,7 +3016,7 @@ void PTextEdit::helpAboutQt()
|
|||||||
void PTextEdit::exitStatusMusrWiz(int exitCode, QProcess::ExitStatus exitStatus)
|
void PTextEdit::exitStatusMusrWiz(int exitCode, QProcess::ExitStatus exitStatus)
|
||||||
{
|
{
|
||||||
if (exitStatus == QProcess::CrashExit) {
|
if (exitStatus == QProcess::CrashExit) {
|
||||||
QMessageBox::critical(nullptr, "**FATAL**", "musrWiz returned CrashExit.");
|
QMessageBox::critical(nullptr, "FATAL ERROR", "musrWiz returned CrashExit.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3053,7 +3032,7 @@ void PTextEdit::exitStatusMusrWiz(int exitCode, QProcess::ExitStatus exitStatus)
|
|||||||
std::ifstream fin(pathName.toLatin1().data(), std::ifstream::in);
|
std::ifstream fin(pathName.toLatin1().data(), std::ifstream::in);
|
||||||
if (!fin.is_open()) {
|
if (!fin.is_open()) {
|
||||||
errMsg = QString("PTextEdit::exitStatusMusrWiz: couldn't read %1 file.").arg(pathName);
|
errMsg = QString("PTextEdit::exitStatusMusrWiz: couldn't read %1 file.").arg(pathName);
|
||||||
QMessageBox::critical(nullptr, "**ERROR**", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
char line[128];
|
char line[128];
|
||||||
@ -3088,7 +3067,7 @@ void PTextEdit::exitStatusMusrWiz(int exitCode, QProcess::ExitStatus exitStatus)
|
|||||||
QFile logFile(pathName);
|
QFile logFile(pathName);
|
||||||
if (!logFile.remove()) {
|
if (!logFile.remove()) {
|
||||||
errMsg = QString("PTextEdit::exitStatusMusrWiz: couldn't delete %1 file.").arg(pathName);
|
errMsg = QString("PTextEdit::exitStatusMusrWiz: couldn't delete %1 file.").arg(pathName);
|
||||||
QMessageBox::critical(nullptr, "**ERROR**", errMsg);
|
QMessageBox::critical(nullptr, "ERROR", errMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3101,7 +3080,7 @@ void PTextEdit::exitStatusMusrWiz(int exitCode, QProcess::ExitStatus exitStatus)
|
|||||||
void PTextEdit::exitStatusMusrSetSteps(int exitCode, QProcess::ExitStatus exitStatus)
|
void PTextEdit::exitStatusMusrSetSteps(int exitCode, QProcess::ExitStatus exitStatus)
|
||||||
{
|
{
|
||||||
if (exitStatus == QProcess::CrashExit) {
|
if (exitStatus == QProcess::CrashExit) {
|
||||||
QMessageBox::critical(nullptr, "**FATAL**", "musrStep returned CrashExit.");
|
QMessageBox::critical(nullptr, "FATAL ERROR", "musrStep returned CrashExit.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3260,7 +3239,7 @@ void PTextEdit::fileChanged(const QString &fileName)
|
|||||||
fFileSystemWatcherActive = false;
|
fFileSystemWatcherActive = false;
|
||||||
|
|
||||||
QString str = "File '" + fileName + "' changed on the system.\nDo you want to reload it?";
|
QString str = "File '" + fileName + "' changed on the system.\nDo you want to reload it?";
|
||||||
int result = QMessageBox::question(this, "**INFO**", str, QMessageBox::Yes, QMessageBox::No);
|
int result = QMessageBox::question(this, "INFO", str, QMessageBox::Yes, QMessageBox::No);
|
||||||
if (result == QMessageBox::Yes) {
|
if (result == QMessageBox::Yes) {
|
||||||
// find correct file
|
// find correct file
|
||||||
int idx = -1;
|
int idx = -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user