diff --git a/debian/control b/debian/control index 9fb85c91..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,13 +12,12 @@ 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 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.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/rules b/debian/rules index be760b71..f825c01a 100755 --- a/debian/rules +++ b/debian/rules @@ -92,25 +92,17 @@ 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/ - # 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) 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) - 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 d57ec260..16705ab4 100644 --- a/debian/system-ui.aegis +++ b/debian/system-ui.aegis @@ -6,6 +6,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + 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 238a5331..178dd5b2 100755 --- a/debian/system-ui.postinst +++ b/debian/system-ui.postinst @@ -1,5 +1,7 @@ #!/bin/sh +/usr/share/sysuid/setup.sh + if [ -n "`initctl status xsession/sysuid | grep running`" ] then initctl restart xsession/sysuid diff --git a/data/status-menu-items-order.conf b/src/systemui/data/items-order.conf similarity index 85% rename from data/status-menu-items-order.conf rename to src/systemui/data/items-order.conf index 46b17b35..7c28a8df 100644 --- a/data/status-menu-items-order.conf +++ b/src/systemui/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/src/systemui/data/pannable-order.conf b/src/systemui/data/pannable-order.conf new file mode 100644 index 00000000..89f038f1 --- /dev/null +++ b/src/systemui/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/src/systemui/data/top-order.conf b/src/systemui/data/top-order.conf new file mode 100644 index 00000000..4615ddd6 --- /dev/null +++ b/src/systemui/data/top-order.conf @@ -0,0 +1,2 @@ +statusindicatormenu-volume.desktop +statusindicatormenu-call.desktop \ No newline at end of file diff --git a/src/systemui/notifications/lednotificationsink.cpp b/src/systemui/notifications/lednotificationsink.cpp index 068be011..8b32bee8 100644 --- a/src/systemui/notifications/lednotificationsink.cpp +++ b/src/systemui/notifications/lednotificationsink.cpp @@ -96,6 +96,20 @@ 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; + } + // Any other events with genericTextCatalogue listed in allowed + else if (allowedNotifications.contains(genericTextCatalogue)) { + return true; + } return false; } 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/statusarea/speedwrapper.cpp b/src/systemui/statusarea/speedwrapper.cpp new file mode 100644 index 00000000..4bb4f6c5 --- /dev/null +++ b/src/systemui/statusarea/speedwrapper.cpp @@ -0,0 +1,223 @@ +#include "speedwrapper.h" + +#ifndef UNIT_TEST + +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; +} + +#endif diff --git a/src/systemui/statusarea/speedwrapper.h b/src/systemui/statusarea/speedwrapper.h new file mode 100644 index 00000000..bf60f452 --- /dev/null +++ b/src/systemui/statusarea/speedwrapper.h @@ -0,0 +1,76 @@ +#ifndef SPEEDWRAPPER_H +#define SPEEDWRAPPER_H + +#ifndef UNIT_TEST + +#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) + {} + bytes_data(){} +}; + +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 + +#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..e220d838 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 @@ -117,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() @@ -153,6 +160,9 @@ void StatusAreaView::setupTestability() portraitDLNAIndicator->setParent(portraitWidget); landscapeTransferStatusIndicator->setParent(landscapeWidget); portraitTransferStatusIndicator->setParent(portraitWidget); + //! NetSpeed + portraitNetSpeedIndicator->setParent(portraitWidget); + landscapeNetSpeedIndicator->setParent(landscapeWidget); } StatusAreaView::~StatusAreaView() @@ -184,6 +194,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 +225,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..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. @@ -147,6 +150,15 @@ private slots: Clock *landscapeClock; Clock *portraitClock; + //! Test + 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 ede2c78c..b66ab4d9 100644 --- a/src/systemui/statusarea/statusindicator.cpp +++ b/src/systemui/statusarea/statusindicator.cpp @@ -298,11 +298,15 @@ 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); } + batteryPercentageChanged(); batteryLevelChanged (); } @@ -343,24 +347,50 @@ 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 + { + batteryLevelChanged(); + 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,31 +399,56 @@ 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())); + + batteryPercentageChanged(); + batteryLevelChanged(); } 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); + batteryLevelChanged(); + } + 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) : @@ -503,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); @@ -565,54 +622,71 @@ 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 + { + 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) : @@ -842,3 +916,216 @@ 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(); +} + +#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); + + 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); + 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())); + + 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())); + + displayChanged(); +} + +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().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(); + 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); +} +#endif diff --git a/src/systemui/statusarea/statusindicator.h b/src/systemui/statusarea/statusindicator.h index 6b77ed66..01a8cd7f 100644 --- a/src/systemui/statusarea/statusindicator.h +++ b/src/systemui/statusarea/statusindicator.h @@ -23,7 +23,12 @@ #include #include #include "statusindicatormodel.h" +#include "speedwrapper.h" #include +#include +#include +#include + #ifdef HAVE_QMSYSTEM #include @@ -186,7 +191,7 @@ private slots: class PhoneNetworkTypeStatusIndicator : public StatusIndicator { Q_OBJECT - M_CONTROLLER(PhoneNetworkTypeStatusIndicator); + M_CONTROLLER(PhoneNetworkTypeStatusIndicator) public: /*! @@ -243,11 +248,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 +281,13 @@ class BatteryPercentageStatusIndicator : public StatusIndicator virtual ~BatteryPercentageStatusIndicator(); private slots: + void batteryLevelChanged(); void batteryPercentageChanged(); private: ContextItem *batteryPercentage; + ContextItem *batteryCharging; + ContextItem *batterySaveMode; MGConfItem *displayPercentage; }; @@ -402,6 +412,7 @@ private slots: ContextItem *cellularServiceStatus; ContextItem *cellularRegistrationStatus; MGConfItem *displayLimitedServiceState; + MGConfItem *displayNetworkName; QTimer networkChangeShowVisitorTimer; #ifdef UNIT_TEST @@ -666,4 +677,64 @@ 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; +}; + +#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 *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; +}; +#endif + #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/src/systemui/statusindicatormenu/notificationareaview.cpp b/src/systemui/statusindicatormenu/notificationareaview.cpp index 517f79e8..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,26 +53,26 @@ 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); 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() @@ -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/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/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 3567b28b..aca63cb4 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.cpp @@ -31,9 +31,12 @@ #include #include #include +#include +#include +#include +#include #include "statusindicatormenu.h" #include "statusindicatormenudropdownview.h" -#include "statusindicatormenustyle.h" #include "sysuid.h" const int StatusIndicatorMenuDropDownView::VIEW_INITIALIZATION_DELAY = 30 * 1000; @@ -85,18 +88,14 @@ void PannedWidgetController::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) StatusIndicatorMenuDropDownView::StatusIndicatorMenuDropDownView(StatusIndicatorMenu *controller) : MSceneWindowView(controller), controller(controller), - settingsPluginsExtensionArea(NULL), + 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())); @@ -107,7 +106,6 @@ StatusIndicatorMenuDropDownView::StatusIndicatorMenuDropDownView(StatusIndicator StatusIndicatorMenuDropDownView::~StatusIndicatorMenuDropDownView() { - delete backgroundWidget; delete closeButtonOverlay; delete pannableViewport; delete topRowWidget; @@ -115,34 +113,58 @@ 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("StatusIndicatorDropDownMenuExtensionArea"); + fixedPluginsExtensionArea->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + + 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$"); + 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(); + + 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-(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; - topRowWidget->setStyleName("StatusIndicatorMenuExtensionAreaWidget"); + topRowWidget->setStyleName("StatusIndicatorDropDownMenuExtensionAreaWidget"); topRowWidget->setLayout(topRowLayout); return topRowWidget; @@ -150,13 +172,46 @@ 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$")); + extensionArea->setObjectName("StatusIndicatorDropDownMenuExtensionArea"); + + 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; } @@ -170,71 +225,52 @@ MPannableViewport* StatusIndicatorMenuDropDownView::createPannableArea() contentLayout->setSpacing(0); contentLayout->addItem(statusIndicatorExtensionArea); - if(style()->notificationArea()) { + MGConfItem *displayNotifications = new MGConfItem("/desktop/meego/status_menu/display_notifications", this); + + if(displayNotifications->value(true).toBool()) { 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; - contentWidget->setStyleName("StatusIndicatorMenuContentWidget"); + contentWidget->setStyleName("StatusIndicatorDropDownMenuExtensionAreaWidget"); 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); - 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); + MPannableViewport *pannableViewport = new MPannableViewport(); pannableViewport->setWidget(pannedWidget); + 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"); - 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 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 +291,7 @@ MOverlay *StatusIndicatorMenuDropDownView::createCloseButtonOverlay() void StatusIndicatorMenuDropDownView::ensureIsViewable() { - settingsPluginsExtensionArea->init(); + fixedPluginsExtensionArea->init(); if (statusIndicatorExtensionArea) { statusIndicatorExtensionArea->init(); @@ -264,38 +300,22 @@ 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 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) / 2; - if (backgroundHeight < 0) { - backgroundHeight = 0; - } - backgroundWidget->setMinimumHeight(backgroundHeight); - backgroundWidget->setMaximumHeight(backgroundHeight); } void StatusIndicatorMenuDropDownView::resetViewport() { - pannableViewport->setPosition(QPointF(0,0)); + //pannableViewport->setPosition(QPointF(0,0)); } void StatusIndicatorMenuDropDownView::applyStyle() @@ -303,12 +323,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(); @@ -316,7 +330,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 caf8c08b..a3fc653a 100644 --- a/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h +++ b/src/systemui/statusindicatormenu/statusindicatormenudropdownview.h @@ -24,7 +24,9 @@ #include #include #include -#include "statusindicatormenustyle.h" +#include "statusindicatordropdownmenustyle.h" + +#define CRASH_FILE "/tmp/system-ui-crashed" class QGraphicsSceneMouseEvent; class QGraphicsLinearLayout; @@ -107,7 +109,7 @@ class PannedWidgetController : public MStylableWidget class StatusIndicatorMenuDropDownView : public MSceneWindowView { Q_OBJECT - M_VIEW(MSceneWindowModel, StatusIndicatorMenuStyle) + M_VIEW(MSceneWindowModel, StatusIndicatorDropDownMenuStyle) public: /*! @@ -145,13 +147,13 @@ 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(); //! The pannable area viewport @@ -169,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/src/systemui/statusindicatormenu/statusindicatormenuverticalview.cpp b/src/systemui/statusindicatormenu/statusindicatormenuverticalview.cpp index 299033b1..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; - - 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); + QStringList order; + QRegExp filter; + + QFile configFile("/home/user/.status-menu/items-order.conf"); + + 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(); } - fileNames.clear(); - - return modifiedFileNameList.join("|"); - } -} - -QStringList StatusIndicatorMenuVerticalView::getOrderList() -{ - QFile configFile("/etc/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); } - 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 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 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 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/tests/ut_statusindicatormenudropdownview/ut_statusindicatormenudropdownview.cpp b/tests/ut_statusindicatormenudropdownview/ut_statusindicatormenudropdownview.cpp index 51624c0f..3eec8bc4 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; } @@ -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() diff --git a/themes/style/notificationarea.css b/themes/style/notificationarea.css index 597d8124..e68be2d9 100644 --- a/themes/style/notificationarea.css +++ b/themes/style/notificationarea.css @@ -1,15 +1,17 @@ NotificationAreaStyle { - minimum-size: 100% 0; - maximum-size: 100% -1; - margin-left: 0; + minimum-size: 400 0; + maximum-size: 400 -1; + margin-left: 16; margin-top: 0; - margin-right: 0; + margin-right: 16; margin-bottom: 0; clear-button: true; max-banners: -1; } MAbstractLayoutPolicyStyle#NotificationAreaBannerLayoutPolicy { + minimum-size: 400 0; + maximum-size: 400 -1; vertical-spacing: 0.8mm; margin-left: 0; margin-right: 0; @@ -25,12 +27,17 @@ 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-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/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/statusarea.css b/themes/style/statusarea.css index fc0713de..996f23b1 100644 --- a/themes/style/statusarea.css +++ b/themes/style/statusarea.css @@ -509,12 +509,25 @@ 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; 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/style/statusindicatormenu.css b/themes/style/statusindicatormenu.css index 919c22a5..44ad27cc 100644 --- a/themes/style/statusindicatormenu.css +++ b/themes/style/statusindicatormenu.css @@ -1,7 +1,14 @@ StatusIndicatorMenuStyle { - padding-top: 2.8mm; + padding-top: 0; + notification-area: true; +} +StatusIndicatorDropDownMenuStyle { + padding-top: 0; notification-area: true; + background-opacity: 0.8; + minimum-size: 480 -1; + maximum-size: 480 -1; } MSceneLayerEffect#MenuSceneLayerEffect MWidgetFadeAnimationStyle#In { @@ -32,22 +39,26 @@ StatusIndicatorMenu MWidgetSlideAnimationStyle#Out { origin: "top"; } +MWidgetStyle#StatusIndicatorDropDownMenuExtensionAreaWidget { + background-color: $COLOR_INVERTED_BACKGROUND; +} + MWidgetStyle#StatusIndicatorMenuExtensionAreaWidget { - background-image: "meegotouch-applicationpage-background"; + background-color: $COLOR_INVERTED_BACKGROUND; } MWidgetStyle#StatusIndicatorMenuContentWidget { - background-image: "meegotouch-applicationpage-background"; + background-color: $COLOR_INVERTED_BACKGROUND; } MWidgetStyle#CloseButtonArea { - background-image: "meegotouch-statusmenuclose-background"; + background-color: $COLOR_INVERTED_BACKGROUND; } MWidgetStyle#StatusIndicatorMenuWindowBackground { - background-image: "meegotouch-applicationpage-background"; - minimum-size: 100% 0; - maximum-size: 100% 0; + background-color: $COLOR_INVERTED_BACKGROUND; + minimum-size: 480 0; + maximum-size: 480 0; } MStatusBarStyle#StatusIndicatorMenuWindowStatusBar { @@ -91,18 +102,20 @@ 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-color: $COLOR_INVERTED_BACKGROUND; + minimum-size: 480 6mm; + preferred-size: 480 6mm; + maximum-size: 480 6mm; offset: 0 0; vertical-align: bottom; horizontal-align: left; } -MApplicationExtensionAreaStyle#StatusIndicatorMenuTopRowExtensionArea { - background-image: ; - layout-orientation: horizontal; +MApplicationExtensionAreaStyle#StatusIndicatorDropDownMenuExtensionArea { + padding-left: 0mm; + padding-right: 0mm; + background-color: $COLOR_INVERTED_BACKGROUND; + layout-orientation: vertical; container-mode: false; } @@ -115,10 +128,25 @@ MPannableWidgetStyle#StatusIndicatorMenuViewport { padding-right: 0; padding-top: 0; padding-bottom: 0; - minimum-size: -1 -1; - preferred-size: -1 -1; - maximum-size: -1 -1; - background-image: "meegotouch-applicationpage-background"; + minimum-size: 480 -1; + preferred-size: 480 -1; + maximum-size: 480 -1; + 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; } MContainerStyle#MExtensionAreaInvisibleContainer { 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 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