Skip to content

Commit 58b4f31

Browse files
committed
ui: only compile AI related component when bmf and gui enabled
hide the Remux page until the backend fully implemented Signed-off-by: Jack Lau <[email protected]>
1 parent c4ec768 commit 58b4f31

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

src/CMakeLists.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ if(ENABLE_GUI)
260260
${CMAKE_SOURCE_DIR}/builder/src/base_page.cpp
261261
${CMAKE_SOURCE_DIR}/builder/src/converter_runner.cpp
262262
${CMAKE_SOURCE_DIR}/builder/src/transcoder_helper.cpp
263-
${CMAKE_SOURCE_DIR}/builder/src/python_manager.cpp
264263
${CMAKE_SOURCE_DIR}/component/src/file_selector_widget.cpp
265264
${CMAKE_SOURCE_DIR}/component/src/filter_tag_widget.cpp
266265
${CMAKE_SOURCE_DIR}/component/src/progress_widget.cpp
@@ -273,7 +272,6 @@ if(ENABLE_GUI)
273272
${CMAKE_SOURCE_DIR}/component/src/quality_widget.cpp
274273
${CMAKE_SOURCE_DIR}/component/src/codec_selector_widget.cpp
275274
${CMAKE_SOURCE_DIR}/component/src/format_selector_widget.cpp
276-
${CMAKE_SOURCE_DIR}/component/src/python_install_dialog.cpp
277275
${CMAKE_SOURCE_DIR}/builder/src/batch_item.cpp
278276
${CMAKE_SOURCE_DIR}/builder/src/batch_queue.cpp
279277
${CMAKE_SOURCE_DIR}/builder/src/batch_file_dialog.cpp
@@ -287,7 +285,6 @@ if(ENABLE_GUI)
287285
${CMAKE_SOURCE_DIR}/builder/src/cut_video_page.cpp
288286
${CMAKE_SOURCE_DIR}/builder/src/remux_page.cpp
289287
${CMAKE_SOURCE_DIR}/builder/src/transcode_page.cpp
290-
${CMAKE_SOURCE_DIR}/builder/src/ai_processing_page.cpp
291288
${CMAKE_SOURCE_DIR}/builder/src/shared_data.cpp
292289
${CMAKE_SOURCE_DIR}/builder/src/open_converter.cpp
293290
)
@@ -297,7 +294,6 @@ if(ENABLE_GUI)
297294
${CMAKE_SOURCE_DIR}/builder/include/base_page.h
298295
${CMAKE_SOURCE_DIR}/builder/include/converter_runner.h
299296
${CMAKE_SOURCE_DIR}/builder/include/transcoder_helper.h
300-
${CMAKE_SOURCE_DIR}/builder/include/python_manager.h
301297
${CMAKE_SOURCE_DIR}/component/include/file_selector_widget.h
302298
${CMAKE_SOURCE_DIR}/component/include/filter_tag_widget.h
303299
${CMAKE_SOURCE_DIR}/component/include/progress_widget.h
@@ -310,7 +306,6 @@ if(ENABLE_GUI)
310306
${CMAKE_SOURCE_DIR}/component/include/quality_widget.h
311307
${CMAKE_SOURCE_DIR}/component/include/codec_selector_widget.h
312308
${CMAKE_SOURCE_DIR}/component/include/format_selector_widget.h
313-
${CMAKE_SOURCE_DIR}/component/include/python_install_dialog.h
314309
${CMAKE_SOURCE_DIR}/builder/include/batch_item.h
315310
${CMAKE_SOURCE_DIR}/builder/include/batch_queue.h
316311
${CMAKE_SOURCE_DIR}/builder/include/batch_file_dialog.h
@@ -324,11 +319,23 @@ if(ENABLE_GUI)
324319
${CMAKE_SOURCE_DIR}/builder/include/cut_video_page.h
325320
${CMAKE_SOURCE_DIR}/builder/include/remux_page.h
326321
${CMAKE_SOURCE_DIR}/builder/include/transcode_page.h
327-
${CMAKE_SOURCE_DIR}/builder/include/ai_processing_page.h
328322
${CMAKE_SOURCE_DIR}/builder/include/shared_data.h
329323
${CMAKE_SOURCE_DIR}/builder/include/open_converter.h
330324
)
331325

326+
if(BMF_TRANSCODER)
327+
list(APPEND GUI_SOURCES
328+
${CMAKE_SOURCE_DIR}/component/src/python_install_dialog.cpp
329+
${CMAKE_SOURCE_DIR}/builder/src/python_manager.cpp
330+
${CMAKE_SOURCE_DIR}/builder/src/ai_processing_page.cpp
331+
)
332+
list(APPEND GUI_HEADERS
333+
${CMAKE_SOURCE_DIR}/component/include/python_install_dialog.h
334+
${CMAKE_SOURCE_DIR}/builder/include/python_manager.h
335+
${CMAKE_SOURCE_DIR}/builder/include/ai_processing_page.h
336+
)
337+
endif()
338+
332339
# Add UI files
333340
list(APPEND UI_FILES
334341
${CMAKE_SOURCE_DIR}/builder/src/open_converter.ui

src/builder/src/open_converter.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,11 @@ OpenConverter::OpenConverter(QWidget *parent)
150150
navButtonGroup->addButton(ui->btnExtractAudio, 2);
151151
navButtonGroup->addButton(ui->btnCutVideo, 3);
152152
navButtonGroup->addButton(ui->btnCreateGif, 4);
153-
navButtonGroup->addButton(ui->btnRemux, 5);
153+
// navButtonGroup->addButton(ui->btnRemux, 5);
154154
navButtonGroup->addButton(ui->btnTranscode, 6);
155+
#if defined(ENABLE_BMF) && defined(ENABLE_GUI)
155156
navButtonGroup->addButton(ui->btnAIProcessing, 7);
157+
#endif
156158

157159
// Connect navigation button group
158160
connect(navButtonGroup, QOverload<int>::of(&QButtonGroup::idClicked),
@@ -342,9 +344,11 @@ void OpenConverter::InitializePages() {
342344
pages.append(new CutVideoPage(this));
343345
pages.append(new CreateGifPage(this));
344346
// Advanced section
345-
pages.append(new RemuxPage(this));
347+
// pages.append(new RemuxPage(this));
346348
pages.append(new TranscodePage(this));
349+
#if defined(ENABLE_BMF) && defined(ENABLE_GUI)
347350
pages.append(new AIProcessingPage(this));
351+
#endif
348352

349353
// Add all pages to the stacked widget
350354
for (BasePage *page : pages) {

0 commit comments

Comments
 (0)