Esempio n. 1
0
void eZapOsdSetup::init_eZapOsdSetup()
{
	alpha = gFBDC::getInstance()->getAlpha();
	sAlpha = CreateSkinnedSlider("alpha","lalpha", 0, 512 );
	sAlpha->setIncrement( eSystemInfo::getInstance()->getAlphaIncrement() ); // Percent !
	sAlpha->setValue( alpha);
	CONNECT( sAlpha->changed, eZapOsdSetup::alphaChanged );

	brightness = gFBDC::getInstance()->getBrightness();
	sBrightness = CreateSkinnedSlider("brightness","lbrightness", 0, 255 );
	sBrightness->setIncrement( 5 ); // Percent !
	sBrightness->setValue( brightness);
	CONNECT( sBrightness->changed, eZapOsdSetup::brightnessChanged );

	gamma = gFBDC::getInstance()->getGamma();
	sGamma = CreateSkinnedSlider("contrast","lcontast", 0, 255 );
	sGamma->setIncrement( 5 ); // Percent !
	sGamma->setValue( gamma);
	CONNECT( sGamma->changed, eZapOsdSetup::gammaChanged );

	simpleMainMenu=CreateSkinnedCheckbox("simpleMainMenu",0,"/ezap/osd/simpleMainMenu");

	CONNECT( CreateSkinnedButton("skin")->selected, eZapOsdSetup::skinPressed );

	CONNECT( CreateSkinnedButton("pluginoffs")->selected, eZapOsdSetup::pluginPositionPressed );

	CONNECT(CreateSkinnedButton("ok")->selected, eZapOsdSetup::okPressed);

	CONNECT( CreateSkinnedButton("expert")->selected, eZapOsdSetup::expertPressed );

	BuildSkin("eZapOsdSetup");

	setHelpID(83);
}
Esempio n. 2
0
 static void CurrentSkin(cDBusObject *Object, GVariant *Parameters, GDBusMethodInvocation *Invocation)
 {
   GVariantBuilder *ret = g_variant_builder_new(G_VARIANT_TYPE("(i(iss))"));
   g_variant_builder_add(ret, "i", 900);
   g_variant_builder_add_value(ret, BuildSkin(Skins.Current()));
   g_dbus_method_invocation_return_value(Invocation, g_variant_builder_end(ret));
   g_variant_builder_unref(ret);
 };
Esempio n. 3
0
void eZapKeyboardSetup::init_eZapKeyboardSetup()
{
	mappings=CreateSkinnedComboBox("mapping",4);

	CONNECT(CreateSkinnedButton("save")->selected, eZapKeyboardSetup::okPressed);

	BuildSkin("KeyboardSetup");

	loadMappings();
}
Esempio n. 4
0
 static void ListSkins(cDBusObject *Object, GVariant *Parameters, GDBusMethodInvocation *Invocation)
 {
   GVariantBuilder *ret = g_variant_builder_new(G_VARIANT_TYPE("(ia(iss))"));
   g_variant_builder_add(ret, "i", 900);
   GVariantBuilder *array = g_variant_builder_new(G_VARIANT_TYPE("a(iss)"));
   for (cSkin* skin = Skins.First(); skin; skin = Skins.Next(skin))
       g_variant_builder_add_value(array, BuildSkin(skin));
   g_variant_builder_add_value(ret, g_variant_builder_end(array));
   g_dbus_method_invocation_return_value(Invocation, g_variant_builder_end(ret));
   g_variant_builder_unref(array);
   g_variant_builder_unref(ret);
 };
