mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
BUILD(client): Auto-generate ApplicationPalette.h
Instead of having this file be part of the regular source tree, we now generate it on-the-fly instead.
This commit is contained in:
parent
90a21f4fba
commit
6716bdf526
File diff suppressed because it is too large
Load Diff
@ -52,28 +52,31 @@
|
||||
/// till the application terminates.
|
||||
///
|
||||
class ApplicationPalette : public QWidget {
|
||||
Q_OBJECT
|
||||
%(properties)s public : explicit ApplicationPalette(QWidget *p = 0)
|
||||
: QWidget(p),
|
||||
m_originalPalette(QApplication::palette()){
|
||||
// Empty
|
||||
}
|
||||
Q_OBJECT
|
||||
%(properties)s
|
||||
public:
|
||||
explicit ApplicationPalette(QWidget *p = 0) : QWidget(p), m_originalPalette(QApplication::palette()) {
|
||||
// Empty
|
||||
}
|
||||
|
||||
%(getterssetters)s
|
||||
|
||||
private slots : void updateApplicationPalette() {
|
||||
qWarning() << "Updating application palette";
|
||||
private slots:
|
||||
void updateApplicationPalette() {
|
||||
qWarning() << "Updating application palette";
|
||||
|
||||
QPalette newPalette = m_originalPalette; // Do not re-use potentially already styled palette. Might not pick up
|
||||
// system style changes though.
|
||||
QPalette newPalette = m_originalPalette; // Do not re-use potentially already styled palette. Might not pick up
|
||||
// system style changes though.
|
||||
|
||||
%(paletteupdates)s
|
||||
%(paletteupdates)s
|
||||
|
||||
QApplication::setPalette(newPalette);
|
||||
resetAllProperties();
|
||||
QApplication::setPalette(newPalette);
|
||||
resetAllProperties();
|
||||
}
|
||||
|
||||
void resetAllProperties() { %(propertyresets)s }
|
||||
void resetAllProperties() {
|
||||
%(propertyresets)s
|
||||
}
|
||||
|
||||
protected:
|
||||
bool event(QEvent *e) Q_DECL_OVERRIDE {
|
||||
|
||||
@ -38,6 +38,19 @@ option(portaudio "Build support for PortAudio" ON)
|
||||
option(plugin-debug "Build Mumble with debug output for plugin developers." OFF)
|
||||
option(plugin-callback-debug "Build Mumble with debug output for plugin callbacks inside of Mumble." OFF)
|
||||
|
||||
include(FindPythonInterpreter)
|
||||
set(PYTHON_HINTS
|
||||
"C:/Python39-x64" # Path on the AppVeyor CI server
|
||||
)
|
||||
|
||||
find_python_interpreter(
|
||||
VERSION 3
|
||||
INTERPRETER_OUT_VAR PYTHON_INTERPRETER
|
||||
HINTS ${PYTHON_HINTS}
|
||||
REQUIRED
|
||||
)
|
||||
|
||||
|
||||
if(WIN32)
|
||||
option(asio "Build support for ASIO audio input." OFF)
|
||||
option(wasapi "Build support for WASAPI." ON)
|
||||
@ -93,7 +106,6 @@ set(MUMBLE_SOURCES
|
||||
"ACLEditor.ui"
|
||||
"API_v_1_x_x.cpp"
|
||||
"API.h"
|
||||
"ApplicationPalette.h"
|
||||
"AudioConfigDialog.cpp"
|
||||
"AudioConfigDialog.h"
|
||||
"Audio.cpp"
|
||||
@ -365,6 +377,17 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "ApplicationPalette.h"
|
||||
COMMAND ${PYTHON_INTERPRETER}
|
||||
ARGS ${CMAKE_SOURCE_DIR}/scripts/generate-ApplicationPalette-class.py --template ${CMAKE_CURRENT_SOURCE_DIR}/ApplicationPaletteTemplate.h
|
||||
--output ApplicationPalette.h
|
||||
COMMENT "Generating ApplicationPalette.h"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/ApplicationPaletteTemplate.h"
|
||||
)
|
||||
target_sources(mumble PRIVATE "ApplicationPalette.h")
|
||||
target_include_directories(mumble PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
set_property(TARGET mumble_client_object_lib PROPERTY INTERPROCEDURAL_OPTIMIZATION ${lto})
|
||||
set_property(TARGET mumble PROPERTY INTERPROCEDURAL_OPTIMIZATION ${lto})
|
||||
|
||||
@ -385,6 +408,13 @@ set_target_properties(mumble_client_object_lib
|
||||
AUTOUIC ON
|
||||
)
|
||||
|
||||
set_target_properties(mumble
|
||||
PROPERTIES
|
||||
AUTOMOC ON
|
||||
AUTORCC ON
|
||||
AUTOUIC ON
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
install(TARGETS mumble RUNTIME DESTINATION "${MUMBLE_INSTALL_EXECUTABLEDIR}" COMPONENT mumble_client)
|
||||
else()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user