Re: [PATCH] Don't display permission emblem for abstract locations, add "Computer" properties pages



On Sat, 2005-11-19 at 12:24 +0100, Christian Neumair wrote:
> The attached patch makes Nautilus not display permission emblems and
> permissions in the properties dialog for locations for locations like
> "computer:///", "network:///" etc. and also adds a "Computer" properties
> page.

I'd like the nautilus_file_should_show_permissions() call to be a bit
more efficient, looking at file->details->directory->details->vfs_uri
instead of nautilus_file_get_uri() with all the string operations and
memory allocation it will cause. This is called for every file while
reading a folder after all.

> My initial plan was to use libgtop, but it turned out to be not that
> useful, because for in-depth information you always need other apps like
> "hal-device-manager". Therefore, I've modified Nautilus to display links
> to these applications on the "Computer" page.
> 
> The "hal-device-manager" desktop file is in the capplet directory, and
> therefore requires a GnomeVFS API addition.

I don't think a new way of launching certain applications like that is
particularly useful. I was thinging more a very simple page that lists:
* hostname
* cpu type
* cpu speed
* nr of cpus
* memory size

Something like:
Computer <hostname>
  <b>Processor:</b> AMD Athlon(TM) XP 2600+
  <b>Processor speed:</b> 2071 MHz
  <b>Nr of processors:</b> 1
  <b>Memory Size:</b> 512 Mb

These are the simple things you might see in an ad for a computer. No
fancy stuff, if you want that you can launch one of the apps that does
that well.

Easy API to get this is: gethostname(), get_nprocs(),
get_phys_pages()*getpagesize(). The last two are glibc-only (i think,
although they might be availible elsewhere too), so we would need
corresponding ifdefs or autoconf checks.

The hard part is the CPU type. We can parse /proc/cputype with some
simple g_file_get_contents + g_strsplit + g_str_has_prefix. The only
problem is that cpuinfo format is arch dependent. Here are some snippets
from various machines:

i386 machines:

model name      : AMD Athlon(TM) XP 2600+
cpu MHz         : 2071.201

model name      : AMD Athlon(tm) Processor
cpu MHz         : 702.183

(This is a laptop with scaling cpu frequency)
model name      : Intel(R) Pentium(R) M processor 1700MHz
cpu MHz         : 599.577

IA64 machine:

processor  : 3
vendor     : GenuineIntel
arch       : IA-64
family     : Itanium 2
model      : 2
revision   : 1
archrev    : 0
features   : branchlong
cpu number : 0
cpu regs   : 4
cpu MHz    : 1695.407994
itc MHz    : 1695.407994
BogoMIPS   : 2533.35

PPC64 machine:

processor       : 7
cpu             : POWER4+ (gq)
clock           : 1200MHz
revision        : 2.1

S390 machine:

vendor_id       : IBM/S390
# processors    : 8
bogomips per cpu: 1769.47
processor 0: version = 00,  identification = 01D48C,  machine = 2084
processor 1: version = 00,  identification = 01D48C,  machine = 2084
processor 2: version = 00,  identification = 01D48C,  machine = 2084
processor 3: version = 00,  identification = 01D48C,  machine = 2084
processor 4: version = 00,  identification = 01D48C,  machine = 2084
processor 5: version = 00,  identification = 01D48C,  machine = 2084
processor 6: version = 00,  identification = 01D48C,  machine = 2084
processor 7: version = 00,  identification = 01D48C,  machine = 2084


x86-64 machines:

intel:
processor       : 3
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      :                   Intel(R) Xeon(TM) CPU 3.60GHz
stepping        : 3
cpu MHz         : 3600.280
cache size      : 2048 KB
physical id     : 3
siblings        : 2
core id         : 3
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall
lm pni monitor ds_cpl est tm2 cid cx16 xtpr
bogomips        : 7192.57
clflush size    : 64
cache_alignment : 128
address sizes   : 36 bits physical, 48 bits virtual
power management:

amd:
processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 37
model name      : unknown
stepping        : 1
cpu MHz         : 2591.966
cache size      : 1024 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm
3dnowext 3dnow pni
bogomips        : 5177.34
TLB size        : 1088 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a war-weary overambitious shaman who hides his scarred face behind a 
mask. She's a violent Buddhist wrestler with a flame-thrower. They fight 
crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]