Merge lp:~mutse-young/chinese-calendar/trunk into lp:chinese-calendar/1.0
- trunk
- Merge into chinese-calendar
Proposed by
mutse
Status: | Rejected |
---|---|
Rejected by: | Shine Huang |
Proposed branch: | lp:~mutse-young/chinese-calendar/trunk |
Merge into: | lp:chinese-calendar/1.0 |
Diff against target: |
5026 lines (+4847/-0) (has conflicts) 27 files modified
calendar.ui (+1359/-0) ccbo.cpp (+490/-0) ccbo.h (+108/-0) chinese-calendar.desktop (+10/-0) chinese-calendar.pro (+65/-0) chinese-calendar.qrc (+10/-0) chinesecalendar.cpp (+1265/-0) chinesecalendar.h (+111/-0) cnote.cpp (+89/-0) cnote.h (+39/-0) dateitem.cpp (+195/-0) dateitem.h (+76/-0) dateitem.ui (+71/-0) datemaskwidget.cpp (+41/-0) datemaskwidget.h (+48/-0) debian/changelog (+57/-0) debian/compat (+1/-0) debian/control (+17/-0) debian/copyright (+19/-0) debian/rules (+5/-0) debian/source/format (+1/-0) img/chinesecalendar.svg (+214/-0) main.cpp (+61/-0) skin/README.md (+27/-0) skin/black-skin.qss (+189/-0) skin/default-skin.qss (+138/-0) translate/i18_zh_CN.ts (+141/-0) Conflict adding file KylinLunar.db. Moved existing file to KylinLunar.db.moved. Conflict adding file calendar.ui. Moved existing file to calendar.ui.moved. Conflict adding file dateitem.cpp. Moved existing file to dateitem.cpp.moved. Conflict adding file dateitem.h. Moved existing file to dateitem.h.moved. Conflict adding file dateitem.ui. Moved existing file to dateitem.ui.moved. Conflict adding file datemaskwidget.cpp. Moved existing file to datemaskwidget.cpp.moved. Conflict adding file datemaskwidget.h. Moved existing file to datemaskwidget.h.moved. Conflict adding file img. Moved existing file to img.moved. Conflict adding file main.cpp. Moved existing file to main.cpp.moved. Conflict adding file translate. Moved existing file to translate.moved. |
To merge this branch: | bzr merge lp:~mutse-young/chinese-calendar/trunk |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Kylin Members | Pending | ||
Review via email: mp+162613@code.launchpad.net |
Commit message
Description of the change
* add skins changing functional code
* add default and black skin qss files
To post a comment you must log in.
Revision history for this message
Abel Liu (guiltyritter) wrote : | # |
Revision history for this message
Shine Huang (shine) wrote : | # |
mutse已有更新的代码,
这个merge请求reject关闭。
Unmerged revisions
- 33. By mutse
-
delete ok.png note.png no.png chinesecalendar
BGyellow. png of img - 32. By mutse
-
delete .tmp
- 31. By mutse
-
add skin change function
- 30. By mutse
-
add skin files
- 29. By mutse
-
add chinese calendar source code
- 28. By Abel Liu
-
update changelog
- 27. By Abel Liu
-
update changelog
- 26. By Abel Liu
-
fix bug #1161756
- 25. By Abel Liu
-
fix bug #1161425
- 24. By Abel Liu
-
fix bug #1161425
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'KylinLunar.db' |
2 | Binary files KylinLunar.db 1970-01-01 00:00:00 +0000 and KylinLunar.db 2013-05-06 14:54:28 +0000 differ |
3 | === renamed file 'KylinLunar.db' => 'KylinLunar.db.moved' |
4 | === added file 'calendar.ui' |
5 | --- calendar.ui 1970-01-01 00:00:00 +0000 |
6 | +++ calendar.ui 2013-05-06 14:54:28 +0000 |
7 | @@ -0,0 +1,1359 @@ |
8 | +<?xml version="1.0" encoding="UTF-8"?> |
9 | +<ui version="4.0"> |
10 | + <class>Calendar</class> |
11 | + <widget class="QWidget" name="Calendar"> |
12 | + <property name="geometry"> |
13 | + <rect> |
14 | + <x>0</x> |
15 | + <y>0</y> |
16 | + <width>520</width> |
17 | + <height>350</height> |
18 | + </rect> |
19 | + </property> |
20 | + <property name="windowTitle"> |
21 | + <string>Calendar</string> |
22 | + </property> |
23 | + <property name="styleSheet"> |
24 | + <string notr="true"/> |
25 | + </property> |
26 | + <widget class="QLabel" name="label_3"> |
27 | + <property name="geometry"> |
28 | + <rect> |
29 | + <x>5</x> |
30 | + <y>39</y> |
31 | + <width>55</width> |
32 | + <height>30</height> |
33 | + </rect> |
34 | + </property> |
35 | + <property name="font"> |
36 | + <font> |
37 | + <family>文泉驿微米黑</family> |
38 | + </font> |
39 | + </property> |
40 | + <property name="text"> |
41 | + <string>星期日</string> |
42 | + </property> |
43 | + <property name="alignment"> |
44 | + <set>Qt::AlignCenter</set> |
45 | + </property> |
46 | + </widget> |
47 | + <widget class="QLabel" name="label_4"> |
48 | + <property name="geometry"> |
49 | + <rect> |
50 | + <x>60</x> |
51 | + <y>39</y> |
52 | + <width>55</width> |
53 | + <height>30</height> |
54 | + </rect> |
55 | + </property> |
56 | + <property name="font"> |
57 | + <font> |
58 | + <family>文泉驿微米黑</family> |
59 | + <pointsize>11</pointsize> |
60 | + </font> |
61 | + </property> |
62 | + <property name="text"> |
63 | + <string>星期一</string> |
64 | + </property> |
65 | + <property name="alignment"> |
66 | + <set>Qt::AlignCenter</set> |
67 | + </property> |
68 | + </widget> |
69 | + <widget class="QLabel" name="label_5"> |
70 | + <property name="geometry"> |
71 | + <rect> |
72 | + <x>115</x> |
73 | + <y>39</y> |
74 | + <width>55</width> |
75 | + <height>30</height> |
76 | + </rect> |
77 | + </property> |
78 | + <property name="font"> |
79 | + <font> |
80 | + <family>文泉驿微米黑</family> |
81 | + <pointsize>11</pointsize> |
82 | + </font> |
83 | + </property> |
84 | + <property name="text"> |
85 | + <string>星期二</string> |
86 | + </property> |
87 | + <property name="alignment"> |
88 | + <set>Qt::AlignCenter</set> |
89 | + </property> |
90 | + </widget> |
91 | + <widget class="QLabel" name="label_6"> |
92 | + <property name="geometry"> |
93 | + <rect> |
94 | + <x>170</x> |
95 | + <y>39</y> |
96 | + <width>55</width> |
97 | + <height>30</height> |
98 | + </rect> |
99 | + </property> |
100 | + <property name="font"> |
101 | + <font> |
102 | + <family>文泉驿微米黑</family> |
103 | + <pointsize>11</pointsize> |
104 | + </font> |
105 | + </property> |
106 | + <property name="text"> |
107 | + <string>星期三</string> |
108 | + </property> |
109 | + <property name="alignment"> |
110 | + <set>Qt::AlignCenter</set> |
111 | + </property> |
112 | + </widget> |
113 | + <widget class="QLabel" name="label_7"> |
114 | + <property name="geometry"> |
115 | + <rect> |
116 | + <x>225</x> |
117 | + <y>39</y> |
118 | + <width>55</width> |
119 | + <height>30</height> |
120 | + </rect> |
121 | + </property> |
122 | + <property name="font"> |
123 | + <font> |
124 | + <family>文泉驿微米黑</family> |
125 | + <pointsize>11</pointsize> |
126 | + </font> |
127 | + </property> |
128 | + <property name="text"> |
129 | + <string>星期四</string> |
130 | + </property> |
131 | + <property name="alignment"> |
132 | + <set>Qt::AlignCenter</set> |
133 | + </property> |
134 | + </widget> |
135 | + <widget class="QLabel" name="label_8"> |
136 | + <property name="geometry"> |
137 | + <rect> |
138 | + <x>280</x> |
139 | + <y>39</y> |
140 | + <width>55</width> |
141 | + <height>30</height> |
142 | + </rect> |
143 | + </property> |
144 | + <property name="font"> |
145 | + <font> |
146 | + <family>文泉驿微米黑</family> |
147 | + <pointsize>11</pointsize> |
148 | + </font> |
149 | + </property> |
150 | + <property name="text"> |
151 | + <string>星期五</string> |
152 | + </property> |
153 | + <property name="alignment"> |
154 | + <set>Qt::AlignCenter</set> |
155 | + </property> |
156 | + </widget> |
157 | + <widget class="QLabel" name="label_9"> |
158 | + <property name="geometry"> |
159 | + <rect> |
160 | + <x>335</x> |
161 | + <y>39</y> |
162 | + <width>55</width> |
163 | + <height>30</height> |
164 | + </rect> |
165 | + </property> |
166 | + <property name="font"> |
167 | + <font> |
168 | + <family>文泉驿微米黑</family> |
169 | + </font> |
170 | + </property> |
171 | + <property name="text"> |
172 | + <string>星期六</string> |
173 | + </property> |
174 | + <property name="alignment"> |
175 | + <set>Qt::AlignCenter</set> |
176 | + </property> |
177 | + </widget> |
178 | + <widget class="QLabel" name="label_10"> |
179 | + <property name="geometry"> |
180 | + <rect> |
181 | + <x>400</x> |
182 | + <y>60</y> |
183 | + <width>110</width> |
184 | + <height>68</height> |
185 | + </rect> |
186 | + </property> |
187 | + <property name="text"> |
188 | + <string/> |
189 | + </property> |
190 | + <property name="alignment"> |
191 | + <set>Qt::AlignCenter</set> |
192 | + </property> |
193 | + </widget> |
194 | + <widget class="QLabel" name="label_12"> |
195 | + <property name="geometry"> |
196 | + <rect> |
197 | + <x>400</x> |
198 | + <y>40</y> |
199 | + <width>110</width> |
200 | + <height>20</height> |
201 | + </rect> |
202 | + </property> |
203 | + <property name="text"> |
204 | + <string/> |
205 | + </property> |
206 | + <property name="alignment"> |
207 | + <set>Qt::AlignCenter</set> |
208 | + </property> |
209 | + </widget> |
210 | + <widget class="QLabel" name="label_13"> |
211 | + <property name="geometry"> |
212 | + <rect> |
213 | + <x>400</x> |
214 | + <y>128</y> |
215 | + <width>110</width> |
216 | + <height>20</height> |
217 | + </rect> |
218 | + </property> |
219 | + <property name="text"> |
220 | + <string/> |
221 | + </property> |
222 | + <property name="alignment"> |
223 | + <set>Qt::AlignCenter</set> |
224 | + </property> |
225 | + </widget> |
226 | + <widget class="QLabel" name="label_14"> |
227 | + <property name="geometry"> |
228 | + <rect> |
229 | + <x>400</x> |
230 | + <y>148</y> |
231 | + <width>110</width> |
232 | + <height>20</height> |
233 | + </rect> |
234 | + </property> |
235 | + <property name="text"> |
236 | + <string/> |
237 | + </property> |
238 | + <property name="alignment"> |
239 | + <set>Qt::AlignCenter</set> |
240 | + </property> |
241 | + </widget> |
242 | + <widget class="QLabel" name="label_15"> |
243 | + <property name="geometry"> |
244 | + <rect> |
245 | + <x>393</x> |
246 | + <y>3</y> |
247 | + <width>121</width> |
248 | + <height>30</height> |
249 | + </rect> |
250 | + </property> |
251 | + <property name="text"> |
252 | + <string/> |
253 | + </property> |
254 | + <property name="alignment"> |
255 | + <set>Qt::AlignCenter</set> |
256 | + </property> |
257 | + </widget> |
258 | + <widget class="QPushButton" name="TbpreviousYear"> |
259 | + <property name="geometry"> |
260 | + <rect> |
261 | + <x>5</x> |
262 | + <y>3</y> |
263 | + <width>25</width> |
264 | + <height>30</height> |
265 | + </rect> |
266 | + </property> |
267 | + <property name="font"> |
268 | + <font> |
269 | + <family>文泉驿微米黑</family> |
270 | + <pointsize>14</pointsize> |
271 | + <weight>50</weight> |
272 | + <bold>false</bold> |
273 | + </font> |
274 | + </property> |
275 | + <property name="toolTip"> |
276 | + <string>Previous Year</string> |
277 | + </property> |
278 | + <property name="text"> |
279 | + <string><</string> |
280 | + </property> |
281 | + </widget> |
282 | + <widget class="QLabel" name="label"> |
283 | + <property name="geometry"> |
284 | + <rect> |
285 | + <x>100</x> |
286 | + <y>3</y> |
287 | + <width>25</width> |
288 | + <height>30</height> |
289 | + </rect> |
290 | + </property> |
291 | + <property name="font"> |
292 | + <font> |
293 | + <family>文泉驿微米黑</family> |
294 | + </font> |
295 | + </property> |
296 | + <property name="text"> |
297 | + <string>年</string> |
298 | + </property> |
299 | + <property name="alignment"> |
300 | + <set>Qt::AlignCenter</set> |
301 | + </property> |
302 | + </widget> |
303 | + <widget class="QPushButton" name="TbnextYear"> |
304 | + <property name="geometry"> |
305 | + <rect> |
306 | + <x>125</x> |
307 | + <y>3</y> |
308 | + <width>25</width> |
309 | + <height>30</height> |
310 | + </rect> |
311 | + </property> |
312 | + <property name="font"> |
313 | + <font> |
314 | + <family>文泉驿微米黑</family> |
315 | + <pointsize>14</pointsize> |
316 | + <weight>50</weight> |
317 | + <bold>false</bold> |
318 | + </font> |
319 | + </property> |
320 | + <property name="toolTip"> |
321 | + <string>Next Year</string> |
322 | + </property> |
323 | + <property name="text"> |
324 | + <string>></string> |
325 | + </property> |
326 | + </widget> |
327 | + <widget class="QPushButton" name="TbpreviousMonth"> |
328 | + <property name="geometry"> |
329 | + <rect> |
330 | + <x>150</x> |
331 | + <y>3</y> |
332 | + <width>25</width> |
333 | + <height>30</height> |
334 | + </rect> |
335 | + </property> |
336 | + <property name="font"> |
337 | + <font> |
338 | + <family>文泉驿微米黑</family> |
339 | + <pointsize>14</pointsize> |
340 | + <weight>50</weight> |
341 | + <italic>false</italic> |
342 | + <bold>false</bold> |
343 | + <underline>false</underline> |
344 | + <stylestrategy>PreferDefault</stylestrategy> |
345 | + </font> |
346 | + </property> |
347 | + <property name="toolTip"> |
348 | + <string>Previous Month</string> |
349 | + </property> |
350 | + <property name="text"> |
351 | + <string><</string> |
352 | + </property> |
353 | + </widget> |
354 | + <widget class="QComboBox" name="monthCombo"> |
355 | + <property name="geometry"> |
356 | + <rect> |
357 | + <x>175</x> |
358 | + <y>3</y> |
359 | + <width>60</width> |
360 | + <height>30</height> |
361 | + </rect> |
362 | + </property> |
363 | + <property name="font"> |
364 | + <font> |
365 | + <family>文泉驿微米黑</family> |
366 | + </font> |
367 | + </property> |
368 | + <item> |
369 | + <property name="text"> |
370 | + <string>1</string> |
371 | + </property> |
372 | + </item> |
373 | + <item> |
374 | + <property name="text"> |
375 | + <string>2</string> |
376 | + </property> |
377 | + </item> |
378 | + <item> |
379 | + <property name="text"> |
380 | + <string>3</string> |
381 | + </property> |
382 | + </item> |
383 | + <item> |
384 | + <property name="text"> |
385 | + <string>4</string> |
386 | + </property> |
387 | + </item> |
388 | + <item> |
389 | + <property name="text"> |
390 | + <string>5</string> |
391 | + </property> |
392 | + </item> |
393 | + <item> |
394 | + <property name="text"> |
395 | + <string>6</string> |
396 | + </property> |
397 | + </item> |
398 | + <item> |
399 | + <property name="text"> |
400 | + <string>7</string> |
401 | + </property> |
402 | + </item> |
403 | + <item> |
404 | + <property name="text"> |
405 | + <string>8</string> |
406 | + </property> |
407 | + </item> |
408 | + <item> |
409 | + <property name="text"> |
410 | + <string>9</string> |
411 | + </property> |
412 | + </item> |
413 | + <item> |
414 | + <property name="text"> |
415 | + <string>10</string> |
416 | + </property> |
417 | + </item> |
418 | + <item> |
419 | + <property name="text"> |
420 | + <string>11</string> |
421 | + </property> |
422 | + </item> |
423 | + <item> |
424 | + <property name="text"> |
425 | + <string>12</string> |
426 | + </property> |
427 | + </item> |
428 | + </widget> |
429 | + <widget class="QLabel" name="label_2"> |
430 | + <property name="geometry"> |
431 | + <rect> |
432 | + <x>235</x> |
433 | + <y>3</y> |
434 | + <width>25</width> |
435 | + <height>30</height> |
436 | + </rect> |
437 | + </property> |
438 | + <property name="font"> |
439 | + <font> |
440 | + <family>文泉驿微米黑</family> |
441 | + </font> |
442 | + </property> |
443 | + <property name="text"> |
444 | + <string>月</string> |
445 | + </property> |
446 | + <property name="alignment"> |
447 | + <set>Qt::AlignCenter</set> |
448 | + </property> |
449 | + </widget> |
450 | + <widget class="QPushButton" name="TbnextMonth"> |
451 | + <property name="geometry"> |
452 | + <rect> |
453 | + <x>260</x> |
454 | + <y>3</y> |
455 | + <width>25</width> |
456 | + <height>30</height> |
457 | + </rect> |
458 | + </property> |
459 | + <property name="font"> |
460 | + <font> |
461 | + <family>文泉驿微米黑</family> |
462 | + <pointsize>14</pointsize> |
463 | + <weight>50</weight> |
464 | + <italic>false</italic> |
465 | + <bold>false</bold> |
466 | + <underline>false</underline> |
467 | + <stylestrategy>PreferDefault</stylestrategy> |
468 | + </font> |
469 | + </property> |
470 | + <property name="toolTip"> |
471 | + <string>Next Month</string> |
472 | + </property> |
473 | + <property name="text"> |
474 | + <string>></string> |
475 | + </property> |
476 | + </widget> |
477 | + <widget class="QPushButton" name="backtotoday"> |
478 | + <property name="geometry"> |
479 | + <rect> |
480 | + <x>290</x> |
481 | + <y>3</y> |
482 | + <width>50</width> |
483 | + <height>30</height> |
484 | + </rect> |
485 | + </property> |
486 | + <property name="font"> |
487 | + <font> |
488 | + <family>文泉驿微米黑</family> |
489 | + <pointsize>12</pointsize> |
490 | + <weight>75</weight> |
491 | + <italic>false</italic> |
492 | + <bold>true</bold> |
493 | + </font> |
494 | + </property> |
495 | + <property name="styleSheet"> |
496 | + <string notr="true"/> |
497 | + </property> |
498 | + <property name="text"> |
499 | + <string>今日</string> |
500 | + </property> |
501 | + </widget> |
502 | + <widget class="QLabel" name="label_11"> |
503 | + <property name="geometry"> |
504 | + <rect> |
505 | + <x>400</x> |
506 | + <y>185</y> |
507 | + <width>55</width> |
508 | + <height>30</height> |
509 | + </rect> |
510 | + </property> |
511 | + <property name="font"> |
512 | + <font> |
513 | + <family>文泉驿微米黑</family> |
514 | + <pointsize>13</pointsize> |
515 | + <weight>75</weight> |
516 | + <bold>true</bold> |
517 | + </font> |
518 | + </property> |
519 | + <property name="text"> |
520 | + <string>宜</string> |
521 | + </property> |
522 | + <property name="alignment"> |
523 | + <set>Qt::AlignCenter</set> |
524 | + </property> |
525 | + </widget> |
526 | + <widget class="QLabel" name="label_16"> |
527 | + <property name="geometry"> |
528 | + <rect> |
529 | + <x>455</x> |
530 | + <y>185</y> |
531 | + <width>55</width> |
532 | + <height>30</height> |
533 | + </rect> |
534 | + </property> |
535 | + <property name="font"> |
536 | + <font> |
537 | + <family>文泉驿微米黑</family> |
538 | + <pointsize>13</pointsize> |
539 | + <weight>75</weight> |
540 | + <bold>true</bold> |
541 | + </font> |
542 | + </property> |
543 | + <property name="text"> |
544 | + <string>忌</string> |
545 | + </property> |
546 | + <property name="alignment"> |
547 | + <set>Qt::AlignCenter</set> |
548 | + </property> |
549 | + </widget> |
550 | + <widget class="QComboBox" name="YearSelect"> |
551 | + <property name="geometry"> |
552 | + <rect> |
553 | + <x>30</x> |
554 | + <y>3</y> |
555 | + <width>70</width> |
556 | + <height>30</height> |
557 | + </rect> |
558 | + </property> |
559 | + <item> |
560 | + <property name="text"> |
561 | + <string>1900</string> |
562 | + </property> |
563 | + </item> |
564 | + <item> |
565 | + <property name="text"> |
566 | + <string>1901</string> |
567 | + </property> |
568 | + </item> |
569 | + <item> |
570 | + <property name="text"> |
571 | + <string>1902</string> |
572 | + </property> |
573 | + </item> |
574 | + <item> |
575 | + <property name="text"> |
576 | + <string>1903</string> |
577 | + </property> |
578 | + </item> |
579 | + <item> |
580 | + <property name="text"> |
581 | + <string>1904</string> |
582 | + </property> |
583 | + </item> |
584 | + <item> |
585 | + <property name="text"> |
586 | + <string>1905</string> |
587 | + </property> |
588 | + </item> |
589 | + <item> |
590 | + <property name="text"> |
591 | + <string>1906</string> |
592 | + </property> |
593 | + </item> |
594 | + <item> |
595 | + <property name="text"> |
596 | + <string>1907</string> |
597 | + </property> |
598 | + </item> |
599 | + <item> |
600 | + <property name="text"> |
601 | + <string>1908</string> |
602 | + </property> |
603 | + </item> |
604 | + <item> |
605 | + <property name="text"> |
606 | + <string>1909</string> |
607 | + </property> |
608 | + </item> |
609 | + <item> |
610 | + <property name="text"> |
611 | + <string>1910</string> |
612 | + </property> |
613 | + </item> |
614 | + <item> |
615 | + <property name="text"> |
616 | + <string>1911</string> |
617 | + </property> |
618 | + </item> |
619 | + <item> |
620 | + <property name="text"> |
621 | + <string>1912</string> |
622 | + </property> |
623 | + </item> |
624 | + <item> |
625 | + <property name="text"> |
626 | + <string>1913</string> |
627 | + </property> |
628 | + </item> |
629 | + <item> |
630 | + <property name="text"> |
631 | + <string>1914</string> |
632 | + </property> |
633 | + </item> |
634 | + <item> |
635 | + <property name="text"> |
636 | + <string>1915</string> |
637 | + </property> |
638 | + </item> |
639 | + <item> |
640 | + <property name="text"> |
641 | + <string>1916</string> |
642 | + </property> |
643 | + </item> |
644 | + <item> |
645 | + <property name="text"> |
646 | + <string>1917</string> |
647 | + </property> |
648 | + </item> |
649 | + <item> |
650 | + <property name="text"> |
651 | + <string>1918</string> |
652 | + </property> |
653 | + </item> |
654 | + <item> |
655 | + <property name="text"> |
656 | + <string>1919</string> |
657 | + </property> |
658 | + </item> |
659 | + <item> |
660 | + <property name="text"> |
661 | + <string>1920</string> |
662 | + </property> |
663 | + </item> |
664 | + <item> |
665 | + <property name="text"> |
666 | + <string>1921</string> |
667 | + </property> |
668 | + </item> |
669 | + <item> |
670 | + <property name="text"> |
671 | + <string>1922</string> |
672 | + </property> |
673 | + </item> |
674 | + <item> |
675 | + <property name="text"> |
676 | + <string>1923</string> |
677 | + </property> |
678 | + </item> |
679 | + <item> |
680 | + <property name="text"> |
681 | + <string>1924</string> |
682 | + </property> |
683 | + </item> |
684 | + <item> |
685 | + <property name="text"> |
686 | + <string>1925</string> |
687 | + </property> |
688 | + </item> |
689 | + <item> |
690 | + <property name="text"> |
691 | + <string>1926</string> |
692 | + </property> |
693 | + </item> |
694 | + <item> |
695 | + <property name="text"> |
696 | + <string>1927</string> |
697 | + </property> |
698 | + </item> |
699 | + <item> |
700 | + <property name="text"> |
701 | + <string>1928</string> |
702 | + </property> |
703 | + </item> |
704 | + <item> |
705 | + <property name="text"> |
706 | + <string>1929</string> |
707 | + </property> |
708 | + </item> |
709 | + <item> |
710 | + <property name="text"> |
711 | + <string>1930</string> |
712 | + </property> |
713 | + </item> |
714 | + <item> |
715 | + <property name="text"> |
716 | + <string>1931</string> |
717 | + </property> |
718 | + </item> |
719 | + <item> |
720 | + <property name="text"> |
721 | + <string>1932</string> |
722 | + </property> |
723 | + </item> |
724 | + <item> |
725 | + <property name="text"> |
726 | + <string>1933</string> |
727 | + </property> |
728 | + </item> |
729 | + <item> |
730 | + <property name="text"> |
731 | + <string>1934</string> |
732 | + </property> |
733 | + </item> |
734 | + <item> |
735 | + <property name="text"> |
736 | + <string>1935</string> |
737 | + </property> |
738 | + </item> |
739 | + <item> |
740 | + <property name="text"> |
741 | + <string>1936</string> |
742 | + </property> |
743 | + </item> |
744 | + <item> |
745 | + <property name="text"> |
746 | + <string>1937</string> |
747 | + </property> |
748 | + </item> |
749 | + <item> |
750 | + <property name="text"> |
751 | + <string>1938</string> |
752 | + </property> |
753 | + </item> |
754 | + <item> |
755 | + <property name="text"> |
756 | + <string>1939</string> |
757 | + </property> |
758 | + </item> |
759 | + <item> |
760 | + <property name="text"> |
761 | + <string>1940</string> |
762 | + </property> |
763 | + </item> |
764 | + <item> |
765 | + <property name="text"> |
766 | + <string>1941</string> |
767 | + </property> |
768 | + </item> |
769 | + <item> |
770 | + <property name="text"> |
771 | + <string>1942</string> |
772 | + </property> |
773 | + </item> |
774 | + <item> |
775 | + <property name="text"> |
776 | + <string>1943</string> |
777 | + </property> |
778 | + </item> |
779 | + <item> |
780 | + <property name="text"> |
781 | + <string>1944</string> |
782 | + </property> |
783 | + </item> |
784 | + <item> |
785 | + <property name="text"> |
786 | + <string>1945</string> |
787 | + </property> |
788 | + </item> |
789 | + <item> |
790 | + <property name="text"> |
791 | + <string>1946</string> |
792 | + </property> |
793 | + </item> |
794 | + <item> |
795 | + <property name="text"> |
796 | + <string>1947</string> |
797 | + </property> |
798 | + </item> |
799 | + <item> |
800 | + <property name="text"> |
801 | + <string>1948</string> |
802 | + </property> |
803 | + </item> |
804 | + <item> |
805 | + <property name="text"> |
806 | + <string>1949</string> |
807 | + </property> |
808 | + </item> |
809 | + <item> |
810 | + <property name="text"> |
811 | + <string>1950</string> |
812 | + </property> |
813 | + </item> |
814 | + <item> |
815 | + <property name="text"> |
816 | + <string>1951</string> |
817 | + </property> |
818 | + </item> |
819 | + <item> |
820 | + <property name="text"> |
821 | + <string>1952</string> |
822 | + </property> |
823 | + </item> |
824 | + <item> |
825 | + <property name="text"> |
826 | + <string>1953</string> |
827 | + </property> |
828 | + </item> |
829 | + <item> |
830 | + <property name="text"> |
831 | + <string>1954</string> |
832 | + </property> |
833 | + </item> |
834 | + <item> |
835 | + <property name="text"> |
836 | + <string>1955</string> |
837 | + </property> |
838 | + </item> |
839 | + <item> |
840 | + <property name="text"> |
841 | + <string>1956</string> |
842 | + </property> |
843 | + </item> |
844 | + <item> |
845 | + <property name="text"> |
846 | + <string>1957</string> |
847 | + </property> |
848 | + </item> |
849 | + <item> |
850 | + <property name="text"> |
851 | + <string>1958</string> |
852 | + </property> |
853 | + </item> |
854 | + <item> |
855 | + <property name="text"> |
856 | + <string>1959</string> |
857 | + </property> |
858 | + </item> |
859 | + <item> |
860 | + <property name="text"> |
861 | + <string>1960</string> |
862 | + </property> |
863 | + </item> |
864 | + <item> |
865 | + <property name="text"> |
866 | + <string>1961</string> |
867 | + </property> |
868 | + </item> |
869 | + <item> |
870 | + <property name="text"> |
871 | + <string>1962</string> |
872 | + </property> |
873 | + </item> |
874 | + <item> |
875 | + <property name="text"> |
876 | + <string>1963</string> |
877 | + </property> |
878 | + </item> |
879 | + <item> |
880 | + <property name="text"> |
881 | + <string>1964</string> |
882 | + </property> |
883 | + </item> |
884 | + <item> |
885 | + <property name="text"> |
886 | + <string>1965</string> |
887 | + </property> |
888 | + </item> |
889 | + <item> |
890 | + <property name="text"> |
891 | + <string>1966</string> |
892 | + </property> |
893 | + </item> |
894 | + <item> |
895 | + <property name="text"> |
896 | + <string>1967</string> |
897 | + </property> |
898 | + </item> |
899 | + <item> |
900 | + <property name="text"> |
901 | + <string>1968</string> |
902 | + </property> |
903 | + </item> |
904 | + <item> |
905 | + <property name="text"> |
906 | + <string>1969</string> |
907 | + </property> |
908 | + </item> |
909 | + <item> |
910 | + <property name="text"> |
911 | + <string>1970</string> |
912 | + </property> |
913 | + </item> |
914 | + <item> |
915 | + <property name="text"> |
916 | + <string>1971</string> |
917 | + </property> |
918 | + </item> |
919 | + <item> |
920 | + <property name="text"> |
921 | + <string>1972</string> |
922 | + </property> |
923 | + </item> |
924 | + <item> |
925 | + <property name="text"> |
926 | + <string>1973</string> |
927 | + </property> |
928 | + </item> |
929 | + <item> |
930 | + <property name="text"> |
931 | + <string>1974</string> |
932 | + </property> |
933 | + </item> |
934 | + <item> |
935 | + <property name="text"> |
936 | + <string>1975</string> |
937 | + </property> |
938 | + </item> |
939 | + <item> |
940 | + <property name="text"> |
941 | + <string>1976</string> |
942 | + </property> |
943 | + </item> |
944 | + <item> |
945 | + <property name="text"> |
946 | + <string>1977</string> |
947 | + </property> |
948 | + </item> |
949 | + <item> |
950 | + <property name="text"> |
951 | + <string>1978</string> |
952 | + </property> |
953 | + </item> |
954 | + <item> |
955 | + <property name="text"> |
956 | + <string>1979</string> |
957 | + </property> |
958 | + </item> |
959 | + <item> |
960 | + <property name="text"> |
961 | + <string>1980</string> |
962 | + </property> |
963 | + </item> |
964 | + <item> |
965 | + <property name="text"> |
966 | + <string>1981</string> |
967 | + </property> |
968 | + </item> |
969 | + <item> |
970 | + <property name="text"> |
971 | + <string>1982</string> |
972 | + </property> |
973 | + </item> |
974 | + <item> |
975 | + <property name="text"> |
976 | + <string>1983</string> |
977 | + </property> |
978 | + </item> |
979 | + <item> |
980 | + <property name="text"> |
981 | + <string>1984</string> |
982 | + </property> |
983 | + </item> |
984 | + <item> |
985 | + <property name="text"> |
986 | + <string>1985</string> |
987 | + </property> |
988 | + </item> |
989 | + <item> |
990 | + <property name="text"> |
991 | + <string>1986</string> |
992 | + </property> |
993 | + </item> |
994 | + <item> |
995 | + <property name="text"> |
996 | + <string>1987</string> |
997 | + </property> |
998 | + </item> |
999 | + <item> |
1000 | + <property name="text"> |
1001 | + <string>1988</string> |
1002 | + </property> |
1003 | + </item> |
1004 | + <item> |
1005 | + <property name="text"> |
1006 | + <string>1989</string> |
1007 | + </property> |
1008 | + </item> |
1009 | + <item> |
1010 | + <property name="text"> |
1011 | + <string>1990</string> |
1012 | + </property> |
1013 | + </item> |
1014 | + <item> |
1015 | + <property name="text"> |
1016 | + <string>1991</string> |
1017 | + </property> |
1018 | + </item> |
1019 | + <item> |
1020 | + <property name="text"> |
1021 | + <string>1992</string> |
1022 | + </property> |
1023 | + </item> |
1024 | + <item> |
1025 | + <property name="text"> |
1026 | + <string>1993</string> |
1027 | + </property> |
1028 | + </item> |
1029 | + <item> |
1030 | + <property name="text"> |
1031 | + <string>1994</string> |
1032 | + </property> |
1033 | + </item> |
1034 | + <item> |
1035 | + <property name="text"> |
1036 | + <string>1995</string> |
1037 | + </property> |
1038 | + </item> |
1039 | + <item> |
1040 | + <property name="text"> |
1041 | + <string>1996</string> |
1042 | + </property> |
1043 | + </item> |
1044 | + <item> |
1045 | + <property name="text"> |
1046 | + <string>1997</string> |
1047 | + </property> |
1048 | + </item> |
1049 | + <item> |
1050 | + <property name="text"> |
1051 | + <string>1998</string> |
1052 | + </property> |
1053 | + </item> |
1054 | + <item> |
1055 | + <property name="text"> |
1056 | + <string>1999</string> |
1057 | + </property> |
1058 | + </item> |
1059 | + <item> |
1060 | + <property name="text"> |
1061 | + <string>2000</string> |
1062 | + </property> |
1063 | + </item> |
1064 | + <item> |
1065 | + <property name="text"> |
1066 | + <string>2001</string> |
1067 | + </property> |
1068 | + </item> |
1069 | + <item> |
1070 | + <property name="text"> |
1071 | + <string>2002</string> |
1072 | + </property> |
1073 | + </item> |
1074 | + <item> |
1075 | + <property name="text"> |
1076 | + <string>2003</string> |
1077 | + </property> |
1078 | + </item> |
1079 | + <item> |
1080 | + <property name="text"> |
1081 | + <string>2004</string> |
1082 | + </property> |
1083 | + </item> |
1084 | + <item> |
1085 | + <property name="text"> |
1086 | + <string>2005</string> |
1087 | + </property> |
1088 | + </item> |
1089 | + <item> |
1090 | + <property name="text"> |
1091 | + <string>2006</string> |
1092 | + </property> |
1093 | + </item> |
1094 | + <item> |
1095 | + <property name="text"> |
1096 | + <string>2007</string> |
1097 | + </property> |
1098 | + </item> |
1099 | + <item> |
1100 | + <property name="text"> |
1101 | + <string>2008</string> |
1102 | + </property> |
1103 | + </item> |
1104 | + <item> |
1105 | + <property name="text"> |
1106 | + <string>2009</string> |
1107 | + </property> |
1108 | + </item> |
1109 | + <item> |
1110 | + <property name="text"> |
1111 | + <string>2010</string> |
1112 | + </property> |
1113 | + </item> |
1114 | + <item> |
1115 | + <property name="text"> |
1116 | + <string>2011</string> |
1117 | + </property> |
1118 | + </item> |
1119 | + <item> |
1120 | + <property name="text"> |
1121 | + <string>2012</string> |
1122 | + </property> |
1123 | + </item> |
1124 | + <item> |
1125 | + <property name="text"> |
1126 | + <string>2013</string> |
1127 | + </property> |
1128 | + </item> |
1129 | + <item> |
1130 | + <property name="text"> |
1131 | + <string>2014</string> |
1132 | + </property> |
1133 | + </item> |
1134 | + <item> |
1135 | + <property name="text"> |
1136 | + <string>2015</string> |
1137 | + </property> |
1138 | + </item> |
1139 | + <item> |
1140 | + <property name="text"> |
1141 | + <string>2016</string> |
1142 | + </property> |
1143 | + </item> |
1144 | + <item> |
1145 | + <property name="text"> |
1146 | + <string>2017</string> |
1147 | + </property> |
1148 | + </item> |
1149 | + <item> |
1150 | + <property name="text"> |
1151 | + <string>2018</string> |
1152 | + </property> |
1153 | + </item> |
1154 | + <item> |
1155 | + <property name="text"> |
1156 | + <string>2019</string> |
1157 | + </property> |
1158 | + </item> |
1159 | + <item> |
1160 | + <property name="text"> |
1161 | + <string>2020</string> |
1162 | + </property> |
1163 | + </item> |
1164 | + <item> |
1165 | + <property name="text"> |
1166 | + <string>2021</string> |
1167 | + </property> |
1168 | + </item> |
1169 | + <item> |
1170 | + <property name="text"> |
1171 | + <string>2022</string> |
1172 | + </property> |
1173 | + </item> |
1174 | + <item> |
1175 | + <property name="text"> |
1176 | + <string>2023</string> |
1177 | + </property> |
1178 | + </item> |
1179 | + <item> |
1180 | + <property name="text"> |
1181 | + <string>2024</string> |
1182 | + </property> |
1183 | + </item> |
1184 | + <item> |
1185 | + <property name="text"> |
1186 | + <string>2025</string> |
1187 | + </property> |
1188 | + </item> |
1189 | + <item> |
1190 | + <property name="text"> |
1191 | + <string>2026</string> |
1192 | + </property> |
1193 | + </item> |
1194 | + <item> |
1195 | + <property name="text"> |
1196 | + <string>2027</string> |
1197 | + </property> |
1198 | + </item> |
1199 | + <item> |
1200 | + <property name="text"> |
1201 | + <string>2028</string> |
1202 | + </property> |
1203 | + </item> |
1204 | + <item> |
1205 | + <property name="text"> |
1206 | + <string>2029</string> |
1207 | + </property> |
1208 | + </item> |
1209 | + <item> |
1210 | + <property name="text"> |
1211 | + <string>2030</string> |
1212 | + </property> |
1213 | + </item> |
1214 | + <item> |
1215 | + <property name="text"> |
1216 | + <string>2031</string> |
1217 | + </property> |
1218 | + </item> |
1219 | + <item> |
1220 | + <property name="text"> |
1221 | + <string>2032</string> |
1222 | + </property> |
1223 | + </item> |
1224 | + <item> |
1225 | + <property name="text"> |
1226 | + <string>2033</string> |
1227 | + </property> |
1228 | + </item> |
1229 | + <item> |
1230 | + <property name="text"> |
1231 | + <string>2034</string> |
1232 | + </property> |
1233 | + </item> |
1234 | + <item> |
1235 | + <property name="text"> |
1236 | + <string>2035</string> |
1237 | + </property> |
1238 | + </item> |
1239 | + <item> |
1240 | + <property name="text"> |
1241 | + <string>2036</string> |
1242 | + </property> |
1243 | + </item> |
1244 | + <item> |
1245 | + <property name="text"> |
1246 | + <string>2037</string> |
1247 | + </property> |
1248 | + </item> |
1249 | + <item> |
1250 | + <property name="text"> |
1251 | + <string>2038</string> |
1252 | + </property> |
1253 | + </item> |
1254 | + <item> |
1255 | + <property name="text"> |
1256 | + <string>2039</string> |
1257 | + </property> |
1258 | + </item> |
1259 | + <item> |
1260 | + <property name="text"> |
1261 | + <string>2040</string> |
1262 | + </property> |
1263 | + </item> |
1264 | + <item> |
1265 | + <property name="text"> |
1266 | + <string>2041</string> |
1267 | + </property> |
1268 | + </item> |
1269 | + <item> |
1270 | + <property name="text"> |
1271 | + <string>2042</string> |
1272 | + </property> |
1273 | + </item> |
1274 | + <item> |
1275 | + <property name="text"> |
1276 | + <string>2043</string> |
1277 | + </property> |
1278 | + </item> |
1279 | + <item> |
1280 | + <property name="text"> |
1281 | + <string>2044</string> |
1282 | + </property> |
1283 | + </item> |
1284 | + <item> |
1285 | + <property name="text"> |
1286 | + <string>2045</string> |
1287 | + </property> |
1288 | + </item> |
1289 | + <item> |
1290 | + <property name="text"> |
1291 | + <string>2046</string> |
1292 | + </property> |
1293 | + </item> |
1294 | + <item> |
1295 | + <property name="text"> |
1296 | + <string>2047</string> |
1297 | + </property> |
1298 | + </item> |
1299 | + <item> |
1300 | + <property name="text"> |
1301 | + <string>2048</string> |
1302 | + </property> |
1303 | + </item> |
1304 | + <item> |
1305 | + <property name="text"> |
1306 | + <string>2049</string> |
1307 | + </property> |
1308 | + </item> |
1309 | + <item> |
1310 | + <property name="text"> |
1311 | + <string>2050</string> |
1312 | + </property> |
1313 | + </item> |
1314 | + </widget> |
1315 | + <widget class="QLabel" name="label_17"> |
1316 | + <property name="geometry"> |
1317 | + <rect> |
1318 | + <x>400</x> |
1319 | + <y>215</y> |
1320 | + <width>55</width> |
1321 | + <height>100</height> |
1322 | + </rect> |
1323 | + </property> |
1324 | + <property name="text"> |
1325 | + <string/> |
1326 | + </property> |
1327 | + <property name="alignment"> |
1328 | + <set>Qt::AlignHCenter|Qt::AlignTop</set> |
1329 | + </property> |
1330 | + </widget> |
1331 | + <widget class="QLabel" name="label_18"> |
1332 | + <property name="geometry"> |
1333 | + <rect> |
1334 | + <x>455</x> |
1335 | + <y>215</y> |
1336 | + <width>55</width> |
1337 | + <height>100</height> |
1338 | + </rect> |
1339 | + </property> |
1340 | + <property name="text"> |
1341 | + <string/> |
1342 | + </property> |
1343 | + <property name="alignment"> |
1344 | + <set>Qt::AlignHCenter|Qt::AlignTop</set> |
1345 | + </property> |
1346 | + </widget> |
1347 | + <widget class="QLabel" name="label_19"> |
1348 | + <property name="geometry"> |
1349 | + <rect> |
1350 | + <x>20</x> |
1351 | + <y>320</y> |
1352 | + <width>120</width> |
1353 | + <height>20</height> |
1354 | + </rect> |
1355 | + </property> |
1356 | + <property name="text"> |
1357 | + <string>TextLabel</string> |
1358 | + </property> |
1359 | + <property name="alignment"> |
1360 | + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> |
1361 | + </property> |
1362 | + </widget> |
1363 | + </widget> |
1364 | + <resources/> |
1365 | + <connections/> |
1366 | +</ui> |
1367 | |
1368 | === renamed file 'calendar.ui' => 'calendar.ui.moved' |
1369 | === added file 'ccbo.cpp' |
1370 | --- ccbo.cpp 1970-01-01 00:00:00 +0000 |
1371 | +++ ccbo.cpp 2013-05-06 14:54:28 +0000 |
1372 | @@ -0,0 +1,490 @@ |
1373 | +/* |
1374 | + * This file is part of the chinese-calendar project |
1375 | + * The code reference to "Chinese Traditional Calendar Library" |
1376 | + * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd |
1377 | + * |
1378 | + * This program is free software: you can redistribute it and/or modify |
1379 | + * it under the terms of the GNU General Public License version 3 as |
1380 | + * published by the Free Software Foundation. |
1381 | + * |
1382 | + * This program is distributed in the hope that it will be useful, |
1383 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1384 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1385 | + * GNU General Public License for more details. |
1386 | + * |
1387 | + * You should have received a copy of the GNU General Public License |
1388 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1389 | + * |
1390 | + * This project is developed by "UbuntuKylin Members" team, |
1391 | + * see <https://launchpad.net/~ubuntukylin~members> |
1392 | + * Authors: Abel Liu <guiltyritter@gmail.com> |
1393 | + * Shine Huang <hostc@163.com> |
1394 | + */ |
1395 | +/* |
1396 | +* Chinese Tradional Calendar Library |
1397 | +* Copyright (C) 2002-2003 Wang Yang |
1398 | +* Copyright (C) 2003 donaldzju@zju.edu.cn |
1399 | +*/ |
1400 | + |
1401 | +#include "ccbo.h" |
1402 | + |
1403 | +CCBO::CCBO(void){} |
1404 | +CCBO::~CCBO(void){} |
1405 | + |
1406 | +int CCBO::ctcl_calendar_type(int y, int m, int d, int opt) |
1407 | +{ |
1408 | + int days_of_month[13]={0,31,28,31,30,31,30,31,30,30,31,30,31}; |
1409 | + if(opt==1){ |
1410 | + if(y>1582 || (y==1582 && m>10) || (y==1582 && m==10 && d>14) ){ |
1411 | + if( (y%400==0) || (y%4==0 && y%100!=0) )days_of_month[2]++; |
1412 | + if(m>0 && m<=12 && d>0 && d<=days_of_month[m]) |
1413 | + return(1); |
1414 | + else |
1415 | + return(-1); |
1416 | + }else if(y==1582 && m==10 && d>=5 && d<=14){ |
1417 | + return(-1); |
1418 | + }else{ |
1419 | + if(y%4==0)days_of_month[2]++; |
1420 | + if(m>0 && m<=12 && d>0 && d<=days_of_month[m]) |
1421 | + return(0); |
1422 | + else |
1423 | + return(-1); |
1424 | + } |
1425 | + } |
1426 | + |
1427 | + if(opt==2) |
1428 | + return(1); |
1429 | + return(0); |
1430 | +} |
1431 | + |
1432 | +int CCBO::ctcl_date_to_days(int y,int m,int d) |
1433 | +{ |
1434 | + int days=0,i; |
1435 | + int type=ctcl_calendar_type(y,m,d,1); |
1436 | + int dm[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};//Days of each month |
1437 | + if(type!=0){ |
1438 | + if( (y%100!=0 && y%4==0) || (y%400==0) ) |
1439 | + dm[2]+=1; |
1440 | + }else{ |
1441 | + if(y%4==0) |
1442 | + dm[2]+=1; |
1443 | + } |
1444 | + for(i=0;i<=m-1;i++){ |
1445 | + days+=dm[i]; |
1446 | + } |
1447 | + days+=d; |
1448 | + if(y==1582){ |
1449 | + if(type==1) |
1450 | + days-=10; |
1451 | + if(type==-1) |
1452 | + days=-1; |
1453 | + } |
1454 | + return days; |
1455 | +} |
1456 | + |
1457 | +int CCBO::ctcl_days_to_date(int y,int x) |
1458 | +{ |
1459 | + int m=1; |
1460 | + int i; |
1461 | + for(i=1;i<=12;i++){ |
1462 | + int d=ctcl_date_to_days(y,i+1,1)-ctcl_date_to_days(y,i,1); |
1463 | + if(x<=d || i==12){ |
1464 | + m=i; |
1465 | + break; |
1466 | + }else{ |
1467 | + x-=d; |
1468 | + } |
1469 | + } |
1470 | + return 100*m+x; |
1471 | +} |
1472 | + |
1473 | +int CCBO::days_from_era(int y) |
1474 | +{ |
1475 | + int days=(y-1)*365 + (y-1)/4; |
1476 | + if(y>1582) |
1477 | + days+= -((y-1)/100) + (y-1)/400; |
1478 | + return days; |
1479 | +} |
1480 | + |
1481 | +int CCBO::ctcl_standard_days(int y,int m,int d) |
1482 | +{ |
1483 | + int days=(y-1)*365 + (y-1)/4 + ctcl_date_to_days(y,m,d) - 2; |
1484 | + if(y>1582) |
1485 | + days+= -((y-1)/100) + ((y-1)/400) + 2; |
1486 | + return days; |
1487 | +} |
1488 | + |
1489 | +double CCBO::ctcl_julian_day(int y,int m,int d,int h,int min,int sec,int zone) |
1490 | +{ |
1491 | + int type=ctcl_calendar_type(y,m,d,1); |
1492 | + double jt=(h+(min+sec/60.0)/60.0)/24.0-0.5-zone/24.0; |
1493 | + double jd=(type!=0) ? (ctcl_standard_days(y,m,d)+1721425+jt) : |
1494 | + (ctcl_standard_days(y,m,d)+1721425+jt); |
1495 | + return jd; |
1496 | +} |
1497 | + |
1498 | +int CCBO::ctcl_day_of_week(int y,int m,int d) |
1499 | +{ |
1500 | + return ctcl_standard_days(y,m,d)%7; |
1501 | +} |
1502 | + |
1503 | +double CCBO::ctcl_solar_term(int y,int n,int t) |
1504 | +{ |
1505 | + double jd = y * (365.2423112 - 6.4e-14*(y-100)*(y-100) - 3.047e-8*(y-100)) |
1506 | + + 15.218427 * n + 1721050.71301; |
1507 | + double zeta = 3.0e-4 * y - 0.372781384 - 0.2617913325 * n; |
1508 | + double yd = ( 1.945 * sin(zeta) - 0.01206 * sin(2*zeta) ) |
1509 | + * ( 1.048994 - 2.583e-5 *y ); |
1510 | + double sd =-18e-4*sin(2.313908653*y-0.439822951-3.0443*n); |
1511 | + return (t==1)?(jd+yd+sd-ctcl_standard_days(y,1,0)-1721425) |
1512 | + :(jd-ctcl_standard_days(y,1,0)-1721425); |
1513 | +} |
1514 | + |
1515 | +double CCBO::ctcl_tail(double x) |
1516 | +{ |
1517 | + return x-floor(x); |
1518 | +} |
1519 | + |
1520 | +double CCBO::ctcl_rem(double x,double w) |
1521 | +{ |
1522 | + return ctcl_tail(x/w)*w; |
1523 | +} |
1524 | + |
1525 | +double CCBO::ctcl_round(double x){ |
1526 | + return floor(x+0.5); |
1527 | +} |
1528 | + |
1529 | +int CCBO::ctcl_gan(int x) |
1530 | +{ |
1531 | + return x%10; |
1532 | +} |
1533 | + |
1534 | +int CCBO::ctcl_zhi(int x) |
1535 | +{ |
1536 | + return x%12; |
1537 | +} |
1538 | + |
1539 | +int CCBO::ctcl_year_ganzhi(int y,int m,int d,int h) |
1540 | +{ |
1541 | + if ( (ctcl_date_to_days(y,m,d)+h/24.0) |
1542 | + < ctcl_solar_term(y,3,1)-1.0 ) |
1543 | + y-=1; |
1544 | + return ctcl_round( ctcl_rem(y-3.0,60.0) ); |
1545 | +} |
1546 | + |
1547 | +double CCBO::ang(double x,double t,double c1,double t0,double t2,double t3) |
1548 | +{ |
1549 | + return ctcl_tail(c1*x)*2*M_PI+t0-t2*t*t-t3*t*t*t; |
1550 | +} |
1551 | + |
1552 | +int CCBO::ctcl_lunar_date(int y,int m,int d) |
1553 | +{ |
1554 | + int lunar_date=-1; |
1555 | + const double rpi=180/M_PI; |
1556 | + const double zone=8.0; |
1557 | + double t=(y-1899.5)/100.0; |
1558 | + double ms=floor((y-1900)*12.3685); |
1559 | + double f0=ang(ms,t,0,0.75933,2.172e-4,1.55e-7) |
1560 | + +0.53058868*ms-8.37e-4*t+zone/24.0+0.5; |
1561 | + double fc=0.1734-3.93e-4*t; |
1562 | + double j0=693595+29*ms; |
1563 | + double aa0=ang(ms,t,0.08084821133,359.2242/rpi, |
1564 | + 0.0000333/rpi,0.00000347/rpi); |
1565 | + double ab0=ang(ms,t,7.171366127999999e-2,306.0253/rpi, |
1566 | + -0.0107306/rpi,-0.00001236/rpi); |
1567 | + double ac0=ang(ms,t,0.08519585128,21.2964/rpi, |
1568 | + 0.0016528/rpi,0.00000239/rpi); |
1569 | + int i; |
1570 | + for(i=-1;i<=13;i+=1){ |
1571 | + double aa=aa0+0.507984293*i; |
1572 | + double ab=ab0+6.73377553*i; |
1573 | + double ac=ac0+6.818486628*i; |
1574 | + double f1=f0+1.53058868*i+fc*sin(aa)-0.4068*sin(ab)+0.0021*sin(2*aa) |
1575 | + +0.0161*sin(2*ab)+0.0104*sin(2*ac)-0.0074*sin(aa-ab)-0.0051*sin(aa+ab); |
1576 | + double j=j0+28*i+f1; |
1577 | + int diff=ctcl_standard_days(y,m,d)-floor(j); |
1578 | + if( diff>=0 && diff<=29 ) |
1579 | + lunar_date=diff+1; |
1580 | + } |
1581 | + return(lunar_date); |
1582 | +} |
1583 | + |
1584 | +int CCBO::ctcl_leap_month(int y) |
1585 | +{ |
1586 | + char leap=lunarstr.mid(y-beginning_year,2).at(0); |
1587 | + if(leap=='a') |
1588 | + leap='0'+10; |
1589 | + if(leap=='b') |
1590 | + leap='0'+11; |
1591 | + if(leap=='c') |
1592 | + leap='0'+12; |
1593 | + return leap-'0'; |
1594 | +} |
1595 | + |
1596 | +int CCBO::ctcl_lunar_month(int y,int m,int d) |
1597 | +{ |
1598 | + double lunar_date=ctcl_lunar_date(y,m,d); |
1599 | + int lunar_days=lunar_date-floor(lunar_date/100)*100; |
1600 | + int leap_num=0; |
1601 | + int i; |
1602 | + int non_leap; |
1603 | + int lunar_month; |
1604 | + |
1605 | + for(i=-849;i<=y;i++){ |
1606 | + if(ctcl_leap_month(i)!=0) |
1607 | + leap_num++; |
1608 | + } |
1609 | + |
1610 | + non_leap=ctcl_round((ctcl_standard_days(y,m,d) |
1611 | + -ctcl_standard_days(-849,1,21) |
1612 | + -lunar_days)/29.530588)-leap_num; |
1613 | + |
1614 | + if(y<=240) non_leap++; |
1615 | + if(y<=237) non_leap--; |
1616 | + if(y<24) non_leap++; |
1617 | + if(y<9) non_leap--; |
1618 | + if(y<=-255) non_leap++; |
1619 | + if(y<=-256) non_leap+=2; |
1620 | + if(y<=-722) non_leap++; |
1621 | + |
1622 | + lunar_month=ctcl_round(ctcl_rem(non_leap-3.0,12.0)+1.0); |
1623 | + if(lunar_month==ctcl_leap_month(y-1) && m==1 && d<lunar_days) |
1624 | + lunar_month*=-1; |
1625 | + else if(lunar_month==ctcl_leap_month(y)) |
1626 | + lunar_month*=-1; |
1627 | + else if(lunar_month<ctcl_leap_month(y) || ( m<lunar_month && ctcl_leap_month(y) ) ) |
1628 | + lunar_month++; |
1629 | + else lunar_month=ctcl_round(ctcl_rem(lunar_month-1,12)+1); |
1630 | + |
1631 | + return lunar_month; |
1632 | +} |
1633 | +QString CCBO::ctcl_displaydata(int y, int m, int d) |
1634 | +{ |
1635 | + QString QueryStr; |
1636 | + QString data; |
1637 | + QueryStr=QString("select note from cnote where y=%1 and m=%2 and d=%3").arg(y).arg(m).arg(d); |
1638 | + data=ctcl_common_query("cnote",QueryStr); |
1639 | + return data; |
1640 | +} |
1641 | + |
1642 | +int CCBO::ctcl_savenote(int y,int m, int d ,QString textedit) |
1643 | +{ |
1644 | + QString QueryStr; |
1645 | + QString InsertStr; |
1646 | + QString UpdateStr; |
1647 | + QString note; |
1648 | + QString insert; |
1649 | + QueryStr=QString("select note from cnote where y=%1 and m=%2 and d=%3").arg(y).arg(m).arg(d); |
1650 | + note=ctcl_common_query("cnote",QueryStr); |
1651 | + if(textedit.isEmpty()&¬e.isEmpty()) |
1652 | + return 0; |
1653 | + if(note.isEmpty()) |
1654 | + { InsertStr=QString("INSERT INTO cnote(y,m,d,note) VALUES(%1,%2,%3,'%4');").arg(y).arg(m).arg(d).arg(textedit); |
1655 | + ctcl_common_query("cnote",InsertStr); |
1656 | + }else{ |
1657 | + UpdateStr=QString("UPDATE cnote SET note = '%4' where y=%1 and m=%2 and d=%3").arg(y).arg(m).arg(d).arg(textedit); |
1658 | + ctcl_common_query("cnote",UpdateStr); |
1659 | + } |
1660 | +} |
1661 | + |
1662 | +int CCBO::ctcl_solar_to_lunar(int y,int m,int d,struct CCalendar* ctc) |
1663 | +{ |
1664 | + int r,i; |
1665 | + char buf[10]; |
1666 | + ::qsnprintf(buf, 10, "%02d%02d", m,d); |
1667 | + QString MD = QString::fromAscii(buf); |
1668 | + QString QueryStr; |
1669 | + |
1670 | + QueryStr=QString("select Ji from yiji where Year=%1 and Month=%2 and Day=%3").arg(y).arg(m).arg(d); |
1671 | + ctc->ji=ctcl_common_query("yiji",QueryStr); |
1672 | + QueryStr=QString("select Yi from yiji where Year=%1 and Month=%2 and Day=%3").arg(y).arg(m).arg(d); |
1673 | + ctc->yi=ctcl_common_query("yiji",QueryStr); |
1674 | + |
1675 | + |
1676 | + QueryStr=QString("select VALUE from holiday where DATA='"+MD+"'"); |
1677 | + ctc->holiday=ctcl_common_query("holiday",QueryStr); |
1678 | + |
1679 | + int type=ctcl_calendar_type(y,m,d,1); |
1680 | + QueryStr=QString("select VALUE from caltype where ID=%1").arg(type); |
1681 | + ctc->caltype=ctcl_common_query("caltype",QueryStr); |
1682 | + |
1683 | + if(type==-1)return -1; |
1684 | + |
1685 | + QueryStr=QString("select VALUE from weekday where ID=%1").arg(ctcl_day_of_week(y,m,d)); |
1686 | + ctc->weekday=ctcl_common_query("weekday",QueryStr); |
1687 | + |
1688 | + QueryStr=QString("select VALUE from zodiac where DATEB<=%1 and DATEE>=%2").arg(MD.toInt()).arg(MD.toInt()); |
1689 | + |
1690 | + ctc->zodiac=ctcl_common_query("zodiac",QueryStr); |
1691 | + |
1692 | + if(ctc->zodiac.isEmpty()) |
1693 | + { |
1694 | + QueryStr=QString("select VALUE from zodiac where DATEB<=%1 and %2<=1231").arg(MD.toInt()).arg(MD.toInt()); |
1695 | + ctc->zodiac=ctcl_common_query("zodiac",QueryStr); |
1696 | + if(ctc->zodiac.isEmpty()) |
1697 | + { |
1698 | + QueryStr=QString("select VALUE from zodiac where DATEB>=101 and DATEE<=119"); |
1699 | + ctc->zodiac=ctcl_common_query("zodiac",QueryStr); |
1700 | + } |
1701 | + } |
1702 | + ctc->gan=ctcl_gan(ctcl_year_ganzhi(y,m,d,12)); |
1703 | + ctc->zhi=ctcl_zhi(ctcl_year_ganzhi(y,m,d,12)); |
1704 | + |
1705 | + |
1706 | + QueryStr=QString("select VALUE from tiangan where ID=%1").arg(ctc->gan); |
1707 | + ctc->ganzhi=ctcl_common_query("gan",QueryStr); |
1708 | + QueryStr=QString("select VALUE from dizhi where ID=%1").arg(ctc->zhi); |
1709 | + ctc->ganzhi.append(ctcl_common_query("zhi",QueryStr)); |
1710 | + |
1711 | + QueryStr=QString("select VALUE from shengxiao where ID=%1").arg(ctc->zhi); |
1712 | + ctc->shengxiao=ctcl_common_query("shengxiao",QueryStr); |
1713 | + |
1714 | + for(i=0;i<24;i++){ |
1715 | + r=ctcl_days_to_date(y,ctcl_solar_term(y,i+1,1)); |
1716 | + if(r>=m*100+d){ |
1717 | + QueryStr=QString("select VALUE from sterm where ID=%1").arg(i); |
1718 | + ctc->sterm=ctcl_common_query("sterm",QueryStr); |
1719 | + if(r!=m*100+d){ |
1720 | + ctc->sterm.insert(0,QString("%1%2").arg(r/10%10).arg(r%10)+QString::fromUtf8("\346\227\245")); |
1721 | + } |
1722 | + ctc->laststerm = false; |
1723 | + break; |
1724 | + }else if(i==23){ |
1725 | + QueryStr=QString("select VALUE from sterm where ID=0"); |
1726 | + ctc->sterm=ctcl_common_query("sterm",QueryStr); |
1727 | + r=ctcl_days_to_date(y+1,ctcl_solar_term(y+1,1,1)); |
1728 | + ctc->laststerm = true; |
1729 | + } |
1730 | + } |
1731 | + |
1732 | + if(y>=maxyear){ |
1733 | + ctc->day=0; |
1734 | + ctc->month=0; |
1735 | + ctc->cday=tr("unknown"); |
1736 | + ctc->cmonth=tr("no data"); |
1737 | + return 0; |
1738 | + } |
1739 | + |
1740 | + ctc->day=ctcl_lunar_date(y,m,d); |
1741 | + if(ctc->day<=10){ |
1742 | + QueryStr=QString("select VALUE from cnumber where ID=%1").arg(ctc->day); |
1743 | + ctc->cday=QString::fromUtf8("\345\210\235")+ctcl_common_query("day",QueryStr); |
1744 | + }else if(ctc->day<20){ |
1745 | + QueryStr=QString("select VALUE from cnumber where ID=%1").arg(ctc->day%10); |
1746 | + ctc->cday=QString::fromUtf8("\345\215\201")+ctcl_common_query("day",QueryStr); |
1747 | + }else if(ctc->day==20){ |
1748 | + ctc->cday=QString::fromUtf8("\344\272\214\345\215\201"); |
1749 | + }else if(ctc->day<30){ |
1750 | + QueryStr=QString("select VALUE from cnumber where ID=%1").arg(ctc->day%10); |
1751 | + ctc->cday=QString::fromUtf8("\345\273\277")+ctcl_common_query("day",QueryStr); |
1752 | + }else if(ctc->day==30){ |
1753 | + ctc->cday=QString::fromUtf8("\344\270\211\345\215\201"); |
1754 | + } |
1755 | + |
1756 | + ctc->month=ctcl_lunar_month(y,m,d); |
1757 | + if(ctc->month==-12){ |
1758 | + ctc->cmonth=QString::fromUtf8("\351\227\260\345\215\201\344\272\214\346\234\210"); |
1759 | + }else if(ctc->month==-11){ |
1760 | + ctc->cmonth=QString::fromUtf8("\351\227\260\345\215\201\344\270\200\346\234\210"); |
1761 | + }else if(ctc->month==-1){ |
1762 | + ctc->cmonth=QString::fromUtf8("\351\227\260\346\255\243\346\234\210"); |
1763 | + }else if(ctc->month<0){ |
1764 | + ctc->cmonth=QString::fromUtf8("\351\227\260"); |
1765 | + QueryStr=QString("select VALUE from cnumber where ID=%1").arg(-ctc->month); |
1766 | + ctc->cmonth.append(ctcl_common_query("month",QueryStr)); |
1767 | + ctc->cmonth.append(QString::fromUtf8("\346\234\210")); |
1768 | + }else if(ctc->month==13){ |
1769 | + ctc->cmonth=QString::fromUtf8("\346\255\243\346\234\210"); |
1770 | + }else{ |
1771 | + QueryStr=QString("select VALUE from cnumber where ID=%1").arg(ctc->month); |
1772 | + ctc->cmonth=ctcl_common_query("month",QueryStr); |
1773 | + ctc->cmonth.append(QString::fromUtf8("\346\234\210")); |
1774 | + } |
1775 | + memset(buf,0x00,sizeof(buf)); |
1776 | + if(qAbs(ctc->month)<13) |
1777 | + ::qsnprintf(buf, 10, "%02d%02d", qAbs(ctc->month),ctc->day); |
1778 | + else if(qAbs(ctc->month)==13) |
1779 | + ::qsnprintf(buf, 10, "%02d%02d", 1,ctc->day); |
1780 | + MD = QString::fromAscii(buf); |
1781 | + if(ctc->month>0){ |
1782 | + QueryStr=QString("select VALUE from choliday where DATA='"+MD+"'"); |
1783 | + ctc->choliday=ctcl_common_query("choliday",QueryStr); |
1784 | + //logSqlError("choliday",QueryStr); |
1785 | + } |
1786 | + if(ctc->month>0&&!(ctc->choliday.isEmpty())) |
1787 | + ctc->ischoliday=true; |
1788 | + else |
1789 | + ctc->ischoliday=false; |
1790 | + return 1; |
1791 | +} |
1792 | + |
1793 | +bool CCBO::InitConnection(QString Path) |
1794 | +{ |
1795 | + QString QueryStr; |
1796 | + QString systempath,systemdirectory; |
1797 | + QStringList env = QProcess::systemEnvironment().filter(QRegExp("^XDG_DATA_HOME=")); |
1798 | + if (env.length() == 0) { |
1799 | + systemdirectory = QDir::homePath() + "/.local/share"; |
1800 | + } else { |
1801 | + systemdirectory = env.at(0); |
1802 | + systemdirectory = systemdirectory.mid(systemdirectory.indexOf("=") + 1); |
1803 | + if (systemdirectory.isEmpty()) { |
1804 | + systemdirectory = QDir::homePath() + "/.local/share"; |
1805 | + } |
1806 | + } |
1807 | + |
1808 | + systemdirectory = QString("%1/chinese-calendar").arg(systemdirectory); |
1809 | + systempath = QString("%1/KylinLunar.db").arg(systemdirectory); |
1810 | + |
1811 | + if(!QFile::exists(systempath)) |
1812 | + { |
1813 | + QDir d; |
1814 | + if (d.mkpath(systemdirectory) == false) { |
1815 | + return false; |
1816 | + } |
1817 | + if (QFile::copy("/usr/share/chinese-calendar/db/KylinLunar.db", systempath) == false) { |
1818 | + return false; |
1819 | + } |
1820 | + } |
1821 | + |
1822 | + QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); |
1823 | + db.setDatabaseName(systempath); |
1824 | + |
1825 | + if (!db.open()) { |
1826 | + return false; |
1827 | + } |
1828 | + |
1829 | + QSqlQuery query; |
1830 | + query.exec("select * from lunar where MaxYear=2100"); |
1831 | + query.last(); |
1832 | + maxyear=query.value(0).toInt(); |
1833 | + lunarstr=query.value(1).toByteArray (); |
1834 | + |
1835 | + return true; |
1836 | +} |
1837 | + |
1838 | +void CCBO::logSqlError(const QString& Type, const QString& error) |
1839 | +{ |
1840 | + QFile f("chinesecalendar.log" ); |
1841 | + if ( !f.open(QIODevice::ReadWrite | QIODevice::Append ) ) |
1842 | + return; |
1843 | + QTextStream t( &f ); |
1844 | + t << "Error time: " << QDateTime::currentDateTime().toString() << "\n"; |
1845 | + t << Type << "\n"; |
1846 | + t << error << "\n"; |
1847 | + f.close(); |
1848 | +} |
1849 | + |
1850 | +QString CCBO::ctcl_common_query(QString type,QString querystr) |
1851 | +{ |
1852 | + QSqlQuery query; |
1853 | + query.prepare(querystr); |
1854 | + if(!query.exec()) |
1855 | + logSqlError(type,query.lastError().text()); |
1856 | + if (query.last()) { |
1857 | + return query.value(0).toString(); |
1858 | + } else { |
1859 | + return QString(); |
1860 | + } |
1861 | +} |
1862 | + |
1863 | |
1864 | === added file 'ccbo.h' |
1865 | --- ccbo.h 1970-01-01 00:00:00 +0000 |
1866 | +++ ccbo.h 2013-05-06 14:54:28 +0000 |
1867 | @@ -0,0 +1,108 @@ |
1868 | +/* |
1869 | + * This file is part of the chinese-calendar project |
1870 | + * The code reference to "Chinese Traditional Calendar Library" |
1871 | + * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd |
1872 | + * |
1873 | + * This program is free software: you can redistribute it and/or modify |
1874 | + * it under the terms of the GNU General Public License version 3 as |
1875 | + * published by the Free Software Foundation. |
1876 | + * |
1877 | + * This program is distributed in the hope that it will be useful, |
1878 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1879 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1880 | + * GNU General Public License for more details. |
1881 | + * |
1882 | + * You should have received a copy of the GNU General Public License |
1883 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1884 | + * |
1885 | + * This project is developed by "UbuntuKylin Members" team, |
1886 | + * see <https://launchpad.net/~ubuntukylin~members> |
1887 | + * Authors: Abel Liu <guiltyritter@gmail.com> |
1888 | + * Shine Huang <hostc@163.com> |
1889 | + */ |
1890 | +/* |
1891 | +* Chinese Tradional Calendar Library |
1892 | +* Copyright (C) 2002-2003 Wang Yang |
1893 | +* Copyright (C) 2003 donaldzju@zju.edu.cn |
1894 | +*/ |
1895 | + |
1896 | +#pragma once |
1897 | +#include <math.h> |
1898 | +#include <QByteArray> |
1899 | +#include <QFile> |
1900 | +#include <QString> |
1901 | +#include <QObject> |
1902 | +#include <string.h> |
1903 | +#include <QDate> |
1904 | +#include <QFile> |
1905 | +#include <QtGui> |
1906 | +#include <QMessageBox> |
1907 | +#include <QSqlDatabase> |
1908 | +#include <QSqlError> |
1909 | +#include <QSqlQuery> |
1910 | +#include <QTextStream> |
1911 | +#ifndef M_PI |
1912 | +#define M_PI 3.14159265358979323846264338327 |
1913 | +#endif |
1914 | + |
1915 | +const int beginning_year=-849; |
1916 | +const int baseIndex = 0; |
1917 | + |
1918 | +struct CCalendar |
1919 | +{ |
1920 | + int month; |
1921 | + int day; |
1922 | + int gan; |
1923 | + int zhi; |
1924 | + QString cmonth; |
1925 | + QString cday; |
1926 | + QString ganzhi; |
1927 | + QString shengxiao; |
1928 | + QString sterm; |
1929 | + QString caltype; |
1930 | + QString weekday; |
1931 | + QString zodiac; |
1932 | + QString holiday; |
1933 | + QString choliday; |
1934 | + bool laststerm; |
1935 | + bool ischoliday; |
1936 | + QString yi; |
1937 | + QString ji; |
1938 | + QString note; |
1939 | +}; |
1940 | + |
1941 | +class CCBO: public QObject |
1942 | +{ |
1943 | +public: |
1944 | + CCBO(void); |
1945 | + ~CCBO(void); |
1946 | + int ctcl_solar_to_lunar(int y,int m,int d,struct CCalendar* ctc); |
1947 | + bool InitConnection(QString Path); |
1948 | + int ctcl_savenote(int y,int m, int d ,QString textedit); |
1949 | + QString ctcl_displaydata(int y,int m,int d); |
1950 | +private: |
1951 | + QByteArray lunarstr; |
1952 | + int maxyear; |
1953 | + int ctcl_calendar_type(int y, int m, int d, int opt); |
1954 | + int ctcl_date_to_days(int y,int m,int d); |
1955 | + int ctcl_days_to_date(int y,int x); |
1956 | + int days_from_era(int y); |
1957 | + int ctcl_standard_days(int y,int m,int d); |
1958 | + double ctcl_julian_day(int y,int m,int d,int h,int min,int sec,int zone); |
1959 | + int ctcl_day_of_week(int y,int m,int d); |
1960 | + double ctcl_solar_term(int y,int n,int t); |
1961 | + double ctcl_tail(double x); |
1962 | + double ctcl_rem(double x,double w); |
1963 | + double ctcl_round(double x); |
1964 | + int ctcl_gan(int x); |
1965 | + int ctcl_zhi(int x); |
1966 | + int ctcl_year_ganzhi(int y,int m,int d,int h); |
1967 | + double ang(double x,double t,double c1,double t0,double t2,double t3); |
1968 | + int ctcl_lunar_date(int y,int m,int d); |
1969 | + int ctcl_leap_month(int y); |
1970 | + int ctcl_lunar_month(int y,int m,int d); |
1971 | + void logSqlError( const QString& Type, const QString& error); |
1972 | + QString ctcl_common_query(QString type,QString querystr); |
1973 | + |
1974 | + |
1975 | +}; |
1976 | |
1977 | === added file 'chinese-calendar.desktop' |
1978 | --- chinese-calendar.desktop 1970-01-01 00:00:00 +0000 |
1979 | +++ chinese-calendar.desktop 2013-05-06 14:54:28 +0000 |
1980 | @@ -0,0 +1,10 @@ |
1981 | +[Desktop Entry] |
1982 | +Name=chinese-calendar |
1983 | +Name[zh_CN]=中国农历 |
1984 | +Comment=Chinese lunar calendar |
1985 | +Exec=/usr/bin/chinese-calendar |
1986 | +Icon=chinesecalendar-64.png |
1987 | +StartupNotify=true |
1988 | +Terminal=false |
1989 | +Type=Application |
1990 | +Categories=GNOME;GTK;Graphics;RasterGraphics;Viewer; |
1991 | |
1992 | === added file 'chinese-calendar.pro' |
1993 | --- chinese-calendar.pro 1970-01-01 00:00:00 +0000 |
1994 | +++ chinese-calendar.pro 2013-05-06 14:54:28 +0000 |
1995 | @@ -0,0 +1,65 @@ |
1996 | +TEMPLATE = app |
1997 | +TARGET += |
1998 | +DEPENDPATH += $$PWD/ |
1999 | +INCLUDEPATH += $$PWD/ |
2000 | + |
2001 | +inst.files += KylinLunar.db |
2002 | +inst.path = /usr/share/chinese-calendar/db |
2003 | +inst1.files += img/chinesecalendar-64.png |
2004 | +inst1.path = /usr/share/pixmaps |
2005 | +inst2.files += chinese-calendar.desktop |
2006 | +inst2.path = /usr/share/applications |
2007 | +inst3.files += chinese-calendar.desktop |
2008 | +inst3.path = /etc/xdg/autostart |
2009 | +default_skin.files += skin/default/chinesecalendarBGyellow.png \ |
2010 | + skin/default/no.png \ |
2011 | + skin/default/note.png \ |
2012 | + skin/default/ok.png |
2013 | +default_skin.path = /usr/share/chinese-calendar/skin/default |
2014 | +black_skin.files += skin/black/chinesecalendar.png \ |
2015 | + skin/black/no.png \ |
2016 | + skin/black/no-hover.png \ |
2017 | + skin/black/ok.png \ |
2018 | + skin/black/ok-hover.png \ |
2019 | + skin/black/note.png \ |
2020 | + skin/black/arrow-left.png \ |
2021 | + skin/black/arrow-right.png \ |
2022 | + skin/black/arrow-down.png |
2023 | +black_skin.path = /usr/share/chinese-calendar/skin/black |
2024 | +qss.files += skin/default-skin.qss \ |
2025 | + skin/black-skin.qss |
2026 | +qss.path = /usr/share/chinese-calendar/skin |
2027 | + |
2028 | +target.source += $$TARGET |
2029 | +target.path = /usr/bin |
2030 | +INSTALLS += inst \ |
2031 | + inst1 \ |
2032 | + inst2 \ |
2033 | + inst3 \ |
2034 | + default_skin \ |
2035 | + black_skin \ |
2036 | + qss \ |
2037 | + target |
2038 | + |
2039 | + |
2040 | +QT += core gui\ |
2041 | + sql \ |
2042 | + svg |
2043 | + |
2044 | +HEADERS += \ |
2045 | + dateitem.h \ |
2046 | + datemaskwidget.h \ |
2047 | + chinesecalendar.h \ |
2048 | + ccbo.h \ |
2049 | + cnote.h |
2050 | +FORMS += calendar.ui \ |
2051 | + dateitem.ui |
2052 | +SOURCES += main.cpp \ |
2053 | + dateitem.cpp \ |
2054 | + datemaskwidget.cpp \ |
2055 | + chinesecalendar.cpp \ |
2056 | + ccbo.cpp \ |
2057 | + cnote.cpp |
2058 | +RESOURCES += \ |
2059 | + chinese-calendar.qrc |
2060 | +TRANSLATIONS += translate/i18_zh_CN.ts |
2061 | |
2062 | === added file 'chinese-calendar.qrc' |
2063 | --- chinese-calendar.qrc 1970-01-01 00:00:00 +0000 |
2064 | +++ chinese-calendar.qrc 2013-05-06 14:54:28 +0000 |
2065 | @@ -0,0 +1,10 @@ |
2066 | +<RCC> |
2067 | + <qresource prefix="/"> |
2068 | + <file>img/chinesecalendar.svg</file> |
2069 | + <file>img/chinesecalendar-64.png</file> |
2070 | + <file>img/icon.png</file> |
2071 | + <file>img/icon-64.png</file> |
2072 | + <file>translate/i18_zh_CN.qm</file> |
2073 | + <file>translate/i18_zh_CN.ts</file> |
2074 | + </qresource> |
2075 | +</RCC> |
2076 | |
2077 | === added file 'chinesecalendar.cpp' |
2078 | --- chinesecalendar.cpp 1970-01-01 00:00:00 +0000 |
2079 | +++ chinesecalendar.cpp 2013-05-06 14:54:28 +0000 |
2080 | @@ -0,0 +1,1265 @@ |
2081 | +/* |
2082 | + * This file is part of the chinese-calendar project |
2083 | + * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd |
2084 | + * |
2085 | + * This program is free software: you can redistribute it and/or modify |
2086 | + * it under the terms of the GNU General Public License version 3 as |
2087 | + * published by the Free Software Foundation. |
2088 | + * |
2089 | + * This program is distributed in the hope that it will be useful, |
2090 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2091 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2092 | + * GNU General Public License for more details. |
2093 | + * |
2094 | + * You should have received a copy of the GNU General Public License |
2095 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2096 | + * |
2097 | + * This project is developed by "UbuntuKylin Members" team, |
2098 | + * see <https://launchpad.net/~ubuntukylin~members> |
2099 | + * Authors: Abel Liu <guiltyritter@gmail.com> |
2100 | + * Shine Huang <hostc@163.com> |
2101 | + */ |
2102 | + |
2103 | +#include "chinesecalendar.h" |
2104 | + |
2105 | + |
2106 | +ChineseCalendar::ChineseCalendar(QWidget *parent) |
2107 | + : QWidget(parent) |
2108 | +{ |
2109 | + setupUi(this); m_strFileList.clear(); |
2110 | +// bg = new QPixmap(":/img/chinesecalendarBGyellow.png"); |
2111 | + icon = QIcon(":/img/icon.png"); |
2112 | + icon64 = QIcon(":/img/chinesecalendar-64.png"); |
2113 | + mycalendat=new CCBO; |
2114 | + mycalendat->InitConnection(QDir::currentPath ()); |
2115 | + selectedDate = QDate::currentDate(); |
2116 | + monthCombo->setCurrentIndex(selectedDate.month() - 1); |
2117 | + YearSelect->setCurrentIndex(selectedDate.year()-1900); |
2118 | + connect(monthCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setMonth(int))); |
2119 | + connect(monthCombo, SIGNAL(activated(int)), this, SLOT(setMonth(int))); |
2120 | + connect(YearSelect, SIGNAL(currentIndexChanged(int)), this, SLOT(setYear(int))); |
2121 | + connect(this->backtotoday, SIGNAL(clicked()), this, SLOT(backtoday())); |
2122 | + |
2123 | +// this->TbnextMonth->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}"); |
2124 | +// this->TbnextYear->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}"); |
2125 | +// this->TbpreviousMonth->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}"); |
2126 | +// this->TbpreviousYear->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}"); |
2127 | +// this->backtotoday->setStyleSheet("QPushButton{background-color:transparent;color:rgb(200,200,150);}QPushButton:hover{color:rgb(255,255,255);}"); |
2128 | +// this->YearSelect->setStyleSheet("QComboBox{border: 2px solid lightgray;border-radius: 5px;font:12pt;}"); |
2129 | +// this->monthCombo->setStyleSheet("QComboBox{border: 2px solid lightgray;border-radius: 5px;font:12pt;}"); |
2130 | +// this->label->setStyleSheet("QLabel{font:12pt;}"); |
2131 | +// this->label_2->setStyleSheet("QLabel{font:12pt;}"); |
2132 | + |
2133 | + QDateTime dateTime; |
2134 | + QString currentTime; |
2135 | + QString week; |
2136 | + dateTime = QDateTime::currentDateTime(); |
2137 | + if(dateTime.toString("ddd") == "Mon") |
2138 | + week = "星期一"; |
2139 | + if(dateTime.toString("ddd") == "Tue") |
2140 | + week = "星期二"; |
2141 | + if(dateTime.toString("ddd") == "Wed") |
2142 | + week = "星期三"; |
2143 | + if(dateTime.toString("ddd") == "Thu") |
2144 | + week = "星期四"; |
2145 | + if(dateTime.toString("ddd") == "Fri") |
2146 | + week = "星期五"; |
2147 | + if(dateTime.toString("ddd") == "Sat") |
2148 | + week = "星期六"; |
2149 | + if(dateTime.toString("ddd") == "Sun") |
2150 | + week = "星期日"; |
2151 | + currentTime = dateTime.toString("yyyy-MM-dd %1").arg(week); |
2152 | + QDate day = QDate::currentDate(); |
2153 | + struct CCalendar datebase; |
2154 | + mycalendat->ctcl_solar_to_lunar(day.year(),day.month(),day.day(),&datebase); |
2155 | + QString chinesemonth = datebase.cmonth; |
2156 | + if (chinesemonth == "一月") |
2157 | + chinesemonth = "正月"; |
2158 | + if (chinesemonth == "十一月") |
2159 | + chinesemonth = "冬月"; |
2160 | + if (chinesemonth == "十二月") |
2161 | + chinesemonth = "腊月"; |
2162 | + QString chineseday = QString("农历 %1%2").arg(chinesemonth).arg(datebase.cday); |
2163 | + QString chineseyear = QString("%1年(%2年)").arg(datebase.ganzhi).arg(datebase.shengxiao); |
2164 | + |
2165 | + QString chineseyi = QString("%1").arg(datebase.yi); |
2166 | + QStringList chineseyilist = chineseyi.split("、"); |
2167 | + QString chineseji = QString("%2").arg(datebase.ji); |
2168 | + QStringList chinesejilist = chineseji.split("、"); |
2169 | + |
2170 | + QFont font; |
2171 | + QPalette pa; |
2172 | + font.setPointSize(48); |
2173 | + font.setBold(true); |
2174 | + this->label_10->setFont(font); |
2175 | + this->label_10->setText(QString::number(day.day())); |
2176 | + font.setBold(false); |
2177 | + font.setPointSize(9); |
2178 | + this->label_12->setFont(font); |
2179 | + this->label_12->setText(currentTime); |
2180 | + font.setPointSize(10); |
2181 | + this->label_13->setFont(font); |
2182 | + this->label_13->setText(chineseday); |
2183 | + this->label_14->setFont(font); |
2184 | + this->label_14->setText(chineseyear); |
2185 | + font.setPointSize(15); |
2186 | + this->label_15->setFont(font); |
2187 | + font.setPointSize(10); |
2188 | + this->label_17->setFont(font); |
2189 | + this->label_18->setFont(font); |
2190 | + QString yi=QString(""); |
2191 | + QString ji=QString(""); |
2192 | + if(chineseyilist.count() == 0 ) |
2193 | + yi =QString(""); |
2194 | + if(chineseyilist.count() >= 5) |
2195 | + yi = QString("").append(chineseyilist.at(0)).append("\n").append(chineseyilist.at(1)).append("\n").append(chineseyilist.at(2)).append("\n").append(chineseyilist.at(3)).append("\n").append(chineseyilist.at(4)); |
2196 | + if(chineseyilist.count() == 4) |
2197 | + yi = QString("").append(chineseyilist.at(0)).append("\n").append(chineseyilist.at(1)).append("\n").append(chineseyilist.at(2)).append("\n").append(chineseyilist.at(3)); |
2198 | + if (chineseyilist.count() == 3) |
2199 | + yi = QString("").append(chineseyilist.at(0)).append("\n").append(chineseyilist.at(1)).append("\n").append(chineseyilist.at(2)); |
2200 | + if (chineseyilist.count() == 2) |
2201 | + yi = QString("").append(chineseyilist.at(0)).append("\n").append(chineseyilist.at(1)); |
2202 | + if (chineseyilist.count() == 1) |
2203 | + yi = QString("").append(chineseyilist.at(0)).append("\n"); |
2204 | + this->label_17->setText(yi); |
2205 | + |
2206 | + if(chinesejilist.count() == 0 ) |
2207 | + ji =QString(""); |
2208 | + if(chinesejilist.count() >= 5) |
2209 | + ji = QString("").append(chinesejilist.at(0)).append("\n").append(chinesejilist.at(1)).append("\n").append(chinesejilist.at(2)).append("\n").append(chinesejilist.at(3)).append("\n").append(chinesejilist.at(4)); |
2210 | + if(chinesejilist.count() == 4) |
2211 | + ji = QString("").append(chinesejilist.at(0)).append("\n").append(chinesejilist.at(1)).append("\n").append(chinesejilist.at(2)).append("\n").append(chinesejilist.at(3)); |
2212 | + if (chinesejilist.count() == 3) |
2213 | + ji = QString("").append(chinesejilist.at(0)).append("\n").append(chinesejilist.at(1)).append("\n").append(chinesejilist.at(2)); |
2214 | + if (chinesejilist.count() == 2) |
2215 | + ji = QString("").append(chinesejilist.at(0)).append("\n").append(chinesejilist.at(1)); |
2216 | + if (chinesejilist.count() == 1) |
2217 | + ji = QString("").append(chinesejilist.at(0)).append("\n"); |
2218 | + this->label_18->setText(ji); |
2219 | + |
2220 | + QString cnote=mycalendat->ctcl_displaydata(day.year(),day.month(),day.day()); |
2221 | + QString haveplan=QString("今日有行程安排"); |
2222 | + QString noplan=QString("今日无行程安排"); |
2223 | + int num=cnote.count(); |
2224 | + while( num > 0 && cnote.at(num-1).isSpace()) |
2225 | + { |
2226 | + num--; |
2227 | + } |
2228 | + if(cnote.isEmpty() || num == 0) |
2229 | + this->label_19->setText(noplan); |
2230 | + else |
2231 | + this->label_19->setText(haveplan); |
2232 | + pa.setColor(QPalette::WindowText,Qt::white); |
2233 | + this->label->setPalette(pa); |
2234 | + this->label_2->setPalette(pa); |
2235 | + this->label_15->setPalette(pa); |
2236 | + this->label_4->setPalette(pa); |
2237 | + this->label_5->setPalette(pa); |
2238 | + this->label_6->setPalette(pa); |
2239 | + this->label_7->setPalette(pa); |
2240 | + this->label_8->setPalette(pa); |
2241 | + |
2242 | + pa.setColor(QPalette::WindowText,QColor(255,255,255)); |
2243 | + this->label_3->setPalette(pa); |
2244 | + this->label_9->setPalette(pa); |
2245 | + |
2246 | + pa.setColor(QPalette::WindowText,Qt::black); |
2247 | + this->label_18->setPalette(pa); |
2248 | + this->label_19->setPalette(pa); |
2249 | + |
2250 | + pa.setColor(QPalette::WindowText,Qt::red); |
2251 | + this->label_10->setPalette(pa); |
2252 | + this->label_11->setPalette(pa); |
2253 | + this->label_12->setPalette(pa); |
2254 | + this->label_13->setPalette(pa); |
2255 | + this->label_14->setPalette(pa); |
2256 | + this->label_17->setPalette(pa); |
2257 | + |
2258 | + map = new QMap<QString, DateItem *>(); |
2259 | + DateItem *dateitem00 = new DateItem(this); |
2260 | + dateitem00->show(); |
2261 | + map->insert(QString("1-1"), dateitem00 ); |
2262 | + connect(dateitem00, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2263 | + connect(dateitem00, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2264 | + |
2265 | + DateItem *dateitem01 = new DateItem(this); |
2266 | + dateitem01->show(); |
2267 | + map->insert(QString("1-2"), dateitem01 ); |
2268 | + connect(dateitem01, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2269 | + connect(dateitem01, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2270 | + |
2271 | + DateItem *dateitem02 = new DateItem(this); |
2272 | + dateitem02->show(); |
2273 | + map->insert(QString("1-3"), dateitem02 ); |
2274 | + connect(dateitem02, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2275 | + connect(dateitem02, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2276 | + |
2277 | + DateItem *dateitem03 = new DateItem(this); |
2278 | + dateitem03->show(); |
2279 | + map->insert(QString("1-4"), dateitem03 ); |
2280 | + connect(dateitem03, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2281 | + connect(dateitem03, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2282 | + |
2283 | + DateItem *dateitem04 = new DateItem(this); |
2284 | + dateitem04->show(); |
2285 | + map->insert(QString("1-5"), dateitem04 ); |
2286 | + connect(dateitem04, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2287 | + connect(dateitem04, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2288 | + |
2289 | + DateItem *dateitem05 = new DateItem(this); |
2290 | + dateitem05->show(); |
2291 | + map->insert(QString("1-6"), dateitem05 ); |
2292 | + connect(dateitem05, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2293 | + connect(dateitem05, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2294 | + |
2295 | + DateItem *dateitem06 = new DateItem(this); |
2296 | + dateitem06->show(); |
2297 | + map->insert(QString("1-7"), dateitem06 ); |
2298 | + connect(dateitem06, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2299 | + connect(dateitem06, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2300 | + |
2301 | + DateItem *dateitem10 = new DateItem(this); |
2302 | + dateitem10->show(); |
2303 | + map->insert(QString("2-1"), dateitem10 ); |
2304 | + connect(dateitem10, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2305 | + connect(dateitem10, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2306 | + |
2307 | + DateItem *dateitem11 = new DateItem(this); |
2308 | + dateitem11->show(); |
2309 | + map->insert(QString("2-2"), dateitem11 ); |
2310 | + connect(dateitem11, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2311 | + connect(dateitem11, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2312 | + |
2313 | + DateItem *dateitem12 = new DateItem(this); |
2314 | + dateitem12->show(); |
2315 | + map->insert(QString("2-3"), dateitem12 ); |
2316 | + connect(dateitem12, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2317 | + connect(dateitem12, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2318 | + |
2319 | + DateItem *dateitem13 = new DateItem(this); |
2320 | + dateitem13->show(); |
2321 | + map->insert(QString("2-4"), dateitem13 ); |
2322 | + connect(dateitem13, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2323 | + connect(dateitem13, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2324 | + |
2325 | + DateItem *dateitem14 = new DateItem(this); |
2326 | + dateitem14->show(); |
2327 | + map->insert(QString("2-5"), dateitem14 ); |
2328 | + connect(dateitem14, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2329 | + connect(dateitem14, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2330 | + |
2331 | + DateItem *dateitem15 = new DateItem(this); |
2332 | + dateitem15->show(); |
2333 | + map->insert(QString("2-6"), dateitem15 ); |
2334 | + connect(dateitem15, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2335 | + connect(dateitem15, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2336 | + |
2337 | + DateItem *dateitem16 = new DateItem(this); |
2338 | + dateitem16->show(); |
2339 | + map->insert(QString("2-7"), dateitem16 ); |
2340 | + connect(dateitem16, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2341 | + connect(dateitem16, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2342 | + |
2343 | + DateItem *dateitem20 = new DateItem(this); |
2344 | + dateitem20->show(); |
2345 | + map->insert(QString("3-1"), dateitem20 ); |
2346 | + connect(dateitem20, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2347 | + connect(dateitem20, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2348 | + |
2349 | + DateItem *dateitem21 = new DateItem(this); |
2350 | + dateitem21->show(); |
2351 | + map->insert(QString("3-2"), dateitem21 ); |
2352 | + connect(dateitem21, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2353 | + connect(dateitem21, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2354 | + |
2355 | + DateItem *dateitem22 = new DateItem(this); |
2356 | + dateitem22->show(); |
2357 | + map->insert(QString("3-3"), dateitem22 ); |
2358 | + connect(dateitem22, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2359 | + connect(dateitem22, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2360 | + |
2361 | + DateItem *dateitem23 = new DateItem(this); |
2362 | + dateitem23->show(); |
2363 | + map->insert(QString("3-4"), dateitem23 ); |
2364 | + connect(dateitem23, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2365 | + connect(dateitem23, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2366 | + |
2367 | + DateItem *dateitem24 = new DateItem(this); |
2368 | + dateitem24->show(); |
2369 | + map->insert(QString("3-5"), dateitem24 ); |
2370 | + connect(dateitem24, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2371 | + connect(dateitem24, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2372 | + |
2373 | + DateItem *dateitem25 = new DateItem(this); |
2374 | + dateitem25->show(); |
2375 | + map->insert(QString("3-6"), dateitem25 ); |
2376 | + connect(dateitem25, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2377 | + connect(dateitem25, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2378 | + |
2379 | + DateItem *dateitem26 = new DateItem(this); |
2380 | + dateitem26->show(); |
2381 | + map->insert(QString("3-7"), dateitem26 ); |
2382 | + connect(dateitem26, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2383 | + connect(dateitem26, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2384 | + |
2385 | + DateItem *dateitem30 = new DateItem(this); |
2386 | + dateitem30->show(); |
2387 | + map->insert(QString("4-1"), dateitem30 ); |
2388 | + connect(dateitem30, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2389 | + connect(dateitem30, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2390 | + |
2391 | + DateItem *dateitem31 = new DateItem(this); |
2392 | + dateitem31->show(); |
2393 | + map->insert(QString("4-2"), dateitem31 ); |
2394 | + connect(dateitem31, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2395 | + connect(dateitem31, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2396 | + |
2397 | + DateItem *dateitem32 = new DateItem(this); |
2398 | + dateitem32->show(); |
2399 | + map->insert(QString("4-3"), dateitem32 ); |
2400 | + connect(dateitem32, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2401 | + connect(dateitem32, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2402 | + |
2403 | + DateItem *dateitem33 = new DateItem(this); |
2404 | + dateitem33->show(); |
2405 | + map->insert(QString("4-4"), dateitem33 ); |
2406 | + connect(dateitem33, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2407 | + connect(dateitem33, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2408 | + |
2409 | + DateItem *dateitem34 = new DateItem(this); |
2410 | + dateitem34->show(); |
2411 | + map->insert(QString("4-5"), dateitem34 ); |
2412 | + connect(dateitem34, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2413 | + connect(dateitem34, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2414 | + |
2415 | + DateItem *dateitem35 = new DateItem(this); |
2416 | + dateitem35->show(); |
2417 | + map->insert(QString("4-6"), dateitem35 ); |
2418 | + connect(dateitem35, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2419 | + connect(dateitem35, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2420 | + |
2421 | + DateItem *dateitem36 = new DateItem(this); |
2422 | + dateitem36->show(); |
2423 | + map->insert(QString("4-7"), dateitem36 ); |
2424 | + connect(dateitem36, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2425 | + connect(dateitem36, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2426 | + |
2427 | + DateItem *dateitem40 = new DateItem(this); |
2428 | + dateitem40->show(); |
2429 | + map->insert(QString("5-1"), dateitem40 ); |
2430 | + connect(dateitem40, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2431 | + connect(dateitem40, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2432 | + |
2433 | + DateItem *dateitem41 = new DateItem(this); |
2434 | + dateitem41->show(); |
2435 | + map->insert(QString("5-2"), dateitem41 ); |
2436 | + connect(dateitem41, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2437 | + connect(dateitem41, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2438 | + |
2439 | + DateItem *dateitem42 = new DateItem(this); |
2440 | + dateitem42->show(); |
2441 | + map->insert(QString("5-3"), dateitem42 ); |
2442 | + connect(dateitem42, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2443 | + connect(dateitem42, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2444 | + |
2445 | + DateItem *dateitem43 = new DateItem(this); |
2446 | + dateitem43->show(); |
2447 | + map->insert(QString("5-4"), dateitem43 ); |
2448 | + connect(dateitem43, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2449 | + connect(dateitem43, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2450 | + |
2451 | + DateItem *dateitem44 = new DateItem(this); |
2452 | + dateitem44->show(); |
2453 | + map->insert(QString("5-5"), dateitem44 ); |
2454 | + connect(dateitem44, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2455 | + connect(dateitem44, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2456 | + |
2457 | + DateItem *dateitem45 = new DateItem(this); |
2458 | + dateitem45->show(); |
2459 | + map->insert(QString("5-6"), dateitem45 ); |
2460 | + connect(dateitem45, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2461 | + connect(dateitem45, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2462 | + |
2463 | + DateItem *dateitem46 = new DateItem(this); |
2464 | + dateitem46->show(); |
2465 | + map->insert(QString("5-7"), dateitem46 ); |
2466 | + connect(dateitem46, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2467 | + connect(dateitem46, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2468 | + |
2469 | + DateItem *dateitem50 = new DateItem(this); |
2470 | + dateitem50->hide(); |
2471 | + map->insert(QString("6-1"), dateitem50 ); |
2472 | + connect(dateitem50, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2473 | + connect(dateitem50, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2474 | + |
2475 | + DateItem *dateitem51 = new DateItem(this); |
2476 | + dateitem51->hide(); |
2477 | + map->insert(QString("6-2"), dateitem51 ); |
2478 | + connect(dateitem51, SIGNAL(clicked(QString)), this, SLOT(resetcalendardate(QString))); |
2479 | + connect(dateitem51, SIGNAL(day(QString)), this, SLOT(setclickday(QString))); |
2480 | + |
2481 | + DateItem *dateitem52 = new DateItem(this); |
2482 | + dateitem52->hide(); |
2483 | + map->insert(QString("6-3"), dateitem52 ); |
2484 | + |
2485 | + DateItem *dateitem53 = new DateItem(this); |
2486 | + dateitem53->hide(); |
2487 | + map->insert(QString("6-4"), dateitem53 ); |
2488 | + |
2489 | + DateItem *dateitem54 = new DateItem(this); |
2490 | + dateitem54->hide(); |
2491 | + map->insert(QString("6-5"), dateitem54 ); |
2492 | + |
2493 | + DateItem *dateitem55 = new DateItem(this); |
2494 | + dateitem55->hide(); |
2495 | + map->insert(QString("6-6"), dateitem55 ); |
2496 | + |
2497 | + DateItem *dateitem56 = new DateItem(this); |
2498 | + dateitem56->hide(); |
2499 | + map->insert(QString("6-7"), dateitem56 ); |
2500 | + |
2501 | + setItemLayout(); |
2502 | + setCalendar(); |
2503 | + |
2504 | + QTimer *timer = new QTimer(this); |
2505 | + timer->setInterval(1000); |
2506 | + connect(timer,SIGNAL(timeout()),this,SLOT(setTime())); |
2507 | + timer->start(); |
2508 | + |
2509 | + QBitmap objBitmap(size()); |
2510 | + QPainter painter(&objBitmap); |
2511 | + painter.fillRect(rect(),Qt::white); |
2512 | + painter.setBrush(QColor(0,0,0)); |
2513 | + painter.drawRoundedRect(this->rect(),10,10); |
2514 | + setMask(objBitmap); |
2515 | + |
2516 | + |
2517 | + this->createTray(); |
2518 | + |
2519 | + |
2520 | + note = new Cnote; |
2521 | + QDesktopWidget desktop; |
2522 | + int width = desktop.screenGeometry().width(); |
2523 | + note->setGeometry(QRect(width-400,80,224,280)); |
2524 | + connect(note,SIGNAL(save(QString)),this,SLOT(savedata(QString))); |
2525 | + note->hide(); |
2526 | + |
2527 | +} |
2528 | + |
2529 | +ChineseCalendar::~ChineseCalendar() |
2530 | +{ |
2531 | + delete mycalendat; |
2532 | +} |
2533 | + |
2534 | +void ChineseCalendar::setclickday(QString day) |
2535 | +{ |
2536 | + clickday = day.toInt(); |
2537 | + int year = this->YearSelect->currentText().toInt(); |
2538 | + int month = this->monthCombo->currentText().toInt(); |
2539 | + int today = clickday; |
2540 | + QString dateplan = QString("%1月%2日计划安排").arg(this->monthCombo->currentText()).arg(day); |
2541 | + QString data; |
2542 | + data=mycalendat->ctcl_displaydata(year,month,today); |
2543 | + note->textedit->setText(data); |
2544 | + note->datelabel->setText(dateplan); |
2545 | + note->exec(); |
2546 | +} |
2547 | + |
2548 | +void ChineseCalendar::savedata(QString data) |
2549 | +{ |
2550 | + int year = this->YearSelect->currentText().toInt(); |
2551 | + int month = this->monthCombo->currentText().toInt(); |
2552 | + int day = clickday; |
2553 | + mycalendat->ctcl_savenote(year,month,day,data); |
2554 | + note->hide(); |
2555 | + |
2556 | +} |
2557 | + |
2558 | + |
2559 | +void ChineseCalendar::createTray() |
2560 | +{ |
2561 | + this->actionShow = new QAction(tr("隐藏/显示"), this); |
2562 | + connect(actionShow, SIGNAL(triggered()), this, SLOT(showOrHide())); |
2563 | + |
2564 | + this->actionStaysOnTop = new QAction(tr("总在最前"), this); |
2565 | + this->actionStaysOnTop->setCheckable(true); |
2566 | + connect(actionStaysOnTop, SIGNAL(triggered()), this, SLOT(setMode())); |
2567 | + |
2568 | + this->actionStaysOnBottom = new QAction(tr("总在最后"), this); |
2569 | + this->actionStaysOnBottom->setCheckable(true); |
2570 | + connect(actionStaysOnBottom, SIGNAL(triggered()), this, SLOT(setMode())); |
2571 | + |
2572 | + this->actionStaysNormal = new QAction(tr("普通模式"), this); |
2573 | + this->actionStaysNormal->setCheckable(true); |
2574 | + this->actionStaysNormal->setChecked(true); |
2575 | + connect(actionStaysNormal, SIGNAL(triggered()), this, SLOT(setMode())); |
2576 | + |
2577 | + // default skin |
2578 | + this->actionDefault = new QAction(tr("Default"), this); |
2579 | + actionDefault->setCheckable(true); |
2580 | + actionDefault->setChecked(true); |
2581 | + connect(actionDefault, SIGNAL(triggered()), this, SLOT(slotChangeSkin())); |
2582 | + |
2583 | + // black skin |
2584 | + this->actionSkin = new QAction(tr("Black"), this); |
2585 | + actionSkin->setCheckable(true); |
2586 | + connect(actionSkin, SIGNAL(triggered()), this, SLOT(slotChangeSkin())); |
2587 | + |
2588 | + this->skinMenu = new QMenu(tr("换肤"), this); |
2589 | + this->skinMenu->addAction(actionDefault); |
2590 | + this->skinMenu->addAction(actionSkin); |
2591 | + |
2592 | + QActionGroup *actSkinGrp = new QActionGroup(this); |
2593 | + actSkinGrp->addAction(actionDefault); |
2594 | + actSkinGrp->addAction(actionSkin); |
2595 | + |
2596 | + // read user customizated skin files |
2597 | + readSkinFiles(); |
2598 | + |
2599 | + foreach (QString strSkin, m_strFileList) |
2600 | + { |
2601 | + QAction *actionNew = new QAction(strSkin, this); |
2602 | + actionNew->setCheckable(true); |
2603 | + actSkinGrp->addAction(actionNew); |
2604 | + this->skinMenu->addAction(actionNew); |
2605 | + connect(actionNew, SIGNAL(triggered()), this, SLOT(slotChangeSkin())); |
2606 | + } |
2607 | + |
2608 | + this->ag = new QActionGroup(this); |
2609 | + this->ag->addAction(actionStaysOnTop); |
2610 | + this->ag->addAction(actionStaysOnBottom); |
2611 | + this->ag->addAction(actionStaysNormal); |
2612 | + |
2613 | + this->actionQuit = new QAction(tr("退出程序"), this); |
2614 | + connect(actionQuit, SIGNAL(triggered()), qApp, SLOT(quit())); |
2615 | + |
2616 | + this->trayMenu = new QMenu(this); |
2617 | + this->trayMenu->addAction(actionShow); |
2618 | + this->trayMenu->addSeparator(); |
2619 | + this->trayMenu->addAction(actionStaysOnTop); |
2620 | + this->trayMenu->addAction(actionStaysOnBottom); |
2621 | + this->trayMenu->addAction(actionStaysNormal); |
2622 | + this->trayMenu->addSeparator(); |
2623 | + this->trayMenu->addMenu(skinMenu); |
2624 | + this->trayMenu->addSeparator(); |
2625 | + this->trayMenu->addAction(actionQuit); |
2626 | + |
2627 | + this->trayIcon = new QSystemTrayIcon(this); |
2628 | + this->trayIcon->setIcon(icon); |
2629 | + this->trayIcon->setContextMenu(trayMenu); |
2630 | + this->trayIcon->show(); |
2631 | +} |
2632 | + |
2633 | +void ChineseCalendar::paintEvent(QPaintEvent *) |
2634 | +{ |
2635 | + QStyleOption opt; |
2636 | + opt.init(this); |
2637 | + QPainter painter(this); |
2638 | +// painter.drawPixmap(0,0,width(),height(),*bg); |
2639 | + style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this); |
2640 | + |
2641 | +// painter.setPen(Qt::gray); |
2642 | + painter.setPen(QColor(255,121,3,100)); |
2643 | + |
2644 | + if(!isTall) |
2645 | + { |
2646 | + //row |
2647 | + painter.drawLine(5,108,390,108); |
2648 | + painter.drawLine(5,147,390,147); |
2649 | + painter.drawLine(5,186,390,186); |
2650 | + painter.drawLine(5,225,390,225); |
2651 | + painter.drawLine(5,264,390,264); |
2652 | +// painter.drawLine(5,303,390,303); |
2653 | + } |
2654 | + else |
2655 | + { |
2656 | + painter.drawLine(5,116,390,116); |
2657 | + painter.drawLine(5,163,390,163); |
2658 | + painter.drawLine(5,210,390,210); |
2659 | + painter.drawLine(5,257,390,257); |
2660 | +// painter.drawLine(5,304,390,304); |
2661 | + } |
2662 | + //column |
2663 | + painter.drawLine(60,69,60,303); |
2664 | + painter.drawLine(115,69,115,303); |
2665 | + painter.drawLine(170,69,170,303); |
2666 | + painter.drawLine(225,69,225,303); |
2667 | + painter.drawLine(280,69,280,303); |
2668 | + painter.drawLine(335,69,335,303); |
2669 | +} |
2670 | + |
2671 | +void ChineseCalendar::setItemLayout() |
2672 | +{ |
2673 | + if(isTall == false) |
2674 | + { |
2675 | + map->value("1-1")->resizeItem(55,47); |
2676 | + map->value("1-2")->resizeItem(55,47); |
2677 | + map->value("1-3")->resizeItem(55,47); |
2678 | + map->value("1-4")->resizeItem(55,47); |
2679 | + map->value("1-5")->resizeItem(55,47); |
2680 | + map->value("1-6")->resizeItem(55,47); |
2681 | + map->value("1-7")->resizeItem(55,47); |
2682 | + map->value("2-1")->resizeItem(55,47); |
2683 | + map->value("2-2")->resizeItem(55,47); |
2684 | + map->value("2-3")->resizeItem(55,47); |
2685 | + map->value("2-4")->resizeItem(55,47); |
2686 | + map->value("2-5")->resizeItem(55,47); |
2687 | + map->value("2-6")->resizeItem(55,47); |
2688 | + map->value("2-7")->resizeItem(55,47); |
2689 | + map->value("3-1")->resizeItem(55,47); |
2690 | + map->value("3-2")->resizeItem(55,47); |
2691 | + map->value("3-3")->resizeItem(55,47); |
2692 | + map->value("3-4")->resizeItem(55,47); |
2693 | + map->value("3-5")->resizeItem(55,47); |
2694 | + map->value("3-6")->resizeItem(55,47); |
2695 | + map->value("3-7")->resizeItem(55,47); |
2696 | + map->value("4-1")->resizeItem(55,47); |
2697 | + map->value("4-2")->resizeItem(55,47); |
2698 | + map->value("4-3")->resizeItem(55,47); |
2699 | + map->value("4-4")->resizeItem(55,47); |
2700 | + map->value("4-5")->resizeItem(55,47); |
2701 | + map->value("4-6")->resizeItem(55,47); |
2702 | + map->value("4-7")->resizeItem(55,47); |
2703 | + map->value("5-1")->resizeItem(55,47); |
2704 | + map->value("5-2")->resizeItem(55,47); |
2705 | + map->value("5-3")->resizeItem(55,47); |
2706 | + map->value("5-4")->resizeItem(55,47); |
2707 | + map->value("5-5")->resizeItem(55,47); |
2708 | + map->value("5-6")->resizeItem(55,47); |
2709 | + map->value("5-7")->resizeItem(55,47); |
2710 | + map->value("6-1")->resizeItem(55,47); |
2711 | + map->value("6-2")->resizeItem(55,47); |
2712 | + map->value("6-3")->resizeItem(55,47); |
2713 | + map->value("6-4")->resizeItem(55,47); |
2714 | + map->value("6-5")->resizeItem(55,47); |
2715 | + map->value("6-6")->resizeItem(55,47); |
2716 | + map->value("6-7")->resizeItem(55,47); |
2717 | + isTall = true; |
2718 | + } |
2719 | + map->value("1-1")->move(5,69); |
2720 | + map->value("1-2")->move(60,69); |
2721 | + map->value("1-3")->move(115,69); |
2722 | + map->value("1-4")->move(170,69); |
2723 | + map->value("1-5")->move(225,69); |
2724 | + map->value("1-6")->move(280,69); |
2725 | + map->value("1-7")->move(335,69); |
2726 | + map->value("2-1")->move(5,116); |
2727 | + map->value("2-2")->move(60,116); |
2728 | + map->value("2-3")->move(115,116); |
2729 | + map->value("2-4")->move(170,116); |
2730 | + map->value("2-5")->move(225,116); |
2731 | + map->value("2-6")->move(280,116); |
2732 | + map->value("2-7")->move(335,116); |
2733 | + map->value("3-1")->move(5,163); |
2734 | + map->value("3-2")->move(60,163); |
2735 | + map->value("3-3")->move(115,163); |
2736 | + map->value("3-4")->move(170,163); |
2737 | + map->value("3-5")->move(225,163); |
2738 | + map->value("3-6")->move(280,163); |
2739 | + map->value("3-7")->move(335,163); |
2740 | + map->value("4-1")->move(5,210); |
2741 | + map->value("4-2")->move(60,210); |
2742 | + map->value("4-3")->move(115,210); |
2743 | + map->value("4-4")->move(170,210); |
2744 | + map->value("4-5")->move(225,210); |
2745 | + map->value("4-6")->move(280,210); |
2746 | + map->value("4-7")->move(335,210); |
2747 | + map->value("5-1")->move(5,257); |
2748 | + map->value("5-2")->move(60,257); |
2749 | + map->value("5-3")->move(115,257); |
2750 | + map->value("5-4")->move(170,257); |
2751 | + map->value("5-5")->move(225,257); |
2752 | + map->value("5-6")->move(280,257); |
2753 | + map->value("5-7")->move(335,257); |
2754 | + map->value("6-1")->move(5,304); |
2755 | + map->value("6-2")->move(60,304); |
2756 | + map->value("6-3")->move(115,304); |
2757 | + map->value("6-4")->move(170,304); |
2758 | + map->value("6-5")->move(225,304); |
2759 | + map->value("6-6")->move(280,304); |
2760 | + map->value("6-7")->move(335,304); |
2761 | +} |
2762 | + |
2763 | +void ChineseCalendar::resetItemLayout() |
2764 | +{ |
2765 | + map->value("1-1")->resizeItem(55,39); |
2766 | + map->value("1-2")->resizeItem(55,39); |
2767 | + map->value("1-3")->resizeItem(55,39); |
2768 | + map->value("1-4")->resizeItem(55,39); |
2769 | + map->value("1-5")->resizeItem(55,39); |
2770 | + map->value("1-6")->resizeItem(55,39); |
2771 | + map->value("1-7")->resizeItem(55,39); |
2772 | + map->value("2-1")->resizeItem(55,39); |
2773 | + map->value("2-2")->resizeItem(55,39); |
2774 | + map->value("2-3")->resizeItem(55,39); |
2775 | + map->value("2-4")->resizeItem(55,39); |
2776 | + map->value("2-5")->resizeItem(55,39); |
2777 | + map->value("2-6")->resizeItem(55,39); |
2778 | + map->value("2-7")->resizeItem(55,39); |
2779 | + map->value("3-1")->resizeItem(55,39); |
2780 | + map->value("3-2")->resizeItem(55,39); |
2781 | + map->value("3-3")->resizeItem(55,39); |
2782 | + map->value("3-4")->resizeItem(55,39); |
2783 | + map->value("3-5")->resizeItem(55,39); |
2784 | + map->value("3-6")->resizeItem(55,39); |
2785 | + map->value("3-7")->resizeItem(55,39); |
2786 | + map->value("4-1")->resizeItem(55,39); |
2787 | + map->value("4-2")->resizeItem(55,39); |
2788 | + map->value("4-3")->resizeItem(55,39); |
2789 | + map->value("4-4")->resizeItem(55,39); |
2790 | + map->value("4-5")->resizeItem(55,39); |
2791 | + map->value("4-6")->resizeItem(55,39); |
2792 | + map->value("4-7")->resizeItem(55,39); |
2793 | + map->value("5-1")->resizeItem(55,39); |
2794 | + map->value("5-2")->resizeItem(55,39); |
2795 | + map->value("5-3")->resizeItem(55,39); |
2796 | + map->value("5-4")->resizeItem(55,39); |
2797 | + map->value("5-5")->resizeItem(55,39); |
2798 | + map->value("5-6")->resizeItem(55,39); |
2799 | + map->value("5-7")->resizeItem(55,39); |
2800 | + map->value("6-1")->resizeItem(55,39); |
2801 | + map->value("6-2")->resizeItem(55,39); |
2802 | + map->value("6-3")->resizeItem(55,39); |
2803 | + map->value("6-4")->resizeItem(55,39); |
2804 | + map->value("6-5")->resizeItem(55,39); |
2805 | + map->value("6-6")->resizeItem(55,39); |
2806 | + map->value("6-7")->resizeItem(55,39); |
2807 | + isTall = false; |
2808 | + |
2809 | + map->value("1-1")->move(5,69); |
2810 | + map->value("1-2")->move(60,69); |
2811 | + map->value("1-3")->move(115,69); |
2812 | + map->value("1-4")->move(170,69); |
2813 | + map->value("1-5")->move(225,69); |
2814 | + map->value("1-6")->move(280,69); |
2815 | + map->value("1-7")->move(335,69); |
2816 | + map->value("2-1")->move(5,108); |
2817 | + map->value("2-2")->move(60,108); |
2818 | + map->value("2-3")->move(115,108); |
2819 | + map->value("2-4")->move(170,108); |
2820 | + map->value("2-5")->move(225,108); |
2821 | + map->value("2-6")->move(280,108); |
2822 | + map->value("2-7")->move(335,108); |
2823 | + map->value("3-1")->move(5,147); |
2824 | + map->value("3-2")->move(60,147); |
2825 | + map->value("3-3")->move(115,147); |
2826 | + map->value("3-4")->move(170,147); |
2827 | + map->value("3-5")->move(225,147); |
2828 | + map->value("3-6")->move(280,147); |
2829 | + map->value("3-7")->move(335,147); |
2830 | + map->value("4-1")->move(5,186); |
2831 | + map->value("4-2")->move(60,186); |
2832 | + map->value("4-3")->move(115,186); |
2833 | + map->value("4-4")->move(170,186); |
2834 | + map->value("4-5")->move(225,186); |
2835 | + map->value("4-6")->move(280,186); |
2836 | + map->value("4-7")->move(335,186); |
2837 | + map->value("5-1")->move(5,225); |
2838 | + map->value("5-2")->move(60,225); |
2839 | + map->value("5-3")->move(115,225); |
2840 | + map->value("5-4")->move(170,225); |
2841 | + map->value("5-5")->move(225,225); |
2842 | + map->value("5-6")->move(280,225); |
2843 | + map->value("5-7")->move(335,225); |
2844 | + map->value("6-1")->move(5,264); |
2845 | + map->value("6-2")->move(60,264); |
2846 | + map->value("6-3")->move(115,264); |
2847 | + map->value("6-4")->move(170,264); |
2848 | + map->value("6-5")->move(225,264); |
2849 | + map->value("6-6")->move(280,264); |
2850 | + map->value("6-7")->move(335,264); |
2851 | +} |
2852 | + |
2853 | +void ChineseCalendar::setTime() |
2854 | +{ |
2855 | + QDateTime dateTime = QDateTime::currentDateTime(); |
2856 | + this->label_15->setText(dateTime.toString("hh:mm:ss")); |
2857 | +} |
2858 | + |
2859 | +void ChineseCalendar::resetcalendardate(QString day) |
2860 | +{ |
2861 | + QDate date(this->YearSelect->currentText().toInt(),this->monthCombo->currentText().toInt(),day.toInt()); |
2862 | + clearbackground(); |
2863 | + QString weekday; |
2864 | + if(date.toString("ddd") == "Mon") |
2865 | + weekday = "星期一"; |
2866 | + if(date.toString("ddd") == "Tue") |
2867 | + weekday = "星期二"; |
2868 | + if(date.toString("ddd") == "Wed") |
2869 | + weekday = "星期三"; |
2870 | + if(date.toString("ddd") == "Thu") |
2871 | + weekday = "星期四"; |
2872 | + if(date.toString("ddd") == "Fri") |
2873 | + weekday = "星期五"; |
2874 | + if(date.toString("ddd") == "Sat") |
2875 | + weekday = "星期六"; |
2876 | + if(date.toString("ddd") == "Sun") |
2877 | + weekday = "星期日"; |
2878 | + QString selecttime = date.toString("yyyy-MM-dd %1").arg(weekday); |
2879 | + struct CCalendar d; |
2880 | + mycalendat->ctcl_solar_to_lunar(date.year(),date.month(),date.day(),&d); |
2881 | + QString selectmonth = d.cmonth; |
2882 | + if (selectmonth == "一月") |
2883 | + selectmonth = "正月"; |
2884 | + if (selectmonth == "十一月") |
2885 | + selectmonth = "冬月"; |
2886 | + if (selectmonth == "十二月") |
2887 | + selectmonth = "腊月"; |
2888 | + struct CCalendar f = fixshengxiao(date); |
2889 | + QString selectday = QString("农历 %1%2").arg(selectmonth).arg(d.cday); |
2890 | + QString selectyear = QString("%1年(%2年)").arg(f.ganzhi).arg(f.shengxiao); |
2891 | + this->label_10->setText(day); |
2892 | + this->label_12->setText(selecttime); |
2893 | + this->label_13->setText(selectday); |
2894 | + this->label_14->setText(selectyear); |
2895 | + |
2896 | + QString cnote=QString(""); |
2897 | + QString haveplan=QString("今日有行程安排"); |
2898 | + QString noplan=QString("今日无行程安排"); |
2899 | + cnote=mycalendat->ctcl_displaydata(date.year(),date.month(),date.day()); |
2900 | + int num=cnote.count(); |
2901 | + while( num > 0 && cnote.at(num-1).isSpace()) |
2902 | + { |
2903 | + num--; |
2904 | + } |
2905 | + if(cnote.isEmpty() || num == 0) |
2906 | + this->label_19->setText(noplan); |
2907 | + else |
2908 | + this->label_19->setText(haveplan); |
2909 | + |
2910 | + QString yi = QString(""); |
2911 | + QString ji = QString(""); |
2912 | + QString selectyi = QString("%1").arg(f.yi); |
2913 | + QStringList selectyilist = selectyi.split("、"); |
2914 | + if(selectyilist.count() == 0 ) |
2915 | + yi =QString(""); |
2916 | + if(selectyilist.count() >= 5) |
2917 | + yi = QString("").append(selectyilist.at(0)).append("\n").append(selectyilist.at(1)).append("\n").append(selectyilist.at(2)).append("\n").append(selectyilist.at(3)).append("\n").append(selectyilist.at(4)); |
2918 | + if(selectyilist.count() == 4) |
2919 | + yi = QString("").append(selectyilist.at(0)).append("\n").append(selectyilist.at(1)).append("\n").append(selectyilist.at(2)).append("\n").append(selectyilist.at(3)); |
2920 | + if (selectyilist.count() == 3) |
2921 | + yi = QString("").append(selectyilist.at(0)).append("\n").append(selectyilist.at(1)).append("\n").append(selectyilist.at(2)); |
2922 | + if (selectyilist.count() == 2) |
2923 | + yi = QString("").append(selectyilist.at(0)).append("\n").append(selectyilist.at(1)); |
2924 | + if (selectyilist.count() == 1) |
2925 | + yi = QString("").append(selectyilist.at(0)).append("\n"); |
2926 | + |
2927 | + QString selectji = QString("%2").arg(f.ji); |
2928 | + QStringList selectjilist = selectji.split("、"); |
2929 | + if(selectjilist.count() == 0 ) |
2930 | + ji =QString(""); |
2931 | + if(selectjilist.count() >= 5) |
2932 | + ji = QString("").append(selectjilist.at(0)).append("\n").append(selectjilist.at(1)).append("\n").append(selectjilist.at(2)).append("\n").append(selectjilist.at(3)).append("\n").append(selectjilist.at(4)); |
2933 | + if(selectjilist.count() == 4) |
2934 | + ji = QString("").append(selectjilist.at(0)).append("\n").append(selectjilist.at(1)).append("\n").append(selectjilist.at(2)).append("\n").append(selectjilist.at(3)); |
2935 | + if (selectjilist.count() == 3) |
2936 | + ji = QString("").append(selectjilist.at(0)).append("\n").append(selectjilist.at(1)).append("\n").append(selectjilist.at(2)); |
2937 | + if (selectjilist.count() == 2) |
2938 | + ji = QString("").append(selectjilist.at(0)).append("\n").append(selectjilist.at(1)); |
2939 | + if (selectjilist.count() == 1) |
2940 | + ji = QString("").append(selectjilist.at(0)).append("\n"); |
2941 | + this->label_17->setText(yi); |
2942 | + this->label_18->setText(ji); |
2943 | +} |
2944 | + |
2945 | +CCalendar ChineseCalendar::fixshengxiao(QDate date) |
2946 | +{ |
2947 | + QDate fixdate = date.addDays(1); |
2948 | + struct CCalendar fix; |
2949 | + mycalendat->ctcl_solar_to_lunar(fixdate.year(),fixdate.month(),fixdate.day(),&fix); |
2950 | + if (fix.sterm == "立春") |
2951 | + { |
2952 | + fixdate = fixdate.addDays(-2); |
2953 | + mycalendat->ctcl_solar_to_lunar(fixdate.year(),fixdate.month(),fixdate.day(),&fix); |
2954 | + return fix; |
2955 | + } |
2956 | + else |
2957 | + { |
2958 | + fixdate = fixdate.addDays(-1); |
2959 | + mycalendat->ctcl_solar_to_lunar(fixdate.year(),fixdate.month(),fixdate.day(),&fix); |
2960 | + return fix; |
2961 | + } |
2962 | +} |
2963 | + |
2964 | +void ChineseCalendar::backtoday() |
2965 | +{ |
2966 | + QDate today = QDate::currentDate(); |
2967 | + YearSelect->setCurrentIndex(today.year() - 1900); |
2968 | + monthCombo->setCurrentIndex(today.month() - 1); |
2969 | + setCalendar(); |
2970 | + |
2971 | +} |
2972 | + |
2973 | +void ChineseCalendar::setCalendar() |
2974 | +{ |
2975 | + struct CCalendar c; |
2976 | + cleardate(); |
2977 | + QDate date(selectedDate.year(), selectedDate.month(), 1); |
2978 | + while (date.month() == selectedDate.month()) { |
2979 | + int weekDay = date.dayOfWeek(); |
2980 | + mycalendat->ctcl_solar_to_lunar(selectedDate.year(),selectedDate.month(),date.day(),&c); |
2981 | + QString mycday; |
2982 | + mycday=c.cday; |
2983 | + if(c.sterm.at(0) >=QChar('0') && c.sterm.at(0) <= QChar('9')) |
2984 | + mycday=c.cday; |
2985 | + else |
2986 | + { |
2987 | + if(c.laststerm) |
2988 | + mycday=c.cday; |
2989 | + else |
2990 | + mycday=c.sterm; |
2991 | + } |
2992 | + if(c.ischoliday) |
2993 | + mycday=c.choliday; |
2994 | + int day = date.day(); |
2995 | + if (weekDay == 7) |
2996 | + weekDay = 0; |
2997 | + int row = (day + (6 - weekDay) + 7 -1)/7; |
2998 | + QString site = QString("%1-%2").arg(row).arg(weekDay+1); |
2999 | + map->value(site)->setday(date.day()); |
3000 | + map->value(site)->setcday(mycday); |
3001 | + if(weekDay == 6 || weekDay == 0) |
3002 | + map->value(site)->setcolor(); |
3003 | + date = date.addDays(1); |
3004 | + } |
3005 | + |
3006 | + if (!map->value("6-1")->day().isNull()) |
3007 | + { |
3008 | + map->value("6-1")->show(); |
3009 | + map->value("6-2")->show(); |
3010 | + map->value("6-3")->show(); |
3011 | + map->value("6-4")->show(); |
3012 | + map->value("6-5")->show(); |
3013 | + map->value("6-6")->show(); |
3014 | + map->value("6-7")->show(); |
3015 | + resetItemLayout(); |
3016 | + } |
3017 | + |
3018 | + QDate today = QDate::currentDate(); |
3019 | + if(today.year() == selectedDate.year() && today.month() == selectedDate.month()) |
3020 | + { |
3021 | + int d = today.day(); |
3022 | + int w = today.dayOfWeek(); |
3023 | + if (w == 7) |
3024 | + w = 0; |
3025 | + int r = (d + (6 - w) + 7 -1)/7; |
3026 | + QString add = QString("%1-%2").arg(r).arg(w+1); |
3027 | + resetcalendardate(QString::number(today.day())); |
3028 | + map->value(add)->setToday(); |
3029 | + } |
3030 | +} |
3031 | + |
3032 | +void ChineseCalendar::clearbackground() |
3033 | +{ |
3034 | + map->value("1-1")->clearstyle(); |
3035 | + map->value("1-2")->clearstyle(); |
3036 | + map->value("1-3")->clearstyle(); |
3037 | + map->value("1-4")->clearstyle(); |
3038 | + map->value("1-5")->clearstyle(); |
3039 | + map->value("1-6")->clearstyle(); |
3040 | + map->value("1-7")->clearstyle(); |
3041 | + map->value("2-1")->clearstyle(); |
3042 | + map->value("2-2")->clearstyle(); |
3043 | + map->value("2-3")->clearstyle(); |
3044 | + map->value("2-4")->clearstyle(); |
3045 | + map->value("2-5")->clearstyle(); |
3046 | + map->value("2-6")->clearstyle(); |
3047 | + map->value("2-7")->clearstyle(); |
3048 | + map->value("3-1")->clearstyle(); |
3049 | + map->value("3-2")->clearstyle(); |
3050 | + map->value("3-3")->clearstyle(); |
3051 | + map->value("3-4")->clearstyle(); |
3052 | + map->value("3-5")->clearstyle(); |
3053 | + map->value("3-6")->clearstyle(); |
3054 | + map->value("3-7")->clearstyle(); |
3055 | + map->value("4-1")->clearstyle(); |
3056 | + map->value("4-2")->clearstyle(); |
3057 | + map->value("4-3")->clearstyle(); |
3058 | + map->value("4-4")->clearstyle(); |
3059 | + map->value("4-5")->clearstyle(); |
3060 | + map->value("4-6")->clearstyle(); |
3061 | + map->value("4-7")->clearstyle(); |
3062 | + map->value("5-1")->clearstyle(); |
3063 | + map->value("5-2")->clearstyle(); |
3064 | + map->value("5-3")->clearstyle(); |
3065 | + map->value("5-4")->clearstyle(); |
3066 | + map->value("5-5")->clearstyle(); |
3067 | + map->value("5-6")->clearstyle(); |
3068 | + map->value("5-7")->clearstyle(); |
3069 | + map->value("6-1")->clearstyle(); |
3070 | + map->value("6-2")->clearstyle(); |
3071 | + map->value("6-3")->clearstyle(); |
3072 | + map->value("6-4")->clearstyle(); |
3073 | + map->value("6-5")->clearstyle(); |
3074 | + map->value("6-6")->clearstyle(); |
3075 | + map->value("6-7")->clearstyle(); |
3076 | +} |
3077 | + |
3078 | +void ChineseCalendar::cleardate() |
3079 | +{ |
3080 | + map->value("1-1")->clear(); |
3081 | + map->value("1-2")->clear(); |
3082 | + map->value("1-3")->clear(); |
3083 | + map->value("1-4")->clear(); |
3084 | + map->value("1-5")->clear(); |
3085 | + map->value("1-6")->clear(); |
3086 | + map->value("1-7")->clear(); |
3087 | + map->value("2-1")->clear(); |
3088 | + map->value("2-2")->clear(); |
3089 | + map->value("2-3")->clear(); |
3090 | + map->value("2-4")->clear(); |
3091 | + map->value("2-5")->clear(); |
3092 | + map->value("2-6")->clear(); |
3093 | + map->value("2-7")->clear(); |
3094 | + map->value("3-1")->clear(); |
3095 | + map->value("3-2")->clear(); |
3096 | + map->value("3-3")->clear(); |
3097 | + map->value("3-4")->clear(); |
3098 | + map->value("3-5")->clear(); |
3099 | + map->value("3-6")->clear(); |
3100 | + map->value("3-7")->clear(); |
3101 | + map->value("4-1")->clear(); |
3102 | + map->value("4-2")->clear(); |
3103 | + map->value("4-3")->clear(); |
3104 | + map->value("4-4")->clear(); |
3105 | + map->value("4-5")->clear(); |
3106 | + map->value("4-6")->clear(); |
3107 | + map->value("4-7")->clear(); |
3108 | + map->value("5-1")->clear(); |
3109 | + map->value("5-2")->clear(); |
3110 | + map->value("5-3")->clear(); |
3111 | + map->value("5-4")->clear(); |
3112 | + map->value("5-5")->clear(); |
3113 | + map->value("5-6")->clear(); |
3114 | + map->value("5-7")->clear(); |
3115 | + map->value("6-1")->clear(); |
3116 | + map->value("6-2")->clear(); |
3117 | + map->value("6-3")->clear(); |
3118 | + map->value("6-4")->clear(); |
3119 | + map->value("6-5")->clear(); |
3120 | + map->value("6-6")->clear(); |
3121 | + map->value("6-7")->clear(); |
3122 | + map->value("6-1")->hide(); |
3123 | + map->value("6-2")->hide(); |
3124 | + map->value("6-3")->hide(); |
3125 | + map->value("6-4")->hide(); |
3126 | + map->value("6-5")->hide(); |
3127 | + map->value("6-6")->hide(); |
3128 | + map->value("6-7")->hide(); |
3129 | + setItemLayout(); |
3130 | +} |
3131 | + |
3132 | +void ChineseCalendar::mousePressEvent(QMouseEvent *event) |
3133 | +{ |
3134 | + if (event->button() == Qt::LeftButton) |
3135 | + { |
3136 | + if (map->value("6-1")->isHidden()) |
3137 | + { |
3138 | + if (event->x()>5 && event->x()<390 && event->y()>69 && event->y()<304) |
3139 | + moveable = false; |
3140 | + else moveable = true; |
3141 | + } |
3142 | + else |
3143 | + { |
3144 | + if (event->x()>5 && event->x()<390 && event->y()>69 && event->y()<304) |
3145 | + moveable = false ; |
3146 | + else moveable = true; |
3147 | + } |
3148 | + dragPos = event->globalPos() - frameGeometry().topLeft(); |
3149 | + event->accept(); |
3150 | + } |
3151 | + |
3152 | +} |
3153 | + |
3154 | +void ChineseCalendar::mouseMoveEvent(QMouseEvent *event) |
3155 | +{ |
3156 | + if (event->buttons() & Qt::LeftButton && moveable == true ) |
3157 | + { |
3158 | + if (map->value("6-1")->isHidden()) |
3159 | + { |
3160 | + if (event->x()>5 && event->x()<390 && event->y()>69 && event->y()<304) |
3161 | + return ; |
3162 | + else move(event->globalPos() - dragPos); |
3163 | + } |
3164 | + else |
3165 | + { |
3166 | + if (event->x()>5 && event->x()<390 && event->y()>69 && event->y()<304) |
3167 | + return ; |
3168 | + else move(event->globalPos() - dragPos); |
3169 | + } |
3170 | + setWindowOpacity(0.5); |
3171 | + } |
3172 | + event->accept(); |
3173 | + |
3174 | +} |
3175 | + |
3176 | +void ChineseCalendar::mouseReleaseEvent(QMouseEvent *event) |
3177 | +{ |
3178 | + if (event->button() == Qt::LeftButton) |
3179 | + { |
3180 | + setWindowOpacity(1); |
3181 | + } |
3182 | + event->accept(); |
3183 | +} |
3184 | + |
3185 | +void ChineseCalendar::setMonth(int month) |
3186 | +{ |
3187 | + |
3188 | + int day=0; |
3189 | + int newmonth = month+1; |
3190 | + if(newmonth<=0) |
3191 | + { |
3192 | + newmonth = 12; |
3193 | + monthCombo->setCurrentIndex(11); |
3194 | + } |
3195 | + if(newmonth>12) |
3196 | + { |
3197 | + newmonth = 1; |
3198 | + } |
3199 | + if(newmonth ==1 || newmonth ==3 || newmonth == 5 || newmonth == 7 || newmonth == 8 || newmonth == 10 || newmonth ==12) |
3200 | + { |
3201 | + day =31; |
3202 | + } |
3203 | + else if(newmonth ==4 || newmonth==6 || newmonth ==9 || newmonth ==11) |
3204 | + { |
3205 | + day =30; |
3206 | + } |
3207 | + if(selectedDate.year()%4 ==0 && selectedDate.year()%100!=0) |
3208 | + { |
3209 | + day = 29; |
3210 | + } |
3211 | + else if(selectedDate.year()%400 ==0) |
3212 | + { |
3213 | + day = 29; |
3214 | + } |
3215 | + else |
3216 | + { |
3217 | + day = 28; |
3218 | + } |
3219 | + selectedDate = QDate(selectedDate.year(),newmonth,day); |
3220 | + setCalendar(); |
3221 | +} |
3222 | + |
3223 | +void ChineseCalendar::setYear(int year) |
3224 | +{ |
3225 | + selectedDate = QDate(year+1900, selectedDate.month(), selectedDate.day()); |
3226 | + setCalendar(); |
3227 | +} |
3228 | + |
3229 | +void ChineseCalendar::on_TbpreviousYear_clicked() |
3230 | +{ |
3231 | + if(YearSelect->currentIndex() != 0) |
3232 | + YearSelect->setCurrentIndex(YearSelect->currentIndex()-1); |
3233 | +} |
3234 | + |
3235 | +void ChineseCalendar::on_TbpreviousMonth_clicked() |
3236 | +{ |
3237 | + if (monthCombo->currentIndex() == 0 && YearSelect->currentIndex() != 0) |
3238 | + { |
3239 | + YearSelect->setCurrentIndex(YearSelect->currentIndex()-1); |
3240 | + monthCombo->setCurrentIndex(11); |
3241 | + } |
3242 | + else |
3243 | + monthCombo->setCurrentIndex(monthCombo->currentIndex()-1); |
3244 | +} |
3245 | + |
3246 | +void ChineseCalendar::on_TbnextMonth_clicked() |
3247 | +{ |
3248 | + if (monthCombo->currentIndex() == 11 && YearSelect->currentIndex() != 150) |
3249 | + { |
3250 | + YearSelect->setCurrentIndex(YearSelect->currentIndex()+1); |
3251 | + monthCombo->setCurrentIndex(0); |
3252 | + } |
3253 | + else |
3254 | + monthCombo->setCurrentIndex(monthCombo->currentIndex()+1); |
3255 | +} |
3256 | + |
3257 | +void ChineseCalendar::on_TbnextYear_clicked() |
3258 | +{ |
3259 | + if(YearSelect->currentIndex() != 150) |
3260 | + YearSelect->setCurrentIndex(YearSelect->currentIndex()+1); |
3261 | +} |
3262 | + |
3263 | +void ChineseCalendar::showOrHide() |
3264 | +{ |
3265 | + if(this->isHidden()) |
3266 | + { |
3267 | + this->show(); |
3268 | + }else |
3269 | + this->hide(); |
3270 | +} |
3271 | + |
3272 | +void ChineseCalendar::setMode() |
3273 | +{ |
3274 | + if(this->actionStaysOnTop->isChecked()) |
3275 | + { |
3276 | + this->setWindowFlags(Qt::ToolTip | Qt::FramelessWindowHint); |
3277 | + this->show(); |
3278 | + } else if(this->actionStaysOnBottom->isChecked()) |
3279 | + { |
3280 | + this->setWindowFlags(Qt::WindowStaysOnBottomHint | Qt::FramelessWindowHint); |
3281 | + this->show(); |
3282 | + } else |
3283 | + { |
3284 | + this->setWindowFlags(Qt::FramelessWindowHint); |
3285 | + this->show(); |
3286 | + } |
3287 | +} |
3288 | + |
3289 | +void ChineseCalendar::slotChangeSkin() |
3290 | +{ |
3291 | + QAction *action = qobject_cast<QAction *>(sender()); |
3292 | + QString strSkin = action->text(); |
3293 | + |
3294 | + if (!strSkin.isEmpty()) |
3295 | + { |
3296 | + if (strSkin.toLower() == "default" || strSkin.toLower() == "black") |
3297 | + { |
3298 | + changeSkin(strSkin.toLower()); |
3299 | + } |
3300 | + else |
3301 | + { |
3302 | + changeSkin(strSkin, false); |
3303 | + } |
3304 | + } |
3305 | +} |
3306 | + |
3307 | +void ChineseCalendar::changeSkin(const QString &skin, bool bFlag) |
3308 | +{ |
3309 | + QString strFilename(""); |
3310 | + |
3311 | + if (bFlag) |
3312 | + { |
3313 | +#ifdef DEBUG |
3314 | + strFilename = QCoreApplication::applicationDirPath() + QString("/skin/%1-skin.qss").arg(skin); |
3315 | +#else |
3316 | + strFilename = QString("/usr/share/chinese-calendar/skin/%1-skin.qss").arg(skin); |
3317 | +#endif |
3318 | + } |
3319 | + else |
3320 | + { |
3321 | + strFilename = QDir::homePath() + QString("/.local/share/chinese-calendar/skins/%1.qss").arg(skin); |
3322 | + } |
3323 | + |
3324 | + QFile qss(strFilename); |
3325 | + if (qss.open(QFile::ReadOnly)) |
3326 | + { |
3327 | + qApp->setStyleSheet(qss.readAll()); |
3328 | + qss.close(); |
3329 | + } |
3330 | +} |
3331 | + |
3332 | +void ChineseCalendar::readSkinFiles() |
3333 | +{ |
3334 | + QString systemdirectory; |
3335 | + systemdirectory = QDir::homePath() + "/.local/share/chinese-calendar/skins/"; |
3336 | + |
3337 | + QDir dir(systemdirectory); |
3338 | + foreach(QFileInfo info, dir.entryInfoList()) |
3339 | + { |
3340 | + if (info.isFile() && info.suffix() == "qss") |
3341 | + { |
3342 | + m_strFileList << info.baseName(); |
3343 | + } |
3344 | + } |
3345 | +} |
3346 | |
3347 | === added file 'chinesecalendar.h' |
3348 | --- chinesecalendar.h 1970-01-01 00:00:00 +0000 |
3349 | +++ chinesecalendar.h 2013-05-06 14:54:28 +0000 |
3350 | @@ -0,0 +1,111 @@ |
3351 | +/* |
3352 | + * This file is part of the chinese-calendar project |
3353 | + * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd |
3354 | + * |
3355 | + * This program is free software: you can redistribute it and/or modify |
3356 | + * it under the terms of the GNU General Public License version 3 as |
3357 | + * published by the Free Software Foundation. |
3358 | + * |
3359 | + * This program is distributed in the hope that it will be useful, |
3360 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3361 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3362 | + * GNU General Public License for more details. |
3363 | + * |
3364 | + * You should have received a copy of the GNU General Public License |
3365 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3366 | + * |
3367 | + * This project is developed by "UbuntuKylin Members" team, |
3368 | + * see <https://launchpad.net/~ubuntukylin~members> |
3369 | + * Authors: Abel Liu <guiltyritter@gmail.com> |
3370 | + * Shine Huang <hostc@163.com> |
3371 | + */ |
3372 | + |
3373 | +#ifndef MYCALENDAR_H |
3374 | +#define MYCALENDAR_H |
3375 | + |
3376 | +#include <QWidget> |
3377 | +#include <QDate> |
3378 | +#include <QSystemTrayIcon> |
3379 | +#include <QMenu> |
3380 | +#include <QProcess> |
3381 | +#include <QGraphicsItem> |
3382 | +#include <QtGui> |
3383 | +#include <QMap> |
3384 | +#include <QPixmap> |
3385 | +#include <QSystemTrayIcon> |
3386 | +#include <QMenu> |
3387 | +#include <QAction> |
3388 | +#include <QActionGroup> |
3389 | +#include "ui_calendar.h" |
3390 | +#include "ccbo.h" |
3391 | +#include "dateitem.h" |
3392 | +#include "cnote.h" |
3393 | +class CCBO; |
3394 | +class ChineseCalendar: public QWidget, private Ui::Calendar |
3395 | +{ |
3396 | + Q_OBJECT |
3397 | +public: |
3398 | + explicit ChineseCalendar(QWidget *parent = 0); |
3399 | + virtual ~ChineseCalendar(); |
3400 | + QIcon icon, icon64; |
3401 | + int clickday; |
3402 | + |
3403 | +private: |
3404 | + void setCalendar(); |
3405 | + void cleardate(); |
3406 | + void clearbackground(); |
3407 | + void createTray(); |
3408 | + void setItemLayout(); |
3409 | + void resetItemLayout(); |
3410 | + CCalendar fixshengxiao(QDate); |
3411 | + Cnote *note; |
3412 | + |
3413 | + void paintEvent(QPaintEvent *); |
3414 | + |
3415 | + bool moveable; |
3416 | + bool isTall; |
3417 | + QPoint dragPos; |
3418 | + QDate selectedDate; |
3419 | + CCBO *mycalendat; |
3420 | + QMap<QString, DateItem*> *map; |
3421 | + |
3422 | + QPixmap *bg; |
3423 | + QSystemTrayIcon *trayIcon; |
3424 | + QMenu *trayMenu; |
3425 | + QActionGroup *ag; |
3426 | + QAction *actionShow, *actionStaysOnTop, *actionStaysOnBottom, *actionStaysNormal, *actionQuit; |
3427 | + QAction *actionDefault; |
3428 | + QAction *actionSkin; |
3429 | + QMenu *skinMenu; |
3430 | + |
3431 | +public slots: |
3432 | + void setMonth(int month); |
3433 | + void setYear(int year); |
3434 | + void setTime(); |
3435 | + void resetcalendardate(QString); |
3436 | + void backtoday(); |
3437 | + void showOrHide(); |
3438 | + void setMode(); |
3439 | + void savedata(QString); |
3440 | + void setclickday(QString); |
3441 | + |
3442 | + |
3443 | +protected: |
3444 | + void mousePressEvent(QMouseEvent *event); |
3445 | + void mouseMoveEvent(QMouseEvent *event); |
3446 | + void mouseReleaseEvent(QMouseEvent *event); |
3447 | + |
3448 | +private slots: |
3449 | + void on_TbnextYear_clicked(); |
3450 | + void on_TbnextMonth_clicked(); |
3451 | + void on_TbpreviousMonth_clicked(); |
3452 | + void on_TbpreviousYear_clicked(); |
3453 | + void slotChangeSkin(); |
3454 | +private: |
3455 | + void changeSkin(const QString &, bool bFlag = true); |
3456 | + void readSkinFiles(); |
3457 | + |
3458 | + QStringList m_strFileList; |
3459 | +}; |
3460 | + |
3461 | +#endif |
3462 | |
3463 | === added file 'cnote.cpp' |
3464 | --- cnote.cpp 1970-01-01 00:00:00 +0000 |
3465 | +++ cnote.cpp 2013-05-06 14:54:28 +0000 |
3466 | @@ -0,0 +1,89 @@ |
3467 | +#include "cnote.h" |
3468 | +#include "ccbo.h" |
3469 | +#include <QtGui> |
3470 | + |
3471 | +Cnote::Cnote(QWidget *parent) : |
3472 | + QDialog(parent) |
3473 | +{ |
3474 | + setWindowFlags(Qt::FramelessWindowHint); |
3475 | + setAttribute(Qt::WA_TranslucentBackground); |
3476 | + //pix.load(":/img/note.png",0,Qt::AvoidDither|Qt::ThresholdDither|Qt::ThresholdAlphaDither); |
3477 | + resize(224,280); |
3478 | + textedit = new QTextEdit(this); textedit->setObjectName("textedit"); |
3479 | + ok = new QPushButton(this); ok->setObjectName("ok"); |
3480 | + cancel = new QPushButton(this);cancel->setObjectName("cancel"); |
3481 | + datelabel = new QLabel(this);datelabel->setObjectName("datelabel"); |
3482 | + clearplan = new QPushButton(this);clearplan->setObjectName("clearplan"); |
3483 | + textedit->resize(155,140); |
3484 | + textedit->move(30,60); |
3485 | + ok->resize(30,30); |
3486 | + ok->move(120,210); |
3487 | + cancel->resize(30,30); |
3488 | + cancel->move(160,210); |
3489 | + clearplan->resize(70,30); |
3490 | + clearplan->setText("清空计划"); |
3491 | + clearplan->move(30,210); |
3492 | + datelabel->resize(120,20); |
3493 | + datelabel->move(50,40); |
3494 | + |
3495 | + //ok->setStyleSheet("QPushButton{background-color:transparent;}"); |
3496 | + //cancel->setStyleSheet("QPushButton{background-color:transparent;border:0 solid}"); |
3497 | + //datelabel->setStyleSheet("QLabel{background-color:transparent;border:0 solid;}"); |
3498 | + //clearplan->setStyleSheet("QPushButton{background-color:transparent;}"); |
3499 | + //ok->setIcon(QIcon(":/img/ok.png")); |
3500 | + //cancel->setIcon(QIcon(":/img/no.png")); |
3501 | + //textedit->setStyleSheet("QTextEdit{background-color:transparent;border:0 solid;}"); |
3502 | + connect(this->ok,SIGNAL(clicked()),this,SLOT(savenote())); |
3503 | + connect(this->cancel,SIGNAL(clicked()),this,SLOT(cancelnote())); |
3504 | + connect(this->clearplan,SIGNAL(clicked()),this,SLOT(clean())); |
3505 | + |
3506 | +} |
3507 | + |
3508 | +Cnote::~Cnote() |
3509 | +{ |
3510 | + |
3511 | +} |
3512 | + |
3513 | +void Cnote::clean() |
3514 | +{ |
3515 | + this->textedit->clear(); |
3516 | +} |
3517 | + |
3518 | +void Cnote::savenote() |
3519 | +{ |
3520 | + emit save(this->textedit->toPlainText()); |
3521 | + |
3522 | + this->hide(); |
3523 | + this->textedit->clear(); |
3524 | +} |
3525 | + |
3526 | +void Cnote::cancelnote() |
3527 | +{ |
3528 | + this->hide(); |
3529 | + this->textedit->clear(); |
3530 | +} |
3531 | + |
3532 | +void Cnote::paintEvent(QPaintEvent *) |
3533 | +{ |
3534 | + QPainter painter(this); |
3535 | + //painter.drawPixmap(0,0,pix.scaled(this->size(),Qt::IgnoreAspectRatio,Qt::SmoothTransformation)); |
3536 | + QStyleOption opt; |
3537 | + opt.init(this); |
3538 | + style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this); |
3539 | +} |
3540 | + |
3541 | +void Cnote::mouseMoveEvent(QMouseEvent *event) |
3542 | +{ |
3543 | + move(event->globalPos() - dragPos); |
3544 | + setWindowOpacity(0.5); |
3545 | +} |
3546 | + |
3547 | +void Cnote::mousePressEvent(QMouseEvent *event) |
3548 | +{ |
3549 | + dragPos = event->globalPos() - frameGeometry().topLeft(); |
3550 | +} |
3551 | + |
3552 | +void Cnote::mouseReleaseEvent(QMouseEvent *event) |
3553 | +{ |
3554 | + setWindowOpacity(1.0); |
3555 | +} |
3556 | |
3557 | === added file 'cnote.h' |
3558 | --- cnote.h 1970-01-01 00:00:00 +0000 |
3559 | +++ cnote.h 2013-05-06 14:54:28 +0000 |
3560 | @@ -0,0 +1,39 @@ |
3561 | +#ifndef CNOTE_H |
3562 | +#define CNOTE_H |
3563 | + |
3564 | +#include <QWidget> |
3565 | +#include <QtGui> |
3566 | +#include <QDialog> |
3567 | + |
3568 | +class Cnote : public QDialog |
3569 | +{ |
3570 | + Q_OBJECT |
3571 | +public: |
3572 | + explicit Cnote(QWidget *parent = 0); |
3573 | + ~Cnote(); |
3574 | + QPixmap pix; |
3575 | + void paintEvent(QPaintEvent *); |
3576 | + QPoint dragPos; |
3577 | + QTextEdit *textedit; |
3578 | + QLabel *datelabel; |
3579 | +protected: |
3580 | + void mouseMoveEvent(QMouseEvent *event); |
3581 | + void mousePressEvent(QMouseEvent *event); |
3582 | + void mouseReleaseEvent(QMouseEvent *event); |
3583 | +private: |
3584 | + QPushButton *ok; |
3585 | + QPushButton *cancel; |
3586 | + QPushButton *clearplan; |
3587 | +public slots: |
3588 | + void savenote(); |
3589 | + void cancelnote(); |
3590 | + void clean(); |
3591 | + |
3592 | +signals: |
3593 | + void save(QString); |
3594 | + |
3595 | + |
3596 | + |
3597 | +}; |
3598 | + |
3599 | +#endif // CNOTE_H |
3600 | |
3601 | === added file 'dateitem.cpp' |
3602 | --- dateitem.cpp 1970-01-01 00:00:00 +0000 |
3603 | +++ dateitem.cpp 2013-05-06 14:54:28 +0000 |
3604 | @@ -0,0 +1,195 @@ |
3605 | +/* |
3606 | + * This file is part of the chinese-calendar project |
3607 | + * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd |
3608 | + * |
3609 | + * This program is free software: you can redistribute it and/or modify |
3610 | + * it under the terms of the GNU General Public License version 3 as |
3611 | + * published by the Free Software Foundation. |
3612 | + * |
3613 | + * This program is distributed in the hope that it will be useful, |
3614 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3615 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3616 | + * GNU General Public License for more details. |
3617 | + * |
3618 | + * You should have received a copy of the GNU General Public License |
3619 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3620 | + * |
3621 | + * This project is developed by "UbuntuKylin Members" team, |
3622 | + * see <https://launchpad.net/~ubuntukylin~members> |
3623 | + * Authors: Abel Liu <guiltyritter@gmail.com> |
3624 | + * Shine Huang <hostc@163.com> |
3625 | + */ |
3626 | + |
3627 | +#include "dateitem.h" |
3628 | +//extern Cnote *note; |
3629 | + |
3630 | +DateItem::DateItem(QWidget *parent) : |
3631 | + QWidget(parent), |
3632 | + ui(new Ui::DateItem) |
3633 | +{ |
3634 | + ui->setupUi(this); |
3635 | + QFont font ; |
3636 | + font.setPointSize(15); |
3637 | + QFont font1; |
3638 | + font1.setPointSize(10); |
3639 | + ui->label->setFont(font); |
3640 | + ui->label_2->setFont(font1); |
3641 | + |
3642 | + connect(ui->datemaskwidget, SIGNAL(clicked()), this, SLOT(click())); |
3643 | + connect(ui->datemaskwidget, SIGNAL(clickday()), this, SLOT(clickday())); |
3644 | + |
3645 | + ui->datemaskwidget->installEventFilter(this); |
3646 | + |
3647 | + this->isFocus = false; |
3648 | + this->oriItemStyle = this->styleSheet(); |
3649 | + this->oriDayStyle = ui->label->styleSheet(); |
3650 | + this->oriCDayStyle = ui->label_2->styleSheet(); |
3651 | + this->clickiItemStyle = "QWidget{background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(238, 93, 0, 255), stop:1 rgba(255, 121, 2, 200));}"; |
3652 | + this->clickDayStyle = "QLabel{color:rgb(255,255,255);}"; |
3653 | + this->clickCDayStyle = "QLabel{color:rgb(255,255,255);}"; |
3654 | + this->hoverItemStyle = "QWidget{background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(238, 93, 0, 155), stop:1 rgba(255, 121, 2, 100));}"; |
3655 | + this->hoverDayStyle = "QLabel{color:rgb(255,255,255);}"; |
3656 | + this->hoverCDayStyle = "QLabel{color:rgb(255,255,255);}"; |
3657 | +} |
3658 | + |
3659 | +DateItem::~DateItem() |
3660 | +{ |
3661 | + delete ui; |
3662 | +} |
3663 | + |
3664 | +bool DateItem::eventFilter(QObject *o, QEvent *ev) |
3665 | +{ |
3666 | + if(o == ui->datemaskwidget){ |
3667 | + if(ev->type() == QEvent::Enter){ |
3668 | + this->enter(); |
3669 | + }else if(ev->type() == QEvent::Leave){ |
3670 | + this->leave(); |
3671 | + }else{ |
3672 | + return QObject::eventFilter(o,ev); |
3673 | + } |
3674 | + } |
3675 | +} |
3676 | + |
3677 | +void DateItem::resizeItem(int x, int y) |
3678 | +{ |
3679 | + this->resize(x,y); |
3680 | + ui->datemaskwidget->resize(x,y); |
3681 | + if ( y == 47 ) |
3682 | + { |
3683 | + ui->label->resize(55,27); |
3684 | + ui->label->move(0,0); |
3685 | + ui->label_2->resize(55,20); |
3686 | + ui->label_2->move(0,27); |
3687 | + } |
3688 | + if( y == 39 ) |
3689 | + { |
3690 | + ui->label->resize(55,22); |
3691 | + ui->label->move(0,0); |
3692 | + ui->label_2->resize(55,17); |
3693 | + ui->label_2->move(0,22); |
3694 | + } |
3695 | +} |
3696 | + |
3697 | +void DateItem::enter() |
3698 | +{ |
3699 | + if (!ui->label->text().isNull()) |
3700 | + { |
3701 | + this->setStyleSheet(this->hoverItemStyle); |
3702 | + ui->label->setStyleSheet(this->hoverDayStyle); |
3703 | + ui->label_2->setStyleSheet(this->hoverCDayStyle); |
3704 | + } |
3705 | +} |
3706 | + |
3707 | +void DateItem::leave() |
3708 | +{ |
3709 | + if(this->isFocus){ |
3710 | + this->setStyleSheet(this->clickiItemStyle); |
3711 | + ui->label->setStyleSheet(this->clickDayStyle); |
3712 | + ui->label_2->setStyleSheet(this->clickCDayStyle); |
3713 | + }else{ |
3714 | + this->setStyleSheet(this->oriItemStyle); |
3715 | + ui->label->setStyleSheet(this->oriDayStyle); |
3716 | + ui->label_2->setStyleSheet(this->oriCDayStyle); |
3717 | + } |
3718 | +} |
3719 | + |
3720 | + |
3721 | +void DateItem::click() |
3722 | +{ |
3723 | + if (!ui->label->text().isNull()) |
3724 | + { |
3725 | + emit clicked(ui->label->text()); |
3726 | + this->setStyleSheet(this->clickiItemStyle); |
3727 | + ui->label->setStyleSheet(this->clickDayStyle); |
3728 | + ui->label_2->setStyleSheet(this->clickCDayStyle); |
3729 | + this->isFocus = true; |
3730 | + } |
3731 | +} |
3732 | + |
3733 | +void DateItem::clickday() |
3734 | +{ |
3735 | + if(!ui->label->text().isNull()) |
3736 | + { |
3737 | + emit day(ui->label->text()); |
3738 | +// note->show(); |
3739 | + } |
3740 | +} |
3741 | + |
3742 | +void DateItem::setday(int day) |
3743 | +{ |
3744 | + ui->label->setText(QString::number(day)); |
3745 | +} |
3746 | + |
3747 | +void DateItem::setcday(QString cday) |
3748 | +{ |
3749 | + ui->label_2->setText(cday); |
3750 | +} |
3751 | + |
3752 | +QString DateItem::day() |
3753 | +{ |
3754 | + return ui->label->text(); |
3755 | +} |
3756 | + |
3757 | +QString DateItem::cday() |
3758 | +{ |
3759 | + return ui->label_2->text(); |
3760 | +} |
3761 | + |
3762 | +void DateItem::clear() |
3763 | +{ |
3764 | + ui->label->clear(); |
3765 | + ui->label_2->clear(); |
3766 | + this->clearstyle(); |
3767 | +} |
3768 | + |
3769 | +void DateItem::clearstyle() |
3770 | +{ |
3771 | + this->setStyleSheet(this->oriItemStyle); |
3772 | + ui->label->setStyleSheet(this->oriDayStyle); |
3773 | + ui->label_2->setStyleSheet(this->oriCDayStyle); |
3774 | + this->isFocus = false; |
3775 | +} |
3776 | + |
3777 | +void DateItem::setcolor() |
3778 | +{ |
3779 | + QPalette pa; |
3780 | + pa.setColor(QPalette::WindowText,Qt::red); |
3781 | + ui->label->setPalette(pa); |
3782 | + ui->label_2->setPalette(pa); |
3783 | +} |
3784 | + |
3785 | +void DateItem::setToday() |
3786 | +{ |
3787 | + this->setStyleSheet(this->clickiItemStyle); |
3788 | + ui->label->setStyleSheet(this->clickDayStyle); |
3789 | + ui->label_2->setStyleSheet(this->clickCDayStyle); |
3790 | + this->isFocus = true; |
3791 | +} |
3792 | + |
3793 | +void DateItem::paintEvent(QPaintEvent *) |
3794 | +{ |
3795 | + QPainter painter(this); |
3796 | + QStyleOption opt; |
3797 | + opt.init(this); |
3798 | + style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this); |
3799 | +} |
3800 | |
3801 | === renamed file 'dateitem.cpp' => 'dateitem.cpp.moved' |
3802 | === added file 'dateitem.h' |
3803 | --- dateitem.h 1970-01-01 00:00:00 +0000 |
3804 | +++ dateitem.h 2013-05-06 14:54:28 +0000 |
3805 | @@ -0,0 +1,76 @@ |
3806 | +/* |
3807 | + * This file is part of the chinese-calendar project |
3808 | + * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd |
3809 | + * |
3810 | + * This program is free software: you can redistribute it and/or modify |
3811 | + * it under the terms of the GNU General Public License version 3 as |
3812 | + * published by the Free Software Foundation. |
3813 | + * |
3814 | + * This program is distributed in the hope that it will be useful, |
3815 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3816 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3817 | + * GNU General Public License for more details. |
3818 | + * |
3819 | + * You should have received a copy of the GNU General Public License |
3820 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3821 | + * |
3822 | + * This project is developed by "UbuntuKylin Members" team, |
3823 | + * see <https://launchpad.net/~ubuntukylin~members> |
3824 | + * Authors: Abel Liu <guiltyritter@gmail.com> |
3825 | + * Shine Huang <hostc@163.com> |
3826 | + */ |
3827 | + |
3828 | +#ifndef DATEITEM_H |
3829 | +#define DATEITEM_H |
3830 | + |
3831 | +#include <QtGui> |
3832 | +#include <QWidget> |
3833 | +#include "datemaskwidget.h" |
3834 | +#include "ui_dateitem.h" |
3835 | + |
3836 | +namespace Ui { |
3837 | +class DateItem; |
3838 | +} |
3839 | + |
3840 | +class DateItem : public QWidget |
3841 | +{ |
3842 | + Q_OBJECT |
3843 | + |
3844 | +public: |
3845 | + explicit DateItem(QWidget *parent = 0); |
3846 | + ~DateItem(); |
3847 | + int row; |
3848 | + int column; |
3849 | + void setday(int day); |
3850 | + void setcday(QString cday); |
3851 | + void clear(); |
3852 | + void clearstyle(); |
3853 | + void setcolor(); |
3854 | + void setToday(); |
3855 | + QString day(); |
3856 | + QString cday(); |
3857 | + void resizeItem(int x,int y); |
3858 | + |
3859 | +protected: |
3860 | + void paintEvent(QPaintEvent *); |
3861 | + bool eventFilter(QObject *o, QEvent *ev); |
3862 | + void enter(); |
3863 | + void leave(); |
3864 | + |
3865 | +public slots: |
3866 | + void click(); |
3867 | + void clickday(); |
3868 | + |
3869 | +signals: |
3870 | + void clicked(QString); |
3871 | + void day(QString); |
3872 | + |
3873 | +private: |
3874 | + Ui::DateItem *ui; |
3875 | + bool isFocus; |
3876 | + QString oriItemStyle, oriDayStyle, oriCDayStyle; |
3877 | + QString clickiItemStyle, clickDayStyle, clickCDayStyle; |
3878 | + QString hoverItemStyle, hoverDayStyle, hoverCDayStyle; |
3879 | +}; |
3880 | + |
3881 | +#endif // DATEITEM_H |
3882 | |
3883 | === renamed file 'dateitem.h' => 'dateitem.h.moved' |
3884 | === added file 'dateitem.ui' |
3885 | --- dateitem.ui 1970-01-01 00:00:00 +0000 |
3886 | +++ dateitem.ui 2013-05-06 14:54:28 +0000 |
3887 | @@ -0,0 +1,71 @@ |
3888 | +<?xml version="1.0" encoding="UTF-8"?> |
3889 | +<ui version="4.0"> |
3890 | + <class>DateItem</class> |
3891 | + <widget class="QWidget" name="DateItem"> |
3892 | + <property name="geometry"> |
3893 | + <rect> |
3894 | + <x>0</x> |
3895 | + <y>0</y> |
3896 | + <width>55</width> |
3897 | + <height>47</height> |
3898 | + </rect> |
3899 | + </property> |
3900 | + <property name="windowTitle"> |
3901 | + <string>Form</string> |
3902 | + </property> |
3903 | + <property name="styleSheet"> |
3904 | + <string notr="true"/> |
3905 | + </property> |
3906 | + <widget class="QLabel" name="label"> |
3907 | + <property name="geometry"> |
3908 | + <rect> |
3909 | + <x>0</x> |
3910 | + <y>0</y> |
3911 | + <width>55</width> |
3912 | + <height>27</height> |
3913 | + </rect> |
3914 | + </property> |
3915 | + <property name="text"> |
3916 | + <string>17</string> |
3917 | + </property> |
3918 | + <property name="alignment"> |
3919 | + <set>Qt::AlignCenter</set> |
3920 | + </property> |
3921 | + </widget> |
3922 | + <widget class="QLabel" name="label_2"> |
3923 | + <property name="geometry"> |
3924 | + <rect> |
3925 | + <x>0</x> |
3926 | + <y>27</y> |
3927 | + <width>55</width> |
3928 | + <height>20</height> |
3929 | + </rect> |
3930 | + </property> |
3931 | + <property name="text"> |
3932 | + <string>端午节</string> |
3933 | + </property> |
3934 | + <property name="alignment"> |
3935 | + <set>Qt::AlignCenter</set> |
3936 | + </property> |
3937 | + </widget> |
3938 | + <widget class="DateMaskWidget" name="datemaskwidget" native="true"> |
3939 | + <property name="geometry"> |
3940 | + <rect> |
3941 | + <x>0</x> |
3942 | + <y>0</y> |
3943 | + <width>55</width> |
3944 | + <height>47</height> |
3945 | + </rect> |
3946 | + </property> |
3947 | + </widget> |
3948 | + </widget> |
3949 | + <customwidgets> |
3950 | + <customwidget> |
3951 | + <class>DateMaskWidget</class> |
3952 | + <extends>QWidget</extends> |
3953 | + <header>datemaskwidget.h</header> |
3954 | + </customwidget> |
3955 | + </customwidgets> |
3956 | + <resources/> |
3957 | + <connections/> |
3958 | +</ui> |
3959 | |
3960 | === renamed file 'dateitem.ui' => 'dateitem.ui.moved' |
3961 | === added file 'datemaskwidget.cpp' |
3962 | --- datemaskwidget.cpp 1970-01-01 00:00:00 +0000 |
3963 | +++ datemaskwidget.cpp 2013-05-06 14:54:28 +0000 |
3964 | @@ -0,0 +1,41 @@ |
3965 | +/* |
3966 | + * This file is part of the chinese-calendar project |
3967 | + * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd |
3968 | + * |
3969 | + * This program is free software: you can redistribute it and/or modify |
3970 | + * it under the terms of the GNU General Public License version 3 as |
3971 | + * published by the Free Software Foundation. |
3972 | + * |
3973 | + * This program is distributed in the hope that it will be useful, |
3974 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3975 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3976 | + * GNU General Public License for more details. |
3977 | + * |
3978 | + * You should have received a copy of the GNU General Public License |
3979 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
3980 | + * |
3981 | + * This project is developed by "UbuntuKylin Members" team, |
3982 | + * see <https://launchpad.net/~ubuntukylin~members> |
3983 | + * Authors: Abel Liu <guiltyritter@gmail.com> |
3984 | + * Shine Huang <hostc@163.com> |
3985 | + */ |
3986 | + |
3987 | +#include "datemaskwidget.h" |
3988 | +#include <QDebug> |
3989 | +#include "chinesecalendar.h" |
3990 | +DateMaskWidget::DateMaskWidget(QWidget *parent) : |
3991 | + QWidget(parent) |
3992 | +{ |
3993 | + |
3994 | +} |
3995 | + |
3996 | +void DateMaskWidget::mousePressEvent(QMouseEvent *ev) |
3997 | +{ |
3998 | + if( ev->button() == Qt::LeftButton) |
3999 | + emit clicked(); |
4000 | + if( ev->button() == Qt::LeftButton && ev->type() == QEvent::MouseButtonDblClick) |
4001 | + { |
4002 | + emit clickday(); |
4003 | + } |
4004 | + ev->ignore(); |
4005 | +} |
4006 | |
4007 | === renamed file 'datemaskwidget.cpp' => 'datemaskwidget.cpp.moved' |
4008 | === added file 'datemaskwidget.h' |
4009 | --- datemaskwidget.h 1970-01-01 00:00:00 +0000 |
4010 | +++ datemaskwidget.h 2013-05-06 14:54:28 +0000 |
4011 | @@ -0,0 +1,48 @@ |
4012 | +/* |
4013 | + * This file is part of the chinese-calendar project |
4014 | + * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd |
4015 | + * |
4016 | + * This program is free software: you can redistribute it and/or modify |
4017 | + * it under the terms of the GNU General Public License version 3 as |
4018 | + * published by the Free Software Foundation. |
4019 | + * |
4020 | + * This program is distributed in the hope that it will be useful, |
4021 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4022 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4023 | + * GNU General Public License for more details. |
4024 | + * |
4025 | + * You should have received a copy of the GNU General Public License |
4026 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4027 | + * |
4028 | + * This project is developed by "UbuntuKylin Members" team, |
4029 | + * see <https://launchpad.net/~ubuntukylin~members> |
4030 | + * Authors: Abel Liu <guiltyritter@gmail.com> |
4031 | + * Shine Huang <hostc@163.com> |
4032 | + */ |
4033 | + |
4034 | +#ifndef DATEMASKWIDGET_H |
4035 | +#define DATEMASKWIDGET_H |
4036 | + |
4037 | +#include <QWidget> |
4038 | +#include <QMouseEvent> |
4039 | +#include "cnote.h" |
4040 | + |
4041 | +class DateMaskWidget : public QWidget |
4042 | +{ |
4043 | + Q_OBJECT |
4044 | +public: |
4045 | + explicit DateMaskWidget(QWidget *parent = 0); |
4046 | + |
4047 | +signals: |
4048 | + void clicked(); |
4049 | + void clickday(); |
4050 | + |
4051 | +protected: |
4052 | + void mousePressEvent(QMouseEvent *ev); |
4053 | + |
4054 | +private: |
4055 | + QPoint mousePos; |
4056 | + |
4057 | +}; |
4058 | + |
4059 | +#endif // DATEMASKWIDGET_H |
4060 | |
4061 | === renamed file 'datemaskwidget.h' => 'datemaskwidget.h.moved' |
4062 | === added directory 'debian' |
4063 | === added file 'debian/changelog' |
4064 | --- debian/changelog 1970-01-01 00:00:00 +0000 |
4065 | +++ debian/changelog 2013-05-06 14:54:28 +0000 |
4066 | @@ -0,0 +1,57 @@ |
4067 | +chinese-calendar (0.7.8-1) raring; urgency=low |
4068 | + |
4069 | + * add skins changing function code |
4070 | + * add default and black skin qss files |
4071 | + |
4072 | + -- mutse <yyhoo2.young@gmail.com> Wed, 01 May 2013 19:11:07 +0800 |
4073 | + |
4074 | +chinese-calendar (0.7.7-0ubuntu1) raring; urgency=low |
4075 | + |
4076 | + [ abelsaber (Yes,it's true) ] |
4077 | + * Fix bug #1160698, bug #1164859, bug #1161756, bug #1155491, bug #1160698, bug #1160800. |
4078 | + |
4079 | +chinese-calendar (0.7.6-0ubuntu4) raring; urgency=low |
4080 | + |
4081 | + * add 03-save-data-per-user.diff (LP: #1160149) |
4082 | + * remove debian/postinst, since db will be saved under |
4083 | + user's home. |
4084 | + |
4085 | + -- Zhengpeng Hou <zhengpeng-hou@ubuntu.com> Tue, 26 Mar 2013 22:49:47 +0800 |
4086 | + |
4087 | +chinese-calendar (0.7.6-0ubuntu3) raring; urgency=low |
4088 | + |
4089 | + * add 02-fix-write-permission.diff. (LP: #1159732) |
4090 | + |
4091 | + -- Zhengpeng Hou <zhengpeng-hou@ubuntu.com> Mon, 25 Mar 2013 20:12:01 +0800 |
4092 | + |
4093 | +chinese-calendar (0.7.6-0ubuntu2) raring; urgency=low |
4094 | + |
4095 | + * Add 01-fix-crash.diff to fix the crash on startup. |
4096 | + |
4097 | + -- Zhengpeng Hou <zhengpeng-hou@ubuntu.com> Thu, 14 Mar 2013 21:41:07 +0800 |
4098 | + |
4099 | +chinese-calendar (0.7.6-0ubuntu1) raring; urgency=high |
4100 | + |
4101 | + * Fix bug #1154063, bug #1154075, bug #1154079, bug #1154050. |
4102 | + * Modify note function. |
4103 | + |
4104 | + -- abelsaber (Yes,it's true) <guiltyritter@gmail.com> Wed, 13 Mar 2013 10:12:21 +0800 |
4105 | + |
4106 | +chinese-calendar (0.7.5) raring; urgency=high |
4107 | + |
4108 | + * Fix bug #1124849, bug #1124747, bug #1124831, bug #1131516, bug #1124825, bug #1129925. |
4109 | + * Add note function. |
4110 | + |
4111 | + -- abelsaber (Yes,it's true) <guiltyritter@gmail.com> Tue, 12 Mar 2013 14:25:51 +0800 |
4112 | + |
4113 | +chinese-calendar (0.7.4) raring; urgency=low |
4114 | + |
4115 | + * Optimize the display of dateitem, add systemtray. |
4116 | + |
4117 | + -- abelsaber (Yes,it's true) <guiltyritter@gmail.com> Tue, 29 Jan 2013 14:33:08 +0800 |
4118 | + |
4119 | +chinese-calendar (0.6.2-1) raring; urgency=low |
4120 | + |
4121 | + * Initial release. |
4122 | + |
4123 | + -- abelsaber (Yes,it's true) <guiltyritter@gmail.com> Tue, 22 Jan 2013 14:10:26 +0800 |
4124 | |
4125 | === added file 'debian/compat' |
4126 | --- debian/compat 1970-01-01 00:00:00 +0000 |
4127 | +++ debian/compat 2013-05-06 14:54:28 +0000 |
4128 | @@ -0,0 +1,1 @@ |
4129 | +8 |
4130 | |
4131 | === added file 'debian/control' |
4132 | --- debian/control 1970-01-01 00:00:00 +0000 |
4133 | +++ debian/control 2013-05-06 14:54:28 +0000 |
4134 | @@ -0,0 +1,17 @@ |
4135 | +Source: chinese-calendar |
4136 | +Section: utils |
4137 | +Priority: extra |
4138 | +Maintainer: abel <guiltyritter@gmail.com> |
4139 | +Build-Depends: debhelper (>= 8.0.0), libqt4-dev (>=4.8.1), libqt4-sql-sqlite, ttf-wqy-microhei |
4140 | +Standards-Version: 3.9.2 |
4141 | +Homepage: https://launchpad.net/chinese-calendar |
4142 | + |
4143 | +Package: chinese-calendar |
4144 | +Architecture: any |
4145 | +Depends: ${shlibs:Depends}, ${misc:Depends} |
4146 | +Description: Chinese lunar calendar |
4147 | + This indicator is used to show a Chinese lunar calendar which is |
4148 | + tailored for Chinese users. The calendar can show festivals and the |
4149 | + 24 solar terms, year and month is also selectable. |
4150 | + . |
4151 | + This calendar is the default application in the UbuntuKylin flavour. |
4152 | |
4153 | === added file 'debian/copyright' |
4154 | --- debian/copyright 1970-01-01 00:00:00 +0000 |
4155 | +++ debian/copyright 2013-05-06 14:54:28 +0000 |
4156 | @@ -0,0 +1,19 @@ |
4157 | +Format: http://dep.debian.net/deps/dep5 |
4158 | +Upstream-Name: chinese-calendar |
4159 | +Upstream-Contact: abel <guiltyritter@gmail.com> |
4160 | +Source: https://launchpad.net/chinese-calendar |
4161 | + |
4162 | +Files: * |
4163 | +Copyright: Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Lt |
4164 | +License: GPL-3 |
4165 | + This program is free software: you can redistribute it and/or modify |
4166 | + it under the terms of the GNU General Public License version 3 as |
4167 | + published by the Free Software Foundation. |
4168 | + . |
4169 | + This program is distributed in the hope that it will be useful, |
4170 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
4171 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4172 | + GNU General Public License for more details. |
4173 | + . |
4174 | + On Debian/Ubuntu systems, the full text of the GPL v3 can be found in |
4175 | + `/usr/share/common-licenses/GPL-3' |
4176 | |
4177 | === added file 'debian/rules' |
4178 | --- debian/rules 1970-01-01 00:00:00 +0000 |
4179 | +++ debian/rules 2013-05-06 14:54:28 +0000 |
4180 | @@ -0,0 +1,5 @@ |
4181 | +#!/usr/bin/make -f |
4182 | +# -*- makefile -*- |
4183 | + |
4184 | +%: |
4185 | + dh $@ |
4186 | |
4187 | === added directory 'debian/source' |
4188 | === added file 'debian/source/format' |
4189 | --- debian/source/format 1970-01-01 00:00:00 +0000 |
4190 | +++ debian/source/format 2013-05-06 14:54:28 +0000 |
4191 | @@ -0,0 +1,1 @@ |
4192 | +3.0 (quilt) |
4193 | |
4194 | === added directory 'img' |
4195 | === renamed directory 'img' => 'img.moved' |
4196 | === added file 'img/chinesecalendar-64.png' |
4197 | Binary files img/chinesecalendar-64.png 1970-01-01 00:00:00 +0000 and img/chinesecalendar-64.png 2013-05-06 14:54:28 +0000 differ |
4198 | === added file 'img/chinesecalendar.svg' |
4199 | --- img/chinesecalendar.svg 1970-01-01 00:00:00 +0000 |
4200 | +++ img/chinesecalendar.svg 2013-05-06 14:54:28 +0000 |
4201 | @@ -0,0 +1,214 @@ |
4202 | +<?xml version="1.0" encoding="utf-8"?> |
4203 | +<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) --> |
4204 | +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
4205 | +<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" |
4206 | + width="64px" height="64px" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve"> |
4207 | +<g> |
4208 | + |
4209 | + <image overflow="visible" opacity="0.55" width="62" height="62" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAACXBIWXMAAAsSAAALEgHS3X78AAAA |
4210 | +GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAATRJREFUeNrs27FqAkEUheHZcQ0W |
4211 | +CqK9ffIC1nnyvEMKt08fEVQI2bDrGbyTnYRYBGy8/gOHu2D1zYzTnVEYVmWJxbenhGKG2ma074nN |
4212 | +GHytTvlSPmx2te1CmktlpSyUh3J3bnz1yqeyVd6Ud6XNJz4x9LPypEydwQ/KRnlRjhlenvijslbm |
4213 | +jq57uuY724BXs1blf3yszAy9cAYPZhtnV33hVY/OHrj463V393r/ayeAAwcOHDhw4MCBAwcOHDhw |
4214 | +4MCBAwcOHDhw4MCBAwcOHDhw4MCBAwcOHDhw4MCBAwcOHDjwa6+yodBbujDUGTys7Mm+H/D0Q6vs |
4215 | +w7m44uk25DLO3oxdhqddSCW01Mdqwrm34bF+1ZgxWftcUEntnLsq3FXFtb67imX5H28dnfRfJ/89 |
4216 | +TwIMADtMQaNu0ySdAAAAAElFTkSuQmCC" transform="matrix(1 0 0 1 1 2)"> |
4217 | + </image> |
4218 | + <g> |
4219 | + <path fill="#590100" d="M60,57c0,1.658-1.344,3-3,3H7c-1.657,0-3-1.342-3-3V7c0-1.656,1.343-3,3-3h50c1.656,0,3,1.344,3,3V57z"/> |
4220 | + </g> |
4221 | +</g> |
4222 | +<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="4" y1="32" x2="60" y2="32"> |
4223 | + <stop offset="0" style="stop-color:#FFFFFF;stop-opacity:0"/> |
4224 | + <stop offset="0.5" style="stop-color:#FFFFFF"/> |
4225 | + <stop offset="1" style="stop-color:#FFFFFF;stop-opacity:0"/> |
4226 | +</linearGradient> |
4227 | +<path opacity="0.3" fill="url(#SVGID_1_)" d="M60,57c0,1.658-1.344,3-3,3H7c-1.657,0-3-1.342-3-3V7c0-1.656,1.343-3,3-3h50 |
4228 | + c1.656,0,3,1.344,3,3V57z"/> |
4229 | +<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="31.9995" y1="4" x2="31.9995" y2="57.2713"> |
4230 | + <stop offset="0" style="stop-color:#FFA44D"/> |
4231 | + <stop offset="1" style="stop-color:#CD0100"/> |
4232 | +</linearGradient> |
4233 | +<path fill="url(#SVGID_2_)" d="M60,54c0,1.658-1.344,3-3,3H7c-1.657,0-3-1.342-3-3V7c0-1.656,1.343-3,3-3h50c1.656,0,3,1.344,3,3V54 |
4234 | + z"/> |
4235 | +<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="31.9995" y1="5" x2="31.9995" y2="56.2611"> |
4236 | + <stop offset="0" style="stop-color:#FF7D01"/> |
4237 | + <stop offset="1" style="stop-color:#990100"/> |
4238 | +</linearGradient> |
4239 | +<path fill="url(#SVGID_3_)" d="M7,56c-1.103,0-2-0.897-2-2V7c0-1.103,0.897-2,2-2h50c1.104,0,2,0.897,2,2v47c0,1.103-0.896,2-2,2H7z |
4240 | + "/> |
4241 | +<g> |
4242 | + <path fill="#B35701" d="M25.624,10.926l1.377-3.801h0.966l1.335,3.801H28.48l-0.288-0.801h-1.5l-0.288,0.801H25.624z M27.987,9.488 |
4243 | + l-0.514-1.623h-0.021l-0.555,1.623H27.987z"/> |
4244 | + <path fill="#B35701" d="M30.391,8.584h0.021c0.178-0.233,0.411-0.356,0.699-0.37c0.767,0.041,1.178,0.507,1.233,1.397 |
4245 | + c-0.055,0.876-0.432,1.329-1.13,1.356c-0.383,0-0.65-0.137-0.801-0.411h-0.021v1.335H29.61V8.81c0-0.055,0-0.137,0-0.247 |
4246 | + C29.597,8.44,29.59,8.344,29.59,8.275h0.781L30.391,8.584z M30.966,10.474c0.384,0,0.568-0.288,0.555-0.863 |
4247 | + c0.013-0.589-0.171-0.884-0.555-0.884c-0.356,0.014-0.548,0.308-0.575,0.884C30.418,10.173,30.61,10.461,30.966,10.474z"/> |
4248 | + <path fill="#B35701" d="M33.556,8.275v0.493h0.021c0.15-0.37,0.452-0.541,0.904-0.514v0.699h-0.35 |
4249 | + c-0.191,0.041-0.322,0.103-0.391,0.185c-0.041,0.096-0.075,0.226-0.103,0.39c0,0.042,0,0.069,0,0.083v1.315h-0.78V8.81 |
4250 | + c0-0.027,0-0.089,0-0.185c-0.015-0.151-0.021-0.267-0.021-0.35H33.556z"/> |
4251 | + <path fill="#B35701" d="M35.733,7.125v0.678h-0.842V7.125H35.733z M35.713,8.275v2.651h-0.801V8.275H35.713z"/> |
4252 | + <path fill="#B35701" d="M37.172,7.125v3.801h-0.801V7.125H37.172z"/> |
4253 | +</g> |
4254 | +<g> |
4255 | + <path fill="#FFFFFF" d="M25.624,10.7l1.377-3.801h0.966l1.335,3.801H28.48l-0.288-0.801h-1.5L26.405,10.7H25.624z M27.987,9.261 |
4256 | + l-0.514-1.623h-0.021l-0.555,1.623H27.987z"/> |
4257 | + <path fill="#FFFFFF" d="M30.391,8.357h0.021c0.178-0.233,0.411-0.356,0.699-0.37c0.767,0.041,1.178,0.507,1.233,1.397 |
4258 | + c-0.055,0.876-0.432,1.329-1.13,1.356c-0.383,0-0.65-0.137-0.801-0.411h-0.021v1.335H29.61V8.583c0-0.055,0-0.137,0-0.247 |
4259 | + c-0.014-0.124-0.021-0.219-0.021-0.288h0.781L30.391,8.357z M30.966,10.248c0.384,0,0.568-0.288,0.555-0.863 |
4260 | + c0.013-0.589-0.171-0.884-0.555-0.884c-0.356,0.014-0.548,0.308-0.575,0.884C30.418,9.946,30.61,10.234,30.966,10.248z"/> |
4261 | + <path fill="#FFFFFF" d="M33.556,8.049v0.493h0.021c0.15-0.37,0.452-0.541,0.904-0.514v0.699h-0.35 |
4262 | + c-0.191,0.041-0.322,0.103-0.391,0.185c-0.041,0.096-0.075,0.226-0.103,0.39c0,0.042,0,0.069,0,0.083V10.7h-0.78V8.583 |
4263 | + c0-0.027,0-0.089,0-0.185c-0.015-0.151-0.021-0.267-0.021-0.35H33.556z"/> |
4264 | + <path fill="#FFFFFF" d="M35.733,6.898v0.678h-0.842V6.898H35.733z M35.713,8.049V10.7h-0.801V8.049H35.713z"/> |
4265 | + <path fill="#FFFFFF" d="M37.172,6.898V10.7h-0.801V6.898H37.172z"/> |
4266 | +</g> |
4267 | +<path fill="#B3B3B3" d="M57,51c0,1.657-1.344,3-3,3H10c-1.657,0-3-1.343-3-3V15.657c0-1.657,1.343-3,3-3h44c1.656,0,3,1.343,3,3V51z |
4268 | + "/> |
4269 | +<radialGradient id="SVGID_4_" cx="31.833" cy="53.9121" r="22.9383" gradientUnits="userSpaceOnUse"> |
4270 | + <stop offset="0" style="stop-color:#FFFFFF"/> |
4271 | + <stop offset="1" style="stop-color:#000000"/> |
4272 | +</radialGradient> |
4273 | +<path opacity="0.2" fill="url(#SVGID_4_)" d="M57,51c0,1.657-1.344,3-3,3H10c-1.657,0-3-1.343-3-3V15.657c0-1.657,1.343-3,3-3h44 |
4274 | + c1.656,0,3,1.343,3,3V51z"/> |
4275 | +<path fill="#D6D6D6" d="M57,49c0,1.657-1.344,3-3,3H10c-1.657,0-3-1.343-3-3V15.657c0-1.657,1.343-3,3-3h44c1.656,0,3,1.343,3,3V49z |
4276 | + "/> |
4277 | +<path fill="#F5F5F5" d="M57,48c0,1.657-1.344,3-3,3H10c-1.657,0-3-1.343-3-3V15.657c0-1.657,1.343-3,3-3h44c1.656,0,3,1.343,3,3V48z |
4278 | + "/> |
4279 | +<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="31.9995" y1="12.5039" x2="31.9995" y2="49.9999"> |
4280 | + <stop offset="0" style="stop-color:#E6E6E6"/> |
4281 | + <stop offset="1" style="stop-color:#F2F2F2"/> |
4282 | +</linearGradient> |
4283 | +<path fill="url(#SVGID_5_)" d="M57,47c0,1.657-1.344,3-3,3H10c-1.657,0-3-1.343-3-3V15.657c0-1.657,1.343-3,3-3h44 |
4284 | + c1.656,0,3,1.343,3,3V47z"/> |
4285 | +<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="31.9995" y1="13.5122" x2="31.9995" y2="49"> |
4286 | + <stop offset="0" style="stop-color:#CCCCCC"/> |
4287 | + <stop offset="1" style="stop-color:#F2F2F2"/> |
4288 | +</linearGradient> |
4289 | +<path fill="url(#SVGID_6_)" d="M10,49c-1.103,0-2-0.897-2-2V15.657c0-1.103,0.897-2,2-2h44c1.104,0,2,0.897,2,2V47 |
4290 | + c0,1.103-0.896,2-2,2H10z"/> |
4291 | +<radialGradient id="SVGID_7_" cx="32.125" cy="12.7036" r="22.0638" gradientUnits="userSpaceOnUse"> |
4292 | + <stop offset="0" style="stop-color:#FFFFFF"/> |
4293 | + <stop offset="1" style="stop-color:#FFFFFF;stop-opacity:0"/> |
4294 | +</radialGradient> |
4295 | +<path fill="url(#SVGID_7_)" d="M57,47c0,1.657-1.344,3-3,3H10c-1.657,0-3-1.343-3-3V15.657c0-1.657,1.343-3,3-3h44 |
4296 | + c1.656,0,3,1.343,3,3V47z"/> |
4297 | +<g> |
4298 | + <g> |
4299 | + <path fill="#FFFFFF" d="M24.344,49.229v-9.481c-0.941,0.854-2.05,1.666-3.332,2.435c-0.941-0.939-2.05-1.922-3.332-2.947 |
4300 | + c2.819-1.451,5.125-3.245,6.919-5.382h-6.663v-2.947h8.585c0.256-0.512,0.512-1.067,0.769-1.666h-5.638v-2.947h6.791 |
4301 | + c0.17-0.512,0.298-1.025,0.384-1.538h-9.866v-2.947h10.635c0.17-0.939,0.298-1.793,0.384-2.563 |
4302 | + c0.597,0.086,1.494,0.214,2.691,0.384c0.427,0.086,0.725,0.128,0.897,0.128c0.682,0.172,0.811,0.557,0.385,1.153 |
4303 | + c-0.174,0.172-0.258,0.3-0.258,0.384v0.256l-0.127,0.256h12.941v2.947H33.057c-0.085,0.513-0.213,1.025-0.384,1.538H43.82v2.947 |
4304 | + h-5.51c0.084,0.256,0.256,0.599,0.514,1.025c0.17,0.256,0.297,0.471,0.383,0.641h8.33v2.947h-5.895 |
4305 | + c1.537,1.538,3.543,2.863,6.021,3.973c-0.256,0.172-0.342,0.256-0.256,0.256c-1.453,1.197-2.434,2.137-2.947,2.819 |
4306 | + c-1.197-0.77-2.307-1.538-3.332-2.307v10.123H36.9v-0.513h-8.328v1.024H24.344z M29.598,33.853 |
4307 | + c-0.599,0.855-1.239,1.752-1.922,2.691h11.276c-0.855-0.939-1.623-1.836-2.307-2.691H29.598z M36.9,39.362h-8.328v1.666H36.9 |
4308 | + V39.362z M36.9,43.848h-8.328v1.794H36.9V43.848z M34.723,30.905c-0.256-0.512-0.557-1.067-0.896-1.666h-2.178 |
4309 | + c-0.172,0.513-0.385,1.069-0.641,1.666H34.723z"/> |
4310 | + </g> |
4311 | + <g> |
4312 | + <path fill="#1A1A1A" d="M23.511,48.422V38.94c-0.941,0.854-2.05,1.666-3.332,2.435c-0.941-0.939-2.05-1.922-3.332-2.947 |
4313 | + c2.819-1.451,5.125-3.245,6.919-5.382h-6.663v-2.947h8.585c0.256-0.512,0.512-1.067,0.769-1.666H20.82v-2.947h6.791 |
4314 | + c0.17-0.512,0.298-1.025,0.384-1.538h-9.866v-2.947h10.635c0.17-0.939,0.298-1.793,0.384-2.563 |
4315 | + c0.597,0.086,1.494,0.214,2.691,0.384c0.426,0.086,0.725,0.128,0.897,0.128c0.683,0.172,0.81,0.557,0.384,1.153 |
4316 | + c-0.172,0.172-0.256,0.3-0.256,0.384v0.256l-0.128,0.256h12.941v2.947H32.224c-0.086,0.513-0.214,1.025-0.384,1.538h11.148v2.947 |
4317 | + h-5.51c0.084,0.256,0.256,0.599,0.512,1.025c0.17,0.256,0.299,0.471,0.385,0.641h8.328v2.947h-5.895 |
4318 | + c1.539,1.538,3.545,2.863,6.023,3.973c-0.256,0.172-0.342,0.256-0.256,0.256c-1.455,1.197-2.436,2.137-2.947,2.819 |
4319 | + c-1.197-0.77-2.307-1.538-3.332-2.307V47.91h-4.229v-0.513h-8.329v1.024H23.511z M28.765,33.046 |
4320 | + c-0.599,0.855-1.239,1.752-1.922,2.691h11.277c-0.855-0.939-1.625-1.836-2.307-2.691H28.765z M36.068,38.556h-8.329v1.666h8.329 |
4321 | + V38.556z M36.068,43.041h-8.329v1.794h8.329V43.041z M33.891,30.099c-0.258-0.512-0.557-1.067-0.898-1.666h-2.178 |
4322 | + c-0.172,0.513-0.385,1.069-0.641,1.666H33.891z"/> |
4323 | + </g> |
4324 | +</g> |
4325 | +<g> |
4326 | + <ellipse fill="#FFFFFF" cx="17.032" cy="17.01" rx="4.028" ry="2.49"/> |
4327 | + <linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="17.0322" y1="14.0186" x2="17.0322" y2="19.1263"> |
4328 | + <stop offset="0" style="stop-color:#020202"/> |
4329 | + <stop offset="1" style="stop-color:#636363"/> |
4330 | + </linearGradient> |
4331 | + <ellipse fill="url(#SVGID_8_)" cx="17.032" cy="16.581" rx="4.028" ry="2.49"/> |
4332 | + |
4333 | + <radialGradient id="SVGID_9_" cx="17.0322" cy="9.8262" r="3.3488" gradientTransform="matrix(1 0 0 0.7209 0 2.7423)" gradientUnits="userSpaceOnUse"> |
4334 | + <stop offset="0" style="stop-color:#000000"/> |
4335 | + <stop offset="1" style="stop-color:#000000;stop-opacity:0"/> |
4336 | + </radialGradient> |
4337 | + <ellipse fill="url(#SVGID_9_)" cx="17.032" cy="9.827" rx="4.028" ry="2.49"/> |
4338 | + <g> |
4339 | + |
4340 | + <radialGradient id="SVGID_10_" cx="17.0425" cy="11.5977" r="2.587" gradientTransform="matrix(1 0 0 2.1958 0 -13.869)" gradientUnits="userSpaceOnUse"> |
4341 | + <stop offset="0" style="stop-color:#000000"/> |
4342 | + <stop offset="1" style="stop-color:#000000;stop-opacity:0"/> |
4343 | + </radialGradient> |
4344 | + <polygon fill="url(#SVGID_10_)" points="19.605,11.454 19.251,17.367 14.813,17.367 14.48,11.547 14.813,5.829 19.251,5.829 "/> |
4345 | + <linearGradient id="SVGID_11_" gradientUnits="userSpaceOnUse" x1="17.0322" y1="6.9238" x2="17.0322" y2="17.3821"> |
4346 | + <stop offset="0" style="stop-color:#B8BABC"/> |
4347 | + <stop offset="0.0024" style="stop-color:#B2B4B6"/> |
4348 | + <stop offset="0.0167" style="stop-color:#939497"/> |
4349 | + <stop offset="0.0316" style="stop-color:#7B7B7F"/> |
4350 | + <stop offset="0.0472" style="stop-color:#6A6A6E"/> |
4351 | + <stop offset="0.0638" style="stop-color:#605F63"/> |
4352 | + <stop offset="0.0832" style="stop-color:#5D5C60"/> |
4353 | + <stop offset="0.1083" style="stop-color:#808083"/> |
4354 | + <stop offset="0.1508" style="stop-color:#B6B6B8"/> |
4355 | + <stop offset="0.1875" style="stop-color:#DEDEDF"/> |
4356 | + <stop offset="0.2166" style="stop-color:#F6F6F6"/> |
4357 | + <stop offset="0.2344" style="stop-color:#FFFFFF"/> |
4358 | + <stop offset="0.3824" style="stop-color:#F0F2F2"/> |
4359 | + <stop offset="0.5576" style="stop-color:#9D9EA1"/> |
4360 | + <stop offset="0.5874" style="stop-color:#939497"/> |
4361 | + <stop offset="0.6675" style="stop-color:#7F8083"/> |
4362 | + <stop offset="0.7473" style="stop-color:#737477"/> |
4363 | + <stop offset="0.826" style="stop-color:#6F7073"/> |
4364 | + <stop offset="0.8886" style="stop-color:#959799"/> |
4365 | + <stop offset="0.9575" style="stop-color:#BCBEC0"/> |
4366 | + </linearGradient> |
4367 | + <rect x="15.136" y="6.667" fill="url(#SVGID_11_)" width="3.792" height="10.7"/> |
4368 | + </g> |
4369 | +</g> |
4370 | +<g> |
4371 | + <ellipse fill="#FFFFFF" cx="46.928" cy="17.01" rx="4.028" ry="2.49"/> |
4372 | + <linearGradient id="SVGID_12_" gradientUnits="userSpaceOnUse" x1="46.9277" y1="14.0186" x2="46.9277" y2="19.1263"> |
4373 | + <stop offset="0" style="stop-color:#020202"/> |
4374 | + <stop offset="1" style="stop-color:#636363"/> |
4375 | + </linearGradient> |
4376 | + <ellipse fill="url(#SVGID_12_)" cx="46.928" cy="16.581" rx="4.028" ry="2.49"/> |
4377 | + |
4378 | + <radialGradient id="SVGID_13_" cx="46.9277" cy="9.8262" r="3.3488" gradientTransform="matrix(1 0 0 0.7209 0 2.7423)" gradientUnits="userSpaceOnUse"> |
4379 | + <stop offset="0" style="stop-color:#000000"/> |
4380 | + <stop offset="1" style="stop-color:#000000;stop-opacity:0"/> |
4381 | + </radialGradient> |
4382 | + <ellipse fill="url(#SVGID_13_)" cx="46.928" cy="9.827" rx="4.028" ry="2.49"/> |
4383 | + <g> |
4384 | + |
4385 | + <radialGradient id="SVGID_14_" cx="46.9375" cy="11.5977" r="2.587" gradientTransform="matrix(1 0 0 2.1958 0 -13.869)" gradientUnits="userSpaceOnUse"> |
4386 | + <stop offset="0" style="stop-color:#000000"/> |
4387 | + <stop offset="1" style="stop-color:#000000;stop-opacity:0"/> |
4388 | + </radialGradient> |
4389 | + <polygon fill="url(#SVGID_14_)" points="49.5,11.454 49.146,17.367 44.709,17.367 44.375,11.547 44.709,5.829 49.146,5.829 "/> |
4390 | + <linearGradient id="SVGID_15_" gradientUnits="userSpaceOnUse" x1="46.9277" y1="6.9238" x2="46.9277" y2="17.3821"> |
4391 | + <stop offset="0" style="stop-color:#B8BABC"/> |
4392 | + <stop offset="0.0024" style="stop-color:#B2B4B6"/> |
4393 | + <stop offset="0.0167" style="stop-color:#939497"/> |
4394 | + <stop offset="0.0316" style="stop-color:#7B7B7F"/> |
4395 | + <stop offset="0.0472" style="stop-color:#6A6A6E"/> |
4396 | + <stop offset="0.0638" style="stop-color:#605F63"/> |
4397 | + <stop offset="0.0832" style="stop-color:#5D5C60"/> |
4398 | + <stop offset="0.1083" style="stop-color:#808083"/> |
4399 | + <stop offset="0.1508" style="stop-color:#B6B6B8"/> |
4400 | + <stop offset="0.1875" style="stop-color:#DEDEDF"/> |
4401 | + <stop offset="0.2166" style="stop-color:#F6F6F6"/> |
4402 | + <stop offset="0.2344" style="stop-color:#FFFFFF"/> |
4403 | + <stop offset="0.3824" style="stop-color:#F0F2F2"/> |
4404 | + <stop offset="0.5576" style="stop-color:#9D9EA1"/> |
4405 | + <stop offset="0.5874" style="stop-color:#939497"/> |
4406 | + <stop offset="0.6675" style="stop-color:#7F8083"/> |
4407 | + <stop offset="0.7473" style="stop-color:#737477"/> |
4408 | + <stop offset="0.826" style="stop-color:#6F7073"/> |
4409 | + <stop offset="0.8886" style="stop-color:#959799"/> |
4410 | + <stop offset="0.9575" style="stop-color:#BCBEC0"/> |
4411 | + </linearGradient> |
4412 | + <rect x="45.031" y="6.667" fill="url(#SVGID_15_)" width="3.793" height="10.7"/> |
4413 | + </g> |
4414 | +</g> |
4415 | +</svg> |
4416 | |
4417 | === added file 'img/icon-64.png' |
4418 | Binary files img/icon-64.png 1970-01-01 00:00:00 +0000 and img/icon-64.png 2013-05-06 14:54:28 +0000 differ |
4419 | === added file 'img/icon.png' |
4420 | Binary files img/icon.png 1970-01-01 00:00:00 +0000 and img/icon.png 2013-05-06 14:54:28 +0000 differ |
4421 | === added file 'main.cpp' |
4422 | --- main.cpp 1970-01-01 00:00:00 +0000 |
4423 | +++ main.cpp 2013-05-06 14:54:28 +0000 |
4424 | @@ -0,0 +1,61 @@ |
4425 | +/* |
4426 | + * This file is part of the chinese-calendar project |
4427 | + * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd |
4428 | + * |
4429 | + * This program is free software: you can redistribute it and/or modify |
4430 | + * it under the terms of the GNU General Public License version 3 as |
4431 | + * published by the Free Software Foundation. |
4432 | + * |
4433 | + * This program is distributed in the hope that it will be useful, |
4434 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4435 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4436 | + * GNU General Public License for more details. |
4437 | + * |
4438 | + * You should have received a copy of the GNU General Public License |
4439 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4440 | + * |
4441 | + * This project is developed by "UbuntuKylin Members" team, |
4442 | + * see <https://launchpad.net/~ubuntukylin~members> |
4443 | + * Authors: Abel Liu <guiltyritter@gmail.com> |
4444 | + * Shine Huang <hostc@163.com> |
4445 | + */ |
4446 | + |
4447 | +#include <QtGui> |
4448 | +#include <QCoreApplication> |
4449 | +#include <QTranslator> |
4450 | +#include <QTextCodec> |
4451 | +#include <QDesktopWidget> |
4452 | +#include "chinesecalendar.h" |
4453 | + |
4454 | +int main(int argc, char *argv[]) |
4455 | +{ |
4456 | + QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); |
4457 | + QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); |
4458 | + QApplication app(argc, argv); |
4459 | + QTranslator translator; |
4460 | + |
4461 | + translator.load(":/translate/i18_zh_CN.qm"); |
4462 | + app.installTranslator(&translator); |
4463 | + |
4464 | + // load default skin |
4465 | +#ifdef DEBUG |
4466 | + QFile file(QCoreApplication::applicationDirPath() + "/skin/default-skin.qss"); |
4467 | +#else |
4468 | + QFile file("/usr/share/chinese-calendar/skin/default-skin.qss"); |
4469 | +#endif |
4470 | + file.open(QFile::ReadOnly); |
4471 | + QString stylesheet = QObject::tr(file.readAll()); |
4472 | + app.setStyleSheet(stylesheet); |
4473 | + |
4474 | + ChineseCalendar *window = new ChineseCalendar; |
4475 | + app.setWindowIcon(window->icon64); |
4476 | + window->setWindowFlags(Qt::FramelessWindowHint); |
4477 | + |
4478 | + QDesktopWidget desktop; |
4479 | + int width = desktop.screenGeometry().width(); |
4480 | + int height = desktop.screenGeometry().height(); |
4481 | + |
4482 | + window->setGeometry(QRect(width-525,30,520,350)); |
4483 | + window->hide(); |
4484 | + return app.exec(); |
4485 | +} |
4486 | |
4487 | === renamed file 'main.cpp' => 'main.cpp.moved' |
4488 | === added directory 'skin' |
4489 | === added file 'skin/README.md' |
4490 | --- skin/README.md 1970-01-01 00:00:00 +0000 |
4491 | +++ skin/README.md 2013-05-06 14:54:28 +0000 |
4492 | @@ -0,0 +1,27 @@ |
4493 | +皮肤说明文档 |
4494 | +============ |
4495 | + |
4496 | +目录结构如下: |
4497 | + |
4498 | +skin/ |
4499 | + | |
4500 | + |-black/ |
4501 | + |-black-skin.qss |
4502 | + | |
4503 | + |-blue/ |
4504 | + |-blue.qss |
4505 | + | |
4506 | + |-default/ |
4507 | + |-default-skin.qss |
4508 | + |
4509 | +其中,black-skin.qss default-skin.qss为系统皮肤文件,blue.qss为用户自己定义皮肤文件。 |
4510 | + |
4511 | +### 用户自定义皮肤 |
4512 | + |
4513 | +若用户想制作自己的个性皮肤,可参考blue.qss。运行程序前,将自制皮肤文件复制到 ~/.local/share/chinese-calendar/skins 目录(若无此目录,请使用 mkdir -p ~/.local/share/chinese-calendar/skins 来新建)下即可换肤。 |
4514 | + |
4515 | +### 问题与反馈 |
4516 | + |
4517 | +mutse(墨汁) <yyhoo2.young@gmail.com> |
4518 | + |
4519 | + |
4520 | |
4521 | === added directory 'skin/black' |
4522 | === added file 'skin/black-skin.qss' |
4523 | --- skin/black-skin.qss 1970-01-01 00:00:00 +0000 |
4524 | +++ skin/black-skin.qss 2013-05-06 14:54:28 +0000 |
4525 | @@ -0,0 +1,189 @@ |
4526 | +/* |
4527 | + * This file is part of the chinese-calendar project |
4528 | + * Copyright (C) 2013 Mutse & UbuntuKylin Members |
4529 | + * |
4530 | + * This program is free software: you can redistribute it and/or modify |
4531 | + * it under the terms of the GNU General Public License version 3 as |
4532 | + * published by the Free Software Foundation. |
4533 | + * |
4534 | + * This program is distributed in the hope that it will be useful, |
4535 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4536 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4537 | + * GNU General Public License for more details. |
4538 | + * |
4539 | + * You should have received a copy of the GNU General Public License |
4540 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4541 | + * |
4542 | + * This project is developed by "UbuntuKylin Members" team, |
4543 | + * see <https://launchpad.net/~ubuntukylin~members> |
4544 | + * Author: Mutse <yyhoo2.young@gmail.com> |
4545 | + */ |
4546 | + |
4547 | +ChineseCalendar{ |
4548 | + background: url(/usr/share/chinese-calendar/skin/black/chinesecalendar.png); |
4549 | +} |
4550 | + |
4551 | +ChineseCalendar QPushButton#TbnextMonth{ |
4552 | + background-color:transparent; |
4553 | + image: url(/usr/share/chinese-calendar/skin/black/arrow-right.png); |
4554 | + color:rgb(200,200,150); |
4555 | +} |
4556 | + |
4557 | +ChineseCalendar QPushButton#TbnextMonth:hover{ |
4558 | + color:rgb(255,255,255); |
4559 | +} |
4560 | + |
4561 | +ChineseCalendar QPushButton#TbnextYear{ |
4562 | + background-color:transparent; |
4563 | + image: url(/usr/share/chinese-calendar/skin/black/arrow-right.png); |
4564 | + color:rgb(200,200,150); |
4565 | +} |
4566 | + |
4567 | +ChineseCalendar QPushButton#TbnextYear:hover{ |
4568 | + color:rgb(255,255,255); |
4569 | +} |
4570 | + |
4571 | +ChineseCalendar QPushButton#TbpreviousMonth{ |
4572 | + background-color:transparent; |
4573 | + image: url(/usr/share/chinese-calendar/skin/black/arrow-left.png); |
4574 | + color:rgb(200,200,150); |
4575 | +} |
4576 | + |
4577 | +ChineseCalendar QPushButton#TbpreviousMonth:hover{ |
4578 | + color:rgb(255,255,255); |
4579 | +} |
4580 | + |
4581 | +ChineseCalendar QPushButton#TbpreviousYear{ |
4582 | + background-color:transparent; |
4583 | + image: url(/usr/share/chinese-calendar/skin/black/arrow-left.png); |
4584 | + color:rgb(200,200,150); |
4585 | +} |
4586 | + |
4587 | +ChineseCalendar QPushButton#TbpreviousYear:hover{ |
4588 | + color:rgb(255,255,255); |
4589 | +} |
4590 | + |
4591 | +ChineseCalendar QPushButton#backtotoday{ |
4592 | + background-color:transparent; |
4593 | + color:rgb(200,200,150); |
4594 | +} |
4595 | + |
4596 | +ChineseCalendar QPushButton#backtotoday:hover{ |
4597 | + color:rgb(255,255,255); |
4598 | +} |
4599 | + |
4600 | +ChineseCalendar QComboBox#YearSelect{ |
4601 | + border: 2px solid lightgray; |
4602 | + border-radius: 5px; |
4603 | + font:12pt; |
4604 | +} |
4605 | + |
4606 | +ChineseCalendar QComboBox#monthCombo{ |
4607 | + border: 2px solid lightgray; |
4608 | + border-radius: 5px; |
4609 | + font:12pt; |
4610 | +} |
4611 | + |
4612 | +ChineseCalendar QComboBox::down-arrow { |
4613 | + image: url(/usr/share/chinese-calendar/skin/black/arrow-down.png); |
4614 | + background-color: transparent; |
4615 | +} |
4616 | + |
4617 | +ChineseCalendar QLabel#label{ |
4618 | + font:12pt; |
4619 | +} |
4620 | + |
4621 | +ChineseCalendar QLabel#label_2{ |
4622 | + font:12pt; |
4623 | +} |
4624 | + |
4625 | +ChineseCalendar QLabel#label_3, QLabel#label_9{ |
4626 | + color: rgb(112, 121, 138); |
4627 | +} |
4628 | + |
4629 | +ChineseCalendar QLabel#label_4, |
4630 | + QLabel#label_5, |
4631 | + QLabel#label_6, |
4632 | + QLabel#label_7, |
4633 | + QLabel#label_8{ |
4634 | + color: rgb(248,128,35); |
4635 | +} |
4636 | + |
4637 | +ChineseCalendar QLabel#label_10{ |
4638 | + color: rgb(248,128,35); |
4639 | +} |
4640 | + |
4641 | +ChineseCalendar QLabel#label_11{ |
4642 | + color: rgb(238,124,35); |
4643 | +} |
4644 | + |
4645 | +ChineseCalendar QLabel#label_12, |
4646 | + QLabel#label_13, QLabel#label_14, |
4647 | + QLabel#label_15, QLabel#label_17{ |
4648 | + color: rgb(112, 121, 138); |
4649 | +} |
4650 | + |
4651 | +ChineseCalendar QLabel#label_16{ |
4652 | + color: black; |
4653 | +} |
4654 | + |
4655 | +Cnote{ |
4656 | + background: url(/usr/share/chinese-calendar/skin/black/note.png); |
4657 | +} |
4658 | + |
4659 | +Cnote QPushButton#ok{ |
4660 | + image: url(/usr/share/chinese-calendar/skin/black/ok.png); |
4661 | + background-color:transparent; |
4662 | +} |
4663 | + |
4664 | +Cnote QPushButton#ok:hover{ |
4665 | + image: url(/usr/share/chinese-calendar/skin/black/ok-hover.png); |
4666 | +} |
4667 | + |
4668 | +Cnote QPushButton#cancel{ |
4669 | + image: url(/usr/share/chinese-calendar/skin/black/no.png); |
4670 | + background-color:transparent; |
4671 | + |
4672 | + border:0 solid; |
4673 | +} |
4674 | + |
4675 | +Cnote QPushButton#cancel:hover{ |
4676 | + image: url(/usr/share/chinese-calendar/skin/black/no-hover.png); |
4677 | +} |
4678 | + |
4679 | +Cnote QLabel#datelabel{ |
4680 | + background-color: transparent; |
4681 | + color: rgb(133,143,162); |
4682 | + border:0 solid; |
4683 | +} |
4684 | + |
4685 | +Cnote QPushButton#clearplan{ |
4686 | + background-color: transparent; |
4687 | + color: rgb(133,143,162); |
4688 | +} |
4689 | + |
4690 | +Cnote QTextEdit#textedit{ |
4691 | + background-color: transparent; |
4692 | + color: rgb(133,143,162); |
4693 | + border:0 solid; |
4694 | +} |
4695 | + |
4696 | +DateItem:focus{ |
4697 | + background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(238, 93, 0, 255), stop:1 rgba(255, 121, 2, 200)); |
4698 | +} |
4699 | + |
4700 | +DateItem QWidget:hover{ |
4701 | + background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(238, 93, 0, 155), stop:1 rgba(255, 121, 2, 100)); |
4702 | +} |
4703 | + |
4704 | +DateItem QLabel#label{ |
4705 | + color:rgb(112,121,138); |
4706 | +} |
4707 | + |
4708 | +DateItem QLabel#labe:pressed{ |
4709 | + color:rgb(255, 255, 0); |
4710 | +} |
4711 | + |
4712 | +DateItem QLabel#label_2{ |
4713 | + color:rgb(112, 121, 138); |
4714 | +} |
4715 | |
4716 | === added file 'skin/black/bg.png' |
4717 | Binary files skin/black/bg.png 1970-01-01 00:00:00 +0000 and skin/black/bg.png 2013-05-06 14:54:28 +0000 differ |
4718 | === added file 'skin/black/chinesecalendar.png' |
4719 | Binary files skin/black/chinesecalendar.png 1970-01-01 00:00:00 +0000 and skin/black/chinesecalendar.png 2013-05-06 14:54:28 +0000 differ |
4720 | === added file 'skin/black/no.png' |
4721 | Binary files skin/black/no.png 1970-01-01 00:00:00 +0000 and skin/black/no.png 2013-05-06 14:54:28 +0000 differ |
4722 | === added file 'skin/black/note.png' |
4723 | Binary files skin/black/note.png 1970-01-01 00:00:00 +0000 and skin/black/note.png 2013-05-06 14:54:28 +0000 differ |
4724 | === added file 'skin/black/ok.png' |
4725 | Binary files skin/black/ok.png 1970-01-01 00:00:00 +0000 and skin/black/ok.png 2013-05-06 14:54:28 +0000 differ |
4726 | === added directory 'skin/default' |
4727 | === added file 'skin/default-skin.qss' |
4728 | --- skin/default-skin.qss 1970-01-01 00:00:00 +0000 |
4729 | +++ skin/default-skin.qss 2013-05-06 14:54:28 +0000 |
4730 | @@ -0,0 +1,138 @@ |
4731 | +/* |
4732 | + * This file is part of the chinese-calendar project |
4733 | + * Copyright (C) 2013 Mutse & UbuntuKylin Members |
4734 | + * |
4735 | + * This program is free software: you can redistribute it and/or modify |
4736 | + * it under the terms of the GNU General Public License version 3 as |
4737 | + * published by the Free Software Foundation. |
4738 | + * |
4739 | + * This program is distributed in the hope that it will be useful, |
4740 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
4741 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4742 | + * GNU General Public License for more details. |
4743 | + * |
4744 | + * You should have received a copy of the GNU General Public License |
4745 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
4746 | + * |
4747 | + * This project is developed by "UbuntuKylin Members" team, |
4748 | + * see <https://launchpad.net/~ubuntukylin~members> |
4749 | + * Author: Mutse <yyhoo2.young@gmail.com> |
4750 | + */ |
4751 | + |
4752 | +ChineseCalendar{ |
4753 | + background: url(/usr/share/chinese-calendar/skin/default/chinesecalendarBGyellow.png); |
4754 | +} |
4755 | + |
4756 | +ChineseCalendar QPushButton#TbnextMonth{ |
4757 | + background-color:transparent; |
4758 | + color:rgb(200,200,150); |
4759 | +} |
4760 | + |
4761 | +ChineseCalendar QPushButton#TbnextMonth:hover{ |
4762 | + color:rgb(255,255,255); |
4763 | +} |
4764 | + |
4765 | +ChineseCalendar QPushButton#TbnextYear{ |
4766 | + background-color:transparent; |
4767 | + color:rgb(200,200,150); |
4768 | +} |
4769 | + |
4770 | +ChineseCalendar QPushButton#TbnextYear:hover{ |
4771 | + color:rgb(255,255,255); |
4772 | +} |
4773 | + |
4774 | +ChineseCalendar QPushButton#TbpreviousMonth{ |
4775 | + background-color:transparent; |
4776 | + color:rgb(200,200,150); |
4777 | +} |
4778 | + |
4779 | +ChineseCalendar QPushButton#TbpreviousMonth:hover{ |
4780 | + color:rgb(255,255,255); |
4781 | +} |
4782 | + |
4783 | +ChineseCalendar QPushButton#TbpreviousYear{ |
4784 | + background-color:transparent; |
4785 | + color:rgb(200,200,150); |
4786 | +} |
4787 | + |
4788 | +ChineseCalendar QPushButton#TbpreviousYear:hover{ |
4789 | + color:rgb(255,255,255); |
4790 | +} |
4791 | + |
4792 | +ChineseCalendar QPushButton#backtotoday{ |
4793 | + background-color:transparent; |
4794 | + color:rgb(200,200,150); |
4795 | +} |
4796 | + |
4797 | +ChineseCalendar QPushButton#backtotoday:hover{ |
4798 | + color:rgb(255,255,255); |
4799 | +} |
4800 | + |
4801 | +ChineseCalendar QComboBox#YearSelect{ |
4802 | + border: 2px solid lightgray; |
4803 | + border-radius: 5px; |
4804 | + font:12pt; |
4805 | +} |
4806 | + |
4807 | +ChineseCalendar QComboBox#monthCombo{ |
4808 | + border: 2px solid lightgray; |
4809 | + border-radius: 5px; |
4810 | + font:12pt; |
4811 | +} |
4812 | + |
4813 | +ChineseCalendar QLabel#label{ |
4814 | + font:12pt; |
4815 | +} |
4816 | + |
4817 | +ChineseCalendar QLabel#label_2{ |
4818 | + font:12pt; |
4819 | +} |
4820 | + |
4821 | +Cnote{ |
4822 | + background: url(/usr/share/chinese-calendar/skin/default/note.png); |
4823 | +} |
4824 | + |
4825 | +Cnote QPushButton#ok{ |
4826 | + image: url(/usr/share/chinese-calendar/skin/default/ok.png); |
4827 | + background-color:transparent; |
4828 | +} |
4829 | + |
4830 | +Cnote QPushButton#cancel{ |
4831 | + image: url(/usr/share/chinese-calendar/skin/default/no.png); |
4832 | + background-color:transparent; |
4833 | + border:0 solid; |
4834 | +} |
4835 | + |
4836 | +Cnote QLabel#datelabel{ |
4837 | + background-color:transparent; |
4838 | + border:0 solid; |
4839 | +} |
4840 | + |
4841 | +Cnote QPushButton#clearplan{ |
4842 | + background-color:transparent; |
4843 | +} |
4844 | + |
4845 | +Cnote QTextEdit#textedit{ |
4846 | + background-color:transparent; |
4847 | + border:0 solid; |
4848 | +} |
4849 | + |
4850 | +DateItem:focus{ |
4851 | + background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(238, 93, 0, 255), stop:1 rgba(255, 121, 2, 200)); |
4852 | +} |
4853 | + |
4854 | +DateItem QWidget:hover{ |
4855 | + background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(238, 93, 0, 155), stop:1 rgba(255, 121, 2, 100)); |
4856 | +} |
4857 | + |
4858 | +DateItem QLabel#label{ |
4859 | + color:rgb(0,0,255); |
4860 | +} |
4861 | + |
4862 | +DateItem QLabel#labe:pressed{ |
4863 | + color:rgb(255,0,0); |
4864 | +} |
4865 | + |
4866 | +DateItem QLabel#label_2{ |
4867 | + color:rgb(0,0,0); |
4868 | +} |
4869 | |
4870 | === added file 'skin/default/chinesecalendarBGyellow.png' |
4871 | Binary files skin/default/chinesecalendarBGyellow.png 1970-01-01 00:00:00 +0000 and skin/default/chinesecalendarBGyellow.png 2013-05-06 14:54:28 +0000 differ |
4872 | === added file 'skin/default/no.png' |
4873 | Binary files skin/default/no.png 1970-01-01 00:00:00 +0000 and skin/default/no.png 2013-05-06 14:54:28 +0000 differ |
4874 | === added file 'skin/default/note.png' |
4875 | Binary files skin/default/note.png 1970-01-01 00:00:00 +0000 and skin/default/note.png 2013-05-06 14:54:28 +0000 differ |
4876 | === added file 'skin/default/ok.png' |
4877 | Binary files skin/default/ok.png 1970-01-01 00:00:00 +0000 and skin/default/ok.png 2013-05-06 14:54:28 +0000 differ |
4878 | === added directory 'translate' |
4879 | === renamed directory 'translate' => 'translate.moved' |
4880 | === added file 'translate/i18_zh_CN.qm' |
4881 | Binary files translate/i18_zh_CN.qm 1970-01-01 00:00:00 +0000 and translate/i18_zh_CN.qm 2013-05-06 14:54:28 +0000 differ |
4882 | === added file 'translate/i18_zh_CN.ts' |
4883 | --- translate/i18_zh_CN.ts 1970-01-01 00:00:00 +0000 |
4884 | +++ translate/i18_zh_CN.ts 2013-05-06 14:54:28 +0000 |
4885 | @@ -0,0 +1,141 @@ |
4886 | +<?xml version="1.0" encoding="utf-8"?> |
4887 | +<!DOCTYPE TS> |
4888 | +<TS version="2.0" language="zh_CN"> |
4889 | +<context> |
4890 | + <name>Calendar</name> |
4891 | + <message> |
4892 | + <source>Calendar</source> |
4893 | + <translation type="unfinished">中国农历</translation> |
4894 | + </message> |
4895 | + <message> |
4896 | + <source>Previous Year</source> |
4897 | + <translation type="unfinished">前年</translation> |
4898 | + </message> |
4899 | + <message> |
4900 | + <source>previousYear</source> |
4901 | + <translation type="unfinished">前年</translation> |
4902 | + </message> |
4903 | + <message> |
4904 | + <source>Previous Month</source> |
4905 | + <translation type="unfinished">前一月</translation> |
4906 | + </message> |
4907 | + <message> |
4908 | + <source>previousMonth</source> |
4909 | + <translation type="unfinished">前一月</translation> |
4910 | + </message> |
4911 | + <message> |
4912 | + <source>yyyy</source> |
4913 | + <translation type="unfinished">yyyy</translation> |
4914 | + </message> |
4915 | + <message> |
4916 | + <source>Next Month</source> |
4917 | + <translation type="unfinished">后一月</translation> |
4918 | + </message> |
4919 | + <message> |
4920 | + <source>nextMonth</source> |
4921 | + <translation type="unfinished">后一月</translation> |
4922 | + </message> |
4923 | + <message> |
4924 | + <source>Next Year</source> |
4925 | + <translation type="unfinished">后年</translation> |
4926 | + </message> |
4927 | + <message> |
4928 | + <source>nextYear</source> |
4929 | + <translation type="unfinished">后年</translation> |
4930 | + </message> |
4931 | +</context> |
4932 | +<context> |
4933 | + <name>MyCTCalendar</name> |
4934 | + <message> |
4935 | + <source>ri</source> |
4936 | + <translation type="obsolete">日</translation> |
4937 | + </message> |
4938 | + <message> |
4939 | + <source>unknown</source> |
4940 | + <translation type="unfinished">未知</translation> |
4941 | + </message> |
4942 | + <message> |
4943 | + <source>no data</source> |
4944 | + <translation type="unfinished">无数据</translation> |
4945 | + </message> |
4946 | + <message> |
4947 | + <source>first</source> |
4948 | + <translation type="obsolete">初</translation> |
4949 | + </message> |
4950 | + <message> |
4951 | + <source>ten</source> |
4952 | + <translation type="obsolete">十</translation> |
4953 | + </message> |
4954 | + <message> |
4955 | + <source>twenty</source> |
4956 | + <translation type="obsolete">二十</translation> |
4957 | + </message> |
4958 | + <message> |
4959 | + <source>Ctwenty</source> |
4960 | + <translation type="obsolete">廿</translation> |
4961 | + </message> |
4962 | + <message> |
4963 | + <source>thirty</source> |
4964 | + <translation type="obsolete">三十</translation> |
4965 | + </message> |
4966 | + <message> |
4967 | + <source>sleek December</source> |
4968 | + <translation type="obsolete">润十二月</translation> |
4969 | + </message> |
4970 | + <message> |
4971 | + <source>sleek November</source> |
4972 | + <translation type="obsolete">润十一月</translation> |
4973 | + </message> |
4974 | + <message> |
4975 | + <source>sleek January</source> |
4976 | + <translation type="obsolete">润正月</translation> |
4977 | + </message> |
4978 | + <message> |
4979 | + <source>sleek</source> |
4980 | + <translation type="obsolete">润</translation> |
4981 | + </message> |
4982 | + <message> |
4983 | + <source>month</source> |
4984 | + <translation type="obsolete">月</translation> |
4985 | + </message> |
4986 | + <message> |
4987 | + <source>January</source> |
4988 | + <translation type="obsolete">正月</translation> |
4989 | + </message> |
4990 | +</context> |
4991 | +<context> |
4992 | + <name>Mycalendar</name> |
4993 | + <message> |
4994 | + <source>NongLi year</source> |
4995 | + <translation type="unfinished">农历年:</translation> |
4996 | + </message> |
4997 | + <message> |
4998 | + <source>year(</source> |
4999 | + <translation type="unfinished">年(</translation> |
5000 | + </message> |
The diff has been truncated for viewing.
部分控件颜色有些问题, 比如星期显示那块, 需要修改下颜色。 题,需要修改下。
日期控件hover的颜色有些问