refactor: move none c++ source files into src/

This commit is contained in:
shenleban tongying 2023-04-17 13:40:05 -04:00
parent cfff9cd026
commit 20230542d6
No known key found for this signature in database
39 changed files with 34 additions and 110 deletions

View file

@ -131,27 +131,12 @@ set(QRC_RESOURCES
flags.qrc flags.qrc
resources.qrc resources.qrc
scripts.qrc scripts.qrc
src/stylesheets/css.qrc
) )
set(UI_SRC # auto discovery of ui files https://cmake.org/cmake/help/v3.26/prop_tgt/AUTOUIC_SEARCH_PATHS.html
about.ui set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/src/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
)
if(WITH_EPWING_SUPPORT) if(WITH_EPWING_SUPPORT)
set(EPWING_SUPPORT_SRC set(EPWING_SUPPORT_SRC
epwing.cc epwing.cc
@ -186,7 +171,6 @@ if(WITH_FFMPEG_PLAYER)
endif() endif()
set(PROJECT_SOURCES set(PROJECT_SOURCES
${UI_SRC}
${MAC_SRC} ${MAC_SRC}
${QRC_RESOURCES} ${QRC_RESOURCES}
${EPWING_SUPPORT_SRC} ${EPWING_SUPPORT_SRC}

View file

@ -399,20 +399,7 @@ HEADERS += folding.hh \
src/ui/ftssearchpanel.h \ src/ui/ftssearchpanel.h \
src/ui/searchpanel.h src/ui/searchpanel.h
FORMS += groups.ui \ FORMS += $$files(src/ui/*.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
SOURCES += folding.cc \ SOURCES += folding.cc \
ankiconnector.cpp \ ankiconnector.cpp \
@ -533,7 +520,6 @@ SOURCES += folding.cc \
src/ui/searchpanel.cpp src/ui/searchpanel.cpp
#speech to text #speech to text
FORMS += texttospeechsource.ui
SOURCES += speechclient.cc \ SOURCES += speechclient.cc \
texttospeechsource.cc texttospeechsource.cc
HEADERS += texttospeechsource.hh \ HEADERS += texttospeechsource.hh \
@ -586,48 +572,11 @@ CONFIG( chinese_conversion_support ) {
RESOURCES += resources.qrc \ RESOURCES += resources.qrc \
scripts.qrc \ scripts.qrc \
flags.qrc flags.qrc \
src/stylesheets/css.qrc
#EXTRA_TRANSLATIONS += thirdparty/qwebengine_ts/qtwebengine_zh_CN.ts #EXTRA_TRANSLATIONS += thirdparty/qwebengine_ts/qtwebengine_zh_CN.ts
TRANSLATIONS += locale/ru_RU.ts \ TRANSLATIONS += $$files(locale/*.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
# Build version file # Build version file
!isEmpty( hasGit ) { !isEmpty( hasGit ) {
PRE_TARGETDEPS += $$PWD/version.txt PRE_TARGETDEPS += $$PWD/version.txt

View file

@ -1199,25 +1199,25 @@ void MainWindow::applyQtStyleSheet( QString const & addonStyle,QString const & d
} }
#endif #endif
QFile builtInCssFile( ":src/qtstyle/qt-style.css" ); QFile builtInCssFile( ":qt-style.css" );
builtInCssFile.open( QFile::ReadOnly ); builtInCssFile.open( QFile::ReadOnly );
QByteArray css = builtInCssFile.readAll(); QByteArray css = builtInCssFile.readAll();
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
QFile macCssFile( ":src/qtstyle/qt-style-macos.css" ); QFile macCssFile( ":qt-style-macos.css" );
macCssFile.open( QFile::ReadOnly ); macCssFile.open( QFile::ReadOnly );
css += macCssFile.readAll(); css += macCssFile.readAll();
#endif #endif
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
QFile winCssFile( ":src/qtstyle/qt-style-win.css" ); QFile winCssFile( ":qt-style-win.css" );
winCssFile.open( QFile::ReadOnly ); winCssFile.open( QFile::ReadOnly );
css += winCssFile.readAll(); css += winCssFile.readAll();
// Load an additional stylesheet // Load an additional stylesheet
// Dark Mode doesn't work nice with custom qt style sheets, // Dark Mode doesn't work nice with custom qt style sheets,
if (!darkMode){ 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 ) ){ if ( additionalStyle.open( QFile::ReadOnly ) ){
css += additionalStyle.readAll(); css += additionalStyle.readAll();
} }

View file

@ -8,8 +8,6 @@
<file>icons/programicon.png</file> <file>icons/programicon.png</file>
<file>icons/programicon_scan.png</file> <file>icons/programicon_scan.png</file>
<file>icons/warning.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_dsl.png</file>
<file>icons/icon32_stardict.png</file> <file>icons/icon32_stardict.png</file>
<file>icons/icon32_xdxf.png</file> <file>icons/icon32_xdxf.png</file>
@ -18,7 +16,6 @@
<file>icons/icon32_hunspell.png</file> <file>icons/icon32_hunspell.png</file>
<file>icons/icon32_wiki.png</file> <file>icons/icon32_wiki.png</file>
<file>icons/wiktionary.png</file> <file>icons/wiktionary.png</file>
<file>article-style-st-lingvo.css</file>
<file>icons/icon_dsl_native.png</file> <file>icons/icon_dsl_native.png</file>
<file>icons/forvo.png</file> <file>icons/forvo.png</file>
<file>icons/lingualibre.svg</file> <file>icons/lingualibre.svg</file>
@ -29,13 +26,9 @@
<file>icons/icon32_aard.png</file> <file>icons/icon32_aard.png</file>
<file>icons/expand_opt.png</file> <file>icons/expand_opt.png</file>
<file>icons/collapse_opt.png</file> <file>icons/collapse_opt.png</file>
<file>article-style-st-babylon.css</file>
<file>icons/menu_button.svg</file> <file>icons/menu_button.svg</file>
<file>icons/clear.png</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>icons/icon32_lingoes.png</file>
<file>article-style-st-lingoes-blue.css</file>
<file>icons/mdict.png</file> <file>icons/mdict.png</file>
<file>icons/downarrow.png</file> <file>icons/downarrow.png</file>
<file>icons/blank.png</file> <file>icons/blank.png</file>
@ -94,17 +87,7 @@
<file>icons/1downarrow.svg</file> <file>icons/1downarrow.svg</file>
<file>icons/wizard-selected.svg</file> <file>icons/wizard-selected.svg</file>
<file>icons/mdict-bg.png</file> <file>icons/mdict-bg.png</file>
<file>article-style-st-classic.css</file>
<file>icons/old-arrow.png</file> <file>icons/old-arrow.png</file>
<file>icons/old-downarrow.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> </qresource>
</RCC> </RCC>

View file

@ -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
View 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>