Пример #1
0
/**
 * Constructor.
 */
MainScreen::MainScreen() :
	TabScreen(),
	mDisplayNotificationScreen(NULL),
	mSettingsScreen(NULL),
	mTCPConnection(NULL),
	mToken(NULL)
{
	mDisplayNotificationScreen = new DisplayNotificationScreen();
	mSettingsScreen = new SettingsScreen(this);
	mTCPConnection = new TCPConnection(this);

	this->addTab(mDisplayNotificationScreen);
	this->addTab(mSettingsScreen);

	if ( isAndroid() )
	{
		// Store the reg ID, and call registration only once per app.
		checkStore();
	}
	else
	{
		int registerCode = Notification::NotificationManager::getInstance()->registerPushNotification(
				Notification::PUSH_NOTIFICATION_TYPE_BADGE |
				Notification::PUSH_NOTIFICATION_TYPE_ALERT |
				Notification::PUSH_NOTIFICATION_TYPE_SOUND,
				C2DM_USER_ACCOUNT);

		if ( MA_NOTIFICATION_RES_UNSUPPORTED == registerCode )
			maPanic(0, "This device does not support push notifications");
	}

	NotificationManager::getInstance()->addPushNotificationListener(this);
}
Пример #2
0
void WindowMain::onStart(QList<QUrl> urls)
{
	/** Check the movies store before begin */
	if(!checkStore())
		return;

	m_urls = urls;

	/** Setting progress in status bar */
	m_progress->setValue(0);
	m_progress->setMaximum(m_urls.size());
	m_ui->statusBar->addWidget(m_progress);
	m_progress->show();

	/** Disable menubar */
	m_ui->menuBar->setEnabled(false);

	/** Enable processing flag */
	m_processing = true;

	/** Begin processing */
	if(!m_urls.isEmpty())
		emit next();
}