Skip to content

Commit

Permalink
Add USB_Drives.module
Browse files Browse the repository at this point in the history
Fix ComboBox Read Only = True
  • Loading branch information
eloaders committed Jan 30, 2012
1 parent 88d5410 commit 16f70ef
Show file tree
Hide file tree
Showing 18 changed files with 511 additions and 224 deletions.
Binary file modified src/i-nex/.gambas/ABOUT
Binary file not shown.
Binary file modified src/i-nex/.gambas/BATTERY
Binary file not shown.
Binary file modified src/i-nex/.gambas/DISK_DRIVES
Binary file not shown.
Binary file modified src/i-nex/.gambas/FINFOSYS
Binary file not shown.
Binary file modified src/i-nex/.gambas/FLICENCJA
Binary file not shown.
Binary file modified src/i-nex/.gambas/FZASLUGI
Binary file not shown.
Binary file modified src/i-nex/.gambas/GLOBAL
Binary file not shown.
Binary file modified src/i-nex/.gambas/SCREENSHOT
Binary file not shown.
Binary file modified src/i-nex/.gambas/SCREENSHOTM
Binary file not shown.
Binary file added src/i-nex/.gambas/USB_DRIVES
Binary file not shown.
246 changes: 137 additions & 109 deletions src/i-nex/.lang/.pot

Large diffs are not rendered by default.

238 changes: 129 additions & 109 deletions src/i-nex/.lang/Finfosys.pot

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions src/i-nex/.lang/USB_Drives.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# /home/michal/Baazar/i-nex/src/i-nex/.src/USB_Drives.module
# Generated by Gambas compiler

# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n""POT-Creation-Date: 2002-11-01 04:27+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

11 changes: 7 additions & 4 deletions src/i-nex/.settings
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ SearchString=True

[OpenFile]
File[1]=".src/Finfosys.form"
Active=2
File[2]=".src/Finfosys.class:7.46"
File[2]=".src/Finfosys.class:554.17"
File[3]=".src/Global.class:120.69"
File[4]=".src/About.form"
File[5]=".src/About.class:29.47"
Expand All @@ -27,11 +26,15 @@ File[8]=".src/Fzaslugi.class:35.0"
File[9]=".src/Flicencja.class:4.11"
File[10]=".src/distrodetect.class:7.35"
File[11]=".src/battery.module:20.18"
File[12]=".src/Disk_Drives.module:80.31"
File[12]=".src/Disk_Drives.module:125.62"
File[13]=".src/ScreenShot.form"
File[14]=".src/ScreenShot.class:8.10"
File[15]=".src/ScreenShotM.module:2.21"
Count=15
File[16]=".src/DmidecodeM.module:8.37"
Active=17
File[17]=".src/GetPassword.form"
File[18]=".src/GetPassword.class:15.3"
Count=18

[Watches]
Count=0
Expand Down
7 changes: 6 additions & 1 deletion src/i-nex/.src/Disk_Drives.module
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Dim righe As New String[]
Dim count As Integer
Dim riga As New String[]
Dim lista As New String[]
Debug "Add Drives to ComboBox"
Shell "ls /sys/block/ | grep 'sd'" To ListAllDiscs
righe = Split(ListAllDiscs, "\n", "%%", True)
For count = 0 To righe.Max
Expand All @@ -53,6 +54,7 @@ Dim righe As New String[]
Dim count As Integer
Dim riga As New String[]
Dim lista As New String[]
Debug "Add Drives to ComboBox.."
Shell "ls /sys/block/" & Finfosys.ComboBox4.Text & " | grep 'sd'" To ListAllDiscs
righe = Split(ListAllDiscs, "\n", "%%", True)
For count = 0 To righe.Max
Expand All @@ -65,7 +67,7 @@ Next
End

Public Sub get_informations()

