Resolve CMakeLists tab/spaces; add non-blocking action dialog for common user requests.

This commit is contained in:
Charles J. Cliffe 2016-12-23 18:45:25 -05:00
parent 2085d0f2c9
commit 02a876272f
10 changed files with 952 additions and 364 deletions

View File

@ -77,9 +77,9 @@ ADD_DEFINITIONS(
-DENABLE_DIGITAL_LAB=1
)
IF(MSVC)
SET (ENABLE_LIQUID_EXPERIMENTAL OFF CACHE BOOL "Enable experimental liquid-dsp features (requires latest liquid-dsp installed)")
SET (ENABLE_LIQUID_EXPERIMENTAL OFF CACHE BOOL "Enable experimental liquid-dsp features (requires latest liquid-dsp installed)")
ELSE()
SET (ENABLE_LIQUID_EXPERIMENTAL ON CACHE BOOL "Enable experimental liquid-dsp features (requires latest liquid-dsp installed)")
SET (ENABLE_LIQUID_EXPERIMENTAL ON CACHE BOOL "Enable experimental liquid-dsp features (requires latest liquid-dsp installed)")
ENDIF()
IF(ENABLE_LIQUID_EXPERIMENTAL)
ADD_DEFINITIONS(
@ -100,7 +100,7 @@ if (USE_HAMLIB)
include_directories(${HAMLIB_INCLUDE_DIR})
link_libraries(${HAMLIB_LIBRARY})
ADD_DEFINITIONS(-DUSE_HAMLIB)
ADD_DEFINITIONS(-DUSE_HAMLIB)
endif ()
macro(configure_files srcDir destDir globStr)
@ -153,16 +153,16 @@ SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}/${EX_PLATFORM_NA
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}/${EX_PLATFORM_NAME})
IF (MSVC)
include_directories ("${PROJECT_SOURCE_DIR}/external/wglext")
SET(LIQUID_INCLUDES "${PROJECT_SOURCE_DIR}/external/liquid-dsp/include/" CACHE STRING "Liquid-DSP include directory")
SET(LIQUID_LIBRARIES "${PROJECT_SOURCE_DIR}/external/liquid-dsp/msvc/${EX_PLATFORM}/libliquid.lib" CACHE STRING "Liquid-DSP Library")
SET(LIQUID_DLL "${PROJECT_SOURCE_DIR}/external/liquid-dsp/msvc/${EX_PLATFORM}/libliquid.dll" CACHE STRING "Liquid-DSP DLL")
SET(HAMLIB_DLLS "${PROJECT_SOURCE_DIR}/external/hamlib/${EX_PLATFORM}/libhamlib-2.dll;${PROJECT_SOURCE_DIR}/external/hamlib/${EX_PLATFORM}/libwinpthread-1.dll" CACHE STRING "HAMLIB DLLS")
include_directories ("${PROJECT_SOURCE_DIR}/external/wglext")
SET(LIQUID_INCLUDES "${PROJECT_SOURCE_DIR}/external/liquid-dsp/include/" CACHE STRING "Liquid-DSP include directory")
SET(LIQUID_LIBRARIES "${PROJECT_SOURCE_DIR}/external/liquid-dsp/msvc/${EX_PLATFORM}/libliquid.lib" CACHE STRING "Liquid-DSP Library")
SET(LIQUID_DLL "${PROJECT_SOURCE_DIR}/external/liquid-dsp/msvc/${EX_PLATFORM}/libliquid.dll" CACHE STRING "Liquid-DSP DLL")
SET(HAMLIB_DLLS "${PROJECT_SOURCE_DIR}/external/hamlib/${EX_PLATFORM}/libhamlib-2.dll;${PROJECT_SOURCE_DIR}/external/hamlib/${EX_PLATFORM}/libwinpthread-1.dll" CACHE STRING "HAMLIB DLLS")
ELSE (MSVC)
ADD_DEFINITIONS(
-std=c++0x
-pthread
)
ADD_DEFINITIONS(
-std=c++0x
-pthread
)
ENDIF(MSVC)
find_package(OpenGL REQUIRED)
@ -178,50 +178,50 @@ find_package(SoapySDR "0.4.0" NO_MODULE REQUIRED)
include_directories(${SOAPY_SDR_INCLUDE_DIR})
SET(OTHER_LIBRARIES ${SOAPY_SDR_LIBRARY} ${OTHER_LIBRARIES})
ADD_DEFINITIONS(
-DUSE_SOAPY_SDR=1
-DUSE_SOAPY_SDR=1
)
IF (WIN32)
set(wxWidgets_USE_STATIC ON)
set(wxWidgets_USE_STATIC ON)
set(BUILD_INSTALLER OFF CACHE BOOL "Build Installer")
# Audio device selection is not mandatory, dummy audio device is used if none are compiled in.
# Can also compile support for more than one simultaneously.
set(USE_AUDIO_DS ON CACHE BOOL "Include support for DirectSound")
set(USE_AUDIO_WASAPI OFF CACHE BOOL "Include support for WASAPI Audio")
# TODO:
# set(USE_AUDIO_ASIO OFF CACHE BOOL "Include support for ASIO Audio")
set(BUILD_INSTALLER OFF CACHE BOOL "Build Installer")
# Audio device selection is not mandatory, dummy audio device is used if none are compiled in.
# Can also compile support for more than one simultaneously.
set(USE_AUDIO_DS ON CACHE BOOL "Include support for DirectSound")
set(USE_AUDIO_WASAPI OFF CACHE BOOL "Include support for WASAPI Audio")
# TODO:
# set(USE_AUDIO_ASIO OFF CACHE BOOL "Include support for ASIO Audio")
# WASAPI
IF(USE_AUDIO_WASAPI)
ADD_DEFINITIONS(-D__WINDOWS_WASAPI__)
IF (NOT MSVC)
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} -luuid -lksuser)
ENDIF(NOT MSVC)
ENDIF(USE_AUDIO_WASAPI)
# WASAPI
IF(USE_AUDIO_WASAPI)
ADD_DEFINITIONS(-D__WINDOWS_WASAPI__)
IF (NOT MSVC)
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} -luuid -lksuser)
ENDIF(NOT MSVC)
ENDIF(USE_AUDIO_WASAPI)
# DirectSound
IF (USE_AUDIO_DS)
ADD_DEFINITIONS(-D__WINDOWS_DS__)
IF (MSVC)
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} dsound.lib)
ELSE (MSVC)
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} -ldsound)
ENDIF (MSVC)
ENDIF(USE_AUDIO_DS)
# DirectSound
IF (USE_AUDIO_DS)
ADD_DEFINITIONS(-D__WINDOWS_DS__)
IF (MSVC)
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} dsound.lib)
ELSE (MSVC)
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} -ldsound)
ENDIF (MSVC)
ENDIF(USE_AUDIO_DS)
SET(USE_MINGW_PATCH OFF CACHE BOOL "Add some missing functions when compiling against mingw liquid-dsp.")
IF (USE_MINGW_PATCH)
SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} legacy_stdio_definitions.lib libgcc.a")
ADD_DEFINITIONS(
-DMINGW_PATCH=1
)
SET (GCC_LINKDIR "" CACHE STRING "")
IF (GCC_LINKDIR)
link_directories("${GCC_LINKDIR}")
ENDIF()
ENDIF()
SET(USE_MINGW_PATCH OFF CACHE BOOL "Add some missing functions when compiling against mingw liquid-dsp.")
IF (USE_MINGW_PATCH)
SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} legacy_stdio_definitions.lib libgcc.a")
ADD_DEFINITIONS(
-DMINGW_PATCH=1
)
SET (GCC_LINKDIR "" CACHE STRING "")
IF (GCC_LINKDIR)
link_directories("${GCC_LINKDIR}")
ENDIF()
ENDIF()
ENDIF (WIN32)
IF (UNIX AND NOT APPLE)
@ -290,23 +290,23 @@ ENDIF (APPLE)
SET (cubicsdr_sources
src/CubicSDR.cpp
src/AppFrame.cpp
src/AppConfig.cpp
src/FrequencyDialog.cpp
src/CubicSDR.cpp
src/AppFrame.cpp
src/AppConfig.cpp
src/FrequencyDialog.cpp
src/DemodLabelDialog.cpp
src/IOThread.cpp
src/ModemProperties.cpp
src/BookmarkMgr.cpp
src/sdr/SDRDeviceInfo.cpp
src/sdr/SDRPostThread.cpp
src/sdr/SDREnumerator.cpp
src/sdr/SoapySDRThread.h
src/demod/DemodulatorPreThread.cpp
src/demod/DemodulatorThread.cpp
src/demod/DemodulatorWorkerThread.cpp
src/demod/DemodulatorInstance.cpp
src/demod/DemodulatorMgr.cpp
src/sdr/SDRDeviceInfo.cpp
src/sdr/SDRPostThread.cpp
src/sdr/SDREnumerator.cpp
src/sdr/SoapySDRThread.h
src/demod/DemodulatorPreThread.cpp
src/demod/DemodulatorThread.cpp
src/demod/DemodulatorWorkerThread.cpp
src/demod/DemodulatorInstance.cpp
src/demod/DemodulatorMgr.cpp
src/modules/modem/Modem.cpp
src/modules/modem/ModemAnalog.cpp
src/modules/modem/ModemDigital.cpp
@ -318,53 +318,55 @@ SET (cubicsdr_sources
src/modules/modem/analog/ModemIQ.cpp
src/modules/modem/analog/ModemLSB.cpp
src/modules/modem/analog/ModemUSB.cpp
src/audio/AudioThread.cpp
src/util/Gradient.cpp
src/util/Timer.cpp
src/util/MouseTracker.cpp
src/util/GLExt.cpp
src/util/GLFont.cpp
src/util/DataTree.cpp
src/audio/AudioThread.cpp
src/util/Gradient.cpp
src/util/Timer.cpp
src/util/MouseTracker.cpp
src/util/GLExt.cpp
src/util/GLFont.cpp
src/util/DataTree.cpp
src/panel/ScopePanel.cpp
src/panel/SpectrumPanel.cpp
src/panel/WaterfallPanel.cpp
src/panel/MeterPanel.cpp
src/panel/MeterPanel.h
src/visual/ColorTheme.cpp
src/visual/PrimaryGLContext.cpp
src/visual/InteractiveCanvas.cpp
src/visual/MeterCanvas.cpp
src/visual/MeterContext.cpp
src/visual/TuningCanvas.cpp
src/visual/TuningContext.cpp
src/visual/ModeSelectorCanvas.cpp
src/visual/ModeSelectorContext.cpp
src/visual/ScopeCanvas.cpp
src/visual/ScopeContext.cpp
src/visual/SpectrumCanvas.cpp
src/visual/WaterfallCanvas.cpp
src/visual/ColorTheme.cpp
src/visual/PrimaryGLContext.cpp
src/visual/InteractiveCanvas.cpp
src/visual/MeterCanvas.cpp
src/visual/MeterContext.cpp
src/visual/TuningCanvas.cpp
src/visual/TuningContext.cpp
src/visual/ModeSelectorCanvas.cpp
src/visual/ModeSelectorContext.cpp
src/visual/ScopeCanvas.cpp
src/visual/ScopeContext.cpp
src/visual/SpectrumCanvas.cpp
src/visual/WaterfallCanvas.cpp
src/visual/GainCanvas.cpp
src/visual/ImagePanel.cpp
src/process/VisualProcessor.cpp
src/process/ScopeVisualProcessor.cpp
src/process/SpectrumVisualProcessor.cpp
src/process/FFTVisualDataThread.cpp
src/process/FFTDataDistributor.cpp
src/visual/ImagePanel.cpp
src/process/VisualProcessor.cpp
src/process/ScopeVisualProcessor.cpp
src/process/SpectrumVisualProcessor.cpp
src/process/FFTVisualDataThread.cpp
src/process/FFTDataDistributor.cpp
src/process/SpectrumVisualDataThread.cpp
src/ui/GLPanel.cpp
src/ui/GLPanel.cpp
src/forms/SDRDevices/SDRDevices.cpp
src/forms/SDRDevices/SDRDevicesForm.cpp
src/forms/SDRDevices/SDRDeviceAdd.cpp
src/forms/SDRDevices/SDRDeviceAddForm.cpp
src/forms/Bookmark/BookmarkPanel.cpp
src/forms/Bookmark/BookmarkView.cpp
external/rtaudio/RtAudio.cpp
external/lodepng/lodepng.cpp
external/tinyxml/tinyxml.cpp
external/tinyxml/tinystr.cpp
external/tinyxml/tinyxmlparser.cpp
external/tinyxml/tinyxmlerror.cpp
external/cubicvr2/math/cubic_math.cpp
src/forms/Dialog/ActionDialogBase.cpp
src/forms/Dialog/ActionDialog.cpp
external/rtaudio/RtAudio.cpp
external/lodepng/lodepng.cpp
external/tinyxml/tinyxml.cpp
external/tinyxml/tinystr.cpp
external/tinyxml/tinyxmlparser.cpp
external/tinyxml/tinyxmlerror.cpp
external/cubicvr2/math/cubic_math.cpp
)
IF(ENABLE_DIGITAL_LAB)
@ -384,34 +386,34 @@ IF(ENABLE_DIGITAL_LAB)
src/modules/modem/digital/ModemQAM.cpp
src/modules/modem/digital/ModemQPSK.cpp
)
IF(ENABLE_LIQUID_EXPERIMENTAL)
IF(ENABLE_LIQUID_EXPERIMENTAL)
SET (cubicsdr_sources
${cubicsdr_sources}
src/modules/modem/digital/ModemFSK.cpp
)
ENDIF()
ENDIF()
ENDIF()
SET (cubicsdr_headers
src/CubicSDRDefs.h
src/CubicSDR.h
src/AppFrame.h
src/AppConfig.h
src/FrequencyDialog.h
src/CubicSDRDefs.h
src/CubicSDR.h
src/AppFrame.h
src/AppConfig.h
src/FrequencyDialog.h
src/DemodLabelDialog.h
src/IOThread.h
src/ModemProperties.h
src/BookmarkMgr.h
src/sdr/SDRDeviceInfo.h
src/sdr/SDRPostThread.h
src/sdr/SDREnumerator.h
src/sdr/SoapySDRThread.cpp
src/demod/DemodulatorPreThread.h
src/demod/DemodulatorThread.h
src/demod/DemodulatorWorkerThread.h
src/demod/DemodulatorInstance.h
src/demod/DemodulatorMgr.h
src/demod/DemodDefs.h
src/sdr/SDRDeviceInfo.h
src/sdr/SDRPostThread.h
src/sdr/SDREnumerator.h
src/sdr/SoapySDRThread.cpp
src/demod/DemodulatorPreThread.h
src/demod/DemodulatorThread.h
src/demod/DemodulatorWorkerThread.h
src/demod/DemodulatorInstance.h
src/demod/DemodulatorMgr.h
src/demod/DemodDefs.h
src/modules/modem/Modem.h
src/modules/modem/ModemAnalog.h
src/modules/modem/ModemDigital.h
@ -423,67 +425,69 @@ SET (cubicsdr_headers
src/modules/modem/analog/ModemIQ.h
src/modules/modem/analog/ModemLSB.h
src/modules/modem/analog/ModemUSB.h
src/audio/AudioThread.h
src/util/Gradient.h
src/util/Timer.h
src/util/ThreadQueue.h
src/util/MouseTracker.h
src/util/GLExt.h
src/util/GLFont.h
src/util/DataTree.h
src/audio/AudioThread.h
src/util/Gradient.h
src/util/Timer.h
src/util/ThreadQueue.h
src/util/MouseTracker.h
src/util/GLExt.h
src/util/GLFont.h
src/util/DataTree.h
src/panel/ScopePanel.h
src/panel/SpectrumPanel.h
src/panel/WaterfallPanel.h
src/visual/ColorTheme.h
src/visual/PrimaryGLContext.h
src/visual/InteractiveCanvas.h
src/visual/MeterCanvas.h
src/visual/MeterContext.h
src/visual/TuningCanvas.h
src/visual/TuningContext.h
src/visual/ModeSelectorCanvas.h
src/visual/ModeSelectorContext.h
src/visual/ScopeCanvas.h
src/visual/ScopeContext.h
src/visual/SpectrumCanvas.h
src/visual/WaterfallCanvas.h
src/visual/ColorTheme.h
src/visual/PrimaryGLContext.h
src/visual/InteractiveCanvas.h
src/visual/MeterCanvas.h
src/visual/MeterContext.h
src/visual/TuningCanvas.h
src/visual/TuningContext.h
src/visual/ModeSelectorCanvas.h
src/visual/ModeSelectorContext.h
src/visual/ScopeCanvas.h
src/visual/ScopeContext.h
src/visual/SpectrumCanvas.h
src/visual/WaterfallCanvas.h
src/visual/GainCanvas.h
src/visual/ImagePanel.h
src/process/VisualProcessor.h
src/process/ScopeVisualProcessor.h
src/process/SpectrumVisualProcessor.h
src/process/FFTVisualDataThread.h
src/process/FFTDataDistributor.h
src/visual/ImagePanel.h
src/process/VisualProcessor.h
src/process/ScopeVisualProcessor.h
src/process/SpectrumVisualProcessor.h
src/process/FFTVisualDataThread.h
src/process/FFTDataDistributor.h
src/process/SpectrumVisualDataThread.h
src/ui/GLPanel.h
src/ui/UITestCanvas.cpp
src/ui/UITestCanvas.h
src/ui/UITestContext.cpp
src/ui/UITestContext.h
src/ui/GLPanel.h
src/ui/UITestCanvas.cpp
src/ui/UITestCanvas.h
src/ui/UITestContext.cpp
src/ui/UITestContext.h
src/forms/SDRDevices/SDRDevices.h
src/forms/SDRDevices/SDRDevicesForm.h
src/forms/SDRDevices/SDRDeviceAdd.h
src/forms/SDRDevices/SDRDeviceAddForm.h
src/forms/Bookmark/BookmarkPanel.h
src/forms/Bookmark/BookmarkView.h
external/rtaudio/RtAudio.h
external/lodepng/lodepng.h
external/tinyxml/tinyxml.h
external/tinyxml/tinystr.h
external/cubicvr2/math/aabb.h
external/cubicvr2/math/cubic_math.h
external/cubicvr2/math/cubic_types.h
external/cubicvr2/math/frustum.h
external/cubicvr2/math/mat3.h
external/cubicvr2/math/mat4.h
external/cubicvr2/math/plane.h
external/cubicvr2/math/quaternion.h
external/cubicvr2/math/sphere.h
external/cubicvr2/math/transform.h
external/cubicvr2/math/triangle.h
external/cubicvr2/math/vec2.h
external/cubicvr2/math/vec3.h
external/cubicvr2/math/vec4.h
src/forms/Dialog/ActionDialogBase.h
src/forms/Dialog/ActionDialog.h
external/rtaudio/RtAudio.h
external/lodepng/lodepng.h
external/tinyxml/tinyxml.h
external/tinyxml/tinystr.h
external/cubicvr2/math/aabb.h
external/cubicvr2/math/cubic_math.h
external/cubicvr2/math/cubic_types.h
external/cubicvr2/math/frustum.h
external/cubicvr2/math/mat3.h
external/cubicvr2/math/mat4.h
external/cubicvr2/math/plane.h
external/cubicvr2/math/quaternion.h
external/cubicvr2/math/sphere.h
external/cubicvr2/math/transform.h
external/cubicvr2/math/triangle.h
external/cubicvr2/math/vec2.h
external/cubicvr2/math/vec3.h
external/cubicvr2/math/vec4.h
)
IF(ENABLE_DIGITAL_LAB)
@ -554,6 +558,7 @@ set(REG_EXT "[^/]*([.]cpp|[.]c|[.]h|[.]hpp)$")
SOURCE_GROUP("Base" REGULAR_EXPRESSION "src/${REG_EXT}")
SOURCE_GROUP("Forms\\SDRDevices" REGULAR_EXPRESSION "src/forms/SDRDevices/${REG_EXT}")
SOURCE_GROUP("Forms\\Bookmark" REGULAR_EXPRESSION "src/forms/Bookmark/${REG_EXT}")
SOURCE_GROUP("Forms\\Dialog" REGULAR_EXPRESSION "src/forms/Dialog/${REG_EXT}")
SOURCE_GROUP("SDR" REGULAR_EXPRESSION "src/sdr/${REG_EXT}")
IF(USE_HAMLIB)
SOURCE_GROUP("Rig" REGULAR_EXPRESSION "src/rig/${REG_EXT}")
@ -577,27 +582,28 @@ SOURCE_GROUP("_ext-TinyXML" REGULAR_EXPRESSION "external/tinyxml/.*${REG_EXT}")
SOURCE_GROUP("_ext-CubicVR2" REGULAR_EXPRESSION "external/cubicvr2/.*${REG_EXT}")
include_directories (
${PROJECT_SOURCE_DIR}/src/forms/SDRDevices
${PROJECT_SOURCE_DIR}/src/forms/DigitalConsole
${PROJECT_SOURCE_DIR}/src/forms/Bookmark
${PROJECT_SOURCE_DIR}/src/sdr
${PROJECT_SOURCE_DIR}/src/demod
${PROJECT_SOURCE_DIR}/src/modules
${PROJECT_SOURCE_DIR}/src/modules/modem
${PROJECT_SOURCE_DIR}/src/modules/modem/digital
${PROJECT_SOURCE_DIR}/src/modules/modem/analog
${PROJECT_SOURCE_DIR}/src/audio
${PROJECT_SOURCE_DIR}/src/util
${PROJECT_SOURCE_DIR}/src/panel
${PROJECT_SOURCE_DIR}/src/visual
${PROJECT_SOURCE_DIR}/src/process
${PROJECT_SOURCE_DIR}/src/ui
${PROJECT_SOURCE_DIR}/src/rig
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/external/rtaudio
${PROJECT_SOURCE_DIR}/external/lodepng
${PROJECT_SOURCE_DIR}/external/tinyxml
${PROJECT_SOURCE_DIR}/external/cubicvr2/math
${PROJECT_SOURCE_DIR}/src/forms/SDRDevices
${PROJECT_SOURCE_DIR}/src/forms/DigitalConsole
${PROJECT_SOURCE_DIR}/src/forms/Bookmark
${PROJECT_SOURCE_DIR}/src/forms/Dialog
${PROJECT_SOURCE_DIR}/src/sdr
${PROJECT_SOURCE_DIR}/src/demod
${PROJECT_SOURCE_DIR}/src/modules
${PROJECT_SOURCE_DIR}/src/modules/modem
${PROJECT_SOURCE_DIR}/src/modules/modem/digital
${PROJECT_SOURCE_DIR}/src/modules/modem/analog
${PROJECT_SOURCE_DIR}/src/audio
${PROJECT_SOURCE_DIR}/src/util
${PROJECT_SOURCE_DIR}/src/panel
${PROJECT_SOURCE_DIR}/src/visual
${PROJECT_SOURCE_DIR}/src/process
${PROJECT_SOURCE_DIR}/src/ui
${PROJECT_SOURCE_DIR}/src/rig
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/external/rtaudio
${PROJECT_SOURCE_DIR}/external/lodepng
${PROJECT_SOURCE_DIR}/external/tinyxml
${PROJECT_SOURCE_DIR}/external/cubicvr2/math
)
set(RES_FILES "")
@ -606,11 +612,11 @@ if(MINGW OR MSVC)
set(CMAKE_RC_COMPILER_INIT windres)
ENABLE_LANGUAGE(RC)
IF(EX_PLATFORM EQUAL 64)
SET(RC_TARGET "pe-x86-64")
SET(RC_TARGET "pe-x86-64")
ELSE(EX_PLATFORM EQUAL 64)
SET(RC_TARGET "pe-i386")
SET(RC_TARGET "pe-i386")
ENDIF(EX_PLATFORM EQUAL 64)
SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
endif(MINGW OR MSVC)
@ -618,9 +624,9 @@ IF (NOT BUNDLE_APP)
configure_files(${PROJECT_SOURCE_DIR}/font ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME}/fonts "*.fnt")
configure_files(${PROJECT_SOURCE_DIR}/font ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME}/fonts "*.png")
configure_files(${PROJECT_SOURCE_DIR}/icon ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} CubicSDR.ico)
IF(MSVC)
configure_files(${PROJECT_SOURCE_DIR}/external/liquid-dsp/msvc/${EX_PLATFORM}/ ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} "*.dll")
ENDIF()
IF(MSVC)
configure_files(${PROJECT_SOURCE_DIR}/external/liquid-dsp/msvc/${EX_PLATFORM}/ ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} "*.dll")
ENDIF()
IF (CUBICSDR_HAS_HEADER_IMAGE)
configure_files(${CUBICSDR_HEADER_IMAGE_DIR} ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} ${CUBICSDR_HEADER_IMAGE_FILE})
ENDIF()
@ -661,20 +667,20 @@ IF (APPLE AND BUNDLE_APP)
set(BUNDLE_MIR_SDR OFF CACHE BOOL "Bundle mir_sdr for personal use only -- do not distribute.")
IF (BUNDLE_SOAPY_MODS)
ADD_DEFINITIONS(
-DBUNDLE_SOAPY_MODS=1
)
set(BUNDLED_MODS_ONLY OFF CACHE BOOL "Use bundled mods only")
IF (BUNDLED_MODS_ONLY)
ADD_DEFINITIONS(
-DBUNDLED_MODS_ONLY=1
)
ENDIF()
ADD_DEFINITIONS(
-DBUNDLE_SOAPY_MODS=1
)
set(BUNDLED_MODS_ONLY OFF CACHE BOOL "Use bundled mods only")
IF (BUNDLED_MODS_ONLY)
ADD_DEFINITIONS(
-DBUNDLED_MODS_ONLY=1
)
ENDIF()
ENDIF()
ADD_DEFINITIONS(
-std=c++0x
-pthread
-std=c++0x
-pthread
-D_OSX_APP_
)
@ -804,21 +810,21 @@ IF(APPLE AND NOT BUNDLE_APP)
IF (NOT CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX "/usr/")
ENDIF()
ADD_DEFINITIONS(
-DRES_FOLDER="${CMAKE_INSTALL_PREFIX}/share/cubicsdr/"
)
ADD_DEFINITIONS(
-DRES_FOLDER="${CMAKE_INSTALL_PREFIX}/share/cubicsdr/"
)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro")
INSTALL(TARGETS CubicSDR DESTINATION bin)
INSTALL(TARGETS CubicSDR DESTINATION bin)
install(FILES
${PROJECT_SOURCE_DIR}/src/CubicSDR.png
DESTINATION share/cubicsdr)
DESTINATION share/cubicsdr)
install(FILES
${CUBICSDR_FONTS}
DESTINATION share/cubicsdr/fonts)
DESTINATION share/cubicsdr/fonts)
CONFIGURE_FILE(
"${PROJECT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
@ -834,33 +840,33 @@ IF (WIN32 AND NOT BUILD_INSTALLER)
ADD_DEFINITIONS(
-DRES_FOLDER="../share/cubicsdr/"
)
INSTALL(TARGETS CubicSDR DESTINATION bin)
INSTALL(FILES
${LIQUID_DLL}
DESTINATION bin)
INSTALL(FILES
${LIQUID_DLL}
DESTINATION bin)
IF(USE_HAMLIB)
FOREACH(HAMLIB_DLL ${HAMLIB_DLLS})
message(STATUS "Copying Hamlib DLL: ${HAMLIB_DLL}")
IF(USE_HAMLIB)
FOREACH(HAMLIB_DLL ${HAMLIB_DLLS})
message(STATUS "Copying Hamlib DLL: ${HAMLIB_DLL}")
INSTALL( FILES "${HAMLIB_DLL}"
DESTINATION bin
)
ENDFOREACH()
ENDIF()
ENDFOREACH()
ENDIF()
INSTALL(FILES
${PROJECT_SOURCE_DIR}/src/CubicSDR.png
DESTINATION share/cubicsdr)
${PROJECT_SOURCE_DIR}/src/CubicSDR.png
DESTINATION share/cubicsdr)
INSTALL(FILES
${CUBICSDR_FONTS}
DESTINATION share/cubicsdr/fonts)
${CUBICSDR_FONTS}
DESTINATION share/cubicsdr/fonts)
IF (CUBICSDR_HAS_HEADER_IMAGE)
INSTALL(FILES
${CUBICSDR_HEADER_IMAGE}
DESTINATION share/cubicsdr/)
${CUBICSDR_HEADER_IMAGE}
DESTINATION share/cubicsdr/)
ENDIF()
ENDIF()
@ -868,167 +874,167 @@ ENDIF()
IF (WIN32 AND BUILD_INSTALLER)
set(BUNDLE_SOAPY_MODS OFF CACHE BOOL "Bundle local SoapySDR modules")
set(CPACK_GENERATOR NSIS)
set(CPACK_PACKAGE_NAME "${CUBICSDR_INSTALL_NAME}")
set(CPACK_NSIS_DISPLAY_NAME "${CUBICSDR_INSTALL_TITLE}")
set(CPACK_PACKAGE_VENDOR "cubicsdr.com")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CUBICSDR_INSTALL_NAME}")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "CubicSDR.ico")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/icon\\\\NSIS_Header.bmp")
IF(EX_PLATFORM EQUAL 64)
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
SET(CPACK_NSIS_PACKAGE_NAME "${CUBICSDR_INSTALL_NAME}")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CUBICSDR_INSTALL_NAME} ${CPACK_PACKAGE_VERSION}")
set(CMAKE_CL_64 TRUE) # This gets around a bug in the CPack installer name generation for MinGW 64-bit since 2.8
ELSE(EX_PLATFORM EQUAL 64)
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
SET(CPACK_NSIS_PACKAGE_NAME "${CUBICSDR_INSTALL_NAME} (x86)")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CUBICSDR_INSTALL_NAME} ${CPACK_PACKAGE_VERSION} (x86)")
set(CMAKE_CL_64 FALSE)
ENDIF(EX_PLATFORM EQUAL 64)
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
install(TARGETS CubicSDR RUNTIME DESTINATION .)
set(CPACK_GENERATOR NSIS)
set(CPACK_PACKAGE_NAME "${CUBICSDR_INSTALL_NAME}")
set(CPACK_NSIS_DISPLAY_NAME "${CUBICSDR_INSTALL_TITLE}")
set(CPACK_PACKAGE_VENDOR "cubicsdr.com")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CUBICSDR_INSTALL_NAME}")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "CubicSDR.ico")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/icon\\\\NSIS_Header.bmp")
IF(EX_PLATFORM EQUAL 64)
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
SET(CPACK_NSIS_PACKAGE_NAME "${CUBICSDR_INSTALL_NAME}")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CUBICSDR_INSTALL_NAME} ${CPACK_PACKAGE_VERSION}")
set(CMAKE_CL_64 TRUE) # This gets around a bug in the CPack installer name generation for MinGW 64-bit since 2.8
ELSE(EX_PLATFORM EQUAL 64)
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
SET(CPACK_NSIS_PACKAGE_NAME "${CUBICSDR_INSTALL_NAME} (x86)")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CUBICSDR_INSTALL_NAME} ${CPACK_PACKAGE_VERSION} (x86)")
set(CMAKE_CL_64 FALSE)
ENDIF(EX_PLATFORM EQUAL 64)
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
install(TARGETS CubicSDR RUNTIME DESTINATION .)
install(FILES
install(FILES
${PROJECT_SOURCE_DIR}/icon/CubicSDR.ico
${LIQUID_DLL}
DESTINATION .)
${LIQUID_DLL}
DESTINATION .)
install(FILES
install(FILES
${CUBICSDR_FONTS}
DESTINATION fonts)
DESTINATION fonts)
IF (CUBICSDR_HAS_HEADER_IMAGE)
INSTALL(FILES
${CUBICSDR_HEADER_IMAGE}
DESTINATION .)
${CUBICSDR_HEADER_IMAGE}
DESTINATION .)
ENDIF()
IF(USE_HAMLIB)
FOREACH(HAMLIB_DLL ${HAMLIB_DLLS})
message(STATUS "Copying Hamlib DLL: ${HAMLIB_DLL}")
IF(USE_HAMLIB)
FOREACH(HAMLIB_DLL ${HAMLIB_DLLS})
message(STATUS "Copying Hamlib DLL: ${HAMLIB_DLL}")
INSTALL( FILES
${HAMLIB_DLL}
DESTINATION .)
ENDFOREACH()
ENDIF()
${HAMLIB_DLL}
DESTINATION .)
ENDFOREACH()
ENDIF()
IF (BUNDLE_SOAPY_MODS)
ADD_DEFINITIONS(
-DBUNDLE_SOAPY_MODS=1
)
set(BUNDLED_MODS_ONLY OFF CACHE BOOL "Use bundled mods only")
IF (BUNDLED_MODS_ONLY)
ADD_DEFINITIONS(
-DBUNDLED_MODS_ONLY=1
)
ENDIF()
file(GLOB SOAPY_BINS ${SOAPY_SDR_ROOT}/bin/*.dll)
file(GLOB SOAPY_MODS ${SOAPY_SDR_ROOT}/lib/SoapySDR/modules/*.dll)
message(STATUS "SOAPY_BINS: ${SOAPY_BINS}")
message(STATUS "SOAPY_MODS: ${SOAPY_MODS}")
install(FILES ${SOAPY_BINS} DESTINATION .)
install(FILES ${SOAPY_MODS} DESTINATION modules)
ENDIF(BUNDLE_SOAPY_MODS)
IF(MSVC AND EX_PLATFORM EQUAL 32)
install(FILES
${PROJECT_SOURCE_DIR}/external/msvc/${EX_PLATFORM_NAME}/libgcc_s_dw2-1.dll
DESTINATION .)
ENDIF(MSVC AND EX_PLATFORM EQUAL 32)
IF (BUNDLE_SOAPY_MODS)
ADD_DEFINITIONS(
-DBUNDLE_SOAPY_MODS=1
)
set(BUNDLED_MODS_ONLY OFF CACHE BOOL "Use bundled mods only")
IF (BUNDLED_MODS_ONLY)
ADD_DEFINITIONS(
-DBUNDLED_MODS_ONLY=1
)
ENDIF()
file(GLOB SOAPY_BINS ${SOAPY_SDR_ROOT}/bin/*.dll)
file(GLOB SOAPY_MODS ${SOAPY_SDR_ROOT}/lib/SoapySDR/modules/*.dll)
message(STATUS "SOAPY_BINS: ${SOAPY_BINS}")
message(STATUS "SOAPY_MODS: ${SOAPY_MODS}")
install(FILES ${SOAPY_BINS} DESTINATION .)
install(FILES ${SOAPY_MODS} DESTINATION modules)
ENDIF(BUNDLE_SOAPY_MODS)
IF(MSVC AND EX_PLATFORM EQUAL 32)
install(FILES
${PROJECT_SOURCE_DIR}/external/msvc/${EX_PLATFORM_NAME}/libgcc_s_dw2-1.dll
DESTINATION .)
ENDIF(MSVC AND EX_PLATFORM EQUAL 32)
set(CPACK_PACKAGE_EXECUTABLES CubicSDR "CubicSDR")
set(CPACK_PACKAGE_EXECUTABLES CubicSDR "CubicSDR")
IF (MSVC)
install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/external/msvc/${EX_PLATFORM_NAME}/vc_redist.${EX_PLATFORM_NAME}.exe DESTINATION vc_redist)
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\vc_redist\\\\vc_redist.${EX_PLATFORM_NAME}.exe\\\" /q:a'")
ENDIF (MSVC)
INCLUDE(CPack)
IF (MSVC)
install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/external/msvc/${EX_PLATFORM_NAME}/vc_redist.${EX_PLATFORM_NAME}.exe DESTINATION vc_redist)
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\vc_redist\\\\vc_redist.${EX_PLATFORM_NAME}.exe\\\" /q:a'")
ENDIF (MSVC)
INCLUDE(CPack)
ENDIF (WIN32 AND BUILD_INSTALLER)
IF (UNIX AND NOT APPLE AND BUILD_DEB)
set(CPACK_GENERATOR DEB)
set(CPACK_PACKAGE_NAME "CubicSDR")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS " libwxgtk3.0-0, libpulse0")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Charles J. Cliffe <cj@cubicproductions.com>")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "CubicSDR Software Defined Radio application v${CUBICSDR_VERSION}")
SET(CPACK_DEBIAN_PACKAGE_SECTION "comm")
set(CPACK_PACKAGE_NAME "CubicSDR")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS " libwxgtk3.0-0, libpulse0")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Charles J. Cliffe <cj@cubicproductions.com>")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "CubicSDR Software Defined Radio application v${CUBICSDR_VERSION}")
SET(CPACK_DEBIAN_PACKAGE_SECTION "comm")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${EX_PLATFORM_NAME}")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${EX_PLATFORM_NAME}")
IF (NOT CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX "/usr/")
ENDIF()
ADD_DEFINITIONS(
-DRES_FOLDER="${CMAKE_INSTALL_PREFIX}/share/cubicsdr/"
-D_FORTIFY_SOURCE=2
)
ADD_DEFINITIONS(
-DRES_FOLDER="${CMAKE_INSTALL_PREFIX}/share/cubicsdr/"
-D_FORTIFY_SOURCE=2
)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro")
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/external/deb/deb_post.sh.in"
"${CMAKE_CURRENT_BINARY_DIR}/deb_post.sh" @ONLY IMMEDIATE)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/external/deb/deb_post.sh.in"
"${CMAKE_CURRENT_BINARY_DIR}/deb_post.sh" @ONLY IMMEDIATE)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/CubicSDR.desktop.in"
"${CMAKE_CURRENT_BINARY_DIR}/CubicSDR.desktop" @ONLY IMMEDIATE)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/CubicSDR.desktop.in"
"${CMAKE_CURRENT_BINARY_DIR}/CubicSDR.desktop" @ONLY IMMEDIATE)
INSTALL(TARGETS CubicSDR DESTINATION bin)
INSTALL(TARGETS CubicSDR DESTINATION bin)
install(FILES
${PROJECT_SOURCE_DIR}/src/CubicSDR.png
DESTINATION share/cubicsdr)
DESTINATION share/cubicsdr)
install(FILES
${CUBICSDR_FONTS}
DESTINATION share/cubicsdr/fonts)
DESTINATION share/cubicsdr/fonts)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/CubicSDR.desktop"
DESTINATION share/applications)
INCLUDE(CPack)
INCLUDE(CPack)
ENDIF()
IF(UNIX AND NOT APPLE AND NOT BUILD_DEB)
IF (NOT CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX "/usr/")
ENDIF()
ADD_DEFINITIONS(
-DRES_FOLDER="${CMAKE_INSTALL_PREFIX}/share/cubicsdr/"
)
ADD_DEFINITIONS(
-DRES_FOLDER="${CMAKE_INSTALL_PREFIX}/share/cubicsdr/"
)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro")
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/CubicSDR.desktop.in"
"${CMAKE_CURRENT_BINARY_DIR}/CubicSDR.desktop" @ONLY IMMEDIATE)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/CubicSDR.desktop.in"
"${CMAKE_CURRENT_BINARY_DIR}/CubicSDR.desktop" @ONLY IMMEDIATE)
INSTALL(TARGETS CubicSDR DESTINATION bin)
INSTALL(TARGETS CubicSDR DESTINATION bin)
INSTALL(FILES
${PROJECT_SOURCE_DIR}/src/CubicSDR.png
DESTINATION share/cubicsdr)
DESTINATION share/cubicsdr)
INSTALL(FILES
${CUBICSDR_FONTS}
DESTINATION share/cubicsdr/fonts)
DESTINATION share/cubicsdr/fonts)
IF (CUBICSDR_HAS_HEADER_IMAGE)
INSTALL(FILES
${CUBICSDR_HEADER_IMAGE}
DESTINATION share/cubicsdr)
${CUBICSDR_HEADER_IMAGE}
DESTINATION share/cubicsdr)
ENDIF()
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/CubicSDR.desktop"
DESTINATION share/applications)
DESTINATION share/applications)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/external/deb/deb_post.sh.in"
"${CMAKE_CURRENT_BINARY_DIR}/deb_post.sh" @ONLY IMMEDIATE)
"${CMAKE_CURRENT_BINARY_DIR}/deb_post.sh" @ONLY IMMEDIATE)
CONFIGURE_FILE(
"${PROJECT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"

View File

@ -341,3 +341,26 @@ BookmarkEntry *BookmarkMgr::nodeToBookmark(const char *name_in, DataNode *node)
return be;
}
std::wstring BookmarkMgr::getBookmarkEntryDisplayName(BookmarkEntry *bmEnt) {
std::wstring dispName = bmEnt->label;
if (dispName == "") {
std::string freqStr = frequencyToStr(bmEnt->frequency) + " " + bmEnt->type;
dispName = wstring(freqStr.begin(),freqStr.end());
}
return dispName;
}
std::wstring BookmarkMgr::getActiveDisplayName(DemodulatorInstance *demod) {
std::wstring activeName = demod->getDemodulatorUserLabel();
if (activeName == "") {
std::string wstr = frequencyToStr(demod->getFrequency()) + " " + demod->getDemodulatorType();
activeName = std::wstring(wstr.begin(),wstr.end());
}
return activeName;
}

View File

@ -64,7 +64,9 @@ public:
BookmarkList getRecents();
void clearRecents();
static std::wstring getBookmarkEntryDisplayName(BookmarkEntry *bmEnt);
static std::wstring getActiveDisplayName(DemodulatorInstance *demod);
protected:
void trimRecents();

View File

@ -1,5 +1,6 @@
#include "BookmarkView.h"
#include "CubicSDR.h"
#include "ActionDialog.h"
#include <wx/menu.h>
#include <wx/textdlg.h>
@ -29,6 +30,40 @@ BookmarkViewVisualDragItem::BookmarkViewVisualDragItem(wxString labelValue) : wx
Show();
}
class ActionDialogRemoveBookmark : public ActionDialog {
public:
ActionDialogRemoveBookmark( BookmarkEntry *be ) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Remove Bookmark?")) {
subject = be;
m_questionText->SetLabelText(wxT("Are you sure you want to remove the bookmark\n '" + BookmarkMgr::getBookmarkEntryDisplayName(subject) + "'?"));
}
void doClickOK() {
wxGetApp().getBookmarkMgr().removeBookmark(subject);
wxGetApp().getBookmarkMgr().updateBookmarks();
}
private:
BookmarkEntry *subject;
};
class ActionDialogRemoveGroup : public ActionDialog {
public:
ActionDialogRemoveGroup( std::string groupName ) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Remove Group?")) {
subject = groupName;
m_questionText->SetLabelText(wxT("Warning: Are you sure you want to remove the group\n '" + subject + "' AND ALL BOOKMARKS WITHIN IT?"));
}
void doClickOK() {
wxGetApp().getBookmarkMgr().removeGroup(subject);
wxGetApp().getBookmarkMgr().updateBookmarks();
}
private:
std::string subject;
};
BookmarkView::BookmarkView( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : BookmarkPanel(parent, id, pos, size, style) {
@ -174,7 +209,7 @@ wxTreeItemId BookmarkView::refreshBookmarks() {
tvi->bookmarkEnt = bmEnt;
tvi->groupName = gn_i;
std::wstring labelVal = getBookmarkEntryDisplayName(bmEnt);
std::wstring labelVal = BookmarkMgr::getBookmarkEntryDisplayName(bmEnt);
wxTreeItemId itm = m_treeView->AppendItem(groupItem, labelVal);
m_treeView->SetItemData(itm, tvi);
@ -197,29 +232,6 @@ wxTreeItemId BookmarkView::refreshBookmarks() {
}
std::wstring BookmarkView::getBookmarkEntryDisplayName(BookmarkEntry *bmEnt) {
std::wstring dispName = bmEnt->label;
if (dispName == "") {
std::string freqStr = frequencyToStr(bmEnt->frequency) + " " + bmEnt->type;
dispName = wstring(freqStr.begin(),freqStr.end());
}
return dispName;
}
std::wstring BookmarkView::getActiveDisplayName(DemodulatorInstance *demod) {
std::wstring activeName = demod->getDemodulatorUserLabel();
if (activeName == "") {
std::string wstr = frequencyToStr(demod->getFrequency()) + " " + demod->getDemodulatorType();
activeName = std::wstring(wstr.begin(),wstr.end());
}
return activeName;
}
void BookmarkView::doUpdateActiveList() {
std::vector<DemodulatorInstance *> &demods = wxGetApp().getDemodMgr().getDemodulators();
@ -239,7 +251,7 @@ void BookmarkView::doUpdateActiveList() {
tvi->type = TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE;
tvi->demod = demod_i;
wxString activeLabel = getActiveDisplayName(demod_i);
wxString activeLabel = BookmarkMgr::getActiveDisplayName(demod_i);
wxTreeItemId itm = m_treeView->AppendItem(activeBranch,activeLabel);
m_treeView->SetItemData(itm, tvi);
@ -863,9 +875,7 @@ void BookmarkView::onRemoveBookmark( wxCommandEvent& event ) {
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK) {
wxGetApp().getBookmarkMgr().removeBookmark(curSel->bookmarkEnt);
m_treeView->Delete(m_treeView->GetSelection());
wxGetApp().getBookmarkMgr().updateBookmarks();
ActionDialog::showDialog(new ActionDialogRemoveBookmark(curSel->bookmarkEnt));
}
}
@ -930,9 +940,7 @@ void BookmarkView::onRemoveGroup( wxCommandEvent& event ) {
TreeViewItem *curSel = itemToTVI(m_treeView->GetSelection());
if (curSel && curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_GROUP) {
wxGetApp().getBookmarkMgr().removeGroup(curSel->groupName);
m_treeView->Delete(m_treeView->GetSelection());
wxGetApp().getBookmarkMgr().updateBookmarks();
ActionDialog::showDialog(new ActionDialogRemoveGroup(curSel->groupName));
}
}
@ -947,13 +955,12 @@ void BookmarkView::onRenameGroup( wxCommandEvent& event ) {
wxString stringVal = "";
stringVal = wxGetTextFromUser(BOOKMARK_VIEW_STR_RENAME_GROUP, "New Group Name", curSel->groupName);
std::string newGroupName = stringVal.ToStdString();
std::string newGroupName = stringVal.Trim().ToStdString();
wxGetApp().getBookmarkMgr().renameGroup(curSel->groupName, newGroupName);
m_treeView->Delete(m_treeView->GetSelection());
wxGetApp().getBookmarkMgr().updateBookmarks();
if (newGroupName != "") {
wxGetApp().getBookmarkMgr().renameGroup(curSel->groupName, newGroupName);
wxGetApp().getBookmarkMgr().updateBookmarks();
}
}
@ -975,10 +982,10 @@ void BookmarkView::onTreeBeginDrag( wxTreeEvent& event ) {
if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) {
bAllow = true;
dragItemName = getActiveDisplayName(tvi->demod);
dragItemName = BookmarkMgr::getActiveDisplayName(tvi->demod);
} else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT || tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK) {
bAllow = true;
dragItemName = getBookmarkEntryDisplayName(tvi->bookmarkEnt);
dragItemName = BookmarkMgr::getBookmarkEntryDisplayName(tvi->bookmarkEnt);
}
if (bAllow) {

View File

@ -62,8 +62,6 @@ protected:
void onUpdateTimer( wxTimerEvent& event );
std::wstring getBookmarkEntryDisplayName(BookmarkEntry *bmEnt);
std::wstring getActiveDisplayName(DemodulatorInstance *demod);
void doUpdateActiveList();
void onTreeBeginLabelEdit( wxTreeEvent& event );

View File

@ -0,0 +1,59 @@
#include "ActionDialog.h"
ActionDialog *ActionDialog::activeDialog = nullptr;
ActionDialog::ActionDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
: ActionDialogBase(parent, id, title, pos, size, style) {
}
ActionDialog::~ActionDialog() {
}
void ActionDialog::showDialog(ActionDialog *dlg) {
if (activeDialog) { // rejected
delete dlg;
return;
}
activeDialog = dlg;
dlg->Layout();
dlg->Fit();
dlg->ShowModal();
}
ActionDialog *ActionDialog::getActiveDialog() {
return activeDialog;
}
void ActionDialog::setActiveDialog(ActionDialog *dlg) {
activeDialog = dlg;
}
void ActionDialog::onClickCancel( wxCommandEvent& event ) {
doClickCancel();
activeDialog->EndModal(0);
ActionDialog::setActiveDialog(nullptr);
delete activeDialog;
}
void ActionDialog::onClickOK( wxCommandEvent& event ) {
doClickOK();
activeDialog->EndModal(0);
ActionDialog::setActiveDialog(nullptr);
delete activeDialog;
}
void ActionDialog::doClickCancel() {
}
void ActionDialog::doClickOK() {
}

View File

@ -0,0 +1,21 @@
#include "ActionDialogBase.h"
#include <mutex>
class ActionDialog : public ActionDialogBase {
public:
ActionDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("QuestionTitle"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
~ActionDialog();
void onClickCancel( wxCommandEvent& event );
void onClickOK( wxCommandEvent& event );
virtual void doClickCancel();
virtual void doClickOK();
static ActionDialog *getActiveDialog();
static void setActiveDialog(ActionDialog *dlg);
static void showDialog(ActionDialog *dlg);
private:
static ActionDialog *activeDialog;
};

View File

@ -0,0 +1,53 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 23 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "ActionDialogBase.h"
///////////////////////////////////////////////////////////////////////////
ActionDialogBase::ActionDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* mainSizer;
mainSizer = new wxBoxSizer( wxVERTICAL );
m_questionText = new wxStaticText( this, wxID_ANY, wxT("Question"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
m_questionText->Wrap( -1 );
mainSizer->Add( m_questionText, 1, wxALL|wxEXPAND, 5 );
wxBoxSizer* buttonSizer;
buttonSizer = new wxBoxSizer( wxHORIZONTAL );
m_cancelButton = new wxButton( this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
buttonSizer->Add( m_cancelButton, 1, wxALL|wxEXPAND, 5 );
m_okButton = new wxButton( this, wxID_ANY, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0 );
buttonSizer->Add( m_okButton, 1, wxALL|wxEXPAND, 5 );
mainSizer->Add( buttonSizer, 1, wxEXPAND, 5 );
this->SetSizer( mainSizer );
this->Layout();
mainSizer->Fit( this );
this->Centre( wxBOTH );
// Connect Events
m_cancelButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ActionDialogBase::onClickCancel ), NULL, this );
m_okButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ActionDialogBase::onClickOK ), NULL, this );
}
ActionDialogBase::~ActionDialogBase()
{
// Disconnect Events
m_cancelButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ActionDialogBase::onClickCancel ), NULL, this );
m_okButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ActionDialogBase::onClickOK ), NULL, this );
}

View File

@ -0,0 +1,369 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">ActionDialogBase</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">0</property>
<property name="name">ActionDialogBase</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center">wxBOTH</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">ActionDialogBase</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxDEFAULT_DIALOG_STYLE</property>
<property name="subclass"></property>
<property name="title">QuestionTitle</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">mainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Question</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_questionText</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxALIGN_CENTRE</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">buttonSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Cancel</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_cancelButton</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">onClickCancel</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">OK</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_okButton</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">onClickOK</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -0,0 +1,50 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 23 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __ACTIONDIALOGBASE_H__
#define __ACTIONDIALOGBASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class ActionDialogBase
///////////////////////////////////////////////////////////////////////////////
class ActionDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_questionText;
wxButton* m_cancelButton;
wxButton* m_okButton;
// Virtual event handlers, overide them in your derived class
virtual void onClickCancel( wxCommandEvent& event ) { event.Skip(); }
virtual void onClickOK( wxCommandEvent& event ) { event.Skip(); }
public:
ActionDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("QuestionTitle"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
~ActionDialogBase();
};
#endif //__ACTIONDIALOGBASE_H__