mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
refactor: move none c++ source files into src/
This commit is contained in:
parent
cfff9cd026
commit
20230542d6
|
@ -131,27 +131,12 @@ set(QRC_RESOURCES
|
|||
flags.qrc
|
||||
resources.qrc
|
||||
scripts.qrc
|
||||
src/stylesheets/css.qrc
|
||||
)
|
||||
|
||||
set(UI_SRC
|
||||
about.ui
|
||||
authentication.ui
|
||||
chineseconversion.ui
|
||||
dictgroupwidget.ui
|
||||
dictheadwords.ui
|
||||
dictinfo.ui
|
||||
editdictionaries.ui
|
||||
fulltextsearch.ui
|
||||
groups.ui
|
||||
initializing.ui
|
||||
mainwindow.ui
|
||||
options.ui
|
||||
orderandprops.ui
|
||||
preferences.ui
|
||||
scanpopup.ui
|
||||
sources.ui
|
||||
texttospeechsource.ui
|
||||
)
|
||||
# auto discovery of ui files https://cmake.org/cmake/help/v3.26/prop_tgt/AUTOUIC_SEARCH_PATHS.html
|
||||
set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/src/ui/")
|
||||
|
||||
if(WITH_EPWING_SUPPORT)
|
||||
set(EPWING_SUPPORT_SRC
|
||||
epwing.cc
|
||||
|
@ -186,7 +171,6 @@ if(WITH_FFMPEG_PLAYER)
|
|||
endif()
|
||||
|
||||
set(PROJECT_SOURCES
|
||||
${UI_SRC}
|
||||
${MAC_SRC}
|
||||
${QRC_RESOURCES}
|
||||
${EPWING_SUPPORT_SRC}
|
||||
|
|
|
@ -399,20 +399,7 @@ HEADERS += folding.hh \
|
|||
src/ui/ftssearchpanel.h \
|
||||
src/ui/searchpanel.h
|
||||
|
||||
FORMS += groups.ui \
|
||||
dictgroupwidget.ui \
|
||||
mainwindow.ui \
|
||||
sources.ui \
|
||||
initializing.ui \
|
||||
scanpopup.ui \
|
||||
preferences.ui \
|
||||
about.ui \
|
||||
editdictionaries.ui \
|
||||
orderandprops.ui \
|
||||
dictinfo.ui \
|
||||
dictheadwords.ui \
|
||||
authentication.ui \
|
||||
fulltextsearch.ui
|
||||
FORMS += $$files(src/ui/*.ui)
|
||||
|
||||
SOURCES += folding.cc \
|
||||
ankiconnector.cpp \
|
||||
|
@ -533,7 +520,6 @@ SOURCES += folding.cc \
|
|||
src/ui/searchpanel.cpp
|
||||
|
||||
#speech to text
|
||||
FORMS += texttospeechsource.ui
|
||||
SOURCES += speechclient.cc \
|
||||
texttospeechsource.cc
|
||||
HEADERS += texttospeechsource.hh \
|
||||
|
@ -586,48 +572,11 @@ CONFIG( chinese_conversion_support ) {
|
|||
|
||||
RESOURCES += resources.qrc \
|
||||
scripts.qrc \
|
||||
flags.qrc
|
||||
flags.qrc \
|
||||
src/stylesheets/css.qrc
|
||||
#EXTRA_TRANSLATIONS += thirdparty/qwebengine_ts/qtwebengine_zh_CN.ts
|
||||
TRANSLATIONS += locale/ru_RU.ts \
|
||||
locale/zh_CN.ts \
|
||||
locale/cs_CZ.ts \
|
||||
locale/de_DE.ts \
|
||||
locale/de_CH.ts \
|
||||
locale/el_GR.ts \
|
||||
locale/bg_BG.ts \
|
||||
locale/ar_SA.ts \
|
||||
locale/lt_LT.ts \
|
||||
locale/uk_UA.ts \
|
||||
locale/vi_VN.ts \
|
||||
locale/it_IT.ts \
|
||||
locale/pl_PL.ts \
|
||||
locale/ja_JP.ts \
|
||||
locale/zh_TW.ts \
|
||||
locale/sq_AL.ts \
|
||||
locale/pt_BR.ts \
|
||||
locale/es_AR.ts \
|
||||
locale/es_BO.ts \
|
||||
locale/es_ES.ts \
|
||||
locale/sk_SK.ts \
|
||||
locale/tr_TR.ts \
|
||||
locale/qu_WI.ts \
|
||||
locale/tg_TJ.ts \
|
||||
locale/ay_WI.ts \
|
||||
locale/be_BY.ts \
|
||||
locale/be_BY@latin.ts \
|
||||
locale/fr_FR.ts \
|
||||
locale/ko_KR.ts \
|
||||
locale/nl_NL.ts \
|
||||
locale/sr_SR.ts \
|
||||
locale/sv_SE.ts \
|
||||
locale/tk_TM.ts \
|
||||
locale/fa_IR.ts \
|
||||
locale/mk_MK.ts \
|
||||
locale/eo_EO.ts \
|
||||
locale/fi_FI.ts \
|
||||
locale/jb_JB.ts \
|
||||
locale/hi_IN.ts \
|
||||
locale/ie_001.ts
|
||||
TRANSLATIONS += $$files(locale/*.ts)
|
||||
|
||||
# Build version file
|
||||
!isEmpty( hasGit ) {
|
||||
PRE_TARGETDEPS += $$PWD/version.txt
|
||||
|
|
|
@ -1199,25 +1199,25 @@ void MainWindow::applyQtStyleSheet( QString const & addonStyle,QString const & d
|
|||
}
|
||||
#endif
|
||||
|
||||
QFile builtInCssFile( ":src/qtstyle/qt-style.css" );
|
||||
QFile builtInCssFile( ":qt-style.css" );
|
||||
builtInCssFile.open( QFile::ReadOnly );
|
||||
QByteArray css = builtInCssFile.readAll();
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
QFile macCssFile( ":src/qtstyle/qt-style-macos.css" );
|
||||
QFile macCssFile( ":qt-style-macos.css" );
|
||||
macCssFile.open( QFile::ReadOnly );
|
||||
css += macCssFile.readAll();
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
QFile winCssFile( ":src/qtstyle/qt-style-win.css" );
|
||||
QFile winCssFile( ":qt-style-win.css" );
|
||||
winCssFile.open( QFile::ReadOnly );
|
||||
css += winCssFile.readAll();
|
||||
|
||||
// Load an additional stylesheet
|
||||
// Dark Mode doesn't work nice with custom qt style sheets,
|
||||
if (!darkMode){
|
||||
QFile additionalStyle( QString( ":src/qtstyle/qt-%1.css" ).arg( displayStyle ) );
|
||||
QFile additionalStyle( QString( ":qt-%1.css" ).arg( displayStyle ) );
|
||||
if ( additionalStyle.open( QFile::ReadOnly ) ){
|
||||
css += additionalStyle.readAll();
|
||||
}
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
<file>icons/programicon.png</file>
|
||||
<file>icons/programicon_scan.png</file>
|
||||
<file>icons/warning.png</file>
|
||||
<file>article-style.css</file>
|
||||
<file>article-style-print.css</file>
|
||||
<file>icons/icon32_dsl.png</file>
|
||||
<file>icons/icon32_stardict.png</file>
|
||||
<file>icons/icon32_xdxf.png</file>
|
||||
|
@ -18,7 +16,6 @@
|
|||
<file>icons/icon32_hunspell.png</file>
|
||||
<file>icons/icon32_wiki.png</file>
|
||||
<file>icons/wiktionary.png</file>
|
||||
<file>article-style-st-lingvo.css</file>
|
||||
<file>icons/icon_dsl_native.png</file>
|
||||
<file>icons/forvo.png</file>
|
||||
<file>icons/lingualibre.svg</file>
|
||||
|
@ -29,13 +26,9 @@
|
|||
<file>icons/icon32_aard.png</file>
|
||||
<file>icons/expand_opt.png</file>
|
||||
<file>icons/collapse_opt.png</file>
|
||||
<file>article-style-st-babylon.css</file>
|
||||
<file>icons/menu_button.svg</file>
|
||||
<file>icons/clear.png</file>
|
||||
<file>article-style-st-modern.css</file>
|
||||
<file>article-style-st-lingoes.css</file>
|
||||
<file>icons/icon32_lingoes.png</file>
|
||||
<file>article-style-st-lingoes-blue.css</file>
|
||||
<file>icons/mdict.png</file>
|
||||
<file>icons/downarrow.png</file>
|
||||
<file>icons/blank.png</file>
|
||||
|
@ -94,17 +87,7 @@
|
|||
<file>icons/1downarrow.svg</file>
|
||||
<file>icons/wizard-selected.svg</file>
|
||||
<file>icons/mdict-bg.png</file>
|
||||
<file>article-style-st-classic.css</file>
|
||||
<file>icons/old-arrow.png</file>
|
||||
<file>icons/old-downarrow.png</file>
|
||||
<file>src/qtstyle/qt-babylon.css</file>
|
||||
<file>src/qtstyle/qt-classic.css</file>
|
||||
<file>src/qtstyle/qt-lingoes-blue.css</file>
|
||||
<file>src/qtstyle/qt-lingoes.css</file>
|
||||
<file>src/qtstyle/qt-lingvo.css</file>
|
||||
<file>src/qtstyle/qt-modern.css</file>
|
||||
<file>src/qtstyle/qt-style-macos.css</file>
|
||||
<file>src/qtstyle/qt-style-win.css</file>
|
||||
<file>src/qtstyle/qt-style.css</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
Qt style sheets
|
||||
|
||||
Loading order:
|
||||
|
||||
1. qt-style.css will be loaded first.
|
||||
2. platform specific styles -> qt-style-macos.css and qt-style-win.css
|
||||
(3.) On windows, additional style will be loaded according to Article View's style.
|
||||
|
||||
--
|
||||
|
||||
Qt Style Sheets Reference:
|
||||
|
||||
https://doc.qt.io/qt-6/stylesheet-reference.html
|
21
src/stylesheets/css.qrc
Normal file
21
src/stylesheets/css.qrc
Normal file
|
@ -0,0 +1,21 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>article-style.css</file>
|
||||
<file>article-style-print.css</file>
|
||||
<file>article-style-st-lingvo.css</file>
|
||||
<file>article-style-st-babylon.css</file>
|
||||
<file>article-style-st-modern.css</file>
|
||||
<file>article-style-st-lingoes.css</file>
|
||||
<file>article-style-st-lingoes-blue.css</file>
|
||||
<file>article-style-st-classic.css</file>
|
||||
<file>qt-babylon.css</file>
|
||||
<file>qt-classic.css</file>
|
||||
<file>qt-lingoes-blue.css</file>
|
||||
<file>qt-lingoes.css</file>
|
||||
<file>qt-lingvo.css</file>
|
||||
<file>qt-modern.css</file>
|
||||
<file>qt-style-macos.css</file>
|
||||
<file>qt-style-win.css</file>
|
||||
<file>qt-style.css</file>
|
||||
</qresource>
|
||||
</RCC>
|
Loading…
Reference in a new issue