Debug "Get informations of Drives"
Shell "cat /sys/block/" & Finfosys.ComboBox4.Text & "/device/model" Wait To device_model
Shell "cat /sys/block/" & Finfosys.ComboBox4.Text & "/device/vendor" Wait To device_vendor
Shell "cat /sys/block/" & Finfosys.ComboBox4.Text & "/device/rev" Wait To device_rev
Expand Down Expand Up @@ -93,6 +95,8 @@ Public Sub get_informations()
Shell "ls -l /dev/disk/by-uuid/ | grep " & Finfosys.ComboBox3.Text & " | awk {'print $8'}" Wait To device_uuid
Shell "swapon -s | sed -n '2p' | awk {'print $1'} | cut -d '/' -f 3" Wait To check_swap
Shell "df | grep '" & Finfosys.ComboBox3.Text & "' | awk {'print $5'} | sed -n '1p'" Wait To used
Debug "Get informations of Drives Done"
Debug "Replace new line to Null"
rm_new_line()

End
Expand Down Expand Up @@ -127,6 +131,7 @@ Public Sub rm_new_line()
max_segment_size = Replace(max_segment_size, "\n", "")
read_ahead_kb = Replace(read_ahead_kb, "\n", "")
scheduler = Replace(scheduler, "\n", "")
Debug "Replace new line to Null Done"

End

20 changes: 20 additions & 0 deletions src/i-nex/.src/Finfosys.class
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
Public Sub Form_Open()
Dim default_display_manager As Boolean = Exist("/etc/X11/default-display-manager")
Dim cpuz0, cpuz1, cpuz2, cpuz3, cpuz4, cpuz5, cpuz6, cpuz7, cpuz8, cpuz9, cpuz10, cpuz11 As String
Debug "Check for Usb device plugged"
Object.Call(USB_Drives, "_init")
Debug "Check for The main USB devices"
Object.Call(USB_Drives, "_init_2")
Debug "Check for Drives"
Object.Call(Disk_Drives, "_init")
Debug "Check for Drives.."
Object.Call(Disk_Drives, "_init_2")
Debug "Check for Drives...."
Object.Call(Disk_Drives, "get_informations")
Debug "End Check Drives"
Debug "Check for default display manager"
If default_display_manager = True Then
Label4.Visible = True
Expand Down Expand Up @@ -545,3 +553,15 @@ Public Sub refreshing()
' TextArea8.Text = checking_device_uuid
' Endif
End

Public Sub ComboBox5_Click()

USB_Drives.get_informations()

End

Public Sub ComboBox6_Click()

USB_Drives.get_informations_2()

