From: Cuong Le Date: Sun, 18 Sep 2011 16:15:28 +0000 (+0700) Subject: * Know bugs fixed X-Git-Url: http://git.maemo.org/git/?p=lichviet-widget;a=commitdiff_plain;h=a7a436f8c8030a2fb75f2be3107608d51a158b92 * Know bugs fixed --- diff --git a/lichvietwidget.pro b/lichvietwidget.pro index f8a8a9b..25a2738 100644 --- a/lichvietwidget.pro +++ b/lichvietwidget.pro @@ -38,7 +38,9 @@ OTHER_FILES += \ qtc_packaging/debian_fremantle/copyright \ qtc_packaging/debian_fremantle/control \ qtc_packaging/debian_fremantle/compat \ - qtc_packaging/debian_fremantle/changelog + qtc_packaging/debian_fremantle/changelog \ + qml/lichvietwidget/settings.qml \ + qml/lichvietwidget/Button.qml TEMPLATE = app diff --git a/lichvietwidget.pro.user b/lichvietwidget.pro.user index 0b980ba..c3b1cbf 100644 --- a/lichvietwidget.pro.user +++ b/lichvietwidget.pro.user @@ -2,7 +2,7 @@ ProjectExplorer.Project.ActiveTarget - 1 + 0 ProjectExplorer.Project.EditorSettings @@ -78,12 +78,12 @@ 2 false - 4.7.3 Desktop Release + Desktop 4.7.3 Release Qt4ProjectManager.Qt4BuildConfiguration 0 /home/cuonglb/Garage/lichvietwidget-build-desktop - 6 + 7 ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit. true @@ -192,66 +192,16 @@ 2 false - 4.7.0 Release + Maemo 5 4.7.0 Release Qt4ProjectManager.Qt4BuildConfiguration 0 /home/cuonglb/Garage/lichvietwidget-build-maemo - 4 - Qt4ProjectManager.ToolChain.Maemo:/opt/QtSDK_Maemo/Maemo/4.6.2/targets/fremantle-pr13/bin/gcc.arm-linux-generic-elf-32bit. - true - - - Qt4ProjectManager.ToolChain.Maemo:/opt/QtSDK_Maemo/Maemo/4.6.2/targets/fremantle-pr13/bin/gcc.arm-linux-generic-elf-32bit. - - - qmake - - QtProjectManager.QMakeBuildStep - false - - false - - - Make - - Qt4ProjectManager.MakeStep - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - Make - - Qt4ProjectManager.MakeStep - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - 4.7.0 Release - 4.7.0 Release2 - Qt4ProjectManager.Qt4BuildConfiguration - 0 - /home/cuonglb/Garage/lichvietwidget-build-maemo - 4 + 6 Qt4ProjectManager.ToolChain.Maemo:/opt/QtSDK_Maemo/Maemo/4.6.2/targets/fremantle-pr13/bin/gcc.arm-linux-generic-elf-32bit. true - 2 + 1 @@ -264,7 +214,7 @@ Deploy to Maemo5 device Qt4ProjectManager.MaemoDeployStep - false + true 0 @@ -329,7 +279,7 @@ ProjectExplorer.Project.Updater.EnvironmentId - {11b71d82-22ac-4198-bd51-c62ab18f4700} + {d543d526-18d9-438e-925f-0abd8634c84c} ProjectExplorer.Project.Updater.FileVersion diff --git a/main.cpp b/main.cpp index c9219f9..8356266 100644 --- a/main.cpp +++ b/main.cpp @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) viewer.setMainQmlFile(QLatin1String("/opt/lichvietwidget/qml/lichvietwidget/main.qml")); QMaemo5HomescreenAdaptor *adaptor = new QMaemo5HomescreenAdaptor(&viewer); - adaptor->setSettingsAvailable(false); + adaptor->setSettingsAvailable(true); SettingsDlg settingsdlg; diff --git a/qml/lichvietwidget/Button.qml b/qml/lichvietwidget/Button.qml new file mode 100644 index 0000000..1c1c2ed --- /dev/null +++ b/qml/lichvietwidget/Button.qml @@ -0,0 +1,71 @@ +/* +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 2 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 + +Item { + id:menubutton + property string text + property string tip + property bool selected + + signal clicked + + Rectangle{ + id:menurectangle + color: selected ? "#000000":"#a7bfe8" + anchors.fill:parent + radius: 8 + border.color: "#ca8282" + + Text { + id: text1 + x: 20 + y: 8 + text:menubutton.text + font.bold: true + horizontalAlignment: Text.AlignHCenter + font.pixelSize: 22 + color:"#404040" + } + + Text { + id: text2 + x: 20 + y: 33 + text:menubutton.tip + font.bold: true + horizontalAlignment: Text.AlignHCenter + font.pixelSize: 18 + color:"black" + } + } + + MouseArea { + id: mouseRegion + anchors.fill: menurectangle + onClicked: { menubutton.clicked(); } + } + + states: [ + State { + name: "Pressed" + when: mouseRegion.pressed == true + PropertyChanges { target: menurectangle; color:"white" } + } + ] +} diff --git a/qml/lichvietwidget/main.qml b/qml/lichvietwidget/main.qml index 437ccea..5653999 100644 --- a/qml/lichvietwidget/main.qml +++ b/qml/lichvietwidget/main.qml @@ -64,7 +64,7 @@ Item { width: 60 height: 75 source: "imgs/1.png" - visible:true + visible:false } Image { @@ -73,7 +73,7 @@ Item { y: -2 width: 60 height: 75 - visible: true + visible: false source: "imgs/0.png" } @@ -84,7 +84,7 @@ Item { width: 60 height: 75 source: "imgs/4.png" - visible: true + visible: false } Image { @@ -141,7 +141,6 @@ Item { id: txt_detail x: 174 y: 68 - color: "#0c0a4d" text: "" anchors.horizontalCenterOffset: 0 font.family: "Nokia Sans" diff --git a/qml/lichvietwidget/settings.qml b/qml/lichvietwidget/settings.qml new file mode 100644 index 0000000..db6d39b --- /dev/null +++ b/qml/lichvietwidget/settings.qml @@ -0,0 +1,54 @@ +import QtQuick 1.0 + +Rectangle { + id: rectangle1 + width: 550 + height: 300 + color:"transparent" + + + Component { + id: listDelegate + Rectangle { + height:65 + Button { + y: 3; width: rectangle1.width; height: 60 + onClicked: { + } + text: name + tip: title + } + } + } + + ListModel { + id: listModel + + ListElement { + idm:1;name: "Màu nền";title:"Transparent, opacity=0.3" + } + ListElement { + idm:1;name: "Kích thước, mẫu định dạng widget";title:"Mặc định" + } + ListElement { + idm:1;name: "Tự động chuyển ngày mới";title:"Bật" + } + ListElement { + idm:1;name: "Thời gian kiểm tra qua ngày mới";title:"1000 ms" + } + ListElement { + idm:1;name: "Khởi động Lich Viet khi nhấn lên widget";title:"Bật" + } + + Component.onCompleted: { + } + } + + ListView { + id: listView + anchors.fill: parent;anchors.leftMargin: 0; + model: listModel + delegate: listDelegate + focus: true + } +} diff --git a/qmlapplicationviewer/qmlapplicationviewer.cpp b/qmlapplicationviewer/qmlapplicationviewer.cpp index b3e862c..8e0aa88 100644 --- a/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -1,4 +1,4 @@ -// checksum 0x7895 version 0x4000b +// checksum 0xfe24 version 0x6000e /* This file was generated by the Qt Quick Application wizard of Qt Creator. QmlApplicationViewer is a convenience class containing mobile device specific @@ -17,19 +17,17 @@ #include #include -#if defined(QMLJSDEBUGGER) +#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800 + #include -#endif -#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#if !defined(NO_JSDEBUGGER) #include #endif -#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#if !defined(NO_QMLOBSERVER) #include #endif -#if defined(QMLJSDEBUGGER) - // Enable debugging before any QDeclarativeEngine is created struct QmlJsDebuggingEnabler { @@ -77,12 +75,15 @@ QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : { connect(engine(), SIGNAL(quit()), SLOT(close())); setResizeMode(QDeclarativeView::SizeRootObjectToView); -#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in +#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800 +#if !defined(NO_JSDEBUGGER) new QmlJSDebugger::JSDebuggerAgent(engine()); #endif -#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#if !defined(NO_QMLOBSERVER) new QmlJSDebugger::QDeclarativeViewObserver(this, this); #endif +#endif } QmlApplicationViewer::~QmlApplicationViewer() @@ -146,7 +147,7 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) void QmlApplicationViewer::showExpanded() { -#ifdef Q_OS_SYMBIAN +#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR) showFullScreen(); #elif defined(Q_WS_MAEMO_5) showMaximized(); diff --git a/qmlapplicationviewer/qmlapplicationviewer.h b/qmlapplicationviewer/qmlapplicationviewer.h index 19875a3..83b9575 100644 --- a/qmlapplicationviewer/qmlapplicationviewer.h +++ b/qmlapplicationviewer/qmlapplicationviewer.h @@ -1,4 +1,4 @@ -// checksum 0x382f version 0x4000b +// checksum 0x382f version 0x6000e /* This file was generated by the Qt Quick Application wizard of Qt Creator. QmlApplicationViewer is a convenience class containing mobile device specific diff --git a/qmlapplicationviewer/qmlapplicationviewer.pri b/qmlapplicationviewer/qmlapplicationviewer.pri index b07f873..86d980f 100644 --- a/qmlapplicationviewer/qmlapplicationviewer.pri +++ b/qmlapplicationviewer/qmlapplicationviewer.pri @@ -1,4 +1,4 @@ -# checksum 0xcaf1 version 0x4000b +# checksum 0x82af version 0x6000e # This file was generated by the Qt Quick Application wizard of Qt Creator. # The code below adds the QmlApplicationViewer to the project and handles the # activation of QML debugging. @@ -70,9 +70,16 @@ symbian { } } else:unix { maemo5 { + desktopfile.files = $${TARGET}.desktop desktopfile.path = /usr/share/applications/hildon - } else { + icon.files = $${TARGET}64.png + icon.path = /usr/share/icons/hicolor/64x64/apps + } else:!isEmpty(MEEGO_VERSION_MAJOR) { + desktopfile.files = $${TARGET}_harmattan.desktop desktopfile.path = /usr/share/applications + icon.files = $${TARGET}80.png + icon.path = /usr/share/icons/hicolor/80x80/apps + } else { # Assumed to be a Desktop Unix copyCommand = for(deploymentfolder, DEPLOYMENTFOLDERS) { source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) @@ -111,16 +118,18 @@ symbian { export($$itempath) INSTALLS += $$item } - icon.files = $${TARGET}.png - icon.path = /usr/share/icons/hicolor/64x64/apps - desktopfile.files = $${TARGET}.desktop + + !isEmpty(desktopfile.path) { + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + INSTALLS += icon desktopfile + } + target.path = $${installPrefix}/bin - export(icon.files) - export(icon.path) - export(desktopfile.files) - export(desktopfile.path) export(target.path) - INSTALLS += desktopfile icon target + INSTALLS += target } export (ICON) diff --git a/qtc_packaging/debian_fremantle/changelog b/qtc_packaging/debian_fremantle/changelog index ecb1594..a9255dd 100644 --- a/qtc_packaging/debian_fremantle/changelog +++ b/qtc_packaging/debian_fremantle/changelog @@ -1,5 +1,5 @@ -lichvietwidget (0.1.0-2) unstable; urgency=low +lichvietwidget (0.1.0-3) unstable; urgency=low - * Latest UI changes/Add some features. + * Know bugs fixed. - -- Cuong Le Thu, 10 Sep 2011 11:16:24 +0700 + -- Cuong Le Thu, 10 Sep 2011 11:33:24 +0700 diff --git a/settingsdlg.cpp b/settingsdlg.cpp index 20a0189..ec37296 100644 --- a/settingsdlg.cpp +++ b/settingsdlg.cpp @@ -28,41 +28,27 @@ SettingsDlg::SettingsDlg(QWidget *parent) : connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - tabWidget = new QTabWidget; - tabWidget ->addTab(new ThemeTab(), QString::fromUtf8("Mẫu widget")); - tabWidget ->addTab(new GeneralTab(), QString::fromUtf8("Giới thiệu")); + vboxlayout = new QVBoxLayout; + vboxlayout1 = new QVBoxLayout; mainLayout = new QGridLayout(this); - mainLayout->addWidget(tabWidget,0,0,1,1); - mainLayout->addWidget(buttonBox,0,1,1,1); + vboxlayout1->addWidget(buttonBox); + view = new QDeclarativeView(this); + view->setSource(QUrl("/opt/lichvietwidget/qml/lichvietwidget/settings.qml")); + + vboxlayout->addWidget(view); + + mainLayout->addLayout(vboxlayout,0 ,0,1,1); + mainLayout->addLayout(vboxlayout1,0,1,1,1); \ this->setLayout(mainLayout); } void SettingsDlg::showSettingsDialog(){ + this->setMinimumHeight(325); this->show(); } -GeneralTab::GeneralTab(QWidget *parent) - : QWidget(parent) -{ - mainLayout = new QVBoxLayout; - setLayout(mainLayout); -} - -ThemeTab::ThemeTab(QWidget *parent) - : QWidget(parent) -{ - themes = new QListWidget(this); - themes->addItem(new QListWidgetItem( QString::fromUtf8("Mặc định"))); - themes->addItem(new QListWidgetItem( QString::fromUtf8("Vừa phải"))); - themes->addItem(new QListWidgetItem( QString::fromUtf8("Lớn"))); - - mainLayout = new QVBoxLayout; - mainLayout->addWidget(themes); - setLayout(mainLayout); -} - diff --git a/settingsdlg.h b/settingsdlg.h index b30767e..8691a4b 100644 --- a/settingsdlg.h +++ b/settingsdlg.h @@ -24,8 +24,8 @@ along with this program. If not, see #include #include #include -#include -#include +#include +#include class SettingsDlg : public QDialog { @@ -34,9 +34,12 @@ public: explicit SettingsDlg(QWidget *parent = 0); private: - QTabWidget *tabWidget; QDialogButtonBox *buttonBox; QGridLayout *mainLayout; + QVBoxLayout *vboxlayout; + QVBoxLayout *vboxlayout1; + + QDeclarativeView *view; signals: @@ -45,29 +48,4 @@ public slots: }; -class GeneralTab : public QWidget -{ - Q_OBJECT - -private: - QVBoxLayout *mainLayout; - -public: - GeneralTab(QWidget *parent = 0); -}; - -class ThemeTab : public QWidget -{ - Q_OBJECT - -private: - QVBoxLayout *mainLayout; - QListWidget *themes; - - -public: - ThemeTab(QWidget *parent = 0); -}; - - #endif // SETTINGSDLG_H