├── .github ├── FUNDING.yml └── workflows │ ├── android.yml │ ├── appimage.yml │ ├── build.yml │ ├── codespell.yml │ ├── macos.yml │ ├── mingw.yml │ ├── msvc.yml │ └── ubuntu.yml ├── .gitignore ├── .gitmodules ├── .travis.yml ├── App ├── AppIcon.ico ├── AppIcon.rc ├── CMakeLists.txt ├── DlgOption.cpp ├── DlgOption.h ├── DlgOption.ui ├── FrmEyeNurse.cpp ├── FrmEyeNurse.h ├── FrmEyeNurse.ui ├── MainWindow.cpp ├── MainWindow.h ├── MainWindow.ui ├── Resource │ └── Translations │ │ ├── CalendarApp_ar.ts │ │ ├── CalendarApp_ca.ts │ │ ├── CalendarApp_cs.ts │ │ ├── CalendarApp_da.ts │ │ ├── CalendarApp_de.ts │ │ ├── CalendarApp_el.ts │ │ ├── CalendarApp_en.ts │ │ ├── CalendarApp_en_GB.ts │ │ ├── CalendarApp_es.ts │ │ ├── CalendarApp_et.ts │ │ ├── CalendarApp_fi.ts │ │ ├── CalendarApp_fr.ts │ │ ├── CalendarApp_gd.ts │ │ ├── CalendarApp_gl.ts │ │ ├── CalendarApp_hu.ts │ │ ├── CalendarApp_it.ts │ │ ├── CalendarApp_ja.ts │ │ ├── CalendarApp_ko.ts │ │ ├── CalendarApp_nb.ts │ │ ├── CalendarApp_ne.ts │ │ ├── CalendarApp_nl.ts │ │ ├── CalendarApp_nn.ts │ │ ├── CalendarApp_oc.ts │ │ ├── CalendarApp_pl.ts │ │ ├── CalendarApp_pt_BR.ts │ │ ├── CalendarApp_pt_PT.ts │ │ ├── CalendarApp_ro.ts │ │ ├── CalendarApp_ru.ts │ │ ├── CalendarApp_sk.ts │ │ ├── CalendarApp_sl.ts │ │ ├── CalendarApp_sv.ts │ │ ├── CalendarApp_th.ts │ │ ├── CalendarApp_tr.ts │ │ ├── CalendarApp_uk.ts │ │ ├── CalendarApp_zh_CN.ts │ │ └── CalendarApp_zh_TW.ts ├── android │ ├── AndroidManifest.xml │ └── res │ │ ├── drawable-hdpi │ │ └── icon.png │ │ ├── drawable-ldpi │ │ └── icon.png │ │ ├── drawable-mdpi │ │ └── icon.png │ │ ├── drawable-xhdpi │ │ └── icon.png │ │ ├── drawable-xxhdpi │ │ └── icon.png │ │ ├── drawable-xxxhdpi │ │ └── icon.png │ │ ├── values-zh │ │ └── strings.xml │ │ └── values │ │ └── strings.xml └── main.cpp ├── Authors.md ├── Authors_zh_CN.md ├── CMakeLists.txt ├── ChangeLog.md ├── ChangeLog_zh_CN.md ├── Install ├── Install.nsi └── install.sh ├── License.md ├── README.md ├── README_zh_CN.md ├── Resource └── Image │ ├── English.png │ ├── ScreenShot │ ├── AndroidCalendar.png │ ├── AndroidCalendar_zh_CN.png │ ├── AndroidStricky.png │ ├── AndroidStrickyList.png │ ├── AndroidStrickyList_zh_CN.png │ ├── AndroidStricky_zh_CN.png │ ├── AndroidTask.png │ ├── AndroidTask_zh_CN.png │ ├── Calendar.png │ ├── Calendar_zh_CN.png │ ├── Sticky.png │ ├── Sticky_zh_CN.png │ ├── Task.png │ └── Task_zh_CN.png │ └── china.png ├── Script ├── build_appimage.sh ├── build_debpackage.sh ├── build_depend.sh └── test_linux.sh ├── Src ├── CMakeLists.txt ├── DlgContainer.cpp ├── DlgContainer.h ├── DlgContainer.ui ├── DlgTaskActivity.cpp ├── DlgTaskActivity.h ├── DlgTaskActivity.ui ├── FrmCalendar.cpp ├── FrmCalendar.h ├── FrmCustomActivity.cpp ├── FrmCustomActivity.h ├── FrmCustomActivity.ui ├── FrmFullScreen.cpp ├── FrmFullScreen.h ├── FrmFullScreen.ui ├── FrmStickyList.cpp ├── FrmStickyList.h ├── FrmStickyList.ui ├── FrmStickyNotes.cpp ├── FrmStickyNotes.h ├── FrmStickyNotes.ui ├── FrmTask.cpp ├── FrmTask.h ├── FrmTask.ui ├── FrmTaskProperty.ui ├── FrmTaskPropery.cpp ├── FrmTaskPropery.h ├── FrmTasks.cpp ├── FrmTasks.h ├── FrmTasks.ui ├── FrmTasksList.cpp ├── FrmTasksList.h ├── FrmTasksList.ui ├── FrmTop.cpp ├── FrmTop.h ├── FrmTop.ui ├── FrmTopActivity.cpp ├── FrmTopActivity.h ├── Global │ ├── TasksTools.cpp │ └── TasksTools.h ├── ObjectFactory.h ├── Resource │ ├── ResourceTasks.qrc │ ├── Sounds │ │ ├── Alarm05.wav │ │ ├── Alarm08.wav │ │ └── Windows Unlock.wav │ ├── Translations │ │ ├── Tasks_ar.ts │ │ ├── Tasks_ca.ts │ │ ├── Tasks_cs.ts │ │ ├── Tasks_da.ts │ │ ├── Tasks_de.ts │ │ ├── Tasks_el.ts │ │ ├── Tasks_en.ts │ │ ├── Tasks_en_GB.ts │ │ ├── Tasks_es.ts │ │ ├── Tasks_et.ts │ │ ├── Tasks_fi.ts │ │ ├── Tasks_fr.ts │ │ ├── Tasks_gd.ts │ │ ├── Tasks_gl.ts │ │ ├── Tasks_hu.ts │ │ ├── Tasks_it.ts │ │ ├── Tasks_ja.ts │ │ ├── Tasks_ko.ts │ │ ├── Tasks_nb.ts │ │ ├── Tasks_ne.ts │ │ ├── Tasks_nl.ts │ │ ├── Tasks_nn.ts │ │ ├── Tasks_oc.ts │ │ ├── Tasks_pl.ts │ │ ├── Tasks_pt_BR.ts │ │ ├── Tasks_pt_PT.ts │ │ ├── Tasks_ro.ts │ │ ├── Tasks_ru.ts │ │ ├── Tasks_sk.ts │ │ ├── Tasks_sl.ts │ │ ├── Tasks_sv.ts │ │ ├── Tasks_th.ts │ │ ├── Tasks_tr.ts │ │ ├── Tasks_uk.ts │ │ ├── Tasks_zh_CN.ts │ │ └── Tasks_zh_TW.ts │ ├── db │ │ └── TaskActivity.sql │ ├── icons │ │ ├── rabbit-black │ │ │ ├── index.theme │ │ │ └── svg │ │ │ │ ├── add.svg │ │ │ │ ├── down.svg │ │ │ │ ├── sticky.svg │ │ │ │ ├── subtract.svg │ │ │ │ ├── task.svg │ │ │ │ ├── up.svg │ │ │ │ └── week.svg │ │ ├── rabbit-green │ │ │ ├── index.theme │ │ │ └── svg │ │ │ │ ├── add.svg │ │ │ │ ├── down.svg │ │ │ │ ├── sticky.svg │ │ │ │ ├── subtract.svg │ │ │ │ ├── task.svg │ │ │ │ ├── up.svg │ │ │ │ └── week.svg │ │ ├── rabbit-red │ │ │ ├── index.theme │ │ │ └── svg │ │ │ │ ├── add.svg │ │ │ │ ├── down.svg │ │ │ │ ├── sticky.svg │ │ │ │ ├── subtract.svg │ │ │ │ ├── task.svg │ │ │ │ ├── up.svg │ │ │ │ └── week.svg │ │ └── rabbit-white │ │ │ ├── index.theme │ │ │ └── svg │ │ │ ├── add.svg │ │ │ ├── down.svg │ │ │ ├── sticky.svg │ │ │ ├── subtract.svg │ │ │ ├── task.svg │ │ │ ├── up.svg │ │ │ └── week.svg │ └── image │ │ ├── Calendar.png │ │ ├── English.png │ │ ├── EyeCharts.png │ │ ├── EyeNurse.png │ │ ├── Task.png │ │ ├── Tools.png │ │ ├── add.png │ │ ├── bold.png │ │ ├── china.png │ │ ├── close.png │ │ ├── copyright.png │ │ ├── delete.png │ │ ├── down.png │ │ ├── download.png │ │ ├── edit.png │ │ ├── eye.png │ │ ├── file.png │ │ ├── green_close.png │ │ ├── italic.png │ │ ├── monthlyview.png │ │ ├── move.png │ │ ├── option.png │ │ ├── point.png │ │ ├── red_point.png │ │ ├── refresh.png │ │ ├── restart.png │ │ ├── right.png │ │ ├── save.png │ │ ├── skin.png │ │ ├── sticky.png │ │ ├── stricke.png │ │ ├── sub.png │ │ ├── underline.png │ │ ├── up.png │ │ ├── wait.png │ │ └── weeklyview.png ├── Sticky.cpp ├── Sticky.h ├── StickyItemDelegate.cpp ├── StickyItemDelegate.h ├── StickyModel.cpp ├── StickyModel.h ├── Task.cpp ├── Task.h ├── TaskActivity.cpp ├── TaskActivity.h ├── TaskCycleWeek.cpp ├── TaskCycleWeek.h ├── TaskDay.cpp ├── TaskDay.h ├── TaskLockScreen.cpp ├── TaskLockScreen.h ├── TaskPrompt.cpp ├── TaskPrompt.h ├── TaskPromptDelay.cpp ├── TaskPromptDelay.h ├── TaskPromptDelay1.cpp ├── TaskPromptDelay1.h ├── TaskTrayIconPrompt.cpp ├── TaskTrayIconPrompt.h ├── Tasks.cpp ├── Tasks.h ├── Tasks.rc ├── TasksList.cpp ├── TasksList.h ├── ThreadTasks.cpp ├── ThreadTasks.h ├── ViewTaskProperty.cpp ├── ViewTaskProperty.h └── export │ ├── tasks_export.h │ ├── tasks_export_linux.h │ └── tasks_export_windows.h ├── Update ├── update.json ├── update.xml ├── update_android.xml ├── update_linux.xml └── update_windows.xml ├── appveyor.yml ├── cmake ├── Tasks.pc.in └── TasksConfig.cmake.in ├── debian ├── changelog ├── control ├── copyright ├── postinst ├── postrm ├── preinst ├── prerm ├── rules ├── source │ └── format └── watch ├── deploy.sh ├── etc ├── Calendar_log4qt.conf ├── Calendar_logqt.ini ├── TasksList_en.xml └── TasksList_zh_CN.xml ├── share ├── Calendar.sh └── applications │ └── org.Rabbit.Calendar.desktop.in ├── vcpkg.json └── vcpkg └── manifests └── vcpkg.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | 14 | - https://github.com/KangLin/RabbitCommon/raw/master/Src/Resource/image/Contribute.png 15 | - https://gitee.com/kl222/RabbitCommon/raw/master/Src/Resource/image/Contribute.png 16 | - https://gitlab.com/kl222/RabbitCommon/-/raw/master/Src/Resource/image/Contribute.png -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # Author: Kang Lin 2 | 3 | name: build 4 | 5 | env: 6 | artifact_path: artifact_path 7 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 8 | Calendar_VERSION: v1.0.22 9 | 10 | on: 11 | push: 12 | pull_request: 13 | 14 | jobs: 15 | ubuntu: 16 | uses: ./.github/workflows/ubuntu.yml 17 | 18 | appimage: 19 | uses: ./.github/workflows/appimage.yml 20 | secrets: inherit 21 | 22 | msvc: 23 | uses: ./.github/workflows/msvc.yml 24 | 25 | mingw: 26 | uses: ./.github/workflows/mingw.yml 27 | 28 | macos: 29 | uses: ./.github/workflows/macos.yml 30 | 31 | android: 32 | uses: ./.github/workflows/android.yml 33 | secrets: inherit 34 | 35 | deploy: 36 | #if: ${{ startsWith(github.ref, 'refs/tags/') }} 37 | runs-on: ubuntu-latest 38 | needs: [ubuntu, appimage, msvc, macos, android] 39 | steps: 40 | - name: Checkout Repository 41 | uses: actions/checkout@v3 42 | with: 43 | submodules: false 44 | 45 | - name: Download ubuntu 46 | uses: actions/download-artifact@v4 47 | with: 48 | name: ${{ needs.ubuntu.outputs.name }} 49 | path: ${{ env.artifact_path }} 50 | merge-multiple: true 51 | 52 | - name: Download appimage 53 | uses: actions/download-artifact@v4 54 | with: 55 | name: ${{ needs.appimage.outputs.name }} 56 | path: ${{ env.artifact_path }} 57 | merge-multiple: true 58 | 59 | - name: Download msvc 60 | uses: actions/download-artifact@v4 61 | with: 62 | pattern: ${{ needs.msvc.outputs.name }}* 63 | path: ${{ env.artifact_path }} 64 | merge-multiple: true 65 | 66 | - name: Download macos 67 | uses: actions/download-artifact@v4 68 | with: 69 | pattern: ${{ needs.macos.outputs.name }}* 70 | path: ${{ env.artifact_path }} 71 | merge-multiple: true 72 | 73 | - name: Download android 74 | uses: actions/download-artifact@v4 75 | with: 76 | pattern: ${{ needs.android.outputs.name }}* 77 | path: ${{ env.artifact_path }} 78 | merge-multiple: true 79 | 80 | - name: Process configure file 81 | run: | 82 | git clone https://github.com/KangLin/RabbitCommon.git 83 | ./RabbitCommon/Install/MergeJsonFile.sh \ 84 | "${{ github.workspace }}/update.json" \ 85 | "${{ env.artifact_path }}" "${{ env.artifact_path }}/version.json" 86 | rm ${{ env.artifact_path }}/*.json 87 | 88 | - name: Make note file 89 | run: | 90 | echo "[:cn: 修改日志](https://github.com/KangLin/Calendar/blob/${{env.Calendar_VERSION}}/ChangeLog_zh_CN.md)" > ${{github.workspace}}/Note.md 91 | echo "[:us: Change log](https://github.com/KangLin/Calendar/blob/${{env.Calendar_VERSION}}/ChangeLog.md)" >> ${{github.workspace}}/Note.md 92 | echo "" >> ${{github.workspace}}/Note.md 93 | echo "File checksum:" >> ${{github.workspace}}/Note.md 94 | echo "|File|Checksum(md5)|" >> ${{github.workspace}}/Note.md 95 | echo "| :- | :- |" >> ${{github.workspace}}/Note.md 96 | cd ${{ env.artifact_path }} 97 | for file in * 98 | do 99 | echo "$file" 100 | if [ -f $file ]; then 101 | if [ "${file##*.}" != "xml" ] && [ "${file##*.}" != "json" ]; then 102 | md5sum $file > ${file}.md5sum 103 | awk '{print "|", $2, "|", $1, "|"}' ${file}.md5sum >> ${{github.workspace}}/Note.md 104 | fi 105 | else 106 | rm -fr $file 107 | fi 108 | done 109 | 110 | - name: Upload To Github Release 111 | if: ${{ startsWith(github.ref, 'refs/tags/') }} 112 | #continue-on-error: true 113 | run: | 114 | gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --notes-file ${{github.workspace}}/Note.md 115 | gh release upload ${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* ${{github.workspace}}/Note.md ${{github.workspace}}/update.json 116 | -------------------------------------------------------------------------------- /.github/workflows/codespell.yml: -------------------------------------------------------------------------------- 1 | name: Codespell 2 | 3 | on: 4 | push: 5 | pull_request: 6 | 7 | jobs: 8 | codespell: 9 | name: Check for spelling errors 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout Repository 13 | uses: actions/checkout@v3 14 | with: 15 | submodules: true 16 | 17 | - uses: codespell-project/actions-codespell@master 18 | with: 19 | check_filenames: true 20 | path: ${{github.workspace}} 21 | skip: "*.lua,codespell.yml" 22 | ignore_words_list: "doubleclick,msdos,rabits,eArch" 23 | -------------------------------------------------------------------------------- /.github/workflows/mingw.yml: -------------------------------------------------------------------------------- 1 | # Author: Kang Lin 2 | 3 | name: mingw 4 | 5 | on: 6 | workflow_call: 7 | outputs: 8 | name: 9 | description: "The artifact name" 10 | value: ${{ jobs.build_mingw.outputs.name }} 11 | 12 | jobs: 13 | build_mingw: 14 | 15 | strategy: 16 | matrix: 17 | BUILD_TYPE: [Release, Debug] 18 | 19 | defaults: 20 | run: 21 | shell: cmd 22 | 23 | # See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners) 24 | # See: [Choosing the runner for a job](https://docs.github.com/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job) 25 | # See: https://github.com/actions/runner-images/ 26 | runs-on: windows-latest 27 | 28 | env: 29 | BUILD_TYPE: ${{ matrix.BUILD_TYPE }} 30 | BUILD_DIR: ${{github.workspace}}/build 31 | SOURCE_DIR: ${{github.workspace}}\.cache\source 32 | TOOSL_DIR: ${{github.workspace}}\.cache\tools 33 | INSTALL_DIR: ${{github.workspace}}\.cache\install 34 | artifact_name: build_mingw 35 | 36 | # Map the job outputs to step outputs 37 | outputs: 38 | name: ${{ env.artifact_name }} 39 | 40 | steps: 41 | - name: Checkout Repository 42 | uses: actions/checkout@v3 43 | with: 44 | submodules: recursive 45 | 46 | - name: Make directories 47 | run: | 48 | cmake -E make_directory ${{env.SOURCE_DIR}} 49 | cmake -E make_directory ${{env.TOOSL_DIR}} 50 | cmake -E make_directory ${{env.INSTALL_DIR}} 51 | cmake -E make_directory ${{env.BUILD_DIR}} 52 | 53 | - name: Cache installed 54 | uses: actions/cache@v3 55 | id: cache-installed 56 | with: 57 | path: | 58 | ${{env.INSTALL_DIR}} 59 | key: install_mingw_${{matrix.BUILD_TYPE}} 60 | 61 | - name: pacman 62 | env: 63 | PATH: C:\msys64\usr\bin 64 | run: | 65 | C:\msys64\usr\bin\pacman.exe -Syu --noconfirm 66 | C:\msys64\usr\bin\pacman.exe -S --noconfirm ^ 67 | mingw-w64-x86_64-cmake ^ 68 | mingw-w64-x86_64-make ^ 69 | mingw-w64-x86_64-nsis ^ 70 | mingw-w64-x86_64-gcc ^ 71 | mingw-w64-x86_64-qt5 ^ 72 | mingw-w64-x86_64-zlib ^ 73 | mingw-w64-x86_64-openssl ^ 74 | mingw-w64-x86_64-cmark ^ 75 | git base-devel 76 | 77 | - name: git clone RabbitCommon 78 | working-directory: ${{env.SOURCE_DIR}} 79 | run: git clone https://github.com/KangLin/RabbitCommon.git 80 | 81 | - name: build LunarCalendar 82 | working-directory: ${{env.BUILD_DIR}} 83 | env: 84 | RabbitCommon_ROOT: ${{env.SOURCE_DIR}}/RabbitCommon 85 | #Qt5_Dir: C:\msys64\mingw64 86 | MSYSTEM: MINGW64 87 | PATH: C:\msys64\mingw64\bin;C:\msys64\usr\bin 88 | run: | 89 | cmake .. -G"MinGW Makefiles" ^ 90 | -DCMARK_SHARED=OFF ^ 91 | -DCMARK_TESTS=OFF ^ 92 | -DCMARK_STATIC=ON ^ 93 | -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} ^ 94 | -DCMAKE_INSTALL_PREFIX=install 95 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.dsc 2 | *.change 3 | *.buildinfo 4 | *.changes 5 | *.xz 6 | obj-x86_64-linux-gnu/ 7 | debian/ 8 | *.user.* 9 | .qmake.stash 10 | Translations.qrc 11 | Plugin/PluginStatic.cpp 12 | Plugin/PluginStatic.pri 13 | Plugin/build-*/ 14 | Makefile.Debug 15 | Makefile.Release 16 | Version.h 17 | Update/Update_*.xml 18 | build*/ 19 | *.bak 20 | *~ 21 | *.autosave 22 | *.qm 23 | *.user 24 | test.xml 25 | .CCodec.h.kate-swp 26 | .kdev4/ 27 | .kdev_include_paths 28 | .vs/ 29 | CMakeSettings.json 30 | build-*/ 31 | build/ 32 | build_android/ 33 | build_unix_mingw/ 34 | build_windows_mingw/ 35 | build_unix/ 36 | build_windows_msvc/ 37 | RabbitIm/ 38 | *.ncb 39 | .metadata/ 40 | *~ 41 | debug/ 42 | bin/ 43 | *.class 44 | .deps/ 45 | Makefile.in 46 | aclocal.m4 47 | config.guess 48 | config.h 49 | config.h.in 50 | config.h.in~ 51 | config.log 52 | config.status 53 | config.sub 54 | configure 55 | depcomp 56 | install-sh 57 | libtool 58 | ltmain.sh 59 | missing 60 | reachmonitor 61 | stamp-h1 62 | .deps/ 63 | Makefile.in 64 | aclocal.m4 65 | config.guess 66 | config.h 67 | config.h.in 68 | config.h.in~ 69 | config.log 70 | config.status 71 | config.sub 72 | configure 73 | depcomp 74 | install-sh 75 | libtool 76 | ltmain.sh 77 | missing 78 | stamp-h1 79 | *.bak 80 | *.bs 81 | *.la 82 | *.lo 83 | *.ft 84 | *.ft.1 85 | *.made 86 | *.o 87 | *.obj 88 | *.old 89 | *.orig 90 | *.out 91 | *.pdb 92 | *.rej 93 | .libs/ 94 | Makefile 95 | *.cdf 96 | *.cache 97 | *.obj 98 | *.ilk 99 | *.resources 100 | *.tlb 101 | *.tli 102 | *.tlh 103 | *.tmp 104 | *.rsp 105 | *.pgc 106 | *.pgd 107 | *.meta 108 | *.tlog 109 | *.manifest 110 | *.res 111 | *.pch 112 | *.exp 113 | *.idb 114 | *.rep 115 | *.xdc 116 | *.pdb 117 | *_manifest.rc 118 | *.bsc 119 | *.sbr 120 | *.opensdf 121 | *.sdf 122 | *.suo 123 | Debug/ 124 | release/ 125 | Release/ 126 | ipch/ 127 | IncludeLocalDatabase.txt 128 | ThirdLibrary/unix_mingw/ 129 | ThirdLibrary/unix/ 130 | ThirdLibrary/unix_static/ 131 | ThirdLibrary/android/ 132 | ThirdLibrary/android_static/ 133 | ThirdLibrary/windows_msvc/ 134 | ThirdLibrary/windows_mingw/ 135 | ThirdLibrary/src/ 136 | ThirdLibrary/windows_mingw_static/ 137 | ThirdLibrary/windows_msvc_static/ 138 | rabbitim.kdev4 139 | *.pro.user.* 140 | Doxygen/ 141 | Doxyfile 142 | android/local.properties 143 | android/gradlew.* 144 | android/gradle.properties 145 | *.iml 146 | 147 | # Compiled Object files 148 | *.slo 149 | *.lo 150 | *.o 151 | *.obj 152 | 153 | # Precompiled Headers 154 | *.gch 155 | *.pch 156 | 157 | # Compiled Dynamic libraries 158 | *.so 159 | *.dylib 160 | *.dll 161 | 162 | # Fortran module files 163 | *.mod 164 | 165 | # Compiled Static libraries 166 | *.lai 167 | *.la 168 | *.a 169 | *.lib 170 | 171 | # Executables 172 | *.exe 173 | *.out 174 | *.app 175 | 176 | # Platform Specifics - auto generated files 177 | PlatformSpecifics/Windows/*.rc 178 | 179 | # Visual studio - project files 180 | *.sln 181 | *.suo 182 | *.vcxproj 183 | *.vcxproj.filters 184 | *.vcxproj.user 185 | 186 | # Visual Studio - Build Results 187 | [Dd]ebug/ 188 | [Rr]elease/ 189 | [Mm]in[Ss]ize[Rr]el/ 190 | [Rr]el[Ww]ith[Dd]eb[Ii]nfo/ 191 | 192 | # Visual Studio - Browsing Database File 193 | *.sdf 194 | *.opensdf 195 | 196 | #osx xcode 197 | DerivedData/ 198 | *.DS_Store 199 | *.build 200 | *.xcodeproj 201 | 202 | #CPACK related files 203 | CPackConfig-*.cmake 204 | _CPack_Packages/ 205 | 206 | #packages 207 | *.tar.gz 208 | *.zip 209 | 210 | android/.gradle/ 211 | android/.idea/ 212 | android/android.iml 213 | android/gradle/ 214 | android/gradlew 215 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "3th_libs/LunarCalendar"] 2 | path = 3th_libs/LunarCalendar 3 | url = https://github.com/KangLin/LunarCalendar.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: xenial 3 | language: cpp 4 | cache: 5 | - apt 6 | - directories: 7 | - Package 8 | 9 | #compiler: 10 | # - g++ 11 | 12 | #os: 13 | # - unix 14 | 15 | #addons: 16 | # ssh_known_hosts: 17 | # - github.com 18 | # - frs.sourceforge.net 19 | 20 | env: 21 | global: 22 | - SOURCE_DIR=$TRAVIS_BUILD_DIR 23 | - RABBITIM_USE_REPOSITORIES="TRUE" 24 | - QMAKE=qmake 25 | 26 | matrix: 27 | # DOWNLOAD_QT: 28 | # APT: Use apt to install from ubuntu source; 29 | # TRUE: download from download.qt.io 30 | # FALSE: install from https://launchpad.net/~beineri 31 | - BUILD_TARGERT="unix" DOWNLOAD_QT=APT 32 | - BUILD_TARGERT="unix" DOWNLOAD_QT=APT GENERATORS="Unix Makefiles" 33 | 34 | - BUILD_TARGERT="unix" QT_VERSION_DIR=512 QT_VERSION=5.12.3 DOWNLOAD_QT=FALSE 35 | - BUILD_TARGERT="unix" QT_VERSION_DIR=511 QT_VERSION=5.11.3 DOWNLOAD_QT=FALSE GENERATORS="Unix Makefiles" STATIC=ON 36 | 37 | - BUILD_TARGERT="unix" BUILD_ARCH="unix" QT_VERSION_DIR=5.14 QT_VERSION=5.14.0 DOWNLOAD_QT=TRUE 38 | - BUILD_TARGERT="unix" BUILD_ARCH="unix" QT_VERSION_DIR=5.14 QT_VERSION=5.14.0 DOWNLOAD_QT=TRUE GENERATORS="Unix Makefiles" 39 | - BUILD_TARGERT="unix" BUILD_ARCH="unix" QT_VERSION_DIR=5.12 QT_VERSION=5.12.6 DOWNLOAD_QT=TRUE GENERATORS="Unix Makefiles" 40 | 41 | # BUILD_ARCH qt 大于等于 5.14.0 可选(arm64-v8a armeabi-v7a x86_64 x86)组合 42 | #- BUILD_TARGERT="android" BUILD_ARCH="armeabi-v7a x86" ANDROID_ARM_NEON=ON QT_VERSION_DIR=5.14 QT_VERSION=5.14.0 ANDROID_API=android-24 DOWNLOAD_QT=TRUE 43 | - BUILD_TARGERT="android" BUILD_ARCH="armeabi-v7a" ANDROID_ARM_NEON=ON QT_VERSION_DIR=5.12 QT_VERSION=5.12.6 ANDROID_API=android-24 DOWNLOAD_QT=TRUE GENERATORS="Unix Makefiles" DOWNLOAD_THIRDLIBS_URL=https://github.com/KangLin/RabbitThirdLibrary/releases/download/v0.2.6/android_arm_v0.2.6_in_linux.tar.gz 44 | - BUILD_TARGERT="android" BUILD_ARCH="arm64-v8a" ANDROID_ARM_NEON=ON QT_VERSION_DIR=5.12 QT_VERSION=5.12.6 ANDROID_API=android-24 DOWNLOAD_QT=TRUE DOWNLOAD_THIRDLIBS_URL=https://github.com/KangLin/RabbitThirdLibrary/releases/download/v0.2.6/android_arm64_v0.2.6_in_linux.tar.gz 45 | - BUILD_TARGERT="android" BUILD_ARCH="x86" QT_VERSION_DIR=5.12 QT_VERSION=5.12.6 ANDROID_API=android-24 DOWNLOAD_QT=TRUE GENERATORS="Unix Makefiles" DOWNLOAD_THIRDLIBS_URL=https://github.com/KangLin/RabbitThirdLibrary/releases/download/v0.2.6/android_x86_v0.2.6_in_linux.tar.gz 46 | 47 | before_install: 48 | - echo "TRAVIS_OS_NAME=${TRAVIS_OS_NAME}" 49 | - sudo apt-get install -y -qq xvfb xpra 50 | - sudo Xvfb :99 -ac & 51 | - export DISPLAY=:99.0 52 | - mkdir -p ${SOURCE_DIR}/Tools 53 | - export VERSION="v1.0.22" 54 | 55 | install: 56 | - cd ${SOURCE_DIR} 57 | - git submodule update --init --recursive 58 | - git clone https://github.com/KangLin/RabbitCommon.git 59 | - export RabbitCommon_ROOT="`pwd`/RabbitCommon" 60 | - bash ci/build-install-tools.sh > /dev/null 61 | # - | 62 | # if [ "$BUILD_TARGERT"="unix" -a -z "$RABBIT_ARCH" ]; then 63 | # source /opt/qt511/bin/qt511-env.sh 64 | # fi 65 | 66 | before_script: 67 | - cd ${SOURCE_DIR} 68 | 69 | script: 70 | - bash ${SOURCE_DIR}/ci/build.sh ${SOURCE_DIR} 71 | 72 | notifications: 73 | email: kl222@126.com 74 | on_success: never # [always|never|change] 75 | on_failure: always 76 | 77 | #deploy: 78 | # - provider: releases 79 | # api_key: 80 | # secure: ALZWWdQlmi0gJ5Gs9gjX4waV4JYvZAFogN6oUCJayWYkCvME/z1QSxMERuZhRM0F4K2Kt8LWK2ozp18OEtonNQJ81ZELbZRYMQwl4C3Cmfhnywyn4UgiU3CLEQ3Dn25iLqHy7QhaS6BWyISxVQxrsEhFkc0tLDODwk45tibiniIpTtBtTB9Tx85p8FEfdOHUCNxhVtW9zF0LjdWxD569HEzpKDi8c4naNCDVvbBA9r2voQqt3NkNsCNz10vxyV+xO8uJIs1/K5Mj6Gnd+UaUtSDnVTUKCZatcge5OGpu9TcYbH5yLuhlTifVtYmhmK3YeAmte6uNlD6WYIdpSTMJLQ8Lgc2WE+2mj0G16afWtY9ajTqVUlJEa1R078gCnFG4YeYjUYIZhFq/u0U16Ga95RvHAZlQNVcyDLb/Mwt6QyJJdWRNHzsm1sY6mwhXKRwAMGvPl9RTWl6JJdFT5wcPYIzPL9+Y6k6ZhkdI6kWEzA7HYUbA1mLiF6Q8h+ezKnb10KiPEAFU4NNUmf3RKMwolRSTN/TkiZCRIVsPKnkLgS5LzTf6s0rGBZ2g5vWo1fDsigDPBJRE27742pPDXXMt82CySThq3lKJFwQsGObLg1z2H8XbvDkImVIVOK98oW2a/7aXX28/0LjWE2tdV83p1ho5DvyTlGZio+fqk0qmfsw= 81 | # file: "$TRAVIS_BUILD_DIR/../calendar_${VERSION}_amd64.deb " 82 | # skip_cleanup: true 83 | # on: 84 | # tags: true 85 | # condition: "$BUILD_TARGERT=unix && $QT_VERSION_DIR=512 && $DOWNLOAD_QT=FALSE" 86 | -------------------------------------------------------------------------------- /App/AppIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/App/AppIcon.ico -------------------------------------------------------------------------------- /App/AppIcon.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "AppIcon.ico" 2 | -------------------------------------------------------------------------------- /App/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(CalendarApp LANGUAGES CXX) 2 | 3 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 4 | set(CMAKE_CXX_STANDARD 11) 5 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 6 | set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "verbose") 7 | 8 | set(HEAD_FILES 9 | MainWindow.h 10 | DlgOption.h) 11 | set(SOURCE_FILES 12 | main.cpp 13 | MainWindow.cpp 14 | DlgOption.cpp) 15 | set(SOURCE_UI_FILES 16 | MainWindow.ui 17 | DlgOption.ui) 18 | if(WIN32) 19 | set(RCC_FILES AppIcon.rc) 20 | endif() 21 | LIST(APPEND PRIVATE_DEFINITIONS 22 | Calendar_REVISION="${Calendar_REVISION}" 23 | Calendar_VERSION="${Calendar_VERSION}" 24 | BUILD_ARCH="${BUILD_ARCH}" 25 | BUILD_PLATFORM="${BUILD_PLATFORM}") 26 | ADD_TARGET(NAME ${PROJECT_NAME} 27 | ISEXE 28 | ISWINDOWS 29 | SOURCE_FILES ${SOURCE_FILES} ${HEAD_FILES} ${SOURCE_UI_FILES} ${RCC_FILES} 30 | PRIVATE_DEFINITIONS RABBITCOMMON ${PRIVATE_DEFINITIONS} 31 | PRIVATE_LIBS RabbitCommon LunarCalendar Tasks ${QT_LIBRARIES} 32 | VERSION ${Calendar_VERSION}) 33 | 34 | if(NOT ANDROID AND (UNIX OR IOS)) 35 | configure_file(${CMAKE_SOURCE_DIR}/share/applications/org.Rabbit.Calendar.desktop.in 36 | ${CMAKE_BINARY_DIR}/org.Rabbit.Calendar.desktop) 37 | INSTALL(FILES ${CMAKE_BINARY_DIR}/org.Rabbit.Calendar.desktop 38 | DESTINATION "share/applications" 39 | COMPONENT Application) 40 | INSTALL(FILES ${CMAKE_SOURCE_DIR}/Src/Resource/image/Calendar.png 41 | DESTINATION "share/pixmaps" 42 | COMPONENT Application) 43 | INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/share/Calendar.sh 44 | DESTINATION ${CMAKE_INSTALL_BINDIR} 45 | COMPONENT Application) 46 | endif() 47 | 48 | if(NOT EXISTS ${CMAKE_BINARY_DIR}/etc/Calendar_logqt.ini) 49 | configure_file(${CMAKE_SOURCE_DIR}/etc/Calendar_logqt.ini 50 | ${CMAKE_BINARY_DIR}/etc/Calendar_logqt.ini 51 | COPYONLY) 52 | endif() 53 | INSTALL(FILES ${CMAKE_SOURCE_DIR}/etc/Calendar_logqt.ini 54 | DESTINATION etc COMPONENT Application) 55 | 56 | set(OTHER_FILES 57 | ${CMAKE_SOURCE_DIR}/License.md 58 | ${CMAKE_SOURCE_DIR}/Authors.md 59 | ${CMAKE_SOURCE_DIR}/ChangeLog.md 60 | ${CMAKE_SOURCE_DIR}/Authors_zh_CN.md 61 | ${CMAKE_SOURCE_DIR}/ChangeLog_zh_CN.md) 62 | 63 | # Install other files 64 | INSTALL_FILE(SOURCES ${OTHER_FILES} 65 | DESTINATION ${CMAKE_INSTALL_DOCDIR} 66 | COMPONENT Application) 67 | 68 | if(WIN32) 69 | # 替换 Install.nsi 中的 CMAKE_INSTALL_PREFIX 等 70 | configure_file(${CMAKE_SOURCE_DIR}/Install/Install.nsi 71 | ${CMAKE_BINARY_DIR}/Install.nsi @ONLY) 72 | INSTALL(FILES AppIcon.ico DESTINATION "." COMPONENT Application) 73 | endif() 74 | -------------------------------------------------------------------------------- /App/DlgOption.cpp: -------------------------------------------------------------------------------- 1 | #include "DlgOption.h" 2 | #include "ui_DlgOption.h" 3 | #include "Global/TasksTools.h" 4 | #include "RabbitCommonDir.h" 5 | #include "RabbitCommonTools.h" 6 | #include 7 | #include "LunarCalendar.h" 8 | #include 9 | 10 | static Q_LOGGING_CATEGORY(log, "Rabbit.LunarCalendar.Option") 11 | 12 | CDlgOption::CDlgOption(QWidget *parent) : 13 | QDialog(parent), 14 | ui(new Ui::CDlgOption) 15 | { 16 | ui->setupUi(this); 17 | 18 | ui->cbRunFromBoot->setChecked(RabbitCommon::CTools::IsStartRun()); 19 | QSettings set(RabbitCommon::CDir::Instance()->GetFileUserConfigure(), 20 | QSettings::IniFormat); 21 | bool bShow = set.value("Options/MainWindow/Show", false).toBool(); 22 | ui->cbShowMainWindows->setChecked(bShow); 23 | int nType = set.value("Options/Calendar/Type", 0).toInt(); 24 | if(0 == nType) 25 | ui->cbAutomation->setChecked(true); 26 | if(static_cast(CLunarCalendar::_CalendarType::CalendarTypeSolar) & nType) 27 | ui->cbSolar->setChecked(true); 28 | if(static_cast(CLunarCalendar::_CalendarType::CalendarTypeLunar) & nType) 29 | ui->cbLunar->setChecked(true); 30 | } 31 | 32 | CDlgOption::~CDlgOption() 33 | { 34 | delete ui; 35 | } 36 | 37 | void CDlgOption::on_buttonBox_accepted() 38 | { 39 | if(ui->cbRunFromBoot->checkState() == Qt::Checked) 40 | RabbitCommon::CTools::InstallStartRun(); 41 | else 42 | RabbitCommon::CTools::RemoveStartRun(); 43 | 44 | QSettings set(RabbitCommon::CDir::Instance()->GetFileUserConfigure(), 45 | QSettings::IniFormat); 46 | set.setValue("Options/MainWindow/Show", ui->cbShowMainWindows->isChecked()); 47 | if(ui->cbAutomation->isChecked()) 48 | set.setValue("Options/Calendar/Type", 0); 49 | else { 50 | int nType = 0; 51 | nType = set.value("Options/Calendar/Type", 0).toInt(); 52 | if(ui->cbSolar->isChecked()) 53 | { 54 | nType |= static_cast(CLunarCalendar::_CalendarType::CalendarTypeSolar); 55 | } else { 56 | nType &= ~static_cast(CLunarCalendar::_CalendarType::CalendarTypeSolar); 57 | } 58 | if(ui->cbLunar->isChecked()) { 59 | nType |= static_cast(CLunarCalendar::_CalendarType::CalendarTypeLunar); 60 | } else { 61 | nType &= ~static_cast(CLunarCalendar::_CalendarType::CalendarTypeLunar); 62 | } 63 | set.setValue("Options/Calendar/Type", nType); 64 | } 65 | } 66 | 67 | void CDlgOption::on_cbAutomation_toggled(bool checked) 68 | { 69 | qDebug(log) << "on_cbAutomation_clicked"; 70 | if(checked) { 71 | ui->cbLunar->setEnabled(false); 72 | ui->cbSolar->setEnabled(false); 73 | } else { 74 | ui->cbLunar->setEnabled(true); 75 | ui->cbSolar->setEnabled(true); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /App/DlgOption.h: -------------------------------------------------------------------------------- 1 | #ifndef DLGOPTION_H 2 | #define DLGOPTION_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class CDlgOption; 8 | } 9 | 10 | class CDlgOption : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit CDlgOption(QWidget *parent = nullptr); 16 | ~CDlgOption(); 17 | 18 | private slots: 19 | void on_buttonBox_accepted(); 20 | void on_cbAutomation_toggled(bool checked); 21 | 22 | private: 23 | Ui::CDlgOption *ui; 24 | }; 25 | 26 | #endif // DLGOPTION_H 27 | -------------------------------------------------------------------------------- /App/FrmEyeNurse.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMEYENURSE_H 2 | #define FRMEYENURSE_H 3 | 4 | #pragma once 5 | 6 | #include 7 | #include "TasksList.h" 8 | #include "FrmTasks.h" 9 | #include 10 | #include 11 | 12 | namespace Ui { 13 | class CFrmEyeNurse; 14 | } 15 | 16 | class CFrmEyeNurse : public QWidget 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit CFrmEyeNurse(QWidget *parent = nullptr); 22 | ~CFrmEyeNurse(); 23 | 24 | private Q_SLOTS: 25 | void slotExit(bool checked); 26 | void slotShow(bool checked); 27 | void slotAbout(bool checked); 28 | void slotStartRun(bool checked); 29 | 30 | void slotActivated(QSystemTrayIcon::ActivationReason reason); 31 | void slotChanged(); 32 | 33 | protected: 34 | virtual void closeEvent(QCloseEvent *event); 35 | 36 | private: 37 | Ui::CFrmEyeNurse *ui; 38 | 39 | QMenu m_TrayIconMenu; 40 | QSystemTrayIcon m_TrayIcon; 41 | QAction* m_pShow; 42 | QAction* m_pStartRun; 43 | 44 | CTasksList m_TasksList; 45 | int VisionProtectionTasks(); 46 | 47 | CFrmTasks m_frmTasks; 48 | }; 49 | 50 | #endif // FRMEYENURSE_H 51 | -------------------------------------------------------------------------------- /App/FrmEyeNurse.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CFrmEyeNurse 4 | 5 | 6 | 7 | 0 8 | 0 9 | 275 10 | 230 11 | 12 | 13 | 14 | Eye nurse 15 | 16 | 17 | 18 | :/icon/EyeNurse:/icon/EyeNurse 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /App/MainWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "TasksList.h" 12 | #include "FrmTasksList.h" 13 | #include "FrmStickyList.h" 14 | #include "FrmCalendar.h" 15 | 16 | namespace Ui { 17 | class CMainWindow; 18 | } 19 | 20 | class CMainWindow : public QMainWindow 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | explicit CMainWindow(QWidget *parent = nullptr); 26 | virtual ~CMainWindow() override; 27 | 28 | private Q_SLOTS: 29 | void slotExit(); 30 | void slotShow(); 31 | void slotAbout(); 32 | void slotStartRun(bool checked); 33 | 34 | void slotActivated(QSystemTrayIcon::ActivationReason reason); 35 | void on_actionExit_E_triggered(); 36 | void on_actionAbout_A_triggered(); 37 | 38 | void on_actionOption_O_triggered(); 39 | void on_actionUpdate_U_triggered(); 40 | 41 | void on_actionSticky_list_L_triggered(); 42 | void on_actionTasks_list_A_triggered(); 43 | 44 | protected: 45 | virtual void closeEvent(QCloseEvent *e) override; 46 | bool eventFilter(QObject *watched, QEvent *event) override; 47 | bool eventResizeTable(QTabWidget *pTabWidget, QResizeEvent *event); 48 | bool eventResizeScrollArea(QScrollArea *pScrollArea, QResizeEvent* event); 49 | 50 | private: 51 | int LoadStyle(); 52 | int LoadStyle(const QString &szFile); 53 | 54 | private: 55 | Ui::CMainWindow *ui; 56 | QMenu m_TrayIconMenu; 57 | QSystemTrayIcon m_TrayIcon; 58 | QAction* m_pShow; 59 | QAction* m_pStartRun; 60 | 61 | QTabWidget m_Table; 62 | CFrmTasksList m_FrmTasksList; 63 | CFrmStickyList m_frmStickyList; 64 | CFrmCalendar m_frmCalendar; 65 | 66 | protected: 67 | virtual void hideEvent(QHideEvent *event) override; 68 | }; 69 | 70 | #endif // MAINWINDOW_H 71 | -------------------------------------------------------------------------------- /App/MainWindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CMainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 500 10 | 400 11 | 12 | 13 | 14 | Calendar 15 | 16 | 17 | 18 | .. 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 0 27 | 0 28 | 500 29 | 27 30 | 31 | 32 | 33 | 34 | Help(&H) 35 | 36 | 37 | 38 | 39 | 40 | 41 | Tools(&T) 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | .. 55 | 56 | 57 | About(&A) 58 | 59 | 60 | About 61 | 62 | 63 | About 64 | 65 | 66 | About 67 | 68 | 69 | 70 | 71 | 72 | .. 73 | 74 | 75 | Exit(&E) 76 | 77 | 78 | 79 | 80 | 81 | .. 82 | 83 | 84 | Option(&O) 85 | 86 | 87 | Option 88 | 89 | 90 | Option 91 | 92 | 93 | Option 94 | 95 | 96 | 97 | 98 | 99 | .. 100 | 101 | 102 | Update(&U) 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /App/android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 | 29 | 30 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /App/android/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/App/android/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /App/android/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/App/android/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /App/android/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/App/android/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /App/android/res/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/App/android/res/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /App/android/res/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/App/android/res/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /App/android/res/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/App/android/res/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /App/android/res/values-zh/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 日历 5 | 6 | 7 | -------------------------------------------------------------------------------- /App/android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Calendar 5 | 6 | 7 | -------------------------------------------------------------------------------- /App/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #if defined(Q_OS_ANDROID) \ 8 | && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) \ 9 | && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 10 | #include 11 | #endif 12 | 13 | #include "MainWindow.h" 14 | #include "FrmStickyNotes.h" 15 | #include "FrmStickyList.h" 16 | #include "Global/TasksTools.h" 17 | #include "RabbitCommonDir.h" 18 | #include "RabbitCommonTools.h" 19 | #include "FrmUpdater.h" 20 | #include "LunarCalendar.h" 21 | 22 | static Q_LOGGING_CATEGORY(log, "Rabbit.LunarCalendar") 23 | 24 | int main(int argc, char *argv[]) 25 | { 26 | #if (QT_VERSION > QT_VERSION_CHECK(5,6,0)) 27 | QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 28 | #endif 29 | #if defined(Q_OS_ANDROID) \ 30 | && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) \ 31 | && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 32 | QtAndroid::hideSplashScreen(); 33 | #endif 34 | 35 | QApplication a(argc, argv); 36 | a.setApplicationVersion(Calendar_VERSION); 37 | a.setApplicationName("Calendar"); 38 | 39 | RabbitCommon::CTools::Instance()->Init(); 40 | 41 | QStringList permissions("android.permission.VIBRATE"); 42 | permissions << "android.permission.ACCESS_FINE_LOCATION" 43 | << "android.permission.BLUETOOTH"; 44 | RabbitCommon::CTools::Instance()->AndroidRequestPermission(permissions); 45 | 46 | RabbitCommon::CTools::Instance()->InstallTranslator("CalendarApp"); 47 | 48 | CTasksTools::Instance()->InitResource(); 49 | 50 | a.setApplicationDisplayName(QObject::tr("Calendar")); 51 | 52 | qInfo(log) << QObject::tr("Calendar version: ") + Calendar_VERSION 53 | #ifdef Calendar_REVISION 54 | + " (Revision: [" + Calendar_REVISION 55 | + "](https://github.com/KangLin/" 56 | + a.applicationName() +"/tree/" 57 | + Calendar_REVISION + "))" 58 | #endif 59 | + "; " + QObject::tr("LunarCalendar: ") + CLunarCalendar::Version() 60 | + "; " + QObject::tr("Rabbit Common: ") + RabbitCommon::CTools::Version(); 61 | ; 62 | 63 | CFrmUpdater *pUpdate = new CFrmUpdater(); 64 | QIcon icon = QIcon::fromTheme("calendar"); 65 | if(!icon.isNull()) { 66 | auto sizeList = icon.availableSizes(); 67 | if(!sizeList.isEmpty()) { 68 | QPixmap p = icon.pixmap(*sizeList.begin()); 69 | pUpdate->SetTitle(p.toImage()); 70 | } 71 | } 72 | pUpdate->SetInstallAutoStartup(); 73 | if(a.arguments().length() > 1) { 74 | pUpdate->GenerateUpdateJson(); 75 | pUpdate->GenerateUpdateXml(); 76 | return 0; 77 | } 78 | 79 | CMainWindow win; 80 | #if defined(Q_OS_ANDROID) 81 | win.showMaximized(); 82 | #else 83 | QSettings set(RabbitCommon::CDir::Instance()->GetFileUserConfigure(), 84 | QSettings::IniFormat); 85 | bool bShow = set.value("Options/MainWindow/Show", false).toBool(); 86 | if(bShow) 87 | win.show(); 88 | #endif 89 | 90 | int nRet = a.exec(); 91 | 92 | RabbitCommon::CTools::Instance()->Clean(); 93 | 94 | CTasksTools::Instance()->CleanResource(); 95 | return nRet; 96 | } 97 | -------------------------------------------------------------------------------- /Authors.md: -------------------------------------------------------------------------------- 1 | Authors: 2 | KangLin(kl222@126.com) 3 | 4 | The third project: 5 | 6 | LunarCalendar 7 | https://github.com/KangLin/LunarCalendar 8 | 9 | Qt (LGPL v2.1) 10 | http://qt.io/ 11 | -------------------------------------------------------------------------------- /Authors_zh_CN.md: -------------------------------------------------------------------------------- 1 | 作者: 2 | 康林(kl222@126.com) 3 | 4 | 第三方库: 5 | 6 | 日历 7 | https://github.com/KangLin/LunarCalendar 8 | 9 | Qt (LGPL v2.1) 10 | http://qt.io/ 11 | -------------------------------------------------------------------------------- /Install/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Use to install appimage in linux 4 | # $1: install or remove 5 | # $2: run 6 | 7 | case "$1" in 8 | remove) 9 | echo "remove ..." 10 | rm -f /usr/share/applications/org.Rabbit.Calendar.desktop 11 | rm -f ~/.config/autostart/org.Rabbit.Calendar.desktop 12 | rm -f /usr/share/pixmaps/Calendar.png 13 | ;; 14 | 15 | install|*) 16 | echo "install ..." 17 | # Install desktop 18 | if [ -f /usr/share/applications/org.Rabbit.Calendar.desktop ]; then 19 | rm /usr/share/applications/org.Rabbit.Calendar.desktop 20 | fi 21 | ln -s `pwd`/share/applications/org.Rabbit.Calendar.desktop /usr/share/applications/org.Rabbit.Calendar.desktop 22 | 23 | # Install auto run on boot 24 | if [ ! -d ~/.config/autostart ]; then 25 | mkdir -p ~/.config/autostart 26 | chmod a+wr ~/.config/autostart 27 | fi 28 | if [ -f ~/.config/autostart/org.Rabbit.Calendar.desktop ]; then 29 | rm ~/.config/autostart/org.Rabbit.Calendar.desktop 30 | fi 31 | ln -s `pwd`/share/applications/org.Rabbit.Calendar.desktop ~/.config/autostart/org.Rabbit.Calendar.desktop 32 | 33 | # Reset exec to desktop 34 | sed -i "s/Exec=.*//g" `pwd`/share/applications/org.Rabbit.Calendar.desktop 35 | echo "Exec=`pwd`/Calendar-x86_64.AppImage" >> `pwd`/share/applications/org.Rabbit.Calendar.desktop 36 | 37 | # Install applications icon 38 | if [ -f /usr/share/pixmaps/Calendar.png ]; then 39 | rm /usr/share/pixmaps/Calendar.png 40 | fi 41 | if [ ! -d /usr/share/pixmaps ]; then 42 | mkdir -p /usr/share/pixmaps 43 | fi 44 | ln -s `pwd`/share/pixmaps/Calendar.png /usr/share/pixmaps/Calendar.png 45 | 46 | # Whether run after install 47 | if [ "$2" = "run" ]; then 48 | ./Calendar-x86_64.AppImage 49 | fi 50 | ;; 51 | esac 52 | -------------------------------------------------------------------------------- /Resource/Image/English.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/English.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/AndroidCalendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/AndroidCalendar.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/AndroidCalendar_zh_CN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/AndroidCalendar_zh_CN.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/AndroidStricky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/AndroidStricky.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/AndroidStrickyList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/AndroidStrickyList.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/AndroidStrickyList_zh_CN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/AndroidStrickyList_zh_CN.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/AndroidStricky_zh_CN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/AndroidStricky_zh_CN.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/AndroidTask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/AndroidTask.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/AndroidTask_zh_CN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/AndroidTask_zh_CN.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/Calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/Calendar.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/Calendar_zh_CN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/Calendar_zh_CN.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/Sticky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/Sticky.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/Sticky_zh_CN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/Sticky_zh_CN.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/Task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/Task.png -------------------------------------------------------------------------------- /Resource/Image/ScreenShot/Task_zh_CN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/ScreenShot/Task_zh_CN.png -------------------------------------------------------------------------------- /Resource/Image/china.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Resource/Image/china.png -------------------------------------------------------------------------------- /Script/build_appimage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Kang Lin 3 | 4 | # See: - https://docs.appimage.org/packaging-guide/from-source/native-binaries.html#examples 5 | # - https://luyuhuang.tech/2024/04/19/appimage.html 6 | 7 | #See: https://blog.csdn.net/alwaysbefine/article/details/114187380 8 | #set -x 9 | set -e 10 | #set -v 11 | 12 | ## building in temporary directory to keep system clean 13 | ## use RAM disk if possible (as in: not building on CI system like Travis, and RAM disk is available) 14 | #if [ "$CI" == "" ] && [ -d /dev/shm ]; then 15 | # TEMP_BASE=/dev/shm 16 | #else 17 | # TEMP_BASE=/tmp 18 | #fi 19 | #BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" Calendar-appimage-build-XXXXXX) 20 | ## make sure to clean up build dir, even if errors occur 21 | 22 | # store repo root as variable 23 | REPO_ROOT=$(readlink -f $(dirname $(dirname $(readlink -f $0)))) 24 | OLD_CWD=$(readlink -f .) 25 | 26 | pushd "$REPO_ROOT" 27 | 28 | if [ -z "$BUILD_DIR" ]; then 29 | BUILD_DIR=build_appimage 30 | fi 31 | BUILD_DIR=$(readlink -f ${BUILD_DIR}) 32 | mkdir -p $BUILD_DIR 33 | pushd "$BUILD_DIR" 34 | 35 | if [ -z "$TOOLS_DIR" ]; then 36 | TOOLS_DIR=Tools 37 | fi 38 | if [ -z "$SOURCE_DIR" ]; then 39 | SOURCE_DIR=Source 40 | fi 41 | if [ -z "$INSTALL_DIR" ]; then 42 | INSTALL_DIR=Install 43 | fi 44 | 45 | TOOLS_DIR=$(readlink -f ${TOOLS_DIR}) 46 | mkdir -p $TOOLS_DIR 47 | SOURCE_DIR=$(readlink -f ${SOURCE_DIR}) 48 | mkdir -p $SOURCE_DIR 49 | INSTALL_DIR=$(readlink -f ${INSTALL_DIR}) 50 | mkdir -p $INSTALL_DIR 51 | 52 | echo "Repo folder: $REPO_ROOT" 53 | echo "Old folder: $OLD_CWD" 54 | echo "Current folder: `pwd`" 55 | echo "BUILD_DIR: $BUILD_DIR" 56 | echo "TOOLS_DIR: $TOOLS_DIR" 57 | echo "SOURCE_DIR: $SOURCE_DIR" 58 | echo "INSTALL_DIR: $INSTALL_DIR" 59 | 60 | cleanup () { 61 | if [ -d "${BUILD_DIR}" ]; then 62 | rm -rf "${BUILD_DIR}" 63 | fi 64 | } 65 | if [ "$CI" != "" ]; then 66 | trap cleanup EXIT 67 | fi 68 | 69 | pushd "${TOOLS_DIR}" 70 | if [ ! -f linuxdeploy-`uname -m`.AppImage ]; then 71 | wget https://github.com/linuxdeploy/linuxdeploy/releases/download/2.0.0-alpha-1-20241106/linuxdeploy-`uname -m`.AppImage 72 | chmod u+x linuxdeploy-`uname -m`.AppImage 73 | fi 74 | if [ ! -f linuxdeploy-plugin-qt-`uname -m`.AppImage ]; then 75 | wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/2.0.0-alpha-1-20241106/linuxdeploy-plugin-qt-`uname -m`.AppImage 76 | chmod u+x linuxdeploy-plugin-qt-`uname -m`.AppImage 77 | fi 78 | popd 79 | 80 | INSTALL_APP_DIR=AppDir/usr 81 | cmake "$REPO_ROOT" \ 82 | -DCMAKE_INSTALL_PREFIX=/usr \ 83 | -DCMARK_SHARED=OFF \ 84 | -DCMARK_TESTS=OFF \ 85 | -DCMARK_STATIC=ON \ 86 | -DQT_DEBUG_FIND_PACKAGE=ON \ 87 | -DCMAKE_BUILD_TYPE=Release 88 | cmake --build . --parallel $(nproc) 89 | cmake --install . --config Release --component DependLibraries --prefix ${INSTALL_APP_DIR} 90 | cmake --install . --config Release --component Runtime --prefix ${INSTALL_APP_DIR} 91 | cmake --install . --config Release --component Application --prefix ${INSTALL_APP_DIR} 92 | 93 | # See: https://github.com/linuxdeploy/linuxdeploy-plugin-qt 94 | #export QMAKE=$Qt6_DIR/bin/qmake6 95 | export EXTRA_PLATFORM_PLUGINS="libqxcb.so" 96 | # Icons from theme are not displayed in QtWidgets Application: https://github.com/linuxdeploy/linuxdeploy-plugin-qt/issues/17 97 | export EXTRA_QT_MODULES="svg" 98 | ${TOOLS_DIR}/linuxdeploy-`uname -m`.AppImage --appdir=AppDir -v0 \ 99 | --plugin qt \ 100 | --output appimage \ 101 | --exclude-library libqsqlmimer.so \ 102 | --exclude-library libqsqlmysql.so \ 103 | --exclude-library libqsqlodbc.so \ 104 | --exclude-library libqsqlpsql.so 105 | 106 | chmod a+x Calendar-`uname -m`.AppImage 107 | 108 | if [ -z "$Calendar_VERSION" ]; then 109 | cp Calendar-`uname -m`.AppImage $REPO_ROOT 110 | else 111 | mv Calendar-`uname -m`.AppImage ../Calendar_${Calendar_VERSION}_Linux_`uname -m`.AppImage 112 | fi 113 | 114 | popd 115 | popd 116 | -------------------------------------------------------------------------------- /Script/build_debpackage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Kang Lin 3 | 4 | #See: https://blog.csdn.net/alwaysbefine/article/details/114187380 5 | set -x 6 | set -e 7 | #set -v 8 | 9 | # store repo root as variable 10 | REPO_ROOT=$(readlink -f $(dirname $(dirname $(readlink -f $0)))) 11 | OLD_CWD=$(readlink -f .) 12 | 13 | pushd "$REPO_ROOT" 14 | 15 | if [ -n "$1" -a -z "$QT_ROOT" ]; then 16 | QT_ROOT=$1 17 | fi 18 | 19 | if [ -d "/usr/lib/`uname -m`-linux-gnu" -a -z "$QT_ROOT" ]; then 20 | QT_ROOT="/usr/lib/`uname -m`-linux-gnu" 21 | fi 22 | 23 | if [ -z "$QT_ROOT" ]; then 24 | echo "QT_ROOT=$QT_ROOT" 25 | echo "$0 QT_ROOT RabbitCommon_ROOT" 26 | exit -1 27 | fi 28 | 29 | if [ -n "$2" -a -z "$RabbitCommon_ROOT" ]; then 30 | RabbitCommon_ROOT=$2 31 | fi 32 | 33 | if [ -z "$RabbitCommon_ROOT" ]; then 34 | RabbitCommon_ROOT=`pwd`/../RabbitCommon 35 | echo "RabbitCommon_ROOT=$RabbitCommon_ROOT" 36 | fi 37 | 38 | if [ ! -d "$RabbitCommon_ROOT" ]; then 39 | echo "QT_ROOT=$QT_ROOT" 40 | echo "RabbitCommon_ROOT=$RabbitCommon_ROOT" 41 | echo "$0 QT_ROOT RabbitCommon_ROOT" 42 | exit -1 43 | fi 44 | 45 | export QT_ROOT=$QT_ROOT 46 | export RabbitCommon_ROOT=$RabbitCommon_ROOT 47 | export PATH=$QT_ROOT/bin:$PATH 48 | 49 | #fakeroot debian/rules binary 50 | 51 | # -p, --sign-command=sign-command 52 | # When dpkg-buildpackage needs to execute GPG to sign a source 53 | # control (.dsc) file or a .changes file it will run sign-command 54 | # (searching the PATH if necessary) instead of gpg (long option since 55 | # dpkg 1.18.8). sign-command will get all the arguments that gpg 56 | # would have gotten. sign-command should not contain spaces or any 57 | # other shell metacharacters. 58 | 59 | # -k, --sign-key=key-id 60 | # Specify a key-ID to use when signing packages (long option since 61 | # dpkg 1.18.8). 62 | 63 | # -us, --unsigned-source 64 | # Do not sign the source package (long option since dpkg 1.18.8). 65 | 66 | # -ui, --unsigned-buildinfo 67 | # Do not sign the .buildinfo file (since dpkg 1.18.19). 68 | 69 | # -uc, --unsigned-changes 70 | # Do not sign the .buildinfo and .changes files (long option since 71 | # dpkg 1.18.8). 72 | 73 | # -b Equivalent to --build=binary or --build=any,all. 74 | # -S Equivalent to --build=source 75 | # -d, --no-check-builddeps do not check build dependencies and conflicts. 76 | # --ignore-builtin-builddeps 77 | # do not check builtin build dependencies. 78 | 79 | #The -us -uc tell it there is no need to GPG sign the package. the -b is build binary 80 | dpkg-buildpackage -us -uc -b -d 81 | 82 | #The -us -uc tell it there is no need to GPG sign the package. the -S is build source package 83 | #dpkg-buildpackage -us -uc -S 84 | 85 | #dpkg-buildpackage -S 86 | 87 | # build source and binary package 88 | #dpkg-buildpackage -us -uc -d 89 | 90 | #dpkg-buildpackage -d 91 | 92 | popd 93 | -------------------------------------------------------------------------------- /Script/test_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Kang Lin 3 | 4 | #See: https://blog.csdn.net/alwaysbefine/article/details/114187380 5 | set -x 6 | set -e 7 | #set -v 8 | 9 | EXIT_CODE=0 10 | PROJECT_NAME="Calendar" 11 | 12 | if [ -n "$1" ]; then 13 | echo "$PROJECT_NAME" 14 | PROJECT_NAME=$1 15 | fi 16 | 17 | if [ ! -f ~/.config/autostart/${PROJECT_NAME}.desktop ]; then 18 | echo "There are not ~/.config/autostart/autostart/${PROJECT_NAME}.desktop" 19 | EXIT_CODE=$[EXIT_CODE+1] 20 | fi 21 | 22 | if [ ! -f /opt/${PROJECT_NAME}/share/applications/${PROJECT_NAME}.desktop ]; then 23 | echo "There are not /opt/share/applications/${PROJECT_NAME}.desktop" 24 | EXIT_CODE=$[EXIT_CODE+1] 25 | fi 26 | 27 | if [ ! -f /usr/share/applications/${PROJECT_NAME}.desktop ]; then 28 | echo "There are not /usr/share/applications/${PROJECT_NAME}.desktop" 29 | EXIT_CODE=$[EXIT_CODE+1] 30 | fi 31 | 32 | if [ ! -f /opt/${PROJECT_NAME}/share/pixmaps/${PROJECT_NAME}.png ]; then 33 | echo "There are not /opt/${PROJECT_NAME}/share/pixmaps/${PROJECT_NAME}.png" 34 | EXIT_CODE=$[EXIT_CODE+1] 35 | fi 36 | 37 | if [ ! -f /usr/share/pixmaps/${PROJECT_NAME}.png ]; then 38 | echo "There are not /usr/share/pixmaps/${PROJECT_NAME}.png" 39 | EXIT_CODE=$[EXIT_CODE+1] 40 | fi 41 | 42 | if [ ! -f /etc/ld.so.conf.d/${PROJECT_NAME}.conf ]; then 43 | echo "There are not /etc/ld.so.conf.d/${PROJECT_NAME}.conf" 44 | EXIT_CODE=$[EXIT_CODE+1] 45 | fi 46 | 47 | exit $EXIT_CODE 48 | -------------------------------------------------------------------------------- /Src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(Tasks LANGUAGES CXX) 2 | 3 | set(INSTALLHEADER_FILES 4 | FrmTasksList.h 5 | FrmStickyList.h 6 | FrmTasksList.h 7 | Global/TasksTools.h 8 | ) 9 | set(HEAD_FILES 10 | ${INSTALLHEADER_FILES} 11 | Task.h 12 | Tasks.h 13 | TasksList.h 14 | TaskLockScreen.h 15 | TaskTrayIconPrompt.h 16 | FrmTop.h 17 | TaskPrompt.h 18 | FrmStickyNotes.h 19 | FrmFullScreen.h 20 | ObjectFactory.h 21 | FrmTaskPropery.h 22 | ViewTaskProperty.h 23 | FrmTasks.h 24 | TaskPromptDelay.h 25 | Sticky.h 26 | StickyModel.h 27 | StickyItemDelegate.h 28 | FrmTasksList.h 29 | TaskActivity.h 30 | DlgTaskActivity.h 31 | FrmTopActivity.h 32 | DlgContainer.h 33 | FrmCustomActivity.h 34 | ThreadTasks.h 35 | ) 36 | set(SOURCE_FILES 37 | Task.cpp 38 | Tasks.cpp 39 | TasksList.cpp 40 | TaskLockScreen.cpp 41 | TaskTrayIconPrompt.cpp 42 | FrmTop.cpp 43 | TaskPrompt.cpp 44 | FrmStickyNotes.cpp 45 | FrmFullScreen.cpp 46 | Global/TasksTools.cpp 47 | FrmTaskPropery.cpp 48 | ViewTaskProperty.cpp 49 | FrmTasks.cpp 50 | TaskPromptDelay.cpp 51 | FrmTasksList.cpp 52 | Sticky.cpp 53 | FrmStickyList.cpp 54 | StickyModel.cpp 55 | StickyItemDelegate.cpp 56 | FrmCalendar.cpp 57 | TaskActivity.cpp 58 | DlgTaskActivity.cpp 59 | FrmTopActivity.cpp 60 | DlgContainer.cpp 61 | FrmCustomActivity.cpp 62 | ThreadTasks.cpp 63 | ) 64 | set(SOURCE_UI_FILES 65 | FrmFullScreen.ui 66 | FrmTop.ui 67 | FrmStickyNotes.ui 68 | FrmTaskProperty.ui 69 | FrmTasks.ui 70 | FrmTasksList.ui 71 | FrmStickyList.ui 72 | DlgTaskActivity.ui 73 | DlgContainer.ui 74 | FrmCustomActivity.ui 75 | ) 76 | 77 | #设置资源文件 78 | SET(RCC_FILES 79 | Resource/ResourceTasks.qrc 80 | ) 81 | 82 | if(Calendar_VERSION) 83 | list(APPEND Tasks_DEFINITIONS 84 | Calendar_VERSION="${Calendar_VERSION}" 85 | Calendar_REVISION="${Calendar_REVISION}" 86 | ) 87 | endif() 88 | 89 | include(GenerateExportHeader) 90 | ADD_TARGET(NAME ${PROJECT_NAME} 91 | SOURCE_FILES ${SOURCE_FILES} ${HEAD_FILES} 92 | ${SOURCE_UI_FILES} ${RCC_FILES} 93 | DEFINITIONS ${Tasks_DEFINITIONS} 94 | INCLUDE_DIRS 95 | $ # See: http://www.it1352.com/478094.html 96 | $ 97 | PRIVATE_LIBS LunarCalendar RabbitCommon ${QT_LIBRARIES} 98 | PRIVATE_INCLUDE_DIRS 99 | ${CMAKE_CURRENT_BINARY_DIR} 100 | ${CMAKE_BINARY_DIR} 101 | ${RabbitCommon_ROOR}/Src 102 | ${RabbitCommon_ROOR}/Src/export 103 | INSTALL_HEADER_FILES "${INSTALLHEADER_FILES}" 104 | VERSION ${Calendar_VERSION} 105 | ) 106 | 107 | # Install xml files 108 | INSTALL_DIR(SOURCES ${CMAKE_SOURCE_DIR}/etc/ 109 | DESTINATION "etc/xml" 110 | COMPONENT Runtime) 111 | 112 | INSTALL_ICON_THEME( 113 | SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Resource/icons 114 | COMPONENT Runtime 115 | PARAMETERS PATTERN "*.theme" EXCLUDE 116 | ) 117 | -------------------------------------------------------------------------------- /Src/DlgContainer.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "DlgContainer.h" 4 | #include "ui_DlgContainer.h" 5 | #include 6 | #include 7 | #include 8 | 9 | CDlgContainer::CDlgContainer(QWidget *parent) : 10 | QDialog(parent), 11 | ui(new Ui::CDlgContainer) 12 | { 13 | ui->setupUi(this); 14 | } 15 | 16 | CDlgContainer::~CDlgContainer() 17 | { 18 | delete ui; 19 | } 20 | 21 | int CDlgContainer::SetWidget(QWidget *pWidget) 22 | { 23 | if(!pWidget) 24 | return -1; 25 | 26 | setWindowTitle(pWidget->windowTitle()); 27 | setWindowIcon(pWidget->windowIcon()); 28 | ui->scrollArea->setWidget(pWidget); 29 | 30 | return 0; 31 | } 32 | 33 | int CDlgContainer::ShowButton(bool bShow) 34 | { 35 | ui->pbOk->setVisible(bShow); 36 | ui->pbCancle->setVisible(bShow); 37 | return 0; 38 | } 39 | 40 | int CDlgContainer::ExtendExec() 41 | { 42 | #if defined (Q_OS_ANDROID) 43 | showMaximized(); 44 | #endif 45 | return exec(); 46 | } 47 | 48 | void CDlgContainer::showEvent(QShowEvent *event) 49 | { 50 | Q_UNUSED(event); 51 | 52 | if(!ui->scrollArea->widget()) 53 | return; 54 | 55 | ensurePolished(); 56 | 57 | QMargins cm = ui->scrollArea->widget()->contentsMargins(); 58 | int nWidth = ui->scrollArea->geometry().width(); 59 | int nHeight = ui->scrollArea->geometry().height(); 60 | int otherWidth = geometry().width() - nWidth + ui->scrollArea->geometry().y(); 61 | int otherHeght = geometry().height() - nHeight + ui->scrollArea->geometry().x(); 62 | int boardWidth = frameGeometry().width() - nWidth; 63 | int boardHeight = frameGeometry().height() - nHeight; 64 | 65 | QRect rectWidget = ui->scrollArea->widget()->frameGeometry(); 66 | rectWidget.setWidth(rectWidget.width() + cm.left() + cm.right()); 67 | rectWidget.setHeight(rectWidget.height() + cm.top() + cm.bottom()); 68 | QRect rectDesktop = QGuiApplication::primaryScreen()->availableGeometry(); 69 | int nDesktopWidth = rectDesktop.width(); 70 | int nDesktopHeight = rectDesktop.height(); 71 | 72 | qDebug() << "CDlgContainer::showEvent:" << frameGeometry() << geometry() 73 | << ui->scrollArea->geometry() << rectWidget << "otherWidth:" << otherWidth 74 | << "oHeight:" << otherHeght << "boardWidth:" << boardWidth 75 | << "boardHeight:" << boardHeight; 76 | 77 | if(nWidth < rectWidget.width()) 78 | { 79 | if(rectWidget.width() > rectDesktop.width() - boardWidth) 80 | nWidth = rectDesktop.width() - boardWidth; 81 | else 82 | nWidth = rectWidget.width(); 83 | } 84 | if(nHeight < rectWidget.height()) 85 | { 86 | if(rectWidget.height() > rectDesktop.height() - boardHeight) 87 | nHeight = rectDesktop.height() - boardHeight; 88 | else 89 | nHeight = rectWidget.height(); 90 | } 91 | 92 | QRect rect = geometry(); 93 | rect.setWidth(nWidth + otherWidth); 94 | rect.setHeight(nHeight + otherHeght); 95 | setGeometry(rect); 96 | 97 | QPoint point((nDesktopWidth - frameGeometry().width()) / 2, 98 | (nDesktopHeight - frameGeometry().height()) / 2); 99 | move(point); 100 | qDebug() << "CDlgContainer::showEvent:" << frameGeometry(); 101 | } 102 | 103 | void CDlgContainer::on_pbOk_clicked() 104 | { 105 | this->accept(); 106 | } 107 | 108 | void CDlgContainer::on_pbCancle_clicked() 109 | { 110 | this->reject(); 111 | } 112 | -------------------------------------------------------------------------------- /Src/DlgContainer.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef DLGCONTAINER_H 4 | #define DLGCONTAINER_H 5 | 6 | #include 7 | 8 | namespace Ui { 9 | class CDlgContainer; 10 | } 11 | 12 | class CDlgContainer : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit CDlgContainer(QWidget *parent = nullptr); 18 | virtual ~CDlgContainer() override; 19 | 20 | int SetWidget(QWidget* pWidget); 21 | int ShowButton(bool bShow = true); 22 | int ExtendExec(); 23 | 24 | private: 25 | Ui::CDlgContainer *ui; 26 | 27 | protected: 28 | virtual void showEvent(QShowEvent *event) override; 29 | private slots: 30 | void on_pbOk_clicked(); 31 | void on_pbCancle_clicked(); 32 | }; 33 | 34 | #endif // DLGCONTAINER_H 35 | -------------------------------------------------------------------------------- /Src/DlgContainer.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CDlgContainer 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 9 19 | 20 | 21 | 9 22 | 23 | 24 | 9 25 | 26 | 27 | 9 28 | 29 | 30 | 6 31 | 32 | 33 | 34 | 35 | QFrame::NoFrame 36 | 37 | 38 | QFrame::Sunken 39 | 40 | 41 | true 42 | 43 | 44 | 45 | 46 | 0 47 | 0 48 | 382 49 | 254 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | Qt::Horizontal 61 | 62 | 63 | 64 | 40 65 | 20 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 0 75 | 0 76 | 77 | 78 | 79 | Ok(&O) 80 | 81 | 82 | 83 | 84 | 85 | 86 | Cancel(&C) 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Src/DlgTaskActivity.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef FRMACTIVITY_H 4 | #define FRMACTIVITY_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include "TaskActivity.h" 10 | 11 | namespace Ui { 12 | class CDlgTaskActivity; 13 | } 14 | 15 | class CDlgTaskActivity : public QDialog 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit CDlgTaskActivity(CTaskActivity* task, 21 | QWidget *parent = nullptr); 22 | virtual ~CDlgTaskActivity() override; 23 | 24 | int SetTask(CTaskActivity* task); 25 | CTaskActivity* GetTask(); 26 | int ApplyTask(); 27 | 28 | private: 29 | int Init(); 30 | 31 | private: 32 | Ui::CDlgTaskActivity *ui; 33 | CTaskActivity* m_Task; 34 | QStandardItemModel *m_pModelPrompt; 35 | CTaskActivity::_TYPE_DATE m_TypeDate; 36 | CTaskActivity::_ENUM_REPEAT m_Repeat; 37 | int m_CustomNumber; 38 | int m_Week; 39 | CTaskActivity::_ENUM_EFFECTIVE m_Effective; 40 | QDate m_UntilDate; 41 | int m_LoopCount; 42 | 43 | protected: 44 | virtual void showEvent(QShowEvent *event) override; 45 | virtual void hideEvent(QHideEvent *event) override; 46 | 47 | private slots: 48 | void on_rbSolar_clicked(); 49 | void on_rbLunar_clicked(); 50 | void on_rbOnce_clicked(); 51 | void on_rbEveryDay_clicked(); 52 | void on_rbWeekly_clicked(); 53 | void on_rbMonthly_clicked(); 54 | void on_rbEveryYear_clicked(); 55 | void on_rbCustom_clicked(); 56 | void on_pbPromptAdd_clicked(); 57 | void on_pbPromptRemove_clicked(); 58 | void on_dtStart_dateChanged(const QDate &date); 59 | void on_dtEnd_dateChanged(const QDate &date); 60 | void on_tmStart_timeChanged(const QTime &time); 61 | void on_tmEnd_timeChanged(const QTime &time); 62 | }; 63 | 64 | #endif // FRMACTIVITY_H 65 | -------------------------------------------------------------------------------- /Src/FrmCalendar.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef FRMCALENDAR_H 4 | #define FRMCALENDAR_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "tasks_export.h" 12 | #include "TasksList.h" 13 | 14 | class CLunarCalendar; 15 | 16 | class TASKS_EXPORT CFrmCalendar : public QWidget 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit CFrmCalendar(QWidget *parent = nullptr); 22 | virtual ~CFrmCalendar(); 23 | 24 | virtual int onHandle(const QDate &date, QStringList &t); 25 | 26 | public Q_SLOTS: 27 | void slotCalendarType(); 28 | 29 | private Q_SLOTS: 30 | void slotSelectionChanged(); 31 | void slotLoad(); 32 | void slotSaveAs(); 33 | void slotAdd(); 34 | void slotDelete(); 35 | void slotModify(); 36 | void slotRefresh(); 37 | void slotViewWeek(bool checked); 38 | void slotCalendarHead(bool checked); 39 | void slotViewDoubleClicked(const QModelIndex &index); 40 | void slotViewCustomContextMenuRequested(const QPoint &pos); 41 | 42 | private: 43 | int Load(const QString& szFile); 44 | int Update(); 45 | 46 | private: 47 | CLunarCalendar *m_pCalendar; 48 | QListView m_listView; 49 | QStandardItemModel* m_pModel; 50 | QToolBar m_ToolBar; 51 | bool m_bModify; 52 | CTasksList m_TasksList; 53 | QMenu m_ListViewMenu; 54 | }; 55 | 56 | #endif // FRMCALENDAR_H 57 | -------------------------------------------------------------------------------- /Src/FrmCustomActivity.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef FRMCUSTOMACTIVITY_H 4 | #define FRMCUSTOMACTIVITY_H 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "TaskActivity.h" 11 | 12 | namespace Ui { 13 | class CFrmCustomActivity; 14 | } 15 | 16 | class CFrmCustomActivity : public QWidget 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit CFrmCustomActivity(QWidget *parent = nullptr); 22 | ~CFrmCustomActivity(); 23 | 24 | int SetRepeat(CTaskActivity::_ENUM_REPEAT r); 25 | CTaskActivity::_ENUM_REPEAT GetRepeat() const; 26 | int SetNumber(int n); 27 | int GetNumber() const; 28 | void SetWeek(int w); 29 | int GetWeek() const; 30 | int SetEffective(CTaskActivity::_ENUM_EFFECTIVE e); 31 | CTaskActivity::_ENUM_EFFECTIVE GetEffective() const; 32 | int SetUntil(QDate d); 33 | QDate GetUntil(); 34 | int SetLoopCount(int n); 35 | int GetLoopCount(); 36 | 37 | private slots: 38 | void on_rbWeeks_clicked(); 39 | void on_rbDays_clicked(); 40 | void on_rbMonths_clicked(); 41 | void on_rbYears_clicked(); 42 | void on_rbAlways_clicked(); 43 | void on_rbUntil_clicked(); 44 | void on_rbLoopCount_clicked(); 45 | 46 | void on_cmbType_currentIndexChanged(int index); 47 | 48 | private: 49 | Ui::CFrmCustomActivity *ui; 50 | 51 | CTaskActivity::_ENUM_REPEAT m_Repeat; 52 | }; 53 | 54 | #endif // FRMCUSTOMACTIVITY_H 55 | -------------------------------------------------------------------------------- /Src/FrmFullScreen.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "FrmFullScreen.h" 4 | #include "ui_FrmFullScreen.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 11 | #include 12 | #else 13 | #include 14 | #endif 15 | 16 | CFrmFullScreen::CFrmFullScreen(QWidget *parent) : 17 | QWidget(parent, 18 | Qt::FramelessWindowHint 19 | | Qt::X11BypassWindowManagerHint //这个标志是在x11下有用,查看帮助QWidget::showFullScreen() 20 | | Qt::Tool 21 | | Qt::WindowStaysOnTopHint 22 | | Qt::CustomizeWindowHint), 23 | ui(new Ui::CFrmFullScreen) 24 | { 25 | QSize s; 26 | 27 | #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 28 | s = qApp->primaryScreen()->geometry().size(); 29 | #else 30 | s = qApp->desktop()->size(); 31 | #endif 32 | this->setFixedSize(s); 33 | resize(s); 34 | ui->setupUi(this); 35 | setAttribute(Qt::WA_DeleteOnClose); 36 | //setStyleSheet("background-color:rgb(0,0,0);color:rgb(0,255,0);"); 37 | bool check = connect(&m_Timer, SIGNAL(timeout()), this, SLOT(slotTimeout())); 38 | Q_ASSERT(check); 39 | m_Timer.start(1000); 40 | this->setCursor(Qt::BlankCursor); 41 | } 42 | 43 | CFrmFullScreen::~CFrmFullScreen() 44 | { 45 | qDebug() << "CFrmFullScreen::~CFrmFullScreen()"; 46 | m_Timer.stop(); 47 | delete ui; 48 | } 49 | 50 | void CFrmFullScreen::slotTimeout() 51 | { 52 | ui->lbTime->setText(QTime::currentTime().toString("hh:mm:ss")); 53 | } 54 | 55 | void CFrmFullScreen::paintEvent(QPaintEvent *event) 56 | { 57 | Q_UNUSED(event); 58 | /*QPainter painter(this); 59 | if(!m_bpBackgroup.isNull()) 60 | painter.drawImage(this->geometry(), m_bpBackgroup);*/ 61 | } 62 | 63 | int CFrmFullScreen::Prompt(const QString szPrompt, int nValue, int nMin, int nMax, bool bInverted) 64 | { 65 | ui->lbText->setText(szPrompt); 66 | ui->progressBar->reset(); 67 | //ui->progressBar->setInvertedAppearance(bInverted); 68 | ui->progressBar->setRange(nMin, nMax); 69 | if(bInverted) 70 | { 71 | int n = nMax - nValue; 72 | qDebug() << "Max:" << nMax << "value:" << nValue << "n:" << n; 73 | ui->progressBar->setValue(n); 74 | } 75 | else 76 | ui->progressBar->setValue(nValue); 77 | return 0; 78 | } 79 | 80 | int CFrmFullScreen::SetBackgroupImage(const QString szImage) 81 | { 82 | QImage img(szImage); 83 | return SetBackgroupImage(img); 84 | } 85 | 86 | int CFrmFullScreen::SetBackgroupImage(const QImage img) 87 | { 88 | setStyleSheet(""); 89 | QPalette palette; 90 | palette.setBrush(QPalette::Window, QBrush(img.scaled(this->geometry().size()))); 91 | setPalette(palette); 92 | return 0; 93 | } 94 | -------------------------------------------------------------------------------- /Src/FrmFullScreen.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef FRMLOCKSCREEN_H 4 | #define FRMLOCKSCREEN_H 5 | 6 | #pragma once 7 | #include 8 | #include 9 | #include 10 | 11 | namespace Ui { 12 | class CFrmFullScreen; 13 | } 14 | 15 | class CFrmFullScreen : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit CFrmFullScreen(QWidget *parent = nullptr); 21 | virtual ~CFrmFullScreen(); 22 | 23 | int Prompt(const QString szPrompt, int nValue = 0, int nMin = 0, int nMax = 100, bool bInverted = false); 24 | int SetBackgroupImage(const QString szImage); 25 | int SetBackgroupImage(const QImage img); 26 | 27 | protected: 28 | virtual void paintEvent(QPaintEvent *event); 29 | 30 | private Q_SLOTS: 31 | void slotTimeout(); 32 | 33 | private: 34 | Ui::CFrmFullScreen *ui; 35 | QTimer m_Timer; 36 | QImage m_bpBackgroup; 37 | }; 38 | 39 | #endif // FRMLOCKSCREEN_H 40 | -------------------------------------------------------------------------------- /Src/FrmFullScreen.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CFrmFullScreen 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | FullScreen 15 | 16 | 17 | true 18 | 19 | 20 | 21 | 22 | 23 | Qt::Vertical 24 | 25 | 26 | 27 | 20 28 | 40 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 18 38 | 39 | 40 | 41 | Time 42 | 43 | 44 | Qt::AlignCenter 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 0 53 | 0 54 | 55 | 56 | 57 | 58 | Arial 59 | 20 60 | 61 | 62 | 63 | TextLabel 64 | 65 | 66 | Qt::AlignCenter 67 | 68 | 69 | 70 | 71 | 72 | 73 | Qt::Vertical 74 | 75 | 76 | 77 | 20 78 | 40 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 24 87 | 88 | 89 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 90 | 91 | 92 | false 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /Src/FrmStickyList.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef FRMSTICKYLIST_H 4 | #define FRMSTICKYLIST_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include "StickyModel.h" 10 | #include "FrmStickyNotes.h" 11 | #include "tasks_export.h" 12 | 13 | namespace Ui { 14 | class CFrmStickyList; 15 | } 16 | 17 | class TASKS_EXPORT CFrmStickyList : public QWidget 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | explicit CFrmStickyList(QWidget *parent = nullptr); 23 | virtual ~CFrmStickyList(); 24 | 25 | public Q_SLOTS: 26 | void slotLoad(); 27 | void slotSave(); 28 | void on_actionNew_triggered(); 29 | void on_actionRemove_triggered(); 30 | void slotDelete(QSharedPointer sticky); 31 | 32 | private slots: 33 | void on_listView_doubleClicked(const QModelIndex &index); 34 | 35 | private: 36 | int Load(const QString &szFile); 37 | int Save(const QString &szFile); 38 | void ShowSticky(int nIndex); 39 | CFrmStickyNotes *NewFrmSticky(QSharedPointer s); 40 | int CleanStickyNotes(); 41 | 42 | private: 43 | Ui::CFrmStickyList *ui; 44 | 45 | CStickyModel m_Model; 46 | QList m_StickyNotes; 47 | QListView m_lvTasks; 48 | QToolBar m_ToolBar; 49 | }; 50 | 51 | #endif // FRMSTICKYLIST_H 52 | -------------------------------------------------------------------------------- /Src/FrmStickyList.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CFrmStickyList 4 | 5 | 6 | 7 | 0 8 | 0 9 | 262 10 | 468 11 | 12 | 13 | 14 | Sticky 15 | 16 | 17 | 18 | 19 | 20 | 21 | Sticky 22 | 23 | 24 | Sticky 25 | 26 | 27 | Sticky 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | New 37 | 38 | 39 | New sticky 40 | 41 | 42 | New sticky 43 | 44 | 45 | New sticky 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | Remove 55 | 56 | 57 | Remove sticky 58 | 59 | 60 | Remove sticky 61 | 62 | 63 | Remove sticky 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Src/FrmStickyNotes.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef FRMSTICKYNOTES_H 4 | #define FRMSTICKYNOTES_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "Sticky.h" 12 | 13 | namespace Ui { 14 | class CFrmStickyNotes; 15 | } 16 | 17 | class CFrmStickyNotes : public QWidget 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | explicit CFrmStickyNotes(QWidget *parent = nullptr); 23 | virtual ~CFrmStickyNotes() override; 24 | 25 | int SetSticky(QSharedPointer sticky); 26 | bool IsSticky(QSharedPointer sticky); 27 | 28 | Q_SIGNALS: 29 | void sigNew(); 30 | 31 | private Q_SLOTS: 32 | void slotBold(); 33 | void slotItalic(); 34 | void slotUnderline(); 35 | void slotStrikethrough(); 36 | void slotDelet(); 37 | void slotNew(); 38 | void slotPolicy(int policy); 39 | void slotTextChanged(); 40 | void slotUpdate(); 41 | 42 | protected: 43 | #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 44 | virtual void enterEvent(QEnterEvent *event) override; 45 | #else 46 | virtual void enterEvent(QEvent *event) override; 47 | #endif 48 | virtual void leaveEvent(QEvent *event) override; 49 | virtual void mousePressEvent(QMouseEvent *e) override; 50 | virtual void mouseReleaseEvent(QMouseEvent *e) override; 51 | virtual void mouseMoveEvent(QMouseEvent *e) override; 52 | virtual void focusInEvent(QFocusEvent *event) override; 53 | virtual void focusOutEvent(QFocusEvent *event) override; 54 | virtual void moveEvent(QMoveEvent *event) override; 55 | virtual void resizeEvent(QResizeEvent *event) override; 56 | virtual void closeEvent(QCloseEvent *event) override; 57 | virtual void showEvent(QShowEvent *event) override; 58 | 59 | private: 60 | Ui::CFrmStickyNotes *ui; 61 | 62 | QComboBox *m_pComboBox; 63 | QToolBar m_ToolBarTop; 64 | QToolBar m_ToolBarButton; 65 | QTextEdit m_TextEdit; 66 | 67 | bool m_bMoveable; 68 | QPointF m_oldPos; 69 | QPoint m_oldTop; 70 | QRect m_rtDesktop; 71 | 72 | QSharedPointer m_Sticky; 73 | }; 74 | 75 | #endif // FRMSTICKYNOTES_H 76 | -------------------------------------------------------------------------------- /Src/FrmStickyNotes.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CFrmStickyNotes 4 | 5 | 6 | 7 | 0 8 | 0 9 | 300 10 | 350 11 | 12 | 13 | 14 | 15 | Arial 16 | 12 17 | 18 | 19 | 20 | Sticky Notes 21 | 22 | 23 | 24 | 25 | 26 | 1.000000000000000 27 | 28 | 29 | 30 | 0 31 | 32 | 33 | 0 34 | 35 | 36 | 0 37 | 38 | 39 | 0 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Src/FrmTask.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "FrmTask.h" 4 | #include "ui_FrmTask.h" 5 | 6 | CFrmTask::CFrmTask(QSharedPointer task, QWidget *parent) : 7 | QWidget(parent), 8 | ui(new Ui::CFrmTask) 9 | { 10 | ui->setupUi(this); 11 | SetTask(task); 12 | } 13 | 14 | CFrmTask::~CFrmTask() 15 | { 16 | delete ui; 17 | } 18 | 19 | int CFrmTask::SetTask(QSharedPointer task) 20 | { 21 | //ui->gpTask->setTitle(tr("Task: ") + task->objectName()); 22 | ui->leTaskID->setText(QString::number(task->GetId())); 23 | ui->leTaskTitle->setText(task->GetTitle()); 24 | ui->teTaskContent->setText(task->GetContent()); 25 | ui->spInterval->setValue(task->GetInterval() / 60000); 26 | ui->spPromptInterval->setValue(task->GetPromptInterval() / 1000); 27 | 28 | m_Task = task; 29 | return 0; 30 | } 31 | 32 | int CFrmTask::ApplyTask() 33 | { 34 | m_Task->SetId(ui->leTaskID->text().toInt()); 35 | m_Task->SetTitle(ui->leTaskTitle->text()); 36 | m_Task->SetContent(ui->teTaskContent->toPlainText()); 37 | m_Task->SetInterval(ui->spInterval->value() * 60000); 38 | m_Task->SetPromptInterval(ui->spPromptInterval->value() * 1000); 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /Src/FrmTask.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef FRMTASK_H 4 | #define FRMTASK_H 5 | 6 | #include 7 | #include "Task.h" 8 | 9 | namespace Ui { 10 | class CFrmTask; 11 | } 12 | 13 | class CFrmTask : public QWidget 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit CFrmTask(QSharedPointer task = QSharedPointer(), 19 | QWidget *parent = nullptr); 20 | ~CFrmTask(); 21 | 22 | int SetTask(QSharedPointer task); 23 | int ApplyTask(); 24 | 25 | private: 26 | Ui::CFrmTask *ui; 27 | 28 | QSharedPointer m_Task; 29 | }; 30 | 31 | #endif // FRMTASK_H 32 | -------------------------------------------------------------------------------- /Src/FrmTaskProperty.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CFrmTaskProperty 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Task property 15 | 16 | 17 | 18 | 19 | 20 | 21 | 0 22 | 0 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Qt::Horizontal 33 | 34 | 35 | 36 | 40 37 | 20 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Save 46 | 47 | 48 | 49 | 50 | 51 | 52 | Cancel 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Src/FrmTaskPropery.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "FrmTaskPropery.h" 4 | #include "ui_FrmTaskProperty.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | CFrmTaskProperty::CFrmTaskProperty(CTasksList *plstTasks, 16 | QWidget *parent) : 17 | QWidget(parent), 18 | ui(new Ui::CFrmTaskProperty) 19 | { 20 | setAttribute(Qt::WA_DeleteOnClose); 21 | setAttribute(Qt::WA_QuitOnClose, false); 22 | ui->setupUi(this); 23 | m_plstTasks = plstTasks; 24 | 25 | if(!ui->widget->layout()) 26 | { 27 | setLayout(new QVBoxLayout(ui->widget)); 28 | } 29 | if(!ui->widget->layout()) 30 | return; 31 | 32 | CTasksList::POSITION pos = m_plstTasks->GetFirst(); 33 | QSharedPointer tasks = m_plstTasks->GetNext(pos); 34 | while(tasks) 35 | { 36 | QGroupBox *pGb = new QGroupBox( 37 | tr("Tasks: %1; Id: %2").arg(tasks->GetTitle(), 38 | QString::number(tasks->GetId())), 39 | ui->widget); 40 | if(!pGb) 41 | break; 42 | ui->widget->layout()->addWidget(pGb); 43 | 44 | CTasks::POSITION posTasks = tasks->GetFirst(); 45 | QSharedPointer task = tasks->GetNext(posTasks); 46 | while(task) 47 | { 48 | if(!pGb->layout()) 49 | { 50 | pGb->setLayout(new QHBoxLayout(pGb)); 51 | } 52 | 53 | QVBoxLayout *pVbLayout = new QVBoxLayout(pGb); 54 | pGb->layout()->addItem(pVbLayout); 55 | 56 | QLabel *label = new QLabel(pGb); 57 | if(tasks->GetCurrent() == task) 58 | { 59 | QPalette lablePalette = label->palette(); 60 | lablePalette.setColor(QPalette::Window, 61 | lablePalette.color(QPalette::Highlight)); 62 | label->setPalette(lablePalette); 63 | } 64 | label->setText(tr("Id: %1 Title: %2").arg( 65 | QString::number(task->GetId()), task->GetTitle())); 66 | pVbLayout->addWidget(label); 67 | CViewTaskProperty *m_pProperty = new CViewTaskProperty(task, pGb); 68 | pVbLayout->addWidget(m_pProperty); 69 | task = tasks->GetNext(posTasks); 70 | } 71 | tasks = m_plstTasks->GetNext(pos); 72 | } 73 | } 74 | 75 | CFrmTaskProperty::~CFrmTaskProperty() 76 | { 77 | delete ui; 78 | qDebug() << "CFrmTaskProperty::~CFrmTaskProperty"; 79 | } 80 | 81 | void CFrmTaskProperty::on_pbSave_clicked() 82 | { 83 | // Save configure 84 | m_plstTasks->SaveSettings(); 85 | close(); 86 | } 87 | 88 | void CFrmTaskProperty::on_pbCancle_clicked() 89 | { 90 | close(); 91 | } 92 | -------------------------------------------------------------------------------- /Src/FrmTaskPropery.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef FRMTASKPROPERY_H 4 | #define FRMTASKPROPERY_H 5 | 6 | #include 7 | #include 8 | #include "TasksList.h" 9 | #include "ViewTaskProperty.h" 10 | 11 | namespace Ui { 12 | class CFrmTaskProperty; 13 | } 14 | 15 | class CFrmTaskProperty : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit CFrmTaskProperty(CTasksList *plstTasks, QWidget *parent = nullptr); 21 | virtual ~CFrmTaskProperty(); 22 | 23 | private slots: 24 | void on_pbSave_clicked(); 25 | void on_pbCancle_clicked(); 26 | 27 | private: 28 | Ui::CFrmTaskProperty *ui; 29 | 30 | CTasksList *m_plstTasks; 31 | }; 32 | 33 | #endif // FRMTASKPROPERY_H 34 | -------------------------------------------------------------------------------- /Src/FrmTasks.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef FRMTASKS_H 4 | #define FRMTASKS_H 5 | 6 | #include 7 | #include "Tasks.h" 8 | 9 | namespace Ui { 10 | class CFrmTasks; 11 | } 12 | 13 | class CFrmTasks : public QWidget 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | CFrmTasks(QWidget* parent = nullptr); 19 | explicit CFrmTasks(QSharedPointer tasks, 20 | bool readOnly = false, 21 | QWidget *parent = nullptr); 22 | virtual ~CFrmTasks(); 23 | 24 | int SetTasks(QSharedPointer tasks = QSharedPointer()); 25 | 26 | Q_SIGNALS: 27 | void Changed(); 28 | 29 | private Q_SLOTS: 30 | void on_pbAdd_clicked(); 31 | void on_pbRemove_clicked(); 32 | void on_pbClose_clicked(); 33 | void on_vsLength_valueChanged(int value); 34 | void on_pbPrevious_clicked(); 35 | void on_pbNext_clicked(); 36 | void on_pbApply_clicked(); 37 | 38 | void on_leTasksTitle_editingFinished(); 39 | void on_teTasksContent_textChanged(); 40 | void on_leTaskTitle_editingFinished(); 41 | void on_teTaskContent_textChanged(); 42 | void on_spInterval_valueChanged(int arg1); 43 | void on_spPromptInterval_valueChanged(int arg1); 44 | 45 | void on_pbTasksIcon_clicked(); 46 | 47 | void on_pbTaskIcon_clicked(); 48 | 49 | protected: 50 | virtual void closeEvent(QCloseEvent *event); 51 | 52 | private: 53 | int SetTask(QSharedPointer task); 54 | int InitTaskComboBox(); 55 | int SetSlider(int value); 56 | 57 | private: 58 | Ui::CFrmTasks *ui; 59 | QSharedPointer m_Tasks; 60 | }; 61 | 62 | #endif // FRMTASKS_H 63 | -------------------------------------------------------------------------------- /Src/FrmTasksList.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef FRMTASKSLIST_H 4 | #define FRMTASKSLIST_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "TasksList.h" 12 | #include "FrmTasks.h" 13 | #include "tasks_export.h" 14 | 15 | namespace Ui { 16 | class CFrmTasksList; 17 | } 18 | 19 | /** 20 | * @brief Tasks list form class 21 | */ 22 | class TASKS_EXPORT CFrmTasksList : public QWidget 23 | { 24 | Q_OBJECT 25 | 26 | public: 27 | explicit CFrmTasksList(QWidget *parent = nullptr); 28 | virtual ~CFrmTasksList(); 29 | 30 | public Q_SLOTS: 31 | void slotNew(); 32 | void slotRemove(); 33 | void slotLoad(); 34 | void slotSaveAs(); 35 | void slotRefresh(); 36 | 37 | private Q_SLOTS: 38 | void on_lvTasks_clicked(const QModelIndex &index); 39 | void on_lvTasks_indexesMoved(const QModelIndexList &indexes); 40 | 41 | protected: 42 | virtual void closeEvent(QCloseEvent *event); 43 | 44 | private: 45 | int Init(); 46 | int Load(QString szFile = QString()); 47 | 48 | private: 49 | Ui::CFrmTasksList *ui; 50 | 51 | CTasksList m_TasksList; 52 | CFrmTasks m_FrmTasks; 53 | QStandardItemModel m_Model; 54 | QListView m_lvTasks; 55 | QToolBar m_ToolBar; 56 | }; 57 | 58 | #endif // FRMTASKSLIST_H 59 | -------------------------------------------------------------------------------- /Src/FrmTasksList.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CFrmTasksList 4 | 5 | 6 | 7 | 0 8 | 0 9 | 150 10 | 400 11 | 12 | 13 | 14 | Tasks 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Load(&L) 28 | 29 | 30 | Load tasks 31 | 32 | 33 | Load tasks 34 | 35 | 36 | Load tasks 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Save as(&S) ...... 46 | 47 | 48 | Save tasks as ...... 49 | 50 | 51 | Save tasks as ...... 52 | 53 | 54 | Save tasks as ...... 55 | 56 | 57 | Save tasks as ...... 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | New(&N) 67 | 68 | 69 | New tasks 70 | 71 | 72 | New tasks 73 | 74 | 75 | New tasks 76 | 77 | 78 | QAction::TextHeuristicRole 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | Remove(&R) 88 | 89 | 90 | Remove tasks 91 | 92 | 93 | Remove tasks 94 | 95 | 96 | Remove tasks 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | Refresh(&F) 106 | 107 | 108 | Refresh 109 | 110 | 111 | Refresh 112 | 113 | 114 | Refresh 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /Src/FrmTop.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef FRMTOP_H 4 | #define FRMTOP_H 5 | 6 | #pragma once 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace Ui { 15 | class CFrmTop; 16 | } 17 | 18 | class CFrmTop : public QWidget 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | explicit CFrmTop(QWidget *parent = nullptr); 24 | virtual ~CFrmTop() override; 25 | 26 | void SetText(const QString szText); 27 | int SetBackgroupImage(const QString szImage); 28 | int SetPopupMenu(QMenu* pMenu); 29 | 30 | enum POSITION 31 | { 32 | LeftTop, 33 | LeftCenter, 34 | LeftBottom, 35 | CenterTop, 36 | Center, 37 | CenterBottom, 38 | RightTop, 39 | RightCenter, 40 | RightBottom 41 | }; 42 | int SetPostion(POSITION pos); 43 | 44 | protected: 45 | virtual void mousePressEvent(QMouseEvent *e) override; 46 | virtual void mouseReleaseEvent(QMouseEvent *e) override; 47 | virtual void mouseMoveEvent(QMouseEvent *e) override; 48 | virtual void contextMenuEvent(QContextMenuEvent *event) override; 49 | virtual void showEvent(QShowEvent *event) override; 50 | virtual void closeEvent(QCloseEvent *event) override; 51 | 52 | private: 53 | Ui::CFrmTop *ui; 54 | 55 | bool m_bMoveable; 56 | QPointF m_oldPos; 57 | QPoint m_oldTop; 58 | QRect m_rtDesktop; 59 | 60 | QImage m_bpBackgroup; 61 | QMenu* m_pPopupMenu; 62 | 63 | POSITION m_Postion; 64 | }; 65 | 66 | #endif // FRMTOP_H 67 | -------------------------------------------------------------------------------- /Src/FrmTop.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CFrmTop 4 | 5 | 6 | 7 | 0 8 | 0 9 | 291 10 | 53 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 22 | 23 | 0.700000000000000 24 | 25 | 26 | false 27 | 28 | 29 | 30 | 31 | 32 | Prompt 33 | 34 | 35 | Qt::AlignCenter 36 | 37 | 38 | false 39 | 40 | 41 | true 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Src/FrmTopActivity.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "FrmTopActivity.h" 4 | #include 5 | #include "DlgContainer.h" 6 | #include "DlgTaskActivity.h" 7 | 8 | CFrmTopActivity::CFrmTopActivity(QWidget *parent): CFrmTop(parent) 9 | { 10 | Qt::WindowFlags flags = windowFlags() 11 | & ~(Qt::FramelessWindowHint | 12 | Qt::X11BypassWindowManagerHint | //这个标志是在x11下有用,查看帮助QWidget::showFullScreen() 13 | Qt::Tool | 14 | //Qt::WindowStaysOnTopHint | 15 | Qt::CustomizeWindowHint 16 | ); 17 | setWindowFlags(flags); 18 | setAttribute(Qt::WA_DeleteOnClose, true); 19 | 20 | m_Menu.addAction(QIcon(":/icon/Close"), tr("Close"), 21 | this, SLOT(deleteLater())); 22 | m_Menu.addAction(tr("Delay 5 Minute"), 23 | this, SLOT(slotDelay5Minute(bool))); 24 | m_Menu.addAction(tr("Customize delay"), 25 | this, SLOT(slotDelayCustomize(bool))); 26 | SetPopupMenu(&m_Menu); 27 | 28 | bool check = connect(&m_Timer, SIGNAL(timeout()), this, SLOT(deleteLater())); 29 | Q_ASSERT(check); 30 | StartTimer(); 31 | } 32 | 33 | int CFrmTopActivity::StartTimer(int nMsec) 34 | { 35 | m_Timer.start(nMsec); 36 | m_StartTime.start(); 37 | return 0; 38 | } 39 | 40 | void CFrmTopActivity::slotDelay5Minute(bool checked) 41 | { 42 | Q_UNUSED(checked); 43 | AddDelay(5); 44 | } 45 | 46 | void CFrmTopActivity::slotDelayCustomize(bool checked) 47 | { 48 | Q_UNUSED(checked); 49 | bool ok = false; 50 | int n = QInputDialog::getInt(this, 51 | tr("Customize delay"), 52 | tr("Delay minute"), 53 | 10, 54 | 1, 55 | 60 * 60 * 24, 56 | 1, 57 | &ok); 58 | if(!ok) 59 | return; 60 | AddDelay(n); 61 | } 62 | 63 | int CFrmTopActivity::AddDelay(int nMinute) 64 | { 65 | StartTimer((nMinute + m_Timer.interval() - m_StartTime.elapsed()) * 60 * 1000); 66 | return 0; 67 | } 68 | 69 | int CFrmTopActivity::SetTask(CTaskActivity *task) 70 | { 71 | m_pTask = task; 72 | return 0; 73 | } 74 | 75 | void CFrmTopActivity::mouseReleaseEvent(QMouseEvent *event) 76 | { 77 | if(Qt::LeftButton == event->button()) 78 | { 79 | CDlgTaskActivity* pTask = new CDlgTaskActivity(m_pTask); 80 | CDlgContainer dlg; 81 | dlg.SetWidget(pTask); 82 | bool check = connect(this, SIGNAL(destroyed()), 83 | &dlg, SLOT(reject())); 84 | Q_ASSERT(check); 85 | if(QDialog::Accepted == dlg.ExtendExec()) 86 | { 87 | pTask->ApplyTask(); 88 | } 89 | close(); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Src/FrmTopActivity.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef FRMTOPACTIVITY_H 4 | #define FRMTOPACTIVITY_H 5 | 6 | #include "FrmTop.h" 7 | #include 8 | #include 9 | #include 10 | #include "TaskActivity.h" 11 | 12 | class CFrmTopActivity : public CFrmTop 13 | { 14 | Q_OBJECT 15 | public: 16 | explicit CFrmTopActivity(QWidget *parent = nullptr); 17 | 18 | int StartTimer(int nMsec = 1000 * 60 * 5); 19 | int SetTask(CTaskActivity* task); 20 | 21 | private Q_SLOTS: 22 | void slotDelay5Minute(bool checked); 23 | void slotDelayCustomize(bool checked); 24 | 25 | private: 26 | QMenu m_Menu; 27 | QTimer m_Timer; 28 | QElapsedTimer m_StartTime; 29 | 30 | int AddDelay(int nMinute); 31 | 32 | CTaskActivity* m_pTask; 33 | 34 | protected: 35 | virtual void mouseReleaseEvent(QMouseEvent *event) override; 36 | }; 37 | 38 | #endif // FRMTOPACTIVITY_H 39 | -------------------------------------------------------------------------------- /Src/Global/TasksTools.cpp: -------------------------------------------------------------------------------- 1 | #include "TasksTools.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #if defined(Q_OS_WIN) 8 | #include 9 | #endif 10 | 11 | #include "LunarCalendar.h" 12 | #include "RabbitCommonDir.h" 13 | #include "RabbitCommonTools.h" 14 | 15 | CTasksTools::CTasksTools() 16 | {} 17 | 18 | CTasksTools::~CTasksTools() 19 | {} 20 | 21 | CTasksTools* CTasksTools::Instance() 22 | { 23 | static CTasksTools* pTools = nullptr; 24 | if(nullptr == pTools) 25 | pTools = new CTasksTools(); 26 | return pTools; 27 | } 28 | 29 | void CTasksTools::InitTranslator() 30 | { 31 | m_Translator = RabbitCommon::CTools::Instance()->InstallTranslator("Tasks"); 32 | } 33 | 34 | void CTasksTools::CLeanTranslator() 35 | { 36 | RabbitCommon::CTools::Instance()->RemoveTranslator(m_Translator); 37 | } 38 | 39 | void CTasksTools::InitResource() 40 | { 41 | InitTranslator(); 42 | Q_INIT_RESOURCE(ResourceTasks); 43 | #if _DEBUG 44 | Q_INIT_RESOURCE(translations_Tasks); 45 | #endif 46 | } 47 | 48 | void CTasksTools::CleanResource() 49 | { 50 | Q_CLEANUP_RESOURCE(ResourceTasks); 51 | #if _DEBUG 52 | Q_CLEANUP_RESOURCE(translations_Tasks); 53 | #endif 54 | CLeanTranslator(); 55 | } 56 | 57 | int CTasksTools::ScreenPower(bool bOff) 58 | { 59 | Q_UNUSED(bOff); 60 | #if defined(Q_OS_WIN) 61 | if(bOff) 62 | SendMessage(FindWindow(0, 0), WM_SYSCOMMAND, SC_MONITORPOWER, 2); 63 | else 64 | SendMessage(FindWindow(0, 0), WM_SYSCOMMAND, SC_MONITORPOWER, -1); 65 | #endif 66 | return 0; 67 | } 68 | 69 | int CTasksTools::ScreenSaver(bool bSaver) 70 | { 71 | Q_UNUSED(bSaver); 72 | #if defined(Q_OS_WIN) 73 | ::SystemParametersInfo( SPI_SETSCREENSAVEACTIVE, bSaver, 0, 0 ); 74 | #endif 75 | return 0; 76 | } 77 | 78 | /* 79 | 取消电源管理,避免睡眠、待机: 80 | 81 | ::SetThreadExecutionState( ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED ); 82 | 83 | 恢复电源管理: 84 | 85 | ::SetThreadExecutionState( ES_CONTINUOUS ); 86 | 87 | */ 88 | -------------------------------------------------------------------------------- /Src/Global/TasksTools.h: -------------------------------------------------------------------------------- 1 | #ifndef TASKS_TOOL_H 2 | #define TASKS_TOOL_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "tasks_export.h" 9 | 10 | class TASKS_EXPORT CTasksTools 11 | { 12 | private: 13 | CTasksTools(); 14 | ~CTasksTools(); 15 | 16 | public: 17 | static CTasksTools* Instance(); 18 | 19 | void InitResource(); 20 | void CleanResource(); 21 | 22 | static int ScreenPower(bool bOff); 23 | static int ScreenSaver(bool bSaver); 24 | 25 | private: 26 | QSharedPointer m_Translator; 27 | 28 | void InitTranslator(); 29 | void CLeanTranslator(); 30 | }; 31 | 32 | #endif // TASKS_TOOL_H 33 | -------------------------------------------------------------------------------- /Src/Resource/ResourceTasks.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/china.png 4 | image/EyeNurse.png 5 | image/EyeCharts.png 6 | image/Calendar.png 7 | image/add.png 8 | image/delete.png 9 | image/sub.png 10 | image/edit.png 11 | image/file.png 12 | image/down.png 13 | image/up.png 14 | image/right.png 15 | image/point.png 16 | image/save.png 17 | image/option.png 18 | image/refresh.png 19 | image/skin.png 20 | image/eye.png 21 | image/copyright.png 22 | image/download.png 23 | image/restart.png 24 | image/sticky.png 25 | image/bold.png 26 | image/italic.png 27 | image/stricke.png 28 | image/underline.png 29 | image/move.png 30 | image/green_close.png 31 | image/weeklyview.png 32 | image/monthlyview.png 33 | image/Tools.png 34 | image/Task.png 35 | 36 | 37 | image/red_point.png 38 | image/close.png 39 | 40 | 41 | Sounds/Alarm05.wav 42 | Sounds/Alarm08.wav 43 | 44 | 45 | -------------------------------------------------------------------------------- /Src/Resource/Sounds/Alarm05.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/Sounds/Alarm05.wav -------------------------------------------------------------------------------- /Src/Resource/Sounds/Alarm08.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/Sounds/Alarm08.wav -------------------------------------------------------------------------------- /Src/Resource/Sounds/Windows Unlock.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/Sounds/Windows Unlock.wav -------------------------------------------------------------------------------- /Src/Resource/db/TaskActivity.sql: -------------------------------------------------------------------------------- 1 | BEGIN TRANSACTION; 2 | CREATE TABLE IF NOT EXISTS "TaskActivity" ( 3 | "ID" INTEGER PRIMARY KEY NOT NULL, 4 | "Title" TEXT, 5 | "Content" TEXT, 6 | "Place" TEXT, 7 | "Account" TEXT, -- 账户 8 | 9 | "DateStart" TEXT, -- 格式为 "YYYY-MM-DD" 的日期 10 | "DateEnd" TEXT, -- 格式为 "YYYY-MM-DD" 的日期 11 | "DateType" INTEGER DEFAULT 0, -- 0: 阳历; 1: 农历 12 | "TimeStart" TEXT, -- 格式为 "HH:MM:SS" 的时间 13 | "TimeEnd" TEXT, -- 格式为 "HH:MM:SS" 的时间 14 | 15 | /* 16 | 0,一次性 17 | 1,每天 18 | 2,每周 19 | 3,每月 20 | 4,每年 21 | 100,自定义 22 | */ 23 | "Repeat" INTEGER DEFAULT 0, 24 | 25 | /* 26 | 以 , 分隔的时间,单位为分钟, 27 | 正数表示在StartTime后,负数表示在StartTime前 28 | 默认为-5分钟 29 | */ 30 | "Prompt" TEXT DEFAULT -5 31 | ); 32 | COMMIT; 33 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-black/index.theme: -------------------------------------------------------------------------------- 1 | 2 | [Icon Theme] 3 | Name=green 4 | Comment=Green 5 | Inherits=breeze 6 | Directories=svg, png, ico 7 | 8 | [svg] 9 | Size=200 10 | MinSize=16 11 | ManSize=256 12 | Type=Scalable 13 | 14 | [png] 15 | Size=200 16 | MinSize=16 17 | ManSize=256 18 | Type=Scalable 19 | 20 | [ico] 21 | Size=200 22 | MinSize=16 23 | ManSize=256 24 | Type=Scalable 25 | 26 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-black/svg/add.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-black/svg/down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-black/svg/sticky.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-black/svg/subtract.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-black/svg/task.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-black/svg/up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-black/svg/week.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-green/index.theme: -------------------------------------------------------------------------------- 1 | 2 | [Icon Theme] 3 | Name=green 4 | Comment=Green 5 | Inherits=breeze 6 | Directories=svg, png, ico 7 | 8 | [svg] 9 | Size=200 10 | MinSize=16 11 | ManSize=256 12 | Type=Scalable 13 | 14 | [png] 15 | Size=200 16 | MinSize=16 17 | ManSize=256 18 | Type=Scalable 19 | 20 | [ico] 21 | Size=200 22 | MinSize=16 23 | ManSize=256 24 | Type=Scalable 25 | 26 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-green/svg/add.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-green/svg/down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-green/svg/sticky.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-green/svg/subtract.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-green/svg/task.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-green/svg/up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-green/svg/week.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-red/index.theme: -------------------------------------------------------------------------------- 1 | 2 | [Icon Theme] 3 | Name=green 4 | Comment=Green 5 | Inherits=breeze 6 | Directories=svg, png, ico 7 | 8 | [svg] 9 | Size=200 10 | MinSize=16 11 | ManSize=256 12 | Type=Scalable 13 | 14 | [png] 15 | Size=200 16 | MinSize=16 17 | ManSize=256 18 | Type=Scalable 19 | 20 | [ico] 21 | Size=200 22 | MinSize=16 23 | ManSize=256 24 | Type=Scalable 25 | 26 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-red/svg/add.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-red/svg/down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-red/svg/sticky.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-red/svg/subtract.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-red/svg/task.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-red/svg/up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-red/svg/week.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-white/index.theme: -------------------------------------------------------------------------------- 1 | 2 | [Icon Theme] 3 | Name=green 4 | Comment=Green 5 | Inherits=breeze 6 | Directories=svg, png, ico 7 | 8 | [svg] 9 | Size=200 10 | MinSize=16 11 | ManSize=256 12 | Type=Scalable 13 | 14 | [png] 15 | Size=200 16 | MinSize=16 17 | ManSize=256 18 | Type=Scalable 19 | 20 | [ico] 21 | Size=200 22 | MinSize=16 23 | ManSize=256 24 | Type=Scalable 25 | 26 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-white/svg/add.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-white/svg/down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-white/svg/sticky.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-white/svg/subtract.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-white/svg/task.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-white/svg/up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/icons/rabbit-white/svg/week.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Src/Resource/image/Calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/Calendar.png -------------------------------------------------------------------------------- /Src/Resource/image/English.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/English.png -------------------------------------------------------------------------------- /Src/Resource/image/EyeCharts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/EyeCharts.png -------------------------------------------------------------------------------- /Src/Resource/image/EyeNurse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/EyeNurse.png -------------------------------------------------------------------------------- /Src/Resource/image/Task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/Task.png -------------------------------------------------------------------------------- /Src/Resource/image/Tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/Tools.png -------------------------------------------------------------------------------- /Src/Resource/image/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/add.png -------------------------------------------------------------------------------- /Src/Resource/image/bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/bold.png -------------------------------------------------------------------------------- /Src/Resource/image/china.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/china.png -------------------------------------------------------------------------------- /Src/Resource/image/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/close.png -------------------------------------------------------------------------------- /Src/Resource/image/copyright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/copyright.png -------------------------------------------------------------------------------- /Src/Resource/image/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/delete.png -------------------------------------------------------------------------------- /Src/Resource/image/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/down.png -------------------------------------------------------------------------------- /Src/Resource/image/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/download.png -------------------------------------------------------------------------------- /Src/Resource/image/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/edit.png -------------------------------------------------------------------------------- /Src/Resource/image/eye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/eye.png -------------------------------------------------------------------------------- /Src/Resource/image/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/file.png -------------------------------------------------------------------------------- /Src/Resource/image/green_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/green_close.png -------------------------------------------------------------------------------- /Src/Resource/image/italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/italic.png -------------------------------------------------------------------------------- /Src/Resource/image/monthlyview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/monthlyview.png -------------------------------------------------------------------------------- /Src/Resource/image/move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/move.png -------------------------------------------------------------------------------- /Src/Resource/image/option.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/option.png -------------------------------------------------------------------------------- /Src/Resource/image/point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/point.png -------------------------------------------------------------------------------- /Src/Resource/image/red_point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/red_point.png -------------------------------------------------------------------------------- /Src/Resource/image/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/refresh.png -------------------------------------------------------------------------------- /Src/Resource/image/restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/restart.png -------------------------------------------------------------------------------- /Src/Resource/image/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/right.png -------------------------------------------------------------------------------- /Src/Resource/image/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/save.png -------------------------------------------------------------------------------- /Src/Resource/image/skin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/skin.png -------------------------------------------------------------------------------- /Src/Resource/image/sticky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/sticky.png -------------------------------------------------------------------------------- /Src/Resource/image/stricke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/stricke.png -------------------------------------------------------------------------------- /Src/Resource/image/sub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/sub.png -------------------------------------------------------------------------------- /Src/Resource/image/underline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/underline.png -------------------------------------------------------------------------------- /Src/Resource/image/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/up.png -------------------------------------------------------------------------------- /Src/Resource/image/wait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/wait.png -------------------------------------------------------------------------------- /Src/Resource/image/weeklyview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KangLin/Calendar/4f0f030c460aa068cb490403fed32e94d2646482/Src/Resource/image/weeklyview.png -------------------------------------------------------------------------------- /Src/Sticky.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "Sticky.h" 4 | #include 5 | 6 | static int gTypeCSticky = qRegisterMetaType(); 7 | CSticky::CSticky(QObject *parent) : QObject(parent) 8 | { 9 | m_nVersion = 0; 10 | m_bWindowHide = false; 11 | m_Policy = normal; 12 | } 13 | 14 | CSticky::CSticky(const CSticky &s) 15 | { 16 | m_bWindowHide = s.m_bWindowHide; 17 | m_Policy = s.m_Policy; 18 | m_WindowSize = s.m_WindowSize; 19 | m_WindowsPos = s.m_WindowsPos; 20 | m_bWindowHide = s.m_bWindowHide; 21 | m_szContent = s.m_szContent; 22 | m_tmModify = s.m_tmModify; 23 | m_tmCreate = s.m_tmCreate; 24 | } 25 | 26 | CSticky::~CSticky() 27 | { 28 | qDebug() << "CSticky::~CSticky()"; 29 | } 30 | 31 | int CSticky::SetContent(const QString &szContent) 32 | { 33 | m_szContent = szContent; 34 | m_tmModify = QDateTime::currentDateTime(); 35 | if(m_tmCreate.isNull()) 36 | m_tmCreate = m_tmModify; 37 | emit sigUpdate(); 38 | return 0; 39 | } 40 | 41 | QString CSticky::GetContent() 42 | { 43 | return m_szContent; 44 | } 45 | 46 | QString CSticky::GetText() 47 | { 48 | return m_szText; 49 | } 50 | 51 | int CSticky::SetText(const QString &szText) 52 | { 53 | m_szText = szText; 54 | return 0; 55 | } 56 | 57 | int CSticky::SetWindows(const QPoint &pos, const QSize &size) 58 | { 59 | m_WindowsPos = pos; 60 | m_WindowSize = size; 61 | emit sigUpdate(); 62 | return 0; 63 | } 64 | 65 | int CSticky::GetWindows(QPoint &pos, QSize &size) 66 | { 67 | pos = m_WindowsPos; 68 | size = m_WindowSize; 69 | return 0; 70 | } 71 | 72 | int CSticky::SetModifyTime() 73 | { 74 | m_tmModify = QDateTime::currentDateTime(); 75 | emit sigUpdate(); 76 | return 0; 77 | } 78 | 79 | QDateTime CSticky::GetModifyTime() 80 | { 81 | return m_tmModify; 82 | } 83 | 84 | int CSticky::SetCreateTime() 85 | { 86 | m_tmCreate = QDateTime::currentDateTime(); 87 | emit sigUpdate(); 88 | return 0; 89 | } 90 | 91 | QDateTime CSticky::GetCreateTime() 92 | { 93 | return m_tmCreate; 94 | } 95 | 96 | CSticky::POLICY CSticky::GetPolicy() 97 | { 98 | return m_Policy; 99 | } 100 | 101 | int CSticky::SetPolicy(POLICY p) 102 | { 103 | m_Policy = p; 104 | emit sigUpdate(); 105 | return 0; 106 | } 107 | 108 | int CSticky::SetWindowHide(bool bHide) 109 | { 110 | m_bWindowHide = bHide; 111 | emit sigUpdate(); 112 | return 0; 113 | } 114 | 115 | bool CSticky::GetWindowHide() 116 | { 117 | return m_bWindowHide; 118 | } 119 | 120 | #ifndef QT_NO_DATASTREAM 121 | QDataStream& operator<<(QDataStream &d, const CSticky &s) 122 | { 123 | d << s.m_nVersion; 124 | d << (int)s.m_Policy; 125 | return d << s.m_bWindowHide 126 | << s.m_WindowsPos 127 | << s.m_WindowSize 128 | << s.m_tmCreate 129 | << s.m_tmModify 130 | << s.m_szContent 131 | << s.m_szText; 132 | } 133 | 134 | QDataStream& operator>>(QDataStream &d, CSticky &s) 135 | { 136 | int p; 137 | d >> s.m_nVersion; 138 | d >> p; 139 | s.m_Policy = (CSticky::POLICY)p; 140 | d >> s.m_bWindowHide 141 | >> s.m_WindowsPos 142 | >> s.m_WindowSize 143 | >> s.m_tmCreate 144 | >> s.m_tmModify 145 | >> s.m_szContent 146 | >> s.m_szText; 147 | return d; 148 | } 149 | #endif 150 | -------------------------------------------------------------------------------- /Src/Sticky.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef STICKY_H 4 | #define STICKY_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class CSticky : public QObject 12 | { 13 | Q_OBJECT 14 | Q_PROPERTY(QString content READ GetContent WRITE SetContent) 15 | Q_PROPERTY(QString text READ GetText WRITE SetText) 16 | Q_PROPERTY(QDateTime time READ GetModifyTime) 17 | Q_PROPERTY(QDateTime time READ GetCreateTime) 18 | Q_PROPERTY(bool windowHide READ GetWindowHide WRITE SetWindowHide) 19 | 20 | public: 21 | explicit CSticky(QObject *parent = nullptr); 22 | CSticky(const CSticky &s); 23 | virtual ~CSticky(); 24 | 25 | #ifndef QT_NO_DATASTREAM 26 | friend QDataStream& operator<<(QDataStream &d, const CSticky &s); 27 | friend QDataStream& operator>>(QDataStream &d, CSticky &s); 28 | #endif 29 | 30 | int SetContent(const QString &szContent); 31 | QString GetContent(); 32 | int SetText(const QString &szText); 33 | QString GetText(); 34 | int SetWindows(const QPoint &pos, const QSize &size); 35 | int GetWindows(QPoint &pos, QSize &size); 36 | int SetWindowHide(bool bHide = true); 37 | bool GetWindowHide(); 38 | QDateTime GetModifyTime(); 39 | QDateTime GetCreateTime(); 40 | 41 | enum POLICY 42 | { 43 | normal, 44 | priority, 45 | delay 46 | }; 47 | int SetPolicy(POLICY p); 48 | POLICY GetPolicy(); 49 | 50 | Q_SIGNALS: 51 | void sigRemove(QSharedPointer); 52 | void sigUpdate(); 53 | 54 | private: 55 | int SetModifyTime(); 56 | int SetCreateTime(); 57 | 58 | private: 59 | QString m_szContent; //include QTextEdit::toHtml 60 | QString m_szText; //include QTextEdit::toPlainText 61 | QPoint m_WindowsPos; 62 | QSize m_WindowSize; 63 | bool m_bWindowHide; 64 | QDateTime m_tmModify, m_tmCreate; 65 | POLICY m_Policy; 66 | qint8 m_nVersion; 67 | }; 68 | 69 | Q_DECLARE_METATYPE(CSticky) 70 | #endif // STICKY_H 71 | -------------------------------------------------------------------------------- /Src/StickyItemDelegate.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "StickyItemDelegate.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | CStickyItemDelegate::CStickyItemDelegate(QObject *parent) : QStyledItemDelegate(parent) 12 | { 13 | } 14 | 15 | QWidget *CStickyItemDelegate::createEditor(QWidget *parent, 16 | const QStyleOptionViewItem &option, 17 | const QModelIndex &index) const 18 | { 19 | if(index.isValid()) { 20 | QTextEdit *textedit = new QTextEdit(parent); 21 | textedit->setReadOnly(true); 22 | return textedit; 23 | } else { 24 | return QStyledItemDelegate::createEditor(parent,option,index); 25 | } 26 | } 27 | 28 | void CStickyItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const 29 | { 30 | if(index.isValid() && editor) { 31 | QTextEdit *pEdit = static_cast(editor); 32 | pEdit->setHtml(index.model()->data(index, Qt::EditRole).toString()); 33 | } else { 34 | QStyledItemDelegate::setEditorData(editor,index); 35 | } 36 | } 37 | 38 | void CStickyItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const 39 | { 40 | if(index.isValid() && editor && model) { 41 | QTextEdit* pEdit = static_cast(editor); 42 | model->setData(index, pEdit->toHtml(), Qt::EditRole); 43 | } else { 44 | QStyledItemDelegate::setModelData(editor, model, index); 45 | } 46 | } 47 | 48 | void CStickyItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const 49 | { 50 | painter->save(); 51 | 52 | QTextEdit e; 53 | //e.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); 54 | e.setHtml(index.data(Qt::EditRole).toString()); 55 | //QVariant background = index.model()->data(index, Qt::BackgroundRole); 56 | //QVariant front = index.model()->data(index, Qt::ForegroundRole); 57 | painter->setBrush(option.backgroundBrush); 58 | painter->translate(option.rect.topLeft()); 59 | e.resize(option.rect.size()); 60 | e.render(painter); 61 | 62 | painter->restore(); 63 | } 64 | 65 | QSize CStickyItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const 66 | { 67 | QTextEdit e; 68 | e.setHtml(index.data(Qt::EditRole).toString()); 69 | QMargins cm = e.contentsMargins(); 70 | int marginW = e.style()->pixelMetric( 71 | QStyle::PM_FocusFrameHMargin) << 1; 72 | int marginH = e.style()->pixelMetric( 73 | QStyle::PM_FocusFrameVMargin) << 1; 74 | QSize s = option.rect.size(); 75 | s.setHeight(option.fontMetrics.boundingRect(e.toPlainText()).height() 76 | + cm.top() + cm.bottom() + marginH); 77 | return s; 78 | } 79 | 80 | //void CStickyItemDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const 81 | //{ 82 | // if(index.isValid() && editor) { 83 | 84 | // } else { 85 | // QStyledItemDelegate::updateEditorGeometry(editor, option, index); 86 | // } 87 | //} 88 | -------------------------------------------------------------------------------- /Src/StickyItemDelegate.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef STIKYITEMDELEGATE_H 4 | #define STIKYITEMDELEGATE_H 5 | 6 | #include 7 | 8 | class CStickyItemDelegate : public QStyledItemDelegate 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit CStickyItemDelegate(QObject *parent = nullptr); 13 | 14 | virtual QWidget *createEditor(QWidget *parent, 15 | const QStyleOptionViewItem &option, 16 | const QModelIndex &index) const override; 17 | virtual void setEditorData(QWidget *editor, const QModelIndex &index) const override; 18 | virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override; 19 | virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; 20 | virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; 21 | 22 | //void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; 23 | }; 24 | 25 | #endif // STIKYITEMDELEGATE_H 26 | -------------------------------------------------------------------------------- /Src/StickyModel.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef CSTRICKYMODEL_H 4 | #define CSTRICKYMODEL_H 5 | 6 | #include 7 | #include 8 | #include "Sticky.h" 9 | 10 | class CStickyModel : public QAbstractListModel 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit CStickyModel(QObject *parent = nullptr); 16 | int Clean(); 17 | 18 | public Q_SLOTS: 19 | bool IsModify(); 20 | int SetModify(bool bModify = true); 21 | QSharedPointer Add(); 22 | QSharedPointer Get(int index); 23 | private Q_SLOTS: 24 | void slotDelete(QSharedPointer s); 25 | void slotModify(); 26 | public: 27 | // Header: 28 | QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; 29 | // Basic functionality: 30 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; 31 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; 32 | bool setData(const QModelIndex &index, const QVariant &value, int role) override; 33 | Qt::ItemFlags flags(const QModelIndex &index) const override; 34 | bool removeRows(int row, int count, const QModelIndex &parent) override; 35 | 36 | #ifndef QT_NO_DATASTREAM 37 | friend QDataStream& operator<<(QDataStream &d, const CStickyModel &s); 38 | friend QDataStream& operator>>(QDataStream &d, CStickyModel &s); 39 | #endif 40 | 41 | private: 42 | QList > m_Stickys; 43 | bool m_bModify; 44 | 45 | void internalUpdate(); 46 | }; 47 | 48 | #endif // CSTRICKYMODEL_H 49 | -------------------------------------------------------------------------------- /Src/TaskCycleWeek.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "TaskCycleWeek.h" 4 | 5 | CTaskCycleWeek::CTaskCycleWeek(QObject *parent) : CTask(parent) 6 | { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Src/TaskCycleWeek.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef TASKCYCLEWEEK_H 4 | #define TASKCYCLEWEEK_H 5 | 6 | #include 7 | #include "Task.h" 8 | 9 | class CTaskCycleWeek : public CTask 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit CTaskCycleWeek(QObject *parent = nullptr); 14 | 15 | signals: 16 | 17 | public slots: 18 | }; 19 | 20 | #endif // TASKCYCLEWEEK_H 21 | -------------------------------------------------------------------------------- /Src/TaskDay.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "TaskDay.h" 4 | 5 | CTaskDay::CTaskDay(QObject *parent) : CTaskPromptDelay(parent) 6 | { 7 | 8 | } 9 | 10 | int CTaskDay::Init() 11 | { 12 | setObjectName("TaskDay"); 13 | return 0; 14 | } 15 | 16 | int CTaskDay::onStart() 17 | { 18 | return 0; 19 | } 20 | 21 | int CTaskDay::onRun() 22 | { 23 | return 0; 24 | } 25 | 26 | int CTaskDay::Start() 27 | { 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /Src/TaskDay.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef TASKDAY_H 4 | #define TASKDAY_H 5 | 6 | #include 7 | #include "TaskPromptDelay.h" 8 | 9 | class CTaskDay : public CTaskPromptDelay 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit CTaskDay(QObject *parent = nullptr); 14 | 15 | virtual int Start() override; 16 | virtual int onStart() override; 17 | virtual int onRun() override; 18 | 19 | public slots: 20 | 21 | private: 22 | int Init(); 23 | 24 | QDateTime m_StartTime, m_EndTime; 25 | QDateTime m_ActualStartTime, m_ActualEndTime; 26 | 27 | }; 28 | 29 | #endif // TASKDAY_H 30 | -------------------------------------------------------------------------------- /Src/TaskLockScreen.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "TaskLockScreen.h" 4 | #include 5 | #include 6 | #include "Global/TasksTools.h" 7 | 8 | #if defined(Q_OS_WIN) 9 | LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam) 10 | { 11 | if (nCode == HC_ACTION) 12 | { 13 | return 1; 14 | } 15 | return CallNextHookEx(NULL, nCode, wParam, lParam); 16 | } 17 | 18 | LRESULT CALLBACK LowLevelMouseProc( 19 | _In_ int nCode, 20 | _In_ WPARAM wParam, 21 | _In_ LPARAM lParam 22 | ) 23 | { 24 | if (nCode == HC_ACTION) 25 | { 26 | return 1; 27 | } 28 | return CallNextHookEx(NULL, nCode, wParam, lParam); 29 | } 30 | #endif 31 | 32 | static int gTypeIdCTaskLockScreen = qRegisterMetaType(); 33 | 34 | CTaskLockScreen::CTaskLockScreen(QObject* parent) : CTaskPrompt(parent) 35 | { 36 | Init(); 37 | SetTitle(tr("Reset")); 38 | SetInterval(15 * 60 * 1000); 39 | } 40 | 41 | CTaskLockScreen::CTaskLockScreen(int nInterval, 42 | int nPromptInterval, 43 | QObject *parent) 44 | : CTaskPrompt(tr("Lock screen and reset"), 45 | tr("Reset"), nInterval, nPromptInterval, parent) 46 | { 47 | Init(); 48 | } 49 | 50 | CTaskLockScreen::CTaskLockScreen(const CTaskLockScreen &t) 51 | { 52 | Q_UNUSED(t); 53 | } 54 | 55 | int CTaskLockScreen::Init() 56 | { 57 | setObjectName("TaskLockScreen"); 58 | #if defined(Q_OS_WIN) 59 | m_hKeyboardHook = NULL; 60 | m_hMouseHook = NULL; 61 | #endif 62 | return 0; 63 | } 64 | 65 | QString CTaskLockScreen::GetDescription() const 66 | { 67 | return tr("Lock screen"); 68 | } 69 | 70 | void CTaskLockScreen::slotShow() 71 | { 72 | if(nullptr == m_FullScreen.data()) 73 | { 74 | m_FullScreen = QSharedPointer(new CFrmFullScreen()); 75 | } 76 | if(m_FullScreen) 77 | m_FullScreen->showFullScreen(); 78 | 79 | #if defined(Q_OS_WIN) 80 | if(NULL == m_hKeyboardHook) 81 | m_hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, 82 | (HOOKPROC)KeyboardHookProc, 83 | (HINSTANCE)GetModuleHandle(NULL), 84 | 0); 85 | if(NULL == m_hMouseHook) 86 | m_hMouseHook = SetWindowsHookEx(WH_MOUSE_LL, 87 | (HOOKPROC)LowLevelMouseProc, 88 | (HINSTANCE)GetModuleHandle(NULL), 89 | 0); 90 | #endif 91 | slotUpdate(); 92 | } 93 | 94 | void CTaskLockScreen::slotClose() 95 | { 96 | #if defined(Q_OS_WIN) 97 | if(m_hKeyboardHook) 98 | { 99 | BOOL bFlag = UnhookWindowsHookEx(m_hKeyboardHook); 100 | if(bFlag) m_hKeyboardHook = NULL; 101 | } 102 | if(m_hMouseHook) 103 | { 104 | BOOL bFlag = UnhookWindowsHookEx(m_hMouseHook); 105 | if(bFlag) m_hMouseHook = NULL; 106 | } 107 | #elif defined(Q_OS_LINUX) 108 | //TODO: linux 109 | //https://www.x.org/releases/X11R7.7/doc/libX11/XKB/xkblib.html#Core_X_Protocol_Support_for_Keyboards 110 | #endif 111 | 112 | //如果是屏保,则结束 113 | CTasksTools::ScreenPower(false); 114 | 115 | if(m_FullScreen) 116 | { 117 | m_FullScreen->close(); 118 | m_FullScreen.clear(); 119 | } 120 | } 121 | 122 | void CTaskLockScreen::slotUpdate() 123 | { 124 | QTime tm(0, 0); 125 | tm = tm.addMSecs(Remaining()); 126 | if(m_FullScreen) 127 | m_FullScreen->Prompt(GetContent() + "\n" + tr("Remaining: %1") 128 | .arg(tm.toString("HH:mm:ss")), 129 | Remaining(), 130 | 0, 131 | GetInterval(), 132 | true 133 | ); 134 | } 135 | -------------------------------------------------------------------------------- /Src/TaskLockScreen.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef TASKLOCKSCEEN_H 4 | #define TASKLOCKSCEEN_H 5 | 6 | #pragma once 7 | 8 | #include "TaskPrompt.h" 9 | #include "FrmFullScreen.h" 10 | 11 | #include 12 | #include 13 | 14 | #if defined(Q_OS_WIN) 15 | #include 16 | #endif 17 | 18 | class CTaskLockScreen : public CTaskPrompt 19 | { 20 | Q_OBJECT 21 | public: 22 | explicit CTaskLockScreen(QObject* parent); 23 | /** 24 | * @brief CTaskLockScreen 25 | * @param nInterval: unlocak. in milliseconds 26 | * @param nPromptInterval 27 | * @param parent 28 | */ 29 | explicit CTaskLockScreen(int nInterval = 15 * 60 * 1000, 30 | int nPromptInterval = 1000, 31 | QObject *parent = nullptr); 32 | CTaskLockScreen(const CTaskLockScreen &t); 33 | virtual QString GetDescription() const override; 34 | 35 | protected Q_SLOTS: 36 | virtual void slotShow() override; 37 | virtual void slotClose() override; 38 | virtual void slotUpdate() override; 39 | 40 | private: 41 | int Init(); 42 | 43 | #if defined(Q_OS_WIN) 44 | HHOOK m_hKeyboardHook; 45 | HHOOK m_hMouseHook; 46 | #endif 47 | QSharedPointer m_FullScreen; 48 | }; 49 | 50 | Q_DECLARE_METATYPE(CTaskLockScreen) 51 | 52 | #endif // TASKLOCKSCEEN_H 53 | -------------------------------------------------------------------------------- /Src/TaskPrompt.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "TaskPrompt.h" 4 | #include 5 | 6 | static int gTypeIdCTaskPrompt = qRegisterMetaType(); 7 | 8 | CTaskPrompt::CTaskPrompt(QObject *parent) : CTask(parent) 9 | { 10 | Init(); 11 | SetTitle(objectName()); 12 | SetTitle(GetTitle()); 13 | SetInterval(5 * 60 * 1000); 14 | SetPromptInterval(1000); 15 | } 16 | 17 | CTaskPrompt::CTaskPrompt(const QString szContent, const QString szTitle, 18 | int nInterval, 19 | int nPromptInterval, 20 | QObject *parent) 21 | : CTask (nInterval, nPromptInterval, parent) 22 | { 23 | Init(); 24 | SetTitle(szTitle); 25 | SetContent(szContent); 26 | } 27 | 28 | CTaskPrompt::CTaskPrompt(const CTaskPrompt &t) 29 | { 30 | Q_UNUSED(t); 31 | } 32 | 33 | void CTaskPrompt::Init() 34 | { 35 | setObjectName("TaskPrompt"); 36 | bool check = connect(this, SIGNAL(sigShow()), 37 | this, SLOT(slotShow())); 38 | Q_ASSERT(check); 39 | check = connect(this, SIGNAL(sigClose()), 40 | this, SLOT(slotClose())); 41 | Q_ASSERT(check); 42 | check = connect(this, SIGNAL(sigUpdate()), 43 | this, SLOT(slotUpdate())); 44 | Q_ASSERT(check); 45 | } 46 | 47 | QString CTaskPrompt::GetDescription() const 48 | { 49 | return tr("Prompt task, Only prompt."); 50 | } 51 | 52 | int CTaskPrompt::onStart() 53 | { 54 | emit sigShow(); 55 | return 0; 56 | } 57 | 58 | int CTaskPrompt::onRun() 59 | { 60 | emit sigClose(); 61 | return 0; 62 | } 63 | 64 | void CTaskPrompt::slotPrompt() 65 | { 66 | emit sigUpdate(); 67 | } 68 | 69 | void CTaskPrompt::slotShow() 70 | { 71 | slotPrompt(); 72 | m_Top.show(); 73 | } 74 | 75 | void CTaskPrompt::slotClose() 76 | { 77 | m_Top.close(); 78 | } 79 | 80 | void CTaskPrompt::slotUpdate() 81 | { 82 | m_Top.SetText(GetContent() + "\n" + tr("Remaining: ") + szRemaining()); 83 | } 84 | -------------------------------------------------------------------------------- /Src/TaskPrompt.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef TASKPROMPT_H_KL 4 | #define TASKPROMPT_H_KL 5 | 6 | #pragma once 7 | 8 | #include "Task.h" 9 | #include "FrmTop.h" 10 | 11 | class CTaskPrompt : public CTask 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit CTaskPrompt(QObject *parent = nullptr); 17 | explicit CTaskPrompt(const QString szContent, 18 | const QString szTitle = tr("Prompt"), 19 | int nInterval = 5 * 60 * 1000, 20 | int nPromptInterval = 1000, 21 | QObject *parent = nullptr); 22 | CTaskPrompt(const CTaskPrompt &t); 23 | virtual QString GetDescription() const override; 24 | 25 | protected: 26 | virtual int onStart() override; 27 | virtual int onRun() override; 28 | 29 | Q_SIGNALS: 30 | void sigShow(); 31 | void sigClose(); 32 | void sigUpdate(); 33 | 34 | protected Q_SLOTS: 35 | virtual void slotPrompt() override; 36 | virtual void slotShow(); 37 | virtual void slotClose(); 38 | virtual void slotUpdate(); 39 | 40 | private: 41 | void Init(); 42 | 43 | protected: 44 | CFrmTop m_Top; 45 | }; 46 | 47 | Q_DECLARE_METATYPE(CTaskPrompt) 48 | #endif // TASKPROMPT_H_KL 49 | -------------------------------------------------------------------------------- /Src/TaskPromptDelay.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef TASKPROMPTDELAY_H 4 | #define TASKPROMPTDELAY_H 5 | 6 | #include "TaskPrompt.h" 7 | 8 | class CTaskPromptDelay : public CTaskPrompt 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit CTaskPromptDelay(QObject *parent = nullptr); 13 | explicit CTaskPromptDelay(const QString szContent, 14 | const QString szTitle = tr("PromptDelay"), 15 | int nInterval = 5 * 60 * 1000, 16 | int nPromptInterval = 1000, 17 | QObject *parent = nullptr); 18 | CTaskPromptDelay(const CTaskPromptDelay &task); 19 | 20 | virtual QString GetDescription() const override; 21 | 22 | /** 23 | * @brief Check if the task can run 24 | * @return : 0, The task is finished. other, The task is continue. 25 | */ 26 | virtual int Check() override; 27 | virtual int onStart() override; 28 | 29 | private Q_SLOTS: 30 | void slotDelay5Minute(bool checked); 31 | void slotDelayCustomize(bool checked); 32 | 33 | private: 34 | int Init(); 35 | int AddDelay(int nMinute); 36 | 37 | bool m_bStop; 38 | QMenu m_Menu; 39 | 40 | QVector > m_Delay; 41 | }; 42 | 43 | Q_DECLARE_METATYPE(CTaskPromptDelay) 44 | #endif // TASKPROMPTDELAY_H 45 | -------------------------------------------------------------------------------- /Src/TaskPromptDelay1.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "TaskPromptDelay.h" 4 | #include 5 | 6 | static int gTypeIdCTaskPromptDelay = qRegisterMetaType(); 7 | 8 | CTaskPromptDelay::CTaskPromptDelay(QObject* parent) : CTaskPrompt (parent) 9 | { 10 | Init(); 11 | } 12 | 13 | CTaskPromptDelay::CTaskPromptDelay(const QString szText, 14 | const QString szTitle, 15 | int nInterval, 16 | int nPromptInterval, 17 | QObject *parent) 18 | : CTaskPrompt (szText, szTitle, nInterval, nPromptInterval, parent) 19 | { 20 | Init(); 21 | } 22 | 23 | CTaskPromptDelay::CTaskPromptDelay(const CTaskPromptDelay &task) 24 | { 25 | Q_UNUSED(task); 26 | } 27 | 28 | int CTaskPromptDelay::Init() 29 | { 30 | m_bStop = false; 31 | setObjectName("TaskPromptDelay"); 32 | SetTitle(objectName()); 33 | /*m_Menu.addAction(QIcon(":/icon/Close"), tr("Close"), 34 | &m_Top, SLOT(close())); 35 | m_Menu.addAction(tr("Delay 5 Minute"), 36 | this, SLOT(slotDelay5Minute(bool)));*/ 37 | m_Top.SetPopupMenu(&m_Menu); 38 | return 0; 39 | } 40 | 41 | int CTaskPromptDelay::SaveSettings(QDomElement &e) 42 | { 43 | Q_UNUSED(e); 44 | return 0; 45 | } 46 | 47 | QString CTaskPromptDelay::GetDescription() const 48 | { 49 | return tr("Delayable task. the task can be delayed."); 50 | } 51 | 52 | int CTaskPromptDelay::Check() 53 | { 54 | int nRet = -1; 55 | 56 | if(m_bStop) 57 | { 58 | if(m_Delay.isEmpty()) 59 | return 0; 60 | nRet = m_Delay.first()->Check(); 61 | if(nRet) 62 | return nRet; 63 | m_Delay.pop_front(); 64 | return -1; 65 | } 66 | 67 | if(GetInterval() < Elapsed()) 68 | { 69 | m_bStop = true; 70 | m_PromptTimer.stop(); 71 | if(!m_szRunSound.isEmpty()) 72 | QSound::play(m_szRunSound); 73 | nRet = onRun(); 74 | //TODO: weather check the nRet? 75 | if(m_Delay.isEmpty()) 76 | return nRet; 77 | m_Delay.first()->Start(); 78 | return -1; 79 | } 80 | return nRet; 81 | } 82 | 83 | void CTaskPromptDelay::slotDelay5Minute(bool checked) 84 | { 85 | Q_UNUSED(checked); 86 | AddDelay(5); 87 | } 88 | 89 | int CTaskPromptDelay::AddDelay(int nMinute) 90 | { 91 | m_Top.close(); 92 | CTaskPromptDelay *p = 93 | new CTaskPromptDelay( 94 | GetContent(), 95 | GetTitle(), 96 | nMinute * 60 * 1000, 97 | GetPromptInterval()); 98 | // QSharedPointer t(p); 99 | //m_Delay.append(QSharedPointer(p)); 100 | return 0; 101 | } 102 | -------------------------------------------------------------------------------- /Src/TaskPromptDelay1.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef TASKPROMPTDELAY_H 4 | #define TASKPROMPTDELAY_H 5 | 6 | #pragma once 7 | #include "TaskPrompt.h" 8 | 9 | class CTaskPromptDelay : CTaskPrompt 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit CTaskPromptDelay(QObject* parent = nullptr); 15 | explicit CTaskPromptDelay(const QString szText, 16 | const QString szTitle = tr("Prompt"), 17 | int nInterval = 5 * 60 * 1000, 18 | int nPromptInterval = 1000, 19 | QObject *parent = nullptr); 20 | CTaskPromptDelay(const CTaskPromptDelay &task); 21 | 22 | virtual QString GetDescription() const override; 23 | virtual int SaveSettings(QDomElement &e) override; 24 | 25 | /** 26 | * @brief Check if the task can run 27 | * @return : 0, The task is finished. other, The task is continue. 28 | */ 29 | virtual int Check() override; 30 | 31 | private Q_SLOTS: 32 | void slotDelay5Minute(bool checked); 33 | 34 | private: 35 | int Init(); 36 | 37 | bool m_bStop; 38 | QMenu m_Menu; 39 | 40 | QVector > m_Delay; 41 | int AddDelay(int nMinute); 42 | }; 43 | 44 | Q_DECLARE_METATYPE(CTaskPromptDelay) 45 | #endif // TASKPROMPTDELAY_H 46 | -------------------------------------------------------------------------------- /Src/TaskTrayIconPrompt.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "TaskTrayIconPrompt.h" 4 | #include 5 | 6 | CTaskTrayIconPrompt::CTaskTrayIconPrompt(QObject *parent) 7 | : CTask(parent), 8 | m_TrayIcon(this) 9 | { 10 | m_Icon = QIcon(":/icon/app"); 11 | Init(); 12 | } 13 | 14 | CTaskTrayIconPrompt::CTaskTrayIconPrompt(const QString szMessage, 15 | const QString szTitle, 16 | int nInterval, 17 | int nPromptInterval, 18 | const QIcon icon, 19 | QObject *parent) 20 | : CTask(nInterval, nPromptInterval, parent), 21 | m_TrayIcon(this) 22 | { 23 | m_szMessage = szMessage; 24 | m_szTitle = szTitle; 25 | m_Icon = icon; 26 | Init(); 27 | } 28 | 29 | int CTaskTrayIconPrompt::Init() 30 | { 31 | setObjectName(tr("Tray icon prompt")); 32 | 33 | /*bool check = connect(&m_TrayIcon, 34 | SIGNAL(activated(QSystemTrayIcon::ActivationReason)), 35 | SLOT(slotTrayIconActive(QSystemTrayIcon::ActivationReason))); 36 | Q_ASSERT(check); 37 | 38 | QAction* pExit = m_TrayIconMenu.addAction( 39 | QIcon(":/icons/close"), 40 | tr("Exit"));*/ 41 | 42 | //m_TrayIcon.setContextMenu(&m_TrayIconMenu); 43 | m_TrayIcon.setIcon(m_Icon); 44 | 45 | return 0; 46 | } 47 | 48 | void CTaskTrayIconPrompt::slotPrompt() 49 | { 50 | if(QSystemTrayIcon::isSystemTrayAvailable()) 51 | { 52 | QTime tm(0, 0); 53 | tm = tm.addMSecs(Remaining()); 54 | QString szRemaining = m_szMessage + "\n" 55 | + "Remaining: " + tm.toString("HH:mm:ss"); 56 | if(Remaining() > 10000) 57 | m_TrayIcon.showMessage(m_szTitle, szRemaining); 58 | else if(Remaining() > 3000) 59 | m_TrayIcon.showMessage(m_szTitle, szRemaining, QSystemTrayIcon::Information, 1000); 60 | else 61 | qDebug() << "Title: " << m_szTitle << "Remaining: " << szRemaining; 62 | } 63 | } 64 | 65 | int CTaskTrayIconPrompt::onStart() 66 | { 67 | int nRet = 0; 68 | if(QSystemTrayIcon::isSystemTrayAvailable()) 69 | { 70 | //m_TrayIcon.show(); 71 | slotPrompt(); 72 | } 73 | return nRet; 74 | } 75 | 76 | int CTaskTrayIconPrompt::onRun() 77 | { 78 | int nRet = 0; 79 | m_TrayIcon.hide(); 80 | return nRet; 81 | } 82 | 83 | void CTaskTrayIconPrompt::slotTrayIconActive(QSystemTrayIcon::ActivationReason reason) 84 | { 85 | Q_UNUSED(reason); 86 | } 87 | -------------------------------------------------------------------------------- /Src/TaskTrayIconPrompt.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef TASKTRAYICONPROMPT_H 4 | #define TASKTRAYICONPROMPT_H 5 | 6 | #pragma once 7 | 8 | #include "Task.h" 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | class CTaskTrayIconPrompt : public CTask 17 | { 18 | Q_OBJECT 19 | public: 20 | CTaskTrayIconPrompt(QObject *parent = nullptr); 21 | CTaskTrayIconPrompt(const QString szMessage, 22 | const QString szTitle = tr("Prompt"), 23 | int nInterval = 5 * 60 * 1000, 24 | int nPromptInterval = 60 * 1000, 25 | const QIcon icon = QIcon(":/icon/App"), 26 | QObject *parent = nullptr); 27 | 28 | protected: 29 | virtual int onRun(); 30 | virtual int onStart(); 31 | 32 | protected Q_SLOTS: 33 | virtual void slotPrompt(); 34 | void slotTrayIconActive(QSystemTrayIcon::ActivationReason reason); 35 | 36 | private: 37 | QMenu m_TrayIconMenu; 38 | QSystemTrayIcon m_TrayIcon; 39 | QString m_szTitle; 40 | QString m_szMessage; 41 | QIcon m_Icon; 42 | 43 | int Init(); 44 | }; 45 | 46 | #endif // TASKTRAYICONPROMPT_H 47 | -------------------------------------------------------------------------------- /Src/Tasks.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef TASKS_H 4 | #define TASKS_H 5 | 6 | #pragma once 7 | 8 | #include 9 | #include "Task.h" 10 | #include 11 | #include 12 | 13 | /** 14 | * @brief Define a serial task 15 | */ 16 | class CTasks : public QObject 17 | { 18 | Q_OBJECT 19 | Q_PROPERTY(int id READ GetId WRITE SetId) 20 | Q_PROPERTY(bool enable READ GetEnable WRITE SetEnable) 21 | Q_PROPERTY(QString title READ GetTitle WRITE SetTitle) 22 | Q_PROPERTY(QString content READ GetContent WRITE SetContent) 23 | Q_PROPERTY(bool end READ End) 24 | Q_PROPERTY(int length READ Length) 25 | Q_PROPERTY(int currentIndex READ GetCurrentIndex) 26 | Q_PROPERTY(QIcon icon READ GetIcon WRITE SetIcon) 27 | 28 | public: 29 | Q_INVOKABLE explicit CTasks(QObject *parent = nullptr); 30 | CTasks(const CTasks &tasks); 31 | virtual ~CTasks(); 32 | 33 | Q_INVOKABLE int GetId(); 34 | Q_INVOKABLE int SetId(int id); 35 | Q_INVOKABLE virtual bool GetEnable() const; 36 | Q_INVOKABLE virtual int SetEnable(bool bEnable); 37 | Q_INVOKABLE int SetTitle(const QString &szTitle); 38 | Q_INVOKABLE QString GetTitle(); 39 | Q_INVOKABLE int SetContent(const QString &szContent); 40 | Q_INVOKABLE QString GetContent(); 41 | Q_INVOKABLE int SetIcon(QIcon icon); 42 | Q_INVOKABLE QIcon GetIcon(); 43 | Q_INVOKABLE bool End(); 44 | 45 | Q_INVOKABLE virtual int Add(QSharedPointer task); 46 | Q_INVOKABLE virtual int Insert(QSharedPointer task, int nIndex); 47 | /*Q_INVOKABLE virtual int InsertAfter(QSharedPointer newTask, 48 | QSharedPointer task = QSharedPointer());//*/ 49 | Q_INVOKABLE virtual int Remove(QSharedPointer task); 50 | 51 | Q_INVOKABLE virtual QSharedPointer Get(int nIdTask); 52 | /** 53 | * @brief Get current task 54 | * @return 55 | */ 56 | Q_INVOKABLE virtual QSharedPointer GetCurrent(); 57 | virtual QSharedPointer GetIndex(int nIndex); 58 | Q_INVOKABLE virtual int GetCurrentIndex(); 59 | Q_INVOKABLE virtual int Length(); 60 | 61 | typedef QVector >::iterator POSITION; 62 | POSITION GetFirst(); 63 | QSharedPointer GetNext(POSITION &pos); 64 | 65 | /** 66 | * @brief Start: Initialize here 67 | * @return 68 | */ 69 | Q_INVOKABLE virtual int Start(); 70 | /** 71 | * @brief Check the current task is run 72 | * @return 73 | */ 74 | Q_INVOKABLE virtual int Check(); 75 | 76 | virtual int LoadSettings(const QDomElement &e); 77 | virtual int SaveSettings(QDomElement &e); 78 | 79 | private: 80 | int m_CurrentPostion; 81 | QVector > m_Task; 82 | int m_nIdTask; 83 | int m_nId; 84 | bool m_bEnable; 85 | QString m_szTitle; 86 | QString m_szContent; 87 | QIcon m_Icon; 88 | }; 89 | 90 | Q_DECLARE_METATYPE(CTasks) 91 | 92 | #endif // TASKS_H 93 | -------------------------------------------------------------------------------- /Src/Tasks.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "../App/AppIcon.ico" 2 | -------------------------------------------------------------------------------- /Src/TasksList.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef TASLIST_H 4 | #define TASLIST_H 5 | 6 | #pragma once 7 | 8 | #include 9 | #include "Tasks.h" 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | /** 16 | * @brief Define parallel tasks 17 | */ 18 | class CTasksList : public QObject 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | explicit CTasksList(QObject *parent = nullptr); 24 | virtual ~CTasksList(); 25 | 26 | int Add(QSharedPointer tasks); 27 | int Remove(QSharedPointer tasks); 28 | int RemoveAll(); 29 | 30 | typedef QMap >::iterator POSITION; 31 | POSITION GetFirst(); 32 | QSharedPointer GetNext(POSITION &pos); 33 | QSharedPointer Get(int nId); 34 | 35 | /* 36 | * @brief Start: Initialize here 37 | * @param nInterval: Check interval. 38 | * If is 0, disable check in the class. check by user 39 | * @param bForce: force restart 40 | * @return 41 | */ 42 | int Start(int nInterval = 1000, bool bForce = false); 43 | int Check(); 44 | 45 | virtual int LoadSettings(const QDomElement &e); 46 | virtual int LoadSettings(const QString &szFile = QString()); 47 | virtual int SaveSettings(QDomElement &e); 48 | virtual int SaveSettings(const QString &szFile = QString()); 49 | 50 | private Q_SLOTS: 51 | void slotTimeout(); 52 | 53 | private: 54 | 55 | private: 56 | QMap > m_Tasks; 57 | QTimer m_Timer; 58 | int m_nTimerInterval; 59 | int m_nIdCount; 60 | CThreadTasks m_Thread; 61 | bool m_bThread; 62 | }; 63 | 64 | #endif // TASLIST_H 65 | -------------------------------------------------------------------------------- /Src/ThreadTasks.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "ThreadTasks.h" 4 | #include 5 | #include 6 | #include "TasksList.h" 7 | 8 | CThreadTasks::CThreadTasks(CTasksList *parent) : QThread(), 9 | m_bExit(false), 10 | m_pTaskList(parent) 11 | { 12 | } 13 | 14 | CThreadTasks::~CThreadTasks() 15 | { 16 | } 17 | 18 | void CThreadTasks::run() 19 | { 20 | while(!m_bExit) 21 | { 22 | QThread::usleep(1000); 23 | m_pTaskList->Check(); 24 | } 25 | } 26 | 27 | int CThreadTasks::Quit() 28 | { 29 | m_bExit = true; 30 | quit(); 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /Src/ThreadTasks.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef CTHREADTASKS_H 4 | #define CTHREADTASKS_H 5 | 6 | #include 7 | 8 | class CTasksList; 9 | 10 | class CThreadTasks : public QThread 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit CThreadTasks(CTasksList *parent = nullptr); 16 | virtual ~CThreadTasks(); 17 | 18 | int Quit(); 19 | 20 | protected: 21 | virtual void run() override; 22 | 23 | private: 24 | bool m_bExit; 25 | CTasksList* m_pTaskList; 26 | 27 | }; 28 | 29 | #endif // CTHREADTASKS_H 30 | -------------------------------------------------------------------------------- /Src/ViewTaskProperty.cpp: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #include "ViewTaskProperty.h" 4 | #include 5 | #include 6 | 7 | CViewTaskProperty::CViewTaskProperty(QSharedPointer task, QWidget *parent) : QTableView (parent) 8 | { 9 | bool check = connect(&m_Model, SIGNAL(itemChanged(QStandardItem*)), 10 | this, SLOT(slotItemChange(QStandardItem*))); 11 | Q_ASSERT(check); 12 | setModel(&m_Model); 13 | 14 | m_Model.setColumnCount(2); 15 | m_Model.setHeaderData(0, Qt::Horizontal, tr("Property")); 16 | m_Model.setHeaderData(1, Qt::Horizontal, tr("Value")); 17 | 18 | m_Task = task; 19 | SetProperty(m_Task); 20 | } 21 | 22 | int CViewTaskProperty::SetProperty(QSharedPointer task) 23 | { 24 | int nRet = 0; 25 | 26 | if(!task) 27 | { 28 | qWarning() << "CFrmTaskPropery::InitProperty: task is null"; 29 | return -1; 30 | } 31 | m_Task = task; 32 | const QMetaObject* pObj = task->metaObject(); 33 | int nCount = pObj->propertyCount(); 34 | for(int i = 0; i < nCount; i++) 35 | { 36 | QMetaProperty p = pObj->property(i); 37 | QStandardItem *pName = new QStandardItem(p.name()); 38 | pName->setEditable(false); 39 | QStandardItem *pValue = new QStandardItem(p.read(task.data()).toString()); 40 | if(p.isWritable()) 41 | pValue->setEnabled(true); 42 | else 43 | pValue->setEditable(false); 44 | 45 | QList lstItems; 46 | lstItems.push_back(pName); 47 | lstItems.push_back(pValue); 48 | m_Model.appendRow(lstItems); 49 | } 50 | return nRet; 51 | } 52 | 53 | void CViewTaskProperty::slotItemChange(QStandardItem *item) 54 | { 55 | QModelIndex index = item->index(); 56 | QModelIndex i = item->model()->index(index.row(), 0); 57 | QVariant name = item->model()->data(i, Qt::DisplayRole); 58 | QVariant value = item->data(Qt::DisplayRole); 59 | if(m_Task) 60 | { 61 | //qDebug() << "name:" << name << "value:" << value; 62 | m_Task->setProperty(name.toString().toStdString().c_str(), value); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Src/ViewTaskProperty.h: -------------------------------------------------------------------------------- 1 | // 作者:康林 2 | 3 | #ifndef VIEWTASKPROPERTY_H 4 | #define VIEWTASKPROPERTY_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "Task.h" 11 | 12 | class CViewTaskProperty : public QTableView 13 | { 14 | Q_OBJECT 15 | public: 16 | CViewTaskProperty(QSharedPointer task = QSharedPointer(), 17 | QWidget *parent = nullptr); 18 | 19 | int SetProperty(QSharedPointer task); 20 | 21 | private Q_SLOTS: 22 | void slotItemChange(QStandardItem* item); 23 | 24 | private: 25 | QStandardItemModel m_Model; 26 | QSharedPointer m_Task; 27 | 28 | 29 | }; 30 | 31 | #endif // VIEWTASKPROPERTY_H 32 | -------------------------------------------------------------------------------- /Src/export/tasks_export.h: -------------------------------------------------------------------------------- 1 | #ifndef TASKS_EXPORT_H 2 | #define TASKS_EXPORT_H 3 | 4 | #if defined (Q_OS_WIN) 5 | #include "tasks_export_windows.h" 6 | #endif 7 | 8 | #if defined(Q_OS_LINUX) 9 | #include "tasks_export_linux.h" 10 | #endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /Src/export/tasks_export_linux.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef TASKS_EXPORT_LINUX_H 3 | #define TASKS_EXPORT_LINUX_H 4 | 5 | #ifdef TASKS_STATIC_DEFINE 6 | # define TASKS_EXPORT 7 | # define TASKS_NO_EXPORT 8 | #else 9 | # ifndef TASKS_EXPORT 10 | # ifdef Tasks_EXPORTS 11 | /* We are building this library */ 12 | # define TASKS_EXPORT __attribute__((visibility("default"))) 13 | # else 14 | /* We are using this library */ 15 | # define TASKS_EXPORT __attribute__((visibility("default"))) 16 | # endif 17 | # endif 18 | 19 | # ifndef TASKS_NO_EXPORT 20 | # define TASKS_NO_EXPORT __attribute__((visibility("hidden"))) 21 | # endif 22 | #endif 23 | 24 | #ifndef TASKS_DEPRECATED 25 | # define TASKS_DEPRECATED __attribute__ ((__deprecated__)) 26 | #endif 27 | 28 | #ifndef TASKS_DEPRECATED_EXPORT 29 | # define TASKS_DEPRECATED_EXPORT TASKS_EXPORT TASKS_DEPRECATED 30 | #endif 31 | 32 | #ifndef TASKS_DEPRECATED_NO_EXPORT 33 | # define TASKS_DEPRECATED_NO_EXPORT TASKS_NO_EXPORT TASKS_DEPRECATED 34 | #endif 35 | 36 | #define DEFINE_NO_DEPRECATED 0 37 | #if DEFINE_NO_DEPRECATED 38 | # define TASKS_NO_DEPRECATED 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Src/export/tasks_export_windows.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef TASKS_EXPORT_WINDOWS_H 3 | #define TASKS_EXPORT_WINDOWS_H 4 | 5 | #ifdef TASKS_STATIC_DEFINE 6 | # define TASKS_EXPORT 7 | # define TASKS_NO_EXPORT 8 | #else 9 | # ifndef TASKS_EXPORT 10 | # ifdef Tasks_EXPORTS 11 | /* We are building this library */ 12 | # define TASKS_EXPORT __declspec(dllexport) 13 | # else 14 | /* We are using this library */ 15 | # define TASKS_EXPORT __declspec(dllimport) 16 | # endif 17 | # endif 18 | 19 | # ifndef TASKS_NO_EXPORT 20 | # define TASKS_NO_EXPORT 21 | # endif 22 | #endif 23 | 24 | #ifndef TASKS_DEPRECATED 25 | # define TASKS_DEPRECATED __declspec(deprecated) 26 | #endif 27 | 28 | #ifndef TASKS_DEPRECATED_EXPORT 29 | # define TASKS_DEPRECATED_EXPORT TASKS_EXPORT TASKS_DEPRECATED 30 | #endif 31 | 32 | #ifndef TASKS_DEPRECATED_NO_EXPORT 33 | # define TASKS_DEPRECATED_NO_EXPORT TASKS_NO_EXPORT TASKS_DEPRECATED 34 | #endif 35 | 36 | #if 0 /* DEFINE_NO_DEPRECATED */ 37 | # ifndef TASKS_NO_DEPRECATED 38 | # define TASKS_NO_DEPRECATED 39 | # endif 40 | #endif 41 | 42 | #endif /* TASKS_EXPORT_WINDOWS_H */ 43 | -------------------------------------------------------------------------------- /Update/update.json: -------------------------------------------------------------------------------- 1 | { 2 | "redirect": [ 3 | { 4 | "version":"v1.0.22" 5 | } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /Update/update.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | v1.0.18 4 | 5 | https://github.com/KangLin/Calendar/releases/download/v1.0.18/update_windows.xml 6 | https://sourceforge.net/projects/rabbitcalendar/files/v1.0.18/update_windows.xml/download 7 | 8 | 9 | https://github.com/KangLin/Calendar/releases/download/v1.0.18/update_linux.xml 10 | https://sourceforge.net/projects/rabbitcalendar/files/v1.0.18/update_linux.xml/download 11 | 12 | 13 | https://github.com/KangLin/Calendar/releases/download/v1.0.18/update_linux.xml 14 | https://sourceforge.net/projects/rabbitcalendar/files/v1.0.18/update_linux.xml/download 15 | 16 | 17 | -------------------------------------------------------------------------------- /Update/update_android.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 0 7 | android 8 | android 9 | armv7 10 | 11 | 12 | https://github.com/KangLin/Calendar 13 | v0.3.4 14 | 15 | -------------------------------------------------------------------------------- /Update/update_linux.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | v0.1.5 4 | 5 | Tasks v0.1.5 6 | 0 7 | Linux 8 | x86_64 9 | x86 10 | ec8a1e8c3b3dc78b5737c3cbfa1b9efe 11 | https://github.com/KangLin/Tasks/releases/download/v0.1.5/Tasks_v0.1.5.tar.gz 12 | https://github.com/KangLin/Tasks 13 | 0.0.1 14 | 15 | -------------------------------------------------------------------------------- /Update/update_windows.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | v0.1.5 4 | 5 | Tasks v0.1.5 6 | 0 7 | Windows 8 | x86 9 | x86 10 | a14088e793db91e16a3e8002a8388bec 11 | https://github.com/KangLin/Tasks/releases/download/v0.1.5/Tasks-Setup-v0.1.5.exe 12 | https://github.com/KangLin/Tasks 13 | 0.0.1 14 | 15 | -------------------------------------------------------------------------------- /cmake/Tasks.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | libdir=${prefix}/lib 3 | includedir=${prefix}/include/Tasks 4 | 5 | Name: @PROJECT_NAME@ 6 | Description: Tasks C++ library 7 | Version: @Calendar_VERSION@ 8 | Libs: -L${libdir} -lTasks 9 | Cflags: -I${includedir} @Tasks_DEFINITIONS_PC@ 10 | -------------------------------------------------------------------------------- /cmake/TasksConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # Author: KangLin(kl222@126.com) 2 | 3 | #.rst: 4 | # Tasks 5 | # -------- 6 | # 7 | # Find Tasks 8 | # 9 | # Find the Tasks libraries (asound) 10 | # 11 | # :: 12 | # 13 | # This module defines the following variables: 14 | # Tasks_FOUND - True if Tasks libraries are found 15 | # Tasks_LIBRARIES - Set when Tasks libraries is found 16 | # Tasks_INCLUDE_DIRS - where to find Tasks heard directory. 17 | # Tasks_DEFINITIONS - Set definitions 18 | # Tasks_VERSION_STRING - the version of Tasks found (since CMake 2.8.8) 19 | 20 | set(Tasks_VERSION_STRING @Calendar_VERSION@) 21 | 22 | find_package(PkgConfig) 23 | if(PKG_CONFIG_FOUND) 24 | pkg_check_modules(Tasks Tasks) 25 | if(Tasks_FOUND) 26 | return() 27 | endif() 28 | endif() 29 | 30 | # Compute and install package configuration and version files 31 | get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) 32 | get_filename_component(_prefix "${_dir}" ABSOLUTE) 33 | 34 | find_path(Tasks_INCLUDE_DIR 35 | NAMES FrmTasksList.h 36 | FrmStickyList.h 37 | FrmTasksList.h 38 | HINTS ${_prefix} 39 | PATH_SUFFIXES include/Tasks) 40 | find_library(Tasks_LIBRARY Tasks 41 | HINTS ${_prefix} 42 | PATH_SUFFIXES lib) 43 | 44 | find_package_handle_standard_args(Tasks 45 | REQUIRED_VARS Tasks_INCLUDE_DIR 46 | Tasks_LIBRARY 47 | VERSION_VAR Tasks_VERSION_STRING) 48 | 49 | if(Tasks_FOUND) 50 | SET(Tasks_INCLUDE_DIRS ${Tasks_INCLUDE_DIR}) 51 | SET(Tasks_LIBRARIES ${Tasks_LIBRARY}) 52 | SET(Tasks_DEFINITIONS @Tasks_DEFINITIONS@) 53 | endif() 54 | 55 | MARK_AS_ADVANCED(Tasks_INCLUDE_DIR Tasks_LIBRARY) 56 | 57 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | rabbitcalendar (1.0.22) unstable; urgency=medium 2 | 3 | * Full Changelog: [v1.0.21..v1.0.22](https://github.com/KangLin/RabbitRemoteControl/compare/v1.0.21..v1.0.22) 4 | 5 | -- Kang Lin Mon, 17 Feb 2025 15:04:15 +0800 6 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | # https://www.debian.org/doc/manuals/maint-guide/dreq.zh-cn.html#control 2 | # https://www.debian.org/doc/debian-policy/ch-controlfields.html 3 | 4 | Source: rabbitcalendar 5 | Section: main 6 | Priority: optional 7 | Maintainer: Kang Lin 8 | Build-Depends: debhelper (>=13), debhelper-compat (=13), fakeroot, cmake(>3.30), 9 | libssl-dev, libcrypt-dev, libcmark-dev, rabbitcommon-dev(>=2.3.2), 10 | lunarcalendar-dev, qt6-tools-dev, qt6-tools-dev-tools, 11 | qt6-base-dev, qt6-base-dev-tools, qt6-l10n-tools, 12 | qt6-translations-l10n, qt6-scxml-dev, qt6-webengine-dev, 13 | qt6-webengine-dev-tools, qt6-multimedia-dev 14 | Standards-Version: 4.6.2 15 | Homepage: https://github.com/KangLin/Calendar 16 | Vcs-Git: https://github.com/KangLin/Calendar.git 17 | Vcs-Browser: https://github.com/KangLin/Calendar 18 | Rules-Requires-Root: binary-targets 19 | 20 | Package: rabbitcalendar 21 | Architecture: any 22 | #Pre-Depends: ${misc:Pre-Depends} 23 | Depends: ${shlibs:Depends}, ${misc:Depends} 24 | Replaces: lunarcalendar 25 | Description: Calendar using Qt 26 | Calendar 27 | . 28 | Include: 29 | - Calendar 30 | - solar 31 | - lunar 32 | - Task 33 | - sticky 34 | . 35 | Author: Kang Lin 36 | . 37 | Donation: 38 | . 39 | https://github.com/KangLin/RabbitCommon/raw/master/Src/Resource/image/Contribute.png 40 | . 41 | https://gitee.com/kl222/RabbitCommon/raw/master/Src/Resource/image/Contribute.png 42 | . 43 | https://gitlab.com/kl222/RabbitCommon/-/raw/master/Src/Resource/image/Contribute.png 44 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Source: https://github.com/KangLin/Calendar 3 | Upstream-Name: rabbitcalendar 4 | Upstream-Contact: Kang Lin 5 | 6 | Files: * 7 | Copyright: 2019 Kang Lin 8 | License: GPL-3.0+ 9 | 10 | Files: debian/* 11 | Copyright: 2024 Kang Lin 12 | License: GPL-3.0+ 13 | 14 | License: GPL-3.0+ 15 | This program is free software: you can redistribute it and/or modify 16 | it under the terms of the GNU General Public License as published by 17 | the Free Software Foundation, either version 3 of the License, or 18 | (at your option) any later version. 19 | . 20 | This package is distributed in the hope that it will be useful, 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | GNU General Public License for more details. 24 | . 25 | You should have received a copy of the GNU General Public License 26 | along with this program. If not, see . 27 | . 28 | On Debian systems, the complete text of the GNU General 29 | Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". 30 | -------------------------------------------------------------------------------- /debian/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postinst script for Calendar 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `configure' 10 | # * `abort-upgrade' 11 | # * `abort-remove' `in-favour' 12 | # 13 | # * `abort-remove' 14 | # * `abort-deconfigure' `in-favour' 15 | # `removing' 16 | # 17 | # for details, see https://www.debian.org/doc/debian-policy/ or 18 | # the debian-policy package 19 | 20 | INSTALL_ROOT=/opt/Calendar 21 | 22 | case "$1" in 23 | configure) 24 | mkdir -p $INSTALL_ROOT/log 25 | chmod -R a+w $INSTALL_ROOT/log 26 | chmod -R a+w $INSTALL_ROOT/etc 27 | 28 | if [ ! -d $INSTALL_ROOT/bin/log -a -d $INSTALL_ROOT/log ]; then 29 | ln -s $INSTALL_ROOT/log $INSTALL_ROOT/bin/log 30 | fi 31 | 32 | if [ ! -f /usr/share/applications/org.Rabbit.Calendar.desktop ]; then 33 | ln -s ${INSTALL_ROOT}/share/applications/org.Rabbit.Calendar.desktop /usr/share/applications/org.Rabbit.Calendar.desktop 34 | fi 35 | if [ ! -d ~/.config/autostart ]; then 36 | mkdir -p ~/.config/autostart 37 | chmod 755 ~/.config/autostart 38 | fi 39 | if [ ! -f ~/.config/autostart/org.Rabbit.Calendar.desktop ]; then 40 | ln -s ${INSTALL_ROOT}/share/applications/org.Rabbit.Calendar.desktop ~/.config/autostart/org.Rabbit.Calendar.desktop 41 | fi 42 | if [ ! -f /usr/share/pixmaps/Calendar.png ]; then 43 | if [ ! -d /usr/share/pixmaps ]; then 44 | mkdir -p /usr/share/pixmaps 45 | fi 46 | ln -s ${INSTALL_ROOT}/share/pixmaps/Calendar.png /usr/share/pixmaps/Calendar.png 47 | fi 48 | #echo "${INSTALL_ROOT}/lib" > /etc/ld.so.conf.d/Calendar.conf 49 | #echo "${INSTALL_ROOT}/bin" >> /etc/ld.so.conf.d/Calendar.conf 50 | #export QT_VERSION_DIR= 51 | #if [ -n "${QT_VERSION_DIR}" ]; then 52 | # echo "/opt/qt${QT_VERSION_DIR}/lib" >> /etc/ld.so.conf.d/Calendar.conf 53 | #fi 54 | ldconfig 55 | ;; 56 | 57 | abort-upgrade|abort-remove|abort-deconfigure) 58 | rm -fr ~/.config/autostart/org.Rabbit.Calendar.desktop 59 | rm -fr /usr/share/applications/org.Rabbit.Calendar.desktop 60 | rm -fr $INSTALL_ROOT/log $INSTALL_ROOT/bin/log 61 | rm -fr /etc/ld.so.conf.d/Calendar.conf 62 | rm -fr /usr/share/pixmaps/Calendar.png 63 | ldconfig 64 | ;; 65 | 66 | *) 67 | echo "postinst called with unknown argument \`$1'" >&2 68 | exit 1 69 | ;; 70 | esac 71 | 72 | # dh_installdeb will replace this with shell code automatically 73 | # generated by other debhelper scripts. 74 | 75 | #DEBHELPER# 76 | 77 | exit 0 78 | -------------------------------------------------------------------------------- /debian/postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postrm script for Calendar 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `purge' 11 | # * `upgrade' 12 | # * `failed-upgrade' 13 | # * `abort-install' 14 | # * `abort-install' 15 | # * `abort-upgrade' 16 | # * `disappear' 17 | # 18 | # for details, see https://www.debian.org/doc/debian-policy/ or 19 | # the debian-policy package 20 | 21 | INSTALL_ROOT=/opt/Calendar 22 | 23 | case "$1" in 24 | purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 25 | rm -fr $INSTALL_ROOT/log $INSTALL_ROOT/bin/log 26 | rm -fr ~/.config/autostart/org.Rabbit.Calendar.desktop 27 | rm -fr /usr/share/applications/org.Rabbit.Calendar.desktop 28 | rm -fr /etc/ld.so.conf.d/Calendar.conf 29 | rm -fr /usr/share/pixmaps/Calendar.png 30 | ldconfig 31 | ;; 32 | 33 | *) 34 | echo "postrm called with unknown argument \`$1'" >&2 35 | exit 1 36 | ;; 37 | esac 38 | 39 | # dh_installdeb will replace this with shell code automatically 40 | # generated by other debhelper scripts. 41 | 42 | #DEBHELPER# 43 | 44 | exit 0 45 | -------------------------------------------------------------------------------- /debian/preinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # preinst script for Calendar 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `install' 10 | # * `install' 11 | # * `upgrade' 12 | # * `abort-upgrade' 13 | # for details, see https://www.debian.org/doc/debian-policy/ or 14 | # the debian-policy package 15 | 16 | 17 | case "$1" in 18 | install|upgrade) 19 | export QT_VERSION= 20 | if [ -n "${QT_VERSION}" ]; then 21 | sudo add-apt-repository -y ppa:beineri/opt-qt-${QT_VERSION}-`lsb_release -c|awk '{print $2}'` 22 | sudo apt-get update 23 | fi 24 | ;; 25 | 26 | abort-upgrade) 27 | ;; 28 | 29 | *) 30 | echo "preinst called with unknown argument \`$1'" >&2 31 | exit 1 32 | ;; 33 | esac 34 | 35 | # dh_installdeb will replace this with shell code automatically 36 | # generated by other debhelper scripts. 37 | 38 | #DEBHELPER# 39 | 40 | exit 0 41 | -------------------------------------------------------------------------------- /debian/prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # prerm script for Calendar 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `upgrade' 11 | # * `failed-upgrade' 12 | # * `remove' `in-favour' 13 | # * `deconfigure' `in-favour' 14 | # `removing' 15 | # 16 | # for details, see https://www.debian.org/doc/debian-policy/ or 17 | # the debian-policy package 18 | 19 | 20 | case "$1" in 21 | remove|upgrade|deconfigure) 22 | ;; 23 | 24 | failed-upgrade) 25 | ;; 26 | 27 | *) 28 | echo "prerm called with unknown argument \`$1'" >&2 29 | exit 1 30 | ;; 31 | esac 32 | 33 | # dh_installdeb will replace this with shell code automatically 34 | # generated by other debhelper scripts. 35 | 36 | #DEBHELPER# 37 | 38 | exit 0 39 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # See debhelper(7) (uncomment to enable) 3 | # output every command that modifies files on the build system. 4 | export DH_VERBOSE = 1 5 | 6 | # see FEATURE AREAS in dpkg-buildflags(1) 7 | #export DEB_BUILD_MAINT_OPTIONS = hardening=+all 8 | 9 | # see ENVIRONMENT in dpkg-buildflags(1) 10 | # package maintainers to append CFLAGS 11 | #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic 12 | # package maintainers to append LDFLAGS 13 | #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed 14 | 15 | #export QT_SELECT=qt5 16 | 17 | DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) 18 | BUILD_DIR = "build_$(DEB_HOST_MULTIARCH)" 19 | PACKAGE_DIR = "debian/rabbitcalendar" 20 | PACKAGE_dev_DIR = "debian/rabbitcalendar-dev" 21 | 22 | %: 23 | dh $@ 24 | 25 | # Debian 维护者指南: https://www.debian.org/doc/manuals/debmake-doc/index.zh-cn.html 26 | # Debian 新维护者手册: https://www.debian.org/doc/manuals/maint-guide/dreq.zh-cn.html#rules 27 | # https://www.debian.org/doc/manuals/maint-guide/dreq.zh-cn.html#rules 28 | # This is example for Cmake (See https://bugs.debian.org/641051 ) 29 | override_dh_auto_configure: 30 | dh_auto_configure -B$(BUILD_DIR) -- \ 31 | -DCMAKE_BUILD_TYPE=Release \ 32 | -DCMAKE_INSTALL_PREFIX=/opt/Calendar 33 | 34 | override_dh_auto_build: 35 | cmake --build $(BUILD_DIR) --config Release \ 36 | --parallel $(if "`cat /proc/cpuinfo |grep 'processor' |wc -l`", `cat /proc/cpuinfo |grep 'processor' |wc -l`, 1) 37 | 38 | override_dh_auto_install: 39 | cmake --install $(BUILD_DIR) --config Release \ 40 | --component Runtime --prefix $(PACKAGE_DIR)/opt/Calendar 41 | cmake --install $(BUILD_DIR) --config Release \ 42 | --component Application --prefix $(PACKAGE_DIR)/opt/Calendar 43 | 44 | override_dh_builddeb: 45 | dh_builddeb --package=rabbitcalendar -P$(PACKAGE_DIR) 46 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | # Compulsory line, this is a version 4 file 2 | version=4 3 | 4 | # GitHub hosted projects 5 | opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%-$1.tar.gz%" \ 6 | https://github.com/KangLin/Calendar/tags \ 7 | (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate 8 | -------------------------------------------------------------------------------- /etc/Calendar_log4qt.conf: -------------------------------------------------------------------------------- 1 | # 参见:https://github.com/KangLin/Documents/blob/master/qt/log4qt.md 2 | 3 | #设置储存log文件的根目录 4 | logpath=../log 5 | 6 | #格式化符号说明: 7 | # %p:输出日志信息的优先级,即DEBUG,INFO,WARN,ERROR,FATAL。 8 | # %d:输出日志时间点的日期或时间,默认格式为ISO8601,也可以在其后指定格式,如:%d{yyyy/MM/dd HH:mm:ss,SSS}。 9 | # %r:输出自应用程序启动到输出该log信息耗费的毫秒数。 10 | # %t:输出产生该日志事件的线程名。 11 | # %l:输出日志事件的发生位置,相当于%c.%M(%F:%L)的组合,包括类全名、方法、文件名以及在代码中的行数。例如:test.TestLog4j.main(TestLog4j.java:10)。 12 | # %c:输出日志信息所属的类目,通常就是所在类的全名。 13 | # %M:输出产生日志信息的方法名。 14 | # %F:输出日志消息产生时所在的文件名称。 15 | # %L::输出代码中的行号。 16 | # %m::输出代码中指定的具体日志信息。 17 | # %n:输出一个回车换行符,Windows平台为"\r\n",Unix平台为"\n"。 18 | # %x:输出和当前线程相关联的NDC(嵌套诊断环境),尤其用到像java servlets这样的多客户多线程的应用中。 19 | # %%:输出一个"%“字符。 20 | # 另外,还可以在%与格式字符之间加上修饰符来控制其最小长度、最大长度、和文本的对齐方式。如: 21 | # c:指定输出category的名称,最小的长度是20,如果category的名称长度小于20的话,默认的情况下右对齐。 22 | # 2)%-20c:”-"号表示左对齐。 23 | # 3)%.30c:指定输出category的名称,最大的长度是30,如果category的名称长度大于30的话,就会将左边多出的字符截掉,但小于30的话也不会补空格。 24 | logConversionPattern=%F:%L [%d] [%t] %5p %c - %m%n 25 | 26 | log4j.reset=true 27 | log4j.Debug=WARN 28 | log4j.threshold=NULL 29 | #在运行中,是否监视此文件配置的变化 30 | log4j.watchThisFile=false 31 | #设置是否监听QDebug输出的字符串 32 | log4j.handleQtMessages=true 33 | # QLoggingCategory 过滤规则 34 | #log4j.qtLogging.filterRules= 35 | #log4j.qtLogging.messagePattern= 36 | 37 | #rootLogger 输出 38 | # log4j.rootLogger 日志输出类别和级别:只输出不低于该级别的日志信息 DEBUG < INFO < WARN < ERROR < FATAL 39 | #设置日志输出的几种输出源(appender)。 40 | # log4j.rootLogger 格式:[ level ] , appenderName1, appenderName2, … 41 | # level :设定日志记录的最低级别, 42 | # 可设的值有 OFF、FATAL、ERROR、WARN、INFO、DEBUG、ALL 或者自定义的级别,Log4j建议只使用中间四个级别。 43 | # 通过在这里设定级别,您可以控制应用程序中相应级别的日志信息的开关,比如在这里设定了INFO级别,则应用程序中所有DEBUG级别的日志信息将不会被打印出来。 44 | # 只输出不低于该级别的日志信息 DEBUG < INFO < WARN < ERROR < FATAL 45 | # appenderName:就是指定日志信息要输出到哪里。可以同时指定多个输出目的地,用逗号隔开。本例是:console, daily 46 | log4j.rootLogger=ALL, console, daily 47 | 48 | ############################### 49 | # 输出到控制台 50 | ############################### 51 | 52 | # 配置INFO CONSOLE输出到控制台 53 | log4j.appender.console=org.apache.log4j.ConsoleAppender 54 | log4j.appender.console.target=System.out 55 | # 输入日志等级,默认值是 DEBUG 56 | #log4j.appender.console.Threshold=DEBUG 57 | # 配置CONSOLE设置为自定义布局模式 58 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 59 | # 配置logfile为自定义布局模式 60 | log4j.appender.console.layout.ConversionPattern=${logConversionPattern} 61 | 62 | ############################### 63 | # 输出到日志文件中 64 | ############################### 65 | 66 | # 配置 logfile 输出到文件中 每日产生文件 67 | log4j.appender.daily=org.apache.log4j.DailyFileAppender 68 | # 输出文件位置此为项目根目录下的logs文件夹中 69 | log4j.appender.daily.file=${logpath}/root.log 70 | #true表示消息增加到指定文件中,false 则将消息覆盖指定的文件内容,默认值是 false 71 | log4j.appender.daily.appendFile=true 72 | # 日期格式 73 | log4j.appender.daily.datePattern=_yyyy_MM_dd 74 | # 立即输出。表示所有消息都会被立即输出,设为 false 则不立即输出,默认值是 true 75 | log4j.appender.daily.immediateFlush=true 76 | # 输入日志等级,默认值是 DEBUG 77 | log4j.appender.daily.Threshold=DEBUG 78 | # 设置保留天数 79 | log4j.appender.daily.keepDays=10 80 | # 配置logfile为自定义布局模式 81 | log4j.appender.daily.layout=org.apache.log4j.PatternLayout 82 | log4j.appender.daily.layout.ConversionPattern=${logConversionPattern} 83 | -------------------------------------------------------------------------------- /etc/Calendar_logqt.ini: -------------------------------------------------------------------------------- 1 | [Log] 2 | ;; Log file path. 3 | ;Path=log 4 | ;; Log file name prefix 5 | DateFormat="yyyy-MM-dd" 6 | ;; Message format pattern. See: https://doc.qt.io/qt-6/qtlogging.html#qSetMessagePattern 7 | Pattern="[%{time hh:mm:ss.zzz} %{pid}|%{threadid} %{if-debug}D%{endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-critical}E%{endif}%{if-fatal}F%{endif}] %{category} - %{message}" 8 | ;[%{file}:%{line}, %{function}]" 9 | ;; Log file length 10 | ;Length=100M 11 | ;; Log file count 12 | ;Count=10 13 | ;; Write log file interval 14 | ;Interval=1 15 | 16 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 17 | ;; Log rules 18 | ;; Please see QLoggingCategory documents: https://doc.qt.io/qt-6/qloggingcategory.html#logging-rules 19 | ;; Format: 20 | ;; [.] = true|false 21 | [Rules] 22 | ;*=false 23 | *.debug=false 24 | ;*.warning=false 25 | 26 | ;RabbitCommon*=false 27 | ;RabbitCommon.Updater=true 28 | -------------------------------------------------------------------------------- /share/Calendar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | #获取运行的程序名 6 | PRONAME=$(readlink -f $0) 7 | #获取文件运行的当前目录 8 | INSTALL_PATH=$(readlink -f $(dirname $(dirname $PRONAME))) 9 | 10 | echo "INSTALL_PATH:$INSTALL_PATH" 11 | export LD_LIBRARY_PATH=$INSTALL_PATH/bin:$INSTALL_PATH/lib:$INSTALL_PATH/lib/`uname -m`-linux-gnu:$LD_LIBRARY_PATH 12 | echo "LD_LIBRARY_PATH:$LD_LIBRARY_PATH" 13 | $INSTALL_PATH/bin/CalendarApp $* 14 | -------------------------------------------------------------------------------- /share/applications/org.Rabbit.Calendar.desktop.in: -------------------------------------------------------------------------------- 1 | # https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html 2 | 3 | [Desktop Entry] 4 | Type=Application 5 | Icon=Calendar 6 | Exec=CalendarApp 7 | TryExec=CalendarApp 8 | Path=@CMAKE_INSTALL_PREFIX@/bin 9 | Terminal=false 10 | StartupNotify=true 11 | 12 | # https://specifications.freedesktop.org/menu-spec/latest/apa.html 13 | Categories=Calendar;Development;Utility;Qt; 14 | 15 | # https://www.freedesktop.org/wiki/Specifications/mime-apps-spec/ 16 | # https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/ 17 | MimeType=application/calendar+json;application/calendar+xml;application/octet-stream;text/calendar;text/x-vcalendar;application/vnd.sus-calendar;text/plain; 18 | 19 | Name=Calendar 20 | GenericName=Calendar 21 | Comment=Calendar 22 | 23 | Name[zh_CN]=日历 24 | GenericName[zh_CN]=日历 25 | Comment[zh_CN]=日历 26 | 27 | Name[zh_TW]=日歷 28 | GenericName[zh_TW]=日歷 29 | Comment[zh_TW]=日歷 30 | -------------------------------------------------------------------------------- /vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "calendar", 3 | "version-string": "1.0.22", 4 | "license": "GPL-3.0", 5 | "homepage": "https://github.com/KangLin/Calendar", 6 | 7 | "dependencies": [ 8 | "openssl" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /vcpkg/manifests/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "serialportassistant", 3 | "version-string": "1.0.22", 4 | "license": "GPL-3.0", 5 | "homepage": "https://github.com/KangLin/SerialPortAssistant", 6 | 7 | "dependencies": [ 8 | "openssl" 9 | ], 10 | 11 | "builtin-baseline": "9259a0719d94c402aae2ab7975bc096afdec15df", 12 | "overrides": [ 13 | { "name": "openssl", "version-string": "1.1.1n" } 14 | ] 15 | 16 | } 17 | --------------------------------------------------------------------------------