End
118 changes: 117 additions & 1 deletion src/i-nex/.src/Finfosys.form
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Move(0,0,474,486)
Tag = "System"
AutoResize = True
Count = 10
Count = 11
Index = 0
Text = ("CPU")
Picture = Picture["Data/Tabs/cpu.png"]
Expand Down Expand Up @@ -94,6 +94,7 @@
{ ComboBox1 ComboBox
Move(330,102,120,24)
Font = Font["10"]
ReadOnly = True
Text = ("Select core")
}
{ Label12 Label
Expand Down Expand Up @@ -414,6 +415,7 @@
}
{ ComboBox2 ComboBox
Move(14,259,217,21)
ReadOnly = True
Text = ("Wybierz rozdzielczość")
}
{ Button8 Button
Expand All @@ -430,9 +432,11 @@
Picture = Picture["Data/Tabs/hdd.png"]
{ ComboBox3 ComboBox
Move(120,6,108,24)
ReadOnly = True
}
{ ComboBox4 ComboBox
Move(6,6,108,24)
ReadOnly = True
}
{ Label16 Label
Move(6,36,288,24)
Expand Down Expand Up @@ -1013,6 +1017,118 @@
Move(438,426,24,24)
Picture = Picture["icon:/16/refresh"]
}
Index = 10
Text = ("USB")
Picture = Picture["icon:/16/connect"]
{ HBox12 HBox
Move(0,204,468,24)
{ Label70 Label
Move(0,0,144,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Usb device plugged: ")
}
{ ComboBox5 ComboBox
Move(168,0,144,24)
ReadOnly = True
}
}
{ HBox13 HBox
Move(0,6,468,24)
{ Label71 Label
Move(0,0,84,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("The main USB devices: ")
}
{ ComboBox6 ComboBox
Move(90,0,144,24)
ReadOnly = True
}
}
{ HPanel2 HPanel
Move(0,30,468,162)
{ Label72 Label
Move(0,0,144,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Product: ")
}
{ TextBox43 TextBox
Move(144,6,144,24)
Expand = True
ReadOnly = True
}
{ Label73 Label
Move(0,24,144,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Max power: ")
}
{ TextBox44 TextBox
Move(144,36,144,24)
Expand = True
ReadOnly = True
}
{ Label74 Label
Move(0,48,144,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Manufacturer: ")
}
{ TextBox45 TextBox
Move(144,66,144,24)
Expand = True
ReadOnly = True
}
}
{ HPanel3 HPanel
Move(0,228,468,222)
{ Label68 Label
Move(0,0,66,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Product: ")
}
{ TextBox40 TextBox
Move(150,0,144,24)
Expand = True
ReadOnly = True
}
{ Label69 Label
Move(0,24,78,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Max power: ")
}
{ TextBox41 TextBox
Move(150,24,144,24)
Expand = True
ReadOnly = True
}
{ Label75 Label
Move(0,48,96,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Manufacturer: ")
}
{ TextBox42 TextBox
Move(150,48,144,24)
Expand = True
ReadOnly = True
}
}
{ Separator1 Separator
Move(0,192,468,12)
}
Index = 0
}
{ Button2 Button
Expand Down
79 changes: 79 additions & 0 deletions src/i-nex/.src/USB_Drives.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
' Gambas module file

Public Product As String
Public bMaxPower As String
Public manufacturer As String
Public Product2 As String
Public bMaxPower2 As String
Public manufacturer2 As String

Public Sub _init()

Dim ListAllDiscs, risultato As String
Dim righe As New String[]
Dim count As Integer
Dim riga As New String[]
Dim lista As New String[]
Debug "Add Drives to ComboBox.."
Shell "ls /sys/bus/usb/devices/ --ignore='usb*' | grep [0-9]" To ListAllDiscs
righe = Split(ListAllDiscs, "\n", "%%", True)
For count = 0 To righe.Max
riga = Split(righe[count], " ", "%%", True)
risultato = Replace(riga[0], " ", "")
lista.add(risultato)
Next
Finfosys.ComboBox5.List = lista
Finfosys.ComboBox5.Index = 0
End

Public Sub _init_2()

Dim ListAllDiscs, risultato As String
Dim righe As New String[]
Dim count As Integer
Dim riga As New String[]
Dim lista As New String[]
Debug "Add Drives to ComboBox.."
Shell "ls /sys/bus/usb/devices/ | grep usb" To ListAllDiscs
righe = Split(ListAllDiscs, "\n", "%%", True)
For count = 0 To righe.Max
riga = Split(righe[count], " ", "%%", True)
risultato = Replace(riga[0], " ", "")
lista.add(risultato)
Next
Finfosys.ComboBox6.List = lista
Finfosys.ComboBox6.Index = 0

End

Public Sub get_informations()
Shell "cat /sys/bus/usb/devices/" & Finfosys.ComboBox5.Text & "/product" Wait To Product
Shell "cat /sys/bus/usb/devices/" & Finfosys.ComboBox5.Text & "/bMaxPower" Wait To bMaxPower
Shell "cat /sys/bus/usb/devices/" & Finfosys.ComboBox5.Text & "/manufacturer" Wait To manufacturer
export_informations()
End

Public Sub get_informations_2()
Shell "cat /sys/bus/usb/devices/" & Finfosys.ComboBox6.Text & "/product" Wait To Product2
Shell "cat /sys/bus/usb/devices/" & Finfosys.ComboBox6.Text & "/bMaxPower" Wait To bMaxPower2
Shell "cat /sys/bus/usb/devices/" & Finfosys.ComboBox6.Text & "/manufacturer" Wait To manufacturer2
export_informations_2()
End

Public Sub export_informations()
Product = Replace(Product, "\n", "")
bMaxPower = Replace(bMaxPower, "\n", "")
manufacturer = Replace(manufacturer, "\n", "")
Finfosys.TextBox40.Text = Product
Finfosys.TextBox41.Text = bMaxPower
Finfosys.TextBox42.Text = manufacturer
End

Public Sub export_informations_2()
Product2 = Replace(Product2, "\n", "")
bMaxPower2 = Replace(bMaxPower2, "\n", "")
manufacturer2 = Replace(manufacturer2, "\n", "")
Finfosys.TextBox43.Text = Product2
Finfosys.TextBox44.Text = bMaxPower2
Finfosys.TextBox45.Text = manufacturer2
End

0 comments on commit 16f70ef

Please sign in to comment.