Skip to content

Commit

Permalink
CMakeLists.txt: add option to force non native dialogs
Browse files Browse the repository at this point in the history
This will be used when building flatpaks as it seems that native dialogs have a lot of issues working properly from a flatpak app

Signed-off-by: Daniel Guramulta <[email protected]>
  • Loading branch information
DanielGuramulta committed Jan 28, 2020
1 parent db60697 commit dcb6c19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ endif()

configure_file(Info.plist.cmakein ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY)

option(WITH_NATIVEDIALOGS "Enable native file dialogs for Scopy" ON)

if (NOT ${WITH_NATIVEDIALOGS})
add_definitions(-DNONATIVE)
endif()

# Compiler options
target_compile_options(${PROJECT_NAME} PUBLIC -Wall)

Expand Down
3 changes: 3 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ int main(int argc, char **argv)
}

bool nonativedialog = parser.isSet("nonativedialog");
#ifdef NONATIVE
nonativedialog = true;
#endif
qDebug() << "Using" << (nonativedialog ? "Qt" : "Native") << "file dialogs";
launcher.setNativeDialogs(!nonativedialog);

Expand Down

0 comments on commit dcb6c19

Please sign in to comment.