Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » More new functions
Re: More new functions [message #19200 is a reply to message #18804] Wed, 19 November 2008 17:44 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3432
Registered: August 2008
Senior Veteran
Here it is!

I enclose you two folders:
- SysInfo: The package
---- SysInfo.cpp
---- SysInfo.h
---- SysInfo.upp
- SysInfo demo non-gui: A command line sample
---- main.cpp: The sample
---- SysInfo demo non-gui.upp

Finally I have included much more functions. Just run the demo program and play with it.

There are "SysInfo" functions and others, mainly because they were necessary. Please tell me the best way to organize them to be enclosed some in bazaar and some in other packages.

The next steps will be in addition to do a gui demo and to test the commands in more distros and OS as FreeBSD, OpenSolaris, Slackware and Knoppix. And of course to fix bugs and include more things if you want.

Best regards
Koldo

PD. I enclose you part of the program output as a sample:


Introduce enter or (l) to log off, (r) to reboot or (s) to shutdown
Introduce number of test cycles or just type enter to run it once:
SysInfo functions demo

Special folders
Desktop: /home/aupa/Escritorio
Programs: /usr/bin
Application Data: /home/aupa
Music: /home/aupa/Escritorio
Pictures: /home/aupa/Escritorio
Video: /home/aupa/Escritorio
Personal: /home/aupa/Escritorio
Templates: /home/aupa/Escritorio
Download: /home/aupa/Escritorio
Temp: /home/aupa
Os: /bin
System:

System info:
System manufacturer 'TOSHIBA', product name 'Satellite A300',
version 'PSWJ0E-21403CE', number of processors: 2
Real CPU Speed: 1.830 GHz
Battery info
Working with battery: yes, Percentage: 85%, Remaining; 151 min
Bios version 'V2.70 ',
release date '04/14/2008'
Processor #0: Vendor 'GenuineIntel',
identifier 'Intel(R) Core(TM)2 Duo CPU T5550 @ 1.83GHz',
architecture 'i686
Family 6 Model 15 Stepping 13', speed 1833 MHz
Processor #1: Vendor 'GenuineIntel',
identifier 'Intel(R) Core(TM)2 Duo CPU T5550 @ 1.83GHz',
architecture 'i686
Family 6 Model 15 Stepping 13', speed 1833 MHz

Press enter to continue...

Memory info:
Percent of memory in use: 75%
Total physical memory: 2116001792 bytes (2.0Gb)
Free physical memory: 518352896 bytes (494.3Mb)
Total paging file: 729112576 bytes (695.3Mb)
Free paging file: 0 bytes (0b)
Total virtual memory: 4721266688 bytes (4.4Gb)
Free virtual memory: 4721266688 bytes (4.4Gb)

Os info:
Kernel: Linux, version: 2.6.24-21-generic #1 SMP Tue Oct 21 23:43:45 UTC 2008,
architecture: i686

Distro: ubuntu, version: 8.04
Desktop: gnome, version: 2.22.3

Program compiled with gnuc version 40103. Compilation date: Nov 19 2008

Default exes info:
Default program for 'html' is 'firefox.desktop'
Default program for 'doc' is 'ooo-writer.desktop'
Default program for 'png' is 'eog.desktop'
Default program for 'pdf' is 'evince.desktop'
Default program for 'txt' is 'gedit.desktop'
Default program for 'xyz' is ''

Drives list:
Drive path:'/'
Type: 'Hard', Volume: 'Linux',
MaxName: 255, File System: ext3
Free Bytes User: 46895562752 (43.7Gb)
Total Bytes User: 54519554048 (50.8Gb), Total Free Bytes: 46895562752 (43.7Gb)
Drive path:'/home'
Type: 'Hard', Volume: 'Shared drive',
MaxName: 255, File System: ext3
Free Bytes User: 71834021888 (66.9Gb)
Total Bytes User: 130094362624 (121.2Gb), Total Free Bytes: 71834021888 (66.9Gb)

Other Info:
Process Id: 17248
Process name: 'demo'
Process file name: '/home/exe/demo'
Process priority is: 5
Now changed to high priority: No
Process priority is: 5

Launch file 'test.txt':

If modify 'test.txt' it will ask you to save or not the file
If you answer Yes or No the program will be terminated
If you answer Cancel or wait more than 5 seconds the program will be killed

Press enter to terminate 'test.txt'
Process terminated

Windows list:
Window hwnd: 41943086, processId: 6154, Name: gdesklets-daemon
File name: /usr/bin/python2.5
Window caption: 'gdesklets-daemon '
Window hwnd: 16821977, processId: 5995, Name: nautilus
File name: /usr/bin/nautilus
Window caption: 'SysInfo demo non-gui - Navegador de archivos '
Window hwnd: 35654762, processId: 0, Name: theide-svn
File name:
Window caption: 'SysInfo demo non-gui - - TheIDE - [/home/SysInfo/SysInfo.cpp UTF-8] { MyApps } '

Process list:
Id 5898: Priority: 5, Program: /usr/bin/gnome-session
Id 5948: Priority: 5, Program: /usr/lib/libgconf2-4/gconfd-2
Id 5956: Priority: 5, Program: /usr/bin/seahorse-agent
Id 17071: Priority: 5, Program: /usr/bin/theide-svn
  • Attachment: SysInfo.7z
    (Size: 17.96KB, Downloaded 407 times)


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Simple app-wide "macros"
Next Topic: Grid helper
Goto Forum:
  


Current Time: Thu May 08 07:35:58 CEST 2025

Total time taken to generate the page: 0.03142 seconds