From f17f22bb1c8d8eeef3a3b71608a07b383fab60c2 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Thu, 30 Aug 2012 15:05:17 +0600 Subject: [PATCH 01/36] Added credentials for future installing extensions without using inception/openmode --- debian/system-ui.aegis | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/system-ui.aegis b/debian/system-ui.aegis index d57ec260..61cda9ab 100644 --- a/debian/system-ui.aegis +++ b/debian/system-ui.aegis @@ -4,6 +4,8 @@ + + From 5691e169e4f23328fbe4b0412e5727806a9e66b1 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Thu, 30 Aug 2012 17:35:43 +0600 Subject: [PATCH 02/36] Percentage indicator fixies --- src/systemui/statusarea/statusindicator.cpp | 95 ++++++++++++++----- src/systemui/statusarea/statusindicator.h | 5 + .../batterypercentagestatusindicator_stub.h | 12 +++ tests/stubs/batterystatusindicator_stub.h | 10 ++ 4 files changed, 99 insertions(+), 23 deletions(-) diff --git a/src/systemui/statusarea/statusindicator.cpp b/src/systemui/statusarea/statusindicator.cpp index ede2c78c..80b83719 100644 --- a/src/systemui/statusarea/statusindicator.cpp +++ b/src/systemui/statusarea/statusindicator.cpp @@ -298,6 +298,9 @@ BatteryStatusIndicator::BatteryStatusIndicator(ApplicationContext &context, QGra batterySaveMode = createContextItem(context, "System.PowerSaveMode"); connect(batterySaveMode, SIGNAL(contentsChanged()), this, SLOT(batteryChargingChanged())); + displayPercentage = new MGConfItem("/desktop/meego/status_area/display_percentage", this); + connect(displayPercentage, SIGNAL(valueChanged()), this, SLOT(batteryPercentageChanged())); + // Set the initial power save mode (in case it has been switched on before reboot, etc) if (batterySaveMode->value().toBool()) { setStyleName(QString(metaObject()->className()) + BATTERY_MODE_POWERSAVE); @@ -343,24 +346,49 @@ void BatteryStatusIndicator::batteryLevelChanged() void BatteryStatusIndicator::batteryChargingChanged() { - if (batteryCharging->value().toBool()) { - if (batterySaveMode->value().toBool()) { - setStyleNameAndUpdate(QString(metaObject()->className()) + BATTERY_MODE_POWERSAVE_AND_CHARGING); - } else { - setStyleNameAndUpdate(QString(metaObject()->className()) + BATTERY_MODE_CHARGING); - } - animateIfPossible = true; - } else { - if (batterySaveMode->value().toBool()) { - setStyleNameAndUpdate(QString(metaObject()->className()) + BATTERY_MODE_POWERSAVE); + bool displayPercentageEnabled = displayPercentage->value(false).toBool(); + if (displayPercentageEnabled) + setStyleNameAndUpdate(QString(metaObject()->className()) +"Disabled"); + else + { + if (batteryCharging->value().toBool()) { + if (batterySaveMode->value().toBool()) { + setStyleNameAndUpdate(QString(metaObject()->className()) + BATTERY_MODE_POWERSAVE_AND_CHARGING); + } else { + setStyleNameAndUpdate(QString(metaObject()->className()) + BATTERY_MODE_CHARGING); + } + animateIfPossible = true; } else { - setStyleNameAndUpdate(QString(metaObject()->className()) + BATTERY_MODE_NORMAL); + if (batterySaveMode->value().toBool()) { + setStyleNameAndUpdate(QString(metaObject()->className()) + BATTERY_MODE_POWERSAVE); + } else { + setStyleNameAndUpdate(QString(metaObject()->className()) + BATTERY_MODE_NORMAL); + } + animateIfPossible = false; } - animateIfPossible = false; - } updateAnimationStatus(); batteryLevelChanged (); + } +} + +void BatteryStatusIndicator::batteryPercentageChanged() +{ + bool displayPercentageEnabled = displayPercentage->value(false).toBool(); + if (displayPercentageEnabled) + { + setStyleNameAndUpdate(QString(metaObject()->className())+"Disabled"); + disconnect(batteryLevel, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged())); + disconnect(batteryCharging, SIGNAL(contentsChanged()), this, SLOT(batteryChargingChanged())); + disconnect(batterySaveMode, SIGNAL(contentsChanged()), this, SLOT(batteryChargingChanged())); + } + else + { + batteryChargingChanged(); + connect(batteryLevel, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged()), Qt::UniqueConnection); + connect(batteryCharging, SIGNAL(contentsChanged()), this, SLOT(batteryChargingChanged()), Qt::UniqueConnection); + connect(batterySaveMode, SIGNAL(contentsChanged()), this, SLOT(batteryChargingChanged()), Qt::UniqueConnection); + } } BatteryPercentageStatusIndicator::BatteryPercentageStatusIndicator(ApplicationContext &context, QGraphicsItem *parent) : @@ -369,7 +397,13 @@ BatteryPercentageStatusIndicator::BatteryPercentageStatusIndicator(ApplicationCo setStyleNameAndUpdate(metaObject()->className()); batteryPercentage = createContextItem(context, "Battery.ChargePercentage"); - connect(batteryPercentage, SIGNAL(contentsChanged()), this, SLOT(batteryPercentageChanged())); + connect(batteryPercentage, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged())); + + batteryCharging = createContextItem(context, "Battery.IsCharging"); + connect(batteryCharging, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged())); + + batterySaveMode = createContextItem(context, "System.PowerSaveMode"); + connect(batterySaveMode, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged())); displayPercentage = new MGConfItem("/desktop/meego/status_area/display_percentage", this); connect(displayPercentage, SIGNAL(valueChanged()), this, SLOT(batteryPercentageChanged())); @@ -379,21 +413,36 @@ BatteryPercentageStatusIndicator::~BatteryPercentageStatusIndicator() { } +void BatteryPercentageStatusIndicator::batteryLevelChanged() +{ + QString percentage; + if (batteryCharging->value().toBool()) + percentage.append("+"); + else if (batterySaveMode->value().toBool()) + percentage.append("*"); + percentage.append(batteryPercentage->value().toString()); + percentage.append("%"); + + setValue(percentage); +} + void BatteryPercentageStatusIndicator::batteryPercentageChanged() { bool displayPercentageEnabled = displayPercentage->value(false).toBool(); - if (displayPercentageEnabled) { + if (displayPercentageEnabled) + { setStyleNameAndUpdate(QString(metaObject()->className())); - connect(batteryPercentage, SIGNAL(contentsChanged()), this, SLOT(batteryPercentageChanged()), Qt::UniqueConnection); - } else { + connect(batteryPercentage, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged()), Qt::UniqueConnection); + connect(batteryCharging, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged()), Qt::UniqueConnection); + connect(batterySaveMode, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged()), Qt::UniqueConnection); + } + else + { setStyleNameAndUpdate(QString(metaObject()->className())+"Disabled"); - disconnect(batteryPercentage, SIGNAL(contentsChanged()), this, SLOT(batteryPercentageChanged())); + disconnect(batteryPercentage, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged())); + disconnect(batteryCharging, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged())); + disconnect(batterySaveMode, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged())); } - - QString percentage = batteryPercentage->value().toString(); - percentage.append("%"); - - setValue(percentage); } AlarmStatusIndicator::AlarmStatusIndicator(ApplicationContext &context, QGraphicsItem *parent) : diff --git a/src/systemui/statusarea/statusindicator.h b/src/systemui/statusarea/statusindicator.h index 6b77ed66..9ae4de1a 100644 --- a/src/systemui/statusarea/statusindicator.h +++ b/src/systemui/statusarea/statusindicator.h @@ -243,11 +243,13 @@ class BatteryStatusIndicator : public StatusIndicator private slots: void batteryLevelChanged(); void batteryChargingChanged(); + void batteryPercentageChanged(); private: ContextItem *batteryLevel; ContextItem *batteryCharging; ContextItem *batterySaveMode; + MGConfItem *displayPercentage; #ifdef UNIT_TEST friend class Ut_StatusIndicator; @@ -274,10 +276,13 @@ class BatteryPercentageStatusIndicator : public StatusIndicator virtual ~BatteryPercentageStatusIndicator(); private slots: + void batteryLevelChanged(); void batteryPercentageChanged(); private: ContextItem *batteryPercentage; + ContextItem *batteryCharging; + ContextItem *batterySaveMode; MGConfItem *displayPercentage; }; diff --git a/tests/stubs/batterypercentagestatusindicator_stub.h b/tests/stubs/batterypercentagestatusindicator_stub.h index fbc09d9c..860ff74e 100644 --- a/tests/stubs/batterypercentagestatusindicator_stub.h +++ b/tests/stubs/batterypercentagestatusindicator_stub.h @@ -34,6 +34,7 @@ class BatteryPercentageStatusIndicatorStub : public StubBase virtual void BatteryPercentageStatusIndicatorConstructor(ApplicationContext &context, QGraphicsItem *parent); virtual void BatteryPercentageStatusIndicatorDestructor(); virtual void batteryPercentageChanged(); + virtual void batteryLevelChanged(); }; // 2. IMPLEMENT STUB @@ -47,11 +48,17 @@ void BatteryPercentageStatusIndicatorStub::BatteryPercentageStatusIndicatorDestr { } + void BatteryPercentageStatusIndicatorStub::batteryPercentageChanged() { stubMethodEntered("batteryPercentageChanged"); } +void BatteryPercentageStatusIndicatorStub::batteryLevelChanged() +{ + stubMethodEntered("batteryLevelChanged"); +} + // 3. CREATE A STUB INSTANCE BatteryPercentageStatusIndicatorStub gDefaultBatteryPercentageStatusIndicatorStub; BatteryPercentageStatusIndicatorStub *gBatteryPercentageStatusIndicatorStub = &gDefaultBatteryPercentageStatusIndicatorStub; @@ -73,4 +80,9 @@ void BatteryPercentageStatusIndicator::batteryPercentageChanged() gBatteryPercentageStatusIndicatorStub->batteryPercentageChanged(); } +void BatteryPercentageStatusIndicator::batteryLevelChanged() +{ + gBatteryPercentageStatusIndicatorStub->batteryLevelChanged(); +} + #endif // BATTERYPERCENTAGESTATUSINDICATOR_STUB diff --git a/tests/stubs/batterystatusindicator_stub.h b/tests/stubs/batterystatusindicator_stub.h index e2d1f46d..238881b5 100644 --- a/tests/stubs/batterystatusindicator_stub.h +++ b/tests/stubs/batterystatusindicator_stub.h @@ -35,6 +35,7 @@ class BatteryStatusIndicatorStub : public StubBase virtual void BatteryStatusIndicatorDestructor(); virtual void batteryLevelChanged(); virtual void batteryChargingChanged(); + virtual void batteryPercentageChanged(); }; // 2. IMPLEMENT STUB @@ -58,6 +59,10 @@ void BatteryStatusIndicatorStub::batteryChargingChanged() stubMethodEntered("batteryChargingChanged"); } +void BatteryStatusIndicatorStub::batteryPercentageChanged() +{ + stubMethodEntered("batteryPercentageChanged"); +} // 3. CREATE A STUB INSTANCE BatteryStatusIndicatorStub gDefaultBatteryStatusIndicatorStub; BatteryStatusIndicatorStub *gBatteryStatusIndicatorStub = &gDefaultBatteryStatusIndicatorStub; @@ -84,4 +89,9 @@ void BatteryStatusIndicator::batteryChargingChanged() gBatteryStatusIndicatorStub->batteryChargingChanged(); } +void BatteryStatusIndicator::batteryPercentageChanged() +{ + gBatteryStatusIndicatorStub->batteryPercentageChanged(); +} + #endif // BATTERYSTATUSINDICATOR_STUB From 7d4feb728949cd746093b96f3e22710304359f58 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Thu, 30 Aug 2012 17:45:15 +0600 Subject: [PATCH 03/36] Place order config to home directory. Will be used from control panel applet, which have no root privileges --- data/{status-menu-items-order.conf => items-order.conf} | 0 debian/rules | 2 +- .../statusindicatormenu/statusindicatormenuverticalview.cpp | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename data/{status-menu-items-order.conf => items-order.conf} (100%) diff --git a/data/status-menu-items-order.conf b/data/items-order.conf similarity index 100% rename from data/status-menu-items-order.conf rename to data/items-order.conf diff --git a/debian/rules b/debian/rules index be760b71..fc3737a6 100755 --- a/debian/rules +++ b/debian/rules @@ -92,7 +92,7 @@ binary-arch: build install dh_installchangelogs $(EXCLUSIONS) dh_installdocs $(EXCLUSIONS) dh_install --sourcedir=debian/tmp $(EXCLUSIONS) - cp -v data/status-menu-items-order.conf debian/system-ui/etc/ + cp -v data/items-order.conf debian/system-ui/home/user/.status-menu/items-order.conf # Sigh mkdir -p debian/system-ui/usr/lib/meegotouch/applicationextensions mkdir -p debian/system-ui/usr/share/meegotouch/applicationextensions diff --git a/src/systemui/statusindicatormenu/statusindicatormenuverticalview.cpp b/src/systemui/statusindicatormenu/statusindicatormenuverticalview.cpp index 299033b1..ee0561c9 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenuverticalview.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenuverticalview.cpp @@ -154,7 +154,7 @@ QString StatusIndicatorMenuVerticalView::pluginNameString() QStringList StatusIndicatorMenuVerticalView::getOrderList() { - QFile configFile("/etc/status-menu-items-order.conf"); + QFile configFile("/home/user/.status-menu/items-order.conf"); if (!configFile.exists()) { QStringList list; list << "statusindicatormenu-volume.desktop" From 736e7e0109618bfc9fe8eb51afe3f3d8de4652b2 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Thu, 30 Aug 2012 22:12:05 +0600 Subject: [PATCH 04/36] +fixies for order --- data/items-order.conf | 2 +- debian/rules | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/data/items-order.conf b/data/items-order.conf index 46b17b35..7c28a8df 100644 --- a/data/items-order.conf +++ b/data/items-order.conf @@ -4,4 +4,4 @@ statusindicatormenu-internetconnection.desktop statusindicatormenu-bluetooth.desktop statusindicatormenu-dlna.desktop statusindicatormenu-presence.desktop -statusindicatormenu-transfer.desktop +statusindicatormenu-transfer.desktop \ No newline at end of file diff --git a/debian/rules b/debian/rules index fc3737a6..37c7ebac 100755 --- a/debian/rules +++ b/debian/rules @@ -92,7 +92,10 @@ binary-arch: build install dh_installchangelogs $(EXCLUSIONS) dh_installdocs $(EXCLUSIONS) dh_install --sourcedir=debian/tmp $(EXCLUSIONS) + mkdir -p debian/system-ui/home/user/.status-menu cp -v data/items-order.conf debian/system-ui/home/user/.status-menu/items-order.conf + cp -v data/top-order.conf debian/system-ui/home/user/.status-menu/top-order.conf + cp -v data/pannable-order.conf debian/system-ui/home/user/.status-menu/pannable-order.conf # Sigh mkdir -p debian/system-ui/usr/lib/meegotouch/applicationextensions mkdir -p debian/system-ui/usr/share/meegotouch/applicationextensions From 129e14813001050bd2a6a71c114f7220d3c874ce Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Thu, 30 Aug 2012 22:13:19 +0600 Subject: [PATCH 05/36] +fix for credentials --- debian/system-ui.aegis | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/system-ui.aegis b/debian/system-ui.aegis index 61cda9ab..25d7ced5 100644 --- a/debian/system-ui.aegis +++ b/debian/system-ui.aegis @@ -6,6 +6,8 @@ + + From d9ce0a0f58687b8ccdc48c2c0fc51250a407b027 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Fri, 31 Aug 2012 01:20:02 +0600 Subject: [PATCH 06/36] Just missed beep profile icon --- themes/style/statusarea.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/themes/style/statusarea.css b/themes/style/statusarea.css index fc0713de..883ee442 100644 --- a/themes/style/statusarea.css +++ b/themes/style/statusarea.css @@ -509,6 +509,12 @@ StatusIndicatorIconStyle#BatteryStatusIndicatorPowerSaveCharging { animation-duration: 10000; } +StatusIndicatorIconStyle#BatteryStatusIndicatorDisabled { + preferred-size: 0 -1; + minimum-size: 0 -1; + maximum-size: 0 -1; +} + StatusIndicatorLabelStyle#BatteryPercentageStatusIndicatorDisabled { preferred-size: 0 -1; minimum-size: 0 -1; From 2f91074b031c2ce90a84a7baae8fd662243d40ff Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Fri, 31 Aug 2012 01:33:21 +0600 Subject: [PATCH 07/36] Just fix for order configs owner --- debian/system-ui.postinst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/system-ui.postinst b/debian/system-ui.postinst index 238a5331..3101962e 100755 --- a/debian/system-ui.postinst +++ b/debian/system-ui.postinst @@ -1,5 +1,7 @@ #!/bin/sh +chown -R user:users /home/user/.status-menu/ + if [ -n "`initctl status xsession/sysuid | grep running`" ] then initctl restart xsession/sysuid From 9f09ad16ba3a7d627916021a166964a030b64dfb Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Fri, 31 Aug 2012 01:35:27 +0600 Subject: [PATCH 08/36] StatusIndicatorMenuDropDownView fix to working state (nokia left it unfinished) --- .../statusindicatormenudropdownview.cpp | 146 ++++++++++++------ .../statusindicatormenudropdownview.h | 13 +- themes/style/notificationarea.css | 45 ++++-- themes/style/screenlock.css | 5 - themes/style/statusindicatormenu.css | 120 +++++++++++--- themes/style/sysuid.css | 3 +- 6 files changed, 251 insertions(+), 81 deletions(-) diff --git a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp index 3567b28b..641f3cdb 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp @@ -31,6 +31,9 @@ #include #include #include +#include +#include +#include #include "statusindicatormenu.h" #include "statusindicatormenudropdownview.h" #include "statusindicatormenustyle.h" @@ -85,7 +88,7 @@ void PannedWidgetController::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) StatusIndicatorMenuDropDownView::StatusIndicatorMenuDropDownView(StatusIndicatorMenu *controller) : MSceneWindowView(controller), controller(controller), - settingsPluginsExtensionArea(NULL), + fixedPluginsExtensionArea(NULL), statusIndicatorExtensionArea(NULL), pannableViewport(NULL), closeButtonOverlay(NULL), @@ -115,30 +118,53 @@ StatusIndicatorMenuDropDownView::~StatusIndicatorMenuDropDownView() QGraphicsWidget* StatusIndicatorMenuDropDownView::createTopRow() { - // Create an extension area for the top row plugins - settingsPluginsExtensionArea = new MApplicationExtensionArea("com.meego.core.MStatusIndicatorMenuExtensionInterface/1.0"); - connect(settingsPluginsExtensionArea, SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)), controller, SLOT(setStatusIndicatorMenuInterface(MApplicationExtensionInterface*))); - settingsPluginsExtensionArea->setObjectName("StatusIndicatorMenuTopRowExtensionArea"); - settingsPluginsExtensionArea->setInProcessFilter(QRegExp("/statusindicatormenu-(volume|alarms|internetconnection|presence|profile).desktop$")); - settingsPluginsExtensionArea->setOutOfProcessFilter(QRegExp("$^")); - settingsPluginsExtensionArea->setOrder((QStringList() << "statusindicatormenu-volume.desktop" << "statusindicatormenu-alarms.desktop" << "statusindicatormenu-internetconnection.desktop" << "statusindicatormenu-presence.desktop" << "statusindicatormenu-profile.desktop")); - - // Create a button for accessing the full settings - //% "Settings" - MButton *settingsButton = new MButton(qtTrId("qtn_stat_menu_settings")); - settingsButton->setObjectName("StatusIndicatorMenuTopRowExtensionButton"); - settingsButton->setViewType(MButton::iconType); - settingsButton->setIconID("icon-m-status-menu-settings"); - connect(settingsButton, SIGNAL(clicked()), controller, SLOT(launchControlPanelAndHide())); + // Create an extension area for the fixed area plugins + fixedPluginsExtensionArea = new MApplicationExtensionArea("com.meego.core.MStatusIndicatorMenuExtensionInterface/1.0"); + connect(fixedPluginsExtensionArea, SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)), controller, SLOT(setStatusIndicatorMenuInterface(MApplicationExtensionInterface*))); + fixedPluginsExtensionArea->setObjectName("StatusIndicatorMenuExtensionArea"); + + QStringList order; + QRegExp filter; + + QFile file("/home/user/.status-menu/top-order.conf"); + if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) + { + order = QString(file.readAll()).split("\n"); + file.close(); + + QStringList pattern; + foreach (QString string, order) + if (string.length() > 0 + && string.contains("statusindicatormenu-") + && !string.contains("safemode")) + pattern.append(string.remove("statusindicatormenu-").remove(".desktop")); + + filter.setPattern(QString("/statusindicatormenu-(%1).desktop$").arg(pattern.join("|"))); + pattern.clear(); + } + else if (QFile(CRASH_FILE).exists()) + { + filter.setPattern("/statusindicatormenu-(volume|safemode|call).desktop$"); + order << "statusindicatormenu-volume.desktop" + << "statusindicatormenu-safemode.desktop" + << "statusindicatormenu-call.desktop"; + } + else + { + filter.setPattern("/statusindicatormenu-(volume|call).desktop$"); + order << "statusindicatormenu-volume.desktop" + << "statusindicatormenu-call.desktop"; + } + + fixedPluginsExtensionArea->setInProcessFilter(filter); + fixedPluginsExtensionArea->setOutOfProcessFilter(QRegExp("$^")); + fixedPluginsExtensionArea->setOrder(order); // Put the extension area and the settings button to a horizontal layout - QGraphicsLinearLayout *topRowLayout = new QGraphicsLinearLayout(Qt::Horizontal); + QGraphicsLinearLayout *topRowLayout = new QGraphicsLinearLayout(Qt::Vertical); topRowLayout->setContentsMargins(0, 0, 0, 0); topRowLayout->setSpacing(0); - topRowLayout->addStretch(); - topRowLayout->addItem(settingsPluginsExtensionArea); - topRowLayout->addItem(settingsButton); - topRowLayout->addStretch(); + topRowLayout->addItem(fixedPluginsExtensionArea); // Create a container widget for extension area and settings button layout MWidgetController *topRowWidget = new MStylableWidget; @@ -150,16 +176,53 @@ QGraphicsWidget* StatusIndicatorMenuDropDownView::createTopRow() MApplicationExtensionArea* StatusIndicatorMenuDropDownView::createVerticalExtensionArea() { - // Create an extension area for the call ui and transfer ui plugins + // Create an extension area for the pannable area plugins MApplicationExtensionArea *extensionArea = new MApplicationExtensionArea("com.meego.core.MStatusIndicatorMenuExtensionInterface/1.0"); extensionArea->setObjectName("StatusIndicatorMenuVerticalExtensionArea"); - extensionArea->setInProcessFilter(QRegExp("/statusindicatormenu-(call|transfer).desktop$")); + + QStringList order; + QRegExp filter; + + QFile file("/home/user/.status-menu/pannable-order.conf"); + if (!QFile(CRASH_FILE).exists() && file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) + { + order = QString(file.readAll()).split("\n"); + file.close(); + + QStringList pattern; + foreach (QString string, order) + if (string.length() > 0 + && string.contains("statusindicatormenu-") + && !string.contains("safemode")) + pattern.append(string.remove("statusindicatormenu-").remove(".desktop")); + + filter.setPattern(QString("/statusindicatormenu-(%1).desktop$").arg(pattern.join("|"))); + pattern.clear(); + } + else + { + filter.setPattern("/statusindicatormenu-(internetconnection|bluetooth|dlna|presence|transfer).desktop$"); + order << "statusindicatormenu-internetconnection.desktop" + << "statusindicatormenu-bluetooth.desktop" + << "statusindicatormenu-dlna.desktop" + << "statusindicatormenu-presence.desktop" + << "statusindicatormenu-transfer.desktop"; + } + + extensionArea->setInProcessFilter(filter); extensionArea->setOutOfProcessFilter(QRegExp("$^")); - extensionArea->setOrder((QStringList() << "statusindicatormenu-call.desktop" << "statusindicatormenu-transfer.desktop")); - connect(extensionArea, SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)), controller, SLOT(setStatusIndicatorMenuInterface(MApplicationExtensionInterface*))); + extensionArea->setOrder(order); + connect(extensionArea, + SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)), + controller, + SLOT(setStatusIndicatorMenuInterface(MApplicationExtensionInterface*))); return extensionArea; } +void StatusIndicatorMenuDropDownView::setSafeMode(MApplicationExtensionArea *extensionArea, bool enabled) +{ +} + MPannableViewport* StatusIndicatorMenuDropDownView::createPannableArea() { // Create pannable area contents @@ -170,7 +233,9 @@ MPannableViewport* StatusIndicatorMenuDropDownView::createPannableArea() contentLayout->setSpacing(0); contentLayout->addItem(statusIndicatorExtensionArea); - if(style()->notificationArea()) { + MGConfItem *displayNotifications = new MGConfItem("/desktop/meego/status_menu/display_notifications", this); + + if(style()->notificationArea() && displayNotifications->value(true).toBool()) { NotificationArea *notificationArea = new NotificationArea; notificationArea->setNotificationManagerInterface(Sysuid::instance()->notificationManagerInterface()); connect(notificationArea, SIGNAL(bannerClicked()), controller, SIGNAL(hideRequested())); @@ -178,27 +243,29 @@ MPannableViewport* StatusIndicatorMenuDropDownView::createPannableArea() } MWidgetController *contentWidget = new MStylableWidget; - contentWidget->setStyleName("StatusIndicatorMenuContentWidget"); + contentWidget->setStyleName("StatusIndicatorMenuExtensionAreaWidget"); contentWidget->setLayout(contentLayout); QGraphicsLinearLayout *pannableLayout = new QGraphicsLinearLayout(Qt::Vertical); pannableLayout->setContentsMargins(0, 0, 0, 0); pannableLayout->setSpacing(0); pannableLayout->addItem(contentWidget); - QGraphicsWidget *closeButtonRow = createCloseButtonRow(); - pannableLayout->addItem(closeButtonRow); + //QGraphicsWidget *closeButtonRow = createCloseButtonRow(); + //pannableLayout->addItem(closeButtonRow); pannableLayout->addStretch(); // Create a container widget for the pannable area PannedWidgetController *pannedWidget = new PannedWidgetController; pannedWidget->setLayout(pannableLayout); - pannedWidget->setBottommostWidget(closeButtonRow); + //pannedWidget->setBottommostWidget(closeButtonRow); + pannedWidget->setBottommostWidget(contentWidget); connect(pannedWidget, SIGNAL(positionOrSizeChanged()), this, SLOT(setPannabilityAndLayout())); connect(pannedWidget, SIGNAL(pressedOutSideContents()), controller, SIGNAL(hideRequested())); // Setup the pannable viewport MPannableViewport *pannableViewport = new MPannableViewport; pannableViewport->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + pannableViewport->setVerticalPanningPolicy(MPannableWidget::PanningAsNeeded); pannableViewport->setWidget(pannedWidget); return pannableViewport; } @@ -209,7 +276,7 @@ QGraphicsWidget* StatusIndicatorMenuDropDownView::createCloseButtonRow() MButton *closeButton = new MButton; closeButton->setViewType("icon"); closeButton->setObjectName("StatusIndicatorMenuCloseButton"); - closeButton->setIconID("icon-m-framework-close"); + closeButton->setIconID("icon-m-framework-close-thumbnail"); connect(closeButton, SIGNAL(clicked()), controller, SIGNAL(hideRequested())); // Add two overlay widgets that will not allow mouse events to pass through them next to the close button @@ -234,7 +301,7 @@ MOverlay *StatusIndicatorMenuDropDownView::createCloseButtonOverlay() MButton *closeButton = new MButton; closeButton->setViewType("icon"); closeButton->setObjectName("StatusIndicatorMenuCloseButton"); - closeButton->setIconID("icon-m-framework-close"); + closeButton->setIconID("icon-m-framework-close-thumbnail"); connect(closeButton, SIGNAL(clicked()), controller, SIGNAL(hideRequested())); // Add two overlay widgets that will not allow mouse events to pass through them next to the close button @@ -255,7 +322,7 @@ MOverlay *StatusIndicatorMenuDropDownView::createCloseButtonOverlay() void StatusIndicatorMenuDropDownView::ensureIsViewable() { - settingsPluginsExtensionArea->init(); + fixedPluginsExtensionArea->init(); if (statusIndicatorExtensionArea) { statusIndicatorExtensionArea->init(); @@ -264,16 +331,9 @@ void StatusIndicatorMenuDropDownView::ensureIsViewable() void StatusIndicatorMenuDropDownView::setPannabilityAndLayout() { - QGraphicsWidget *pannableWidget = pannableViewport->widget(); - - // Enable pannability if there is too much content to fit on the screen - bool viewportShouldBePannable = pannableWidget->effectiveSizeHint(Qt::PreferredSize).height() > pannableViewport->geometry().height(); - pannableViewport->setVerticalPanningPolicy(viewportShouldBePannable ? MPannableWidget::PanningAsNeeded : MPannableWidget::PanningAlwaysOff); - // Appear or disappear the close button overlay based on close area position - const QGraphicsWidget *closeButtonRow = static_cast(pannableViewport->widget())->bottommostWidget(); - qreal closeButtonRowBottomYPos = closeButtonRow->mapToItem(controller, QPointF(0, closeButtonRow->geometry().height())).y(); - + const QGraphicsWidget *m_bottommostWidget = static_cast(pannableViewport->widget())->bottommostWidget(); + qreal closeButtonRowBottomYPos = m_bottommostWidget->mapToItem(controller, QPointF(0, m_bottommostWidget->geometry().height())).y(); if (controller->sceneManager()) { qreal screenHeight = controller->sceneManager()->visibleSceneSize().height(); if (closeButtonRowBottomYPos <= screenHeight) { @@ -295,7 +355,7 @@ void StatusIndicatorMenuDropDownView::setPannabilityAndLayout() void StatusIndicatorMenuDropDownView::resetViewport() { - pannableViewport->setPosition(QPointF(0,0)); + //pannableViewport->setPosition(QPointF(0,0)); } void StatusIndicatorMenuDropDownView::applyStyle() diff --git a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h index caf8c08b..f2c3044e 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h @@ -26,6 +26,8 @@ #include #include "statusindicatormenustyle.h" +#define CRASH_FILE "/tmp/system-ui-crashed" + class QGraphicsSceneMouseEvent; class QGraphicsLinearLayout; class MPannableViewport; @@ -145,15 +147,20 @@ private slots: //! The controller StatusIndicatorMenu *controller; - //! The application extension area for the settings plugins - MApplicationExtensionArea *settingsPluginsExtensionArea; + //! The application extension area for the fixed area plugins + MApplicationExtensionArea *fixedPluginsExtensionArea; //! The application extension area for the status indicator widgets MApplicationExtensionArea *statusIndicatorExtensionArea; - //! Extension area for call ui and transfer ui plugins + //! Extension area for pannable area plugins MApplicationExtensionArea* createVerticalExtensionArea(); + /*! + * Sets whether or not non-official plugins will be loaded + */ + void setSafeMode(MApplicationExtensionArea *extensionArea, bool enabled); + //! The pannable area viewport MPannableViewport *pannableViewport; diff --git a/themes/style/notificationarea.css b/themes/style/notificationarea.css index 597d8124..417122ab 100644 --- a/themes/style/notificationarea.css +++ b/themes/style/notificationarea.css @@ -1,9 +1,19 @@ +@const CB_FONT_COLOR_INVERTED: #FFFFFF; +@const CB_FONT_COLOR_INVERTED_PRESSED: #797979; +@const CB_FONT_COLOR_INVERTED_SELECTED: #FFFFFF; +@const CB_FONT_COLOR_INVERTED_DISABLED: #4E4E4E; + +@const CB_BG_INVERTED: meegotouch-button-inverted-background; +@const CB_BG_INVERTED_PRESSED: meegotouch-button-inverted-background-pressed; +@const CB_BG_INVERTED_SELECTED: meegotouch-button-inverted-background-selected; +@const CB_BG_INVERTED_DISABLED: meegotouch-button-inverted-background-disabled; + NotificationAreaStyle { minimum-size: 100% 0; maximum-size: 100% -1; - margin-left: 0; + margin-left: 15; margin-top: 0; - margin-right: 0; + margin-right: 15; margin-bottom: 0; clear-button: true; max-banners: -1; @@ -25,16 +35,29 @@ MButtonStyle#NotificationAreaClearButton { } MButtonStyle#NotificationAreaClearButtonVisible { - margin-left: $MARGIN_MEDIUM; - margin-right: $MARGIN_MEDIUM; - margin-top: $MARGIN_MEDIUM; - margin-bottom: $MARGIN_MEDIUM; - minimum-size: 46mm $SIZE_BUTTON; - maximum-size: 46mm $SIZE_BUTTON; + margin-bottom: 40; + minimum-size: 70% $SIZE_BUTTON; + maximum-size: 70% $SIZE_BUTTON; + text-color: $CB_FONT_COLOR_INVERTED; + background-image: $CB_BG_INVERTED $CORNER_MARGINS; + horizontal-align: center; +} + +MButtonStyle#NotificationAreaClearButtonVisible:pressed { +background-image:$CB_BG_INVERTED_PRESSED $CORNER_MARGINS; +text-color: $CB_FONT_COLOR_INVERTED_PRESSED; +} +MButtonStyle#NotificationAreaClearButtonVisible:selected { +background-image:$CB_BG_INVERTED_SELECTED $CORNER_MARGINS; +text-color: $CB_FONT_COLOR_INVERTED_SELECTED; +} +MButtonStyle#NotificationAreaClearButtonVisible:disabled { +background-image:$CB_BG_INVERTED_DISABLED $CORNER_MARGINS; +text-color: $CB_FONT_COLOR_INVERTED_DISABLED; } MWidgetStyle#AndMore { - maximum-size: 100% 0; + maximum-size: 0 0; padding-top: 0; padding-bottom: 0; padding-left: 0; @@ -46,7 +69,7 @@ MWidgetStyle#AndMore { } MWidgetStyle#AndMoreVisible { - maximum-size: 100% 0; + maximum-size: 0 0; padding-top: 0; padding-bottom: 0; padding-left: 0; @@ -59,7 +82,7 @@ MWidgetStyle#AndMoreVisible { MLabelStyle#AndMoreLabel { font: $FONT_XSMALL; - color: #ffffff; + color: #000000; } MBannerStyle { diff --git a/themes/style/screenlock.css b/themes/style/screenlock.css index d7e22ee1..6c13d246 100644 --- a/themes/style/screenlock.css +++ b/themes/style/screenlock.css @@ -1,8 +1,3 @@ -ScreenLockWindowStyle { - locked-orientation:; - translucent: false; -} - MSceneWindowStyle#ScreenLockWindow { minimum-size: 100% 100%; preferred-size: 100% 100%; diff --git a/themes/style/statusindicatormenu.css b/themes/style/statusindicatormenu.css index 919c22a5..37edbb13 100644 --- a/themes/style/statusindicatormenu.css +++ b/themes/style/statusindicatormenu.css @@ -1,5 +1,5 @@ StatusIndicatorMenuStyle { - padding-top: 2.8mm; + padding-top: 0.0mm; notification-area: true; } @@ -33,21 +33,24 @@ StatusIndicatorMenu MWidgetSlideAnimationStyle#Out { } MWidgetStyle#StatusIndicatorMenuExtensionAreaWidget { - background-image: "meegotouch-applicationpage-background"; + background-image: "meegotouch-applicationpage-background-inverted"; } MWidgetStyle#StatusIndicatorMenuContentWidget { - background-image: "meegotouch-applicationpage-background"; + background-image: "meegotouch-applicationpage-background-inverted"; } MWidgetStyle#CloseButtonArea { - background-image: "meegotouch-statusmenuclose-background"; + background-image: "meegotouch-applicationpage-background-inverted"; + minimum-size: 100% 10.0mm; + preferred-size: 100% 10.0mm; + maximum-size: 100% 10.0mm; } MWidgetStyle#StatusIndicatorMenuWindowBackground { - background-image: "meegotouch-applicationpage-background"; - minimum-size: 100% 0; - maximum-size: 100% 0; + background-image: "meegotouch-applicationpage-background-inverted"; + minimum-size: 480 0; + maximum-size: 480 0; } MStatusBarStyle#StatusIndicatorMenuWindowStatusBar { @@ -91,21 +94,15 @@ MButtonStyle#StatusIndicatorMenuCloseButton { } MOverlayStyle#CloseButtonOverlay { - background-image: "meegotouch-statusmenuclose-background" 0px 0px 0px 0px; - minimum-size: 100% 6mm; - preferred-size: 100% 6mm; - maximum-size: 100% 6mm; + background-image: "meegotouch-applicationpage-background-inverted"; + minimum-size: 100% 6.4mm; + preferred-size: 100% 6.4mm; + maximum-size: 100% 6.4mm; offset: 0 0; vertical-align: bottom; horizontal-align: left; } -MApplicationExtensionAreaStyle#StatusIndicatorMenuTopRowExtensionArea { - background-image: ; - layout-orientation: horizontal; - container-mode: false; -} - MPannableWidgetStyle#StatusIndicatorMenuViewport { margin-left: 0; margin-right: 0; @@ -118,11 +115,98 @@ MPannableWidgetStyle#StatusIndicatorMenuViewport { minimum-size: -1 -1; preferred-size: -1 -1; maximum-size: -1 -1; - background-image: "meegotouch-applicationpage-background"; + background-image: "meegotouch-applicationpage-background-inverted"; } MContainerStyle#MExtensionAreaInvisibleContainer { background-image: ; } +MWidgetStyle#StatusBarLandscapeWidget { + padding-left: 0.4mm; + padding-right: 0.4mm; + padding-top: 0.4mm; +} + +MWidgetStyle#StatusBarPortraitWidget { + padding-left: 0.4mm; + padding-right: 0.4mm; + padding-top: 0.4mm; +} + +MWidgetStyle#StatusBarLandscapeWidgetCall { + background-image: "meegotouch-statusarea-background-call"; + padding-left: 0.4mm; + padding-right: 0.4mm; + padding-top: 0.4mm; +} + +MWidgetStyle#StatusBarPortraitWidgetCall { + background-image: "meegotouch-statusarea-background-call"; + padding-left: 0.4mm; + padding-right: 0.4mm; + padding-top: 0.4mm; +} + +StatusIndicatorMenu MWidgetSlideAnimationStyle#In.Landscape { + origin: "left"; +} + +StatusIndicatorMenu MWidgetSlideAnimationStyle#Out.Landscape { + origin: "left"; +} + +#MenuSceneLayerEffect { + background-image: "meegotouch-statusmenu-dimmer"; +} + +MSceneManagerStyle { + application-menu-animation: "MWidgetSlideAnimation"; +} + +ScreenLockWindowStyle { + locked-orientation: "portrait"; + translucent: true; +} + +MApplicationExtensionAreaStyle#StatusIndicatorMenuTopRowExtensionArea { + padding-left: 0mm; + padding-right: 0mm; + background-image: ; + layout-orientation: vertical; + container-mode: false; + background-color: $COLOR_INVERTED_BACKGROUND; +} + +MApplicationExtensionAreaStyle#StatusIndicatorMenuVerticalExtensionArea { + padding-left: 0mm; + padding-right: 0mm; + background-image: ; + layout-orientation: vertical; + container-mode: false; + background-color: $COLOR_INVERTED_BACKGROUND; +} +MApplicationExtensionAreaStyle#StatusIndicatorMenuExtensionArea { + padding-left: 0mm; + padding-right: 0mm; + background-image: ; + layout-orientation: vertical; + container-mode: false; + background-color: $COLOR_INVERTED_BACKGROUND; +} + +MWidgetZoomAnimationStyle#In { + opacity-animation-delay: 0; + opacity-animation-duration: 500; + opacity-animation-easing-curve: overshotbezier; + + scale-animation-duration: 500; + scale-animation-easing-curve: overshotbezier; + + delay: 50; + scale: 0.25; + opacity: 1; + + position-animation-distance-factor: 0; +} diff --git a/themes/style/sysuid.css b/themes/style/sysuid.css index 5ef9065a..d648eb84 100644 --- a/themes/style/sysuid.css +++ b/themes/style/sysuid.css @@ -1,2 +1,3 @@ -@import "default.css"; @import "custom.css"; +@import "default.css"; +@import "volume.css"; \ No newline at end of file From f6323694df2e1e238394607accfc13a13c133eca Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Fri, 31 Aug 2012 01:42:49 +0600 Subject: [PATCH 09/36] system-ui-thene-fixed dependency contains sysuid.css styles fixies for blanco theme for making StatusIndicatorMenuDropDownView working correctly. https://github.com/CODeRUS/system-ui-theme-fixed --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 9fb85c91..084558e8 100644 --- a/debian/control +++ b/debian/control @@ -17,7 +17,7 @@ Replaces: duistatusindicatormenu, cellular-ui Architecture: any Recommends: pulseaudio-module-meego-mainvolume Depends: ${shlibs:Depends}, ${misc:Depends}, systemui-l10n-engineering-english, duicontrolpanel-privatemodeapplet, ui-fonts (>=5.6), - usb-moded [armel] + usb-moded [armel], system-ui-theme-fixed Description: Various system user interfaces. System user interface package contains various user interfaces, e.g: - status area From dedfe23675049941584735166bd3ad6d3c1d3ce7 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sat, 1 Sep 2012 00:45:06 +0600 Subject: [PATCH 10/36] Layout fixies --- .../statusindicatormenu/statusindicatormenudropdownview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp index 641f3cdb..abf2f562 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp @@ -235,7 +235,7 @@ MPannableViewport* StatusIndicatorMenuDropDownView::createPannableArea() MGConfItem *displayNotifications = new MGConfItem("/desktop/meego/status_menu/display_notifications", this); - if(style()->notificationArea() && displayNotifications->value(true).toBool()) { + if(displayNotifications->value(true).toBool()) { NotificationArea *notificationArea = new NotificationArea; notificationArea->setNotificationManagerInterface(Sysuid::instance()->notificationManagerInterface()); connect(notificationArea, SIGNAL(bannerClicked()), controller, SIGNAL(hideRequested())); @@ -349,8 +349,8 @@ void StatusIndicatorMenuDropDownView::setPannabilityAndLayout() if (backgroundHeight < 0) { backgroundHeight = 0; } - backgroundWidget->setMinimumHeight(backgroundHeight); - backgroundWidget->setMaximumHeight(backgroundHeight); + backgroundWidget->setMinimumHeight(closeButtonRowBottomYPos - viewPortYPos); + backgroundWidget->setMaximumHeight(closeButtonRowBottomYPos - viewPortYPos); } void StatusIndicatorMenuDropDownView::resetViewport() From 6831fed1ce8145deb5e46a99ff52988fe08d4ec1 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sat, 1 Sep 2012 00:57:51 +0600 Subject: [PATCH 11/36] Removed dependency, added postinst script lines for easy fixing blanco style --- debian/control | 2 +- debian/system-ui.postinst | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 084558e8..9fb85c91 100644 --- a/debian/control +++ b/debian/control @@ -17,7 +17,7 @@ Replaces: duistatusindicatormenu, cellular-ui Architecture: any Recommends: pulseaudio-module-meego-mainvolume Depends: ${shlibs:Depends}, ${misc:Depends}, systemui-l10n-engineering-english, duicontrolpanel-privatemodeapplet, ui-fonts (>=5.6), - usb-moded [armel], system-ui-theme-fixed + usb-moded [armel] Description: Various system user interfaces. System user interface package contains various user interfaces, e.g: - status area diff --git a/debian/system-ui.postinst b/debian/system-ui.postinst index 3101962e..54f375bf 100755 --- a/debian/system-ui.postinst +++ b/debian/system-ui.postinst @@ -2,6 +2,10 @@ chown -R user:users /home/user/.status-menu/ +sed -i -e "s/minimum-size: 100% -1;/minimum-size: 100% 0;/" /usr/share/themes/blanco/meegotouch/sysuid/style/sysuid.css +sed -i -e "s/preferred-size: 100% -1;/preferred-size: 100% 30%;/" /usr/share/themes/blanco/meegotouch/sysuid/style/sysuid.css +sed -i -e "s/maximum-size: 100% -1;/maximum-size: 100% 100%;/" /usr/share/themes/blanco/meegotouch/sysuid/style/sysuid.css + if [ -n "`initctl status xsession/sysuid | grep running`" ] then initctl restart xsession/sysuid From 937aec908efcd7177732a6d743e8f41525802276 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sat, 1 Sep 2012 16:53:26 +0600 Subject: [PATCH 12/36] Credentials for chown in postinst script --- debian/system-ui.aegis | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/system-ui.aegis b/debian/system-ui.aegis index 25d7ced5..f68c0876 100644 --- a/debian/system-ui.aegis +++ b/debian/system-ui.aegis @@ -12,4 +12,8 @@ + + + + From 579899c2fac7d67f737bf77370578337f730dc81 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sat, 1 Sep 2012 23:15:07 +0600 Subject: [PATCH 13/36] Final layout fixies. Both views should work fine now. No unnecessary actions at install-time --- debian/system-ui.postinst | 4 - .../notificationareaview.cpp | 4 +- .../statusindicatormenu.pri | 4 +- .../statusindicatormenudropdownview.cpp | 10 +- .../statusindicatormenudropdownview.h | 4 +- .../ut_statusindicatormenudropdownview.cpp | 10 +- themes/style/notificationarea.css | 50 ++---- themes/style/statusindicatormenu.css | 142 +++++------------- 8 files changed, 73 insertions(+), 155 deletions(-) diff --git a/debian/system-ui.postinst b/debian/system-ui.postinst index 54f375bf..3101962e 100755 --- a/debian/system-ui.postinst +++ b/debian/system-ui.postinst @@ -2,10 +2,6 @@ chown -R user:users /home/user/.status-menu/ -sed -i -e "s/minimum-size: 100% -1;/minimum-size: 100% 0;/" /usr/share/themes/blanco/meegotouch/sysuid/style/sysuid.css -sed -i -e "s/preferred-size: 100% -1;/preferred-size: 100% 30%;/" /usr/share/themes/blanco/meegotouch/sysuid/style/sysuid.css -sed -i -e "s/maximum-size: 100% -1;/maximum-size: 100% 100%;/" /usr/share/themes/blanco/meegotouch/sysuid/style/sysuid.css - if [ -n "`initctl status xsession/sysuid | grep running`" ] then initctl restart xsession/sysuid diff --git a/src/systemui/statusindicatormenu/notificationareaview.cpp b/src/systemui/statusindicatormenu/notificationareaview.cpp index 517f79e8..589c2c6b 100644 --- a/src/systemui/statusindicatormenu/notificationareaview.cpp +++ b/src/systemui/statusindicatormenu/notificationareaview.cpp @@ -70,9 +70,9 @@ NotificationAreaView::NotificationAreaView(NotificationArea *controller) : clearButtonLayout->setSpacing(0); clearButton->setStyleName("NotificationAreaClearButton"); connect(clearButton, SIGNAL(clicked()), controller, SLOT(removeAllRemovableBanners())); - clearButtonLayout->addStretch(); +// clearButtonLayout->addStretch(); clearButtonLayout->addItem(clearButton); - clearButtonLayout->addStretch(); +// clearButtonLayout->addStretch(); } NotificationAreaView::~NotificationAreaView() diff --git a/src/systemui/statusindicatormenu/statusindicatormenu.pri b/src/systemui/statusindicatormenu/statusindicatormenu.pri index 1296b231..0f5fe9db 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenu.pri +++ b/src/systemui/statusindicatormenu/statusindicatormenu.pri @@ -21,13 +21,15 @@ HEADERS += \ statusindicatormenu/notificationareaview.h \ statusindicatormenu/notificationareastyle.h \ statusindicatormenu/statusindicatormenustyle.h \ + statusindicatormenu/statusindicatordropdownmenustyle.h \ statusindicatormenu/statusindicatormenu.h \ statusindicatormenu/statusindicatormenudropdownview.h \ statusindicatormenu/statusindicatormenuverticalview.h MODEL_HEADERS += statusindicatormenu/notificationareamodel.h STYLE_HEADERS += statusindicatormenu/notificationareastyle.h \ - statusindicatormenu/statusindicatormenustyle.h + statusindicatormenu/statusindicatormenustyle.h \ + statusindicatormenu/statusindicatordropdownmenustyle.h headers.path = /usr/include/system-ui headers.files += statusindicatormenu/mstatusindicatormenuextensioninterface.h statusindicatormenu/MStatusIndicatorMenuExtensionInterface \ diff --git a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp index abf2f562..44299e86 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp @@ -36,7 +36,7 @@ #include #include "statusindicatormenu.h" #include "statusindicatormenudropdownview.h" -#include "statusindicatormenustyle.h" +#include "statusindicatordropdownmenustyle.h" #include "sysuid.h" const int StatusIndicatorMenuDropDownView::VIEW_INITIALIZATION_DELAY = 30 * 1000; @@ -121,7 +121,7 @@ QGraphicsWidget* StatusIndicatorMenuDropDownView::createTopRow() // Create an extension area for the fixed area plugins fixedPluginsExtensionArea = new MApplicationExtensionArea("com.meego.core.MStatusIndicatorMenuExtensionInterface/1.0"); connect(fixedPluginsExtensionArea, SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)), controller, SLOT(setStatusIndicatorMenuInterface(MApplicationExtensionInterface*))); - fixedPluginsExtensionArea->setObjectName("StatusIndicatorMenuExtensionArea"); + fixedPluginsExtensionArea->setObjectName("StatusIndicatorDropDownMenuExtensionArea"); QStringList order; QRegExp filter; @@ -168,7 +168,7 @@ QGraphicsWidget* StatusIndicatorMenuDropDownView::createTopRow() // Create a container widget for extension area and settings button layout MWidgetController *topRowWidget = new MStylableWidget; - topRowWidget->setStyleName("StatusIndicatorMenuExtensionAreaWidget"); + topRowWidget->setStyleName("StatusIndicatorDropDownMenuExtensionAreaWidget"); topRowWidget->setLayout(topRowLayout); return topRowWidget; @@ -178,7 +178,7 @@ MApplicationExtensionArea* StatusIndicatorMenuDropDownView::createVerticalExtens { // Create an extension area for the pannable area plugins MApplicationExtensionArea *extensionArea = new MApplicationExtensionArea("com.meego.core.MStatusIndicatorMenuExtensionInterface/1.0"); - extensionArea->setObjectName("StatusIndicatorMenuVerticalExtensionArea"); + extensionArea->setObjectName("StatusIndicatorDropDownMenuExtensionArea"); QStringList order; QRegExp filter; @@ -243,7 +243,7 @@ MPannableViewport* StatusIndicatorMenuDropDownView::createPannableArea() } MWidgetController *contentWidget = new MStylableWidget; - contentWidget->setStyleName("StatusIndicatorMenuExtensionAreaWidget"); + contentWidget->setStyleName("StatusIndicatorDropDownMenuExtensionAreaWidget"); contentWidget->setLayout(contentLayout); QGraphicsLinearLayout *pannableLayout = new QGraphicsLinearLayout(Qt::Vertical); diff --git a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h index f2c3044e..2613e798 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h @@ -24,7 +24,7 @@ #include #include #include -#include "statusindicatormenustyle.h" +#include "statusindicatordropdownmenustyle.h" #define CRASH_FILE "/tmp/system-ui-crashed" @@ -109,7 +109,7 @@ class PannedWidgetController : public MStylableWidget class StatusIndicatorMenuDropDownView : public MSceneWindowView { Q_OBJECT - M_VIEW(MSceneWindowModel, StatusIndicatorMenuStyle) + M_VIEW(MSceneWindowModel, StatusIndicatorDropDownMenuStyle) public: /*! diff --git a/tests/ut_statusindicatormenudropdownview/ut_statusindicatormenudropdownview.cpp b/tests/ut_statusindicatormenudropdownview/ut_statusindicatormenudropdownview.cpp index 51624c0f..823c6f35 100644 --- a/tests/ut_statusindicatormenudropdownview/ut_statusindicatormenudropdownview.cpp +++ b/tests/ut_statusindicatormenudropdownview/ut_statusindicatormenudropdownview.cpp @@ -32,7 +32,7 @@ #include "notificationarea_stub.h" #include "sysuid_stub.h" #include "x11wrapper_modified_stub.h" -#include "statusindicatormenustyle.h" +#include "statusindicatordropdownmenustyle.h" #include #ifdef HAVE_QMSYSTEM @@ -110,22 +110,22 @@ MSceneManager *MWidget::sceneManager() const bool showNotificationArea = true; -StatusIndicatorMenuStyleContainer::StatusIndicatorMenuStyleContainer() : +StatusIndicatorDropDownMenuStyleContainer::StatusIndicatorDropDownMenuStyleContainer() : d_ptr(NULL) { } -const char* StatusIndicatorMenuStyleContainer::styleType() const +const char* StatusIndicatorDropDownMenuStyleContainer::styleType() const { return "MWidgetStyle"; } -StatusIndicatorMenuStyleContainer::~StatusIndicatorMenuStyleContainer() +StatusIndicatorDropDownMenuStyleContainer::~StatusIndicatorDropDownMenuStyleContainer() { } -const bool& StatusIndicatorMenuStyle::notificationArea() const +const bool& StatusIndicatorDropDownMenuStyle::notificationArea() const { return showNotificationArea; } diff --git a/themes/style/notificationarea.css b/themes/style/notificationarea.css index 417122ab..c5326d7d 100644 --- a/themes/style/notificationarea.css +++ b/themes/style/notificationarea.css @@ -1,24 +1,19 @@ -@const CB_FONT_COLOR_INVERTED: #FFFFFF; -@const CB_FONT_COLOR_INVERTED_PRESSED: #797979; -@const CB_FONT_COLOR_INVERTED_SELECTED: #FFFFFF; -@const CB_FONT_COLOR_INVERTED_DISABLED: #4E4E4E; - -@const CB_BG_INVERTED: meegotouch-button-inverted-background; -@const CB_BG_INVERTED_PRESSED: meegotouch-button-inverted-background-pressed; -@const CB_BG_INVERTED_SELECTED: meegotouch-button-inverted-background-selected; -@const CB_BG_INVERTED_DISABLED: meegotouch-button-inverted-background-disabled; - NotificationAreaStyle { minimum-size: 100% 0; maximum-size: 100% -1; - margin-left: 15; + margin-left: 16; margin-top: 0; - margin-right: 15; + margin-right: 16; margin-bottom: 0; clear-button: true; max-banners: -1; } +NotificationAreaStyle.Landscape { + minimum-size: 49.2mm 0; + maximum-size: 49.2mm -1; +} + MAbstractLayoutPolicyStyle#NotificationAreaBannerLayoutPolicy { vertical-spacing: 0.8mm; margin-left: 0; @@ -35,29 +30,16 @@ MButtonStyle#NotificationAreaClearButton { } MButtonStyle#NotificationAreaClearButtonVisible { - margin-bottom: 40; - minimum-size: 70% $SIZE_BUTTON; - maximum-size: 70% $SIZE_BUTTON; - text-color: $CB_FONT_COLOR_INVERTED; - background-image: $CB_BG_INVERTED $CORNER_MARGINS; - horizontal-align: center; -} - -MButtonStyle#NotificationAreaClearButtonVisible:pressed { -background-image:$CB_BG_INVERTED_PRESSED $CORNER_MARGINS; -text-color: $CB_FONT_COLOR_INVERTED_PRESSED; -} -MButtonStyle#NotificationAreaClearButtonVisible:selected { -background-image:$CB_BG_INVERTED_SELECTED $CORNER_MARGINS; -text-color: $CB_FONT_COLOR_INVERTED_SELECTED; -} -MButtonStyle#NotificationAreaClearButtonVisible:disabled { -background-image:$CB_BG_INVERTED_DISABLED $CORNER_MARGINS; -text-color: $CB_FONT_COLOR_INVERTED_DISABLED; + margin-left: 5; + margin-right: 5; + margin-top: 20; + margin-bottom: 20; + minimum-size: 46mm 42; + maximum-size: 46mm 42; } MWidgetStyle#AndMore { - maximum-size: 0 0; + maximum-size: 100% 0; padding-top: 0; padding-bottom: 0; padding-left: 0; @@ -69,7 +51,7 @@ MWidgetStyle#AndMore { } MWidgetStyle#AndMoreVisible { - maximum-size: 0 0; + maximum-size: 100% 0; padding-top: 0; padding-bottom: 0; padding-left: 0; @@ -82,7 +64,7 @@ MWidgetStyle#AndMoreVisible { MLabelStyle#AndMoreLabel { font: $FONT_XSMALL; - color: #000000; + color: #ffffff; } MBannerStyle { diff --git a/themes/style/statusindicatormenu.css b/themes/style/statusindicatormenu.css index 37edbb13..21d146b6 100644 --- a/themes/style/statusindicatormenu.css +++ b/themes/style/statusindicatormenu.css @@ -1,7 +1,19 @@ StatusIndicatorMenuStyle { - padding-top: 0.0mm; + padding-top: 0; + notification-area: true; +} +StatusIndicatorDropDownMenuStyle { + padding-top: 0; notification-area: true; + background-opacity: 0.8; + minimum-size: 100% 0; + maximum-size: 100% 100%; +} + +StatusIndicatorDropDownMenuStyle.Landscape { + minimum-size: 49.2mm 0; + maximum-size: 49.2mm 44.4mm; } MSceneLayerEffect#MenuSceneLayerEffect MWidgetFadeAnimationStyle#In { @@ -32,25 +44,32 @@ StatusIndicatorMenu MWidgetSlideAnimationStyle#Out { origin: "top"; } +MWidgetStyle#StatusIndicatorDropDownMenuExtensionAreaWidget { + background-image: ; +} + +MWidgetStyle#StatusIndicatorDropDownMenuExtensionAreaWidget.Landscape { + minimum-size: 49.2mm 0; + maximum-size: 49.2mm 44.4mm; + background-image: ; +} + MWidgetStyle#StatusIndicatorMenuExtensionAreaWidget { - background-image: "meegotouch-applicationpage-background-inverted"; + background-color: $COLOR_INVERTED_BACKGROUND; } MWidgetStyle#StatusIndicatorMenuContentWidget { - background-image: "meegotouch-applicationpage-background-inverted"; + background-color: $COLOR_INVERTED_BACKGROUND; } MWidgetStyle#CloseButtonArea { - background-image: "meegotouch-applicationpage-background-inverted"; - minimum-size: 100% 10.0mm; - preferred-size: 100% 10.0mm; - maximum-size: 100% 10.0mm; + background-color: $COLOR_INVERTED_BACKGROUND; } MWidgetStyle#StatusIndicatorMenuWindowBackground { - background-image: "meegotouch-applicationpage-background-inverted"; - minimum-size: 480 0; - maximum-size: 480 0; + background-color: $COLOR_INVERTED_BACKGROUND; + minimum-size: 49.2mm 0; + maximum-size: 49.2mm 0; } MStatusBarStyle#StatusIndicatorMenuWindowStatusBar { @@ -94,15 +113,21 @@ MButtonStyle#StatusIndicatorMenuCloseButton { } MOverlayStyle#CloseButtonOverlay { - background-image: "meegotouch-applicationpage-background-inverted"; - minimum-size: 100% 6.4mm; - preferred-size: 100% 6.4mm; - maximum-size: 100% 6.4mm; + background-color: $COLOR_INVERTED_BACKGROUND; + minimum-size: 100% 6mm; + preferred-size: 100% 6mm; + maximum-size: 100% 6mm; offset: 0 0; vertical-align: bottom; horizontal-align: left; } +MApplicationExtensionAreaStyle#StatusIndicatorDropDownMenuExtensionArea { + background-image: ; + layout-orientation: vertical; + container-mode: false; +} + MPannableWidgetStyle#StatusIndicatorMenuViewport { margin-left: 0; margin-right: 0; @@ -115,98 +140,11 @@ MPannableWidgetStyle#StatusIndicatorMenuViewport { minimum-size: -1 -1; preferred-size: -1 -1; maximum-size: -1 -1; - background-image: "meegotouch-applicationpage-background-inverted"; -} - -MContainerStyle#MExtensionAreaInvisibleContainer { - background-image: ; -} - -MWidgetStyle#StatusBarLandscapeWidget { - padding-left: 0.4mm; - padding-right: 0.4mm; - padding-top: 0.4mm; -} - -MWidgetStyle#StatusBarPortraitWidget { - padding-left: 0.4mm; - padding-right: 0.4mm; - padding-top: 0.4mm; -} - -MWidgetStyle#StatusBarLandscapeWidgetCall { - background-image: "meegotouch-statusarea-background-call"; - padding-left: 0.4mm; - padding-right: 0.4mm; - padding-top: 0.4mm; -} - -MWidgetStyle#StatusBarPortraitWidgetCall { - background-image: "meegotouch-statusarea-background-call"; - padding-left: 0.4mm; - padding-right: 0.4mm; - padding-top: 0.4mm; -} - -StatusIndicatorMenu MWidgetSlideAnimationStyle#In.Landscape { - origin: "left"; -} - -StatusIndicatorMenu MWidgetSlideAnimationStyle#Out.Landscape { - origin: "left"; -} - -#MenuSceneLayerEffect { - background-image: "meegotouch-statusmenu-dimmer"; -} - -MSceneManagerStyle { - application-menu-animation: "MWidgetSlideAnimation"; -} - -ScreenLockWindowStyle { - locked-orientation: "portrait"; - translucent: true; -} - -MApplicationExtensionAreaStyle#StatusIndicatorMenuTopRowExtensionArea { - padding-left: 0mm; - padding-right: 0mm; - background-image: ; - layout-orientation: vertical; - container-mode: false; background-color: $COLOR_INVERTED_BACKGROUND; } -MApplicationExtensionAreaStyle#StatusIndicatorMenuVerticalExtensionArea { - padding-left: 0mm; - padding-right: 0mm; - background-image: ; - layout-orientation: vertical; - container-mode: false; - background-color: $COLOR_INVERTED_BACKGROUND; -} - -MApplicationExtensionAreaStyle#StatusIndicatorMenuExtensionArea { - padding-left: 0mm; - padding-right: 0mm; +MContainerStyle#MExtensionAreaInvisibleContainer { background-image: ; - layout-orientation: vertical; - container-mode: false; - background-color: $COLOR_INVERTED_BACKGROUND; } -MWidgetZoomAnimationStyle#In { - opacity-animation-delay: 0; - opacity-animation-duration: 500; - opacity-animation-easing-curve: overshotbezier; - - scale-animation-duration: 500; - scale-animation-easing-curve: overshotbezier; - delay: 50; - scale: 0.25; - opacity: 1; - - position-animation-distance-factor: 0; -} From fd9166915d0e59aca684f6d2cd159e2e85240ad1 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sun, 2 Sep 2012 00:25:09 +0600 Subject: [PATCH 14/36] Fix transparency background --- themes/style/statusindicatormenu.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/style/statusindicatormenu.css b/themes/style/statusindicatormenu.css index 21d146b6..7ccff629 100644 --- a/themes/style/statusindicatormenu.css +++ b/themes/style/statusindicatormenu.css @@ -45,13 +45,13 @@ StatusIndicatorMenu MWidgetSlideAnimationStyle#Out { } MWidgetStyle#StatusIndicatorDropDownMenuExtensionAreaWidget { - background-image: ; + background-color: $COLOR_INVERTED_BACKGROUND; } MWidgetStyle#StatusIndicatorDropDownMenuExtensionAreaWidget.Landscape { minimum-size: 49.2mm 0; maximum-size: 49.2mm 44.4mm; - background-image: ; + background-color: $COLOR_INVERTED_BACKGROUND; } MWidgetStyle#StatusIndicatorMenuExtensionAreaWidget { From 465d079e0ae5ebdb9395b1d26d9dce693f34e346 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sun, 2 Sep 2012 11:01:22 +0600 Subject: [PATCH 15/36] Safemode fix for DropDownView --- .../statusindicatormenudropdownview.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp index 44299e86..6596e02c 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp @@ -126,8 +126,14 @@ QGraphicsWidget* StatusIndicatorMenuDropDownView::createTopRow() QStringList order; QRegExp filter; - QFile file("/home/user/.status-menu/top-order.conf"); - if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) + if (QFile(CRASH_FILE).exists()) + { + filter.setPattern("/statusindicatormenu-(volume|safemode|call).desktop$"); + order << "statusindicatormenu-volume.desktop" + << "statusindicatormenu-safemode.desktop" + << "statusindicatormenu-call.desktop"; + } + else if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) { order = QString(file.readAll()).split("\n"); file.close(); @@ -142,13 +148,6 @@ QGraphicsWidget* StatusIndicatorMenuDropDownView::createTopRow() filter.setPattern(QString("/statusindicatormenu-(%1).desktop$").arg(pattern.join("|"))); pattern.clear(); } - else if (QFile(CRASH_FILE).exists()) - { - filter.setPattern("/statusindicatormenu-(volume|safemode|call).desktop$"); - order << "statusindicatormenu-volume.desktop" - << "statusindicatormenu-safemode.desktop" - << "statusindicatormenu-call.desktop"; - } else { filter.setPattern("/statusindicatormenu-(volume|call).desktop$"); From 9342239d3a51dafc6c8040ca970f4ccfd9f4c3bb Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sun, 2 Sep 2012 11:09:37 +0600 Subject: [PATCH 16/36] Missed file declaration --- .../statusindicatormenu/statusindicatormenudropdownview.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp index 6596e02c..0b2a5338 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp @@ -126,6 +126,7 @@ QGraphicsWidget* StatusIndicatorMenuDropDownView::createTopRow() QStringList order; QRegExp filter; + QFile file("/home/user/.status-menu/top-order.conf"); if (QFile(CRASH_FILE).exists()) { filter.setPattern("/statusindicatormenu-(volume|safemode|call).desktop$"); From 35a6833e79db4c265ab3306edeb0d8b21d81fd42 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sun, 2 Sep 2012 12:01:11 +0600 Subject: [PATCH 17/36] Notification clear button fix and small layout fixies --- .../statusindicatormenu/statusindicatormenudropdownview.cpp | 6 +++--- themes/style/notificationarea.css | 6 ++---- themes/style/statusindicatormenu.css | 2 ++ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp index 0b2a5338..ac1a1d54 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp @@ -345,12 +345,12 @@ void StatusIndicatorMenuDropDownView::setPannabilityAndLayout() // Make the pannable area background window extend from the top of the pannable viewport halfway to the bottom of the close button row qreal viewPortYPos = pannableViewport->mapToItem(controller, QPointF()).y(); - qreal backgroundHeight = (closeButtonRowBottomYPos - viewPortYPos) / 2; + qreal backgroundHeight = (closeButtonRowBottomYPos - viewPortYPos); if (backgroundHeight < 0) { backgroundHeight = 0; } - backgroundWidget->setMinimumHeight(closeButtonRowBottomYPos - viewPortYPos); - backgroundWidget->setMaximumHeight(closeButtonRowBottomYPos - viewPortYPos); + backgroundWidget->setMinimumHeight(backgroundHeight); + backgroundWidget->setMaximumHeight(backgroundHeight); } void StatusIndicatorMenuDropDownView::resetViewport() diff --git a/themes/style/notificationarea.css b/themes/style/notificationarea.css index c5326d7d..2989bc6c 100644 --- a/themes/style/notificationarea.css +++ b/themes/style/notificationarea.css @@ -30,12 +30,10 @@ MButtonStyle#NotificationAreaClearButton { } MButtonStyle#NotificationAreaClearButtonVisible { - margin-left: 5; - margin-right: 5; margin-top: 20; margin-bottom: 20; - minimum-size: 46mm 42; - maximum-size: 46mm 42; + minimum-size: 448 42; + maximum-size: 448 42; } MWidgetStyle#AndMore { diff --git a/themes/style/statusindicatormenu.css b/themes/style/statusindicatormenu.css index 7ccff629..0df8744d 100644 --- a/themes/style/statusindicatormenu.css +++ b/themes/style/statusindicatormenu.css @@ -45,6 +45,8 @@ StatusIndicatorMenu MWidgetSlideAnimationStyle#Out { } MWidgetStyle#StatusIndicatorDropDownMenuExtensionAreaWidget { + minimum-size: 480 0; + maximum-size: 480 44.4mm; background-color: $COLOR_INVERTED_BACKGROUND; } From 75d8ff60182ec38f1c31529c9128b8a4f677e830 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Mon, 3 Sep 2012 19:36:45 +0600 Subject: [PATCH 18/36] Fix for DropDownView. Stupid copy/paste mistake --- themes/style/statusindicatormenu.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/style/statusindicatormenu.css b/themes/style/statusindicatormenu.css index 0df8744d..8604d8ee 100644 --- a/themes/style/statusindicatormenu.css +++ b/themes/style/statusindicatormenu.css @@ -8,7 +8,7 @@ StatusIndicatorDropDownMenuStyle { notification-area: true; background-opacity: 0.8; minimum-size: 100% 0; - maximum-size: 100% 100%; + maximum-size: 100% -1; } StatusIndicatorDropDownMenuStyle.Landscape { @@ -46,7 +46,7 @@ StatusIndicatorMenu MWidgetSlideAnimationStyle#Out { MWidgetStyle#StatusIndicatorDropDownMenuExtensionAreaWidget { minimum-size: 480 0; - maximum-size: 480 44.4mm; + maximum-size: 480 -1; background-color: $COLOR_INVERTED_BACKGROUND; } From 853b15a7b7d065a253426777d5f15856d5261a23 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Tue, 4 Sep 2012 01:27:21 +0600 Subject: [PATCH 19/36] Layout fixies --- .../statusindicatormenudropdownview.cpp | 15 ++++++-- themes/style/notificationarea.css | 11 ++---- themes/style/statusindicatormenu.css | 37 +++++++------------ 3 files changed, 28 insertions(+), 35 deletions(-) diff --git a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp index ac1a1d54..0cbdb3ed 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include "statusindicatormenu.h" #include "statusindicatormenudropdownview.h" #include "statusindicatordropdownmenustyle.h" @@ -239,7 +240,11 @@ MPannableViewport* StatusIndicatorMenuDropDownView::createPannableArea() NotificationArea *notificationArea = new NotificationArea; notificationArea->setNotificationManagerInterface(Sysuid::instance()->notificationManagerInterface()); connect(notificationArea, SIGNAL(bannerClicked()), controller, SIGNAL(hideRequested())); - contentLayout->addItem(notificationArea); + MGConfItem *bottomNotifications = new MGConfItem("/desktop/meego/status_menu/bottom_notifications", this); + if (bottomNotifications->value(true).toBool()) + contentLayout->addItem(notificationArea); + else + contentLayout->insertItem(0, notificationArea); } MWidgetController *contentWidget = new MStylableWidget; @@ -263,10 +268,12 @@ MPannableViewport* StatusIndicatorMenuDropDownView::createPannableArea() connect(pannedWidget, SIGNAL(pressedOutSideContents()), controller, SIGNAL(hideRequested())); // Setup the pannable viewport - MPannableViewport *pannableViewport = new MPannableViewport; - pannableViewport->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + MPannableViewport *pannableViewport = new MPannableViewport(); + //pannableViewport->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); pannableViewport->setVerticalPanningPolicy(MPannableWidget::PanningAsNeeded); pannableViewport->setWidget(pannedWidget); + pannableViewport->setStyleName("StatusIndicatorMenuViewport"); + pannableViewport->positionIndicator()->setStyleName("CommonPositionIndicatorInverted"); return pannableViewport; } @@ -376,7 +383,7 @@ void StatusIndicatorMenuDropDownView::applyStyle() layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); layout->addItem(topRowWidget); - layout->addItem(backgroundLayout); + //layout->addItem(backgroundLayout); layout->addItem(pannableViewport); controller->setLayout(layout); } diff --git a/themes/style/notificationarea.css b/themes/style/notificationarea.css index 2989bc6c..daa5a28a 100644 --- a/themes/style/notificationarea.css +++ b/themes/style/notificationarea.css @@ -1,6 +1,6 @@ NotificationAreaStyle { - minimum-size: 100% 0; - maximum-size: 100% -1; + minimum-size: 400 0; + maximum-size: 400 -1; margin-left: 16; margin-top: 0; margin-right: 16; @@ -9,12 +9,9 @@ NotificationAreaStyle { max-banners: -1; } -NotificationAreaStyle.Landscape { - minimum-size: 49.2mm 0; - maximum-size: 49.2mm -1; -} - MAbstractLayoutPolicyStyle#NotificationAreaBannerLayoutPolicy { + minimum-size: 400 0; + maximum-size: 400 -1; vertical-spacing: 0.8mm; margin-left: 0; margin-right: 0; diff --git a/themes/style/statusindicatormenu.css b/themes/style/statusindicatormenu.css index 8604d8ee..e37a6885 100644 --- a/themes/style/statusindicatormenu.css +++ b/themes/style/statusindicatormenu.css @@ -7,13 +7,8 @@ StatusIndicatorDropDownMenuStyle { padding-top: 0; notification-area: true; background-opacity: 0.8; - minimum-size: 100% 0; - maximum-size: 100% -1; -} - -StatusIndicatorDropDownMenuStyle.Landscape { - minimum-size: 49.2mm 0; - maximum-size: 49.2mm 44.4mm; + minimum-size: 480 -1; + maximum-size: 480 -1; } MSceneLayerEffect#MenuSceneLayerEffect MWidgetFadeAnimationStyle#In { @@ -45,14 +40,6 @@ StatusIndicatorMenu MWidgetSlideAnimationStyle#Out { } MWidgetStyle#StatusIndicatorDropDownMenuExtensionAreaWidget { - minimum-size: 480 0; - maximum-size: 480 -1; - background-color: $COLOR_INVERTED_BACKGROUND; -} - -MWidgetStyle#StatusIndicatorDropDownMenuExtensionAreaWidget.Landscape { - minimum-size: 49.2mm 0; - maximum-size: 49.2mm 44.4mm; background-color: $COLOR_INVERTED_BACKGROUND; } @@ -70,8 +57,8 @@ MWidgetStyle#CloseButtonArea { MWidgetStyle#StatusIndicatorMenuWindowBackground { background-color: $COLOR_INVERTED_BACKGROUND; - minimum-size: 49.2mm 0; - maximum-size: 49.2mm 0; + minimum-size: 480 0; + maximum-size: 480 0; } MStatusBarStyle#StatusIndicatorMenuWindowStatusBar { @@ -116,16 +103,18 @@ MButtonStyle#StatusIndicatorMenuCloseButton { MOverlayStyle#CloseButtonOverlay { background-color: $COLOR_INVERTED_BACKGROUND; - minimum-size: 100% 6mm; - preferred-size: 100% 6mm; - maximum-size: 100% 6mm; + minimum-size: 480 6mm; + preferred-size: 480 6mm; + maximum-size: 480 6mm; offset: 0 0; vertical-align: bottom; horizontal-align: left; } MApplicationExtensionAreaStyle#StatusIndicatorDropDownMenuExtensionArea { - background-image: ; + padding-left: 0mm; + padding-right: 0mm; + background-color: $COLOR_INVERTED_BACKGROUND; layout-orientation: vertical; container-mode: false; } @@ -139,9 +128,9 @@ MPannableWidgetStyle#StatusIndicatorMenuViewport { padding-right: 0; padding-top: 0; padding-bottom: 0; - minimum-size: -1 -1; - preferred-size: -1 -1; - maximum-size: -1 -1; + minimum-size: 480 -1; + preferred-size: 480 -1; + maximum-size: 480 -1; background-color: $COLOR_INVERTED_BACKGROUND; } From 8206f327babaf9a1e56c67a8a33da99967d87456 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sat, 8 Sep 2012 12:57:24 +0600 Subject: [PATCH 20/36] Layout fixies --- .../notificationareaview.cpp | 28 ++++---- .../statusindicatormenudropdownview.cpp | 67 ++----------------- .../statusindicatormenudropdownview.h | 12 ---- themes/style/notificationarea.css | 15 +++-- themes/style/statusindicatormenu.css | 19 ++++++ 5 files changed, 51 insertions(+), 90 deletions(-) diff --git a/src/systemui/statusindicatormenu/notificationareaview.cpp b/src/systemui/statusindicatormenu/notificationareaview.cpp index 589c2c6b..ffbbc98e 100644 --- a/src/systemui/statusindicatormenu/notificationareaview.cpp +++ b/src/systemui/statusindicatormenu/notificationareaview.cpp @@ -42,7 +42,7 @@ NotificationAreaView::NotificationAreaView(NotificationArea *controller) : mainLayout->setContentsMargins(0, 0, 0, 0); mainLayout->setSpacing(0); mainLayout->addItem(bannerLayout); - mainLayout->addItem(andMore); + //mainLayout->addItem(andMore); mainLayout->addItem(clearButtonLayout); controller->setLayout(mainLayout); @@ -53,17 +53,17 @@ NotificationAreaView::NotificationAreaView(NotificationArea *controller) : bannerLayout->setPolicy(bannerPolicy); // Create the "and more" area - andMore->setStyleName("AndMore"); - andMore->setVisible(false); + //andMore->setStyleName("AndMore"); + //andMore->setVisible(false); //% "And more" - MLabel *andMoreLabel = new MLabel(qtTrId("qtn_noti_and_more")); - andMoreLabel->setStyleName("AndMoreLabel"); - QGraphicsLinearLayout *andMoreLayout = new QGraphicsLinearLayout(Qt::Horizontal); - andMoreLayout->setContentsMargins(0, 0, 0, 0); - andMoreLayout->setSpacing(0); - andMoreLayout->addStretch(); - andMoreLayout->addItem(andMoreLabel); - andMore->setLayout(andMoreLayout); + //MLabel *andMoreLabel = new MLabel(qtTrId("qtn_noti_and_more")); + //andMoreLabel->setStyleName("AndMoreLabel"); + //QGraphicsLinearLayout *andMoreLayout = new QGraphicsLinearLayout(Qt::Horizontal); + //andMoreLayout->setContentsMargins(0, 0, 0, 0); + //andMoreLayout->setSpacing(0); + //andMoreLayout->addStretch(); + //andMoreLayout->addItem(andMoreLabel); + //andMore->setLayout(andMoreLayout); // Put a clear button into the clear button layout clearButtonLayout->setContentsMargins(0, 0, 0, 0); @@ -120,9 +120,9 @@ void NotificationAreaView::updateLayout() } // If there are more than maximum number of banners to be added show "and more" - bool andMoreVisible = style()->maxBanners() >= 0 && model()->banners().count() > style()->maxBanners(); - andMore->setStyleName(andMoreVisible ? "AndMoreVisible" : "AndMore"); - andMore->setVisible(andMoreVisible); + //bool andMoreVisible = style()->maxBanners() >= 0 && model()->banners().count() > style()->maxBanners(); + //andMore->setStyleName(andMoreVisible ? "AndMoreVisible" : "AndMore"); + //andMore->setVisible(andMoreVisible); // If removable banners exist make the clear button visible clearButton->setStyleName((removableBannersExist && style()->clearButton()) ? "NotificationAreaClearButtonVisible" : "NotificationAreaClearButton"); diff --git a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp index 0cbdb3ed..15b7a6a9 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp @@ -92,15 +92,11 @@ StatusIndicatorMenuDropDownView::StatusIndicatorMenuDropDownView(StatusIndicator fixedPluginsExtensionArea(NULL), statusIndicatorExtensionArea(NULL), pannableViewport(NULL), - closeButtonOverlay(NULL), - backgroundWidget(new MStylableWidget) + closeButtonOverlay(NULL) { // Create close button overlay closeButtonOverlay = createCloseButtonOverlay(); - // Create the pannable area background widget - backgroundWidget->setStyleName("StatusIndicatorMenuWindowBackground"); - connect(controller, SIGNAL(hideRequested()), this, SLOT(resetViewport())); connect(controller, SIGNAL(displayEntered()), SLOT(ensureIsViewable())); @@ -111,7 +107,6 @@ StatusIndicatorMenuDropDownView::StatusIndicatorMenuDropDownView(StatusIndicator StatusIndicatorMenuDropDownView::~StatusIndicatorMenuDropDownView() { - delete backgroundWidget; delete closeButtonOverlay; delete pannableViewport; delete topRowWidget; @@ -123,6 +118,7 @@ QGraphicsWidget* StatusIndicatorMenuDropDownView::createTopRow() fixedPluginsExtensionArea = new MApplicationExtensionArea("com.meego.core.MStatusIndicatorMenuExtensionInterface/1.0"); connect(fixedPluginsExtensionArea, SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)), controller, SLOT(setStatusIndicatorMenuInterface(MApplicationExtensionInterface*))); fixedPluginsExtensionArea->setObjectName("StatusIndicatorDropDownMenuExtensionArea"); + fixedPluginsExtensionArea->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); QStringList order; QRegExp filter; @@ -220,10 +216,6 @@ MApplicationExtensionArea* StatusIndicatorMenuDropDownView::createVerticalExtens return extensionArea; } -void StatusIndicatorMenuDropDownView::setSafeMode(MApplicationExtensionArea *extensionArea, bool enabled) -{ -} - MPannableViewport* StatusIndicatorMenuDropDownView::createPannableArea() { // Create pannable area contents @@ -255,53 +247,24 @@ MPannableViewport* StatusIndicatorMenuDropDownView::createPannableArea() pannableLayout->setContentsMargins(0, 0, 0, 0); pannableLayout->setSpacing(0); pannableLayout->addItem(contentWidget); - //QGraphicsWidget *closeButtonRow = createCloseButtonRow(); - //pannableLayout->addItem(closeButtonRow); - pannableLayout->addStretch(); // Create a container widget for the pannable area PannedWidgetController *pannedWidget = new PannedWidgetController; pannedWidget->setLayout(pannableLayout); - //pannedWidget->setBottommostWidget(closeButtonRow); pannedWidget->setBottommostWidget(contentWidget); connect(pannedWidget, SIGNAL(positionOrSizeChanged()), this, SLOT(setPannabilityAndLayout())); connect(pannedWidget, SIGNAL(pressedOutSideContents()), controller, SIGNAL(hideRequested())); // Setup the pannable viewport MPannableViewport *pannableViewport = new MPannableViewport(); - //pannableViewport->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - pannableViewport->setVerticalPanningPolicy(MPannableWidget::PanningAsNeeded); pannableViewport->setWidget(pannedWidget); - pannableViewport->setStyleName("StatusIndicatorMenuViewport"); + pannableViewport->setVerticalPanningPolicy(MPannableWidget::PanningAlwaysOn); + pannableViewport->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Maximum); + pannableViewport->setStyleName("StatusIndicatorDropDownMenuViewport"); pannableViewport->positionIndicator()->setStyleName("CommonPositionIndicatorInverted"); return pannableViewport; } -QGraphicsWidget* StatusIndicatorMenuDropDownView::createCloseButtonRow() -{ - // Create a close button for the pannable area - MButton *closeButton = new MButton; - closeButton->setViewType("icon"); - closeButton->setObjectName("StatusIndicatorMenuCloseButton"); - closeButton->setIconID("icon-m-framework-close-thumbnail"); - connect(closeButton, SIGNAL(clicked()), controller, SIGNAL(hideRequested())); - - // Add two overlay widgets that will not allow mouse events to pass through them next to the close button - QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal); - layout->setContentsMargins(0, 0, 0, 0); - layout->setSpacing(0); - layout->addItem(new EventEaterWidget); - layout->addItem(closeButton); - layout->addItem(new EventEaterWidget); - - // Create the area itself - MWidgetController *closeButtonArea = new MStylableWidget; - closeButtonArea->setStyleName("CloseButtonArea"); - closeButtonArea->setLayout(layout); - - return closeButtonArea; -} - MOverlay *StatusIndicatorMenuDropDownView::createCloseButtonOverlay() { // Create a close button @@ -340,24 +303,15 @@ void StatusIndicatorMenuDropDownView::setPannabilityAndLayout() { // Appear or disappear the close button overlay based on close area position const QGraphicsWidget *m_bottommostWidget = static_cast(pannableViewport->widget())->bottommostWidget(); - qreal closeButtonRowBottomYPos = m_bottommostWidget->mapToItem(controller, QPointF(0, m_bottommostWidget->geometry().height())).y(); + qreal bottommostWidgetBottomYPos = m_bottommostWidget->mapToItem(controller, QPointF(0, m_bottommostWidget->geometry().height())).y(); if (controller->sceneManager()) { qreal screenHeight = controller->sceneManager()->visibleSceneSize().height(); - if (closeButtonRowBottomYPos <= screenHeight) { + if (bottommostWidgetBottomYPos <= screenHeight) { controller->sceneManager()->disappearSceneWindowNow(closeButtonOverlay); } else { controller->sceneManager()->appearSceneWindowNow(closeButtonOverlay); } } - - // Make the pannable area background window extend from the top of the pannable viewport halfway to the bottom of the close button row - qreal viewPortYPos = pannableViewport->mapToItem(controller, QPointF()).y(); - qreal backgroundHeight = (closeButtonRowBottomYPos - viewPortYPos); - if (backgroundHeight < 0) { - backgroundHeight = 0; - } - backgroundWidget->setMinimumHeight(backgroundHeight); - backgroundWidget->setMaximumHeight(backgroundHeight); } void StatusIndicatorMenuDropDownView::resetViewport() @@ -370,12 +324,6 @@ void StatusIndicatorMenuDropDownView::applyStyle() MSceneWindowView::applyStyle(); if (pannableViewport == NULL) { - QGraphicsAnchorLayout *backgroundLayout = new QGraphicsAnchorLayout; - backgroundLayout->setContentsMargins(0, 0, 0, 0); - backgroundLayout->setSpacing(0); - backgroundLayout->addCornerAnchors(backgroundWidget, Qt::TopLeftCorner, backgroundLayout, Qt::TopLeftCorner); - backgroundLayout->setMaximumHeight(0); - // Put all the stuff into the scene window layout pannableViewport = createPannableArea(); topRowWidget = createTopRow(); @@ -383,7 +331,6 @@ void StatusIndicatorMenuDropDownView::applyStyle() layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); layout->addItem(topRowWidget); - //layout->addItem(backgroundLayout); layout->addItem(pannableViewport); controller->setLayout(layout); } diff --git a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h index 2613e798..a3fc653a 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h @@ -156,11 +156,6 @@ private slots: //! Extension area for pannable area plugins MApplicationExtensionArea* createVerticalExtensionArea(); - /*! - * Sets whether or not non-official plugins will be loaded - */ - void setSafeMode(MApplicationExtensionArea *extensionArea, bool enabled); - //! The pannable area viewport MPannableViewport *pannableViewport; @@ -176,16 +171,9 @@ private slots: //! Creates pannable area MPannableViewport *createPannableArea(); - //! Creates close button row - QGraphicsWidget *createCloseButtonRow(); - //! Creates close button overlay MOverlay *createCloseButtonOverlay(); - //! Pannable area background widget - MWidgetController *backgroundWidget; - - #ifdef UNIT_TEST friend class Ut_StatusIndicatorMenuDropDownView; #endif diff --git a/themes/style/notificationarea.css b/themes/style/notificationarea.css index daa5a28a..e68be2d9 100644 --- a/themes/style/notificationarea.css +++ b/themes/style/notificationarea.css @@ -27,10 +27,17 @@ MButtonStyle#NotificationAreaClearButton { } MButtonStyle#NotificationAreaClearButtonVisible { - margin-top: 20; - margin-bottom: 20; - minimum-size: 448 42; - maximum-size: 448 42; + margin-top: 10; + margin-bottom: 20; + minimum-size: 448 42; + maximum-size: 448 42; + text-color: #ffffff; + background-image: meegotouch-button-inverted-background $CORNER_MARGINS; +} + +MButtonStyle#NotificationAreaClearButtonVisible:pressed { + background-image: meegotouch-button-inverted-background-pressed $CORNER_MARGINS; + text-color: #797979; } MWidgetStyle#AndMore { diff --git a/themes/style/statusindicatormenu.css b/themes/style/statusindicatormenu.css index e37a6885..840ae597 100644 --- a/themes/style/statusindicatormenu.css +++ b/themes/style/statusindicatormenu.css @@ -134,6 +134,25 @@ MPannableWidgetStyle#StatusIndicatorMenuViewport { background-color: $COLOR_INVERTED_BACKGROUND; } +MPannableWidgetStyle#StatusIndicatorDropDownMenuViewport { + margin-left: 0; + margin-right: 0; + margin-top: 0; + margin-bottom: 0; + padding-left: 0; + padding-right: 0; + padding-top: 0; + padding-bottom: 0; + minimum-size: 480 -1; + preferred-size: 480 -1; + maximum-size: 480 -1; + background-color: $COLOR_INVERTED_BACKGROUND; +} + +MPannableWidgetStyle#StatusIndicatorDropDownMenuViewport { + background-color: $COLOR_INVERTED_BACKGROUND; +} + MContainerStyle#MExtensionAreaInvisibleContainer { background-image: ; } From ad59092ee11c57d30200eafdf1f508d689861f1f Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sat, 8 Sep 2012 12:58:50 +0600 Subject: [PATCH 21/36] Don't overwrite existing menu configurations --- debian/rules | 10 +++++----- debian/system-ui.postinst | 12 ++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/debian/rules b/debian/rules index 37c7ebac..939df408 100755 --- a/debian/rules +++ b/debian/rules @@ -92,10 +92,10 @@ binary-arch: build install dh_installchangelogs $(EXCLUSIONS) dh_installdocs $(EXCLUSIONS) dh_install --sourcedir=debian/tmp $(EXCLUSIONS) - mkdir -p debian/system-ui/home/user/.status-menu - cp -v data/items-order.conf debian/system-ui/home/user/.status-menu/items-order.conf - cp -v data/top-order.conf debian/system-ui/home/user/.status-menu/top-order.conf - cp -v data/pannable-order.conf debian/system-ui/home/user/.status-menu/pannable-order.conf + mkdir -p debian/system-ui/etc/status-menu + cp -v data/items-order.conf debian/system-ui/etc/status-menu/items-order.conf + cp -v data/top-order.conf debian/system-ui/etc/status-menu/top-order.conf + cp -v data/pannable-order.conf debian/system-ui/etc/status-menu/pannable-order.conf # Sigh mkdir -p debian/system-ui/usr/lib/meegotouch/applicationextensions mkdir -p debian/system-ui/usr/share/meegotouch/applicationextensions @@ -107,7 +107,7 @@ binary-arch: build install dh_fixperms $(EXCLUSIONS) dh_makeshlibs $(EXCLUSIONS) dh_installdeb $(EXCLUSIONS) - dh_shlibdeps $(EXCLUSIONS) +# dh_shlibdeps $(EXCLUSIONS) dh_gencontrol $(EXCLUSIONS) dh_md5sums $(EXCLUSIONS) dh_builddeb --destdir=$(DEBDIR) $(EXCLUSIONS) diff --git a/debian/system-ui.postinst b/debian/system-ui.postinst index 3101962e..c601bc60 100755 --- a/debian/system-ui.postinst +++ b/debian/system-ui.postinst @@ -1,5 +1,17 @@ #!/bin/sh +mkdir -p /home/user/.status-menu + +if [ ! -f /home/user/.status-menu/items-order.conf ]; then + cp -v /etc/status-menu/items-order.conf /home/user/.status-menu/ +fi +if [ ! -f /home/user/.status-menu/top-order.conf ]; then + cp -v /etc/status-menu/top-order.conf /home/user/.status-menu/ +fi +if [ ! -f /home/user/.status-menu/pannable-order.conf ]; then + cp -v /etc/status-menu/pannable-order.conf /home/user/.status-menu/ +fi + chown -R user:users /home/user/.status-menu/ if [ -n "`initctl status xsession/sysuid | grep running`" ] From 6e6d3bf510b1264742c6b3a66ec14bd147b44a25 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sat, 8 Sep 2012 14:35:44 +0600 Subject: [PATCH 22/36] Oops, mistake =) --- themes/style/statusindicatormenu.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/themes/style/statusindicatormenu.css b/themes/style/statusindicatormenu.css index 840ae597..44ad27cc 100644 --- a/themes/style/statusindicatormenu.css +++ b/themes/style/statusindicatormenu.css @@ -149,10 +149,6 @@ MPannableWidgetStyle#StatusIndicatorDropDownMenuViewport { background-color: $COLOR_INVERTED_BACKGROUND; } -MPannableWidgetStyle#StatusIndicatorDropDownMenuViewport { - background-color: $COLOR_INVERTED_BACKGROUND; -} - MContainerStyle#MExtensionAreaInvisibleContainer { background-image: ; } From db20e1fcc58ad26eb18a35625c5eae3effcf03ce Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sat, 8 Sep 2012 14:38:25 +0600 Subject: [PATCH 23/36] dh_shlibdeps disabled, so, pushing depends manually. it decrease build time. --- debian/control | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 9fb85c91..d48c2c7d 100644 --- a/debian/control +++ b/debian/control @@ -16,8 +16,7 @@ Conflicts: duistatusindicatormenu Replaces: duistatusindicatormenu, cellular-ui Architecture: any Recommends: pulseaudio-module-meego-mainvolume -Depends: ${shlibs:Depends}, ${misc:Depends}, systemui-l10n-engineering-english, duicontrolpanel-privatemodeapplet, ui-fonts (>=5.6), - usb-moded [armel] +Depends: libc6 (>= 2.4), libcontextsubscriber0 (>= 0.5.39+0m6), libdbus-1-3 (>= 1.0.2), libdbus-glib-1-2 (>= 0.71), libgcc1 (>= 1:4.1.1), libmeegotouchcore0, libmeegotouchextensions0, libmeegotouchviews0, libngf0 (>= 0.20+0m6), libnotificationsystem0, libqmsystem2, libqt4-dbus (>= 4.7.4~git20110517), libqt4-meegographicssystemhelper (>= 4.7.4~git20110517), libqtcore4 (>= 4.7.4~git20110517), libqtgui4 (>= 4.7.4~git20110517), libstdc++6 (>= 4.4.0), libx11-6 (>= 0), libxdamage1 (>= 1:1.1), systemui-l10n-engineering-english, duicontrolpanel-privatemodeapplet, usb-moded Description: Various system user interfaces. System user interface package contains various user interfaces, e.g: - status area From 23caba9927a46668d30798ad7f5050c0bc4dcb40 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sat, 15 Sep 2012 14:57:08 +0600 Subject: [PATCH 24/36] Percentage indicator init fixies and gconf for hiding network (gsm) name --- src/systemui/statusarea/statusindicator.cpp | 91 ++++++++++++--------- src/systemui/statusarea/statusindicator.h | 1 + 2 files changed, 53 insertions(+), 39 deletions(-) diff --git a/src/systemui/statusarea/statusindicator.cpp b/src/systemui/statusarea/statusindicator.cpp index 80b83719..32a122ba 100644 --- a/src/systemui/statusarea/statusindicator.cpp +++ b/src/systemui/statusarea/statusindicator.cpp @@ -306,6 +306,7 @@ BatteryStatusIndicator::BatteryStatusIndicator(ApplicationContext &context, QGra setStyleName(QString(metaObject()->className()) + BATTERY_MODE_POWERSAVE); } + batteryPercentageChanged(); batteryLevelChanged (); } @@ -384,6 +385,7 @@ void BatteryStatusIndicator::batteryPercentageChanged() } else { + batteryLevelChanged(); batteryChargingChanged(); connect(batteryLevel, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged()), Qt::UniqueConnection); connect(batteryCharging, SIGNAL(contentsChanged()), this, SLOT(batteryChargingChanged()), Qt::UniqueConnection); @@ -407,6 +409,9 @@ BatteryPercentageStatusIndicator::BatteryPercentageStatusIndicator(ApplicationCo displayPercentage = new MGConfItem("/desktop/meego/status_area/display_percentage", this); connect(displayPercentage, SIGNAL(valueChanged()), this, SLOT(batteryPercentageChanged())); + + batteryPercentageChanged(); + batteryLevelChanged(); } BatteryPercentageStatusIndicator::~BatteryPercentageStatusIndicator() @@ -435,6 +440,7 @@ void BatteryPercentageStatusIndicator::batteryPercentageChanged() connect(batteryPercentage, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged()), Qt::UniqueConnection); connect(batteryCharging, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged()), Qt::UniqueConnection); connect(batterySaveMode, SIGNAL(contentsChanged()), this, SLOT(batteryLevelChanged()), Qt::UniqueConnection); + batteryLevelChanged(); } else { @@ -552,9 +558,11 @@ PhoneNetworkStatusIndicator::PhoneNetworkStatusIndicator(ApplicationContext &con cellularServiceStatus = createContextItem(context, "Cellular.ServiceStatus"); cellularRegistrationStatus = createContextItem(context, "Cellular.RegistrationStatus"); displayLimitedServiceState = new MGConfItem("/desktop/meego/status_area/display_limited_service_state", this); + displayNetworkName = new MGConfItem("/desktop/meego/status_area/display_network_name", this); connect(networkName, SIGNAL(contentsChanged()), this, SLOT(phoneNetworkChanged())); connect(extendedNetworkName, SIGNAL(contentsChanged()), this, SLOT(phoneNetworkChanged())); connect(displayLimitedServiceState, SIGNAL(valueChanged()), this, SLOT(phoneNetworkChanged())); + connect(displayNetworkName, SIGNAL(valueChanged()), this, SLOT(phoneNetworkChanged())); connect(&networkChangeShowVisitorTimer, SIGNAL(timeout()), this, SLOT(showVisitorNetworkName())); networkChangeShowVisitorTimer.setSingleShot(true); networkChangeShowVisitorTimer.setInterval(3 * 1000); @@ -614,50 +622,55 @@ void PhoneNetworkStatusIndicator::phoneNetworkChanged() networkChangeShowVisitorTimer.stop(); } - // Check whether limited service state displaying is enabled - bool limitedService = false; - bool noCoverage = false; - bool displayLimitedServiceStateEnabled = displayLimitedServiceState->value(true).toBool(); - if (displayLimitedServiceStateEnabled) { - // Limited service state should be displayed: Changes in the cellular service status and registration status are interesting - connect(cellularServiceStatus, SIGNAL(contentsChanged()), this, SLOT(phoneNetworkChanged()), Qt::UniqueConnection); - connect(cellularRegistrationStatus, SIGNAL(contentsChanged()), this, SLOT(phoneNetworkChanged()), Qt::UniqueConnection); - - // Check if there is limited service - limitedService = cellularServiceStatus->value().toString() == "limited-service"; + if (displayNetworkName->value(true).toBool()) + { + // Check whether limited service state displaying is enabled + bool limitedService = false; + bool noCoverage = false; + bool displayLimitedServiceStateEnabled = displayLimitedServiceState->value(true).toBool(); + if (displayLimitedServiceStateEnabled) { + // Limited service state should be displayed: Changes in the cellular service status and registration status are interesting + connect(cellularServiceStatus, SIGNAL(contentsChanged()), this, SLOT(phoneNetworkChanged()), Qt::UniqueConnection); + connect(cellularRegistrationStatus, SIGNAL(contentsChanged()), this, SLOT(phoneNetworkChanged()), Qt::UniqueConnection); + + // Check if there is limited service + limitedService = cellularServiceStatus->value().toString() == "limited-service"; + + // Check if there is no coverage and the device is not in offline mode + noCoverage = cellularServiceStatus->value().toString() == "no-coverage" && cellularRegistrationStatus->value().toString() != "offline"; + } else { + // Limited service state should be displayed: Changes in the cellular service status and registration status are not interesting + disconnect(cellularServiceStatus, SIGNAL(contentsChanged()), this, SLOT(phoneNetworkChanged())); + disconnect(cellularRegistrationStatus, SIGNAL(contentsChanged()), this, SLOT(phoneNetworkChanged())); + } - // Check if there is no coverage and the device is not in offline mode - noCoverage = cellularServiceStatus->value().toString() == "no-coverage" && cellularRegistrationStatus->value().toString() != "offline"; - } else { - // Limited service state should be displayed: Changes in the cellular service status and registration status are not interesting - disconnect(cellularServiceStatus, SIGNAL(contentsChanged()), this, SLOT(phoneNetworkChanged())); - disconnect(cellularRegistrationStatus, SIGNAL(contentsChanged()), this, SLOT(phoneNetworkChanged())); - } - - QString home; - QString visitor; - if (limitedService) { - home = qtTrId("qtn_cell_emergency_calls_only"); - model()->setStylePostfix("LimitedService"); - } else if (noCoverage) { - home = qtTrId("qtn_stat_no_coverage"); - model()->setStylePostfix("LimitedService"); - } else { - home = homeNetwork(); - visitor = visitorNetwork(); - model()->setStylePostfix(""); - } - setValue(home); + QString home; + QString visitor; + if (limitedService) { + home = qtTrId("qtn_cell_emergency_calls_only"); + model()->setStylePostfix("LimitedService"); + } else if (noCoverage) { + home = qtTrId("qtn_stat_no_coverage"); + model()->setStylePostfix("LimitedService"); + } else { + home = homeNetwork(); + visitor = visitorNetwork(); + model()->setStylePostfix(""); + } + setValue(home); - if (visitor.isEmpty() && home.isEmpty()) { - setStyleNameAndUpdate(QString(metaObject()->className()) + "Disabled"); - } else { - setStyleNameAndUpdate(metaObject()->className()); - if (!visitor.isEmpty() && !home.isEmpty() && (home != visitor)) { + if (visitor.isEmpty() && home.isEmpty()) { + setStyleNameAndUpdate(QString(metaObject()->className()) + "Disabled"); + } else { setStyleNameAndUpdate(metaObject()->className()); - networkChangeShowVisitorTimer.start(); + if (!visitor.isEmpty() && !home.isEmpty() && (home != visitor)) { + setStyleNameAndUpdate(metaObject()->className()); + networkChangeShowVisitorTimer.start(); + } } } + else + setStyleNameAndUpdate(QString(metaObject()->className()) + "Disabled"); } void PhoneNetworkStatusIndicator::showVisitorNetworkName() { diff --git a/src/systemui/statusarea/statusindicator.h b/src/systemui/statusarea/statusindicator.h index 9ae4de1a..f92fe640 100644 --- a/src/systemui/statusarea/statusindicator.h +++ b/src/systemui/statusarea/statusindicator.h @@ -407,6 +407,7 @@ private slots: ContextItem *cellularServiceStatus; ContextItem *cellularRegistrationStatus; MGConfItem *displayLimitedServiceState; + MGConfItem *displayNetworkName; QTimer networkChangeShowVisitorTimer; #ifdef UNIT_TEST From f254bc5daa6dc3e4539a39affcad7dbb19fd76e7 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sat, 15 Sep 2012 15:00:57 +0600 Subject: [PATCH 25/36] little fix --- src/systemui/statusarea/statusindicator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/systemui/statusarea/statusindicator.cpp b/src/systemui/statusarea/statusindicator.cpp index 32a122ba..d047dff2 100644 --- a/src/systemui/statusarea/statusindicator.cpp +++ b/src/systemui/statusarea/statusindicator.cpp @@ -670,7 +670,10 @@ void PhoneNetworkStatusIndicator::phoneNetworkChanged() } } else + { + setValue(QString("")); setStyleNameAndUpdate(QString(metaObject()->className()) + "Disabled"); + } } void PhoneNetworkStatusIndicator::showVisitorNetworkName() { From f91f001e3b9ed61db1f4930b93475714627db6c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9?= Date: Sat, 22 Sep 2012 01:46:02 +0600 Subject: [PATCH 26/36] Operator name fix,\nTest for DropDownMenu fix,\npostinst script fix for user mode,\nPreload credentials fix,\nDropDownMenu style fixies --- data/pannable-order.conf | 5 +++ data/top-order.conf | 2 + debian/control | 2 +- debian/system-ui.aegis | 14 +++---- debian/system-ui.postinst | 8 ++-- src/systemui/statusarea/statusindicator.cpp | 13 ++++++- .../statusindicatordropdownmenustyle.h | 39 +++++++++++++++++++ .../statusindicatormenudropdownview.cpp | 1 - .../ut_statusindicatormenudropdownview.cpp | 3 +- 9 files changed, 70 insertions(+), 17 deletions(-) create mode 100644 data/pannable-order.conf create mode 100644 data/top-order.conf create mode 100644 src/systemui/statusindicatormenu/statusindicatordropdownmenustyle.h diff --git a/data/pannable-order.conf b/data/pannable-order.conf new file mode 100644 index 00000000..89f038f1 --- /dev/null +++ b/data/pannable-order.conf @@ -0,0 +1,5 @@ +statusindicatormenu-internetconnection.desktop +statusindicatormenu-bluetooth.desktop +statusindicatormenu-dlna.desktop +statusindicatormenu-presence.desktop +statusindicatormenu-transfer.desktop \ No newline at end of file diff --git a/data/top-order.conf b/data/top-order.conf new file mode 100644 index 00000000..4615ddd6 --- /dev/null +++ b/data/top-order.conf @@ -0,0 +1,2 @@ +statusindicatormenu-volume.desktop +statusindicatormenu-call.desktop \ No newline at end of file diff --git a/debian/control b/debian/control index d48c2c7d..53635dff 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ Conflicts: duistatusindicatormenu Replaces: duistatusindicatormenu, cellular-ui Architecture: any Recommends: pulseaudio-module-meego-mainvolume -Depends: libc6 (>= 2.4), libcontextsubscriber0 (>= 0.5.39+0m6), libdbus-1-3 (>= 1.0.2), libdbus-glib-1-2 (>= 0.71), libgcc1 (>= 1:4.1.1), libmeegotouchcore0, libmeegotouchextensions0, libmeegotouchviews0, libngf0 (>= 0.20+0m6), libnotificationsystem0, libqmsystem2, libqt4-dbus (>= 4.7.4~git20110517), libqt4-meegographicssystemhelper (>= 4.7.4~git20110517), libqtcore4 (>= 4.7.4~git20110517), libqtgui4 (>= 4.7.4~git20110517), libstdc++6 (>= 4.4.0), libx11-6 (>= 0), libxdamage1 (>= 1:1.1), systemui-l10n-engineering-english, duicontrolpanel-privatemodeapplet, usb-moded +Depends: libc6 (>= 2.4), libcontextsubscriber0 (>= 0.5.41+0m7), libdbus-1-3 (>= 1.0.2), libdbus-glib-1-2 (>= 0.71), libgcc1 (>= 1:4.1.1), libmeegotouchcore0, libmeegotouchextensions0, libmeegotouchviews0, libngf0 (>= 0.21+0m6), libnotificationsystem0, libqmsystem2, libqt4-dbus (>= 4.7.4~git20120202), libqt4-meegographicssystemhelper (>= 4.7.4~git20120202), libqtcore4 (>= 4.7.4~git20120202), libqtgui4 (>= 4.7.4~git20120202), libstdc++6 (>= 4.4.0), libx11-6 (>= 0), libxdamage1 (>= 1:1.1), libxfixes3 (>= 1:4.0.1), systemui-l10n-engineering-english, duicontrolpanel-privatemodeapplet, ui-fonts (>= 5.6), usb-moded Description: Various system user interfaces. System user interface package contains various user interfaces, e.g: - status area diff --git a/debian/system-ui.aegis b/debian/system-ui.aegis index f68c0876..5f552c3d 100644 --- a/debian/system-ui.aegis +++ b/debian/system-ui.aegis @@ -4,16 +4,14 @@ - - - - + + + + + + - - - - diff --git a/debian/system-ui.postinst b/debian/system-ui.postinst index c601bc60..7595df6a 100755 --- a/debian/system-ui.postinst +++ b/debian/system-ui.postinst @@ -1,15 +1,15 @@ #!/bin/sh -mkdir -p /home/user/.status-menu +aegis-exec -l -u user "mkdir -p /home/user/.status-menu" if [ ! -f /home/user/.status-menu/items-order.conf ]; then - cp -v /etc/status-menu/items-order.conf /home/user/.status-menu/ + aegis-exec -l -u user "cp -v /etc/status-menu/items-order.conf /home/user/.status-menu/" fi if [ ! -f /home/user/.status-menu/top-order.conf ]; then - cp -v /etc/status-menu/top-order.conf /home/user/.status-menu/ + aegis-exec -l -u user "cp -v /etc/status-menu/top-order.conf /home/user/.status-menu/" fi if [ ! -f /home/user/.status-menu/pannable-order.conf ]; then - cp -v /etc/status-menu/pannable-order.conf /home/user/.status-menu/ + aegis-exec -l -u user "cp -v /etc/status-menu/pannable-order.conf /home/user/.status-menu/" fi chown -R user:users /home/user/.status-menu/ diff --git a/src/systemui/statusarea/statusindicator.cpp b/src/systemui/statusarea/statusindicator.cpp index d047dff2..e536ce38 100644 --- a/src/systemui/statusarea/statusindicator.cpp +++ b/src/systemui/statusarea/statusindicator.cpp @@ -671,13 +671,22 @@ void PhoneNetworkStatusIndicator::phoneNetworkChanged() } else { - setValue(QString("")); + setValue(QString()); setStyleNameAndUpdate(QString(metaObject()->className()) + "Disabled"); } } void PhoneNetworkStatusIndicator::showVisitorNetworkName() { - setValue(visitorNetwork()); + if (displayNetworkName->value(true).toBool()) + { + setValue(visitorNetwork()); + setStyleNameAndUpdate(metaObject()->className()); + } + else + { + setValue(QString()); + setStyleNameAndUpdate(QString(metaObject()->className()) + "Disabled"); + } } InputMethodStatusIndicator::InputMethodStatusIndicator(QGraphicsItem *parent) : diff --git a/src/systemui/statusindicatormenu/statusindicatordropdownmenustyle.h b/src/systemui/statusindicatormenu/statusindicatordropdownmenustyle.h new file mode 100644 index 00000000..e3ab3df8 --- /dev/null +++ b/src/systemui/statusindicatormenu/statusindicatordropdownmenustyle.h @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of systemui. +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it 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. +** +****************************************************************************/ + +#ifndef STATUSINDICATORDROPDOWNMENUWINDOWSTYLE_H +#define STATUSINDICATORDROPDOWNMENUWINDOWSTYLE_H + +#include + +class StatusIndicatorDropDownMenuStyle : public MSceneWindowStyle +{ + Q_OBJECT + M_STYLE(StatusIndicatorDropDownMenuStyle) + + //! controls whether to show a notification area in status indicator menu window + M_STYLE_ATTRIBUTE(bool, notificationArea, NotificationArea) +}; + +class StatusIndicatorDropDownMenuStyleContainer : public MSceneWindowStyleContainer +{ + M_STYLE_CONTAINER(StatusIndicatorDropDownMenuStyle) +}; + +#endif diff --git a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp index 15b7a6a9..aca63cb4 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp @@ -37,7 +37,6 @@ #include #include "statusindicatormenu.h" #include "statusindicatormenudropdownview.h" -#include "statusindicatordropdownmenustyle.h" #include "sysuid.h" const int StatusIndicatorMenuDropDownView::VIEW_INITIALIZATION_DELAY = 30 * 1000; diff --git a/tests/ut_statusindicatormenudropdownview/ut_statusindicatormenudropdownview.cpp b/tests/ut_statusindicatormenudropdownview/ut_statusindicatormenudropdownview.cpp index 823c6f35..3eec8bc4 100644 --- a/tests/ut_statusindicatormenudropdownview/ut_statusindicatormenudropdownview.cpp +++ b/tests/ut_statusindicatormenudropdownview/ut_statusindicatormenudropdownview.cpp @@ -345,7 +345,7 @@ void Ut_StatusIndicatorMenuDropDownView::testSetPannability() void Ut_StatusIndicatorMenuDropDownView::testPannableAreaBackgroundWidget() { - const QGraphicsWidget *closeButtonRow = static_cast(m_subject->pannableViewport->widget())->bottommostWidget(); +/* const QGraphicsWidget *closeButtonRow = static_cast(m_subject->pannableViewport->widget())->bottommostWidget(); // When the pannable viewport has been panned above extension area, the background height should be 0 QRectF pannedWidgetGeometry = m_subject->pannableViewport->widget()->geometry(); @@ -364,6 +364,7 @@ void Ut_StatusIndicatorMenuDropDownView::testPannableAreaBackgroundWidget() expectedHeight = (closeButtonRow->mapToItem(controller, QPointF(0, closeButtonRow->geometry().height())).y() - m_subject->pannableViewport->mapToItem(controller, QPointF()).y()) / 2; QCOMPARE(m_subject->backgroundWidget->minimumHeight(), expectedHeight); QCOMPARE(m_subject->backgroundWidget->maximumHeight(), expectedHeight); +*/ } void Ut_StatusIndicatorMenuDropDownView::testTopRowInitialization() From c36c91e535ec4734f05e5345fdf87c31c53ad656 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sat, 22 Sep 2012 05:05:38 +0600 Subject: [PATCH 27/36] + Extra credentials preload * Check for .status-menu folder --- debian/system-ui.aegis | 5 +++++ debian/system-ui.postinst | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/system-ui.aegis b/debian/system-ui.aegis index 5f552c3d..5983ebf8 100644 --- a/debian/system-ui.aegis +++ b/debian/system-ui.aegis @@ -10,8 +10,13 @@ + + + + + diff --git a/debian/system-ui.postinst b/debian/system-ui.postinst index 7595df6a..a1acfba4 100755 --- a/debian/system-ui.postinst +++ b/debian/system-ui.postinst @@ -1,7 +1,10 @@ #!/bin/sh -aegis-exec -l -u user "mkdir -p /home/user/.status-menu" +chown -R user:users /home/user/.status-menu/ +if [ ! -d /home/user/.status-menu ]; then + aegis-exec -l -u user "mkdir -p /home/user/.status-menu" +fi if [ ! -f /home/user/.status-menu/items-order.conf ]; then aegis-exec -l -u user "cp -v /etc/status-menu/items-order.conf /home/user/.status-menu/" fi From 64e8c67cc4f99ba793b32379272336ae060a50d4 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Sat, 22 Sep 2012 05:12:42 +0600 Subject: [PATCH 28/36] Extra preload credential --- debian/system-ui.aegis | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/system-ui.aegis b/debian/system-ui.aegis index 5983ebf8..e5395204 100644 --- a/debian/system-ui.aegis +++ b/debian/system-ui.aegis @@ -7,11 +7,12 @@ - + + From e3f1eb21180ac40f0b8c4bef78b5d114e91e6fb1 Mon Sep 17 00:00:00 2001 From: VlaoMao Date: Sat, 13 Apr 2013 20:57:45 +0000 Subject: [PATCH 29/36] Added netspeed indicator --- src/systemui/statusarea/speedwrapper.cpp | 219 +++++++++++++++++++++++ src/systemui/statusarea/speedwrapper.h | 72 ++++++++ tests/stubs/netspeedindicator_stub.h | 109 +++++++++++ 3 files changed, 400 insertions(+) create mode 100644 src/systemui/statusarea/speedwrapper.cpp create mode 100644 src/systemui/statusarea/speedwrapper.h create mode 100644 tests/stubs/netspeedindicator_stub.h diff --git a/src/systemui/statusarea/speedwrapper.cpp b/src/systemui/statusarea/speedwrapper.cpp new file mode 100644 index 00000000..92e97816 --- /dev/null +++ b/src/systemui/statusarea/speedwrapper.cpp @@ -0,0 +1,219 @@ +#include "speedwrapper.h" + +SpeedWrapper::SpeedWrapper(QObject *parent) : + QObject(parent), + m_tx_speed(0.0), + m_rx_speed(0.0), + m_bytes_data(0,0,0,0), + m_is_enabled(true), + m_speed_interface("wlan0"), + m_update_time(1000), + m_network_interface_valid(false), + m_isOnline(false) +{ + m_gconf_enabled = new MGConfItem("/desktop/meego/status_area/display_netspeed",this); + m_gconf_speed_interface = new MGConfItem("/desktop/meego/status_area/netspeed_interface",this); + m_gconf_update_time = new MGConfItem("/desktop/meego/status_area/netspeed_update_time",this); + m_gconf_when_online = new MGConfItem("/desktop/meego/status_area/display_netspeed_whenOnline",this); + m_network_conf_manager = new QNetworkConfigurationManager(this); + + m_timer = new QTimer(this); + + connect(m_timer,SIGNAL(timeout()),SLOT(updateData())); + connect(m_gconf_enabled,SIGNAL(valueChanged()),SLOT(gconf_value_changed())); + connect(m_gconf_speed_interface,SIGNAL(valueChanged()),SLOT(gconf_value_changed())); + connect(m_gconf_update_time,SIGNAL(valueChanged()),SLOT(gconf_value_changed())); + connect(m_gconf_when_online,SIGNAL(valueChanged()),SLOT(gconf_value_changed())); + connect(m_network_conf_manager,SIGNAL(onlineStateChanged(bool)),SLOT(onlineUpdate(bool))); + + m_network_conf_manager->updateConfigurations(); + gconf_value_changed(); +} + +SpeedWrapper::~SpeedWrapper() +{ + +} + +void SpeedWrapper::updateData() +{ + bool ok; + rxtxBytes bytes = getIfaceStat(m_speed_interface,&ok); + if(ok) + { + //ok + m_bytes_data.oldRxBytes = m_bytes_data.newRxBytes; + m_bytes_data.oldTxBytes = m_bytes_data.newTxBytes; + + m_bytes_data.newRxBytes = bytes.rxBytes; + m_bytes_data.newTxBytes = bytes.txBytes; + + //TODO: Values changed? + + float update_time = m_update_time; + + m_rx_speed = ((m_bytes_data.newRxBytes - m_bytes_data.oldRxBytes) / (update_time / 1000)); + m_tx_speed = ((m_bytes_data.newTxBytes - m_bytes_data.oldTxBytes) / (update_time / 1000)); + + emit dataChanged(); + } +} + +float SpeedWrapper::getRxSpeed() const +{ + return m_rx_speed; +} + +float SpeedWrapper::getTxSpeed() const +{ + return m_tx_speed; +} + +bool SpeedWrapper::isOnline() const +{ + return m_isOnline; +} +void SpeedWrapper::gconf_value_changed() +{ + bool ok; + //check netspeed enabled + if(!m_gconf_enabled->value().isValid()) + m_gconf_enabled->set(true); + //check netspeed interface + if(!m_gconf_speed_interface->value().isValid()) + m_gconf_speed_interface->set("wlan0"); + //check netspeed update time + if(!m_gconf_update_time->value().isValid()) + m_gconf_update_time->set(1000); + //check when online + if(!m_gconf_when_online->value().isValid()) + m_gconf_when_online->set(false); + + + m_is_enabled = m_gconf_enabled->value().toBool(); + m_speed_interface = m_gconf_speed_interface->value().toString(); + m_when_online = m_gconf_when_online->value().toBool(); + + if(m_speed_interface.isEmpty() || m_speed_interface.isNull()) + m_speed_interface = "wlan0"; + m_update_time = m_gconf_update_time->value().toInt(&ok); + if(!ok) + m_update_time = 1000; + + QNetworkInterface interface = QNetworkInterface::interfaceFromName(m_speed_interface); + m_network_interface_valid = interface.isValid(); + bool online = (interface.flags().testFlag(QNetworkInterface::IsUp) && + interface.flags().testFlag(QNetworkInterface::IsRunning)); + if(online != m_isOnline) + { + emit onlineChanged(online); + updateData(); + } + m_isOnline = online; + + if(m_is_enabled) + { + if(m_when_online) + { + if(m_isOnline) + { + m_timer->stop(); + m_timer->start(m_update_time); + }else{ + m_timer->stop(); + } + }else{ + m_timer->stop(); + m_timer->start(m_update_time); + } + }else{ + m_timer->stop(); + } +} + +QString SpeedWrapper::getTxSpeedStr() +{ + return fmtWrapper(m_tx_speed); +} + +QString SpeedWrapper::getRxSpeedStr() +{ + return fmtWrapper(m_rx_speed); +} + +QString SpeedWrapper::fmtWrapper(float in) +{ + QString wrapperStr; + if((in / 1024) <= 1) + { + wrapperStr.sprintf("%.1fK",in / 1024); + } + else + { + if((in / (MByte)) <= 1) + wrapperStr.sprintf("%.1fK",in / 1024); + else + wrapperStr.sprintf("%.1fM",in / (MByte)); + } + if((m_network_interface_valid) && (in > 0)) + return wrapperStr; + else + return QString("-"); +} + +void SpeedWrapper::onlineUpdate(bool) +{ + m_network_conf_manager->updateConfigurations(); + gconf_value_changed(); +} + +rxtxBytes SpeedWrapper::getIfaceStat(QString ifaceName, bool *ok) +{ + QFile file(StatFile); + int pos = 0; + QString rx; + QString tx; + rxtxBytes bytes; + *ok = false; + + if(!file.open(QIODevice::ReadOnly)) + return bytes; + QTextStream stream(&file); + QString s = stream.readAll(); + file.close(); + + QRegExp ifaceExp = QRegExp("(\\w+:)"); + QRegExp rxExp = QRegExp("\\d+"); + QRegExp passExp = QRegExp("(\\W+\\d+){7}"); + + while((pos = ifaceExp.indexIn(s,pos)) != -1) + { + pos += ifaceExp.matchedLength(); + QString iface = ifaceExp.cap(); + if(iface == ifaceName + ":") + { + pos = rxExp.indexIn(s,pos); + rx = rxExp.cap(); + pos += rxExp.matchedLength(); + pos = passExp.indexIn(s,pos); + pos += passExp.matchedLength(); + rxExp.indexIn(s,pos); + tx = rxExp.cap(); + } + } + + if((rx.isEmpty()) || (tx.isEmpty())) + { + *ok = false; + return bytes; + } + bytes.rxBytes = strtoull(qPrintable(rx),0,10); + bytes.txBytes = strtoull(qPrintable(tx),0,10); + if((bytes.rxBytes == ULLONG_MAX) || bytes.txBytes == ULLONG_MAX) + { + *ok = false; + return bytes; + } + *ok = true; + return bytes; +} diff --git a/src/systemui/statusarea/speedwrapper.h b/src/systemui/statusarea/speedwrapper.h new file mode 100644 index 00000000..bcb820fc --- /dev/null +++ b/src/systemui/statusarea/speedwrapper.h @@ -0,0 +1,72 @@ +#ifndef SPEEDWRAPPER_H +#define SPEEDWRAPPER_H + +#include +#include +#include +#include +#include +#include + +#define MByte 1024*1024 +#define StatFile "/proc/net/dev" + +struct bytes_data +{ + float oldRxBytes; + float oldTxBytes; + float newTxBytes; + float newRxBytes; + bytes_data(unsigned long long oldRx,unsigned long long oldTx,unsigned long long newRx,unsigned long long newTx) + : oldRxBytes(oldRx), + oldTxBytes(oldTx), + newRxBytes(newRx), + newTxBytes(newTx) + {} +}; + +typedef struct +{ + unsigned long long rxBytes; + unsigned long long txBytes; +} rxtxBytes; + +class SpeedWrapper : public QObject +{ + Q_OBJECT +public: + explicit SpeedWrapper(QObject *parent = 0); + virtual ~SpeedWrapper(); + float getTxSpeed() const; + float getRxSpeed() const; + QString getTxSpeedStr(); + QString getRxSpeedStr(); + QString fmtWrapper(float); + bool isOnline() const; +signals: + void dataChanged(); + void onlineChanged(bool); +private slots: + void updateData(); + void gconf_value_changed(); + void onlineUpdate(bool); + rxtxBytes getIfaceStat(QString ifaceName,bool *ok); +private: + QTimer *m_timer; + float m_tx_speed; + float m_rx_speed; + struct bytes_data m_bytes_data; + MGConfItem *m_gconf_enabled; + MGConfItem *m_gconf_speed_interface; + MGConfItem *m_gconf_update_time; + MGConfItem *m_gconf_when_online; + bool m_is_enabled; + bool m_network_interface_valid; + bool m_when_online; + bool m_isOnline; + int m_update_time; + QString m_speed_interface; + QNetworkConfigurationManager *m_network_conf_manager; +}; + +#endif // SPEEDWRAPPER_H diff --git a/tests/stubs/netspeedindicator_stub.h b/tests/stubs/netspeedindicator_stub.h new file mode 100644 index 00000000..1cad52a1 --- /dev/null +++ b/tests/stubs/netspeedindicator_stub.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of systemui. +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it 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. +** +****************************************************************************/ +#ifndef NETSPEEDINDICATOR_STUB +#define NETSPEEDINDICATOR_STUB + +#include "statusindicator_stub.h" +#include + +#ifdef HAVE_QMSYSTEM +#include +#endif + +// 1. DECLARE STUB +// FIXME - stubgen is not yet finished +class NetSpeedIndicatorStub : public StubBase +{ +public: + virtual void NetSpeedIndicatorConstructor(ApplicationContext &context, QGraphicsItem *parent); + virtual void NetSpeedIndicatorDestructor(); + virtual void gconf_enable_changed(); + virtual void gconf_when_online_changed(); + virtual void updateStatusIndicator(); + virtual void onlineChanged(bool); +}; + +// 2. IMPLEMENT STUB +void NetSpeedIndicatorStub::NetSpeedIndicatorConstructor(ApplicationContext &context, QGraphicsItem *parent) +{ + Q_UNUSED(context); + Q_UNUSED(parent); + +} +void NetSpeedIndicatorStub::NetSpeedIndicatorDestructor() +{ + +} + +void NetSpeedIndicatorStub::gconf_enable_changed() +{ + stubMethodEntered("gconf_enable_changed"); +} + +void NetSpeedIndicatorStub::gconf_when_online_changed() +{ + stubMethodEntered("gconf_when_online_changed"); +} + +void NetSpeedIndicatorStub::updateStatusIndicator() +{ + stubMethodEntered("updateStatusIndicator"); +} + +void NetSpeedIndicatorStub::onlineChanged(bool) +{ + stubMethodEntered("onlineChanged"); +} + +// 3. CREATE A STUB INSTANCE +NetSpeedIndicatorStub gDefaultNetSpeedIndicatorStub; +NetSpeedIndicatorStub *gNetSpeedIndicatorStub = &gDefaultNetSpeedIndicatorStub; + + +// 4. CREATE A PROXY WHICH CALLS THE STUB +NetSpeedIndicator::NetSpeedIndicator(ApplicationContext &context, QGraphicsItem *parent) +{ + gNetSpeedIndicatorStub->NetSpeedIndicatorConstructor(context, parent); +} + +NetSpeedIndicator::~NetSpeedIndicator() +{ + gNetSpeedIndicatorStub->NetSpeedIndicatorDestructor(); +} + +void NetSpeedIndicator::gconf_enable_changed() +{ + gNetSpeedIndicatorStub->gconf_enable_changed(); +} + +void NetSpeedIndicator::gconf_when_online_changed() +{ + gNetSpeedIndicatorStub->gconf_when_online_changed(); +} + +void NetSpeedIndicator::updateStatusIndicator() +{ + gNetSpeedIndicatorStub->updateStatusIndicator(); +} + +void NetSpeedIndicator::onlineChanged(bool e) +{ + gNetSpeedIndicatorStub->onlineChanged(e); +} +#endif // NETSPEEDINDICATOR_STUB From f33b5da8789447e158b22ba311f856a4b960babc Mon Sep 17 00:00:00 2001 From: VlaoMao Date: Sat, 13 Apr 2013 21:01:23 +0000 Subject: [PATCH 30/36] Modified files --- src/systemui/statusarea/speedwrapper.cpp | 4 + src/systemui/statusarea/speedwrapper.h | 4 + src/systemui/statusarea/statusarea.pri | 6 +- src/systemui/statusarea/statusareaview.cpp | 7 ++ src/systemui/statusarea/statusareaview.h | 4 + src/systemui/statusarea/statusindicator.cpp | 86 +++++++++++++++++++ src/systemui/statusarea/statusindicator.h | 29 ++++++- .../statusarea/statusindicatormodel.h | 4 + .../ut_lockscreenstatusareaview.cpp | 1 + tests/ut_statusareaview/ut_statusareaview.cpp | 1 + themes/style/statusarea.css | 7 ++ themes/sysuid.conf | 3 + 12 files changed, 153 insertions(+), 3 deletions(-) diff --git a/src/systemui/statusarea/speedwrapper.cpp b/src/systemui/statusarea/speedwrapper.cpp index 92e97816..4bb4f6c5 100644 --- a/src/systemui/statusarea/speedwrapper.cpp +++ b/src/systemui/statusarea/speedwrapper.cpp @@ -1,5 +1,7 @@ #include "speedwrapper.h" +#ifndef UNIT_TEST + SpeedWrapper::SpeedWrapper(QObject *parent) : QObject(parent), m_tx_speed(0.0), @@ -217,3 +219,5 @@ rxtxBytes SpeedWrapper::getIfaceStat(QString ifaceName, bool *ok) *ok = true; return bytes; } + +#endif diff --git a/src/systemui/statusarea/speedwrapper.h b/src/systemui/statusarea/speedwrapper.h index bcb820fc..bf60f452 100644 --- a/src/systemui/statusarea/speedwrapper.h +++ b/src/systemui/statusarea/speedwrapper.h @@ -1,6 +1,8 @@ #ifndef SPEEDWRAPPER_H #define SPEEDWRAPPER_H +#ifndef UNIT_TEST + #include #include #include @@ -23,6 +25,7 @@ struct bytes_data newRxBytes(newRx), newTxBytes(newTx) {} + bytes_data(){} }; typedef struct @@ -68,5 +71,6 @@ private slots: QString m_speed_interface; QNetworkConfigurationManager *m_network_conf_manager; }; +#endif #endif // SPEEDWRAPPER_H diff --git a/src/systemui/statusarea/statusarea.pri b/src/systemui/statusarea/statusarea.pri index 4bb96018..989189dc 100644 --- a/src/systemui/statusarea/statusarea.pri +++ b/src/systemui/statusarea/statusarea.pri @@ -11,7 +11,8 @@ SOURCES += statusarea/statusarea.cpp \ statusarea/statusindicatoriconview.cpp \ statusarea/statusindicator.cpp \ statusarea/inputmethodstatusindicatoradaptor.cpp \ - statusarea/statusarearendereradaptor.cpp + statusarea/statusarearendereradaptor.cpp \ + statusarea/speedwrapper.cpp HEADERS += statusarea/statusarea.h \ statusarea/statusareaview.h \ statusarea/statusarearenderer.h \ @@ -30,7 +31,8 @@ HEADERS += statusarea/statusarea.h \ statusarea/statusindicatoriconstyle.h \ statusarea/statusindicator.h \ statusarea/inputmethodstatusindicatoradaptor.h \ - statusarea/statusarearendereradaptor.h + statusarea/statusarearendereradaptor.h \ + statusarea/speedwrapper.h MODEL_HEADERS += statusarea/statusareamodel.h \ statusarea/clockmodel.h \ statusarea/statusindicatormodel.h diff --git a/src/systemui/statusarea/statusareaview.cpp b/src/systemui/statusarea/statusareaview.cpp index cdf8c422..80ff93eb 100644 --- a/src/systemui/statusarea/statusareaview.cpp +++ b/src/systemui/statusarea/statusareaview.cpp @@ -72,6 +72,8 @@ StatusAreaView::StatusAreaView(StatusArea *controller) : portraitTransferStatusIndicator(new TransferStatusIndicator(controller)), landscapeClock(new Clock(controller)), portraitClock(new Clock(controller)), + landscapeNetSpeedIndicator(new NetSpeedIndicator(contextFrameworkContext,controller)), + portraitNetSpeedIndicator(new NetSpeedIndicator(contextFrameworkContext,controller)), callContextItem(contextFrameworkContext.createContextItem("Phone.Call")) { // Set the style names of the landscape and portrait widgets when the call state changes @@ -153,6 +155,9 @@ void StatusAreaView::setupTestability() portraitDLNAIndicator->setParent(portraitWidget); landscapeTransferStatusIndicator->setParent(landscapeWidget); portraitTransferStatusIndicator->setParent(portraitWidget); + //! NetSpeed + portraitNetSpeedIndicator->setParent(portraitWidget); + landscapeNetSpeedIndicator->setParent(landscapeWidget); } StatusAreaView::~StatusAreaView() @@ -184,6 +189,7 @@ QGraphicsLinearLayout* StatusAreaView::createLandscapeLayout() layout->addItem(landscapePhoneNetworkIndicator); layout->addItem(landscapePhoneNetworkTypeIndicator); layout->addStretch(); + layout->addItem(landscapeNetSpeedIndicator); layout->addItem(landscapeNotificationIndicator); layout->addItem(landscapeTransferStatusIndicator); layout->addItem(landscapeCallIndicator); @@ -214,6 +220,7 @@ QGraphicsLinearLayout* StatusAreaView::createPortraitLayout() layout->addItem(portraitPhoneNetworkIndicator); layout->addItem(portraitPhoneNetworkTypeIndicator); layout->addStretch(); + layout->addItem(portraitNetSpeedIndicator); layout->addItem(portraitNotificationIndicator); layout->addItem(portraitTransferStatusIndicator); layout->addItem(portraitCallIndicator); diff --git a/src/systemui/statusarea/statusareaview.h b/src/systemui/statusarea/statusareaview.h index c16bdc35..a9379802 100644 --- a/src/systemui/statusarea/statusareaview.h +++ b/src/systemui/statusarea/statusareaview.h @@ -147,6 +147,10 @@ private slots: Clock *landscapeClock; Clock *portraitClock; + //! Test + StatusIndicator *landscapeNetSpeedIndicator; + StatusIndicator *portraitNetSpeedIndicator; + //! Call state context framework key ContextItem *callContextItem; diff --git a/src/systemui/statusarea/statusindicator.cpp b/src/systemui/statusarea/statusindicator.cpp index e536ce38..94da5e22 100644 --- a/src/systemui/statusarea/statusindicator.cpp +++ b/src/systemui/statusarea/statusindicator.cpp @@ -916,3 +916,89 @@ void DLNAStatusIndicator::dlnaEnabledChanged() { setStyleNameAndUpdate(QString(metaObject()->className()) + (dlnaEnabled->value().toBool() ? "Set" : "")); } + +NetSpeedIndicator::NetSpeedIndicator(ApplicationContext &context, QGraphicsItem *parent) : + StatusIndicator(parent), + testIndicator(createContextItem(context,"Test.TestIndicatorPercentage")), + m_isEnabled(false), + m_isOnline(false), + m_when_online(false) +{ + setStyleNameAndUpdate(metaObject()->className()); + +#ifndef UNIT_TEST + m_speedWrapper = new SpeedWrapper(this); +#endif + m_enabled = new MGConfItem("/desktop/meego/status_area/display_netspeed",this); + m_gconf_when_online = new MGConfItem("/desktop/meego/status_area/display_netspeed_whenOnline",this); + +#ifndef UNIT_TEST + connect(m_speedWrapper,SIGNAL(dataChanged()),SLOT(updateStatusIndicator())); + connect(m_speedWrapper,SIGNAL(onlineChanged(bool)),SLOT(onlineChanged(bool))); +#endif + connect(testIndicator,SIGNAL(contentsChanged()),this,SLOT(updateStatusIndicator())); + connect(m_enabled,SIGNAL(valueChanged()),SLOT(gconf_enable_changed())); + connect(m_gconf_when_online,SIGNAL(valueChanged()),SLOT(gconf_when_online_changed())); + +#ifndef UNIT_TEST + m_isOnline = m_speedWrapper->isOnline(); +#endif + + gconf_when_online_changed(); + updateStatusIndicator(); +} +NetSpeedIndicator::~NetSpeedIndicator() +{ + +} + +void NetSpeedIndicator::updateStatusIndicator() +{ +#ifndef UNIT_TEST + if(m_isEnabled) + { + QString rx = m_speedWrapper->getRxSpeedStr(); + QString tx = m_speedWrapper->getTxSpeedStr(); + QString percent = + QString::fromLocal8Bit("↓") + + rx + + "/" + + QString::fromLocal8Bit("↑") + + tx; + setValue(percent); + } +#endif +} + +void NetSpeedIndicator::gconf_enable_changed() +{ + m_isEnabled = m_enabled->value().toBool(); + if(m_isEnabled) + { + if(m_when_online) + { + if(m_isOnline) + setStyleNameAndUpdate(QString(metaObject()->className())); + else + setStyleNameAndUpdate(QString(metaObject()->className()) + "Disabled"); + }else{ + setStyleNameAndUpdate(QString(metaObject()->className())); + } + } + else + { + setStyleNameAndUpdate(QString(metaObject()->className()) + "Disabled"); + } +} + +void NetSpeedIndicator::gconf_when_online_changed() +{ + m_when_online = m_gconf_when_online->value().toBool(); + gconf_enable_changed(); +} + +void NetSpeedIndicator::onlineChanged(bool online) +{ + m_isOnline = online; + gconf_enable_changed(); +} diff --git a/src/systemui/statusarea/statusindicator.h b/src/systemui/statusarea/statusindicator.h index f92fe640..73b28344 100644 --- a/src/systemui/statusarea/statusindicator.h +++ b/src/systemui/statusarea/statusindicator.h @@ -23,6 +23,7 @@ #include #include #include "statusindicatormodel.h" +#include "speedwrapper.h" #include #ifdef HAVE_QMSYSTEM @@ -186,7 +187,7 @@ private slots: class PhoneNetworkTypeStatusIndicator : public StatusIndicator { Q_OBJECT - M_CONTROLLER(PhoneNetworkTypeStatusIndicator); + M_CONTROLLER(PhoneNetworkTypeStatusIndicator) public: /*! @@ -672,4 +673,30 @@ private slots: ContextItem *dlnaEnabled; }; + +class NetSpeedIndicator : public StatusIndicator +{ + Q_OBJECT + M_CONTROLLER(NetSpeedIndicator) +public: + explicit NetSpeedIndicator(ApplicationContext &context,QGraphicsItem *parent = NULL); + virtual ~NetSpeedIndicator(); +public slots: + void updateStatusIndicator(); + void onlineChanged(bool); +private slots: + void gconf_enable_changed(); + void gconf_when_online_changed(); +private: + ContextItem *testIndicator; +#ifndef UNIT_TEST + SpeedWrapper *m_speedWrapper; +#endif + MGConfItem *m_enabled; + MGConfItem *m_gconf_when_online; + bool m_isEnabled; + bool m_isOnline; + bool m_when_online; +}; + #endif // STATUSINDICATOR_H diff --git a/src/systemui/statusarea/statusindicatormodel.h b/src/systemui/statusarea/statusindicatormodel.h index 6b3571d1..e5266d15 100644 --- a/src/systemui/statusarea/statusindicatormodel.h +++ b/src/systemui/statusarea/statusindicatormodel.h @@ -118,4 +118,8 @@ class DLNAStatusIndicatorModel : public StatusIndicatorModel M_MODEL(DLNAStatusIndicatorModel) }; +class NetSpeedIndicatorModel : public StatusIndicatorModel +{ + M_MODEL(NetSpeedIndicatorModel) +}; #endif /* STATUSINDICATORMODEL_H_ */ diff --git a/tests/ut_lockscreenstatusareaview/ut_lockscreenstatusareaview.cpp b/tests/ut_lockscreenstatusareaview/ut_lockscreenstatusareaview.cpp index f26cc0a4..0eea85a1 100644 --- a/tests/ut_lockscreenstatusareaview/ut_lockscreenstatusareaview.cpp +++ b/tests/ut_lockscreenstatusareaview/ut_lockscreenstatusareaview.cpp @@ -47,6 +47,7 @@ #include "transferstatusindicator_stub.h" #include "dlnastatusindicator_stub.h" #include "screenlockextension_stub.h" +#include "netspeedindicator_stub.h" #include "x11wrapper.h" #include "notificationsink_stub.h" diff --git a/tests/ut_statusareaview/ut_statusareaview.cpp b/tests/ut_statusareaview/ut_statusareaview.cpp index d2310fe8..8b992c23 100644 --- a/tests/ut_statusareaview/ut_statusareaview.cpp +++ b/tests/ut_statusareaview/ut_statusareaview.cpp @@ -48,6 +48,7 @@ #include "notificationstatusindicatorsink_stub.h" #include "inputmethodstatusindicatoradaptor_stub.h" #include "sysuid_stub.h" +#include "netspeedindicator_stub.h" #include "x11wrapper_modified_stub.h" #include diff --git a/themes/style/statusarea.css b/themes/style/statusarea.css index 883ee442..996f23b1 100644 --- a/themes/style/statusarea.css +++ b/themes/style/statusarea.css @@ -521,6 +521,13 @@ StatusIndicatorLabelStyle#BatteryPercentageStatusIndicatorDisabled { maximum-size: 0 -1; } +StatusIndicatorLabelStyle#NetSpeedIndicatorDisabled { + preferred-size: 0 -1; + minimum-size: 0 -1; + maximum-size: 0 -1; + +} + StatusIndicatorIconStyle#AlarmStatusIndicator { /* The list of IDs of the images to be shown in the status indicator separated by spaces */ image-list: ""; diff --git a/themes/sysuid.conf b/themes/sysuid.conf index 40cf3005..4dd8c17c 100644 --- a/themes/sysuid.conf +++ b/themes/sysuid.conf @@ -32,6 +32,9 @@ default = StatusIndicatorIconView [BatteryPercentageStatusIndicator] default = StatusIndicatorLabelView +[NetSpeedIndicator] +default = StatusIndicatorLabelView + [ClockAlarmStatusIndicator] default = StatusIndicatorIconView From 965490d69074e25d0bbff979b237a50b034d40f8 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Tue, 16 Apr 2013 14:52:33 +0600 Subject: [PATCH 31/36] Battery percentage line at top with color settings --- src/systemui/statusarea/statusareaview.cpp | 5 ++ src/systemui/statusarea/statusareaview.h | 8 +++ src/systemui/statusarea/statusindicator.cpp | 69 +++++++++++++++++++++ src/systemui/statusarea/statusindicator.h | 30 +++++++++ 4 files changed, 112 insertions(+) diff --git a/src/systemui/statusarea/statusareaview.cpp b/src/systemui/statusarea/statusareaview.cpp index 80ff93eb..e220d838 100644 --- a/src/systemui/statusarea/statusareaview.cpp +++ b/src/systemui/statusarea/statusareaview.cpp @@ -119,6 +119,11 @@ StatusAreaView::StatusAreaView(StatusArea *controller) : // Set up the class for functional testing setupTestability(); + +#ifndef UNIT_TEST + landscapeBatteryLine = new BatteryPercentageLine(MDeviceProfile::instance()->resolution().width(), contextFrameworkContext, landscapeWidget); + portraitBatteryLine = new BatteryPercentageLine(MDeviceProfile::instance()->resolution().height(), contextFrameworkContext, portraitWidget); +#endif } void StatusAreaView::setupTestability() diff --git a/src/systemui/statusarea/statusareaview.h b/src/systemui/statusarea/statusareaview.h index a9379802..ee133e05 100644 --- a/src/systemui/statusarea/statusareaview.h +++ b/src/systemui/statusarea/statusareaview.h @@ -31,6 +31,9 @@ class StatusArea; class StatusIndicator; class InputMethodStatusIndicator; class QGraphicsLinearLayout; +#ifndef UNIT_TEST +class BatteryPercentageLine; +#endif /*! * Status area view draws the status area. @@ -151,6 +154,11 @@ private slots: StatusIndicator *landscapeNetSpeedIndicator; StatusIndicator *portraitNetSpeedIndicator; +#ifndef UNIT_TEST + BatteryPercentageLine *landscapeBatteryLine; + BatteryPercentageLine *portraitBatteryLine; +#endif + //! Call state context framework key ContextItem *callContextItem; diff --git a/src/systemui/statusarea/statusindicator.cpp b/src/systemui/statusarea/statusindicator.cpp index 94da5e22..adb73849 100644 --- a/src/systemui/statusarea/statusindicator.cpp +++ b/src/systemui/statusarea/statusindicator.cpp @@ -1002,3 +1002,72 @@ void NetSpeedIndicator::onlineChanged(bool online) m_isOnline = online; gconf_enable_changed(); } + +#ifndef UNIT_TEST +BatteryPercentageLine::BatteryPercentageLine(int maxWidth, ApplicationContext &context, QGraphicsItem *parent = 0): + MImageWidget(parent), + mMaxWidth(maxWidth), + mEnabled(true) +{ + setAspectRatioMode(Qt::IgnoreAspectRatio); + mColorPoint = QPixmap(1, 1); + mColorPoint.fill(QColor(60, 200, 255)); + setPixmap(mColorPoint); + + displayPercentageLine = new MGConfItem("/desktop/meego/status_area/display_percentage_line", this); + if (displayPercentageLine->value().isNull()) + displayPercentageLine->set(true); + connect(displayPercentageLine, SIGNAL(valueChanged()), this, SLOT(displayChanged())); + + redPercentageLine = new MGConfItem("/desktop/meego/status_area/red_percentage_line", this); + if (redPercentageLine->value().isNull()) + redPercentageLine->set(60); + connect(redPercentageLine, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + + greenPercentageLine = new MGConfItem("/desktop/meego/status_area/green_percentage_line", this); + if (greenPercentageLine->value().isNull()) + greenPercentageLine->set(200); + connect(greenPercentageLine, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + + bluePercentageLine = new MGConfItem("/desktop/meego/status_area/blue_percentage_line", this); + if (bluePercentageLine->value().isNull()) + bluePercentageLine->set(255); + connect(bluePercentageLine, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + + batteryPercentage = new ContextProperty("Battery.ChargePercentage", this); + connect(batteryPercentage, SIGNAL(valueChanged()), this, SLOT(batteryLevelChanged())); + batteryLevelChanged(); +} + +BatteryPercentageLine::~BatteryPercentageLine() +{ + disconnect(batteryPercentage, SIGNAL(valueChanged()), this, SLOT(batteryLevelChanged())); +} + +void BatteryPercentageLine::batteryLevelChanged() +{ + if (mEnabled) { + int percentage = batteryPercentage->value().toString().toInt(); + int width = mMaxWidth * percentage / 100; + setGeometry(QRectF(0, 0, width, 1)); + } + else { + setGeometry(QRectF(0,0,0,0)); + } +} + +void BatteryPercentageLine::displayChanged() +{ + mEnabled = displayPercentageLine->value().toBool(); + batteryLevelChanged(); +} + +void BatteryPercentageLine::colorChanged() +{ + int red = redPercentageLine->value().toInt(); + int green = greenPercentageLine->value().toInt(); + int blue = bluePercentageLine->value().toInt(); + mColorPoint.fill(QColor(red, green, blue)); + setPixmap(mColorPoint); +} +#endif diff --git a/src/systemui/statusarea/statusindicator.h b/src/systemui/statusarea/statusindicator.h index 73b28344..533db7c9 100644 --- a/src/systemui/statusarea/statusindicator.h +++ b/src/systemui/statusarea/statusindicator.h @@ -25,6 +25,10 @@ #include "statusindicatormodel.h" #include "speedwrapper.h" #include +#include +#include +#include + #ifdef HAVE_QMSYSTEM #include @@ -699,4 +703,30 @@ private slots: bool m_when_online; }; +#ifndef UNIT_TEST +class BatteryPercentageLine : public MImageWidget +{ + Q_OBJECT + +public: + explicit BatteryPercentageLine(int maxWidth, ApplicationContext &context, QGraphicsItem *parent); + virtual ~BatteryPercentageLine(); + +private slots: + void batteryLevelChanged(); + void displayChanged(); + void colorChanged(); + +private: + QPixmap mColorPoint; + ContextProperty *batteryPercentage; + MGConfItem *displayPercentageLine; + MGConfItem *redPercentageLine; + MGConfItem *greenPercentageLine; + MGConfItem *bluePercentageLine; + int mMaxWidth; + bool mEnabled; +}; +#endif + #endif // STATUSINDICATOR_H From 542215ff1c362cea9f647d41183a54bb0882463d Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Tue, 16 Apr 2013 20:40:17 +0600 Subject: [PATCH 32/36] Fixed behaviour on startup --- src/systemui/statusarea/statusindicator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/systemui/statusarea/statusindicator.cpp b/src/systemui/statusarea/statusindicator.cpp index adb73849..ffd721d5 100644 --- a/src/systemui/statusarea/statusindicator.cpp +++ b/src/systemui/statusarea/statusindicator.cpp @@ -1036,7 +1036,8 @@ BatteryPercentageLine::BatteryPercentageLine(int maxWidth, ApplicationContext &c batteryPercentage = new ContextProperty("Battery.ChargePercentage", this); connect(batteryPercentage, SIGNAL(valueChanged()), this, SLOT(batteryLevelChanged())); - batteryLevelChanged(); + + displayChanged(); } BatteryPercentageLine::~BatteryPercentageLine() @@ -1060,6 +1061,7 @@ void BatteryPercentageLine::displayChanged() { mEnabled = displayPercentageLine->value().toBool(); batteryLevelChanged(); + colorChanged(); } void BatteryPercentageLine::colorChanged() From 63c5770e8b4ddc30de866daa945b72cbc0617bce Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Mon, 8 Jul 2013 18:16:17 +0600 Subject: [PATCH 33/36] Added two thresholds to battery color line --- src/systemui/statusarea/statusindicator.cpp | 64 +++++++++++++++++++-- src/systemui/statusarea/statusindicator.h | 8 +++ 2 files changed, 68 insertions(+), 4 deletions(-) diff --git a/src/systemui/statusarea/statusindicator.cpp b/src/systemui/statusarea/statusindicator.cpp index ffd721d5..b66ab4d9 100644 --- a/src/systemui/statusarea/statusindicator.cpp +++ b/src/systemui/statusarea/statusindicator.cpp @@ -1011,14 +1011,22 @@ BatteryPercentageLine::BatteryPercentageLine(int maxWidth, ApplicationContext &c { setAspectRatioMode(Qt::IgnoreAspectRatio); mColorPoint = QPixmap(1, 1); - mColorPoint.fill(QColor(60, 200, 255)); - setPixmap(mColorPoint); displayPercentageLine = new MGConfItem("/desktop/meego/status_area/display_percentage_line", this); if (displayPercentageLine->value().isNull()) displayPercentageLine->set(true); connect(displayPercentageLine, SIGNAL(valueChanged()), this, SLOT(displayChanged())); + percentageLineL1 = new MGConfItem("/desktop/meego/status_area/percentage_line_level_1", this); + if (percentageLineL1->value().isNull()) + percentageLineL1->set(60); + connect(percentageLineL1, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + + percentageLineL2 = new MGConfItem("/desktop/meego/status_area/percentage_line_level_2", this); + if (percentageLineL2->value().isNull()) + percentageLineL2->set(30); + connect(percentageLineL2, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + redPercentageLine = new MGConfItem("/desktop/meego/status_area/red_percentage_line", this); if (redPercentageLine->value().isNull()) redPercentageLine->set(60); @@ -1034,6 +1042,36 @@ BatteryPercentageLine::BatteryPercentageLine(int maxWidth, ApplicationContext &c bluePercentageLine->set(255); connect(bluePercentageLine, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + redPercentageLine2 = new MGConfItem("/desktop/meego/status_area/red_percentage_line_2", this); + if (redPercentageLine2->value().isNull()) + redPercentageLine2->set(120); + connect(redPercentageLine2, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + + greenPercentageLine2 = new MGConfItem("/desktop/meego/status_area/green_percentage_line_2", this); + if (greenPercentageLine2->value().isNull()) + greenPercentageLine2->set(200); + connect(greenPercentageLine2, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + + bluePercentageLine2 = new MGConfItem("/desktop/meego/status_area/blue_percentage_line_2", this); + if (bluePercentageLine2->value().isNull()) + bluePercentageLine2->set(255); + connect(bluePercentageLine2, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + + redPercentageLine3 = new MGConfItem("/desktop/meego/status_area/red_percentage_line_3", this); + if (redPercentageLine3->value().isNull()) + redPercentageLine3->set(255); + connect(redPercentageLine3, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + + greenPercentageLine3 = new MGConfItem("/desktop/meego/status_area/green_percentage_line_3", this); + if (greenPercentageLine3->value().isNull()) + greenPercentageLine3->set(40); + connect(greenPercentageLine3, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + + bluePercentageLine3 = new MGConfItem("/desktop/meego/status_area/blue_percentage_line_3", this); + if (bluePercentageLine3->value().isNull()) + bluePercentageLine3->set(40); + connect(bluePercentageLine3, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + batteryPercentage = new ContextProperty("Battery.ChargePercentage", this); connect(batteryPercentage, SIGNAL(valueChanged()), this, SLOT(batteryLevelChanged())); @@ -1043,32 +1081,50 @@ BatteryPercentageLine::BatteryPercentageLine(int maxWidth, ApplicationContext &c BatteryPercentageLine::~BatteryPercentageLine() { disconnect(batteryPercentage, SIGNAL(valueChanged()), this, SLOT(batteryLevelChanged())); + disconnect(displayPercentageLine, SIGNAL(valueChanged()), this, SLOT(displayChanged())); + disconnect(redPercentageLine, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + disconnect(greenPercentageLine, SIGNAL(valueChanged()), this, SLOT(colorChanged())); + disconnect(bluePercentageLine, SIGNAL(valueChanged()), this, SLOT(colorChanged())); } void BatteryPercentageLine::batteryLevelChanged() { if (mEnabled) { - int percentage = batteryPercentage->value().toString().toInt(); + int percentage = batteryPercentage->value().toInt(); int width = mMaxWidth * percentage / 100; setGeometry(QRectF(0, 0, width, 1)); } else { setGeometry(QRectF(0,0,0,0)); } + colorChanged(); } void BatteryPercentageLine::displayChanged() { mEnabled = displayPercentageLine->value().toBool(); - batteryLevelChanged(); colorChanged(); + batteryLevelChanged(); } void BatteryPercentageLine::colorChanged() { + int percentage = batteryPercentage->value().toInt(); + int l1 = percentageLineL1->value().toInt(); + int l2 = percentageLineL2->value().toInt(); int red = redPercentageLine->value().toInt(); int green = greenPercentageLine->value().toInt(); int blue = bluePercentageLine->value().toInt(); + if (percentage < l2) { + red = redPercentageLine3->value().toInt(); + green = greenPercentageLine3->value().toInt(); + blue = bluePercentageLine3->value().toInt(); + } + else if (percentage < l1) { + red = redPercentageLine2->value().toInt(); + green = greenPercentageLine2->value().toInt(); + blue = bluePercentageLine2->value().toInt(); + } mColorPoint.fill(QColor(red, green, blue)); setPixmap(mColorPoint); } diff --git a/src/systemui/statusarea/statusindicator.h b/src/systemui/statusarea/statusindicator.h index 533db7c9..01a8cd7f 100644 --- a/src/systemui/statusarea/statusindicator.h +++ b/src/systemui/statusarea/statusindicator.h @@ -721,9 +721,17 @@ private slots: QPixmap mColorPoint; ContextProperty *batteryPercentage; MGConfItem *displayPercentageLine; + MGConfItem *percentageLineL1; + MGConfItem *percentageLineL2; MGConfItem *redPercentageLine; MGConfItem *greenPercentageLine; MGConfItem *bluePercentageLine; + MGConfItem *redPercentageLine2; + MGConfItem *greenPercentageLine2; + MGConfItem *bluePercentageLine2; + MGConfItem *redPercentageLine3; + MGConfItem *greenPercentageLine3; + MGConfItem *bluePercentageLine3; int mMaxWidth; bool mEnabled; }; From 45ac1506fb36bbd25a7c566b4076e589a13b83f2 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Mon, 8 Jul 2013 18:16:37 +0600 Subject: [PATCH 34/36] Added Wazapp and Rocket LED notifications support --- src/systemui/notifications/lednotificationsink.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/systemui/notifications/lednotificationsink.cpp b/src/systemui/notifications/lednotificationsink.cpp index 068be011..96aa5cad 100644 --- a/src/systemui/notifications/lednotificationsink.cpp +++ b/src/systemui/notifications/lednotificationsink.cpp @@ -96,6 +96,16 @@ bool LEDNotificationSink::checkIfAcceptable(const NotificationParameters ¶me if (allowedNotifications.contains("organiser")) return true; } + // Wazapp events + else if (genericTextCatalogue.compare("wazapp") == 0) { + if (allowedNotifications.contains("wazapp")) + return true; + } + // Rocket events + else if (genericTextCatalogue.compare("rocket") == 0) { + if (allowedNotifications.contains("rocket")) + return true; + } return false; } From d8b910c6f17944ec20927e14a78633152e39aff6 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Wed, 28 Aug 2013 02:19:35 +0600 Subject: [PATCH 35/36] Unrestricted update - removed crap from rules, using install config + exported resetMenuWidget to dbus * using resetMenuWidget in SafeModeController * using only extensions listed in config --- debian/control | 5 +- debian/rules | 11 -- debian/system-ui.aegis | 13 +++ debian/system-ui.install | 4 + debian/system-ui.postinst | 17 +-- {data => src/systemui/data}/items-order.conf | 0 .../systemui/data}/pannable-order.conf | 0 {data => src/systemui/data}/top-order.conf | 0 .../safemodeapplet/safemodecontroller.cpp | 8 +- src/systemui/scripts/root_helper.sh | 23 ++++ src/systemui/scripts/setup.sh | 20 ++++ .../statusindicatormenuverticalview.cpp | 101 ++++++------------ .../statusindicatormenuverticalview.h | 10 -- .../statusindicatormenuwindow.cpp | 12 ++- .../statusindicatormenuwindow.h | 16 +-- src/systemui/systemui.pro | 13 ++- 16 files changed, 132 insertions(+), 121 deletions(-) rename {data => src/systemui/data}/items-order.conf (100%) rename {data => src/systemui/data}/pannable-order.conf (100%) rename {data => src/systemui/data}/top-order.conf (100%) create mode 100755 src/systemui/scripts/root_helper.sh create mode 100755 src/systemui/scripts/setup.sh diff --git a/debian/control b/debian/control index 53635dff..3fa7e76a 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,8 @@ Source: system-ui Section: devel Priority: optional -Maintainer: Vesa Halttunen +Maintainer: coderus +XSBC-Original-Maintainer: Vesa Halttunen Build-Depends: debhelper (>= 5), doxygen (>=1.5.9), libmeegotouch-dev (>= 0.22.12-1+0m6), libqmsystem2-dev (>= 1.2.0), libresourceqt-dev, libcontextsubscriber-dev, libngf-dev, libxcomposite-dev, libxfixes-dev, libxext-dev, @@ -11,7 +12,7 @@ Build-Depends: debhelper (>= 5), doxygen (>=1.5.9), libmeegotouch-dev (>= 0.22.1 Standards-Version: 3.8.0 Package: system-ui -Provides: duistatusindicatormenu, unrestricted-system-ui, system-ui-led-support +Provides: duistatusindicatormenu, unrestricted-system-ui, system-ui-led-support, unrestricted-settings-support Conflicts: duistatusindicatormenu Replaces: duistatusindicatormenu, cellular-ui Architecture: any diff --git a/debian/rules b/debian/rules index 939df408..f825c01a 100755 --- a/debian/rules +++ b/debian/rules @@ -92,15 +92,6 @@ binary-arch: build install dh_installchangelogs $(EXCLUSIONS) dh_installdocs $(EXCLUSIONS) dh_install --sourcedir=debian/tmp $(EXCLUSIONS) - mkdir -p debian/system-ui/etc/status-menu - cp -v data/items-order.conf debian/system-ui/etc/status-menu/items-order.conf - cp -v data/top-order.conf debian/system-ui/etc/status-menu/top-order.conf - cp -v data/pannable-order.conf debian/system-ui/etc/status-menu/pannable-order.conf - # Sigh - mkdir -p debian/system-ui/usr/lib/meegotouch/applicationextensions - mkdir -p debian/system-ui/usr/share/meegotouch/applicationextensions - cp src/systemui/safemodeapplet/libstatusindicatormenu-safemode.so debian/system-ui/usr/lib/meegotouch/applicationextensions - cp src/systemui/safemodeapplet/statusindicatormenu-safemode.desktop debian/system-ui/usr/share/meegotouch/applicationextensions dh_link $(EXCLUSIONS) dh_strip --dbg-package=system-ui-dbg $(EXCLUSIONS) dh_compress $(EXCLUSIONS) @@ -112,8 +103,6 @@ binary-arch: build install dh_md5sums $(EXCLUSIONS) dh_builddeb --destdir=$(DEBDIR) $(EXCLUSIONS) - aegis-deb-add -control debian/system-ui/DEBIAN/control .. debian/system-ui.aegis=_aegis - binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure diff --git a/debian/system-ui.aegis b/debian/system-ui.aegis index e5395204..16705ab4 100644 --- a/debian/system-ui.aegis +++ b/debian/system-ui.aegis @@ -17,6 +17,19 @@ + + + + + + + + + + + + + diff --git a/debian/system-ui.install b/debian/system-ui.install index 6710f5ab..0569eb43 100644 --- a/debian/system-ui.install +++ b/debian/system-ui.install @@ -4,3 +4,7 @@ usr/share/themes/base/meegotouch/sysuid/style/*.css usr/share/meegotouch/notifications/eventtypes/*.conf etc/dbus-1/system.d/systemui.conf usr/share/themes/base/meegotouch/sysuid/feedbacks +usr/share/sysuid/*.conf +usr/share/sysuid/*.sh +usr/lib/meegotouch/applicationextensions/libstatusindicatormenu-safemode.so +usr/share/meegotouch/applicationextensions/statusindicatormenu-safemode.desktop diff --git a/debian/system-ui.postinst b/debian/system-ui.postinst index a1acfba4..178dd5b2 100755 --- a/debian/system-ui.postinst +++ b/debian/system-ui.postinst @@ -1,21 +1,6 @@ #!/bin/sh -chown -R user:users /home/user/.status-menu/ - -if [ ! -d /home/user/.status-menu ]; then - aegis-exec -l -u user "mkdir -p /home/user/.status-menu" -fi -if [ ! -f /home/user/.status-menu/items-order.conf ]; then - aegis-exec -l -u user "cp -v /etc/status-menu/items-order.conf /home/user/.status-menu/" -fi -if [ ! -f /home/user/.status-menu/top-order.conf ]; then - aegis-exec -l -u user "cp -v /etc/status-menu/top-order.conf /home/user/.status-menu/" -fi -if [ ! -f /home/user/.status-menu/pannable-order.conf ]; then - aegis-exec -l -u user "cp -v /etc/status-menu/pannable-order.conf /home/user/.status-menu/" -fi - -chown -R user:users /home/user/.status-menu/ +/usr/share/sysuid/setup.sh if [ -n "`initctl status xsession/sysuid | grep running`" ] then diff --git a/data/items-order.conf b/src/systemui/data/items-order.conf similarity index 100% rename from data/items-order.conf rename to src/systemui/data/items-order.conf diff --git a/data/pannable-order.conf b/src/systemui/data/pannable-order.conf similarity index 100% rename from data/pannable-order.conf rename to src/systemui/data/pannable-order.conf diff --git a/data/top-order.conf b/src/systemui/data/top-order.conf similarity index 100% rename from data/top-order.conf rename to src/systemui/data/top-order.conf diff --git a/src/systemui/safemodeapplet/safemodecontroller.cpp b/src/systemui/safemodeapplet/safemodecontroller.cpp index 02f80750..5253b00b 100644 --- a/src/systemui/safemodeapplet/safemodecontroller.cpp +++ b/src/systemui/safemodeapplet/safemodecontroller.cpp @@ -1,6 +1,8 @@ #include "safemodecontroller.h" #include "safemodeplugin.h" #include "../statusindicatormenu/statusindicatormenuverticalview.h" +#include +#include SafeModeController::SafeModeController(SafeModePlugin *safeModePlugin, QGraphicsItem *parent) : CustomListItem(parent) @@ -27,8 +29,10 @@ void SafeModeController::onItemClicked() if (file.exists()) file.remove(); - // Ugly, but don't know any other way :/ - system("killall sysuid"); + QDBusInterface *unrestricted = new QDBusInterface("com.nokia.unrestricted", "/menuwindow", "com.nokia.unrestricted", + QDBusConnection::sessionBus(), this); + unrestricted->call("resetMenuWidget"); + delete unrestricted; } else if (result == QMessageBox::Help) { QDesktopServices::openUrl(QUrl("http://mohammadag.xceleo.org/system-ui-safe-mode-help.html")); } diff --git a/src/systemui/scripts/root_helper.sh b/src/systemui/scripts/root_helper.sh new file mode 100755 index 00000000..abb404a0 --- /dev/null +++ b/src/systemui/scripts/root_helper.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +restart_sysuid() +{ + /sbin/initctl stop xsession/sysuid || echo "sysuid not running" + sleep 5 + /sbin/initctl start xsession/sysuid +} + +case "$1" in + "menu-modern") + sed -i -e "s/StatusIndicatorMenuVerticalView/StatusIndicatorMenuDropDownView/" /usr/share/themes/blanco/meegotouch/sysuid/sysuid.conf + restart_sysuid + ;; + "menu-classic") + sed -i -e "s/StatusIndicatorMenuDropDownView/StatusIndicatorMenuVerticalView/" /usr/share/themes/blanco/meegotouch/sysuid/sysuid.conf + restart_sysuid + ;; + *) + ;; +esac + +exit 0 \ No newline at end of file diff --git a/src/systemui/scripts/setup.sh b/src/systemui/scripts/setup.sh new file mode 100755 index 00000000..9f10dd4e --- /dev/null +++ b/src/systemui/scripts/setup.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +if [ ! -d /home/user/.status-menu ]; then + "mkdir -p /home/user/.status-menu" +fi +if [ ! -f /home/user/.status-menu/items-order.conf ]; then + "cp -v /usr/share/sysuid/items-order.conf /home/user/.status-menu/" +fi +if [ ! -f /home/user/.status-menu/top-order.conf ]; then + "cp -v /usr/share/sysuid/top-order.conf /home/user/.status-menu/" +fi +if [ ! -f /home/user/.status-menu/pannable-order.conf ]; then + "cp -v /usr/share/sysuid/pannable-order.conf /home/user/.status-menu/" +fi + +if [ -f /tmp/system-ui-crashed ]; then + rm /tmp/system-ui-crashed +fi + +exit 0 \ No newline at end of file diff --git a/src/systemui/statusindicatormenu/statusindicatormenuverticalview.cpp b/src/systemui/statusindicatormenu/statusindicatormenuverticalview.cpp index ee0561c9..86cd0b71 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenuverticalview.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenuverticalview.cpp @@ -41,7 +41,6 @@ StatusIndicatorMenuVerticalView::StatusIndicatorMenuVerticalView(StatusIndicator connect(extensionArea, SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)), this, SLOT(setExtensionLayoutPosition(MApplicationExtensionInterface*))); extensionArea->setObjectName("StatusIndicatorMenuExtensionArea"); setSafeMode(extensionArea, QFile(CRASH_FILE).exists()); - extensionArea->setOrder(getOrderList()); extensionArea->init(); // Add panning to the expension area @@ -112,81 +111,41 @@ StatusIndicatorMenuVerticalView::~StatusIndicatorMenuVerticalView() void StatusIndicatorMenuVerticalView::setSafeMode(MApplicationExtensionArea *extensionArea, bool enabled) { - QRegExp inProcessFilterRegExp; - QRegExp outOfProcessFilterRegExp; + QStringList order; + QRegExp filter; - if (enabled) { - inProcessFilterRegExp = QRegExp("/statusindicatormenu-(volume|call|internetconnection|safemode|bluetooth|dlna|presence|transfer).desktop$"); - outOfProcessFilterRegExp = QRegExp("$^"); - } else { - QString string = "/statusindicatormenu-(" + pluginNameString() + ").desktop$"; - inProcessFilterRegExp = QRegExp(string); - outOfProcessFilterRegExp = QRegExp(); - } - - extensionArea->setInProcessFilter(inProcessFilterRegExp); - extensionArea->setOutOfProcessFilter(outOfProcessFilterRegExp); -} - -QString StatusIndicatorMenuVerticalView::pluginNameString() -{ - // Hacky, but oh well - QDir dir = QDir(EXTENSIONS_DIR); - // Panic? - if (!dir.exists()) { - return "volume|call|internetconnection|bluetooth|dlna|presence|transfer"; - } else { - QStringList filters; - filters << "statusindicatormenu*.desktop"; - QStringList fileNames = dir.entryList(filters); - QStringList modifiedFileNameList; - foreach (QString string, fileNames) { - string.remove("statusindicatormenu-"); - string.remove(".desktop"); - if (!string.contains("safemode")) - modifiedFileNameList.append(string); - } - fileNames.clear(); - - return modifiedFileNameList.join("|"); - } -} - -QStringList StatusIndicatorMenuVerticalView::getOrderList() -{ QFile configFile("/home/user/.status-menu/items-order.conf"); - if (!configFile.exists()) { - QStringList list; - list << "statusindicatormenu-volume.desktop" - << "statusindicatormenu-call.desktop" - << "statusindicatormenu-internetconnection.desktop" - << "statusindicatormenu-bluetooth.desktop" - << "statusindicatormenu-dlna.desktop" - << "statusindicatormenu-presence.desktop" - << "statusindicatormenu-transfer.desktop"; - return list; - }; - - configFile.open(QIODevice::ReadOnly); - QString orderListString = configFile.readAll(); - configFile.close(); - QStringList orderList = orderListString.split("\n"); - - QDir pluginDir(EXTENSIONS_DIR); - // It should, but do it the right way anyway... - if (pluginDir.exists()) { - QStringList filters; - filters << "statusindicatormenu*.desktop"; - QStringList pluginNames = pluginDir.entryList(filters); - foreach (QString plugin, orderList) { - if (pluginNames.contains(plugin)) - pluginNames.removeAll(plugin); - } - orderList.append(pluginNames); + if (enabled || !configFile.exists()) { + filter.setPattern("/statusindicatormenu-(volume|call|internetconnection|bluetooth|dlna|presence|transfer).desktop$"); + order << "statusindicatormenu-volume.desktop" + << "statusindicatormenu-call.desktop" + << "statusindicatormenu-internetconnection.desktop" + << "statusindicatormenu-bluetooth.desktop" + << "statusindicatormenu-dlna.desktop" + << "statusindicatormenu-presence.desktop" + << "statusindicatormenu-transfer.desktop"; + } else if (configFile.exists()) { + if (configFile.open(QIODevice::ReadOnly | QIODevice::Text)) + { + order = QString(configFile.readAll()).split("\n"); + configFile.close(); + + QStringList pattern; + foreach (QString string, order) + if (string.length() > 0 + && string.contains("statusindicatormenu-") + && !string.contains("safemode")) + pattern.append(string.remove("statusindicatormenu-").remove(".desktop")); + + filter.setPattern(QString("/statusindicatormenu-(%1).desktop$").arg(pattern.join("|"))); + pattern.clear(); + } } - return orderList; + extensionArea->setInProcessFilter(filter); + extensionArea->setOutOfProcessFilter(QRegExp("$^")); + extensionArea->setOrder(order); } M_REGISTER_VIEW_NEW(StatusIndicatorMenuVerticalView, StatusIndicatorMenu) diff --git a/src/systemui/statusindicatormenu/statusindicatormenuverticalview.h b/src/systemui/statusindicatormenu/statusindicatormenuverticalview.h index 028d0aaa..5550898c 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenuverticalview.h +++ b/src/systemui/statusindicatormenu/statusindicatormenuverticalview.h @@ -81,20 +81,10 @@ public slots: #endif private: - /*! - * Returns the order of plugins from a config file - */ - QStringList getOrderList(); - /*! * Sets whether or not non-official plugins will be loaded */ void setSafeMode(MApplicationExtensionArea *extensionArea, bool enabled); - - /*! - * Returns a |-separated string of plugin names for use in a QRegExp - */ - QString pluginNameString(); }; #endif /* STATUSINDICATORMENUVERTICALVIEW_H_ */ diff --git a/src/systemui/statusindicatormenu/statusindicatormenuwindow.cpp b/src/systemui/statusindicatormenu/statusindicatormenuwindow.cpp index 749b39be..ec2560a7 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenuwindow.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenuwindow.cpp @@ -24,11 +24,20 @@ #include "statusindicatormenuwindow.h" #include "statusindicatormenu.h" +#include + +#define OBJECT_NAME "/menuwindow" +#define SERVICE_NAME "com.nokia.unrestricted" + StatusIndicatorMenuWindow::StatusIndicatorMenuWindow(QWidget *parent) : MWindow(parent), statusBar(new MStatusBar), menuWidget(NULL) { + QDBusConnection bus = QDBusConnection::sessionBus(); + bus.registerService(SERVICE_NAME); + bus.registerObject(OBJECT_NAME, this, QDBusConnection::ExportScriptableSlots); + // Show status bar setSceneManager(new MSceneManager); sceneManager()->appearSceneWindowNow(statusBar); @@ -69,7 +78,8 @@ StatusIndicatorMenuWindow::~StatusIndicatorMenuWindow() void StatusIndicatorMenuWindow::resetMenuWidget() { - delete menuWidget; + if (menuWidget) + delete menuWidget; menuWidget = new StatusIndicatorMenu(); connect(menuWidget, SIGNAL(showRequested()), this, SLOT(makeVisible())); diff --git a/src/systemui/statusindicatormenu/statusindicatormenuwindow.h b/src/systemui/statusindicatormenu/statusindicatormenuwindow.h index e8ec6990..13f67412 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenuwindow.h +++ b/src/systemui/statusindicatormenu/statusindicatormenuwindow.h @@ -37,6 +37,7 @@ class StatusIndicatorMenu; class StatusIndicatorMenuWindow : public MWindow { Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "com.nokia.unrestricted") public: /*! @@ -72,6 +73,14 @@ public slots: */ void visibilityChanged(bool visible); +public slots: + /*! Resets menu widget. + * + * Dismisses window from scene manager, if window is appeared there. + * Creates a new menu widget and appears window to scene manager. + */ + Q_SCRIPTABLE void resetMenuWidget(); + private slots: //! Hides window and sends visibilityChanged signal @@ -96,13 +105,6 @@ private slots: #endif private: - /*! Resets menu widget. - * - * Dismisses window from scene manager, if window is appeared there. - * Creates a new menu widget and appears window to scene manager. - */ - void resetMenuWidget(); - //! Status bar MStatusBar *statusBar; diff --git a/src/systemui/systemui.pro b/src/systemui/systemui.pro index 98c5f98c..ab3ffe05 100644 --- a/src/systemui/systemui.pro +++ b/src/systemui/systemui.pro @@ -98,6 +98,17 @@ headers.files += \ volumeextensioninterface.h \ VolumeExtensionInterface +config.files += data/items-order.conf \ + data/pannable-order.conf \ + data/top-order.conf +config.path = /usr/share/sysuid + +scripts.files += scripts/setup.sh \ + scripts/root_helper.sh +scripts.path = /usr/share/sysuid + INSTALLS += target \ dbus_policy \ - headers + headers \ + config \ + scripts From 2e78f0375fab99f0cad7f201defcb508e1dc1cc1 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Wed, 28 Aug 2013 14:08:54 +0600 Subject: [PATCH 36/36] Added support for custom LED notifications --- src/systemui/notifications/lednotificationsink.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/systemui/notifications/lednotificationsink.cpp b/src/systemui/notifications/lednotificationsink.cpp index 96aa5cad..8b32bee8 100644 --- a/src/systemui/notifications/lednotificationsink.cpp +++ b/src/systemui/notifications/lednotificationsink.cpp @@ -106,6 +106,10 @@ bool LEDNotificationSink::checkIfAcceptable(const NotificationParameters ¶me if (allowedNotifications.contains("rocket")) return true; } + // Any other events with genericTextCatalogue listed in allowed + else if (allowedNotifications.contains(genericTextCatalogue)) { + return true; + } return false; }