Esempio n. 1
0
fluid_menu::fluid_menu(osman *oss)
{
    pictureFlowWidget = new PictureFlow();
    pictureFlowWidget->setFocus();
    addWidget(pictureFlowWidget);
    setCurrentWidget(pictureFlowWidget);
    pictureFlowWidget->setFocus();
    QRect screen_size = QApplication::desktop()->screenGeometry();
    introAni.setInterval(250);
    this->oss=oss;
    QObject::connect(&introAni,SIGNAL(timeout()),this,SLOT(aniSlide()));
    QObject::connect(pictureFlowWidget, SIGNAL(itemActivated(int)), this, SLOT(showThat(int)));
	QObject::connect(oss,SIGNAL(showMenu()),this,SLOT(showFullScreen()));
	QObject::connect(oss,SIGNAL(showMenu()),oss,SLOT(hide()));
    h = screen_size.height() * SIZING_FACTOR_HEIGHT;
    w = screen_size.width() * SIZING_FACTOR_WIDTH;

    const int hh = qMin(h, w);
    const int ww = hh;
    pictureFlowWidget->setSlideSize(QSize(ww, hh));
    addIntroItems();
    populatePictureFlow();
    pictureFlowWidget->setCurrentSlide(0);
    pictureFlowWidget->isIntroRunning=true;
    introAni.start();
 

}
Esempio n. 2
0
void CRecDirChooser::initMenu(void)
/**********************************************************************/
{
	char indexStr[10];
	//************************************************/
	addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, BTN_TYPE_CANCEL);

	for(int i=0 ; i < MAX_RECORDING_DIR ; i++)
	{
		if(!g_settings.recording_dir[i].empty())
		{
			bool get_size = true;
			dirOptionText[i]="";
			nfsIndex[i] = getNFSIDOfDir(g_settings.recording_dir[i].c_str());
			//printf("dir %d = nfs: %d\n",i,nfsIndex[i]);
			if( nfsIndex[i] != -1)
			{ 
				int retvalue = pingthost(g_settings.network_nfs[nfsIndex[i]].ip.c_str(),60); // send ping and wait 60ms
				if (retvalue == 0)//LOCALE_PING_UNREACHABLE
				{
					dirOptionText[i] = g_Locale->getText(LOCALE_RECDIRCHOOSER_SERVER_DOWN); 
					get_size = false;
				}
#ifdef ENABLE_GUI_MOUNT
				else if (retvalue == 1)//LOCALE_PING_OK
				{
					// check if we can get more dir informations
					if (CFSMounter::isMounted (g_settings.network_nfs[nfsIndex[i]].local_dir))
					{
						dirOptionText[i] = g_Locale->getText(LOCALE_RECDIRCHOOSER_NOT_MOUNTED); 
						get_size = false;
					}
				}
#endif
			}
			if(get_size)
			{
				// in any other case we can show the free space
				int drivefree;
				drivefree = getFreeDiscSpaceGB(g_settings.recording_dir[i].c_str());
				char tmp[20];
				snprintf(tmp, 19,g_Locale->getText(LOCALE_RECDIRCHOOSER_FREE),drivefree);
				tmp[19]=0;
				dirOptionText[i]=tmp;
			}
			snprintf(indexStr,10,"MID:%d",i);
			CMenuForwarder* fw = new CMenuForwarder(g_settings.recording_dir[i].c_str(), true, dirOptionText[i], this, indexStr);
			fw->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true);
			addItem(fw, i == 0); // select first item
		}
	}
	addItem(GenericMenuSeparatorLine);
	addItem(new CMenuForwarder(LOCALE_RECDIRCHOOSER_USER_DIR, true, NULL, this, "dirChooser"));
}