debian/0000755000000000000000000000000012317174121007165 5ustar debian/control0000644000000000000000000000265712315555133010606 0ustar Source: youker-assistant Section: misc Priority: optional Maintainer: Ubuntu Kylin Team Build-Depends: debhelper (>= 9), dh-translations, libphonon-dev, python-dev, python-pywapi, python-tz, python-unidecode, libqt4-dev, fcitx-libs-dev (>= 1:4.2.7), pkg-config, python (>= 2.6.6-3~), qt4-default, qtchooser, Standards-Version: 3.9.5 Homepage: https://launchpad.net/youker-assistant Vcs-Browser: https://code.launchpad.net/~ubuntukylin-members/youker-assistant/trunk Vcs-Bzr: lp:youker-assistant Package: youker-assistant Architecture: any Depends: phonon-backend-gstreamer, python-dbus, python-psutil, python-pywapi, python-tz, python-compizconfig, ${misc:Depends}, ${python:Depends}, ${shlibs:Depends}, Description: Integrated tool to aid in routine system maintenance tasks Youker Assistant is a tool designed to help Ubuntu and Ubuntu Kylin desktop users manage and maintain many aspects of their working environment conveniently in a single application, providing a consistent user experience. . Features currently included: * Detecting and displaying general system information * Unity user interface customization * System garbage cleaning debian/install0000644000000000000000000000060312315555011010554 0ustar backends/youker-assistant-daemon/dbus/com.ubuntukylin.youker.service /usr/share/dbus-1/system-services/ backends/youker-assistant-daemon/dbus/com.ubuntukylin.youker.policy /usr/share/polkit-1/actions/ backends/youker-assistant-daemon/dbus/com.ubuntukylin.youker.conf /etc/dbus-1/system.d/ backends/youker-assistant-daemon/dbus/com.ubuntukylin.session.service /usr/share/dbus-1/services/ debian/rules0000755000000000000000000000044012302520167010242 0ustar #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 override_dh_auto_configure: QT_SELECT=qt4 dh_auto_configure \ -- "QMAKE_CXXFLAGS=$(CFLAGS)" \ youker-assistant.pro %: dh $@ --with python2,translations --fail-missing --parallel debian/compat0000644000000000000000000000000212302520167010362 0ustar 9 debian/changelog0000644000000000000000000001756312317174121011053 0ustar youker-assistant (1.0.1-0ubuntu4) trusty; urgency=low [ Kobe Lee ] * debian/patches/remove_splash_background_and_widget_boundary_shadow.patch: - Remove unexpected gray background of splash. - Fix shadow of main widget. -- Aron Xu Thu, 03 Apr 2014 13:56:00 +0800 youker-assistant (1.0.1-0ubuntu3) trusty; urgency=low * debian/control: - Versioned B-D on fcitx-libs-dev (>= 1:4.2.7) * debian/install, debian/links: - Add new files and links. -- Aron Xu Sat, 29 Mar 2014 22:36:33 +0800 youker-assistant (1.0.1-0ubuntu2) trusty; urgency=low [ Kobe Lee ] * debian/patches/drag_interface_better_and_remove_screenshot_edging.patch: - Fix drag shadow. - Remove screenshot edging. -- Aron Xu Sat, 29 Mar 2014 22:29:10 +0800 youker-assistant (1.0.1-0ubuntu1) trusty; urgency=low * New upstream release (LP: #1294936). * Modify display mode of weather forecast and system settings. * Add file manager and font style settings. * Improve system settings and restoring default settings. * Cache user account (not password). * Change the position of window control buttons. * Add configuration for Kingsoft KuaiPan cloud client. * Add the instruction of Youker Assistant. * Open related folders when scanning items got double-clicked. * Notify users when operating the Kingsoft disk cloud configuration. * Modify Dbus starting method. -- Aron Xu Mon, 24 Mar 2014 15:52:37 +0800 youker-assistant (1.0.0-0ubuntu1) trusty; urgency=low * Access Yahoo weather info. * Add Class LoginDialog and HttpAuth to login with Ubuntu Kylin forum account. * Cleanup browser cache, thumbnail cache and software configfile. * Completed global mouse theme. * Modify the icon on PolicyKit Dialog. * Adjust the display format of network traffic on the monitor ball. * Add ToolTip.qml. * Achieve the function about login with forum account. * Add FileManager.qml, filemanager.py, common.py, geditmanager.py and settings.py. * Reset default config value with Gio Settings and compizconfig. * Remove software recommand. -- Kobe Lee (kylinkobe) Fri, 21 Feb 2014 16:36:44 +0800 youker-assistant (0.3.2-0ubuntu1) trusty; urgency=low * Refersh process list automatically and position the originally selected process(LP: #1261802). * Adjust the structure of QML project. * Add CD-ROM, Audio Card and WLan information. * Kill root process. * Add Device driver basic information. * Use new translation content. * Display the preview picture when click the name on the BootAnimation page. * Rename dbus and add backends/youker-assistant-daemon/install.sh. * Use policykit for all place that requires authentication(LP: #1261799). * Add GnuPG keys of the UbuntuKylin archive: ubuntukylin-archive-keyring.gpg. * Replace some icons. -- Kobe Lee (kylinkobe) Fri, 10 Jan 2014 12:30:30 +0800 youker-assistant (0.3.1-0ubuntu1) trusty; urgency=low * Overide the Font Dialog with KFontDialog Class. * Add detailed information of Network Card, HardDisk and Graphics Card. * Add Separator.qml. * Change Logo and add InfoGroup.js. * Access weather data with python threading. * Change /usr/share/youker-assistant-daemon to /var/lib/youker-assistant-daemon. * Change UbuntuKylin to Ubuntu Kylin. * Modify calculation method of system memory allocation(LP: #1242579). * Refresh net speed every second to resolve the wrong displaying net flow(LP: #1237891). * Modify LargestFile.qml and One Key cleaner. -- Kobe Lee (kylinkobe) Tue, 17 Dec 2013 15:12:07 +0800 youker-assistant (0.2.4-0ubuntu1) saucy; urgency=low * Optimize button events of AuthDialog(LP: #1256183). * Fixed Dialog's movement and hazing when click a button(LP: #1255550). * Change some pictures of computer's detailed information. * All system configuration saved with QSetting. -- Kobe Lee (kylinkobe) Thu, 05 Dec 2013 14:26:53 +0800 youker-assistant (0.2.3-0ubuntu1) saucy; urgency=low * Add processmanager. * Add Google Chromium Cookies cleaner. * Change Chinese to English add add translation. * Adjust components space after it added translation. * Solve the segmentation fault when users cancel the previous Fcitx configuration(LP: #1252595). * Save and restore the default system configuration with QSetting. * Clear Cookies of Chromium(LP: #1224871). * Solve wrong status of history cleaning(LP: #1253852). * Popup a dialog to add Ubuntu Kylin sourcelist or not. * Display detailed information of Computer. * Display contents when one key scanning. * Add debian/postrm file to remove a folder when it is uninstalled. -- Kobe Lee (kylinkobe) Thu, 28 Nov 2013 21:01:35 +0800 youker-assistant (0.2.2-0ubuntu1) saucy; urgency=low * Change skin and add weather forecast information. * Get correct system information(LP: #1240862). * Get software list and software information dynamically. * Start sudodbus server at the same time to scan package cruft(LP: #1242498). * Change the progressbar from Qt to QML. * Use qtsingleapplication by F.J Kong (kroodylove). * Solve the SIGSEGV crash when the program exit(LP: #1235073). * Add Splash screen. -- Kobe Lee (kylinkobe) Fri, 01 Nov 2013 10:24:05 +0800 youker-assistant (0.2.1-0ubuntu1) saucy; urgency=low * Modify the mouse events of MonitorBall. * Add reset button for clear pages. * Add policykit for apt clear in sudodbus. * Fixed the bug about software status and add masklayer. * Rewrite the code of system information. * Add some signals and slots. * Fixed the bug about Software signals(LP: #1226389). * Modify KThread and add base.py. * Fixed the bug about the black widget when operate software(LP: #1231408). -- Kobe Lee (kylinkobe) Thu, 26 Sep 2013 20:08:11 +0800 youker-assistant (0.2.0-0ubuntu1) saucy; urgency=low * Modify the MonitorBall from QML to QT. * Add recommendation about top software. * Add a module and clean trace about file opened. * Add progressbar to display operation status and progress. * Make it can only start a single program. * Modify all status of clean module. -- Kobe Lee (kylinkobe) Fri, 13 Sep 2013 16:57:13 +0800 youker-assistant (0.1.6-0ubuntu1) saucy; urgency=low * Modify Class SystemDispatcher and SessionDispatcher. * Add watch file into debian folder. * Resolve status of onekey button(LP: #1216236 ). * Add monitorball code into systemdbus daemon. * Optimize the status button. -- Kobe Lee (kylinkobe) Mon, 02 Sep 2013 17:17:45 +0800 youker-assistant (0.1.5-0ubuntu1) saucy; urgency=low * 0.1-Release. * Add policykit. * Make bootimage success. -- Kobe Lee (kylinkobe) Thu, 22 Aug 2013 11:25:15 +0800 youker-assistant (0.1.4-0ubuntu1) raring; urgency=low * Remove libstyleplugin.so and add our components. * Merge youker-assistant and youker-assistant-daemon into one project. * Finish the method of get password. * Modify the start method of systemdbus. * Add Timer to prompt information. -- Kobe Lee (kylinkobe) Fri, 09 Aug 2013 16:41:16 +0800 youker-assistant (0.1.3-0ubuntu1) raring; urgency=low * Finish the basic beauty of Clear pages and Set pages. -- Kobe Lee (kylinkobe) Thu, 01 Aug 2013 18:33:08 +0800 youker-assistant (0.1.2-0ubuntu1) raring; urgency=low * Modify some systemset pages. * systemdbus and sessiondbus start when the program run. * Modify Rubbish Clear functions. -- Kobe Lee (kylinkobe) Fri, 26 Jul 2013 18:23:15 +0800 youker-assistant (0.1.1-0ubuntu1) raring; urgency=low * Initial release. -- Kobe Lee (kylinkobe) Tue, 02 Jul 2013 08:57:14 +0800 debian/copyright0000644000000000000000000001271412302520167011124 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: youker-assistant Upstream-Contact: Ubuntu Kylin Team Source: https://launchpad.net/youker-assistant Files: * Copyright: 2013-2014, National University of Defense Technology(NUDT) & Kylin Ltd. License: GPL-3 Files: backends/youker-assistant-daemon/src/policykit/* Copyright: Copyright (C) 2007-2011 Tualatrix Chou Copyright (C) 2013-2014 National University of Defense Technology(NUDT) & Kylin Ltd. License: GPL-3 Files: qml/func/common/Dial.qml qml/func/common/private/Slider.qml qml/func/common/RangeModel.js qml/func/common/RangeModel.qml src/qrangemodel.cpp src/qcomboboxqmladapter.cpp src/qtmenu.cpp src/qdeclarativefolderlistmodel.h src/qtooltiparea.cpp src/qtsplitterbase.h src/qtmenu.h src/qcursorarea.h src/qwindowitem.h src/qrangemodel.h src/qtoplevelwindow.cpp src/qwheelarea.cpp src/qdesktopitem.h src/qcursorarea.cpp src/qtsplitterbase.cpp src/qrangemodel_p.h src/qtooltiparea.h src/qcomboboxqmladapter.h src/qdesktopitem.cpp src/qtoplevelwindow.h src/qwheelarea.h src/qdeclarativefolderlistmodel.cpp Copyright: Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). License: LGPL-2.1 Files: src/qtkeytrans.cpp src/qtkeytrans.h src/qtkeytransdata.h Copyright: Copyright (C) 2012~2012 by CSSlayer License: GPL-2+ Files: backends/youker-assistant-daemon/src/systemdbus/server.py Copyright: Copyright (C) 2008 Fluendo Embedded S.L. Copyright (C) 2010 TualatriX Copyright (C) 2013-2014 National University of Defense Technology(NUDT) & Kylin Ltd. License: GPL-2+ Files: backends/youker-assistant-daemon/src/beautify/common.py backends/youker-assistant-daemon/src/beautify/compizsettings.py Copyright: Copyright (C) 2007-2011 Tualatrix Chou License: GPL-2+ Files: backends/youker-assistant-daemon/src/beautify/ccm/* Copyright: Copyright (C) 2007 Quinn Storm License: GPL-2+ Files: src/qdeclarativelayout.h src/qstyleitem.h src/qdeclarativelinearlayout.cpp src/settings.cpp src/qwindowitem.cpp src/settings.h src/qdeclarativelayoutengine.cpp src/qdeclarativelayoutengine_p.h src/qtmenubar.cpp src/qtmenuitem.h src/qdeclarativelayout.cpp src/qtmenubar.h src/qtmenuitem.cpp src/qstyleitem.cpp src/qdeclarativelinearlayout.h qml/func/common/Page.qml qml/func/common/PageStack.qml qml/func/common/UIConstants.js qml/func/common/PageStack.js Copyright: Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). License: BSD-3-clause License: LGPL-2.1 This file may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation and appearing in the file LICENSE.LGPL included in the packaging of this file. Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. . On Debian systems, the complete text of the LGPL-2.1 license can be found in `/usr/share/common-licenses/LGPL-2.1`. License: GPL-2+ 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. . On Debian and Ubuntu systems, a copy of the GNU General Public License version 2 may be found in the file /usr/share/common-licenses/GPL-2. License: GPL-3 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. . 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. . On Debian/Ubuntu systems, the full text of the GPL v3 can be found in `/usr/share/common-licenses/GPL-3' License: BSD-3-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the organization nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/source/0000755000000000000000000000000012302520167010464 5ustar debian/source/format0000644000000000000000000000001412302520167011672 0ustar 3.0 (quilt) debian/links0000644000000000000000000000035612315555034010240 0ustar /usr/lib/python2.7/dist-packages/youker-assistant-daemon/src/start_systemdbus.py /usr/bin/youker-assistant-backend.py /usr/lib/python2.7/dist-packages/youker-assistant-daemon/src/start_sessiondbus.py /usr/bin/youker-assistant-session.py debian/patches/0000755000000000000000000000000012317173741010623 5ustar debian/patches/series0000644000000000000000000000016312317173747012046 0ustar drag_interface_better_and_remove_screenshot_edging.patch remove_splash_background_and_widget_boundary_shadow.patch debian/patches/remove_splash_background_and_widget_boundary_shadow.patch0000644000000000000000000002337612317173733024363 0ustar diff -Nuar youker-assistant-1.0.1/src/main.cpp youker-assistant/src/main.cpp --- youker-assistant-1.0.1/src/main.cpp 2014-04-01 14:03:56.000000000 +0800 +++ youker-assistant/src/main.cpp 2014-04-01 13:14:24.429766000 +0800 @@ -102,13 +102,20 @@ QSplashScreen *splash = new QSplashScreen; splash->setPixmap(QPixmap(":/pixmap/image/feature.png")); splash->setDisabled(true); + QBitmap objBitmap(313, 209); + QPainter painter(&objBitmap); + painter.fillRect(splash->rect(),Qt::white); + painter.setBrush(QColor(0,0,0)); + painter.drawRoundedRect(splash->rect(), 10,10); + splash->setMask(objBitmap); splash->show(); splash->showMessage(QObject::tr("starting...."), Qt::AlignHCenter|Qt::AlignBottom, Qt::black);//优客助手正在启动中.... + app.processEvents(); //同时创建主视图对象 IhuApplication application; splash->showMessage(QObject::tr("loading module data...."), Qt::AlignHCenter|Qt::AlignBottom, Qt::black);//正在加载模块数据.... //数据处理 - application.setup("main.qml"); + application.setup(/*"main.qml"*/); //显示主界面,并结束启动画面 application.showQMLWidget(); splash->finish(&application); diff -Nuar youker-assistant-1.0.1/src/youker-application.cpp youker-assistant/src/youker-application.cpp --- youker-assistant-1.0.1/src/youker-application.cpp 2014-04-01 14:03:56.000000000 +0800 +++ youker-assistant/src/youker-application.cpp 2014-04-01 14:03:20.733790000 +0800 @@ -26,104 +26,22 @@ //#include "toplevel.h" -IhuApplication::IhuApplication(QWidget *parent) : - QWidget(parent), - viewer(0) -{ - viewer = new QDeclarativeView(this); - tray = new Tray(); - connect(tray,SIGNAL(showOrHideQmlSignal()),this,SLOT(showOrHideMainPage())); - - QHBoxLayout* layout = new QHBoxLayout(); - layout->addWidget(viewer); - layout->setContentsMargins(5, 3, 5, 7); - setLayout(layout); -} - -IhuApplication::~IhuApplication() -{ - if (viewer) { - delete viewer; - } - if (tray) { - delete tray; - } -} - -inline bool isRunningInstalled() { - static bool installed = (QCoreApplication::applicationDirPath() == - QDir(("/usr/bin")).canonicalPath()); - return installed; -} - -inline QString getAppDirectory() { - if (isRunningInstalled()) { - return QString("/usr/share/youker-assistant/qml/"); - } else { - return QString(QCoreApplication::applicationDirPath() + "/../qml/"); - } -} - - -void IhuApplication::showOrHideMainPage() { - if(this->isHidden()) { - int windowWidth = QApplication::desktop()->width(); - int windowHeight = QApplication::desktop()->height(); - this->move((windowWidth - this->width()) / 2,(windowHeight - this->height()) / 2); - this->show(); - } - else { - this->hide(); - } -} - -void IhuApplication::paintEvent(QPaintEvent *) -{ - this->resize(860, 610); -} - -void IhuApplication::showQMLWidget() { - int windowWidth = QApplication::desktop()->width(); - int windowHeight = QApplication::desktop()->height(); - this->move((windowWidth - this->width()) / 2,(windowHeight - this->height()) / 2); - this->show(); -} - -void IhuApplication::showEvent(QShowEvent *) -{ - repaint(); -} - -void IhuApplication::setup(QString qmlFile) -{ - viewer->engine()->setBaseUrl(QUrl::fromLocalFile(getAppDirectory())); - viewer->setSource(QUrl::fromLocalFile(qmlFile)); - - setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); - setAttribute(Qt::WA_TranslucentBackground); - viewer->rootContext()->setContextProperty("mainwindow", this); - this->resize(860, 610); - QObject::connect(viewer->engine(), SIGNAL(quit()), qApp, SLOT(quit())); -} - - - - - - - - - - -//IhuApplication::IhuApplication(QWidget *parent) -// : QWidget(parent), viewer(0) +//IhuApplication::IhuApplication(QWidget *parent) : +// QWidget(parent), +// viewer(0) //{ -// viewer = new QDeclarativeView; +// viewer = new QDeclarativeView(this); // tray = new Tray(); // connect(tray,SIGNAL(showOrHideQmlSignal()),this,SLOT(showOrHideMainPage())); + +// QHBoxLayout* layout = new QHBoxLayout(); +// layout->addWidget(viewer); +// layout->setContentsMargins(5, 3, 5, 7); +// setLayout(layout); //} -//IhuApplication::~IhuApplication() { +//IhuApplication::~IhuApplication() +//{ // if (viewer) { // delete viewer; // } @@ -146,36 +64,141 @@ // } //} + //void IhuApplication::showOrHideMainPage() { -// if(viewer->isHidden()) { -// viewer->show(); +// if(this->isHidden()) { +// int windowWidth = QApplication::desktop()->width(); +// int windowHeight = QApplication::desktop()->height(); +// this->move((windowWidth - this->width()) / 2,(windowHeight - this->height()) / 2); +// this->show(); // } // else { -// viewer->hide(); +// this->hide(); // } //} -//void IhuApplication::setup() { +//void IhuApplication::paintEvent(QPaintEvent *) +//{ +//// this->resize(860, 610); +// this->resize(850, 600); +//} + +//void IhuApplication::showQMLWidget() { +// int windowWidth = QApplication::desktop()->width(); +// int windowHeight = QApplication::desktop()->height(); +// this->move((windowWidth - this->width()) / 2,(windowHeight - this->height()) / 2); +// this->show(); +//} + +//void IhuApplication::showEvent(QShowEvent *) +//{ +// repaint(); +//} +//void IhuApplication::setup(QString qmlFile) +//{ // viewer->engine()->setBaseUrl(QUrl::fromLocalFile(getAppDirectory())); -// viewer->setSource(QUrl::fromLocalFile("main.qml")); -// viewer->rootContext()->setContextProperty("mainwindow", viewer); -// viewer->setStyleSheet("background:transparent"); -// viewer->setAttribute(Qt::WA_TranslucentBackground); -// viewer->setWindowFlags(Qt::FramelessWindowHint); -// viewer->resize(850, 600); +// viewer->setSource(QUrl::fromLocalFile(qmlFile)); + +// setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); +// setAttribute(Qt::WA_TranslucentBackground); +// viewer->rootContext()->setContextProperty("mainwindow", this); +//// this->resize(860, 610); +// this->resize(850, 600); // QObject::connect(viewer->engine(), SIGNAL(quit()), qApp, SLOT(quit())); //} -//void IhuApplication::showQMLWidget() { -// QDesktopWidget* desktop = QApplication::desktop(); -// QSize size = viewer->sizeHint(); -// int width = desktop->width(); -// int height = desktop->height(); -// int mw = size.width(); -// int mh = size.height(); -// int centerW = (width/2) - (mw/2); -// int centerH = (height/2) - (mh/2); -// viewer->move(centerW, centerH); -// viewer->show(); -//} + + + + + + + + + +IhuApplication::IhuApplication(QWidget *parent) + : QWidget(parent), viewer(0) +{ + viewer = new QDeclarativeView; + tray = new Tray(); + connect(tray,SIGNAL(showOrHideQmlSignal()),this,SLOT(showOrHideMainPage())); +} + +IhuApplication::~IhuApplication() { + if (viewer) { + delete viewer; + } + if (tray) { + delete tray; + } +} + +void IhuApplication::showEvent(QShowEvent *) +{ + repaint(); +} + +void IhuApplication::paintEvent(QPaintEvent *) +{ + this->resize(850, 600); +} + +inline bool isRunningInstalled() { + static bool installed = (QCoreApplication::applicationDirPath() == + QDir(("/usr/bin")).canonicalPath()); + return installed; +} + +inline QString getAppDirectory() { + if (isRunningInstalled()) { + return QString("/usr/share/youker-assistant/qml/"); + } else { + return QString(QCoreApplication::applicationDirPath() + "/../qml/"); + } +} + +void IhuApplication::showOrHideMainPage() { + if(viewer->isHidden()) { + QDesktopWidget* desktop = QApplication::desktop(); + QSize size = viewer->sizeHint(); + int width = desktop->width(); + int height = desktop->height(); + int mw = size.width(); + int mh = size.height(); + int centerW = (width/2) - (mw/2); + int centerH = (height/2) - (mh/2); + viewer->move(centerW, centerH); + viewer->show(); + } + else { + viewer->hide(); + } +} + +void IhuApplication::setup() { + + viewer->engine()->setBaseUrl(QUrl::fromLocalFile(getAppDirectory())); + viewer->setSource(QUrl::fromLocalFile("main.qml")); + viewer->rootContext()->setContextProperty("mainwindow", viewer); + viewer->setStyleSheet("background:transparent"); +// viewer->setAttribute(Qt::WA_TranslucentBackground); +// viewer->setWindowFlags(Qt::FramelessWindowHint); + viewer->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); + viewer->setAttribute(Qt::WA_TranslucentBackground); + viewer->resize(850, 600); + QObject::connect(viewer->engine(), SIGNAL(quit()), qApp, SLOT(quit())); +} + +void IhuApplication::showQMLWidget() { + QDesktopWidget* desktop = QApplication::desktop(); + QSize size = viewer->sizeHint(); + int width = desktop->width(); + int height = desktop->height(); + int mw = size.width(); + int mh = size.height(); + int centerW = (width/2) - (mw/2); + int centerH = (height/2) - (mh/2); + viewer->move(centerW, centerH); + viewer->show(); +} diff -Nuar youker-assistant-1.0.1/src/youker-application.h youker-assistant/src/youker-application.h --- youker-assistant-1.0.1/src/youker-application.h 2014-04-01 14:03:56.000000000 +0800 +++ youker-assistant/src/youker-application.h 2014-04-01 13:57:53.025788000 +0800 @@ -30,7 +30,7 @@ public: explicit IhuApplication(QWidget *parent = 0); virtual ~IhuApplication(); - void setup(QString qmlFile); + void setup(/*QString qmlFile*/); void showQMLWidget(); protected: debian/patches/drag_interface_better_and_remove_screenshot_edging.patch0000644000000000000000000004034512315554224024122 0ustar --- a/qml/StatusWidget.qml +++ b/qml/StatusWidget.qml @@ -81,18 +81,18 @@ text: qsTr("main version:") + root.version//主版本: } } - MouseArea { - id: mouseRegion - anchors.fill: parent - property variant clickPos: "1,1" - onPressed: { - clickPos = Qt.point(mouse.x,mouse.y) - } - onPositionChanged: { - var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y) - mainwindow.pos = Qt.point(mainwindow.pos.x+delta.x, mainwindow.pos.y+delta.y) - } - } +// MouseArea { +// id: mouseRegion +// anchors.fill: parent +// property variant clickPos: "1,1" +// onPressed: { +// clickPos = Qt.point(mouse.x,mouse.y) +// } +// onPositionChanged: { +// var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y) +// mainwindow.pos = Qt.point(mainwindow.pos.x+delta.x, mainwindow.pos.y+delta.y) +// } +// } // Image { // id: downloadImage // anchors { --- a/qml/TitleWidget.qml +++ b/qml/TitleWidget.qml @@ -60,21 +60,21 @@ } } - MouseArea { - id: mouseRegion - anchors.fill: parent; - property variant clickPos: "1,1" +// MouseArea { +// id: mouseRegion +// anchors.fill: parent; +// property variant clickPos: "1,1" - onPressed: { - clickPos = Qt.point(mouse.x,mouse.y) - } +// onPressed: { +// clickPos = Qt.point(mouse.x,mouse.y) +// } - onPositionChanged: { - var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y) - mainwindow.pos = Qt.point(mainwindow.pos.x+delta.x, - mainwindow.pos.y+delta.y) - } - } +// onPositionChanged: { +// var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y) +// mainwindow.pos = Qt.point(mainwindow.pos.x+delta.x, +// mainwindow.pos.y+delta.y) +// } +// } SysBtn { iconName: "sys_button_close.png" --- a/qml/main.qml +++ b/qml/main.qml @@ -70,6 +70,23 @@ anchors.fill: parent source: "" } + + MouseArea { + anchors.fill: parent + property variant previousPosition + onPressed: { + previousPosition = Qt.point(mouseX, mouseY) + } + onPositionChanged: { + if (pressedButtons == Qt.LeftButton) { + var dx = mouseX - previousPosition.x + var dy = mouseY - previousPosition.y + mainwindow.pos = Qt.point(mainwindow.pos.x + dx, + mainwindow.pos.y + dy) + } + } + } + radius: 4 opacity: 1.0 Column { @@ -96,24 +113,24 @@ rightMargin: 35 } source: (sessiondispatcher.get_locale_version() == "zh_CN") ? "./img/zh_CN/logo.png" : "./img/en/logo.png" - MouseArea { - anchors.fill: logo -// property variant clickPos: "1,1" - property variant previousPosition - onPressed: { -// clickPos = Qt.point(mouse.x,mouse.y) - previousPosition = Qt.point(mouseX, mouseY) - } - onPositionChanged: { -// var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y) -// mainwindow.pos = Qt.point(mainwindow.pos.x+delta.x, mainwindow.pos.y+delta.y) - if (pressedButtons == Qt.LeftButton) { - var dx = mouseX - previousPosition.x - var dy = mouseY - previousPosition.y - mainwindow.pos = Qt.point(mainwindow.pos.x + dx, - mainwindow.pos.y + dy) - } - } - } +// MouseArea { +// anchors.fill: logo +//// property variant clickPos: "1,1" +// property variant previousPosition +// onPressed: { +//// clickPos = Qt.point(mouse.x,mouse.y) +// previousPosition = Qt.point(mouseX, mouseY) +// } +// onPositionChanged: { +//// var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y) +//// mainwindow.pos = Qt.point(mainwindow.pos.x+delta.x, mainwindow.pos.y+delta.y) +// if (pressedButtons == Qt.LeftButton) { +// var dx = mouseX - previousPosition.x +// var dy = mouseY - previousPosition.y +// mainwindow.pos = Qt.point(mainwindow.pos.x + dx, +// mainwindow.pos.y + dy) +// } +// } +// } } } --- a/src/fcitxcfgwizard.cpp +++ b/src/fcitxcfgwizard.cpp @@ -674,14 +674,13 @@ //=================================================================================// QStringList FcitxCfgWizard::get_all_skin_type() { - int i; size_t len; QStringList ret_value; QDir skin_dir; QFileInfoList list; QFileInfoList::Iterator list_iter; char **skin_path = FcitxXDGGetPathWithPrefix(&len, "skin"); - for (i = 0; i < len; i++) { + for (size_t i = 0; i < len; i++) { skin_dir = QDir(skin_path[i]); if (!skin_dir.exists()) continue; --- a/src/httpauth.cpp +++ b/src/httpauth.cpp @@ -103,7 +103,7 @@ } } else if(data == "status=logout"){//正常注销 -// qDebug() << "logout success......"; + qDebug() << "logout success......"; } } else { --- a/src/main.cpp +++ b/src/main.cpp @@ -108,7 +108,7 @@ IhuApplication application; splash->showMessage(QObject::tr("loading module data...."), Qt::AlignHCenter|Qt::AlignBottom, Qt::black);//正在加载模块数据.... //数据处理 - application.setup(); + application.setup("main.qml"); //显示主界面,并结束启动画面 application.showQMLWidget(); splash->finish(&application); --- a/src/sessiondispatcher.cpp +++ b/src/sessiondispatcher.cpp @@ -61,6 +61,7 @@ //超时计时器 timer=new QTimer(this); + loginOK = false; // skin_widget = new SkinsWidget(mSettings); // skinCenter = new SkinCenter(); @@ -102,14 +103,29 @@ } SessionDispatcher::~SessionDispatcher() { + if(loginOK) { + //退出 + mSettings->beginGroup("user"); + int id = mSettings->value("id").toInt(); + mSettings->endGroup(); + mSettings->sync(); + QString requestData = QString("http://www.ubuntukylin.com/boxbeta/find_get.php?pp[type]=logout&pp[table]=yk_member&pp[id]=%1").arg(id); + QUrl url(requestData); + httpauth->sendGetRequest(url); + } + waitTime = 0; + disconnect(timer,SIGNAL(timeout()),this,SLOT(connectHttpServer())); + if(timer->isActive()) { + timer->stop(); + } + mSettings->sync(); if (mSettings != NULL) { delete mSettings; } -// if(timer->isActive()) { -// timer->stop(); -// } + this->exit_qt(); +// this->ready_exit_normally(); } //dbus服务退出 @@ -200,10 +216,10 @@ httpauth->sendGetRequest(url); } -void SessionDispatcher::handler_write_user_info_when_exit() {//更新数据库数据和本地配置文件 - this->ready_exit_normally(); - emit this->ready_to_exit();//通知菜单可以退出程序了 -} +//void SessionDispatcher::handler_write_user_info_when_exit() {//更新数据库数据和本地配置文件 +// this->ready_exit_normally(); +// emit this->ready_to_exit();//通知菜单可以退出程序了 +//} //点击登录框的确定按钮后,开始发送数据给服务端进行登录验证 void SessionDispatcher::verify_user_and_password(QString user, QString pwd) { @@ -235,6 +251,7 @@ //用户登录成功后处理数据:显示界面、id写入本地配置、开启定时器 void SessionDispatcher::handle_data_after_login_success(QString id,/* QString level, */QString name, QString score) { + loginOK = true; //登录成功后将用户信息显示在界面上 bool ok; QString level = score_count_level(score.toInt(&ok, 10)); @@ -281,6 +298,7 @@ } } else { + loginOK = false; emit loginFailedStatus(status); } } --- a/src/sessiondispatcher.h +++ b/src/sessiondispatcher.h @@ -381,7 +381,7 @@ void tellUploadCloudConfToQML(QString upload); //程序退出之前用户信息写入服务器端完毕后,告诉tray退出程序 - void ready_to_exit(); +// void ready_to_exit(); //告诉QML确认云配置操作 // void tellQMLCloudConfirm(); @@ -427,7 +427,7 @@ //接收cookies扫描完后的信号 void handler_cookies_scan_over(QString cookiesFlag); //程序退出之前接受传递过来的用户信息,准备写入服务器端 - void handler_write_user_info_when_exit(); +// void handler_write_user_info_when_exit(); //连接服务器 void connectHttpServer(); @@ -469,6 +469,7 @@ int waitTime;//超时重试次数 QTimer *timer; + bool loginOK; }; #endif // SESSIONDISPATCHER_H --- a/src/tray.cpp +++ b/src/tray.cpp @@ -53,8 +53,8 @@ connect(frame, SIGNAL(accelerate_memory()), this, SLOT(startMemoryAccelerate())); //-------------------------- - connect(this, SIGNAL(ready_to_write_user_info_when_exit()), sedispather, SLOT(handler_write_user_info_when_exit())); - connect(sedispather, SIGNAL(ready_to_exit()), this, SLOT(handler_to_exit())); +// connect(this, SIGNAL(ready_to_write_user_info_when_exit()), sedispather, SLOT(handler_write_user_info_when_exit())); +// connect(sedispather, SIGNAL(ready_to_exit()), this, SLOT(handler_to_exit())); QTimer *timer = new QTimer(this); timer->setInterval(1000); @@ -74,9 +74,9 @@ } } -void Tray::handler_to_exit() { - qApp->quit(); -} +//void Tray::handler_to_exit() { +// qApp->quit(); +//} void Tray::updateData() { QStringList current_speed = sedispather->get_network_flow_total_qt(); @@ -175,8 +175,8 @@ } void Tray::exit() { - emit ready_to_write_user_info_when_exit(); -// qApp->quit(); +// emit ready_to_write_user_info_when_exit(); + qApp->quit(); } void Tray::showOrHide() { --- a/src/tray.h +++ b/src/tray.h @@ -85,13 +85,13 @@ //快捷键退出 void exit(); //数据写入数据库完毕后,准备退出程序 - void handler_to_exit(); +// void handler_to_exit(); signals: //显示/隐藏QML主界面的信号 void showOrHideQmlSignal(); //将小监控球实时更新的数据同步到大监控球 void sysc_data(QString upspeed, QString downspeed, QString ratio, int used_memory, QString free_memory, QString cpu_ratio); - void ready_to_write_user_info_when_exit(); +// void ready_to_write_user_info_when_exit(); }; --- a/src/youker-application.cpp +++ b/src/youker-application.cpp @@ -25,15 +25,23 @@ #include //#include "toplevel.h" -IhuApplication::IhuApplication(QWidget *parent) - : QWidget(parent), viewer(0)/*, m_shadow("image/window_shadow.png")*/ + +IhuApplication::IhuApplication(QWidget *parent) : + QWidget(parent), + viewer(0) { - viewer = new QDeclarativeView; + viewer = new QDeclarativeView(this); tray = new Tray(); connect(tray,SIGNAL(showOrHideQmlSignal()),this,SLOT(showOrHideMainPage())); + + QHBoxLayout* layout = new QHBoxLayout(); + layout->addWidget(viewer); + layout->setContentsMargins(5, 3, 5, 7); + setLayout(layout); } -IhuApplication::~IhuApplication() { +IhuApplication::~IhuApplication() +{ if (viewer) { delete viewer; } @@ -56,36 +64,118 @@ } } + void IhuApplication::showOrHideMainPage() { - if(viewer->isHidden()) { - viewer->show(); + if(this->isHidden()) { + int windowWidth = QApplication::desktop()->width(); + int windowHeight = QApplication::desktop()->height(); + this->move((windowWidth - this->width()) / 2,(windowHeight - this->height()) / 2); + this->show(); } else { - viewer->hide(); + this->hide(); } } -void IhuApplication::setup() { +void IhuApplication::paintEvent(QPaintEvent *) +{ + this->resize(860, 610); +} +void IhuApplication::showQMLWidget() { + int windowWidth = QApplication::desktop()->width(); + int windowHeight = QApplication::desktop()->height(); + this->move((windowWidth - this->width()) / 2,(windowHeight - this->height()) / 2); + this->show(); +} + +void IhuApplication::showEvent(QShowEvent *) +{ + repaint(); +} + +void IhuApplication::setup(QString qmlFile) +{ viewer->engine()->setBaseUrl(QUrl::fromLocalFile(getAppDirectory())); - viewer->setSource(QUrl::fromLocalFile("main.qml")); - viewer->rootContext()->setContextProperty("mainwindow", viewer); - viewer->setStyleSheet("background:transparent"); - viewer->setAttribute(Qt::WA_TranslucentBackground); - viewer->setWindowFlags(Qt::FramelessWindowHint); - viewer->resize(850, 600); + viewer->setSource(QUrl::fromLocalFile(qmlFile)); + + setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); + setAttribute(Qt::WA_TranslucentBackground); + viewer->rootContext()->setContextProperty("mainwindow", this); + this->resize(860, 610); QObject::connect(viewer->engine(), SIGNAL(quit()), qApp, SLOT(quit())); } -void IhuApplication::showQMLWidget() { - QDesktopWidget* desktop = QApplication::desktop(); - QSize size = viewer->sizeHint(); - int width = desktop->width(); - int height = desktop->height(); - int mw = size.width(); - int mh = size.height(); - int centerW = (width/2) - (mw/2); - int centerH = (height/2) - (mh/2); - viewer->move(centerW, centerH); - viewer->show(); -} + + + + + + + + + +//IhuApplication::IhuApplication(QWidget *parent) +// : QWidget(parent), viewer(0) +//{ +// viewer = new QDeclarativeView; +// tray = new Tray(); +// connect(tray,SIGNAL(showOrHideQmlSignal()),this,SLOT(showOrHideMainPage())); +//} + +//IhuApplication::~IhuApplication() { +// if (viewer) { +// delete viewer; +// } +// if (tray) { +// delete tray; +// } +//} + +//inline bool isRunningInstalled() { +// static bool installed = (QCoreApplication::applicationDirPath() == +// QDir(("/usr/bin")).canonicalPath()); +// return installed; +//} + +//inline QString getAppDirectory() { +// if (isRunningInstalled()) { +// return QString("/usr/share/youker-assistant/qml/"); +// } else { +// return QString(QCoreApplication::applicationDirPath() + "/../qml/"); +// } +//} + +//void IhuApplication::showOrHideMainPage() { +// if(viewer->isHidden()) { +// viewer->show(); +// } +// else { +// viewer->hide(); +// } +//} + +//void IhuApplication::setup() { + +// viewer->engine()->setBaseUrl(QUrl::fromLocalFile(getAppDirectory())); +// viewer->setSource(QUrl::fromLocalFile("main.qml")); +// viewer->rootContext()->setContextProperty("mainwindow", viewer); +// viewer->setStyleSheet("background:transparent"); +// viewer->setAttribute(Qt::WA_TranslucentBackground); +// viewer->setWindowFlags(Qt::FramelessWindowHint); +// viewer->resize(850, 600); +// QObject::connect(viewer->engine(), SIGNAL(quit()), qApp, SLOT(quit())); +//} + +//void IhuApplication::showQMLWidget() { +// QDesktopWidget* desktop = QApplication::desktop(); +// QSize size = viewer->sizeHint(); +// int width = desktop->width(); +// int height = desktop->height(); +// int mw = size.width(); +// int mh = size.height(); +// int centerW = (width/2) - (mw/2); +// int centerH = (height/2) - (mh/2); +// viewer->move(centerW, centerH); +// viewer->show(); +//} --- a/src/youker-application.h +++ b/src/youker-application.h @@ -30,14 +30,20 @@ public: explicit IhuApplication(QWidget *parent = 0); virtual ~IhuApplication(); - void setup(); + void setup(QString qmlFile); void showQMLWidget(); +protected: + void showEvent(QShowEvent *e); + private: //关联QML界面 QDeclarativeView *viewer; //系统托盘 Tray *tray; + //重写绘图函数 + void paintEvent(QPaintEvent *); + public slots: //主界面显示和隐藏 void showOrHideMainPage(); debian/youker-assistant.manpages0000644000000000000000000000007612302520167014231 0ustar man/youker-assistant.1 man/youkersession.1 man/youkersystem.1 debian/watch0000644000000000000000000000020412302520167010211 0ustar version=3 https://launchpad.net/youker-assistant/+download https://launchpad.net/youker-assistant/.*/youker-assistant-(.*)\.tar\.g debian/postrm0000644000000000000000000000014212302520167010430 0ustar #!/bin/sh if [ "$1" = "purge" ] ; then rm -rf /var/lib/youker-assistant-daemon/ fi #DEBHELPER#