This repository has been archived on 2023-11-19. You can view files and clone it, but cannot push or open issues or pull requests.
goober-bb10/src/ActiveFrameQML.cpp
2016-10-22 15:56:38 -07:00

54 lines
1.7 KiB
C++

/*
* Copyright (C) 2016 Morgan McMillian <gilag@monkeystew.com>
*
* This file is apart of the Goober application, a client for pnut.io
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <src/ActiveFrameQML.h>
#include <bb/cascades/SceneCover>
#include <bb/cascades/Container>
#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
using namespace bb::cascades;
ActiveFrameQML::ActiveFrameQML(QObject *parent) : SceneCover(parent)
{
QmlDocument *qml = QmlDocument::create("asset:///AppCover.qml").parent(parent);
Container *mainContainer = qml->createRootObject<Container>();
setContent(mainContainer);
global_unread_label = mainContainer->findChild<Label*>("global_label");
global_unread_label->setParent(mainContainer);
// home_unread_label = mainContainer->findChild<Label*>("home_label");
// home_unread_label->setParent(mainContainer);
}
ActiveFrameQML::~ActiveFrameQML()
{
// TODO Auto-generated destructor stub
}
void ActiveFrameQML::setGlobalUnread(QString count)
{
global_unread_label->setText(count);
}
void ActiveFrameQML::setHomeUnread(QString count)
{
global_unread_label->setText(count);
}