From: Cuong Le Date: Fri, 9 Sep 2011 08:15:59 +0000 (+0700) Subject: * debian/* cleanup and update X-Git-Url: https://vcs.maemo.org/git/?p=lichviet-widget;a=commitdiff_plain;h=36869a2326fdc2359a176a21800487e5906b5ea1 * debian/* cleanup and update * code update * version 0.1.0 alpha --- diff --git a/main.cpp b/main.cpp index a7cb52c..6a8418d 100644 --- a/main.cpp +++ b/main.cpp @@ -1,3 +1,20 @@ +/* +Copyright (C) 2011 by Cuong Le + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see +*/ + #include #include "qmlapplicationviewer.h" diff --git a/qml/lichvietwidget/main.js b/qml/lichvietwidget/main.js index 1102377..f380b6f 100644 --- a/qml/lichvietwidget/main.js +++ b/qml/lichvietwidget/main.js @@ -1,6 +1,24 @@ +/* +Copyright (C) 2011 by Cuong Le + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see +*/ var IMGS_RESOURCE_PATH = "/opt/lichvietwidget/qml/lichvietwidget/imgs/"; +var isday=-1; +var ismonth=-1; +var isyear=-1; function refresh(day_center_img, day_left_img, day_right_img, month_left_img, month_right_img, year_1_img, year_2_img,year_3_img,year_4_img, txt_detail) { var date = new Date(); @@ -13,40 +31,48 @@ function refresh(day_center_img, day_left_img, day_right_img, month_left_img, mo txt_detail.text = "Ngày "+lunarCanChi[0]+", Tháng "+lunarCanChi[1]+"
Năm "+lunarCanChi[2]+""; - if (xday <= 9){ - day_center_img.visible = true; - day_center_img.source = IMGS_RESOURCE_PATH + xday + ".png"; - day_left_img.visible = false; - day_right_img.visible = false; - }else{ - var strxday = xday+''; - var firstday = strxday[0]; - var secondday = strxday[1]; - day_center_img.visible = false; - day_left_img.visible = true; - day_left_img.source = IMGS_RESOURCE_PATH + firstday + ".png"; - day_right_img.visible = true; - day_right_img.source = IMGS_RESOURCE_PATH + secondday + ".png"; + if (xday != isday){ + if (xday <= 9){ + day_center_img.visible = true; + day_center_img.source = IMGS_RESOURCE_PATH + xday + ".png"; + day_left_img.visible = false; + day_right_img.visible = false; + }else{ + var strxday = xday+''; + var firstday = strxday[0]; + var secondday = strxday[1]; + day_center_img.visible = false; + day_left_img.visible = true; + day_left_img.source = IMGS_RESOURCE_PATH + firstday + ".png"; + day_right_img.visible = true; + day_right_img.source = IMGS_RESOURCE_PATH + secondday + ".png"; + } + isday = xday; } - if (xmonth <=9){ - month_left_img.source = IMGS_RESOURCE_PATH +"0.png"; - month_right_img.source = IMGS_RESOURCE_PATH + xmonth + ".png"; - }else - { - var strxmonth = xmonth+''; - var firstmonth = strxmonth[0]; - var secondmonth = strxmonth[1]; - month_left_img.source = IMGS_RESOURCE_PATH + firstmonth +".png"; - month_right_img.source = IMGS_RESOURCE_PATH + secondmonth + ".png"; + if (xmonth != ismonth){ + if (xmonth <=9){ + month_left_img.source = IMGS_RESOURCE_PATH +"0.png"; + month_right_img.source = IMGS_RESOURCE_PATH + xmonth + ".png"; + }else + { + var strxmonth = xmonth+''; + var firstmonth = strxmonth[0]; + var secondmonth = strxmonth[1]; + month_left_img.source = IMGS_RESOURCE_PATH + firstmonth +".png"; + month_right_img.source = IMGS_RESOURCE_PATH + secondmonth + ".png"; + } + ismonth=xmonth; } - var strxyear = xyear+''; - year_1_img.source = IMGS_RESOURCE_PATH + strxyear[0] +".png"; - year_2_img.source = IMGS_RESOURCE_PATH + strxyear[1] + ".png"; - year_3_img.source = IMGS_RESOURCE_PATH + strxyear[2] +".png"; - year_4_img.source = IMGS_RESOURCE_PATH + strxyear[3] + ".png"; - + if (xyear != isyear){ + var strxyear = xyear+''; + year_1_img.source = IMGS_RESOURCE_PATH + strxyear[0] +".png"; + year_2_img.source = IMGS_RESOURCE_PATH + strxyear[1] + ".png"; + year_3_img.source = IMGS_RESOURCE_PATH + strxyear[2] +".png"; + year_4_img.source = IMGS_RESOURCE_PATH + strxyear[3] + ".png"; + isyear=xyear; + } } /** diff --git a/qml/lichvietwidget/main.qml b/qml/lichvietwidget/main.qml index c43908a..6d7fd41 100644 --- a/qml/lichvietwidget/main.qml +++ b/qml/lichvietwidget/main.qml @@ -1,3 +1,20 @@ +/* +Copyright (C) 2011 by Cuong Le + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see +*/ + import QtQuick 1.0 import "main.js" as Main diff --git a/qtc_packaging/debian_fremantle/compat b/qtc_packaging/debian_fremantle/compat index 7f8f011..7ed6ff8 100644 --- a/qtc_packaging/debian_fremantle/compat +++ b/qtc_packaging/debian_fremantle/compat @@ -1 +1 @@ -7 +5 diff --git a/qtc_packaging/debian_fremantle/control b/qtc_packaging/debian_fremantle/control index 9f2f00e..39276c4 100644 --- a/qtc_packaging/debian_fremantle/control +++ b/qtc_packaging/debian_fremantle/control @@ -1,8 +1,8 @@ Source: lichvietwidget -Section: user/utilities +Section: user/desktop Priority: optional Maintainer: Cuong Le -Build-Depends: debhelper (>= 5), libqt4-dev +Build-Depends: debhelper (>= 5), libqt4-dev, libx11-dev Standards-Version: 3.7.3 Homepage: http://lichviet-widget.garage.maemo.org @@ -10,6 +10,7 @@ Package: lichvietwidget Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, qt4-homescreen-loader Description: A Widget of Lich Viet for Maemo 5 Hildon desktop + A Widget of Lich Viet for Maemo 5 Hildon desktop XB-Maemo-Display-Name: Lich Viet Widget XSBC-Bugtracker: https://garage.maemo.org/tracker/?group_id=2242 XB-Maemo-Icon-26: diff --git a/qtc_packaging/debian_fremantle/rules b/qtc_packaging/debian_fremantle/rules index 7a31fae..997bf97 100755 --- a/qtc_packaging/debian_fremantle/rules +++ b/qtc_packaging/debian_fremantle/rules @@ -9,47 +9,42 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +APPNAME := lichvietwidget +builddir: + mkdir -p builddir - - - -configure: configure-stamp -configure-stamp: - dh_testdir - # qmake PREFIX=/usr# Uncomment this line for use without Qt Creator - - touch configure-stamp - +builddir/Makefile: builddir + cd builddir && qmake-qt4 PREFIX=/usr ../$(APPNAME).pro build: build-stamp -build-stamp: configure-stamp - dh_testdir +build-stamp: builddir/Makefile + dh_testdir - # Add here commands to compile the package. - # $(MAKE) # Uncomment this line for use without Qt Creator - #docbook-to-man debian/lichvietwidget.sgml > lichvietwidget.1 + # Add here commands to compile the package. + cd builddir && $(MAKE) + #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1 - touch $@ + touch $@ -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp +clean: + dh_testdir + dh_testroot + rm -f build-stamp - # Add here commands to clean up after the build process. - $(MAKE) clean + # Add here commands to clean up after the build process. + rm -rf builddir - dh_clean + dh_clean install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs - # Add here commands to install the package into debian/lichvietwidget. - $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/lichvietwidget install + # Add here commands to install the package into debian/arora. + cd builddir && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/$(APPNAME) install # Build architecture-independent files here. @@ -58,34 +53,20 @@ binary-indep: build install # Build architecture-dependent files here. binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_installexamples -# dh_install -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_python -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl -# dh_makeshlibs - dh_installdeb - # dh_shlibdeps # Uncomment this line for use without Qt Creator - dh_gencontrol - dh_md5sums - dh_builddeb + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure diff --git a/settingsdlg.cpp b/settingsdlg.cpp index 7df76b8..d274140 100644 --- a/settingsdlg.cpp +++ b/settingsdlg.cpp @@ -1,3 +1,20 @@ +/* +Copyright (C) 2011 by Cuong Le + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see +*/ + #include "settingsdlg.h" diff --git a/settingsdlg.h b/settingsdlg.h index 491d31b..b30767e 100644 --- a/settingsdlg.h +++ b/settingsdlg.h @@ -1,3 +1,20 @@ +/* +Copyright (C) 2011 by Cuong Le + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see +*/ + #ifndef SETTINGSDLG_H #define SETTINGSDLG_H