From b414dbdb28d839c9755b1832f27f61d1ec9e7863 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Fri, 23 Sep 2011 23:15:49 +0200 Subject: Cleaning up bits --- libsowatch/libsowatch.pro.user | 549 ------------------------------- metawatch/metawatch.cpp | 46 +-- metawatch/metawatch.h | 3 + metawatch/metawatchplugin.cpp | 4 - sowatch.pro | 2 +- sowatch.pro.user | 729 ----------------------------------------- sowatchd/daemon.cpp | 2 +- 7 files changed, 30 insertions(+), 1305 deletions(-) delete mode 100644 libsowatch/libsowatch.pro.user delete mode 100644 sowatch.pro.user diff --git a/libsowatch/libsowatch.pro.user b/libsowatch/libsowatch.pro.user deleted file mode 100644 index d20c31f..0000000 --- a/libsowatch/libsowatch.pro.user +++ /dev/null @@ -1,549 +0,0 @@ - - - - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - - Cpp - - false - CppGlobal - true - false - true - false - false - false - true - true - false - true - false - false - false - true - false - - - 1 - System - Global - 4 - true - 1 - true - false - true - - Cpp - - true - false - CppGlobal - 4 - 1 - false - true - 0 - 8 - - - - QmlJS - - true - false - QmlJSGlobal - 4 - 1 - false - true - 0 - 8 - - - 2 - 0 - 8 - true - 2 - true - true - true - false - - - - ProjectExplorer.Project.Target.0 - - Desktop - Desktop - Qt4ProjectManager.Target.DesktopTarget - 0 - 1 - 0 - - ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.gdb - - - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - - - Make - - Qt4ProjectManager.MakeStep - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - Make - - Qt4ProjectManager.MakeStep - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Desktop Qt 4.7.4 for GCC (Qt SDK) Release - - Qt4ProjectManager.Qt4BuildConfiguration - 0 - /home/javier/maemo/qt/libsowatch-build-desktop-release - 13 - true - - - ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.gdb - - - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - - - Make - - Qt4ProjectManager.MakeStep - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - Make - - Qt4ProjectManager.MakeStep - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Desktop Qt 4.7.4 for GCC (Qt SDK) Debug - - Qt4ProjectManager.Qt4BuildConfiguration - 2 - /home/javier/maemo/qt/libsowatch-build-desktop-debug - 13 - true - - 2 - - - 0 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - No deployment - - ProjectExplorer.DefaultDeployConfiguration - - - - - Create tarball - - MaemoTarPackageCreationStep - - - Deploy tarball via SFTP upload - - MaemoUploadAndInstallTarPackageStep - - - - - - 2 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - Build Tarball and Install to Linux Host - - DeployToGenericLinux - 0 - - 2 - - true - true - - - false - false - false - false - false - false - false - false - true - true - 0.01 - 0.01 - 10 - 10 - true - true - 25 - 25 - - - true - true - valgrind - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - - 2 - - false - - %{buildDir} - Custom Executable - - ProjectExplorer.CustomExecutableRunConfiguration - 3768 - true - false - false - - 1 - - - - ProjectExplorer.Project.Target.1 - - Harmattan - Harmattan - Qt4ProjectManager.Target.HarmattanDeviceTarget - 0 - 0 - 0 - - Qt4ProjectManager.ToolChain.Maemo:/home/javier/opt/QtSDK/Madde/targets/harmattan-nokia-meego-api/bin/gcc.arm-linux-generic-elf-32bit./home/javier/opt/QtSDK/pythongdb/gdb - - - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - - - Make - - Qt4ProjectManager.MakeStep - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - Make - - Qt4ProjectManager.MakeStep - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - MeeGo 1.2 Harmattan API (Qt SDK) Release - - Qt4ProjectManager.Qt4BuildConfiguration - 0 - /home/javier/maemo/qt/libsowatch-build-harmattan-release - 10 - true - - - Qt4ProjectManager.ToolChain.Maemo:/home/javier/opt/QtSDK/Madde/targets/harmattan-nokia-meego-api/bin/gcc.arm-linux-generic-elf-32bit./home/javier/opt/QtSDK/pythongdb/gdb - - - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - - - Make - - Qt4ProjectManager.MakeStep - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - Make - - Qt4ProjectManager.MakeStep - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - MeeGo 1.2 Harmattan API (Qt SDK) Debug - - Qt4ProjectManager.Qt4BuildConfiguration - 2 - /home/javier/maemo/qt/libsowatch-build-harmattan-debug - 10 - true - - 2 - - - - Create Debian Package - - MaemoDebianPackageCreationStep - - - - Install Debian package to sysroot - MaemoInstallDebianPackageToSysrootStep - - - Deploy Debian package via SFTP upload - - MaemoUploadAndInstallDpkgPackageStep - - - - - - 3 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - Build Debian Package and Install to Harmattan Device - - DeployToHarmattan - 0 - - 1 - - true - true - - - false - false - false - false - false - false - false - false - true - true - 0.01 - 0.01 - 10 - 10 - true - true - 25 - 25 - - - true - true - valgrind - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - - 2 - - false - - %{buildDir} - Custom Executable - - ProjectExplorer.CustomExecutableRunConfiguration - 3768 - true - false - true - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.EnvironmentId - {4e827e92-6882-4bad-8513-da5dad54ff3f} - - - ProjectExplorer.Project.Updater.FileVersion - 10 - - diff --git a/metawatch/metawatch.cpp b/metawatch/metawatch.cpp index e6a28f4..e59db2a 100644 --- a/metawatch/metawatch.cpp +++ b/metawatch/metawatch.cpp @@ -79,6 +79,7 @@ MetaWatch::MetaWatch(const QBluetoothAddress& address, QObject *parent) : _paintEngine(0), _address(address), _socket(0), + _24hMode(true), _dayMonthOrder(true), _connectRetries(0), _connected(false), _connectTimer(new QTimer(this)), @@ -138,10 +139,10 @@ int MetaWatch::metric(PaintDeviceMetric metric) const return 1; case PdmDpiX: case PdmPhysicalDpiX: - return 100; + return 96; case PdmDpiY: case PdmPhysicalDpiY: - return 100; + return 96; } return -1; @@ -175,7 +176,7 @@ void MetaWatch::setDateTime(const QDateTime &dateTime) const QDate& date = dateTime.date(); const QTime& time = dateTime.time(); - msg.data[0] = (date.year() & 0xF00) >> 8; + msg.data[0] = (date.year() & 0xFF00) >> 8; msg.data[1] = date.year() & 0xFF; msg.data[2] = date.month(); msg.data[3] = date.day(); @@ -265,28 +266,29 @@ void MetaWatch::clear(Mode mode, bool black) void MetaWatch::renderIdleScreen() { - _paintMode = IdleMode; - - QFont smallFont("MetaWatch Small caps 8pt", 6); - QImage idle_mail(QString(":/metawatch/graphics/idle_gmail.bmp")); QImage idle_call(QString(":/metawatch/graphics/idle_call.bmp")); QImage idle_sms(QString(":/metawatch/graphics/idle_sms.bmp")); - QPainter p(this); + QImage idle_mail(QString(":/metawatch/graphics/idle_gmail.bmp")); + QPainter p; + + _paintMode = IdleMode; + p.begin(this); p.fillRect(0, 0, screenWidth, screenHeight, Qt::white); p.setPen(QPen(Qt::black, 1.0, Qt::DashLine)); p.drawLine(1, systemAreaHeight + 2, screenWidth - 2, systemAreaHeight + 2); - p.drawLine(1, systemAreaHeight * 2 + 3, screenWidth - 2, systemAreaHeight * 2 + 3); + p.drawLine(1, systemAreaHeight * 2 + 4, screenWidth - 2, systemAreaHeight * 2 + 4); - p.drawImage(3, systemAreaHeight * 2 + 6, idle_mail); - p.drawImage(32 + 3, systemAreaHeight * 2 + 6, idle_call); - p.drawImage(32 * 2 + 3, systemAreaHeight * 2 + 6, idle_sms); + p.drawImage((32 * 0) + 4, systemAreaHeight * 2 + 7, idle_call); + p.drawImage((32 * 1) + 4, systemAreaHeight * 2 + 7, idle_sms); + p.drawImage((32 * 2) + 4, systemAreaHeight * 2 + 7, idle_mail); p.end(); + _paintMode = _currentMode; + renderIdleWeather(); renderIdleCounts(); - _paintMode = _currentMode; } void MetaWatch::renderIdleWeather() @@ -297,7 +299,7 @@ void MetaWatch::renderIdleWeather() QPainter p(this); p.setFont(smallFont); - p.drawText(46, systemAreaHeight + 14, "Rain"); + p.drawText(30, systemAreaHeight + 14, "No data!"); p.drawImage(screenWidth - 26, systemAreaHeight + 6, rain); _paintMode = _currentMode; @@ -306,24 +308,26 @@ void MetaWatch::renderIdleWeather() void MetaWatch::renderIdleCounts() { _paintMode = IdleMode; - QFont medFont("MetaWatch Large caps 8pt", 6); + QFont f("MetaWatch Large caps 8pt"); QString s; QPainter p(this); QTextOption opt(Qt::AlignCenter); - const int y = systemAreaHeight * 2 + 25; + const int y = systemAreaHeight * 2 + 26; const int w = 24; const int h = screenHeight - (y + 1); const int mails = _nMails; const int calls = _nCalls; const int sms = _nSms + _nIms; - qDebug() << "unread counts" << mails << calls << sms; + qDebug() << "unread counts" << calls << sms << mails; + + f.setPixelSize(8); // Seems to be the only way to get the desired size. - p.setFont(medFont); + p.setFont(f); p.fillRect(QRect(0, y, screenWidth, h), Qt::white); - p.drawText(QRect(4, y, w, h), s.sprintf("%d", mails), opt); - p.drawText(QRect(32 + 4, y, w, h), s.sprintf("%d", calls), opt); - p.drawText(QRect(32 * 2 + 4, y, w, h), s.sprintf("%d", sms), opt); + p.drawText(QRect((32 * 0) + 4, y, w, h), s.sprintf("%d", calls), opt); + p.drawText(QRect((32 * 1) + 4, y, w, h), s.sprintf("%d", sms), opt); + p.drawText(QRect((32 * 2) + 4, y, w, h), s.sprintf("%d", mails), opt); } quint16 MetaWatch::calcCrc(const QByteArray &data, int size) diff --git a/metawatch/metawatch.h b/metawatch/metawatch.h index d15054f..9da21bb 100644 --- a/metawatch/metawatch.h +++ b/metawatch/metawatch.h @@ -98,6 +98,9 @@ protected: QBluetoothAddress _address; QBluetoothSocket* _socket; + bool _24hMode : 1; + bool _dayMonthOrder : 1; + static const int connectRetryTimesSize = 6; static const int connectRetryTimes[connectRetryTimesSize]; short _connectRetries; diff --git a/metawatch/metawatchplugin.cpp b/metawatch/metawatchplugin.cpp index 751cff9..6a97297 100644 --- a/metawatch/metawatchplugin.cpp +++ b/metawatch/metawatchplugin.cpp @@ -29,7 +29,6 @@ QStringList MetaWatchPlugin::drivers() { QStringList d; d << "metawatch-digital"; - d << "metawatch-digital-sim"; return d; } @@ -38,9 +37,6 @@ Watch* MetaWatchPlugin::getWatch(const QString& driver, QSettings& settings, QOb if (driver == "metawatch-digital") { QBluetoothAddress address(settings.value("address").toString()); return new MetaWatch(address, parent); - } else if (driver == "metawatch-digital-sim") { - //return new MetaWatchSimulator(parent); - return 0; } else { return 0; } diff --git a/sowatch.pro b/sowatch.pro index 38f2a8c..d872f29 100644 --- a/sowatch.pro +++ b/sowatch.pro @@ -4,7 +4,7 @@ SUBDIRS = libsowatch \ sowatchd !isEmpty(MEEGO_VERSION_MAJOR) { - SUBDIRS += meegohandsetnotification + #SUBDIRS += meegohandsetnotification } unix:!symbian { diff --git a/sowatch.pro.user b/sowatch.pro.user deleted file mode 100644 index 852a8a1..0000000 --- a/sowatch.pro.user +++ /dev/null @@ -1,729 +0,0 @@ - - - - - - ProjectExplorer.Project.ActiveTarget - 1 - - - ProjectExplorer.Project.EditorSettings - - true - false - - Cpp - - false - CppGlobal - true - false - true - false - false - false - true - true - false - true - false - false - false - true - false - - - 1 - System - Global - 4 - true - 1 - true - false - true - - Cpp - - true - false - CppGlobal - 4 - 1 - false - true - 0 - 8 - - - - QmlJS - - true - false - QmlJSGlobal - 4 - 1 - false - true - 0 - 8 - - - 2 - 0 - 8 - true - 2 - true - true - true - false - - - - ProjectExplorer.Project.Target.0 - - Desktop - Desktop - Qt4ProjectManager.Target.DesktopTarget - 1 - 1 - 1 - - ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.gdb - - - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - - - Make - - Qt4ProjectManager.MakeStep - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - Make - - Qt4ProjectManager.MakeStep - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Desktop Qt 4.7.4 for GCC (Qt SDK) Release - - Qt4ProjectManager.Qt4BuildConfiguration - 0 - /mnt/Fuentes/Javier/Maemo/qt/sowatch-build-desktop-release - 13 - true - - - ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit.gdb - - - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - - - Make - - Qt4ProjectManager.MakeStep - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - Make - - Qt4ProjectManager.MakeStep - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Desktop Qt 4.7.4 for GCC (Qt SDK) Debug - - Qt4ProjectManager.Qt4BuildConfiguration - 2 - /mnt/Fuentes/Javier/Maemo/qt/sowatch-build-desktop-debug - 13 - true - - 2 - - - 0 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - No deployment - - ProjectExplorer.DefaultDeployConfiguration - - - - - Create tarball - - MaemoTarPackageCreationStep - - - Deploy tarball via SFTP upload - - MaemoUploadAndInstallTarPackageStep - - /mnt/Fuentes/Javier/Maemo/qt/sowatch-build-desktop-debug/sowatch.tar - /mnt/Fuentes/Javier/Maemo/qt/sowatch-build-desktop-release/sowatch.tar - - - localhost - localhost - - - - - - - 2011-09-18T16:45:58 - 2011-09-17T20:53:24 - - - 2 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - Build Tarball and Install to Linux Host - - DeployToGenericLinux - 3 - - 2 - - true - true - - - false - false - false - false - false - false - false - false - true - true - 0.01 - 0.01 - 10 - 10 - true - true - 25 - 25 - - - true - true - valgrind - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - sowsim - - Qt4ProjectManager.Qt4RunConfiguration - 2 - - sowsim/sowsim.pro - false - true - - - 3768 - true - false - false - - - true - true - - - false - false - false - false - false - false - false - false - true - true - 0.01 - 0.01 - 10 - 10 - true - true - 25 - 25 - - - true - true - valgrind - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - sowatchd - - Qt4ProjectManager.Qt4RunConfiguration - 2 - - sowatchd/sowatchd.pro - false - false - - - 3768 - true - false - false - - 2 - - - - ProjectExplorer.Project.Target.1 - - Harmattan - Harmattan - Qt4ProjectManager.Target.HarmattanDeviceTarget - 1 - 0 - 1 - - Qt4ProjectManager.ToolChain.Maemo:/home/javier/opt/QtSDK/Madde/targets/harmattan-platform-api/bin/gcc.arm-linux-generic-elf-32bit./home/javier/opt/QtSDK/pythongdb/gdb - - - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - - - Make - - Qt4ProjectManager.MakeStep - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - Make - - Qt4ProjectManager.MakeStep - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Harmattan Platform API (Qt SDK) Release - Harmattan Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - /mnt/Fuentes/Javier/Maemo/qt/sowatch-build-harmattan-release - 12 - true - - - Qt4ProjectManager.ToolChain.Maemo:/home/javier/opt/QtSDK/Madde/targets/harmattan-platform-api/bin/gcc.arm-linux-generic-elf-32bit./home/javier/opt/QtSDK/pythongdb/gdb - - - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - - - Make - - Qt4ProjectManager.MakeStep - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - Make - - Qt4ProjectManager.MakeStep - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Harmattan Platform API (Qt SDK) Debug - Harmattan Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - /mnt/Fuentes/Javier/Maemo/qt/sowatch-build-harmattan-debug - 12 - true - - 2 - - - - Create Debian Package - - MaemoDebianPackageCreationStep - - - - Install Debian package to sysroot - MaemoInstallDebianPackageToSysrootStep - - - Deploy Debian package via SFTP upload - - MaemoUploadAndInstallDpkgPackageStep - - /mnt/Fuentes/Javier/Maemo/qt/sowatch-build-harmattan-debug/sowatch_0.1.1_armel.deb - /mnt/Fuentes/Javier/Maemo/qt/sowatch-build-harmattan-release/sowatch_0.1.1_armel.deb - - - harm - harm - - - - - - - 2011-09-19T01:23:25 - 2011-09-18T05:14:20 - - - 3 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - Build Debian Package and Install to Harmattan Device - - DeployToHarmattan - 2 - - 1 - - true - true - - - false - false - false - false - false - false - false - false - true - true - 0.01 - 0.01 - 10 - 10 - true - true - 25 - 25 - - - true - true - valgrind - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - sowsim (remote) - - Qt4ProjectManager.MaemoRunConfiguration - - 1 - - sowsim/sowsim.pro - - - 3768 - true - false - false - - - true - true - - - false - false - false - false - false - false - false - false - true - true - 0.01 - 0.01 - 10 - 10 - true - true - 25 - 25 - - - true - true - valgrind - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - sowatchd (remote) - - Qt4ProjectManager.MaemoRunConfiguration - - 1 - - sowatchd/sowatchd.pro - - - 3768 - true - false - false - - 2 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.EnvironmentId - {4e827e92-6882-4bad-8513-da5dad54ff3f} - - - ProjectExplorer.Project.Updater.FileVersion - 10 - - diff --git a/sowatchd/daemon.cpp b/sowatchd/daemon.cpp index 3d9c05c..7889c70 100644 --- a/sowatchd/daemon.cpp +++ b/sowatchd/daemon.cpp @@ -72,7 +72,7 @@ void Daemon::loadProviders() } } - qDebug() << "loaded providers" << _providers; + qDebug() << "loaded providers" << _providers.keys(); } void Daemon::initWatches() -- cgit v1.2.3