[QUESTION]HDD settings hide

Alles rund um das grafische Benutzerinterface Enigma
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

[QUESTION]HDD settings hide

Beitrag von fergy »

Hello all.
What You think about to hide HDD setup from menu when it's not attached to box ( sure, an IDE disk ) ?

I was think about this:

under system_settings.cpp, to add:

Code: Alles auswählen

FILE *F;
	if ( eSystemInfo::getInstance()->hasHDD() )
		if ((F = fopen ("/dev/scsi/host0/bus0/target0/lun0/disc", "r")) != NULL)
		{
		fclose (F);
		CONNECT((new eListBoxEntryMenu(&list, _("Hard disc Setup"), eString().sprintf("(%d) %s", ++entry, _("open hard disc setup")) ))->selected, eSystemSettings::harddisc_setup);
		}
because, there are still lot's of people who don't have hdd in 7000/7020/etc boxes, so why to menu be shown in disk is not present? :gruebel:
OK, maybe

Code: Alles auswählen

/dev/scsi/host0/bus0/target0/lun0/disc
is not so great idea..... :dash:
Just an idea.
Tommy
Tuxboxer
Tuxboxer
Beiträge: 4332
Registriert: Dienstag 7. Mai 2002, 17:04

Re: [QUESTION]HDD settings hide

Beitrag von Tommy »

the idea is not bad but keep in mind that kernel2.6 images use an other device :-?
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: [QUESTION]HDD settings hide

Beitrag von fergy »

Thank You for reply @Tommy
As I say, path is just as is, but, sure if idea will be support, We can use other way.
No problem at all.
Cheers
Tommy
Tuxboxer
Tuxboxer
Beiträge: 4332
Registriert: Dienstag 7. Mai 2002, 17:04

Re: [QUESTION]HDD settings hide

Beitrag von Tommy »

I would bind it on the fail of driverload and a /var/tuxbox/config/.noIDE flag but I'm really not an expert. Maybe you also can use the menu customizing functionalty to simply hide the submenu. But I speak about neutrino :oops:
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: [QUESTION]HDD settings hide

Beitrag von fergy »

Well, as We was in Enigma thread.... I will not put My nose in Neutrino stuff, but if someone like idea, ok.
Anyway, I am talking about Dreambox, not Dbox, so I don't think that there will be problem if I use /dev/scsi as it mount hdd there....
Will try to recompile and see what will be.
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: [QUESTION]HDD settings hide

Beitrag von fergy »

fergy hat geschrieben:Hello all.
What You think about to hide HDD setup from menu when it's not attached to box ( sure, an IDE disk ) ?

I was think about this:

under system_settings.cpp, to add:

Code: Alles auswählen

FILE *F;
	if ( eSystemInfo::getInstance()->hasHDD() )
		if ((F = fopen ("/dev/scsi/host0/bus0/target0/lun0/disc", "r")) != NULL)
		{
		fclose (F);
		CONNECT((new eListBoxEntryMenu(&list, _("Hard disc Setup"), eString().sprintf("(%d) %s", ++entry, _("open hard disc setup")) ))->selected, eSystemSettings::harddisc_setup);
		}
because, there are still lot's of people who don't have hdd in 7000/7020/etc boxes, so why to menu be shown in disk is not present? :gruebel:
OK, maybe

Code: Alles auswählen

/dev/scsi/host0/bus0/target0/lun0/disc
is not so great idea..... :dash:
Just an idea.
This work on Dreambox.
Tested on 7000.
dbluelle
Contributor
Beiträge: 319
Registriert: Samstag 29. Mai 2004, 18:49

Re: [QUESTION]HDD settings hide

Beitrag von dbluelle »

I think the best way would be to check if MOVIEDIR (/hdd/movies/) is accessible
This is done in freeRecordSpace() in enigma_main.cpp:

Code: Alles auswählen

int freeRecordSpace()
{
	struct statfs s;
	int free;
	if (statfs(MOVIEDIR, &s)<0)
		free=-1;
	else
		free=s.f_bfree/1000*s.f_bsize/1000;
	return free;
}
So you don't have to mess around with the different devices.

dbluelle
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: [QUESTION]HDD settings hide

Beitrag von fergy »

Ahh, thank You!