├── .github └── FUNDING.yml ├── .gitignore ├── CMakeLists.txt ├── ChangeLog ├── Doxyfile ├── LICENSE ├── LICENSE.LGPLv3 ├── README.md ├── README_cn.md ├── README_tc.md ├── TTKCommon ├── CMakeLists.txt ├── TTKApplication │ ├── TTKApplication.pri │ ├── TTKCoreApplication.pri │ ├── TTKGuiApplication.pri │ ├── ttkapplication.cpp │ ├── ttkapplication.h │ ├── ttkcoreapplication.cpp │ ├── ttkcoreapplication.h │ ├── ttkguiapplication.cpp │ ├── ttkguiapplication.h │ ├── ttklocalpeer.cpp │ ├── ttklocalpeer.h │ ├── ttklockedfile.cpp │ ├── ttklockedfile.h │ ├── ttklockedfile_unix.cpp │ └── ttklockedfile_win.cpp ├── TTKCommon.pri ├── TTKCommon.pro ├── TTKDumper │ ├── CMakeLists.txt │ ├── TTKDumper.pro │ ├── TTKDumper.rc │ ├── miniprocess.cpp │ ├── miniprocess.h │ ├── ttkdumper.cpp │ └── ttkdumper.h ├── TTKLibrary │ ├── CMakeLists.txt │ ├── TTKLibrary.pro │ ├── TTKLibrary.qrc │ ├── TTKLibrary.rc │ ├── resource │ │ └── shadow │ │ │ ├── lb_bottom.png │ │ │ ├── lb_left.png │ │ │ ├── lb_left_bottom.png │ │ │ ├── lb_left_top.png │ │ │ ├── lb_right.png │ │ │ ├── lb_right_bottom.png │ │ │ ├── lb_right_top.png │ │ │ └── lb_top.png │ ├── ttkabstractbufferinterface.h │ ├── ttkabstractmovedialog.cpp │ ├── ttkabstractmovedialog.h │ ├── ttkabstractmoveresizewidget.cpp │ ├── ttkabstractmoveresizewidget.h │ ├── ttkabstractmovewidget.cpp │ ├── ttkabstractmovewidget.h │ ├── ttkabstractnetwork.cpp │ ├── ttkabstractnetwork.h │ ├── ttkabstractresizeinterface.h │ ├── ttkabstracttablewidget.cpp │ ├── ttkabstracttablewidget.h │ ├── ttkabstractthread.cpp │ ├── ttkabstractthread.h │ ├── ttkabstractxml.cpp │ ├── ttkabstractxml.h │ ├── ttkany.cpp │ ├── ttkany.h │ ├── ttkclickedgroup.cpp │ ├── ttkclickedgroup.h │ ├── ttkclickedlabel.cpp │ ├── ttkclickedlabel.h │ ├── ttkclickedslider.cpp │ ├── ttkclickedslider.h │ ├── ttkcommandline.cpp │ ├── ttkcommandline.h │ ├── ttkconcurrent.h │ ├── ttkconcurrentqueue.h │ ├── ttkcryptographichash.cpp │ ├── ttkcryptographichash.h │ ├── ttkdefer.h │ ├── ttkdesktopscreen.cpp │ ├── ttkdesktopscreen.h │ ├── ttkdispatchmanager.cpp │ ├── ttkdispatchmanager.h │ ├── ttkeventloop.cpp │ ├── ttkeventloop.h │ ├── ttkfileassociation.cpp │ ├── ttkfileassociation.h │ ├── ttkfileinterface.h │ ├── ttkfunctor.h │ ├── ttkglobalinterface.cpp │ ├── ttkglobalinterface.h │ ├── ttkitemdelegate.cpp │ ├── ttkitemdelegate.h │ ├── ttklexicalcast.h │ ├── ttklibrary.h │ ├── ttklibraryversion.h │ ├── ttklogoutput.cpp │ ├── ttklogoutput.h │ ├── ttkoptional.h │ ├── ttkplatformsystem.cpp │ ├── ttkplatformsystem.h │ ├── ttksmartptr.h │ ├── ttkspinlock.h │ ├── ttkstringliterals.h │ ├── ttkstringview.h │ ├── ttksuperenum.cpp │ ├── ttksuperenum.h │ ├── ttktabbutton.cpp │ ├── ttktabbutton.h │ ├── ttkthemelinelabel.cpp │ ├── ttkthemelinelabel.h │ ├── ttktime.cpp │ ├── ttktime.h │ ├── ttktoastlabel.cpp │ ├── ttktoastlabel.h │ ├── ttktree.h │ ├── ttkunsortedmap.h │ └── ttkvariant.h ├── TTKRun │ ├── TTKRun.pri │ ├── ttkrunobject.cpp │ └── ttkrunobject.h ├── base │ ├── ttkcompat.h │ ├── ttkglobal.h │ ├── ttklogger.h │ ├── ttkmoduleexport.h │ ├── ttkprivate.h │ ├── ttkqtcompat.h │ ├── ttkqtglobal.h │ ├── ttkqtobject.h │ ├── ttksingleton.h │ └── ttktraits.h ├── compat │ ├── compat.h │ ├── compat.pri │ ├── int128.h │ ├── integer.h │ ├── strlcat.c │ └── strlcpy.c ├── config.pri ├── config │ ├── CMakeLists.txt │ ├── config.pro │ ├── config.tests │ │ ├── default │ │ │ ├── default.cpp │ │ │ └── default.pro │ │ ├── strlcat │ │ │ ├── strlcat.cpp │ │ │ └── strlcat.pro │ │ └── strlcpy │ │ │ ├── strlcpy.cpp │ │ │ └── strlcpy.pro │ ├── main.cpp │ ├── ttkconfig.h.cmake │ └── ttkconfig.h.qmake ├── ttkobject.h └── ttkversion.h ├── TTKConfig ├── CMakeLists.txt ├── TTKConfig.pro ├── TTKConfig.rc ├── downloadconfigdefine.h ├── downloadconfigmodule.cpp └── downloadconfigmodule.h ├── TTKDownloader.pri ├── TTKDownloader.pro ├── TTKLanguage ├── CMakeLists.txt └── cn.ts ├── TTKModule ├── CMakeLists.txt ├── TTKCore.rc ├── TTKCore │ ├── CMakeLists.txt │ ├── TTKCore.pri │ ├── downloadCoreKits │ │ ├── CMakeLists.txt │ │ ├── DownloadCoreKits.pri │ │ ├── downloadbackgroundconfigmanager.cpp │ │ ├── downloadbackgroundconfigmanager.h │ │ ├── downloadbackgroundmanager.cpp │ │ ├── downloadbackgroundmanager.h │ │ ├── downloadbreakpointconfigmanager.cpp │ │ ├── downloadbreakpointconfigmanager.h │ │ ├── downloadconfigmanager.cpp │ │ ├── downloadconfigmanager.h │ │ ├── downloadextractmanager.cpp │ │ ├── downloadextractmanager.h │ │ ├── downloadhotkeymanager.cpp │ │ ├── downloadhotkeymanager.h │ │ ├── downloadlistconfigmanager.cpp │ │ ├── downloadlistconfigmanager.h │ │ ├── downloadobject.h │ │ ├── downloadotherdefine.h │ │ ├── downloadrecordconfigmanager.cpp │ │ ├── downloadrecordconfigmanager.h │ │ ├── downloadruntimemanager.cpp │ │ ├── downloadruntimemanager.h │ │ └── downloadsettingmanager.h │ ├── downloadNetworkKits │ │ ├── CMakeLists.txt │ │ ├── DownloadNetworkKits.pri │ │ ├── downloadabstractnetwork.h │ │ ├── downloadabstractrequest.cpp │ │ ├── downloadabstractrequest.h │ │ ├── downloaddatasourcerequest.cpp │ │ ├── downloaddatasourcerequest.h │ │ ├── downloadnetworkspeedthread.cpp │ │ ├── downloadnetworkspeedthread.h │ │ ├── downloadnetworkthread.cpp │ │ ├── downloadnetworkthread.h │ │ ├── downloadqueuerequest.cpp │ │ ├── downloadqueuerequest.h │ │ ├── downloadthread.cpp │ │ ├── downloadthread.h │ │ ├── downloadthreadmanager.cpp │ │ ├── downloadthreadmanager.h │ │ ├── downloadthunderskinrequest.cpp │ │ ├── downloadthunderskinrequest.h │ │ ├── downloadurlencoder.cpp │ │ └── downloadurlencoder.h │ └── downloadUtilsKits │ │ ├── CMakeLists.txt │ │ ├── DownloadUtilsKits.pri │ │ ├── downloadalgorithmutils.cpp │ │ ├── downloadalgorithmutils.h │ │ ├── downloadcodecutils.cpp │ │ ├── downloadcodecutils.h │ │ ├── downloadcoreutils.cpp │ │ ├── downloadcoreutils.h │ │ ├── downloadfileutils.cpp │ │ ├── downloadfileutils.h │ │ ├── downloadimageutils.cpp │ │ ├── downloadimageutils.h │ │ ├── downloadnumberutils.cpp │ │ ├── downloadnumberutils.h │ │ ├── downloadstringutils.cpp │ │ ├── downloadstringutils.h │ │ ├── downloadurlutils.cpp │ │ ├── downloadurlutils.h │ │ ├── downloadwidgetutils.cpp │ │ └── downloadwidgetutils.h ├── TTKModule.pri ├── TTKModule.pro ├── TTKWidget │ ├── CMakeLists.txt │ ├── TTKWidget.pri │ ├── downloadCoreKits │ │ ├── CMakeLists.txt │ │ ├── DownloadCoreKits.pri │ │ ├── downloadabstractmovedialog.cpp │ │ ├── downloadabstractmovedialog.h │ │ ├── downloadabstractmovewidget.cpp │ │ ├── downloadabstractmovewidget.h │ │ ├── downloadabstracttablewidget.cpp │ │ ├── downloadabstracttablewidget.h │ │ ├── downloadanimationstackedwidget.cpp │ │ ├── downloadanimationstackedwidget.h │ │ ├── downloadcolordialog.cpp │ │ ├── downloadcolordialog.h │ │ ├── downloadmessagebox.cpp │ │ ├── downloadmessagebox.h │ │ ├── downloadtoollabelbutton.cpp │ │ ├── downloadtoollabelbutton.h │ │ ├── downloadtoolmenuwidget.cpp │ │ ├── downloadtoolmenuwidget.h │ │ ├── downloadtransitionanimationlabel.cpp │ │ ├── downloadtransitionanimationlabel.h │ │ ├── downloadwidgetrenderer.cpp │ │ └── downloadwidgetrenderer.h │ ├── downloadRemoteKits │ │ ├── CMakeLists.txt │ │ ├── DownloadRemoteKits.pri │ │ ├── downloadremotewidget.cpp │ │ └── downloadremotewidget.h │ ├── downloadUiKits │ │ ├── CMakeLists.txt │ │ ├── DownloadUiKits.pri │ │ ├── downloadapplication.ui │ │ ├── downloadbackgroundskindialog.ui │ │ ├── downloadcolordialog.ui │ │ ├── downloadfunctionuiobject.h │ │ ├── downloadmessageaboutdialog.ui │ │ ├── downloadmessagebox.ui │ │ ├── downloadnewfiledialog.ui │ │ ├── downloadsettingwidget.ui │ │ ├── downloadtinyuiobject.h │ │ └── downloaduiobject.h │ └── downloadWidgetKits │ │ ├── CMakeLists.txt │ │ ├── DownloadWidgetKits.pri │ │ ├── downloadbackgroundlistwidget.cpp │ │ ├── downloadbackgroundlistwidget.h │ │ ├── downloadbackgroundpopwidget.cpp │ │ ├── downloadbackgroundpopwidget.h │ │ ├── downloadbackgroundremotewidget.cpp │ │ ├── downloadbackgroundremotewidget.h │ │ ├── downloadbackgroundskindialog.cpp │ │ ├── downloadbackgroundskindialog.h │ │ ├── downloadfunctionlistwidget.cpp │ │ ├── downloadfunctionlistwidget.h │ │ ├── downloadfuntionanimationwidget.cpp │ │ ├── downloadfuntionanimationwidget.h │ │ ├── downloadglobalhotkeyedit.cpp │ │ ├── downloadglobalhotkeyedit.h │ │ ├── downloadhistoryrecordwidget.cpp │ │ ├── downloadhistoryrecordwidget.h │ │ ├── downloadlistitemwidget.cpp │ │ ├── downloadlistitemwidget.h │ │ ├── downloadlistwidgets.cpp │ │ ├── downloadlistwidgets.h │ │ ├── downloadmessageaboutdialog.cpp │ │ ├── downloadmessageaboutdialog.h │ │ ├── downloadnewfiledialog.cpp │ │ ├── downloadnewfiledialog.h │ │ ├── downloadsettingwidget.cpp │ │ ├── downloadsettingwidget.h │ │ ├── downloadsystemtraymenu.cpp │ │ ├── downloadsystemtraymenu.h │ │ ├── downloadunits.cpp │ │ └── downloadunits.h ├── downloadapplication.cpp ├── downloadapplication.h ├── downloadapplicationmodule.cpp ├── downloadapplicationmodule.h ├── downloadbottomareawidget.cpp ├── downloadbottomareawidget.h ├── downloadleftareawidget.cpp ├── downloadleftareawidget.h ├── downloadrightareawidget.cpp ├── downloadrightareawidget.h ├── downloadtopareawidget.cpp └── downloadtopareawidget.h ├── TTKResource ├── 1.ico ├── 2.ico ├── 3.ico ├── 4.ico ├── _extras │ ├── TTKConsole.sh │ ├── TTKDownloader.sh │ ├── TTKInit.sh │ ├── TTKRoutine.sh │ ├── TTKRoutineCopy.sh │ ├── TTKService.sh │ ├── avnets.sh │ ├── config.xml │ ├── history.tkf │ ├── list.tkpl │ └── sound.wav ├── appTools │ ├── item_delete_clicked.png │ ├── item_delete_hover.png │ ├── item_delete_normal.png │ ├── item_download_clicked.png │ ├── item_download_hover.png │ ├── item_download_normal.png │ ├── item_finished_clicked.png │ ├── item_finished_hover.png │ └── item_finished_normal.png ├── contextMenu │ ├── btn_download.png │ ├── btn_keyboard.png │ ├── btn_setting.png │ ├── btn_transparent.png │ ├── btn_window.png │ ├── lb_custom.png │ ├── lb_new_normal.png │ ├── lb_protection.png │ ├── lb_quit_normal.png │ ├── lb_selected.png │ ├── lb_setting.png │ ├── lb_setting_normal.png │ ├── lb_start_normal.png │ └── lb_stop_normal.png ├── controls │ ├── btn_checkBox_checked.png │ ├── btn_checkBox_unchecked.png │ ├── btn_radioButton_unchecked.png │ ├── btn_radiobutton_checked.png │ ├── lb_slider_disable.png │ ├── lb_slider_handle_hover.png │ └── lb_slider_handle_normal.png ├── demo │ ├── demo.jpg │ └── demo2.jpg ├── functions │ ├── btn_close_hover.png │ ├── btn_delete_disable.png │ ├── btn_delete_hover.png │ ├── btn_delete_normal.png │ ├── btn_new_disable.png │ ├── btn_new_hover.png │ ├── btn_new_normal.png │ ├── btn_setting_disable.png │ ├── btn_setting_hover.png │ ├── btn_setting_normal.png │ ├── btn_start_disable.png │ ├── btn_start_hover.png │ ├── btn_start_normal.png │ ├── btn_stop_disable.png │ ├── btn_stop_hover.png │ ├── btn_stop_normal.png │ ├── lb_download.png │ ├── lb_left.png │ ├── lb_order.png │ ├── lb_plan.png │ ├── lb_right.png │ └── lb_upload.png ├── lb_app_logo.ico ├── lb_blankImage.png ├── lb_noneImage.png ├── lb_slider.png ├── logo_banner.png ├── remote │ └── lb_back.png ├── tiny │ ├── btn_close_hover.png │ ├── btn_close_normal.png │ ├── btn_max_hover.png │ ├── btn_max_normal.png │ ├── btn_min_hover.png │ ├── btn_min_normal.png │ ├── btn_setting_hover.png │ ├── btn_setting_normal.png │ ├── btn_skin_hover.png │ ├── btn_skin_normal.png │ ├── lb_arrow_up_normal.png │ ├── lb_resize_normal.png │ ├── lb_selected.png │ └── lb_transparent.png └── usermanager │ ├── btn_down_arrow.png │ └── btn_up_arrow.png ├── TTKRun ├── CMakeLists.txt ├── TTKApp │ ├── CMakeLists.txt │ ├── TTKApp.pro │ ├── TTKApp.rc │ └── ttkrunmain.cpp ├── TTKConsole │ ├── CMakeLists.txt │ ├── TTKConsole.pro │ ├── TTKConsole.rc │ ├── downloadconsolemain.cpp │ ├── downloadconsolemodule.cpp │ └── downloadconsolemodule.h ├── TTKInit │ ├── CMakeLists.txt │ ├── TTKInit.pro │ ├── TTKInit.rc │ └── downloadinitmain.cpp └── TTKRun.pro ├── TTKService ├── CMakeLists.txt ├── TTKService.pro ├── TTKService.rc └── downloadservicemain.cpp ├── TTKThirdParty ├── CMakeLists.txt ├── TTKExtras │ ├── CMakeLists.txt │ ├── TTKExtras.pro │ ├── TTKExtras.rc │ ├── qjson │ │ ├── QJson.pri │ │ ├── README.txt │ │ ├── flexlexer.h │ │ ├── json_parser.cc │ │ ├── json_parser.hh │ │ ├── json_scanner.cc │ │ ├── json_scanner.cpp │ │ ├── json_scanner.h │ │ ├── location.hh │ │ ├── parser.cpp │ │ ├── parser.h │ │ ├── parser_p.h │ │ ├── parserrunnable.cpp │ │ ├── parserrunnable.h │ │ ├── position.hh │ │ ├── qjson_debug.h │ │ ├── qobjecthelper.cpp │ │ ├── qobjecthelper.h │ │ ├── serializer.cpp │ │ ├── serializer.h │ │ ├── serializerrunnable.cpp │ │ ├── serializerrunnable.h │ │ └── stack.hh │ └── qshortcut │ │ ├── QShortCut.pri │ │ ├── README.txt │ │ ├── qglobalshortcut.cpp │ │ ├── qglobalshortcut.h │ │ ├── qglobalshortcut_mac.cpp │ │ ├── qglobalshortcut_p.h │ │ ├── qglobalshortcut_win.cpp │ │ └── qglobalshortcut_x11.cpp ├── TTKThirdParty.pri ├── TTKThirdParty.pro └── Zlib │ ├── CMakeLists.txt │ ├── Zlib.pro │ ├── ttkzip │ ├── CMakeLists.txt │ ├── crypt.h │ ├── ioapi.c │ ├── ioapi.h │ ├── iowin32.c │ ├── iowin32.h │ ├── mztools.c │ ├── mztools.h │ ├── ttkzip.pro │ ├── ttkzip.rc │ ├── unzip.c │ ├── unzip.h │ ├── zip.c │ └── zip.h │ └── zlib │ ├── CMakeLists.txt │ ├── adler32.c │ ├── compress.c │ ├── crc32.c │ ├── crc32.h │ ├── deflate.c │ ├── deflate.h │ ├── gzclose.c │ ├── gzguts.h │ ├── gzlib.c │ ├── gzread.c │ ├── gzwrite.c │ ├── infback.c │ ├── inffast.c │ ├── inffast.h │ ├── inffixed.h │ ├── inflate.c │ ├── inflate.h │ ├── inftrees.c │ ├── inftrees.h │ ├── trees.c │ ├── trees.h │ ├── uncompr.c │ ├── zconf.h │ ├── zlib.h │ ├── zlib.pro │ ├── zlib.rc │ ├── zutil.c │ └── zutil.h ├── TTKUi ├── CMakeLists.txt ├── TTKApp.qrc ├── TTKModule.qrc ├── TTKUi.pro └── TTKUi.rc ├── TTKUtils ├── auc │ ├── make_auc.bat │ └── manifest ├── deploy │ ├── make_desktop.sh │ └── share │ │ ├── appdata │ │ └── ttkdownloader.appdata.xml │ │ └── pixmaps │ │ └── ttkdownloader.png ├── linux_time.sh ├── make_cert.bat ├── resource.sh ├── resource │ ├── LICENSE.QT-LICENSE-AGREEMENT │ ├── README.txt │ └── qicon.dll ├── ts_linux.sh ├── ts_win.bat └── ttk_runtime └── TTKVersion.pri /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | github: [Greedysky] 3 | patreon: # Replace with a single Patreon username 4 | open_collective: # Replace with a single Open Collective username 5 | ko_fi: # Replace with a single Ko-fi username 6 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 7 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 8 | liberapay: # Replace with a single Liberapay username 9 | issuehunt: # Replace with a single IssueHunt username 10 | otechie: # Replace with a single Otechie username 11 | custom: ['https://greedysky.github.io/sponsor'] 12 | 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # C++ objects and libs 2 | *.slo 3 | *.lo 4 | *.o 5 | *.a 6 | *.la 7 | *.lai 8 | 9 | # QtCreator 10 | *.bak 11 | *.autosave 12 | 13 | # Qt 14 | *.user 15 | *.user.* 16 | *.aps 17 | *.prl 18 | *.moc 19 | *moc_* 20 | qrc_*.cpp 21 | ui_*.h 22 | 23 | # Build 24 | Makefile* 25 | *build-* 26 | 27 | # Other 28 | *.*-pre1 29 | *.*~ 30 | *.uxf 31 | 32 | # Windows 33 | Thumbs.db 34 | ehthumbs.db 35 | Desktop.ini 36 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | v3.1.0.0 Final 2025.05.05 2 | 优化部分交互逻辑 3 | 优化其他一些细节 4 | 5 | ... 6 | 7 | -------------------------------------------------------------------------------- /TTKCommon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Library Module project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU Lesser General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU Lesser General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU Lesser General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | add_subdirectory(config) 22 | add_subdirectory(TTKLibrary) 23 | add_subdirectory(TTKDumper) 24 | -------------------------------------------------------------------------------- /TTKCommon/TTKApplication/TTKApplication.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Library Module project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU Lesser General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU Lesser General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU Lesser General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | QT += core gui network 20 | greaterThan(QT_MAJOR_VERSION, 4){ #Qt5 21 | QT += widgets 22 | } 23 | 24 | INCLUDEPATH += $$PWD 25 | 26 | HEADERS += \ 27 | $$PWD/ttklocalpeer.h \ 28 | $$PWD/ttkapplication.h 29 | 30 | SOURCES += \ 31 | $$PWD/ttklocalpeer.cpp \ 32 | $$PWD/ttkapplication.cpp 33 | -------------------------------------------------------------------------------- /TTKCommon/TTKApplication/TTKCoreApplication.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Library Module project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU Lesser General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU Lesser General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU Lesser General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | QT += core network 20 | 21 | INCLUDEPATH += $$PWD 22 | 23 | HEADERS += \ 24 | $$PWD/ttklocalpeer.h \ 25 | $$PWD/ttkcoreapplication.h 26 | 27 | SOURCES += \ 28 | $$PWD/ttklocalpeer.cpp \ 29 | $$PWD/ttkcoreapplication.cpp 30 | -------------------------------------------------------------------------------- /TTKCommon/TTKApplication/TTKGuiApplication.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Library Module project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU Lesser General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU Lesser General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU Lesser General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | QT += core gui network 20 | 21 | INCLUDEPATH += $$PWD 22 | 23 | HEADERS += \ 24 | $$PWD/ttklocalpeer.h \ 25 | $$PWD/ttkguiapplication.h 26 | 27 | SOURCES += \ 28 | $$PWD/ttklocalpeer.cpp \ 29 | $$PWD/ttkguiapplication.cpp 30 | -------------------------------------------------------------------------------- /TTKCommon/TTKApplication/ttkcoreapplication.cpp: -------------------------------------------------------------------------------- 1 | #include "ttkcoreapplication.h" 2 | #include "ttklocalpeer.h" 3 | 4 | /*! @brief The class of the ttk core application private. 5 | * @author Greedysky 6 | */ 7 | class TTKCoreApplicationPrivate : public TTKPrivate 8 | { 9 | public: 10 | TTKCoreApplicationPrivate() noexcept; 11 | ~TTKCoreApplicationPrivate() noexcept; 12 | 13 | TTKLocalPeer *m_peer; 14 | }; 15 | 16 | TTKCoreApplicationPrivate::TTKCoreApplicationPrivate() noexcept 17 | : m_peer(nullptr) 18 | { 19 | 20 | } 21 | 22 | TTKCoreApplicationPrivate::~TTKCoreApplicationPrivate() noexcept 23 | { 24 | delete m_peer; 25 | } 26 | 27 | 28 | 29 | TTKCoreApplication::TTKCoreApplication(int &argc, char **argv) 30 | : QCoreApplication(argc, argv) 31 | { 32 | TTK_INIT_PRIVATE(TTKCoreApplication); 33 | initialize(); 34 | } 35 | 36 | TTKCoreApplication::TTKCoreApplication(const QString &id, int &argc, char **argv) 37 | : QCoreApplication(argc, argv) 38 | { 39 | TTK_INIT_PRIVATE(TTKCoreApplication); 40 | initialize(id); 41 | } 42 | 43 | bool TTKCoreApplication::isRunning() const 44 | { 45 | TTK_D(TTKCoreApplication); 46 | return d->m_peer->isClient(); 47 | } 48 | 49 | QString TTKCoreApplication::id() const noexcept 50 | { 51 | TTK_D(TTKCoreApplication); 52 | return d->m_peer->applicationId(); 53 | } 54 | 55 | bool TTKCoreApplication::sendMessage(const QString &message, int timeout) 56 | { 57 | TTK_D(TTKCoreApplication); 58 | return d->m_peer->sendMessage(message, timeout); 59 | } 60 | 61 | void TTKCoreApplication::initialize(const QString &id) 62 | { 63 | TTK_D(TTKCoreApplication); 64 | d->m_peer = new TTKLocalPeer(this, id); 65 | connect(d->m_peer, SIGNAL(messageReceived(QString)), SIGNAL(messageReceived(QString))); 66 | } 67 | -------------------------------------------------------------------------------- /TTKCommon/TTKApplication/ttkguiapplication.cpp: -------------------------------------------------------------------------------- 1 | #include "ttkguiapplication.h" 2 | #include "ttklocalpeer.h" 3 | 4 | #include 5 | 6 | /*! @brief The class of the ttk gui application private. 7 | * @author Greedysky 8 | */ 9 | class TTKGuiApplicationPrivate : public TTKPrivate 10 | { 11 | public: 12 | TTKGuiApplicationPrivate() noexcept; 13 | ~TTKGuiApplicationPrivate() noexcept; 14 | 15 | TTKLocalPeer *m_peer; 16 | }; 17 | 18 | TTKGuiApplicationPrivate::TTKGuiApplicationPrivate() noexcept 19 | : m_peer(nullptr) 20 | { 21 | 22 | } 23 | 24 | TTKGuiApplicationPrivate::~TTKGuiApplicationPrivate() noexcept 25 | { 26 | delete m_peer; 27 | } 28 | 29 | 30 | 31 | TTKGuiApplication::TTKGuiApplication(int &argc, char **argv) 32 | : QGuiApplication(argc, argv) 33 | { 34 | TTK_INIT_PRIVATE(TTKGuiApplication); 35 | initialize(); 36 | } 37 | 38 | TTKGuiApplication::TTKGuiApplication(const QString &id, int &argc, char **argv) 39 | : QGuiApplication(argc, argv) 40 | { 41 | TTK_INIT_PRIVATE(TTKGuiApplication); 42 | initialize(id); 43 | } 44 | 45 | bool TTKGuiApplication::isRunning() const 46 | { 47 | TTK_D(TTKGuiApplication); 48 | return d->m_peer->isClient(); 49 | } 50 | 51 | QString TTKGuiApplication::id() const noexcept 52 | { 53 | TTK_D(TTKGuiApplication); 54 | return d->m_peer->applicationId(); 55 | } 56 | 57 | bool TTKGuiApplication::sendMessage(const QString &message, int timeout) 58 | { 59 | TTK_D(TTKGuiApplication); 60 | return d->m_peer->sendMessage(message, timeout); 61 | } 62 | 63 | void TTKGuiApplication::initialize(const QString &id) 64 | { 65 | TTK_D(TTKGuiApplication); 66 | d->m_peer = new TTKLocalPeer(this, id); 67 | connect(d->m_peer, SIGNAL(messageReceived(QString)), SIGNAL(messageReceived(QString))); 68 | } 69 | -------------------------------------------------------------------------------- /TTKCommon/TTKApplication/ttklockedfile.cpp: -------------------------------------------------------------------------------- 1 | #include "ttklockedfile.h" 2 | 3 | TTKLockedFile::TTKLockedFile() noexcept 4 | : QFile() 5 | { 6 | #ifdef Q_OS_WIN 7 | m_wmutex = 0; 8 | m_rmutex = 0; 9 | #endif 10 | m_lock_mode = NoLock; 11 | } 12 | 13 | TTKLockedFile::TTKLockedFile(const QString &name) noexcept 14 | : QFile(name) 15 | { 16 | #ifdef Q_OS_WIN 17 | m_wmutex = 0; 18 | m_rmutex = 0; 19 | #endif 20 | m_lock_mode = NoLock; 21 | } 22 | 23 | bool TTKLockedFile::open(OpenMode mode) 24 | { 25 | if (mode & QIODevice::Truncate) { 26 | qWarning("TTKLockedFile::open(): Truncate mode not allowed."); 27 | return false; 28 | } 29 | return QFile::open(mode); 30 | } 31 | 32 | bool TTKLockedFile::isLocked() const noexcept 33 | { 34 | return m_lock_mode != NoLock; 35 | } 36 | 37 | TTKLockedFile::LockMode TTKLockedFile::lockMode() const noexcept 38 | { 39 | return m_lock_mode; 40 | } 41 | -------------------------------------------------------------------------------- /TTKCommon/TTKApplication/ttklockedfile_unix.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "ttklockedfile.h" 7 | 8 | bool TTKLockedFile::lock(LockMode mode, bool block) 9 | { 10 | if (!isOpen()) { 11 | qWarning("TTKLockedFile::lock(): file is not opened"); 12 | return false; 13 | } 14 | 15 | if (mode == NoLock) 16 | return unlock(); 17 | 18 | if (mode == m_lock_mode) 19 | return true; 20 | 21 | if (m_lock_mode != NoLock) 22 | unlock(); 23 | 24 | struct flock fl; 25 | fl.l_whence = SEEK_SET; 26 | fl.l_start = 0; 27 | fl.l_len = 0; 28 | fl.l_type = (mode == ReadLock) ? F_RDLCK : F_WRLCK; 29 | int cmd = block ? F_SETLKW : F_SETLK; 30 | int ret = fcntl(handle(), cmd, &fl); 31 | 32 | if (ret == -1) { 33 | if (errno != EINTR && errno != EAGAIN) 34 | qWarning("TTKLockedFile::lock(): fcntl: %s", strerror(errno)); 35 | return false; 36 | } 37 | 38 | m_lock_mode = mode; 39 | return true; 40 | } 41 | 42 | bool TTKLockedFile::unlock() 43 | { 44 | if (!isOpen()) { 45 | qWarning("TTKLockedFile::unlock(): file is not opened"); 46 | return false; 47 | } 48 | 49 | if (!isLocked()) 50 | return true; 51 | 52 | struct flock fl; 53 | fl.l_whence = SEEK_SET; 54 | fl.l_start = 0; 55 | fl.l_len = 0; 56 | fl.l_type = F_UNLCK; 57 | int ret = fcntl(handle(), F_SETLKW, &fl); 58 | 59 | if (ret == -1) { 60 | qWarning("TTKLockedFile::lock(): fcntl: %s", strerror(errno)); 61 | return false; 62 | } 63 | 64 | m_lock_mode = NoLock; 65 | return true; 66 | } 67 | 68 | TTKLockedFile::~TTKLockedFile() 69 | { 70 | if (isOpen()) 71 | unlock(); 72 | } 73 | -------------------------------------------------------------------------------- /TTKCommon/TTKCommon.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Library Module project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU Lesser General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU Lesser General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU Lesser General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | TEMPLATE = subdirs 20 | CONFIG += ordered 21 | SUBDIRS += config TTKLibrary TTKDumper 22 | -------------------------------------------------------------------------------- /TTKCommon/TTKDumper/TTKDumper.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Library Module project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU Lesser General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU Lesser General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU Lesser General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | QT += core 20 | 21 | TEMPLATE = lib 22 | CONFIG += plugin lib 23 | 24 | include($$PWD/../../TTKVersion.pri) 25 | 26 | DESTDIR = $$OUT_PWD/../../bin/$$TTK_VERSION 27 | TARGET = TTKDumper 28 | 29 | DEFINES += TTK_LIBRARY 30 | 31 | win32:LIBS += -lpsapi 32 | win32:msvc{ 33 | CONFIG += c++11 34 | DEFINES += _CRT_SECURE_NO_WARNINGS 35 | }else{ 36 | equals(QT_MAJOR_VERSION, 6){ #Qt6 37 | QMAKE_CXXFLAGS += -std=c++17 38 | }else{ 39 | QMAKE_CXXFLAGS += -std=c++11 40 | } 41 | } 42 | 43 | INCLUDEPATH += \ 44 | $$PWD/../ \ 45 | $$PWD/../base 46 | 47 | HEADERS += \ 48 | $$PWD/miniprocess.h \ 49 | $$PWD/ttkdumper.h 50 | 51 | SOURCES += \ 52 | $$PWD/miniprocess.cpp \ 53 | $$PWD/ttkdumper.cpp 54 | 55 | win32:RC_FILE = $$PWD/$${TARGET}.rc 56 | -------------------------------------------------------------------------------- /TTKCommon/TTKDumper/TTKDumper.rc: -------------------------------------------------------------------------------- 1 | #if defined(UNDER_CE) 2 | include 3 | #else 4 | #include 5 | #endif 6 | #include "../ttkversion.h" 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION TTK_RC_FILEVERSION 10 | PRODUCTVERSION TTK_RC_FILEVERSION 11 | FILEFLAGSMASK 0x3fL 12 | 13 | #ifdef _DEBUG 14 | FILEFLAGS VS_FF_DEBUG 15 | #else 16 | FILEFLAGS 0x0L 17 | #endif 18 | 19 | FILEOS VOS__WINDOWS32 20 | FILETYPE VFT_DLL 21 | FILESUBTYPE 0x0L 22 | BEGIN 23 | BLOCK "StringFileInfo" 24 | BEGIN 25 | BLOCK "080404b0" 26 | BEGIN 27 | VALUE "CompanyName", TTK_RC_COMPANY 28 | VALUE "FileDescription", "TTKDumper" 29 | VALUE "FileVersion", TTK_RC_PRODUCTVERSION 30 | VALUE "LegalCopyright", TTK_RC_COPYRIGHT 31 | VALUE "ProductName", "TTKDumper" 32 | VALUE "ProductVersion", TTK_RC_PRODUCTVERSION 33 | END 34 | END 35 | BLOCK "VarFileInfo" 36 | BEGIN 37 | VALUE "Translation", 0x804, 1200 38 | END 39 | END 40 | -------------------------------------------------------------------------------- /TTKCommon/TTKDumper/miniprocess.h: -------------------------------------------------------------------------------- 1 | #ifndef MINIPROCESS_H 2 | #define MINIPROCESS_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkmoduleexport.h" 23 | 24 | /*! @brief The namespace of the process utils. 25 | * @author Greedysky 26 | */ 27 | namespace TTK 28 | { 29 | /*! 30 | * Kill process by name. 31 | */ 32 | TTK_MODULE_EXPORT void killProcessByName(const QString &process, bool more = false); 33 | /*! 34 | * Kill process by name list. 35 | */ 36 | TTK_MODULE_EXPORT void killProcessByName(const QStringList &processes, bool more = false); 37 | 38 | } 39 | 40 | #endif // MINIPROCESS_H 41 | -------------------------------------------------------------------------------- /TTKCommon/TTKDumper/ttkdumper.h: -------------------------------------------------------------------------------- 1 | #ifndef TTKDUMPER_H 2 | #define TTKDUMPER_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkprivate.h" 23 | #include "miniprocess.h" 24 | 25 | #if defined(_MSC_VER) 26 | # pragma warning(disable:4091) 27 | # pragma warning(disable:4100) 28 | #endif 29 | 30 | #include 31 | 32 | class TTKDumperPrivate; 33 | 34 | using TTKDumperFunctor = std::function; 35 | 36 | /*! @brief The class of the ttk dumper. 37 | * @author Greedysky 38 | */ 39 | class TTK_MODULE_EXPORT TTKDumper 40 | { 41 | public: 42 | /*! 43 | * Object constructor. 44 | */ 45 | TTKDumper() noexcept; 46 | TTKDumper(const TTKDumperFunctor &functor) noexcept; 47 | ~TTKDumper() noexcept; 48 | 49 | /*! 50 | * Run module. 51 | */ 52 | void run(); 53 | 54 | private: 55 | TTK_DECLARE_PRIVATE(TTKDumper) 56 | 57 | }; 58 | 59 | #endif // TTKDUMPER_H 60 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/TTKLibrary.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resource/shadow/lb_bottom.png 4 | resource/shadow/lb_left.png 5 | resource/shadow/lb_right.png 6 | resource/shadow/lb_top.png 7 | resource/shadow/lb_left_top.png 8 | resource/shadow/lb_right_top.png 9 | resource/shadow/lb_left_bottom.png 10 | resource/shadow/lb_right_bottom.png 11 | 12 | 13 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/TTKLibrary.rc: -------------------------------------------------------------------------------- 1 | #if defined(UNDER_CE) 2 | include 3 | #else 4 | #include 5 | #endif 6 | #include "ttklibraryversion.h" 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION TTK_RC_FILEVERSION 10 | PRODUCTVERSION TTK_RC_FILEVERSION 11 | FILEFLAGSMASK 0x3fL 12 | 13 | #ifdef _DEBUG 14 | FILEFLAGS VS_FF_DEBUG 15 | #else 16 | FILEFLAGS 0x0L 17 | #endif 18 | 19 | FILEOS VOS__WINDOWS32 20 | FILETYPE VFT_DLL 21 | FILESUBTYPE 0x0L 22 | BEGIN 23 | BLOCK "StringFileInfo" 24 | BEGIN 25 | BLOCK "080404b0" 26 | BEGIN 27 | VALUE "CompanyName", TTK_RC_COMPANY 28 | VALUE "FileDescription", "TTKLibrary" 29 | VALUE "FileVersion", TTK_RC_PRODUCTVERSION 30 | VALUE "LegalCopyright", TTK_RC_COPYRIGHT 31 | VALUE "ProductName", "TTKLibrary" 32 | VALUE "ProductVersion", TTK_RC_PRODUCTVERSION 33 | END 34 | END 35 | BLOCK "VarFileInfo" 36 | BEGIN 37 | VALUE "Translation", 0x804, 1200 38 | END 39 | END 40 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/resource/shadow/lb_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKCommon/TTKLibrary/resource/shadow/lb_bottom.png -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/resource/shadow/lb_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKCommon/TTKLibrary/resource/shadow/lb_left.png -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/resource/shadow/lb_left_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKCommon/TTKLibrary/resource/shadow/lb_left_bottom.png -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/resource/shadow/lb_left_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKCommon/TTKLibrary/resource/shadow/lb_left_top.png -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/resource/shadow/lb_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKCommon/TTKLibrary/resource/shadow/lb_right.png -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/resource/shadow/lb_right_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKCommon/TTKLibrary/resource/shadow/lb_right_bottom.png -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/resource/shadow/lb_right_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKCommon/TTKLibrary/resource/shadow/lb_right_top.png -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/resource/shadow/lb_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKCommon/TTKLibrary/resource/shadow/lb_top.png -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttkabstractmovedialog.cpp: -------------------------------------------------------------------------------- 1 | #include "ttkabstractmovedialog.h" 2 | #include "ttkglobalinterface.h" 3 | 4 | TTKAbstractMoveDialog::TTKAbstractMoveDialog(QWidget *parent) 5 | : TTKAbstractMoveDialog(true, parent) 6 | { 7 | 8 | } 9 | 10 | TTKAbstractMoveDialog::TTKAbstractMoveDialog(bool transparent, QWidget *parent) 11 | : QDialog(parent), 12 | m_blockOption(false), 13 | m_shadowOption(true), 14 | m_mouseLeftPressed(false) 15 | { 16 | setWindowFlags(Qt::Window | Qt::FramelessWindowHint); 17 | setAttribute(Qt::WA_TranslucentBackground, transparent); 18 | } 19 | 20 | void TTKAbstractMoveDialog::paintEvent(QPaintEvent *event) 21 | { 22 | QDialog::paintEvent(event); 23 | if(m_shadowOption) 24 | { 25 | QPainter painter(this); 26 | TTK::setBorderShadow(this, &painter); 27 | } 28 | } 29 | 30 | void TTKAbstractMoveDialog::mousePressEvent(QMouseEvent *event) 31 | { 32 | QDialog::mousePressEvent(event); 33 | if(event->button() == Qt::LeftButton && !m_blockOption) 34 | { 35 | m_mouseLeftPressed = true; 36 | } 37 | 38 | m_mousePressedAt = QtMouseGlobalPos(event); 39 | } 40 | 41 | void TTKAbstractMoveDialog::mouseMoveEvent(QMouseEvent *event) 42 | { 43 | QDialog::mouseMoveEvent(event); 44 | if(!m_mouseLeftPressed) 45 | { 46 | event->ignore(); 47 | return; 48 | } 49 | 50 | const int xpos = QtMouseGlobalX(event) - m_mousePressedAt.x(); 51 | const int ypos = QtMouseGlobalY(event) - m_mousePressedAt.y(); 52 | m_mousePressedAt = QtMouseGlobalPos(event); 53 | move(x() + xpos, y() + ypos); 54 | } 55 | 56 | void TTKAbstractMoveDialog::mouseReleaseEvent(QMouseEvent *event) 57 | { 58 | QDialog::mouseReleaseEvent(event); 59 | m_mousePressedAt = QtMouseGlobalPos(event); 60 | m_mouseLeftPressed = false; 61 | } 62 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttkabstractmovewidget.cpp: -------------------------------------------------------------------------------- 1 | #include "ttkabstractmovewidget.h" 2 | #include "ttkglobalinterface.h" 3 | 4 | TTKAbstractMoveWidget::TTKAbstractMoveWidget(QWidget *parent) 5 | : TTKAbstractMoveWidget(true, parent) 6 | { 7 | 8 | } 9 | 10 | TTKAbstractMoveWidget::TTKAbstractMoveWidget(bool transparent, QWidget *parent) 11 | : QWidget(parent), 12 | m_blockOption(false), 13 | m_shadowOption(true), 14 | m_mouseLeftPressed(false) 15 | { 16 | setWindowFlags(Qt::Window | Qt::FramelessWindowHint); 17 | setAttribute(Qt::WA_TranslucentBackground, transparent); 18 | } 19 | 20 | void TTKAbstractMoveWidget::paintEvent(QPaintEvent *event) 21 | { 22 | QWidget::paintEvent(event); 23 | 24 | if(m_shadowOption) 25 | { 26 | QPainter painter(this); 27 | TTK::setBorderShadow(this, &painter); 28 | } 29 | } 30 | 31 | void TTKAbstractMoveWidget::mousePressEvent(QMouseEvent *event) 32 | { 33 | QWidget::mousePressEvent(event); 34 | if(event->button() == Qt::LeftButton && !m_blockOption) 35 | { 36 | m_mouseLeftPressed = true; 37 | } 38 | 39 | m_mousePressedAt = QtMouseGlobalPos(event); 40 | } 41 | 42 | void TTKAbstractMoveWidget::mouseMoveEvent(QMouseEvent *event) 43 | { 44 | QWidget::mouseMoveEvent(event); 45 | if(!m_mouseLeftPressed) 46 | { 47 | event->ignore(); 48 | return; 49 | } 50 | 51 | const int xpos = QtMouseGlobalX(event) - m_mousePressedAt.x(); 52 | const int ypos = QtMouseGlobalY(event) - m_mousePressedAt.y(); 53 | m_mousePressedAt = QtMouseGlobalPos(event); 54 | move(x() + xpos, y() + ypos); 55 | } 56 | 57 | void TTKAbstractMoveWidget::mouseReleaseEvent(QMouseEvent *event) 58 | { 59 | QWidget::mouseReleaseEvent(event); 60 | m_mousePressedAt = QtMouseGlobalPos(event); 61 | m_mouseLeftPressed = false; 62 | } 63 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttkabstractresizeinterface.h: -------------------------------------------------------------------------------- 1 | #ifndef TTKABSTRACTRESIZEINTERFACE_H 2 | #define TTKABSTRACTRESIZEINTERFACE_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkmoduleexport.h" 23 | 24 | /*! @brief The class of the widget resize interface. 25 | * @author Greedysky 26 | */ 27 | class TTK_MODULE_EXPORT TTKAbstractResizeInterface 28 | { 29 | public: 30 | /*! 31 | * Object destructor. 32 | */ 33 | virtual ~TTKAbstractResizeInterface() = default; 34 | 35 | /*! 36 | * Resize widget bound by resize called. 37 | * Subclass should implement this function. 38 | */ 39 | virtual void resizeWidget() = 0; 40 | 41 | }; 42 | 43 | #endif // TTKABSTRACTRESIZEINTERFACE_H 44 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttkabstractthread.cpp: -------------------------------------------------------------------------------- 1 | #include "ttkabstractthread.h" 2 | 3 | TTKAbstractThread::TTKAbstractThread(QObject *parent) 4 | : QThread(parent), 5 | m_running(true) 6 | { 7 | 8 | } 9 | 10 | void TTKAbstractThread::stop() 11 | { 12 | m_running = false; 13 | if(isRunning()) 14 | { 15 | quit(); 16 | wait(); 17 | } 18 | } 19 | 20 | void TTKAbstractThread::start() 21 | { 22 | m_running = true; 23 | QThread::start(); 24 | } 25 | 26 | void TTKAbstractThread::run() 27 | { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttkany.cpp: -------------------------------------------------------------------------------- 1 | #include "ttkany.h" 2 | 3 | TTKAny::TTKAny() noexcept 4 | : m_type(std::type_index(typeid(void))) 5 | { 6 | 7 | } 8 | 9 | TTKAny::TTKAny(const TTKAny &other) noexcept 10 | : m_ptr(other.clone()) 11 | , m_type(other.m_type) 12 | { 13 | 14 | } 15 | 16 | TTKAny::TTKAny(TTKAny &&other) noexcept 17 | : m_ptr(std::move(other.m_ptr)) 18 | , m_type(std::move(other.m_type)) 19 | { 20 | 21 | } 22 | 23 | bool TTKAny::isNull() const noexcept 24 | { 25 | return !bool(m_ptr); 26 | } 27 | 28 | TTKAny& TTKAny::operator=(const TTKAny &other) noexcept 29 | { 30 | if(m_ptr == other.m_ptr) 31 | { 32 | return *this; 33 | } 34 | 35 | m_ptr = other.clone(); 36 | m_type = other.m_type; 37 | return *this; 38 | } 39 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttkclickedgroup.cpp: -------------------------------------------------------------------------------- 1 | #include "ttkclickedgroup.h" 2 | 3 | TTKClickedGroup::TTKClickedGroup(QObject *parent) 4 | : QObject(parent) 5 | { 6 | 7 | } 8 | 9 | void TTKClickedGroup::mapped(QWidget *widget) 10 | { 11 | m_container << widget; 12 | connect(widget, SIGNAL(clicked()), this, SLOT(update())); 13 | } 14 | 15 | void TTKClickedGroup::update() 16 | { 17 | QWidget *widget = TTKObjectCast(QWidget*, sender()); 18 | if(!widget) 19 | { 20 | return; 21 | } 22 | 23 | int index = -1; 24 | for(int i = 0; i < m_container.count(); ++i) 25 | { 26 | if(m_container[i] == widget) 27 | { 28 | index = i; 29 | break; 30 | } 31 | } 32 | 33 | if(index == -1) 34 | { 35 | return; 36 | } 37 | 38 | Q_EMIT clicked(index); 39 | } 40 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttkclickedlabel.cpp: -------------------------------------------------------------------------------- 1 | #include "ttkclickedlabel.h" 2 | 3 | #include 4 | 5 | TTKClickedLabel::TTKClickedLabel(QWidget *parent) 6 | : QLabel(parent) 7 | , m_blockOption(false) 8 | { 9 | setCursor(Qt::PointingHandCursor); 10 | } 11 | 12 | TTKClickedLabel::TTKClickedLabel(const QString &text, QWidget *parent) 13 | : QLabel(text, parent) 14 | , m_blockOption(false) 15 | { 16 | setCursor(Qt::PointingHandCursor); 17 | } 18 | 19 | void TTKClickedLabel::mousePressEvent(QMouseEvent *event) 20 | { 21 | // QLabel::mousePressEvent(event); 22 | if(event->button() == Qt::LeftButton && !m_blockOption) 23 | { 24 | Q_EMIT clicked(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttkconcurrent.h: -------------------------------------------------------------------------------- 1 | #ifndef TTKCONCURRENT_H 2 | #define TTKCONCURRENT_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkqtglobal.h" 23 | 24 | #if TTK_QT_VERSION_CHECK(5,0,0) 25 | # include 26 | #else 27 | # include 28 | #endif 29 | 30 | // marco concurrent 31 | #define TTKConcurrent_1(data) const auto TTK_CAT(ext_status_, __LINE__) = QtConcurrent::run([&]() data ); 32 | 33 | #ifndef Q_CC_MSVC 34 | # define TTKConcurrent(...) TTK_PP_OVERLOAD(TTKConcurrent_, __VA_ARGS__)(__VA_ARGS__) 35 | #else 36 | # define TTKConcurrent(...) TTK_PP_CAT(TTK_PP_OVERLOAD(TTKConcurrent_, __VA_ARGS__)(__VA_ARGS__), TTK_PP_EMPTY()) 37 | #endif 38 | 39 | #endif // TTKCONCURRENT_H 40 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttkeventloop.cpp: -------------------------------------------------------------------------------- 1 | #include "ttkeventloop.h" 2 | 3 | TTKEventLoop::TTKEventLoop(QObject *parent) 4 | : QEventLoop(parent) 5 | { 6 | m_timer.setInterval(10 * TTK_DN_S2MS); 7 | connect(&m_timer, SIGNAL(timeout()), SLOT(quit())); 8 | } 9 | 10 | TTKEventLoop::~TTKEventLoop() 11 | { 12 | quit(); 13 | } 14 | 15 | void TTKEventLoop::setTimeout(int msec) 16 | { 17 | m_timer.setInterval(msec); 18 | } 19 | 20 | int TTKEventLoop::exec(ProcessEventsFlags flags) 21 | { 22 | m_timer.start(); 23 | return QEventLoop::exec(flags); 24 | } 25 | 26 | void TTKEventLoop::quit() 27 | { 28 | m_timer.stop(); 29 | return QEventLoop::quit(); 30 | } 31 | 32 | void TTKEventLoop::exit() 33 | { 34 | m_timer.stop(); 35 | return QEventLoop::exit(); 36 | } 37 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttkglobalinterface.h: -------------------------------------------------------------------------------- 1 | #ifndef TTKGLOBALINTERFACE_H 2 | #define TTKGLOBALINTERFACE_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include 23 | #include "ttkmoduleexport.h" 24 | 25 | /*! @brief The namespace of the global interface. 26 | * @author Greedysky 27 | */ 28 | namespace TTK 29 | { 30 | /*! 31 | * Set application font. 32 | */ 33 | TTK_MODULE_EXPORT void setApplicationFont(); 34 | /*! 35 | * Set widget border shadow. 36 | */ 37 | TTK_MODULE_EXPORT void setBorderShadow(QWidget *widget, QPainter *painter); 38 | 39 | } 40 | 41 | #endif // TTKGLOBALINTERFACE_H 42 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttklexicalcast.h: -------------------------------------------------------------------------------- 1 | #ifndef TTKLEXICALCAST_H 2 | #define TTKLEXICALCAST_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkmoduleexport.h" 23 | 24 | /*! @brief The class of the ttk lexical cast. 25 | * @author Greedysky 26 | */ 27 | namespace TTK 28 | { 29 | template 30 | _Output lexical_cast(const _Input &input) 31 | { 32 | std::stringstream s; 33 | 34 | _Output ouput; 35 | if(!(s << input && s >> ouput && s.eof())) 36 | { 37 | throw std::bad_cast(); 38 | } 39 | return ouput; 40 | } 41 | } 42 | 43 | #ifdef TTK_CAST 44 | # define TTKLexicalCast(x, y) (TTK::lexical_cast(y)) 45 | #else 46 | # define TTKLexicalCast(x, y) ((x)(y)) 47 | #endif 48 | 49 | // compatiblity for std lexical_cast 50 | namespace std 51 | { 52 | using namespace TTK; 53 | } 54 | 55 | #endif // TTKLEXICALCAST_H 56 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttklibrary.h: -------------------------------------------------------------------------------- 1 | #ifndef TTKLIBRARY_H 2 | #define TTKLIBRARY_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | /*! @brief The namespace of the global defines. 23 | * @author Greedysky 24 | */ 25 | namespace TTK 26 | { 27 | enum class Direction 28 | { 29 | No = 0, 30 | Left = 1, 31 | Top = 2, 32 | Right = 4, 33 | Bottom = 8, 34 | LeftTop = Direction::Left | Direction::Top, 35 | LeftBottom = Direction::Left | Direction::Bottom, 36 | RightTop = Direction::Right | Direction::Top, 37 | RightBottom = Direction::Right | Direction::Bottom 38 | }; 39 | } 40 | 41 | #endif // TTKLIBRARY_H 42 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttklibraryversion.h: -------------------------------------------------------------------------------- 1 | #ifndef TTKLIBRARYVERSION_H 2 | #define TTKLIBRARYVERSION_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "../ttkversion.h" 23 | 24 | //update time 2025.04.23 25 | #define TTK_LIBRARY_MAJOR_VERSION 1 26 | #define TTK_LIBRARY_MINOR_VERSION 3 27 | #define TTK_LIBRARY_PATCH_VERSION 0 28 | 29 | #define TTK_LIBRARY_VERSION TTK_VERSION_CHECK(TTK_LIBRARY_MAJOR_VERSION, TTK_LIBRARY_MINOR_VERSION, TTK_LIBRARY_PATCH_VERSION, 0) 30 | #define TTK_LIBRARY_VERSION_STR TTK_VERSION_CHECK_STR(TTK_LIBRARY_MAJOR_VERSION, TTK_LIBRARY_MINOR_VERSION, TTK_LIBRARY_PATCH_VERSION, 0) 31 | 32 | #undef TTK_RC_FILEVERSION 33 | #undef TTK_RC_PRODUCTVERSION 34 | 35 | #define TTK_RC_FILEVERSION TTK_LIBRARY_MAJOR_VERSION, TTK_LIBRARY_MINOR_VERSION, TTK_LIBRARY_PATCH_VERSION, 0 36 | #define TTK_RC_PRODUCTVERSION TTK_LIBRARY_VERSION_STR 37 | 38 | #endif // TTKLIBRARYVERSION_H 39 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttklogoutput.h: -------------------------------------------------------------------------------- 1 | #ifndef TTKLOGOUTPUT_H 2 | #define TTKLOGOUTPUT_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkmoduleexport.h" 23 | 24 | /*! @brief The namespace of the log output. 25 | * @author Greedysky 26 | */ 27 | namespace TTK 28 | { 29 | /*! 30 | * Install log output handler. 31 | */ 32 | TTK_MODULE_EXPORT void installLogHandler(); 33 | /*! 34 | * Remove log output handler. 35 | */ 36 | TTK_MODULE_EXPORT void removeLogHandler(); 37 | 38 | } 39 | 40 | #endif // TTKLOGOUTPUT_H 41 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttksuperenum.cpp: -------------------------------------------------------------------------------- 1 | #include "ttksuperenum.h" 2 | 3 | #include 4 | 5 | TTKSuperEnum::TTKSuperEnum(const QString &value) 6 | : m_enumValue() 7 | { 8 | int enumValue = 0; 9 | const QStringList &enums = value.split(','); 10 | 11 | for(QString data : qAsConst(enums)) 12 | { 13 | const int pos = data.indexOf('='); 14 | if(pos != TTKSuperEnum::Null) 15 | { 16 | const QString &v = data.right(data.length() - pos - 1).trimmed(); 17 | enumValue = v.toInt(nullptr, (v.startsWith("0x") || v.startsWith("0X")) ? 16 : 10); 18 | data = data.left(pos); 19 | } 20 | 21 | m_enumValue[enumValue] = data.trimmed(); 22 | enumValue++; 23 | } 24 | } 25 | 26 | QString TTKSuperEnum::keyToString(int value) const noexcept 27 | { 28 | if(TTKSuperEnum::Null == value) 29 | { 30 | return "Null"; 31 | } 32 | 33 | const auto &it = m_enumValue.find(value); 34 | return it != m_enumValue.end() ? it->second : "Invalid"; 35 | } 36 | 37 | int TTKSuperEnum::stringToKey(const QString &name) const noexcept 38 | { 39 | if("Null" == name) 40 | { 41 | return TTKSuperEnum::Null; 42 | } 43 | 44 | for(auto &&item : qAsConst(m_enumValue)) 45 | { 46 | if(item.second == name) 47 | { 48 | return item.first; 49 | } 50 | } 51 | return TTKSuperEnum::Null; 52 | } 53 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttkthemelinelabel.cpp: -------------------------------------------------------------------------------- 1 | #include "ttkthemelinelabel.h" 2 | 3 | #include 4 | 5 | TTKThemeLineLabel::TTKThemeLineLabel(QWidget *parent) 6 | : QLabel(parent) 7 | { 8 | 9 | } 10 | 11 | void TTKThemeLineLabel::paintEvent(QPaintEvent *) 12 | { 13 | const QFontMetrics ftm(font()); 14 | const int w = QtFontWidth(ftm, text()) + 15; 15 | 16 | QPainter painter(this); 17 | painter.setFont(font()); 18 | painter.drawText(rect(), Qt::AlignLeft | Qt::AlignVCenter, text()); 19 | 20 | painter.setPen(QPen(QColor(0, 0, 0, 25), 1)); 21 | painter.drawLine(w, height() / 2, width(), height() / 2); 22 | } 23 | -------------------------------------------------------------------------------- /TTKCommon/TTKLibrary/ttkthemelinelabel.h: -------------------------------------------------------------------------------- 1 | #ifndef TTKTHEMELINELABEL_H 2 | #define TTKTHEMELINELABEL_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include 23 | #include "ttkmoduleexport.h" 24 | 25 | /*! @brief The class of the theme line label. 26 | * @author Greedysky 27 | */ 28 | class TTK_MODULE_EXPORT TTKThemeLineLabel : public QLabel 29 | { 30 | Q_OBJECT 31 | TTK_DECLARE_MODULE(TTKThemeLineLabel) 32 | public: 33 | /*! 34 | * Object constructor. 35 | */ 36 | explicit TTKThemeLineLabel(QWidget *parent = nullptr); 37 | 38 | protected: 39 | /*! 40 | * Override the widget event. 41 | */ 42 | virtual void paintEvent(QPaintEvent *event) override final; 43 | 44 | }; 45 | 46 | #endif // TTKTHEMELINELABEL_H 47 | -------------------------------------------------------------------------------- /TTKCommon/TTKRun/TTKRun.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Library Module project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU Lesser General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU Lesser General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU Lesser General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | DEFINES += TTK_LIBRARY 20 | 21 | win32:msvc{ 22 | CONFIG += c++11 23 | }else{ 24 | equals(QT_MAJOR_VERSION, 6){ #Qt6 25 | QMAKE_CXXFLAGS += -std=c++17 26 | }else{ 27 | QMAKE_CXXFLAGS += -std=c++11 28 | } 29 | } 30 | 31 | win32:!msvc:QMAKE_LFLAGS_CONSOLE += -mwindows 32 | 33 | INCLUDEPATH += \ 34 | $$PWD \ 35 | $$PWD/../ \ 36 | $$PWD/../base 37 | 38 | HEADERS += $$PWD/ttkrunobject.h 39 | 40 | SOURCES += $$PWD/ttkrunobject.cpp 41 | -------------------------------------------------------------------------------- /TTKCommon/TTKRun/ttkrunobject.h: -------------------------------------------------------------------------------- 1 | #ifndef TTKRUNOBJECT_H 2 | #define TTKRUNOBJECT_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkobject.h" 23 | 24 | #ifdef _MSC_VER // do not show console window 25 | # pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"") 26 | #endif 27 | 28 | /*! @brief The class of the ttk run object. 29 | * @author Greedysky 30 | */ 31 | class TTKRunObject 32 | { 33 | public: 34 | /*! 35 | * Object constructor. 36 | */ 37 | TTKRunObject() = default; 38 | 39 | /*! 40 | * To run main window. 41 | */ 42 | void run(int argc, char **argv) const; 43 | 44 | }; 45 | 46 | #endif // TTKRUNOBJECT_H 47 | -------------------------------------------------------------------------------- /TTKCommon/base/ttkmoduleexport.h: -------------------------------------------------------------------------------- 1 | #ifndef TTKMODULEEXPORT_H 2 | #define TTKMODULEEXPORT_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkqtcompat.h" 23 | 24 | #ifdef TTK_LIBRARY 25 | # define TTK_MODULE_EXPORT Q_DECL_EXPORT 26 | #else 27 | # define TTK_MODULE_EXPORT Q_DECL_IMPORT 28 | #endif 29 | 30 | #endif // TTKMODULEEXPORT_H 31 | -------------------------------------------------------------------------------- /TTKCommon/compat/compat.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPAT_H 2 | #define COMPAT_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include 23 | #include "ttkconfig.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #ifndef HAVE_STRLCAT 30 | size_t strlcat(char *dst, const char *src, size_t dsize); 31 | #endif 32 | 33 | #ifndef HAVE_STRLCPY 34 | size_t strlcpy(char *dst, const char *src, size_t dsize); 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif // COMPAT_H 42 | -------------------------------------------------------------------------------- /TTKCommon/compat/compat.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Library Module project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU Lesser General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU Lesser General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU Lesser General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | include($$PWD/../config.pri) 20 | 21 | INCLUDEPATH += \ 22 | $$PWD \ 23 | $$PWD/../ 24 | 25 | HEADERS += $$PWD/compat.h 26 | 27 | SOURCES += \ 28 | $$PWD/strlcat.c \ 29 | $$PWD/strlcpy.c 30 | -------------------------------------------------------------------------------- /TTKCommon/compat/integer.h: -------------------------------------------------------------------------------- 1 | #ifndef INTEGER_H 2 | #define INTEGER_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #if (defined __SIZEOF_INT128__ && __SIZEOF_INT128__ == 16) || defined _GLIBCXX_USE_INT128 23 | using TTKInt128 = __extension__ __int128; 24 | using TTKUInt128 = __extension__ unsigned __int128; 25 | #else 26 | #include "int128.h" 27 | using TTKInt128 = int128_t; 28 | using TTKUInt128 = uint128_t; 29 | #endif 30 | 31 | #endif // INTEGER_H 32 | -------------------------------------------------------------------------------- /TTKCommon/config.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Library Module project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU Lesser General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU Lesser General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU Lesser General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | GENERATE_PWD = $$DESTDIR/../Generate 20 | 21 | INCLUDEPATH += $$GENERATE_PWD 22 | 23 | HEADERS += $$GENERATE_PWD/ttkconfig.h 24 | -------------------------------------------------------------------------------- /TTKCommon/config/config.tests/default/default.cpp: -------------------------------------------------------------------------------- 1 | 2 | int main(int argc, char *argv[]) 3 | { 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /TTKCommon/config/config.tests/default/default.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Library Module project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU Lesser General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU Lesser General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU Lesser General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | CONFIG -= qt 20 | CONFIG += console 21 | 22 | SOURCES = default.cpp 23 | -------------------------------------------------------------------------------- /TTKCommon/config/config.tests/strlcat/strlcat.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | char v[2] = {}; 6 | strlcat(v, "1", 2); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /TTKCommon/config/config.tests/strlcat/strlcat.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Library Module project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU Lesser General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU Lesser General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU Lesser General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | CONFIG -= qt 20 | CONFIG += console 21 | 22 | SOURCES = strlcat.cpp 23 | -------------------------------------------------------------------------------- /TTKCommon/config/config.tests/strlcpy/strlcpy.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | char v[2] = {}; 6 | strlcpy(v, "1", 2); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /TTKCommon/config/config.tests/strlcpy/strlcpy.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Library Module project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU Lesser General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU Lesser General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU Lesser General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | CONFIG -= qt 20 | CONFIG += console 21 | 22 | SOURCES = strlcpy.cpp 23 | -------------------------------------------------------------------------------- /TTKCommon/config/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | int main(int argc, char *argv[]) 3 | { 4 | (void)argc; 5 | (void)argv; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /TTKCommon/config/ttkconfig.h.cmake: -------------------------------------------------------------------------------- 1 | #ifndef TTKCONFIG_H 2 | #define TTKCONFIG_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #if @HAVE_STRLCAT@ 23 | # define HAVE_STRLCAT 24 | #endif 25 | 26 | #if @HAVE_STRLCPY@ 27 | # define HAVE_STRLCPY 28 | #endif 29 | 30 | #endif // TTKCONFIG_H 31 | -------------------------------------------------------------------------------- /TTKCommon/config/ttkconfig.h.qmake: -------------------------------------------------------------------------------- 1 | #ifndef TTKCONFIG_H 2 | #define TTKCONFIG_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #if $$HAVE_STRLCAT 23 | # define HAVE_STRLCAT 24 | #endif 25 | 26 | #if $$HAVE_STRLCPY 27 | # define HAVE_STRLCPY 28 | #endif 29 | 30 | #endif // TTKCONFIG_H 31 | -------------------------------------------------------------------------------- /TTKCommon/ttkobject.h: -------------------------------------------------------------------------------- 1 | #ifndef TTKOBJECT_H 2 | #define TTKOBJECT_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Library Module project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | 18 | * You should have received a copy of the GNU Lesser General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkglobal.h" 23 | 24 | #define TTK_SERVICE_NAME "TTKService" 25 | #define TTK_APP_NAME "TTKDownloader" 26 | #define TTK_APP_COME_NAME TTK_STR_CAT(TTK_APP_NAME, COM_FILE) 27 | 28 | #ifdef _WIN32 29 | # define TTK_APP_FILE_NAME TTK_STR_CAT(TTK_APP_NAME, EXE_FILE) 30 | # define TTK_APP_RUN_NAME TTK_APP_FILE_NAME 31 | # define TTK_SERVICE_RUN_NAME TTK_STR_CAT(TTK_SERVICE_NAME, EXE_FILE) 32 | #else 33 | # define TTK_APP_FILE_NAME TTK_APP_NAME 34 | # define TTK_APP_RUN_NAME TTK_STR_CAT(TTK_APP_NAME, SHL_FILE) 35 | # define TTK_SERVICE_RUN_NAME TTK_STR_CAT(TTK_SERVICE_NAME, SHL_FILE) 36 | #endif 37 | 38 | #endif // TTKOBJECT_H 39 | -------------------------------------------------------------------------------- /TTKConfig/TTKConfig.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | QT += core 20 | 21 | TEMPLATE = lib 22 | CONFIG += plugin lib 23 | 24 | include($$PWD/../TTKVersion.pri) 25 | 26 | DESTDIR = $$OUT_PWD/../bin/$$TTK_VERSION 27 | TARGET = TTKConfig 28 | 29 | DEFINES += TTK_LIBRARY 30 | 31 | win32:msvc{ 32 | CONFIG += c++11 33 | }else{ 34 | equals(QT_MAJOR_VERSION, 6){ #Qt6 35 | QMAKE_CXXFLAGS += -std=c++17 36 | }else{ 37 | QMAKE_CXXFLAGS += -std=c++11 38 | } 39 | } 40 | 41 | INCLUDEPATH += \ 42 | $$PWD/../TTKCommon \ 43 | $$PWD/../TTKCommon/base \ 44 | $$PWD/../TTKModule/TTKCore/downloadCoreKits 45 | 46 | HEADERS += \ 47 | $$PWD/downloadconfigdefine.h \ 48 | $$PWD/downloadconfigmodule.h 49 | 50 | SOURCES += $$PWD/downloadconfigmodule.cpp 51 | 52 | RESOURCES += $$PWD/../TTKUi/TTKApp.qrc 53 | 54 | win32:RC_FILE = $$PWD/$${TARGET}.rc 55 | -------------------------------------------------------------------------------- /TTKConfig/TTKConfig.rc: -------------------------------------------------------------------------------- 1 | #if defined(UNDER_CE) 2 | include 3 | #else 4 | #include 5 | #endif 6 | #include "../TTKCommon/ttkversion.h" 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION TTK_RC_FILEVERSION 10 | PRODUCTVERSION TTK_RC_FILEVERSION 11 | FILEFLAGSMASK 0x3fL 12 | 13 | #ifdef _DEBUG 14 | FILEFLAGS VS_FF_DEBUG 15 | #else 16 | FILEFLAGS 0x0L 17 | #endif 18 | 19 | FILEOS VOS__WINDOWS32 20 | FILETYPE VFT_DLL 21 | FILESUBTYPE 0x0L 22 | BEGIN 23 | BLOCK "StringFileInfo" 24 | BEGIN 25 | BLOCK "080404b0" 26 | BEGIN 27 | VALUE "CompanyName", TTK_RC_COMPANY 28 | VALUE "FileDescription", "TTKConfig" 29 | VALUE "FileVersion", TTK_RC_PRODUCTVERSION 30 | VALUE "LegalCopyright", TTK_RC_COPYRIGHT 31 | VALUE "ProductName", "TTKConfig" 32 | VALUE "ProductVersion", TTK_RC_PRODUCTVERSION 33 | END 34 | END 35 | BLOCK "VarFileInfo" 36 | BEGIN 37 | VALUE "Translation", 0x804, 1200 38 | END 39 | END 40 | -------------------------------------------------------------------------------- /TTKConfig/downloadconfigdefine.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADCONFIGDEFINE_H 2 | #define DOWNLOADCONFIGDEFINE_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "downloadobject.h" 23 | 24 | #define TTK_MAKE_NET_PATH_FULL MAKE_NET_PATH_FULL 25 | #define TTK_LIST_PATH_FULL LIST_PATH_FULL 26 | #define TTK_COFIG_PATH_FULL COFIG_PATH_FULL 27 | #define TTK_HISTORY_PATH_FULL HISTORY_PATH_FULL 28 | #define TTK_USER_THEME_DIR_FULL USER_THEME_DIR_FULL 29 | // 30 | #define TTK_THEME_DIR_FULL THEME_DIR_FULL 31 | #define TTK_LANGUAGE_DIR_FULL LANGUAGE_DIR_FULL 32 | 33 | #endif // DOWNLOADCONFIGDEFINE_H 34 | -------------------------------------------------------------------------------- /TTKLanguage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | project(TTKLanguage) 22 | 23 | set(SOURCE_FILES 24 | cn.ts 25 | ) 26 | 27 | add_custom_target(${PROJECT_NAME} SOURCES ${SOURCE_FILES}) 28 | -------------------------------------------------------------------------------- /TTKModule/TTKCore.rc: -------------------------------------------------------------------------------- 1 | #if defined(UNDER_CE) 2 | include 3 | #else 4 | #include 5 | #endif 6 | #include "../TTKCommon/ttkversion.h" 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION TTK_RC_FILEVERSION 10 | PRODUCTVERSION TTK_RC_FILEVERSION 11 | FILEFLAGSMASK 0x3fL 12 | 13 | #ifdef _DEBUG 14 | FILEFLAGS VS_FF_DEBUG 15 | #else 16 | FILEFLAGS 0x0L 17 | #endif 18 | 19 | FILEOS VOS__WINDOWS32 20 | FILETYPE VFT_DLL 21 | FILESUBTYPE 0x0L 22 | BEGIN 23 | BLOCK "StringFileInfo" 24 | BEGIN 25 | BLOCK "080404b0" 26 | BEGIN 27 | VALUE "CompanyName", TTK_RC_COMPANY 28 | VALUE "FileDescription", "TTKCore" 29 | VALUE "FileVersion", TTK_RC_PRODUCTVERSION 30 | VALUE "LegalCopyright", TTK_RC_COPYRIGHT 31 | VALUE "ProductName", "TTKCore" 32 | VALUE "ProductVersion", TTK_RC_PRODUCTVERSION 33 | END 34 | END 35 | BLOCK "VarFileInfo" 36 | BEGIN 37 | VALUE "Translation", 0x804, 1200 38 | END 39 | END 40 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | add_subdirectory(downloadCoreKits) 22 | add_subdirectory(downloadNetworkKits) 23 | add_subdirectory(downloadUtilsKits) 24 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/TTKCore.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | include($$PWD/downloadCoreKits/DownloadCoreKits.pri) 20 | include($$PWD/downloadNetworkKits/DownloadNetworkKits.pri) 21 | include($$PWD/downloadUtilsKits/DownloadUtilsKits.pri) 22 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadCoreKits/downloadbackgroundconfigmanager.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadbackgroundconfigmanager.h" 2 | 3 | DownloadSkinConfigManager::DownloadSkinConfigManager() 4 | : TTKAbstractXml() 5 | { 6 | 7 | } 8 | 9 | bool DownloadSkinConfigManager::readBuffer(DownloadSkinConfigItem &items) 10 | { 11 | items.m_name = readAttributeByTagName("name"); 12 | items.m_useCount = readAttributeByTagName("useCount").toInt(); 13 | return true; 14 | } 15 | 16 | bool DownloadSkinConfigManager::writeBuffer(const DownloadSkinConfigItem &items) 17 | { 18 | createProcessingInstruction(); 19 | QDomElement rootDom = createRoot("TTKSkin"); 20 | 21 | writeDomElement(rootDom, "creator", {"value", TTK_APP_NAME}); 22 | writeDomElement(rootDom, "name", {"value", items.m_name}); 23 | writeDomElement(rootDom, "useCount", {"value", items.m_useCount}); 24 | 25 | save(); 26 | return true; 27 | } 28 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadCoreKits/downloadbackgroundmanager.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadbackgroundmanager.h" 2 | 3 | DownloadBackgroundManager::DownloadBackgroundManager() noexcept 4 | : m_skinColor(Qt::white) 5 | { 6 | 7 | } 8 | 9 | void DownloadBackgroundManager::addObserver(QObject *object) 10 | { 11 | m_observer << object; 12 | connect(this, SIGNAL(backgroundChanged()), object, SLOT(backgroundChanged())); 13 | } 14 | 15 | void DownloadBackgroundManager::removeObserver(QObject *object) 16 | { 17 | m_observer.removeAll(object); 18 | disconnect(this, SIGNAL(backgroundChanged()), object, SLOT(backgroundChanged())); 19 | } 20 | 21 | void DownloadBackgroundManager::setBackgroundUrl(const QString &path) noexcept 22 | { 23 | m_background = path; 24 | Q_EMIT backgroundChanged(); 25 | } 26 | 27 | QString DownloadBackgroundManager::backgroundUrl() const noexcept 28 | { 29 | return m_background; 30 | } 31 | 32 | void DownloadBackgroundManager::setBackgroundColor(const QColor &color) noexcept 33 | { 34 | m_skinColor = color; 35 | } 36 | 37 | QColor DownloadBackgroundManager::backgroundColor() const noexcept 38 | { 39 | return m_skinColor; 40 | } 41 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadCoreKits/downloadbreakpointconfigmanager.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadbreakpointconfigmanager.h" 2 | 3 | DownloadBreakPointConfigManager::DownloadBreakPointConfigManager() 4 | : TTKAbstractXml() 5 | { 6 | 7 | } 8 | 9 | bool DownloadBreakPointConfigManager::readBuffer(DownloadBreakPointItemList &items) 10 | { 11 | QDomNodeList nodes = m_document->elementsByTagName("value"); 12 | for(int i = 0; i < nodes.count(); ++i) 13 | { 14 | const QDomElement &element = nodes.item(i).toElement(); 15 | 16 | DownloadBreakPointItem item; 17 | item.m_ready = element.attribute("ready").toLongLong(); 18 | item.m_end = element.attribute("end").toLongLong(); 19 | item.m_start = element.attribute("start").toLongLong(); 20 | items << item; 21 | } 22 | 23 | nodes = m_document->elementsByTagName("url"); 24 | for(int i = 0; i < nodes.count(); ++i) 25 | { 26 | for(DownloadBreakPointItem &item : items) 27 | { 28 | item.m_url = nodes.item(i).toElement().text(); 29 | } 30 | } 31 | 32 | return true; 33 | } 34 | 35 | bool DownloadBreakPointConfigManager::writeBuffer(const DownloadBreakPointItemList &items) 36 | { 37 | createProcessingInstruction(); 38 | QDomElement rootDom = createRoot(TTK_APP_NAME); 39 | QDomElement recordDom = writeDomElement(rootDom, "breakPoint"); 40 | 41 | if(!items.isEmpty()) 42 | { 43 | writeDomElement(recordDom, "url", items.front().m_url); 44 | } 45 | 46 | for(const DownloadBreakPointItem &item : qAsConst(items)) 47 | { 48 | writeDomMultiElement(recordDom, "value", {{"start", item.m_start}, 49 | {"end", item.m_end}, 50 | {"ready", item.m_ready}}); 51 | } 52 | 53 | save(); 54 | return true; 55 | } 56 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadCoreKits/downloadlistconfigmanager.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadlistconfigmanager.h" 2 | 3 | DownloadListConfigManager::DownloadListConfigManager() 4 | : TTKAbstractXml() 5 | { 6 | 7 | } 8 | 9 | bool DownloadListConfigManager::readBuffer(DownloadItemList &items) 10 | { 11 | const QDomNodeList &nodes = m_document->elementsByTagName("value"); 12 | for(int i = 0; i < nodes.count(); ++i) 13 | { 14 | const QDomElement &element = nodes.item(i).toElement(); 15 | 16 | DownloadItem item; 17 | item.m_url = element.attribute("url"); 18 | item.m_name = element.attribute("name"); 19 | items << item; 20 | } 21 | 22 | return true; 23 | } 24 | 25 | bool DownloadListConfigManager::writeBuffer(const DownloadItemList &items) 26 | { 27 | createProcessingInstruction(); 28 | QDomElement rootDom = createRoot(TTK_APP_NAME); 29 | QDomElement recordDom = writeDomElement(rootDom, "list"); 30 | 31 | for(const DownloadItem &item : qAsConst(items)) 32 | { 33 | writeDomMultiElement(recordDom, "value", {{"url", item.m_url}, 34 | {"name", item.m_name}}); 35 | } 36 | 37 | save(); 38 | return true; 39 | } 40 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadCoreKits/downloadotherdefine.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADOTHERDEFINE_H 2 | #define DOWNLOADOTHERDEFINE_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include 23 | 24 | #define TTK_COLOR_FILE TTK::applicationPath() + "color.jpg" 25 | #define TTK_IMAGE_FILE TTK::applicationPath() + "image_cache" 26 | 27 | #endif // DOWNLOADOTHERDEFINE_H 28 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadCoreKits/downloadrecordconfigmanager.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadrecordconfigmanager.h" 2 | 3 | DownloadRecordConfigManager::DownloadRecordConfigManager() 4 | : TTKAbstractXml() 5 | { 6 | 7 | } 8 | 9 | bool DownloadRecordConfigManager::readBuffer(DownloadRecordList &items) 10 | { 11 | const QDomNodeList &nodes = m_document->elementsByTagName("value"); 12 | for(int i = 0; i < nodes.count(); ++i) 13 | { 14 | const QDomElement &element = nodes.item(i).toElement(); 15 | 16 | DownloadRecord item; 17 | item.m_path = element.attribute("name"); 18 | item.m_time = element.attribute("time"); 19 | item.m_size = element.attribute("size"); 20 | item.m_url = element.attribute("url"); 21 | items << item; 22 | } 23 | 24 | return true; 25 | } 26 | 27 | bool DownloadRecordConfigManager::writeBuffer(const DownloadRecordList &items) 28 | { 29 | createProcessingInstruction(); 30 | QDomElement rootDom = createRoot(TTK_APP_NAME); 31 | QDomElement recordDom = writeDomElement(rootDom, "history"); 32 | 33 | for(const DownloadRecord &item : qAsConst(items)) 34 | { 35 | writeDomMultiElement(recordDom, "value", {{"name", item.m_path}, 36 | {"size", item.m_size}, 37 | {"time", item.m_time}, 38 | {"url", item.m_url}}); 39 | } 40 | 41 | save(); 42 | return true; 43 | } 44 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadCoreKits/downloadruntimemanager.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadruntimemanager.h" 2 | #include "downloadconfigmanager.h" 3 | #include "downloadsettingmanager.h" 4 | #include "downloadnetworkthread.h" 5 | #include "downloadcodecutils.h" 6 | 7 | #include 8 | #include 9 | 10 | namespace TTK 11 | { 12 | /*! 13 | * Generate core language resource. 14 | */ 15 | static QString languageCore(int index); 16 | 17 | } 18 | 19 | QString TTK::languageCore(int index) 20 | { 21 | QString lan(LANGUAGE_DIR_FULL); 22 | switch(index) 23 | { 24 | case 0: return lan.append("cn.ln"); 25 | case 1: return lan.append("tc.ln"); 26 | case 2: return lan.append("en.ln"); 27 | default: return {}; 28 | } 29 | } 30 | 31 | 32 | void DownloadRunTimeManager::run() const 33 | { 34 | TTK_INFO_STREAM("DownloadApplication Run"); 35 | 36 | #if !TTK_QT_VERSION_CHECK(5,0,0) 37 | TTK::Codec::setLocalCodec(); 38 | #endif 39 | 40 | #ifdef Q_OS_UNIX 41 | QFont font; 42 | font.setPixelSize(13); 43 | qApp->setFont(font); 44 | #endif 45 | 46 | //detect the current network state 47 | G_NETWORK_PTR->start(); 48 | 49 | DownloadConfigManager manager; 50 | manager.fromFile(COFIG_PATH_FULL); 51 | manager.readBuffer(); 52 | 53 | G_NETWORK_PTR->setBlockNetwork(G_SETTING_PTR->value(DownloadSettingManager::CloseNetWorkMode).toBool()); 54 | } 55 | 56 | QString DownloadRunTimeManager::translator() const 57 | { 58 | return TTK::languageCore(0); 59 | } 60 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadCoreKits/downloadruntimemanager.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADRUNTIMEMANAGER_H 2 | #define DOWNLOADRUNTIMEMANAGER_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkmoduleexport.h" 23 | 24 | /*! @brief The class of the app run time needed. 25 | * @author Greedysky 26 | */ 27 | class TTK_MODULE_EXPORT DownloadRunTimeManager 28 | { 29 | TTK_DECLARE_MODULE(DownloadRunTimeManager) 30 | public: 31 | /*! 32 | * Run. 33 | */ 34 | void run() const; 35 | 36 | /*! 37 | * Get translator path. 38 | */ 39 | QString translator() const ; 40 | 41 | }; 42 | 43 | #endif // DOWNLOADRUNTIMEMANAGER_H 44 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadNetworkKits/downloadabstractnetwork.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADABSTRACTNETWORK_H 2 | #define DOWNLOADABSTRACTNETWORK_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkabstractnetwork.h" 23 | #include "downloadalgorithmutils.h" 24 | 25 | using DownloadAbstractNetwork = TTKAbstractNetwork; 26 | 27 | #endif // DOWNLOADABSTRACTNETWORK_H 28 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadNetworkKits/downloaddatasourcerequest.cpp: -------------------------------------------------------------------------------- 1 | #include "downloaddatasourcerequest.h" 2 | 3 | DownloadDataSourceRequest::DownloadDataSourceRequest(QObject *parent) 4 | : DownloadAbstractNetwork(parent) 5 | { 6 | 7 | } 8 | 9 | void DownloadDataSourceRequest::deleteAll() 10 | { 11 | DownloadAbstractNetwork::deleteAll(); 12 | deleteLater(); 13 | } 14 | 15 | void DownloadDataSourceRequest::startToRequest(const QString &url) 16 | { 17 | QNetworkRequest request; 18 | request.setUrl(url); 19 | TTK::setSslConfiguration(&request); 20 | 21 | m_reply = m_manager.get(request); 22 | connect(m_reply, SIGNAL(finished()), SLOT(downLoadFinished())); 23 | QtNetworkErrorConnect(m_reply, this, replyError, TTK_SLOT); 24 | } 25 | 26 | void DownloadDataSourceRequest::downLoadFinished() 27 | { 28 | DownloadAbstractNetwork::downLoadFinished(); 29 | if(m_reply && m_reply->error() == QNetworkReply::NoError) 30 | { 31 | const QVariant &redirection = m_reply->attribute(QNetworkRequest::RedirectionTargetAttribute); 32 | if(redirection.isValid()) 33 | { 34 | const QString &url = redirection.toString(); 35 | DownloadAbstractNetwork::deleteAll(); 36 | startToRequest(url); 37 | } 38 | else 39 | { 40 | Q_EMIT downLoadRawDataChanged(m_reply->readAll()); 41 | deleteAll(); 42 | } 43 | } 44 | else 45 | { 46 | TTK_ERROR_STREAM("Download source data error"); 47 | Q_EMIT downLoadRawDataChanged({}); 48 | deleteAll(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadNetworkKits/downloadnetworkthread.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadnetworkthread.h" 2 | #include "downloadsettingmanager.h" 3 | #include "ttkconcurrent.h" 4 | 5 | #include 6 | 7 | static constexpr int NETWORK_DETECT_INTERVAL = 5000; // second 8 | static constexpr const char *NETWORK_REQUEST_ADDRESS = "www.baidu.com"; // ip 9 | 10 | DownloadNetworkThread::DownloadNetworkThread() 11 | : QObject(nullptr), 12 | m_networkState(true) 13 | { 14 | connect(&m_timer, SIGNAL(timeout()), SLOT(networkStateChanged())); 15 | } 16 | 17 | DownloadNetworkThread::~DownloadNetworkThread() 18 | { 19 | m_timer.stop(); 20 | } 21 | 22 | void DownloadNetworkThread::start() 23 | { 24 | TTK_INFO_STREAM("Load NetworkThread"); 25 | m_timer.start(NETWORK_DETECT_INTERVAL); 26 | networkStateChanged(); 27 | } 28 | 29 | void DownloadNetworkThread::setBlockNetwork(bool block) 30 | { 31 | G_SETTING_PTR->setValue(DownloadSettingManager::CloseNetWorkMode, block); 32 | } 33 | 34 | void DownloadNetworkThread::networkStateChanged() 35 | { 36 | TTKConcurrent( 37 | { 38 | const bool block = G_SETTING_PTR->value(DownloadSettingManager::CloseNetWorkMode).toBool(); 39 | const QHostInfo &info = QHostInfo::fromName(NETWORK_REQUEST_ADDRESS); 40 | m_networkState = !info.addresses().isEmpty(); 41 | m_networkState = block ? false : m_networkState; 42 | Q_EMIT networkConnectionStateChanged(m_networkState); 43 | }); 44 | } 45 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadNetworkKits/downloadurlencoder.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadurlencoder.h" 2 | 3 | static const QString THUNDER = "thunder://"; 4 | static const QString FLASHGET = "Flashget://"; 5 | static const QString QQDL = "qqdl://"; 6 | 7 | DownloadUrlEncoder::DownloadUrlEncoder(QObject *parent) 8 | : QObject(parent) 9 | { 10 | 11 | } 12 | 13 | QString DownloadUrlEncoder::decoder(const QString &url) 14 | { 15 | QString turl = url; 16 | if(url.left(THUNDER.length()).contains(THUNDER, Qt::CaseInsensitive)) 17 | { 18 | QByteArray byte = QByteArray::fromBase64(turl.mid(THUNDER.length()).toUtf8()); 19 | byte.remove(0, 2); //remove AA 20 | byte.chop(2); //remove ZZ 21 | return byte; 22 | } 23 | else if(url.left(FLASHGET.length()).contains(FLASHGET, Qt::CaseInsensitive)) 24 | { 25 | const int d = turl.lastIndexOf('&'); 26 | turl = (d == -1) ? turl : turl.left(d); 27 | QByteArray byte = QByteArray::fromBase64(turl.mid(FLASHGET.length()).toUtf8()); 28 | byte.remove(0, 10); //remove [FLASHGET] 29 | byte.chop(10); //remove [FLASHGET] 30 | return byte; 31 | } 32 | else if(url.left(QQDL.length()).contains(QQDL, Qt::CaseInsensitive)) 33 | { 34 | return QByteArray::fromBase64(turl.mid(QQDL.length()).toUtf8()); 35 | } 36 | else 37 | { 38 | return url; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadNetworkKits/downloadurlencoder.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADURLENCODER_H 2 | #define DOWNLOADURLENCODER_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkmoduleexport.h" 23 | 24 | class QProcess; 25 | 26 | /*! @brief The class of the network url encoder and decoder. 27 | * @author Greedysky 28 | */ 29 | class TTK_MODULE_EXPORT DownloadUrlEncoder : public QObject 30 | { 31 | Q_OBJECT 32 | TTK_DECLARE_MODULE(DownloadUrlEncoder) 33 | public: 34 | /*! 35 | * Object constructor. 36 | */ 37 | explicit DownloadUrlEncoder(QObject *parent = nullptr); 38 | 39 | /*! 40 | * Decode url. 41 | */ 42 | QString decoder(const QString &url); 43 | 44 | }; 45 | 46 | #endif // DOWNLOADURLENCODER_H 47 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadUtilsKits/DownloadUtilsKits.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | INCLUDEPATH += $$PWD 20 | 21 | HEADERS += \ 22 | $$PWD/downloadalgorithmutils.h \ 23 | $$PWD/downloadcodecutils.h \ 24 | $$PWD/downloadcoreutils.h \ 25 | $$PWD/downloadfileutils.h \ 26 | $$PWD/downloadimageutils.h \ 27 | $$PWD/downloadnumberutils.h \ 28 | $$PWD/downloadstringutils.h \ 29 | $$PWD/downloadurlutils.h \ 30 | $$PWD/downloadwidgetutils.h 31 | 32 | SOURCES += \ 33 | $$PWD/downloadalgorithmutils.cpp \ 34 | $$PWD/downloadcodecutils.cpp \ 35 | $$PWD/downloadcoreutils.cpp \ 36 | $$PWD/downloadfileutils.cpp \ 37 | $$PWD/downloadimageutils.cpp \ 38 | $$PWD/downloadnumberutils.cpp \ 39 | $$PWD/downloadstringutils.cpp \ 40 | $$PWD/downloadurlutils.cpp \ 41 | $$PWD/downloadwidgetutils.cpp 42 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadUtilsKits/downloadalgorithmutils.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadalgorithmutils.h" 2 | #include "ttkcryptographichash.h" 3 | 4 | #include 5 | 6 | static constexpr const char *MDII_URL_KEY = "GREEDYSKY"; 7 | 8 | QByteArray TTK::Algorithm::md5(const QByteArray &data) 9 | { 10 | return QCryptographicHash::hash(data, QCryptographicHash::Md5).toHex().toLower(); 11 | } 12 | 13 | QByteArray TTK::Algorithm::sha1(const QByteArray &data) 14 | { 15 | return QCryptographicHash::hash(data, QCryptographicHash::Sha1); 16 | } 17 | 18 | QByteArray TTK::Algorithm::hmacSha1(const QByteArray &data, const QByteArray &key) 19 | { 20 | const int blockSize = 64; 21 | QByteArray newSecretKey = key; 22 | if(newSecretKey.length() > blockSize) 23 | { 24 | newSecretKey = TTK::Algorithm::sha1(newSecretKey); 25 | } 26 | 27 | QByteArray innerPadding(blockSize, char(0x36)); 28 | QByteArray outerPadding(blockSize, char(0x5C)); 29 | 30 | for(int i = 0; i < key.length(); ++i) 31 | { 32 | innerPadding[i] = innerPadding[i] ^ key.at(i); 33 | outerPadding[i] = outerPadding[i] ^ key.at(i); 34 | } 35 | 36 | QByteArray total = outerPadding; 37 | QByteArray part = innerPadding; 38 | part.append(data); 39 | total.append(TTK::Algorithm::sha1(part)); 40 | return TTK::Algorithm::sha1(total); 41 | } 42 | 43 | QString TTK::Algorithm::mdII(const QString &data, bool encode) 44 | { 45 | TTKCryptographicHash hash; 46 | return encode ? hash.encrypt(data, MDII_URL_KEY) : hash.decrypt(data, MDII_URL_KEY); 47 | } 48 | 49 | QString TTK::Algorithm::mdII(const QString &data, const char *key, bool encode) 50 | { 51 | TTKCryptographicHash hash; 52 | return encode ? hash.encrypt(data, key) : hash.decrypt(data, key); 53 | } 54 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadUtilsKits/downloadcodecutils.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadcodecutils.h" 2 | 3 | #include 4 | 5 | void TTK::Codec::setLocalCodec(const char *format) 6 | { 7 | QTextCodec *codec = QTextCodec::codecForName(format); 8 | QTextCodec::setCodecForLocale(codec); 9 | #if !TTK_QT_VERSION_CHECK(5,0,0) 10 | QTextCodec::setCodecForCStrings(codec); 11 | QTextCodec::setCodecForTr(codec); 12 | #endif 13 | } 14 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadUtilsKits/downloadcodecutils.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADCODECUTILS_H 2 | #define DOWNLOADCODECUTILS_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkmoduleexport.h" 23 | 24 | /*! @brief The namespace of the utils codec. 25 | * @author Greedysky 26 | */ 27 | namespace TTK 28 | { 29 | namespace Codec 30 | { 31 | /*! 32 | * Set local codec by format. 33 | */ 34 | TTK_MODULE_EXPORT void setLocalCodec(const char *format = "UTF-8"); 35 | 36 | } 37 | } 38 | 39 | #endif // DOWNLOADCODECUTILS_H 40 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadUtilsKits/downloadcoreutils.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadcoreutils.h" 2 | 3 | #include 4 | 5 | #ifdef Q_CC_MSVC 6 | # define WIN32_LEAN_AND_MEAN 7 | # include 8 | #elif defined Q_OS_UNIX || defined Q_CC_GNU 9 | # include 10 | #endif 11 | 12 | static bool __BreakPoint__ = false; 13 | static bool versionCheck(const QStringList &ol, const QStringList &dl, int depth) noexcept 14 | { 15 | if(depth >= ol.count()) 16 | { 17 | return false; 18 | } 19 | 20 | if(dl[depth].toInt() >= ol[depth].toInt()) 21 | { 22 | if(dl[depth].toInt() == ol[depth].toInt()) 23 | { 24 | return versionCheck(ol, dl, depth + 1); 25 | } 26 | else 27 | { 28 | return true; 29 | } 30 | } 31 | else 32 | { 33 | return false; 34 | } 35 | } 36 | 37 | void TTK::Core::sleep(int ms) 38 | { 39 | #ifdef Q_CC_MSVC 40 | ::Sleep(ms); 41 | #elif defined Q_OS_UNIX || defined Q_CC_GNU 42 | usleep(ms * TTK_DN_MS2US); 43 | #endif 44 | } 45 | 46 | bool TTK::Core::appVersionCheck(const QString &o, const QString &d) 47 | { 48 | const QStringList &ol = o.split(TTK_DOT); 49 | const QStringList &dl = d.split(TTK_DOT); 50 | 51 | if(ol.isEmpty() || dl.isEmpty() || ol.count() != dl.count()) 52 | { 53 | return false; 54 | } 55 | 56 | return versionCheck(ol, dl, 0); 57 | } 58 | 59 | void TTK::Core::resetBreakPoint() noexcept 60 | { 61 | __BreakPoint__ = false; 62 | } 63 | 64 | void TTK::Core::enableBreakPoint(bool enable) noexcept 65 | { 66 | __BreakPoint__ = enable; 67 | } 68 | 69 | bool TTK::Core::isBreakPointEnabled() noexcept 70 | { 71 | return __BreakPoint__; 72 | } 73 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadUtilsKits/downloadfileutils.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadfileutils.h" 2 | 3 | #include 4 | 5 | QString TTK::File::getOpenFileName(QWidget *parent) 6 | { 7 | return QFileDialog::getOpenFileName(parent, QObject::tr("choose a filename to open under"), QDir::currentPath(), "Image Files (*.png *.bmp *.jpg);;TKM Files (*.tkm)"); 8 | } 9 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadUtilsKits/downloadfileutils.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADCOREUTILS_H 2 | #define DOWNLOADCOREUTILS_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkmoduleexport.h" 23 | 24 | /*! @brief The namespace of the utils file. 25 | * @author Greedysky 26 | */ 27 | namespace TTK 28 | { 29 | namespace File 30 | { 31 | /*! 32 | * Get open file name dialog. 33 | */ 34 | TTK_MODULE_EXPORT QString getOpenFileName(QWidget *parent); 35 | 36 | } 37 | } 38 | 39 | #endif // DOWNLOADCOREUTILS_H 40 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadUtilsKits/downloadnumberutils.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADNUMBERUTILS_H 2 | #define DOWNLOADNUMBERUTILS_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkmoduleexport.h" 23 | 24 | /*! @brief The namespace of the utils number. 25 | * @author Greedysky 26 | */ 27 | namespace TTK 28 | { 29 | namespace Number 30 | { 31 | /*! 32 | * Transform value to cp float value. 33 | */ 34 | TTK_MODULE_EXPORT QString sizeByteToLabel(qint64 size); 35 | /*! 36 | * Transform value to speed float value. 37 | */ 38 | TTK_MODULE_EXPORT QString speedByteToLabel(qint64 size); 39 | 40 | } 41 | } 42 | 43 | #endif // DOWNLOADNUMBERUTILS_H 44 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadUtilsKits/downloadstringutils.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadstringutils.h" 2 | #include "downloadsettingmanager.h" 3 | 4 | QString TTK::String::downloadPrefix() 5 | { 6 | QString path = G_SETTING_PTR->value(DownloadSettingManager::DownloadPathDir).toString(); 7 | if(path.isEmpty()) 8 | { 9 | path = TDDOWNLOAD_DIR_FULL; 10 | } 11 | else 12 | { 13 | if(!QDir(path).exists()) 14 | { 15 | QDir().mkpath(path); 16 | } 17 | } 18 | return path; 19 | } 20 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadUtilsKits/downloadstringutils.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADSTRINGUTILS_H 2 | #define DOWNLOADSTRINGUTILS_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkmoduleexport.h" 23 | 24 | /*! @brief The namespace of the utils string. 25 | * @author Greedysky 26 | */ 27 | namespace TTK 28 | { 29 | namespace String 30 | { 31 | /*! 32 | * Get download dir path. 33 | */ 34 | TTK_MODULE_EXPORT QString downloadPrefix(); 35 | 36 | } 37 | } 38 | 39 | #endif // DOWNLOADSTRINGUTILS_H 40 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadUtilsKits/downloadurlutils.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadurlutils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #ifdef Q_OS_WIN 7 | # define WIN32_LEAN_AND_MEAN 8 | # include 9 | # include 10 | #endif 11 | 12 | bool TTK::Url::openUrl(const QString &path, bool local) 13 | { 14 | if(path.isEmpty()) 15 | { 16 | return false; 17 | } 18 | 19 | if(local) 20 | { 21 | #ifdef Q_OS_WIN 22 | QString p = path; 23 | p.replace(TTK_SEPARATOR, TTK_WSEPARATOR); 24 | p = "/select," + p; 25 | ShellExecuteW(0, L"open", L"explorer.exe", p.toStdWString().c_str(), nullptr, SW_SHOWNORMAL); 26 | return true; 27 | #endif 28 | } 29 | return QDesktopServices::openUrl(local ? QUrl::fromLocalFile(path) : QUrl(path, QUrl::TolerantMode)); 30 | } 31 | -------------------------------------------------------------------------------- /TTKModule/TTKCore/downloadUtilsKits/downloadurlutils.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADURLUTILS_H 2 | #define DOWNLOADURLUTILS_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "ttkmoduleexport.h" 23 | 24 | /*! @brief The namespace of the utils url. 25 | * @author Greedysky 26 | */ 27 | namespace TTK 28 | { 29 | namespace Url 30 | { 31 | /*! 32 | * Open file from local by path or net url. 33 | */ 34 | TTK_MODULE_EXPORT bool openUrl(const QString &path, bool local = true); 35 | 36 | } 37 | } 38 | 39 | #endif // DOWNLOADURLUTILS_H 40 | -------------------------------------------------------------------------------- /TTKModule/TTKModule.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | include($$PWD/TTKCore/TTKCore.pri) 20 | include($$PWD/TTKWidget/TTKWidget.pri) 21 | -------------------------------------------------------------------------------- /TTKModule/TTKModule.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | TEMPLATE = lib 20 | CONFIG += plugin lib 21 | 22 | include($$PWD/TTKModule.pri) 23 | include($$PWD/../TTKDownloader.pri) 24 | 25 | TARGET = TTKCore 26 | 27 | INCLUDEPATH += $$PWD 28 | 29 | HEADERS += \ 30 | $$PWD/downloadapplication.h \ 31 | $$PWD/downloadapplicationmodule.h \ 32 | $$PWD/downloadbottomareawidget.h \ 33 | $$PWD/downloadleftareawidget.h \ 34 | $$PWD/downloadrightareawidget.h \ 35 | $$PWD/downloadtopareawidget.h 36 | 37 | SOURCES += \ 38 | $$PWD/downloadapplication.cpp \ 39 | $$PWD/downloadapplicationmodule.cpp \ 40 | $$PWD/downloadbottomareawidget.cpp \ 41 | $$PWD/downloadleftareawidget.cpp \ 42 | $$PWD/downloadrightareawidget.cpp \ 43 | $$PWD/downloadtopareawidget.cpp 44 | 45 | win32:RC_FILE = $$PWD/$${TARGET}.rc 46 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | add_subdirectory(downloadCoreKits) 22 | add_subdirectory(downloadRemoteKits) 23 | add_subdirectory(downloadUiKits) 24 | add_subdirectory(downloadWidgetKits) 25 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/TTKWidget.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | include($$PWD/downloadUiKits/DownloadUiKits.pri) 20 | include($$PWD/downloadRemoteKits/DownloadRemoteKits.pri) 21 | include($$PWD/downloadWidgetKits/DownloadWidgetKits.pri) 22 | include($$PWD/downloadCoreKits/DownloadCoreKits.pri) 23 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadCoreKits/downloadabstractmovedialog.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadabstractmovedialog.h" 2 | #include "downloadbackgroundmanager.h" 3 | 4 | DownloadAbstractMoveDialog::DownloadAbstractMoveDialog(QWidget *parent) 5 | : DownloadAbstractMoveDialog(true, parent) 6 | { 7 | 8 | } 9 | 10 | DownloadAbstractMoveDialog::DownloadAbstractMoveDialog(bool transparent, QWidget *parent) 11 | : TTKAbstractMoveDialog(transparent, parent), 12 | DownloadWidgetRenderer() 13 | { 14 | G_BACKGROUND_PTR->addObserver(this); 15 | } 16 | 17 | DownloadAbstractMoveDialog::~DownloadAbstractMoveDialog() 18 | { 19 | G_BACKGROUND_PTR->removeObserver(this); 20 | } 21 | 22 | void DownloadAbstractMoveDialog::backgroundChanged() 23 | { 24 | setBackgroundPixmap(size()); 25 | } 26 | 27 | int DownloadAbstractMoveDialog::exec() 28 | { 29 | setBackgroundPixmap(size()); 30 | return QDialog::exec(); 31 | } 32 | 33 | void DownloadAbstractMoveDialog::show() 34 | { 35 | setBackgroundPixmap(size()); 36 | QDialog::show(); 37 | } 38 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadCoreKits/downloadabstractmovewidget.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadabstractmovewidget.h" 2 | #include "downloadbackgroundmanager.h" 3 | 4 | DownloadAbstractMoveWidget::DownloadAbstractMoveWidget(QWidget *parent) 5 | : DownloadAbstractMoveWidget(true, parent) 6 | { 7 | 8 | } 9 | 10 | DownloadAbstractMoveWidget::DownloadAbstractMoveWidget(bool transparent, QWidget *parent) 11 | : TTKAbstractMoveWidget(transparent, parent), 12 | DownloadWidgetRenderer() 13 | { 14 | G_BACKGROUND_PTR->addObserver(this); 15 | } 16 | 17 | DownloadAbstractMoveWidget::~DownloadAbstractMoveWidget() 18 | { 19 | G_BACKGROUND_PTR->removeObserver(this); 20 | } 21 | 22 | void DownloadAbstractMoveWidget::backgroundChanged() 23 | { 24 | setBackgroundPixmap(size()); 25 | } 26 | 27 | void DownloadAbstractMoveWidget::show() 28 | { 29 | setBackgroundPixmap(size()); 30 | QWidget::show(); 31 | } 32 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadCoreKits/downloadabstracttablewidget.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadabstracttablewidget.h" 2 | #include "downloadwidgetutils.h" 3 | 4 | DownloadAbstractTableWidget::DownloadAbstractTableWidget(QWidget *parent) 5 | : TTKAbstractTableWidget(parent) 6 | { 7 | setStyleSheet(TTK::UI::TableWidgetStyle01 + TTK::UI::ScrollBarStyle03 + TTK::UI::LineEditStyle01); 8 | 9 | TTK::Widget::setTransparent(this, 0); 10 | #if defined Q_OS_UNIX && !TTK_QT_VERSION_CHECK(5,7,0) //Fix linux selection-background-color stylesheet bug 11 | TTK::Widget::setTransparent(this, QColor(20, 20, 20, 10)); 12 | #endif 13 | } 14 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadCoreKits/downloadabstracttablewidget.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADABSTRACTTABLEWIDGET_H 2 | #define DOWNLOADABSTRACTTABLEWIDGET_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "downloaduiobject.h" 23 | #include "ttkabstracttablewidget.h" 24 | 25 | /*! @brief The class of the table widget base. 26 | * @author Greedysky 27 | */ 28 | class TTK_MODULE_EXPORT DownloadAbstractTableWidget : public TTKAbstractTableWidget 29 | { 30 | Q_OBJECT 31 | TTK_DECLARE_MODULE(DownloadAbstractTableWidget) 32 | public: 33 | /*! 34 | * Object constructor. 35 | */ 36 | explicit DownloadAbstractTableWidget(QWidget *parent = nullptr); 37 | 38 | }; 39 | 40 | #endif // DOWNLOADABSTRACTTABLEWIDGET_H 41 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadCoreKits/downloadtoolmenuwidget.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadtoolmenuwidget.h" 2 | #include "downloaduiobject.h" 3 | 4 | #include 5 | 6 | DownloadToolMenu::DownloadToolMenu(QWidget *parent) 7 | : QMenu(parent) 8 | { 9 | 10 | } 11 | 12 | void DownloadToolMenu::showEvent(QShowEvent *event) 13 | { 14 | QMenu::showEvent(event); 15 | Q_EMIT windowStateChanged(true); 16 | } 17 | 18 | void DownloadToolMenu::hideEvent(QHideEvent *event) 19 | { 20 | QMenu::hideEvent(event); 21 | Q_EMIT windowStateChanged(false); 22 | } 23 | 24 | 25 | DownloadToolMenuWidget::DownloadToolMenuWidget(QWidget *parent) 26 | : QToolButton(parent) 27 | { 28 | setCursor(Qt::PointingHandCursor); 29 | 30 | m_menu = new DownloadToolMenu(this); 31 | QWidgetAction *actionWidget = new QWidgetAction(m_menu); 32 | m_containWidget = new QWidget(m_menu); 33 | 34 | actionWidget->setDefaultWidget(m_containWidget); 35 | m_menu->addAction(actionWidget); 36 | 37 | connect(this, SIGNAL(clicked()), SLOT(popupMenu())); 38 | } 39 | 40 | DownloadToolMenuWidget::~DownloadToolMenuWidget() 41 | { 42 | delete m_containWidget; 43 | delete m_menu; 44 | } 45 | 46 | void DownloadToolMenuWidget::setTranslucentBackground() 47 | { 48 | m_menu->setWindowFlags(m_menu->windowFlags() | Qt::FramelessWindowHint); 49 | m_menu->setAttribute(Qt::WA_TranslucentBackground); 50 | m_menu->setStyleSheet(TTK::UI::MenuStyle04); 51 | } 52 | 53 | void DownloadToolMenuWidget::popupMenu() 54 | { 55 | QPoint pos = mapToGlobal(QPoint(0, 0)); 56 | pos.setY(pos.y() - m_containWidget->height() - 10); 57 | pos.setX(pos.x() - (m_containWidget->width() - width()) / 2); 58 | 59 | m_menu->exec(pos); 60 | } 61 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadCoreKits/downloadwidgetrenderer.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadwidgetrenderer.h" 2 | #include "downloadextractmanager.h" 3 | #include "downloadbackgroundmanager.h" 4 | #include "downloadbackgroundconfigmanager.h" 5 | 6 | DownloadWidgetRenderer::DownloadWidgetRenderer() 7 | : m_background(nullptr) 8 | { 9 | 10 | } 11 | 12 | void DownloadWidgetRenderer::setBackgroundPixmap(const QSize &size) 13 | { 14 | if(!m_background) 15 | { 16 | return; 17 | } 18 | 19 | DownloadBackgroundImage image; 20 | if(DownloadExtractManager::outputSkin(&image, G_BACKGROUND_PTR->backgroundUrl())) 21 | { 22 | m_background->setPixmap(image.m_pix.scaled(size)); 23 | } 24 | else 25 | { 26 | m_background->setPixmap(QPixmap(G_BACKGROUND_PTR->backgroundUrl()).scaled(size)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadRemoteKits/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | set_property(GLOBAL PROPERTY TTK_WIDGET_REMOTE_KITS_HEADER_FILES 22 | ${TTK_WIDGET_REMOTEWIDGET_DIR}/downloadremotewidget.h 23 | ) 24 | 25 | set_property(GLOBAL PROPERTY TTK_WIDGET_REMOTE_KITS_SOURCE_FILES 26 | ${TTK_WIDGET_REMOTEWIDGET_DIR}/downloadremotewidget.cpp 27 | ) 28 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadRemoteKits/DownloadRemoteKits.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | INCLUDEPATH += $$PWD 20 | 21 | HEADERS += $$PWD/downloadremotewidget.h 22 | 23 | SOURCES += $$PWD/downloadremotewidget.cpp 24 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadUiKits/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | set_property(GLOBAL PROPERTY TTK_WIDGET_UI_KITS_HEADER_FILES 22 | ${TTK_WIDGET_UI_DIR}/downloadfunctionuiobject.h 23 | ${TTK_WIDGET_UI_DIR}/downloadtinyuiobject.h 24 | ${TTK_WIDGET_UI_DIR}/downloaduiobject.h 25 | ) 26 | 27 | set_property(GLOBAL PROPERTY TTK_UI_FILES 28 | ${TTK_WIDGET_UI_DIR}/downloadapplication.ui 29 | ${TTK_WIDGET_UI_DIR}/downloadbackgroundskindialog.ui 30 | ${TTK_WIDGET_UI_DIR}/downloadcolordialog.ui 31 | ${TTK_WIDGET_UI_DIR}/downloadmessageaboutdialog.ui 32 | ${TTK_WIDGET_UI_DIR}/downloadmessagebox.ui 33 | ${TTK_WIDGET_UI_DIR}/downloadnewfiledialog.ui 34 | ${TTK_WIDGET_UI_DIR}/downloadsettingwidget.ui 35 | ) 36 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadUiKits/DownloadUiKits.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | INCLUDEPATH += $$PWD 20 | 21 | HEADERS += \ 22 | $$PWD/downloaduiobject.h \ 23 | $$PWD/downloadfunctionuiobject.h \ 24 | $$PWD/downloadtinyuiobject.h 25 | 26 | FORMS += \ 27 | $$PWD/downloadapplication.ui \ 28 | $$PWD/downloadbackgroundskindialog.ui \ 29 | $$PWD/downloadnewfiledialog.ui \ 30 | $$PWD/downloadcolordialog.ui \ 31 | $$PWD/downloadmessagebox.ui \ 32 | $$PWD/downloadmessageaboutdialog.ui \ 33 | $$PWD/downloadsettingwidget.ui 34 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadWidgetKits/downloadglobalhotkeyedit.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadglobalhotkeyedit.h" 2 | #include "downloadhotkeymanager.h" 3 | 4 | #include 5 | 6 | DownloadGlobalHotKeyEdit::DownloadGlobalHotKeyEdit(QWidget *parent) 7 | : QLineEdit(parent) 8 | { 9 | setReadOnly(true); 10 | } 11 | 12 | void DownloadGlobalHotKeyEdit::setHotKeyEnabled(bool state) 13 | { 14 | setEnabled(state); 15 | setReadOnly(!state); 16 | } 17 | 18 | void DownloadGlobalHotKeyEdit::keyPressEvent(QKeyEvent *event) 19 | { 20 | setText(G_HOTKEY_PTR->toString(event->key(), event->modifiers())); 21 | } 22 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadWidgetKits/downloadmessageaboutdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadmessageaboutdialog.h" 2 | #include "ui_downloadmessageaboutdialog.h" 3 | #include "downloaduiobject.h" 4 | #include "ttkversion.h" 5 | 6 | DownloadMessageAboutDialog::DownloadMessageAboutDialog(QWidget *parent) 7 | : DownloadAbstractMoveDialog(parent), 8 | m_ui(new Ui::DownloadMessageAboutDialog) 9 | { 10 | m_ui->setupUi(this); 11 | setBackgroundLabel(m_ui->background); 12 | 13 | m_ui->topTitleCloseButton->setIcon(QIcon(":/functions/btn_delete_normal")); 14 | m_ui->topTitleCloseButton->setStyleSheet(TTK::UI::ToolButtonStyle03); 15 | m_ui->topTitleCloseButton->setCursor(QCursor(Qt::PointingHandCursor)); 16 | m_ui->topTitleCloseButton->setToolTip(tr("Close")); 17 | 18 | m_ui->iconLabel->setPixmap(QPixmap(":/image/lb_logo")); 19 | m_ui->textLabel->setText(QString("Version: %1\n").arg(TTK_VERSION_STR) + m_ui->textLabel->text()); 20 | 21 | connect(m_ui->topTitleCloseButton, SIGNAL(clicked()), SLOT(close())); 22 | } 23 | 24 | DownloadMessageAboutDialog::~DownloadMessageAboutDialog() 25 | { 26 | delete m_ui; 27 | } 28 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadWidgetKits/downloadmessageaboutdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADMESSAGEABOUTDIALOG_H 2 | #define DOWNLOADMESSAGEABOUTDIALOG_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include "downloadabstractmovedialog.h" 23 | 24 | namespace Ui { 25 | class DownloadMessageAboutDialog; 26 | } 27 | /*! @brief The class of the about application info dialog. 28 | * @author Greedysky 29 | */ 30 | class TTK_MODULE_EXPORT DownloadMessageAboutDialog : public DownloadAbstractMoveDialog 31 | { 32 | Q_OBJECT 33 | TTK_DECLARE_MODULE(DownloadMessageAboutDialog) 34 | public: 35 | /*! 36 | * Object constructor. 37 | */ 38 | explicit DownloadMessageAboutDialog(QWidget *parent = nullptr); 39 | /*! 40 | * Object destructor. 41 | */ 42 | ~DownloadMessageAboutDialog(); 43 | 44 | private: 45 | Ui::DownloadMessageAboutDialog *m_ui; 46 | 47 | }; 48 | 49 | #endif // DOWNLOADMESSAGEABOUTDIALOG_H 50 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadWidgetKits/downloadnewfiledialog.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadnewfiledialog.h" 2 | #include "ui_downloadnewfiledialog.h" 3 | #include "downloadbackgroundmanager.h" 4 | #include "downloadobject.h" 5 | #include "downloaduiobject.h" 6 | 7 | DownloadNewFileDialog::DownloadNewFileDialog(QWidget *parent) 8 | : DownloadAbstractMoveDialog(parent), 9 | m_ui(new Ui::DownloadNewFileDialog) 10 | { 11 | m_ui->setupUi(this); 12 | setBackgroundLabel(m_ui->background); 13 | 14 | m_ui->topTitleCloseButton->setIcon(QIcon(":/functions/btn_delete_normal")); 15 | m_ui->topTitleCloseButton->setStyleSheet(TTK::UI::ToolButtonStyle03); 16 | m_ui->topTitleCloseButton->setCursor(QCursor(Qt::PointingHandCursor)); 17 | m_ui->topTitleCloseButton->setToolTip(tr("Close")); 18 | 19 | m_ui->urlTextEdit->setStyleSheet(QString("QTextEdit{ border:1px solid %1; }").arg(G_BACKGROUND_PTR->backgroundColor().name())); 20 | 21 | m_ui->confirmButton->setCursor(QCursor(Qt::PointingHandCursor)); 22 | m_ui->confirmButton->setStyleSheet(TTK::UI::PushButtonStyle03); 23 | #ifdef Q_OS_UNIX 24 | m_ui->confirmButton->setFocusPolicy(Qt::NoFocus); 25 | #endif 26 | 27 | connect(m_ui->topTitleCloseButton, SIGNAL(clicked()), SLOT(close())); 28 | connect(m_ui->confirmButton, SIGNAL(clicked()), SLOT(confirmButtonPressed())); 29 | } 30 | 31 | DownloadNewFileDialog::~DownloadNewFileDialog() 32 | { 33 | delete m_ui; 34 | } 35 | 36 | void DownloadNewFileDialog::confirmButtonPressed() 37 | { 38 | Q_EMIT setDownloadPath(m_ui->urlTextEdit->toPlainText().split(';')); 39 | close(); 40 | } 41 | -------------------------------------------------------------------------------- /TTKModule/TTKWidget/downloadWidgetKits/downloadsystemtraymenu.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADSYSTEMTRAYMENU_H 2 | #define DOWNLOADSYSTEMTRAYMENU_H 3 | 4 | /*************************************************************************** 5 | * This file is part of the TTK Downloader project 6 | * Copyright (C) 2015 - 2025 Greedysky Studio 7 | 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | 18 | * You should have received a copy of the GNU General Public License along 19 | * with this program; If not, see . 20 | ***************************************************************************/ 21 | 22 | #include 23 | #include "ttkmoduleexport.h" 24 | 25 | /*! @brief The class of the system tray menu widget. 26 | * @author Greedysky 27 | */ 28 | class TTK_MODULE_EXPORT DownloadSystemTrayMenu : public QMenu 29 | { 30 | Q_OBJECT 31 | TTK_DECLARE_MODULE(DownloadSystemTrayMenu) 32 | public: 33 | /*! 34 | * Object constructor. 35 | */ 36 | explicit DownloadSystemTrayMenu(QWidget *parent = nullptr); 37 | /*! 38 | * Object destructor. 39 | */ 40 | ~DownloadSystemTrayMenu(); 41 | 42 | private: 43 | /*! 44 | * Override the widget event. 45 | */ 46 | virtual void showEvent(QShowEvent *event) override final; 47 | 48 | QMenu *m_floatMenu; 49 | 50 | }; 51 | 52 | #endif // DOWNLOADSYSTEMTRAYMENU_H 53 | -------------------------------------------------------------------------------- /TTKModule/downloadleftareawidget.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadleftareawidget.h" 2 | #include "ui_downloadapplication.h" 3 | #include "downloadsettingwidget.h" 4 | #include "downloadhotkeymanager.h" 5 | 6 | DownloadLeftAreaWidget *DownloadLeftAreaWidget::m_instance = nullptr; 7 | 8 | DownloadLeftAreaWidget::DownloadLeftAreaWidget(QWidget *parent) 9 | : QWidget(parent) 10 | { 11 | m_instance = this; 12 | 13 | m_settingWidget = new DownloadSettingWidget(this); 14 | connect(m_settingWidget, SIGNAL(parameterSettingChanged()), parent, SLOT(applyParameter())); 15 | 16 | G_HOTKEY_PTR->addHotKey(this, "Ctrl+O", SLOT(showSettingWidget())); 17 | } 18 | 19 | DownloadLeftAreaWidget::~DownloadLeftAreaWidget() 20 | { 21 | delete m_settingWidget; 22 | } 23 | 24 | DownloadLeftAreaWidget *DownloadLeftAreaWidget::instance() 25 | { 26 | return m_instance; 27 | } 28 | 29 | void DownloadLeftAreaWidget::setupUi(Ui::DownloadApplication *ui) 30 | { 31 | m_ui = ui; 32 | 33 | connect(ui->fucntionListWidget, SIGNAL(currentIndexChanged(int)), SLOT(funcitonIndexChanged(int))); 34 | connect(ui->settingButton, SIGNAL(clicked()), SLOT(showSettingWidget())); 35 | } 36 | 37 | void DownloadLeftAreaWidget::funcitonIndexChanged(int index) 38 | { 39 | m_ui->centerStackedWidget->setCurrentIndex(index); 40 | m_ui->startDownloadButton->setVisible(index == 0); 41 | m_ui->pauseDownloadButton->setVisible(index == 0); 42 | m_ui->deleteDownloadButton->setVisible(index == 0); 43 | } 44 | 45 | void DownloadLeftAreaWidget::showSettingWidget() 46 | { 47 | m_settingWidget->initialize(); 48 | m_settingWidget->exec(); 49 | } 50 | -------------------------------------------------------------------------------- /TTKResource/1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/1.ico -------------------------------------------------------------------------------- /TTKResource/2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/2.ico -------------------------------------------------------------------------------- /TTKResource/3.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/3.ico -------------------------------------------------------------------------------- /TTKResource/4.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/4.ico -------------------------------------------------------------------------------- /TTKResource/_extras/TTKConsole.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | routine="../TTKRoutine.sh" 4 | appname=`basename $0 | sed s,\.sh$,,` 5 | 6 | if [ -z "$appname" ]; then 7 | echo "No Run App Name Input!" 8 | return 9 | fi 10 | 11 | dirpath=`dirname $0` 12 | tmp="${dirpath#?}" 13 | 14 | if [ "${dirpath%$tmp}" != "/" ]; then 15 | dirpath=$PWD/$dirpath 16 | fi 17 | 18 | $dirpath/$routine "$dirpath/$appname" "$@" 19 | -------------------------------------------------------------------------------- /TTKResource/_extras/TTKDownloader.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | routine="TTKRoutine.sh" 4 | appname=`basename $0 | sed s,\.sh$,,` 5 | 6 | if [ -z "$appname" ]; then 7 | echo "No Run App Name Input!" 8 | return 9 | fi 10 | 11 | dirpath=`dirname $0` 12 | tmp="${dirpath#?}" 13 | 14 | if [ "${dirpath%$tmp}" != "/" ]; then 15 | dirpath=$PWD/$dirpath 16 | fi 17 | 18 | $dirpath/$routine "$dirpath/$appname" "$@" 19 | -------------------------------------------------------------------------------- /TTKResource/_extras/TTKInit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | routine="../TTKRoutine.sh" 4 | appname=`basename $0 | sed s,\.sh$,,` 5 | 6 | if [ -z "$appname" ]; then 7 | echo "No Run App Name Input!" 8 | return 9 | fi 10 | 11 | dirpath=`dirname $0` 12 | tmp="${dirpath#?}" 13 | 14 | if [ "${dirpath%$tmp}" != "/" ]; then 15 | dirpath=$PWD/$dirpath 16 | fi 17 | 18 | $dirpath/$routine "$dirpath/$appname" "$@" 19 | -------------------------------------------------------------------------------- /TTKResource/_extras/TTKRoutine.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | appname=$1 4 | 5 | if [ -z "$appname" ]; then 6 | echo "No Run App Name Input!" 7 | return 8 | fi 9 | 10 | dirpath=`dirname $0` 11 | tmp="${dirpath#?}" 12 | 13 | if [ "${dirpath%$tmp}" != "/" ]; then 14 | dirpath=$PWD/$dirpath 15 | fi 16 | 17 | export LD_LIBRARY_PATH=$dirpath:$dirpath/lib:$dirpath/3.1.0.0 18 | export QT_PLUGIN_PATH=$dirpath/plugins:$QT_PLUGIN_PATH 19 | 20 | $appname "$@" 21 | -------------------------------------------------------------------------------- /TTKResource/_extras/TTKRoutineCopy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | appname=$1 4 | 5 | if [ -z "$appname" ]; then 6 | echo "No Run App Name Input!" 7 | return 8 | fi 9 | 10 | des="./" 11 | 12 | deplist=$(ldd $appname | awk '{if (match($3,"/")){ printf("%s "),$3 } }') 13 | cp $deplist $des 14 | -------------------------------------------------------------------------------- /TTKResource/_extras/TTKService.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | routine="../TTKRoutine.sh" 4 | appname=`basename $0 | sed s,\.sh$,,` 5 | 6 | if [ -z "$appname" ]; then 7 | echo "No Run App Name Input!" 8 | return 9 | fi 10 | 11 | dirpath=`dirname $0` 12 | tmp="${dirpath#?}" 13 | 14 | if [ "${dirpath%$tmp}" != "/" ]; then 15 | dirpath=$PWD/$dirpath 16 | fi 17 | 18 | $dirpath/$routine "$dirpath/$appname" "$@" 19 | -------------------------------------------------------------------------------- /TTKResource/_extras/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /TTKResource/_extras/history.tkf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /TTKResource/_extras/list.tkpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /TTKResource/_extras/sound.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/_extras/sound.wav -------------------------------------------------------------------------------- /TTKResource/appTools/item_delete_clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/appTools/item_delete_clicked.png -------------------------------------------------------------------------------- /TTKResource/appTools/item_delete_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/appTools/item_delete_hover.png -------------------------------------------------------------------------------- /TTKResource/appTools/item_delete_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/appTools/item_delete_normal.png -------------------------------------------------------------------------------- /TTKResource/appTools/item_download_clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/appTools/item_download_clicked.png -------------------------------------------------------------------------------- /TTKResource/appTools/item_download_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/appTools/item_download_hover.png -------------------------------------------------------------------------------- /TTKResource/appTools/item_download_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/appTools/item_download_normal.png -------------------------------------------------------------------------------- /TTKResource/appTools/item_finished_clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/appTools/item_finished_clicked.png -------------------------------------------------------------------------------- /TTKResource/appTools/item_finished_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/appTools/item_finished_hover.png -------------------------------------------------------------------------------- /TTKResource/appTools/item_finished_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/appTools/item_finished_normal.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/btn_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/btn_download.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/btn_keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/btn_keyboard.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/btn_setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/btn_setting.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/btn_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/btn_transparent.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/btn_window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/btn_window.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/lb_custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/lb_custom.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/lb_new_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/lb_new_normal.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/lb_protection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/lb_protection.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/lb_quit_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/lb_quit_normal.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/lb_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/lb_selected.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/lb_setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/lb_setting.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/lb_setting_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/lb_setting_normal.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/lb_start_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/lb_start_normal.png -------------------------------------------------------------------------------- /TTKResource/contextMenu/lb_stop_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/contextMenu/lb_stop_normal.png -------------------------------------------------------------------------------- /TTKResource/controls/btn_checkBox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/controls/btn_checkBox_checked.png -------------------------------------------------------------------------------- /TTKResource/controls/btn_checkBox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/controls/btn_checkBox_unchecked.png -------------------------------------------------------------------------------- /TTKResource/controls/btn_radioButton_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/controls/btn_radioButton_unchecked.png -------------------------------------------------------------------------------- /TTKResource/controls/btn_radiobutton_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/controls/btn_radiobutton_checked.png -------------------------------------------------------------------------------- /TTKResource/controls/lb_slider_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/controls/lb_slider_disable.png -------------------------------------------------------------------------------- /TTKResource/controls/lb_slider_handle_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/controls/lb_slider_handle_hover.png -------------------------------------------------------------------------------- /TTKResource/controls/lb_slider_handle_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/controls/lb_slider_handle_normal.png -------------------------------------------------------------------------------- /TTKResource/demo/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/demo/demo.jpg -------------------------------------------------------------------------------- /TTKResource/demo/demo2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/demo/demo2.jpg -------------------------------------------------------------------------------- /TTKResource/functions/btn_close_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_close_hover.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_delete_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_delete_disable.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_delete_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_delete_hover.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_delete_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_delete_normal.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_new_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_new_disable.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_new_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_new_hover.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_new_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_new_normal.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_setting_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_setting_disable.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_setting_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_setting_hover.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_setting_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_setting_normal.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_start_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_start_disable.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_start_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_start_hover.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_start_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_start_normal.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_stop_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_stop_disable.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_stop_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_stop_hover.png -------------------------------------------------------------------------------- /TTKResource/functions/btn_stop_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/btn_stop_normal.png -------------------------------------------------------------------------------- /TTKResource/functions/lb_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/lb_download.png -------------------------------------------------------------------------------- /TTKResource/functions/lb_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/lb_left.png -------------------------------------------------------------------------------- /TTKResource/functions/lb_order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/lb_order.png -------------------------------------------------------------------------------- /TTKResource/functions/lb_plan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/lb_plan.png -------------------------------------------------------------------------------- /TTKResource/functions/lb_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/lb_right.png -------------------------------------------------------------------------------- /TTKResource/functions/lb_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/functions/lb_upload.png -------------------------------------------------------------------------------- /TTKResource/lb_app_logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/lb_app_logo.ico -------------------------------------------------------------------------------- /TTKResource/lb_blankImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/lb_blankImage.png -------------------------------------------------------------------------------- /TTKResource/lb_noneImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/lb_noneImage.png -------------------------------------------------------------------------------- /TTKResource/lb_slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/lb_slider.png -------------------------------------------------------------------------------- /TTKResource/logo_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/logo_banner.png -------------------------------------------------------------------------------- /TTKResource/remote/lb_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/remote/lb_back.png -------------------------------------------------------------------------------- /TTKResource/tiny/btn_close_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/btn_close_hover.png -------------------------------------------------------------------------------- /TTKResource/tiny/btn_close_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/btn_close_normal.png -------------------------------------------------------------------------------- /TTKResource/tiny/btn_max_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/btn_max_hover.png -------------------------------------------------------------------------------- /TTKResource/tiny/btn_max_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/btn_max_normal.png -------------------------------------------------------------------------------- /TTKResource/tiny/btn_min_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/btn_min_hover.png -------------------------------------------------------------------------------- /TTKResource/tiny/btn_min_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/btn_min_normal.png -------------------------------------------------------------------------------- /TTKResource/tiny/btn_setting_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/btn_setting_hover.png -------------------------------------------------------------------------------- /TTKResource/tiny/btn_setting_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/btn_setting_normal.png -------------------------------------------------------------------------------- /TTKResource/tiny/btn_skin_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/btn_skin_hover.png -------------------------------------------------------------------------------- /TTKResource/tiny/btn_skin_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/btn_skin_normal.png -------------------------------------------------------------------------------- /TTKResource/tiny/lb_arrow_up_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/lb_arrow_up_normal.png -------------------------------------------------------------------------------- /TTKResource/tiny/lb_resize_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/lb_resize_normal.png -------------------------------------------------------------------------------- /TTKResource/tiny/lb_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/lb_selected.png -------------------------------------------------------------------------------- /TTKResource/tiny/lb_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/tiny/lb_transparent.png -------------------------------------------------------------------------------- /TTKResource/usermanager/btn_down_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/usermanager/btn_down_arrow.png -------------------------------------------------------------------------------- /TTKResource/usermanager/btn_up_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKResource/usermanager/btn_up_arrow.png -------------------------------------------------------------------------------- /TTKRun/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | add_subdirectory(TTKInit) 22 | add_subdirectory(TTKApp) 23 | add_subdirectory(TTKConsole) 24 | -------------------------------------------------------------------------------- /TTKRun/TTKApp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | project(TTKDownloader) 22 | 23 | set(LIBRARY_OUTPUT_PATH ${TTK_BUILD_DIR}) 24 | set(EXECUTABLE_OUTPUT_PATH ${TTK_BUILD_DIR}) 25 | 26 | include_directories(${TTK_COMMON_DIR}) 27 | include_directories(${TTK_COMMON_RUN_DIR}) 28 | 29 | set(HEADER_FILES 30 | ${TTK_COMMON_RUN_DIR}/ttkrunobject.h 31 | ) 32 | 33 | set(SOURCE_FILES 34 | ${TTK_COMMON_RUN_DIR}/ttkrunobject.cpp 35 | ttkrunmain.cpp 36 | ) 37 | 38 | if(WIN32) 39 | list(APPEND SOURCE_FILES TTKApp.rc) 40 | endif() 41 | 42 | add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES}) 43 | -------------------------------------------------------------------------------- /TTKRun/TTKApp/TTKApp.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | TEMPLATE = app 20 | 21 | DESTDIR = $$OUT_PWD/../../bin 22 | TARGET = TTKDownloader 23 | 24 | include($$PWD/../../TTKCommon/TTKRun/TTKRun.pri) 25 | 26 | SOURCES += $$PWD/ttkrunmain.cpp 27 | 28 | win32:RC_FILE = $$PWD/TTKApp.rc 29 | -------------------------------------------------------------------------------- /TTKRun/TTKApp/TTKApp.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKRun/TTKApp/TTKApp.rc -------------------------------------------------------------------------------- /TTKRun/TTKApp/ttkrunmain.cpp: -------------------------------------------------------------------------------- 1 | #include "ttkrunobject.h" 2 | 3 | #ifdef _MSC_VER // do not show console window 4 | # pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"") 5 | #endif 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | TTKRunObject object; 10 | object.run(argc, argv); 11 | return EXIT_SUCCESS; 12 | } 13 | -------------------------------------------------------------------------------- /TTKRun/TTKConsole/TTKConsole.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKRun/TTKConsole/TTKConsole.rc -------------------------------------------------------------------------------- /TTKRun/TTKConsole/downloadconsolemain.cpp: -------------------------------------------------------------------------------- 1 | #include "downloadconsolemodule.h" 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | QCoreApplication app(argc, argv); 6 | 7 | QCoreApplication::setOrganizationName(TTK_APP_NAME); 8 | QCoreApplication::setOrganizationDomain(TTK_APP_COME_NAME); 9 | QCoreApplication::setApplicationName(TTK_APP_NAME); 10 | 11 | DownloadConsoleModule console; 12 | return console.initialize() ? EXIT_SUCCESS : EXIT_FAILURE; 13 | } 14 | -------------------------------------------------------------------------------- /TTKRun/TTKInit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | project(TTKInit) 22 | 23 | include_directories(${TTK_CONFIG_DIR}) 24 | 25 | set(SOURCE_FILES 26 | downloadinitmain.cpp 27 | ) 28 | 29 | if(WIN32) 30 | list(APPEND SOURCE_FILES ${PROJECT_NAME}.rc) 31 | endif() 32 | 33 | set(QT_LINK_LIBS TTKConfig) 34 | 35 | if(TTK_QT_VERSION VERSION_EQUAL "4") 36 | list(APPEND QT_LINK_LIBS ${QT_QTCORE_LIBRARY}) 37 | elseif(TTK_QT_VERSION VERSION_EQUAL "5") 38 | list(APPEND QT_LINK_LIBS Qt5::Core) 39 | elseif(TTK_QT_VERSION VERSION_EQUAL "6") 40 | list(APPEND QT_LINK_LIBS Qt6::Core) 41 | endif() 42 | 43 | add_executable(${PROJECT_NAME} ${SOURCE_FILES}) 44 | target_link_libraries(${PROJECT_NAME} PRIVATE ${QT_LINK_LIBS}) 45 | -------------------------------------------------------------------------------- /TTKRun/TTKInit/TTKInit.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKRun/TTKInit/TTKInit.rc -------------------------------------------------------------------------------- /TTKRun/TTKInit/downloadinitmain.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "downloadconfigmodule.h" 3 | 4 | #ifdef _MSC_VER // do not show console window 5 | # pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"") 6 | #endif 7 | 8 | int main(int argc, char *argv[]) 9 | { 10 | QCoreApplication app(argc, argv); 11 | 12 | QCoreApplication::setOrganizationName(TTK_APP_NAME); 13 | QCoreApplication::setOrganizationDomain(TTK_APP_COME_NAME); 14 | QCoreApplication::setApplicationName(TTK_APP_NAME); 15 | 16 | DownloadConfigModule config; 17 | config.initialize(); 18 | TTK_INFO_STREAM("Parameter Init success"); 19 | return EXIT_SUCCESS; 20 | } 21 | -------------------------------------------------------------------------------- /TTKRun/TTKRun.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | TEMPLATE = subdirs 20 | CONFIG += ordered 21 | SUBDIRS += TTKInit TTKConsole TTKApp 22 | -------------------------------------------------------------------------------- /TTKService/TTKService.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | TEMPLATE = app 20 | 21 | include($$PWD/../TTKDownloader.pri) 22 | include($$PWD/../TTKCommon/TTKApplication/TTKApplication.pri) 23 | 24 | TARGET = TTKService 25 | 26 | LIBS += -L$$DESTDIR -lTTKCore -lTTKDumper -lTTKConfig 27 | 28 | INCLUDEPATH += \ 29 | $$PWD/../TTKConfig \ 30 | $$PWD/../TTKModule \ 31 | $$PWD/../TTKModule/TTKCore/downloadCoreKits \ 32 | $$PWD/../TTKModule/TTKWidget/downloadCoreKits 33 | 34 | win32:msvc{ 35 | HEADERS += \ 36 | $$PWD/../TTKConfig/downloadconfigmodule.h \ 37 | $$PWD/../TTKModule/downloadapplication.h 38 | } 39 | 40 | SOURCES += $$PWD/downloadservicemain.cpp 41 | 42 | win32:RC_FILE = $$PWD/$${TARGET}.rc 43 | -------------------------------------------------------------------------------- /TTKService/TTKService.rc: -------------------------------------------------------------------------------- 1 | #if defined(UNDER_CE) 2 | include 3 | #else 4 | #include 5 | #endif 6 | #include "../TTKCommon/ttkversion.h" 7 | 8 | IDI_ICON1 ICON DISCARDABLE "../TTKResource/lb_app_logo.ico" 9 | 10 | VS_VERSION_INFO VERSIONINFO 11 | FILEVERSION TTK_RC_FILEVERSION 12 | PRODUCTVERSION TTK_RC_FILEVERSION 13 | FILEFLAGSMASK 0x3fL 14 | 15 | #ifdef _DEBUG 16 | FILEFLAGS VS_FF_DEBUG 17 | #else 18 | FILEFLAGS 0x0L 19 | #endif 20 | 21 | FILEOS VOS__WINDOWS32 22 | FILETYPE VFT_DLL 23 | FILESUBTYPE 0x0L 24 | BEGIN 25 | BLOCK "StringFileInfo" 26 | BEGIN 27 | BLOCK "080404b0" 28 | BEGIN 29 | VALUE "CompanyName", TTK_RC_COMPANY 30 | VALUE "FileDescription", "TTKService" 31 | VALUE "FileVersion", TTK_RC_PRODUCTVERSION 32 | VALUE "InternalName", "TTKService.exe" 33 | VALUE "LegalCopyright", TTK_RC_COPYRIGHT 34 | VALUE "OriginalFilename", "TTKService.exe" 35 | VALUE "ProductName", "TTKService" 36 | VALUE "ProductVersion", TTK_RC_PRODUCTVERSION 37 | END 38 | END 39 | BLOCK "VarFileInfo" 40 | BEGIN 41 | VALUE "Translation", 0x804, 1200 42 | END 43 | END 44 | -------------------------------------------------------------------------------- /TTKThirdParty/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | add_subdirectory(Zlib) 22 | add_subdirectory(TTKExtras) 23 | -------------------------------------------------------------------------------- /TTKThirdParty/TTKExtras/TTKExtras.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | QT += core gui 20 | greaterThan(QT_MAJOR_VERSION, 4){ #Qt5 21 | QT += widgets 22 | } 23 | 24 | TEMPLATE = lib 25 | CONFIG += plugin lib 26 | 27 | include($$PWD/../../TTKVersion.pri) 28 | 29 | DESTDIR = $$OUT_PWD/../../bin/$$TTK_VERSION 30 | TARGET = TTKExtras 31 | 32 | DEFINES += TTK_LIBRARY 33 | 34 | win32:msvc{ 35 | LIBS += -luser32 36 | CONFIG += c++11 37 | }else{ 38 | equals(QT_MAJOR_VERSION, 6){ #Qt6 39 | QMAKE_CXXFLAGS += -std=c++17 40 | }else{ 41 | QMAKE_CXXFLAGS += -std=c++11 42 | } 43 | } 44 | 45 | #load extra define 46 | include($$PWD/../TTKThirdParty.pri) 47 | 48 | include($$PWD/qjson/QJson.pri) 49 | include($$PWD/qshortcut/QShortCut.pri) 50 | 51 | win32:RC_FILE = $$PWD/$${TARGET}.rc 52 | -------------------------------------------------------------------------------- /TTKThirdParty/TTKExtras/TTKExtras.rc: -------------------------------------------------------------------------------- 1 | #if defined(UNDER_CE) 2 | include 3 | #else 4 | #include 5 | #endif 6 | #include "../../TTKCommon/ttkversion.h" 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION TTK_RC_FILEVERSION 10 | PRODUCTVERSION TTK_RC_FILEVERSION 11 | FILEFLAGSMASK 0x3fL 12 | 13 | #ifdef _DEBUG 14 | FILEFLAGS VS_FF_DEBUG 15 | #else 16 | FILEFLAGS 0x0L 17 | #endif 18 | 19 | FILEOS VOS__WINDOWS32 20 | FILETYPE VFT_DLL 21 | FILESUBTYPE 0x0L 22 | BEGIN 23 | BLOCK "StringFileInfo" 24 | BEGIN 25 | BLOCK "080404b0" 26 | BEGIN 27 | VALUE "CompanyName", TTK_RC_COMPANY 28 | VALUE "FileDescription", "TTKExtras" 29 | VALUE "FileVersion", TTK_RC_PRODUCTVERSION 30 | VALUE "LegalCopyright", TTK_RC_COPYRIGHT 31 | VALUE "ProductName", "TTKExtras" 32 | VALUE "ProductVersion", TTK_RC_PRODUCTVERSION 33 | END 34 | END 35 | BLOCK "VarFileInfo" 36 | BEGIN 37 | VALUE "Translation", 0x804, 1200 38 | END 39 | END 40 | -------------------------------------------------------------------------------- /TTKThirdParty/TTKExtras/qjson/QJson.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | INCLUDEPATH += $$PWD 20 | 21 | HEADERS += \ 22 | $$PWD/parser.h \ 23 | $$PWD/parserrunnable.h \ 24 | $$PWD/qobjecthelper.h \ 25 | $$PWD/serializer.h \ 26 | $$PWD/serializerrunnable.h 27 | 28 | SOURCES += \ 29 | $$PWD/parser.cpp \ 30 | $$PWD/qobjecthelper.cpp \ 31 | $$PWD/json_scanner.cpp \ 32 | $$PWD/json_parser.cc \ 33 | $$PWD/parserrunnable.cpp \ 34 | $$PWD/serializer.cpp \ 35 | $$PWD/serializerrunnable.cpp 36 | -------------------------------------------------------------------------------- /TTKThirdParty/TTKExtras/qjson/README.txt: -------------------------------------------------------------------------------- 1 | https://github.com/flavio/qjson -------------------------------------------------------------------------------- /TTKThirdParty/TTKExtras/qjson/parser_p.h: -------------------------------------------------------------------------------- 1 | /* This file is part of QJson 2 | * 3 | * Copyright (C) 2008 Flavio Castelli 4 | * Copyright (C) 2009 Michael Leupold 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1, as published by the Free Software Foundation. 9 | * 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library; see the file COPYING.LIB. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef QJSON_PARSER_P_H 23 | #define QJSON_PARSER_P_H 24 | 25 | #include "parser.h" 26 | 27 | #include 28 | #include 29 | 30 | class JSonScanner; 31 | 32 | namespace yy { 33 | class json_parser; 34 | } 35 | 36 | namespace QJson { 37 | 38 | /** 39 | * @brief Main class used to convert JSON data to QVariant objects private 40 | */ 41 | class ParserPrivate : public TTKPrivate 42 | { 43 | public: 44 | ParserPrivate(); 45 | ~ParserPrivate(); 46 | 47 | void reset(); 48 | 49 | void setError(const QString &errorMsg, int line); 50 | 51 | JSonScanner* m_scanner; 52 | bool m_error; 53 | int m_errorLine; 54 | QString m_errorMsg; 55 | QVariant m_result; 56 | bool m_specialNumbersAllowed; 57 | }; 58 | } 59 | 60 | #endif // QJSON_PARSER_H 61 | -------------------------------------------------------------------------------- /TTKThirdParty/TTKExtras/qjson/qjson_debug.h: -------------------------------------------------------------------------------- 1 | /* This file is part of qjson 2 | * 3 | * Copyright (C) 2009 Michael Leupold 4 | * Copyright (C) 2013 Silvio Moioli 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License version 2.1, as published by the Free Software Foundation. 9 | * 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library; see the file COPYING.LIB. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef QJSON_DEBUG_H 23 | #define QJSON_DEBUG_H 24 | 25 | #include 26 | 27 | // define qjsonDebug() 28 | #ifdef QJSON_VERBOSE_DEBUG_OUTPUT 29 | inline QDebug qjsonDebug() { return QDebug(QtDebugMsg); } 30 | #else 31 | #define qjsonDebug() if(false) QDebug(QtDebugMsg) 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /TTKThirdParty/TTKExtras/qshortcut/QShortCut.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | unix:!mac{ 20 | equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 0){ 21 | QT += x11extras 22 | } 23 | } 24 | 25 | INCLUDEPATH += $$PWD 26 | 27 | HEADERS += \ 28 | $$PWD/qglobalshortcut.h \ 29 | $$PWD/qglobalshortcut_p.h 30 | 31 | win32{ 32 | SOURCES += $$PWD/qglobalshortcut_win.cpp 33 | LIBS += -luser32 34 | } 35 | unix:SOURCES += $$PWD/qglobalshortcut_x11.cpp 36 | mac:SOURCES += $$PWD/qglobalshortcut_mac.cpp 37 | 38 | SOURCES += $$PWD/qglobalshortcut.cpp 39 | -------------------------------------------------------------------------------- /TTKThirdParty/TTKExtras/qshortcut/README.txt: -------------------------------------------------------------------------------- 1 | https://bitbucket.org/libqxt/libqxt/wiki/Home -------------------------------------------------------------------------------- /TTKThirdParty/TTKThirdParty.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | INCLUDEPATH += \ 20 | $$PWD \ 21 | $$PWD/Zlib \ 22 | $$PWD/TTKExtras \ 23 | $$PWD/../TTKCommon \ 24 | $$PWD/../TTKCommon/base 25 | 26 | win32:msvc{ 27 | HEADERS += $$PWD/TTKExtras/qshortcut/qglobalshortcut.h 28 | } 29 | -------------------------------------------------------------------------------- /TTKThirdParty/TTKThirdParty.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | TEMPLATE = subdirs 20 | CONFIG += ordered 21 | SUBDIRS += Zlib TTKExtras 22 | -------------------------------------------------------------------------------- /TTKThirdParty/Zlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | add_subdirectory(zlib) 22 | add_subdirectory(ttkzip) 23 | -------------------------------------------------------------------------------- /TTKThirdParty/Zlib/Zlib.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | TEMPLATE = subdirs 20 | CONFIG += ordered 21 | SUBDIRS += zlib ttkzip 22 | -------------------------------------------------------------------------------- /TTKThirdParty/Zlib/ttkzip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | project(ttkzip) 22 | 23 | add_definitions(-DZLIB_DLL) 24 | add_definitions(-DZLIB_INTERNAL) 25 | 26 | set(HEADER_FILES 27 | zip.h 28 | unzip.h 29 | mztools.h 30 | ioapi.h 31 | crypt.h 32 | ) 33 | 34 | set(SOURCE_FILES 35 | zip.c 36 | unzip.c 37 | mztools.c 38 | ioapi.c 39 | ) 40 | 41 | if(WIN32) 42 | list(APPEND HEADER_FILES iowin32.h) 43 | list(APPEND SOURCE_FILES iowin32.c ${PROJECT_NAME}.rc) 44 | endif() 45 | 46 | if(TTK_BUILD_SHARED) 47 | add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HEADER_FILES}) 48 | else() 49 | add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${HEADER_FILES}) 50 | endif() 51 | target_link_libraries(${PROJECT_NAME} zlib) 52 | -------------------------------------------------------------------------------- /TTKThirdParty/Zlib/ttkzip/iowin32.h: -------------------------------------------------------------------------------- 1 | /* iowin32.h -- IO base function header for compress/uncompress .zip 2 | Version 1.1, February 14h, 2010 3 | part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) 4 | 5 | Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) 6 | 7 | Modifications for Zip64 support 8 | Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) 9 | 10 | For more info read MiniZip_info.txt 11 | 12 | */ 13 | 14 | #include 15 | 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); 22 | void fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def)); 23 | void fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def)); 24 | void fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def)); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /TTKThirdParty/Zlib/ttkzip/mztools.h: -------------------------------------------------------------------------------- 1 | /* 2 | Additional tools for Minizip 3 | Code: Xavier Roche '2004 4 | License: Same as ZLIB (www.gzip.org) 5 | */ 6 | 7 | #ifndef _zip_tools_H 8 | #define _zip_tools_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifndef _ZLIB_H 15 | #include "zlib/zlib.h" 16 | #endif 17 | 18 | #include "unzip.h" 19 | 20 | /* Repair a ZIP file (missing central directory) 21 | file: file to recover 22 | fileOut: output file after recovery 23 | fileOutTmp: temporary file name used for recovery 24 | */ 25 | ZEXTERN int ZEXPORT unzRepair(const char* file, 26 | const char* fileOut, 27 | const char* fileOutTmp, 28 | uLong* nRecovered, 29 | uLong* bytesRecovered); 30 | 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /TTKThirdParty/Zlib/ttkzip/ttkzip.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | TEMPLATE = lib 20 | CONFIG += warn_off plugin lib 21 | 22 | include($$PWD/../../../TTKVersion.pri) 23 | 24 | DESTDIR = $$OUT_PWD/../../../bin/$$TTK_VERSION 25 | TARGET = ttkzip 26 | 27 | DEFINES += \ 28 | ZLIB_DLL \ 29 | ZLIB_INTERNAL 30 | 31 | LIBS += -L$$DESTDIR -lzlib 32 | 33 | INCLUDEPATH += $$PWD/../ 34 | 35 | HEADERS += \ 36 | $$PWD/zip.h \ 37 | $$PWD/unzip.h \ 38 | $$PWD/mztools.h \ 39 | $$PWD/ioapi.h \ 40 | $$PWD/crypt.h 41 | 42 | SOURCES += \ 43 | $$PWD/zip.c \ 44 | $$PWD/unzip.c \ 45 | $$PWD/mztools.c \ 46 | $$PWD/ioapi.c 47 | 48 | win32{ 49 | HEADERS += $$PWD/iowin32.h 50 | SOURCES += $$PWD/iowin32.c 51 | RC_FILE = $$PWD/$${TARGET}.rc 52 | } 53 | -------------------------------------------------------------------------------- /TTKThirdParty/Zlib/ttkzip/ttkzip.rc: -------------------------------------------------------------------------------- 1 | #if defined(UNDER_CE) 2 | include 3 | #else 4 | #include 5 | #endif 6 | #include "../../../TTKCommon/ttkversion.h" 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION TTK_RC_FILEVERSION 10 | PRODUCTVERSION TTK_RC_FILEVERSION 11 | FILEFLAGSMASK 0x3fL 12 | 13 | #ifdef _DEBUG 14 | FILEFLAGS VS_FF_DEBUG 15 | #else 16 | FILEFLAGS 0x0L 17 | #endif 18 | 19 | FILEOS VOS__WINDOWS32 20 | FILETYPE VFT_DLL 21 | FILESUBTYPE 0x0L 22 | BEGIN 23 | BLOCK "StringFileInfo" 24 | BEGIN 25 | BLOCK "080404b0" 26 | BEGIN 27 | VALUE "CompanyName", TTK_RC_COMPANY 28 | VALUE "FileDescription", "TTKZip" 29 | VALUE "FileVersion", TTK_RC_PRODUCTVERSION 30 | VALUE "LegalCopyright", TTK_RC_COPYRIGHT 31 | VALUE "ProductName", "TTKZip" 32 | VALUE "ProductVersion", TTK_RC_PRODUCTVERSION 33 | END 34 | END 35 | BLOCK "VarFileInfo" 36 | BEGIN 37 | VALUE "Translation", 0x804, 1200 38 | END 39 | END 40 | -------------------------------------------------------------------------------- /TTKThirdParty/Zlib/zlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | project(zlib) 22 | 23 | add_definitions(-DZLIB_DLL) 24 | 25 | set(HEADER_FILES 26 | zconf.h 27 | zlib.h 28 | crc32.h 29 | deflate.h 30 | gzguts.h 31 | inffixed.h 32 | inffast.h 33 | inflate.h 34 | inftrees.h 35 | trees.h 36 | zutil.h 37 | ) 38 | 39 | set(SOURCE_FILES 40 | adler32.c 41 | compress.c 42 | crc32.c 43 | deflate.c 44 | gzclose.c 45 | gzlib.c 46 | gzread.c 47 | gzwrite.c 48 | inflate.c 49 | infback.c 50 | inftrees.c 51 | inffast.c 52 | trees.c 53 | uncompr.c 54 | zutil.c 55 | ) 56 | 57 | if(WIN32) 58 | list(APPEND SOURCE_FILES ${PROJECT_NAME}.rc) 59 | endif() 60 | 61 | if(TTK_BUILD_SHARED) 62 | add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${HEADER_FILES}) 63 | else() 64 | add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${HEADER_FILES}) 65 | endif() 66 | -------------------------------------------------------------------------------- /TTKThirdParty/Zlib/zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(gzFile file) { 12 | #ifndef NO_GZCOMPRESS 13 | gz_statep state; 14 | 15 | if (file == NULL) 16 | return Z_STREAM_ERROR; 17 | state = (gz_statep)file; 18 | 19 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 20 | #else 21 | return gzclose_r(file); 22 | #endif 23 | } 24 | -------------------------------------------------------------------------------- /TTKThirdParty/Zlib/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start); 12 | -------------------------------------------------------------------------------- /TTKThirdParty/Zlib/zlib/zlib.rc: -------------------------------------------------------------------------------- 1 | #if defined(UNDER_CE) 2 | include 3 | #else 4 | #include 5 | #endif 6 | #include "../../../TTKCommon/ttkversion.h" 7 | 8 | #define TTK_FILEVERSION 1,3,1,0 9 | #define TTK_PRODUCTVERSION "1.3.1.0" 10 | 11 | VS_VERSION_INFO VERSIONINFO 12 | FILEVERSION TTK_FILEVERSION 13 | PRODUCTVERSION TTK_FILEVERSION 14 | FILEFLAGSMASK 0x3fL 15 | 16 | #ifdef _DEBUG 17 | FILEFLAGS VS_FF_DEBUG 18 | #else 19 | FILEFLAGS 0x0L 20 | #endif 21 | 22 | FILEOS VOS__WINDOWS32 23 | FILETYPE VFT_DLL 24 | FILESUBTYPE 0x0L 25 | BEGIN 26 | BLOCK "StringFileInfo" 27 | BEGIN 28 | BLOCK "080404b0" 29 | BEGIN 30 | VALUE "CompanyName", TTK_RC_COMPANY 31 | VALUE "FileDescription", "zlib" 32 | VALUE "FileVersion", TTK_PRODUCTVERSION 33 | VALUE "ProductName", "zlib" 34 | VALUE "ProductVersion", TTK_PRODUCTVERSION 35 | END 36 | END 37 | BLOCK "VarFileInfo" 38 | BEGIN 39 | VALUE "Translation", 0x804, 1200 40 | END 41 | END 42 | -------------------------------------------------------------------------------- /TTKUi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | cmake_minimum_required(VERSION 3.0.0) 20 | 21 | project(TTKUi) 22 | 23 | SET(QRC_FILES 24 | ${TTK_UI_DIR}/TTKModule.qrc 25 | ) 26 | 27 | if(TTK_QT_VERSION VERSION_EQUAL "4") 28 | qt4_add_resources(RCC_FILES ${QRC_FILES}) 29 | 30 | list(APPEND QT_LINK_LIBS ${QT_QTCORE_LIBRARY}) 31 | elseif(TTK_QT_VERSION VERSION_EQUAL "5") 32 | qt5_add_resources(RCC_FILES ${QRC_FILES}) 33 | 34 | list(APPEND QT_LINK_LIBS Qt5::Core) 35 | elseif(TTK_QT_VERSION VERSION_EQUAL "6") 36 | qt6_add_resources(RCC_FILES ${QRC_FILES}) 37 | 38 | list(APPEND QT_LINK_LIBS Qt6::Core) 39 | endif() 40 | 41 | if(WIN32) 42 | list(APPEND RCC_FILES TTKUi.rc) 43 | endif() 44 | 45 | if(TTK_BUILD_SHARED) 46 | add_library(${PROJECT_NAME} SHARED ${RCC_FILES}) 47 | else() 48 | add_library(${PROJECT_NAME} STATIC ${RCC_FILES}) 49 | endif() 50 | target_link_libraries(${PROJECT_NAME} ${QT_LINK_LIBS}) 51 | -------------------------------------------------------------------------------- /TTKUi/TTKApp.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | ../TTKResource/_extras/config.xml 4 | ../TTKResource/_extras/list.tkpl 5 | ../TTKResource/_extras/history.tkf 6 | ../TTKResource/_extras/avnets.sh 7 | ../TTKResource/_extras/TTKDownloader.sh 8 | ../TTKResource/_extras/TTKRoutine.sh 9 | ../TTKResource/_extras/TTKRoutineCopy.sh 10 | ../TTKResource/_extras/TTKService.sh 11 | ../TTKResource/_extras/TTKConsole.sh 12 | ../TTKResource/_extras/TTKInit.sh 13 | 14 | 15 | -------------------------------------------------------------------------------- /TTKUi/TTKUi.pro: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | TEMPLATE = lib 20 | msvc:CONFIG += staticlib 21 | CONFIG += plugin lib 22 | 23 | include($$PWD/../TTKVersion.pri) 24 | 25 | DESTDIR = $$OUT_PWD/../bin/$$TTK_VERSION 26 | TARGET = TTKUi 27 | 28 | RESOURCES += $$PWD/TTKModule.qrc 29 | 30 | win32:RC_FILE = $$PWD/$${TARGET}.rc 31 | -------------------------------------------------------------------------------- /TTKUi/TTKUi.rc: -------------------------------------------------------------------------------- 1 | #if defined(UNDER_CE) 2 | include 3 | #else 4 | #include 5 | #endif 6 | #include "../TTKCommon/ttkversion.h" 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION TTK_RC_FILEVERSION 10 | PRODUCTVERSION TTK_RC_FILEVERSION 11 | FILEFLAGSMASK 0x3fL 12 | 13 | #ifdef _DEBUG 14 | FILEFLAGS VS_FF_DEBUG 15 | #else 16 | FILEFLAGS 0x0L 17 | #endif 18 | 19 | FILEOS VOS__WINDOWS32 20 | FILETYPE VFT_DLL 21 | FILESUBTYPE 0x0L 22 | BEGIN 23 | BLOCK "StringFileInfo" 24 | BEGIN 25 | BLOCK "080404b0" 26 | BEGIN 27 | VALUE "CompanyName", TTK_RC_COMPANY 28 | VALUE "FileDescription", "TTKUi" 29 | VALUE "FileVersion", TTK_RC_PRODUCTVERSION 30 | VALUE "LegalCopyright", TTK_RC_COPYRIGHT 31 | VALUE "ProductName", "TTKUi" 32 | VALUE "ProductVersion", TTK_RC_PRODUCTVERSION 33 | END 34 | END 35 | BLOCK "VarFileInfo" 36 | BEGIN 37 | VALUE "Translation", 0x804, 1200 38 | END 39 | END 40 | -------------------------------------------------------------------------------- /TTKUtils/auc/make_auc.bat: -------------------------------------------------------------------------------- 1 | "C:\Program Files (x86)\Windows Kits\8.1\bin\x86\mt.exe" -manifest "manifest" -outputresource:"TTKInit.exe" 2 | "C:\Program Files (x86)\Windows Kits\8.1\bin\x86\mt.exe" -manifest "manifest" -outputresource:"TTKDownloader.exe" 3 | "C:\Program Files (x86)\Windows Kits\8.1\bin\x86\mt.exe" -manifest "manifest" -outputresource:"TKConsole.exe" 4 | "C:\Program Files (x86)\Windows Kits\8.1\bin\x86\mt.exe" -manifest "manifest" -outputresource:"3.1.0.0/TTKService.exe" 5 | -------------------------------------------------------------------------------- /TTKUtils/auc/manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /TTKUtils/deploy/make_desktop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | path=share/applications 4 | if [ ! -d $path ]; then 5 | mkdir $path 6 | fi 7 | 8 | datapath=$path/TTKDownloader.desktop 9 | packpath="$PWD/$datapath" 10 | userpath=~/.local/$datapath 11 | iconpath="$PWD/share/pixmaps/ttkdownloader.png" 12 | execpath="$PWD/../TTKDownloader" 13 | 14 | echo -n "[Desktop Entry] 15 | Type=Application 16 | Version=3.1.0.0 17 | Name=TTKDownloader 18 | Name[zh_CN]=天天下载 19 | Name[zh_TW]=天天下載 20 | GenericName=TTKDownloader 21 | GenericName[zh_CN]=天天下载 22 | GenericName[zh_TW]=天天下載 23 | Comment=TTKDownloader 24 | Comment[zh_CN]=天天下载 25 | Comment[zh_TW]=天天下載 26 | Icon=$iconpath 27 | Exec=$execpath 28 | Terminal=false 29 | Keywords=multimedia;downloader; 30 | Categories=Downloader;Qt; 31 | MimeType= 32 | X-KDE-StartupNotify=false\n" > $packpath 33 | 34 | cp -rv $packpath $userpath 35 | chmod +x $userpath 36 | -------------------------------------------------------------------------------- /TTKUtils/deploy/share/pixmaps/ttkdownloader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKUtils/deploy/share/pixmaps/ttkdownloader.png -------------------------------------------------------------------------------- /TTKUtils/linux_time.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | find . -exec touch -c -m -d "2025-05-05 12:00" {} \; 3 | -------------------------------------------------------------------------------- /TTKUtils/resource.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SOURCE="$1/_extras" 4 | OUTPUT="$2" 5 | 6 | #make output dir 7 | mkdir -p "$OUTPUT" 8 | 9 | #copy 10 | cp -rv "$SOURCE/TTKInit.sh" "$OUTPUT/TTKInit.sh" 11 | cp -rv "$SOURCE/TTKDownloader.sh" "$OUTPUT/../TTKDownloader.sh" 12 | cp -rv "$SOURCE/TTKRoutine.sh" "$OUTPUT/../TTKRoutine.sh" 13 | cp -rv "$SOURCE/TTKConsole.sh" "$OUTPUT/TTKConsole.sh" 14 | cp -rv "$SOURCE/TTKService.sh" "$OUTPUT/TTKService.sh" 15 | cp -rv "$SOURCE/TTKRoutineCopy.sh" "$OUTPUT/TTKRoutineCopy.sh" 16 | 17 | #chmod 18 | chmod +x "$OUTPUT/TTKInit.sh" 19 | chmod +x "$OUTPUT/../TTKDownloader.sh" 20 | chmod +x "$OUTPUT/../TTKRoutine.sh" 21 | chmod +x "$OUTPUT/TTKConsole.sh" 22 | chmod +x "$OUTPUT/TTKService.sh" 23 | chmod +x "$OUTPUT/TTKRoutineCopy.sh" 24 | -------------------------------------------------------------------------------- /TTKUtils/resource/README.txt: -------------------------------------------------------------------------------- 1 | 天天下载 2 | TTKDownloader 3 | 4 | Offical web page: https://github.com/Greedysky/TTKDownloader 5 | Bug tracker: https://github.com/Greedysky/TTKDownloader/issues 6 | Maintainer: Greedysky 7 | License: GNU Lesser General Public License Version 3 for TTKCommon modules 8 | GNU General Public License Version 3 for other modules 9 | 10 | 本软件仅供学习交流,不可用于商业用途,否则后果自负 11 | Copyright(C) 2015 - 2025 Greedysky All Rights Reserved 12 | -------------------------------------------------------------------------------- /TTKUtils/resource/qicon.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Greedysky/TTKDownloader/64be5c98353434bf46a1a8c587dd38e6d9418060/TTKUtils/resource/qicon.dll -------------------------------------------------------------------------------- /TTKUtils/ts_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LCEXE="$1" 4 | OUTPUT="$2/GLanguage" 5 | SOURCE="$3/TTKLanguage" 6 | 7 | #make output dir 8 | mkdir -p "$OUTPUT" 9 | 10 | #make 11 | for i in "$SOURCE"/*.ts 12 | do 13 | $LCEXE "$i" 14 | done 15 | 16 | #rename 17 | for i in "$SOURCE"/*.qm 18 | do 19 | rename -v -f 's/.qm/.ln/' "$i" 20 | done 21 | 22 | #move 23 | for i in "$SOURCE"/*.ln 24 | do 25 | mv "$i" "$OUTPUT" 26 | done 27 | -------------------------------------------------------------------------------- /TTKUtils/ts_win.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | PUSHD %~dp0 3 | 4 | set LCEXE="%1" 5 | set OUTPUT="%2/GLanguage" 6 | set SOURCE="%3/TTKLanguage" 7 | 8 | ::make output dir 9 | if not exist "%OUTPUT%" md "%OUTPUT%" 10 | 11 | ::make 12 | for /r "%SOURCE%" %%f in (*.ts) do %LCEXE% "%%f" 13 | 14 | ::rename 15 | for /r "%SOURCE%" %%f in (*.qm) do ren "%%f" *.ln 16 | 17 | ::move 18 | for /r "%SOURCE%" %%f in (*.ln) do move /y "%%f" "%OUTPUT%" 19 | 20 | POPD %~dp0 21 | -------------------------------------------------------------------------------- /TTKUtils/ttk_runtime: -------------------------------------------------------------------------------- 1 | Do copy runtime shell script, don't remove it. 2 | 是否需要执行拷贝运行脚本,请勿删除。 3 | -------------------------------------------------------------------------------- /TTKVersion.pri: -------------------------------------------------------------------------------- 1 | # *************************************************************************** 2 | # * This file is part of the TTK Downloader project 3 | # * Copyright (C) 2015 - 2025 Greedysky Studio 4 | # 5 | # * This program is free software; you can redistribute it and/or modify 6 | # * it under the terms of the GNU General Public License as published by 7 | # * the Free Software Foundation; either version 3 of the License, or 8 | # * (at your option) any later version. 9 | # 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # 15 | # * You should have received a copy of the GNU General Public License along 16 | # * with this program; If not, see . 17 | # *************************************************************************** 18 | 19 | UI_DIR = ./.build/ui 20 | MOC_DIR = ./.build/moc 21 | OBJECTS_DIR = ./.build/obj 22 | RCC_DIR = ./.build/rcc 23 | 24 | greaterThan(QT_MAJOR_VERSION, 4): DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050400 QT_DEPRECATED_WARNINGS 25 | 26 | # update time 2025.05.05 27 | TTK_VERSION = 3.1.0.0 28 | --------------------------------------------------------------------------------