Esempio n. 5
0
void eEventDisplay::init_eEventDisplay(const ePtrList<EITEvent>* e)
{
	eventlist=0;
	events=0;

	scrollbar = CreateSkinnedProgress("scrollbar",0,100);

	descr = new eWidget(this);
	descr->setName("epg_description");

	eventTime = CreateSkinnedLabel("time");

	eventDate = CreateSkinnedLabel("date");

	channel = CreateSkinnedLabel("channel");

	timer_icon = CreateSkinnedLabel("timer_icon");

	BuildSkin("eventview");

	long_description=new eLabel(descr);
	long_description->setFlags(RS_WRAP);

	// try to recalc long description label... ( no broken text lines.. )
	float lineheight=fontRenderClass::getInstance()->getLineHeight( long_description->getFont() );
	int lines = (int)(descr->getSize().height() / lineheight);
	pageHeight = (int)(lines * lineheight);
	descr->resize( eSize( descr->getSize().width(), pageHeight+(int)(lineheight/6)));
	long_description->resize(eSize(descr->getSize().width(), pageHeight*16));

#ifndef DISABLE_FILE
	addActionToHelpList( &i_epgSelectorActions->addDVRTimerEvent );
#endif
#ifndef DISABLE_NETWORK
	addActionToHelpList( &i_epgSelectorActions->addNGRABTimerEvent );
#endif
	addActionToHelpList( &i_epgSelectorActions->addSwitchTimerEvent );
	addActionToHelpList( &i_epgSelectorActions->removeTimerEvent );
	addActionToHelpList( &i_enigmaEventViewActions->close );

	if (e)
		setList(*e);
	else if (evt)
		setEvent(evt);
	addActionMap( &i_enigmaEventViewActions->map );
	addActionMap( &i_epgSelectorActions->map );
	
	setHelpID(11);
}
Esempio n. 6
0
eTextInputFieldHelpWidget::eTextInputFieldHelpWidget(eWidget *parent)
	:eWidget(parent, 0)
{
	keys[0] = CreateSkinnedLabel("zero");
	keys[1] = CreateSkinnedLabel("one");
	keys[2] = CreateSkinnedLabel("two");
	keys[3] = CreateSkinnedLabel("three");
	keys[4] = CreateSkinnedLabel("four");
	keys[5] = CreateSkinnedLabel("five");
	keys[6] = CreateSkinnedLabel("six");
	keys[7] = CreateSkinnedLabel("seven");
	keys[8] = CreateSkinnedLabel("eight");
	keys[9] = CreateSkinnedLabel("nine");
	keys[10] = CreateSkinnedLabel("special_one");
	keys[11] = CreateSkinnedLabel("special_two");
	BuildSkin("eTextInputFieldHelpWidget");
}
Esempio n. 7
0
void eTimeCorrectionEditWindow::init_eTimeCorrectionEditWindow( tsref tp )
{

	lCurTime= CreateSkinnedLabel("curtime");
	lCurDate = CreateSkinnedLabel("curdate");

	lTpTime = CreateSkinnedLabel("tptime");
	lTpDate = CreateSkinnedLabel("tpdate");

	time_t now = time(0)+eDVB::getInstance()->time_difference;
	tm tmp = *localtime( &now );

	nTime = CreateSkinnedNumber("nTime",0, 2, 0, 59, 2, 0, 0);
	nTime->setFlags( eNumber::flagTime|eNumber::flagFillWithZeros );
	CONNECT( nTime->selected, eTimeCorrectionEditWindow::fieldSelected );

	cday = CreateSkinnedComboBox("cday");
	cmonth = CreateSkinnedComboBox("cmonth");
	for ( int i = 0; i < 12; i++ )
		new eListBoxEntryText( *cmonth, eString().sprintf("%02d",i+1), (void*)i );
	CONNECT( cmonth->selchanged, eTimeCorrectionEditWindow::monthChanged );

	cyear = CreateSkinnedComboBox("cyear");
	for ( int i = -1; i < 4; i++ )
		new eListBoxEntryText( *cyear, eString().sprintf("%d",tmp.tm_year+(1900+i)), (void*)(tmp.tm_year+i) );

	CONNECT( cyear->selchanged, eTimeCorrectionEditWindow::yearChanged );

	bSet=CreateSkinnedButton("set");
	CONNECT(bSet->selected, eTimeCorrectionEditWindow::savePressed);

	BuildSkin("timecorrection");
	CONNECT( updateTimer.timeout, eTimeCorrectionEditWindow::updateTimeDate );
	nTime->setNumber(0, tmp.tm_hour );
	nTime->setNumber(1, tmp.tm_min );
	cyear->setCurrent( (void*) tmp.tm_year );
	cmonth->setCurrent( (void*) tmp.tm_mon, true );
	cday->setCurrent( (void*) tmp.tm_mday );
}
Esempio n. 8
0
void eNFSSetup::init_eNFSSetup()
{
	bool have_cifs=false;
	bool have_smbfs=false;
	FILE *f=fopen("/proc/filesystems", "rt");
	if (f)
	{
		while (1)
		{
			char buffer[128];
			if (!fgets(buffer, 128, f))
				break;
			if ( strstr(buffer, "cifs") )
				have_cifs=true;
			if ( strstr(buffer, "smbfs") )
				have_smbfs=true;
		}
		fclose(f);
	}

	CONNECT(timeout.timeout, eNFSSetup::mountTimeout);
	__u32 sip=ntohl(0x0a000061);
    
	int de[4];

	lip = CreateSkinnedLabel("lip");

	eNumber::unpack(sip, de);
	ip=CreateSkinnedNumber("ip",0, 4, 0, 255, 3, de, 0, lip);
	ip->setFlags(eNumber::flagDrawPoints);
	CONNECT(ip->selected, eNFSSetup::fieldSelected);

	combo_fstype=CreateSkinnedComboBox("combo_fstype", 2);
	new eListBoxEntryText( *combo_fstype, "NFS", (void*)0, 0, "Network File System");
	if (have_cifs)
		new eListBoxEntryText( *combo_fstype, "CIFS", (void*)1, 0, "Common Internet File System");
	if (have_smbfs)
		new eListBoxEntryText( *combo_fstype, "SMBFS", (void*)2, 0, _("Samba File System(to mount share from another Dreambox)"));
	combo_fstype->setCurrent(0,true);
	CONNECT(combo_fstype->selchanged, eNFSSetup::fstypeChanged);

	lsdir = CreateSkinnedLabel("lsdir");

	sdir = CreateSkinnedTextInputField("sdir",0);
	sdir->setUseableChars("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.,:|!?/");

	lldir = CreateSkinnedLabel("lldir");

	ldir = CreateSkinnedTextInputField("ldir",0);
	ldir->setUseableChars("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.,:|!?/");

	loptions = CreateSkinnedLabel("lcombo_options");

	combo_options=CreateSkinnedComboBox("combo_options", 3, loptions);
	new eListBoxEntryText( *combo_options, "", (void*)0, 0);
	new eListBoxEntryText( *combo_options, "ro", (void*)1, 0);
	new eListBoxEntryText( *combo_options, "rw", (void*)2, 0);
	new eListBoxEntryText( *combo_options, "ro,nolock", (void*)3, 0);
	new eListBoxEntryText( *combo_options, "rw,nolock", (void*)4, 0);
	new eListBoxEntryText( *combo_options, "ro,soft", (void*)5, 0);
	new eListBoxEntryText( *combo_options, "rw,soft", (void*)6, 0);	
	new eListBoxEntryText( *combo_options, "ro,soft,nolock", (void*)7, 0);
	new eListBoxEntryText( *combo_options, "rw,soft,nolock", (void*)8, 0);	
	new eListBoxEntryText( *combo_options, "ro,udp,nolock", (void*)9, 0);
	new eListBoxEntryText( *combo_options, "rw,udp,nolock", (void*)10, 0);
	new eListBoxEntryText( *combo_options, "ro,soft,udp", (void*)11, 0);
	new eListBoxEntryText( *combo_options, "rw,soft,udp", (void*)12, 0);
	new eListBoxEntryText( *combo_options, "ro,soft,udp,nolock", (void*)13, 0);
	new eListBoxEntryText( *combo_options, "rw,soft,udp,nolock", (void*)14, 0);
	combo_options->setCurrent(0,true);

	lextras = CreateSkinnedLabel("lextraoptions");

	extraoptions=CreateSkinnedTextInputField("extraoptions",0);
	extraoptions->setMaxChars(100);

	luser = CreateSkinnedLabel("luser");

	user=CreateSkinnedTextInputField("user",0);
	user->setMaxChars(100);

	lpass = CreateSkinnedLabel("lpass");

	pass=CreateSkinnedTextInputField("pass",0);
	pass->setMaxChars(100);

	doamount=CreateSkinnedCheckbox("doamount");

	//buttons
	prev = CreateSkinnedButton("prev");
	CONNECT(prev->selected, eNFSSetup::prevPressed);

	CONNECT(CreateSkinnedButton("umount")->selected, eNFSSetup::umountPressed);

	CONNECT(CreateSkinnedButton("mount")->selected, eNFSSetup::mountPressed);

	CONNECT(CreateSkinnedButton("ok")->selected, eNFSSetup::okPressed);

	next = CreateSkinnedButton("next");
	CONNECT(next->selected, eNFSSetup::nextPressed);

	BuildSkin("eNFSSetup");

	cur_entry=0;
	headline.sprintf("Mount Manager(%d/%d)",cur_entry + 1, MAX_NFS_ENTRIES);
	setText(headline);

	load_config();
}
Esempio n. 9
0
void eZapNetworkSetup::init_eZapNetworkSetup()
{
	__u32 sip=ntohl(0x0a000061),
				snetmask=ntohl(0xFF000000),
				sdns=ntohl(0x7f000001),
				sgateway=ntohl(0x7f000001);

	int de[4];
	int sdosetup=0;
	int connectionType=0;
	int webifport=80;
	int useDHCP=0;

#ifdef USE_IFUPDOWN
	bool automatic_start;
	std::string Ip, Netmask, Broadcast, Gateway;
	useDHCP=!getInetAttributes("eth0", automatic_start, Ip, Netmask, Broadcast, Gateway);
	sdosetup=automatic_start;
#else
	eConfig::getInstance()->getKey("/elitedvb/network/usedhcp", useDHCP);
	eConfig::getInstance()->getKey("/elitedvb/network/dosetup", sdosetup);
#endif
	if (useDHCP)
	{
		getIP("eth0", sip, snetmask);
		getDefaultGateway(sgateway);
		getNameserver(sdns);
	}
	else
	{
#ifdef USE_IFUPDOWN
		int tmp[4];
		if ( sscanf(Ip.c_str(), "%d.%d.%d.%d", tmp, tmp+1, tmp+2, tmp+3) == 4 )
			sip = tmp[0]<<24 | tmp[1] << 16 | tmp[2] << 8 | tmp[3];
		else
			eDebug("couldn't parse ip(%s)", Ip.length()?Ip.c_str():"");

		if ( sscanf(Netmask.c_str(), "%d.%d.%d.%d", tmp, tmp+1, tmp+2, tmp+3) == 4 )
			snetmask = tmp[0]<<24 | tmp[1] << 16 | tmp[2] << 8 | tmp[3];
		else
			eDebug("couldn't parse netmask(%s)", Netmask.length()?Netmask.c_str():"");

		if ( sscanf(Gateway.c_str(), "%d.%d.%d.%d", tmp, tmp+1, tmp+2, tmp+3) == 4 )
			sgateway = tmp[0]<<24 | tmp[1] << 16 | tmp[2] << 8 | tmp[3];
		else
			eDebug("couldn't parse gateway(%s)", Gateway.length()?Gateway.c_str():"");

		getNameserver(sdns);  // read always from /etc/resolv.conf
#else
		eConfig::getInstance()->getKey("/elitedvb/network/ip", sip);
		eConfig::getInstance()->getKey("/elitedvb/network/netmask", snetmask);
		eConfig::getInstance()->getKey("/elitedvb/network/gateway", sgateway);
		eConfig::getInstance()->getKey("/elitedvb/network/dns", sdns);
#endif
	}
	eConfig::getInstance()->getKey("/elitedvb/network/connectionType", connectionType);
	eConfig::getInstance()->getKey("/elitedvb/network/webifport", webifport);

	eNumber::unpack(sip, de);
	ip=CreateSkinnedNumberWithLabel("ip",0, 4, 0, 255, 3, de, 0, "lip", !useDHCP);
	ip->setFlags(eNumber::flagDrawPoints);
	CONNECT(ip->selected, eZapNetworkSetup::fieldSelected);

	dhcp = CreateSkinnedCheckbox("dhcp", useDHCP);
	CONNECT(dhcp->checked, eZapNetworkSetup::dhcpStateChanged);

	eNumber::unpack(snetmask, de);
	netmask=CreateSkinnedNumberWithLabel("netmask",0, 4, 0, 255, 3, de, 0, "lnetmask", !useDHCP);
	netmask->setFlags(eNumber::flagDrawPoints);
	CONNECT(netmask->selected, eZapNetworkSetup::fieldSelected);

	eListBoxEntryText *sel=0;
	combo_type=CreateSkinnedComboBoxWithLabel("combo_type", 3, "lcombo_type");
#ifdef ENABLE_PPPOE
	if ( !connectionType )
#endif
	{
		sel = new eListBoxEntryText( *combo_type, _("LAN"), (void*)0, 0, _("communicate to Local Area Network"));
#ifdef ENABLE_PPPOE
		new eListBoxEntryText( *combo_type, _("WAN(PPPoE)"), (void*)1, 0, _("communicate to the Internet via DSL"));
#endif
	}
#ifdef ENABLE_PPPOE
	else
	{
		new eListBoxEntryText( *combo_type, _("LAN"), (void*)0, 0, _("communicate to Local Area Network"));
		sel = new eListBoxEntryText( *combo_type, _("WAN(PPPoE)"), (void*)1, 0, _("communicate to the Internet via DSL"));
	}
	CONNECT(combo_type->selchanged, eZapNetworkSetup::typeChanged);
	tdsl = new eButton(this);
	tdsl->move(ePoint(340,90));
	tdsl->resize(eSize(100, fd+10));
	tdsl->setText("T-DSL");
	tdsl->loadDeco();
	tdsl->hide();
	tdsl->setHelpText(_("T-Online User press ok here"));
	CONNECT( tdsl->selected, eZapNetworkSetup::tdslPressed );
#endif

	eNumber::unpack(sdns, de);
	dns=CreateSkinnedNumberWithLabel("dns",0, 4, 0, 255, 3, de, 0, "lNameserver", !useDHCP);
	dns->setFlags(eNumber::flagDrawPoints);
	CONNECT(dns->selected, eZapNetworkSetup::fieldSelected);

#ifdef ENABLE_PPPOE
	lLogin=new eLabel(this);
	lLogin->setText(_("Login:"******"/elitedvb/network/login", strLogin);
	login=new eTextInputField(this,lLogin);
	login->move(ePoint(160, 130));
	login->resize(eSize(280, fd+10));
	login->setMaxChars(100);
	login->loadDeco();
	login->setHelpText(_("press ok to edit your provider login name"));
	if ( strLogin )
		login->setText(strLogin);
	login->hide();
	CONNECT(login->selected, eZapNetworkSetup::loginSelected );
#endif

	eNumber::unpack(sgateway, de);
	gateway=CreateSkinnedNumberWithLabel("gateway",0, 4, 0, 255, 3, de, 0, "lgateway", !useDHCP);
	gateway->setFlags(eNumber::flagDrawPoints);
	CONNECT(gateway->selected, eZapNetworkSetup::fieldSelected);

#ifdef ENABLE_PPPOE
	lPassword=new eLabel(this);
	lPassword->setText(_("Password:"******"press ok to edit your provider password"));
	password->hide();
	CONNECT(password->selected, eZapNetworkSetup::passwordSelected);
#endif

	dosetup=CreateSkinnedCheckbox("dosetup", sdosetup);

	port=CreateSkinnedNumberWithLabel("port",webifport, 1, 0, 65536, 5, 0, 0, "lport");
	port->setFlags(eNumber::flagDrawPoints);
	CONNECT(port->selected, eZapNetworkSetup::fieldSelected);

#ifdef ENABLE_PPPOE
	int flags = getRejectFlags();
	rejectWWW=new eCheckbox(this, flags&1, 1);
	rejectWWW->setText("WWW");
	rejectWWW->move(ePoint(20,255));
	rejectWWW->resize(eSize(90, fd+4));
	rejectWWW->setHelpText(eString().sprintf(_("reject incoming connections on port %d"), webifport));
	rejectWWW->hide();

	rejectTelnet=new eCheckbox(this, flags&2, 1);
	rejectTelnet->setText("Telnet");
	rejectTelnet->move(ePoint(130,255));
	rejectTelnet->resize(eSize(90, fd+4));
	rejectTelnet->setHelpText(eString().sprintf(_("reject incoming connections on port %d"), 23));
	rejectTelnet->hide();

	rejectSamba=new eCheckbox(this, flags&4, 1);
	rejectSamba->setText("Samba");
	rejectSamba->move(ePoint(240,255));
	rejectSamba->resize(eSize(100, fd+4));
	rejectSamba->setHelpText(_("reject incoming connections on ports 137,138,139"));
	rejectSamba->hide();

	rejectFTP=new eCheckbox(this, flags&8, 1);
	rejectFTP->setText("FTP");
	rejectFTP->move(ePoint(360,255));
	rejectFTP->resize(eSize(70, fd+4));
	rejectFTP->setHelpText(eString().sprintf(_("reject incoming connections on port %d"), 21));
	rejectFTP->hide();
#endif

	CONNECT(CreateSkinnedButton("ok")->selected, eZapNetworkSetup::okPressed);

#ifndef DISABLE_NFS
	nfs = CreateSkinnedButton("nfs");
	CONNECT(nfs->selected, eZapNetworkSetup::nfsPressed );
#else
	CreateSkinnedButton("nfs")->hide();
#endif

	BuildSkin("eZapNetworkSetup");
	setHelpID(82);

	combo_type->setCurrent(sel,true);

#ifdef ENABLE_PPPOE
	if ( readSecretString( secrets ) && secrets )
	{
		unsigned int pos = secrets.find("*");
		if ( pos != eString::npos )
		{
			login->setText( secrets.left(pos) );
			password->setText("******");
		}
	}
#endif
}
Esempio n. 10
0
void eHelpWindow::init_eHelpWindow(ePtrList<eAction> &parseActionHelpList, int helpID)
{
	int xpos=60, ypos=0, labelheight, imgheight;

	scrollbar = CreateSkinnedProgress("scrollbar",0,100);

	visible = new eWidget(this);
	visible->setName("visible");

	BuildSkin("eHelpWindow");

	scrollbox = new eWidget(visible);
	scrollbox->move(ePoint(0, 0));
	scrollbox->resize(eSize(visible->width(), visible->height()*8));

	const std::set<eString> &styles=eActionMapList::getInstance()->getCurrentStyles();

	lastEntry=0;
	entryBeg[lastEntry++]=0;
	int pageend=visible->height();

	for ( ePtrList<eAction>::iterator it( parseActionHelpList.begin() ); it != parseActionHelpList.end() ; it++ )
	{
		std::map< eString, keylist >::iterator b;
		
		for (std::set<eString>::const_iterator si(styles.begin()); si != styles.end(); ++si)
		{
			b=it->keys.find(*si);
			if (b == it->keys.end())
				continue;

			keylist &keys = b->second;
			for ( keylist::iterator i( keys.begin() ); i != keys.end() ; i++ )
			{
				imgheight=0;
				if ( strstr( i->producer->getDescription(), eSystemInfo::getInstance()->getHelpStr() ) )
				{
					if (i->picture)
					{
						gPixmap *image=eSkin::getActive()->queryImage(i->picture);

						if (image)
						{
							label = new eLabel(scrollbox);
							label->setFlags(eLabel::flagVCenter);
							label->move(ePoint(0, ypos));
							label->resize(eSize(xpos,image->y));
							label->setBlitFlags(BF_ALPHATEST);
							label->setPixmap(image);
							label->setPixmapPosition(ePoint((xpos-10)/2-image->x/2, 0));
						}
					}

					label = new eLabel(scrollbox);
					label->setFlags(eLabel::flagVCenter);
					label->setFlags(RS_WRAP);
					label->move(ePoint(xpos, ypos));
					label->resize(eSize(visible->width()-xpos-20, 200));
							// since they are inited before language is set,
							// call gettext again.
					label->setText(gettext(it->getDescription()));
					labelheight=label->getExtend().height();
					label->resize(eSize(visible->width()-xpos-20, labelheight));

					ypos+=(labelheight>imgheight?labelheight:imgheight)+20;
					if ( ypos-20 > pageend )
					{
						pageend=ypos-(labelheight>imgheight?labelheight:imgheight)-20;
						entryBeg[lastEntry++]=pageend;
						pageend+=visible->height();
					}
					break;  // add only once :)
				}
			}
		}
	}

	if (helpID)
	{
		eString helptext=loadHelpText(helpID);

		label = new eLabel(scrollbox);
		label->setFlags(eLabel::flagVCenter);
		label->setFlags(RS_WRAP);
		label->move(ePoint(0, ypos));
		label->resize(eSize(visible->width(), 200));
		label->setText(helptext);
		labelheight = label->getExtend().height();
		label->resize(eSize(visible->width(), labelheight));
		int tmp = ypos+labelheight;
		while ( tmp > pageend )
		{
			entryBeg[lastEntry++]=ypos;
			ypos+=visible->height();
			pageend=ypos;
		}
	}

	--lastEntry;
	cur = 0;
	doscroll=ypos>visible->height();

	if (!doscroll)
		scrollbar->hide();
	else
	  updateScrollbar();
	  
	addActionMap(&i_helpwindowActions->map);
}
Esempio n. 11
0
void eMainMenu::init_eMainMenu()
{
	simpleMainmenu=0;
	eConfig::getInstance()->getKey("/ezap/osd/simpleMainMenu", simpleMainmenu);

	if ( !simpleMainmenu )
	{
		addActionMap(&i_mainmenuActions->map);
		addActionMap(&i_cursorActions->map);
		addActionMap(&i_shortcutActions->map);
		CreateSkinnedLabel("background");

		label[0]=CreateSkinnedLabel("l3");
		label[1]=CreateSkinnedLabel("l2");
		label[2]=CreateSkinnedLabel("l1");
		label[3]=CreateSkinnedLabel("m");
		label[4]=CreateSkinnedLabel("r1");
		label[5]=CreateSkinnedLabel("r2");
		label[6]=CreateSkinnedLabel("r3");

		description=CreateSkinnedLabel("description");

		BuildSkin("eZapMainMenu");

			char *pixmap_name[]={
		"tv",
		"radio",
#ifndef DISABLE_FILE
		"file",
#endif
		"info",
#ifndef DISABLE_FILE
		"shutdown",
#endif
		"setup",
#ifndef DISABLE_FILE
		"games",
#endif
		"timer",
		"scart"
		};

		int count = MENU_ENTRIES;
		if (!eSystemInfo::getInstance()->hasScartSwitch())
			--count;
		for (int i=0; i<count; i++)
		{
			pixmaps[i][0]=eSkin::getActive()->queryImage(eString("mainmenu.") + eString(pixmap_name[i]) );
			pixmaps[i][1]=eSkin::getActive()->queryImage(eString("mainmenu.") + eString(pixmap_name[i]) + ".sel" );
			if (!pixmaps[i][0])
				eFatal("error, mainmenu bug, mainmenu.%s not defined", pixmap_name[i]);
			if (!pixmaps[i][1])
				eFatal("error, mainmenu bug, mainmenu.%s.sel not defined", pixmap_name[i]);
			pixmaps[i][0]->uncompressdata();
			pixmaps[i][1]->uncompressdata();
		}

		setActive(active=eZapMain::getInstance()->getMode());
	}
	else
	{
		CONNECT(wndShowTimer.timeout, eMainMenu::showWindow);
		wnd.cmove(ePoint(180, 115));
		int entry=0;
		int count = MENU_ENTRIES;
		for (int i=0; i<count; i++)
		{
			pixmaps[i][0]=NULL;
			pixmaps[i][1]=NULL;
		}
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("TV mode"), eString().sprintf("(%d) %s", ++entry, _("TV mode")) ))->selected, eMainMenu::sel_tv);
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Radio mode"), eString().sprintf("(%d) %s", ++entry, _("Radio mode")) ))->selected, eMainMenu::sel_radio);
#ifndef DISABLE_FILE
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("File mode"), eString().sprintf("(%d) %s", ++entry, _("File mode")) ))->selected, eMainMenu::sel_file);
		if ( eSystemInfo::getInstance()->hasScartSwitch() )
			CONNECT((new eListBoxEntryMenu(wnd.getList(), _("VCR"), eString().sprintf("(%d) %s", ++entry, _("VCR")) ))->selected, eMainMenu::sel_vcr);
		new eListBoxEntryMenuSeparator(wnd.getList(), eSkin::getActive()->queryImage("listbox.separator"), 0, true );
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Timer"), eString().sprintf("(%d) %s", ++entry, _("Timer")) ))->selected, eMainMenu::sel_timer);
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Setup"), eString().sprintf("(%d) %s", ++entry, _("Setup")) ))->selected, eMainMenu::sel_setup);
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Games"), eString().sprintf("(%d) %s", ++entry, _("Games")) ))->selected, eMainMenu::sel_plugins);
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Information"), eString().sprintf("(%d) %s", ++entry, _("Information")) ))->selected, eMainMenu::sel_info);
		new eListBoxEntryMenuSeparator(wnd.getList(), eSkin::getActive()->queryImage("listbox.separator"), 0, true );
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Shutdown"), eString().sprintf("(%d) %s", ++entry, _("Shutdown")) ))->selected, eMainMenu::sel_quit);
#else
		if ( eSystemInfo::getInstance()->hasScartSwitch() )
			CONNECT((new eListBoxEntryMenu(wnd.getList(), _("VCR"), eString().sprintf("(%d) %s", ++entry, _("VCR")) ))->selected, eMainMenu::sel_vcr);
		new eListBoxEntryMenuSeparator(wnd.getList(), eSkin::getActive()->queryImage("listbox.separator"), 0, true );
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Timer"), eString().sprintf("(%d) %s", ++entry, _("Timer")) ))->selected, eMainMenu::sel_timer);
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Setup"), eString().sprintf("(%d) %s", ++entry, _("Setup")) ))->selected, eMainMenu::sel_setup);
		new eListBoxEntryMenuSeparator(wnd.getList(), eSkin::getActive()->queryImage("listbox.separator"), 0, true );
		CONNECT((new eListBoxEntryMenu(wnd.getList(), _("Information"), eString().sprintf("(%d) %s", ++entry, _("Information")) ))->selected, eMainMenu::sel_info);
#endif
	}
	setHelpID(10);
}
Esempio n. 12
0
eDownloadWindow::eDownloadWindow(const char *url): eWindow(), url(url)
{
	c=0;
	BuildSkin("eDownloadWindow");
}