![]() |
Home · All Namespaces · All Classes |
00001 /**************************************************************************** 00002 ** 00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00004 ** All rights reserved. 00005 ** Contact: Nokia Corporation (directui@nokia.com) 00006 ** 00007 ** This file is part of systemui. 00008 ** 00009 ** If you have questions regarding the use of this file, please contact 00010 ** Nokia at directui@nokia.com. 00011 ** 00012 ** This library is free software; you can redistribute it and/or 00013 ** modify it under the terms of the GNU Lesser General Public 00014 ** License version 2.1 as published by the Free Software Foundation 00015 ** and appearing in the file LICENSE.LGPL included in the packaging 00016 ** of this file. 00017 ** 00018 ****************************************************************************/ 00019 00020 #include "statusindicatorlabelview.h" 00021 #include "statusindicator.h" 00022 #include <QGraphicsLinearLayout> 00023 #include <MTheme> 00024 #include <MLabel> 00025 #include <MViewCreator> 00026 00027 StatusIndicatorLabelView::StatusIndicatorLabelView(StatusIndicator *controller) : 00028 MWidgetView(controller), 00029 controller(controller) 00030 { 00031 label = new MLabel(controller); 00032 label->setObjectName("StatusIndicatorLabel"); 00033 } 00034 00035 StatusIndicatorLabelView::~StatusIndicatorLabelView() 00036 { 00037 } 00038 00039 void StatusIndicatorLabelView::setupModel() 00040 { 00041 MWidgetView::setupModel(); 00042 00043 label->setText(model()->value().toString()); 00044 } 00045 00046 void StatusIndicatorLabelView::updateData(const QList<const char *>& modifications) 00047 { 00048 MWidgetView::updateData(modifications); 00049 00050 const char *member; 00051 foreach(member, modifications) { 00052 if (member == StatusIndicatorModel::Value) { 00053 label->setText(model()->value().toString()); 00054 } else if (member == MWidgetModel::StyleName) { 00055 if (controller->styleName().contains("Landscape")) { 00056 label->setStyleName("StatusIndicatorLabelLandscape"); 00057 } else { 00058 label->setStyleName("StatusIndicatorLabelPortrait"); 00059 } 00060 } 00061 } 00062 } 00063 00064 M_REGISTER_VIEW_NEW(StatusIndicatorLabelView, StatusIndicator)
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:19:34 Doxygen 1.7.1 |
MeeGo Touch |
