themes_qml.target = /
DEPLOYMENTFOLDERS = themes_qml
+QT += dbus
# Additional import path used to resolve QML modules in Creator's code model
#QML_IMPORT_PATH =
#############################################################################
# Makefile for building: LichViet
-# Generated by qmake (2.01a) (Qt 4.7.3) on: Wed Aug 24 08:25:07 2011
+# Generated by qmake (2.01a) (Qt 4.7.3) on: Thu Aug 25 00:22:47 2011
# Project: LichViet.pro
# Template: app
# Command: /opt/QtSDK/Desktop/Qt/473/gcc/bin/qmake -spec /opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/linux-g++-64 -o Makefile LichViet.pro
CC = gcc
CXX = g++
-DEFINES = -DAPP_VERSION=\"1.0.2\" -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_CORE_LIB
+DEFINES = -DAPP_VERSION=\"1.0.2\" -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
-INCPATH = -I/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/linux-g++-64 -I. -I/opt/QtSDK/Desktop/Qt/473/gcc/include/QtCore -I/opt/QtSDK/Desktop/Qt/473/gcc/include/QtGui -I/opt/QtSDK/Desktop/Qt/473/gcc/include/QtDeclarative -I/opt/QtSDK/Desktop/Qt/473/gcc/include -Iqmlapplicationviewer -I.
+INCPATH = -I/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/linux-g++-64 -I. -I/opt/QtSDK/Desktop/Qt/473/gcc/include/QtCore -I/opt/QtSDK/Desktop/Qt/473/gcc/include/QtGui -I/opt/QtSDK/Desktop/Qt/473/gcc/include/QtDBus -I/opt/QtSDK/Desktop/Qt/473/gcc/include/QtDeclarative -I/opt/QtSDK/Desktop/Qt/473/gcc/include -Iqmlapplicationviewer -I.
LINK = g++
LFLAGS = -m64 -Wl,-O1 -Wl,-rpath,/opt/QtSDK/Desktop/Qt/473/gcc/lib
-LIBS = $(SUBLIBS) -L/opt/QtSDK/Desktop/Qt/473/gcc/lib -lQtDeclarative -lQtGui -lQtCore -lpthread
+LIBS = $(SUBLIBS) -L/opt/QtSDK/Desktop/Qt/473/gcc/lib -lQtDeclarative -lQtDBus -lQtGui -lQtCore -lpthread
AR = ar cqs
RANLIB =
QMAKE = /opt/QtSDK/Desktop/Qt/473/gcc/bin/qmake
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/default_post.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/warn_on.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/qt.prf \
- /opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/unix/thread.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/moc.prf \
+ /opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/dbusinterfaces.prf \
+ /opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/dbusadaptors.prf \
+ /opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/unix/thread.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/resources.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/uic.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/yacc.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/default_post.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/warn_on.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/qt.prf \
- /opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/unix/thread.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/moc.prf \
+ /opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/dbusinterfaces.prf \
+ /opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/dbusadaptors.prf \
+ /opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/unix/thread.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/resources.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/uic.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/yacc.prf \
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/default_post.prf:
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/warn_on.prf:
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/qt.prf:
-/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/unix/thread.prf:
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/moc.prf:
+/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/dbusinterfaces.prf:
+/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/dbusadaptors.prf:
+/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/unix/thread.prf:
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/resources.prf:
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/uic.prf:
/opt/QtSDK/Desktop/Qt/473/gcc/mkspecs/features/yacc.prf:
moc_lunarcalendar.cpp: lunarcalendar.h
/opt/QtSDK/Desktop/Qt/473/gcc/bin/moc $(DEFINES) $(INCPATH) lunarcalendar.h -o moc_lunarcalendar.cpp
+compiler_dbus_interface_source_make_all:
+compiler_dbus_interface_source_clean:
+compiler_dbus_adaptor_source_make_all:
+compiler_dbus_adaptor_source_clean:
compiler_rcc_make_all: qrc_lichviet.cpp
compiler_rcc_clean:
-$(DEL_FILE) qrc_lichviet.cpp
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
+compiler_dbus_interface_header_make_all:
+compiler_dbus_interface_header_clean:
+compiler_dbus_interface_moc_make_all:
+compiler_dbus_interface_moc_clean:
+compiler_dbus_adaptor_header_make_all:
+compiler_dbus_adaptor_header_clean:
+compiler_dbus_adaptor_moc_make_all:
+compiler_dbus_adaptor_moc_clean:
compiler_uic_make_all:
compiler_uic_clean:
compiler_yacc_decl_make_all:
viewer.rootContext()->setContextProperty("LC", &lc);
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
- //viewer.setMainQmlFile(QLatin1String("qml/LichViet/main.qml"));
viewer.setSource(QUrl("qrc:/qml/LichViet/main.qml"));
viewer.setWindowTitle(QString::fromUtf8("Lịch Việt"));
}
}
+ Image {
+ id: minimizeButton
+ x:4
+ anchors.verticalCenter: parent.verticalCenter
+ source: theme_manager.theme.titlebar.minimize_button
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed:{
+ parent.source= theme_manager.theme.titlebar.minimize_button_pressed
+ }
+ onReleased:{
+ parent.source=theme_manager.theme.titlebar.minimize_button
+ }
+
+ onClicked: ROOT.minimize();
+ }
+ }
+
Text {
id: categoryText
- x:10
+ x:60
anchors {
verticalCenter: parent.verticalCenter
}
elide: Text.ElideLeft
- text: "Lịch Âm"
+ text: "Lịch Việt"
font.bold: true; color: "White"; style: Text.Raised; styleColor: "Black"
font.pixelSize: 24
font.family: "Tahoma"
Component {
id: listDelegate
- Item {
- height: lheight+5
- Rectangle {
- width:rectangle1.width-20;
- y:10;
- x:10
- height:lheight
- color: "#ffffff"
- radius: 8
- border.color: "#b57e8f"
+
Column {
- Text { x:5;y:50;text:name;color:"blue"; font.pixelSize: 20
- font.family: "Tahoma" }
- Text { x:5;y:50;text:getHD(idm) ; font.pixelSize: 20
- font.family: "Tahoma"}
- } anchors.bottomMargin: -10
- }
- }
- }
+ Rectangle {
+ width:rectangle1.width;
+ y:30;
+ x:0
+ height:1
+ border.color: "#b57e8f"
+ }
+ width:rectangle1.width
+ Rectangle{
+ width:rectangle1.width;
+ height:10;
+ }
+
+ Text { x:5;y:50;text:getHD(name,idm) ;textFormat: Text.RichText;wrapMode: Text.WordWrap; font.pixelSize: 20
+ font.family: "Tahoma";width:parent.width;}
+
+ Rectangle{
+ width:rectangle1.width;
+ height:10;
+ }
+ }
+
+
+ }
ListModel {
id: listModel
}
}
- function getHD(idm){
+ function getHD(name,idm){
+ if (name.length){
+ name="<span style='color:blue;'>"+name+"</span><br>";
+ }
+
NTX.test();
switch(idm){
- case 0 : return AmLich.getTHU(screen.jd)+",ngày <b>"+screen.curDay+"</b> tháng <b>"+screen.curMonth+"</b> năm <b>"+screen.curYear+"</b><br>Ngày <b>"+screen.lunarDay+"</b> tháng <b>"+screen.lunarMonth+"</b> năm <b>"+screen.lunarYear+"</b> (<b>"+screen.lunarYearInt+"</b>)";break;
- case 1 : return screen.lunarGioHoangDao;break;
- case 2 : return screen.lunarTietKhi();break;
- case 3 : return NTX.sao(screen.curYear,AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).jd - AmLich.getLunarDate(1,1,screen.curYear).jd);break;
- case 5 : return NTX.luangiai(screen.curDay);break;
- case -1: return NTX.truc(screen.lunarMonth, screen.lunarDayCanChi, screen.lunarMonthCanChi);break;//"Là ngày: <b>Thiên Lao Hắc Đạo</b> Trực: <b>Định</b>"
- case 6: return NTX.cacsaotot(screen.lunarMonth, screen.lunarDayCanChi);break;
- case 7: return NTX.cacsaoxau(screen.lunarMonth, screen.lunarDayCanChi);break;
+ case 0 : return name+AmLich.getTHU(screen.jd)+",ngày <b>"+screen.curDay+"</b> tháng <b>"+screen.curMonth+"</b> năm <b>"+screen.curYear+"</b><br>Ngày <b>"+screen.lunarDay+"</b> tháng <b>"+screen.lunarMonth+"</b> năm <b>"+screen.lunarYear+"</b> (<b>"+screen.lunarYearInt+"</b>)";break;
+ case 1 : return name+screen.lunarGioHoangDao;break;
+ case 2 : return name+screen.lunarTietKhi();break;
+ case 3 : return name+NTX.sao(screen.curYear,AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).jd - AmLich.getLunarDate(1,1,screen.curYear).jd);break;
+ case 5 : return name+NTX.luangiai(screen.curDay);break;
+ case -1: return name+NTX.truc(screen.lunarMonth, screen.lunarDayCanChi, screen.lunarMonthCanChi);break;//"Là ngày: <b>Thiên Lao Hắc Đạo</b> Trực: <b>Định</b>"
+ case 6: return name+NTX.cacsaotot(screen.lunarMonth, screen.lunarDayCanChi);break;
+ case 7: return name+NTX.cacsaoxau(screen.lunarMonth, screen.lunarDayCanChi);break;
}
}
property int fixed: 40
property int rise: 0
- anchors.fill: parent
+ anchors.fill: parent;anchors.topMargin: 60;anchors.bottomMargin:60;
onPressAndHold:{
if (Settings.pressandhold()==1){
screen.state="datetimedialog"
}
}
-
- /* onPressed: {
- xfrom=mouseX;
- yfrom=mouseY;
- }
-
- onReleased : {
- rise = mouseX - xfrom
- if (rise > fixed || rise < -fixed){
- if (mouseX < xfrom){
- calculateLunar(LC.nextDay(), LC.curMonth(), LC.curYear())
- }else{
- calculateLunar(LC.prevDay(), LC.curMonth(), LC.curYear())
- }
- }
-
- }*/
}
Text {
font.pixelSize: 28
}
- /*
- Text {
- id: txtDAY
- x: 151
- y: 126
- width: 80
- height: 20
- color: "#f0f0f5"
- text: screen.curDay
- horizontalAlignment: Text.AlignHCenter
- anchors.horizontalCenter: parent.horizontalCenter
- opacity: 0.6
- font.bold: true
- font.pixelSize: 80
- }
-*/
-
//------------------------------------------------
Rectangle {
screen.lunarDayCanChi = AmLich.getCanChi(AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear))[0]
screen.lunarMonthCanChi = AmLich.getCanChi(AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear))[1]
- //console.log(screen.curDay+" "+screen.curMonth+" "+screen.curYear)
- //console.log( AmLich.getCanChi(AmLich.getLunarDate(30,1,2007)))
}
function reset(){
property string button_pressed: root_dir+"quit_pressed.png"
property string button_active: root_dir+"quit.png"
property string sci: root_dir+"titlebar.sci"
+
+ property string minimize_button: root_dir+"minimize.png"
+ property string minimize_button_pressed: root_dir+"minimize_pressed.png"
}
Item{
#include <QtDeclarative/QDeclarativeEngine>
#include <QtDeclarative/QDeclarativeContext>
+#include <QtDBus/QDBusConnection>
+#include <QtDBus/QDBusMessage>
+#include <QtDBus/QDBusInterface>
+
#if defined(QMLJSDEBUGGER)
#include <qt_private/qdeclarativedebughelper_p.h>
#endif
else
this->setOrientation(this->ScreenOrientationLockLandscape);
}
+
+void QmlApplicationViewer::minimize(){
+ QDBusConnection c = QDBusConnection::sessionBus();
+ QDBusMessage m = QDBusMessage::createSignal("/", "com.nokia.hildon_desktop", "exit_app_view");
+ c.send(m);
+}
void showExpanded();
Q_INVOKABLE void initScreenOrientation(int);
+ Q_INVOKABLE void minimize();
private:
class QmlApplicationViewerPrivate *m_d;