Skip to content

Commit

Permalink
Update USB_Drives.module
Browse files Browse the repository at this point in the history
New show lsusb Device
New Update-Usbids
  • Loading branch information
eloaders committed Jan 31, 2012
1 parent d1e880c commit 02bc685
Show file tree
Hide file tree
Showing 8 changed files with 340 additions and 330 deletions.
Binary file modified src/i-nex/.gambas/FINFOSYS
Binary file not shown.
Binary file modified src/i-nex/.gambas/USB_DRIVES
Binary file not shown.
246 changes: 129 additions & 117 deletions src/i-nex/.lang/.pot

Large diffs are not rendered by default.

246 changes: 129 additions & 117 deletions src/i-nex/.lang/Finfosys.pot

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/i-nex/.settings
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ SearchString=True
[OpenFile]
Active=1
File[1]=".src/Finfosys.form"
File[2]=".src/Finfosys.class:564.1"
File[2]=".src/Finfosys.class:552.19"
File[3]=".src/Global.class:120.69"
File[4]=".src/About.form"
File[5]=".src/About.class:29.47"
File[6]=".src/Flicencja.form"
File[7]=".src/Fzaslugi.form"
File[8]=".src/Fzaslugi.class:35.0"
File[9]=".src/Flicencja.class:4.11"
File[10]=".src/distrodetect.class:7.35"
File[10]=".src/distrodetect.class:41.7"
File[11]=".src/battery.module:20.18"
File[12]=".src/Disk_Drives.module:53.22"
File[13]=".src/ScreenShot.form"
Expand Down
7 changes: 3 additions & 4 deletions src/i-nex/.src/Finfosys.class
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Public Sub Form_Open()
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.."
Expand Down Expand Up @@ -560,8 +558,9 @@ Public Sub ComboBox5_Click()

End

Public Sub ComboBox6_Click()
Public Sub Button11_Click()

USB_Drives.get_informations_2()
Shell "gksu update-usbids" Wait
USB_Drives.get_informations()

End
101 changes: 52 additions & 49 deletions src/i-nex/.src/Finfosys.form
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@
Text = ("USB")
Picture = Picture["icon:/16/connect"]
{ HBox12 HBox
Move(0,204,468,24)
Move(0,0,468,24)
{ Label70 Label
Move(0,0,144,24)
Font = Font["Bold,11"]
Expand All @@ -1034,100 +1034,103 @@
ReadOnly = True
}
}
{ HBox13 HBox
Move(0,6,468,24)
{ Label71 Label
Move(0,0,84,24)
{ HPanel3 HPanel
Move(0,24,330,126)
{ Label68 Label
Move(0,0,66,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("The main USB devices: ")
Text = ("Product: ")
}
{ ComboBox6 ComboBox
Move(90,0,144,24)
{ TextBox40 TextBox
Move(150,0,144,24)
Expand = True
ReadOnly = True
}
}
{ HPanel2 HPanel
Move(0,30,468,162)
{ Label72 Label
Move(0,0,144,24)
{ Label69 Label
Move(0,24,78,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Product: ")
Text = ("Max power: ")
}
{ TextBox43 TextBox
Move(144,6,144,24)
{ TextBox41 TextBox
Move(150,24,144,24)
Expand = True
ReadOnly = True
}
{ Label73 Label
Move(0,24,144,24)
{ Label75 Label
Move(0,48,96,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Max power: ")
Text = ("Manufacturer: ")
}
{ TextBox44 TextBox
Move(144,36,144,24)
{ TextBox42 TextBox
Move(150,48,144,24)
Expand = True
ReadOnly = True
}
{ Label74 Label
Move(0,48,144,24)
{ Label79 Label
Move(0,72,144,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Manufacturer: ")
Text = ("Speed: ")
}
{ TextBox45 TextBox
Move(144,66,144,24)
{ TextBox46 TextBox
Move(150,72,144,24)
Expand = True
ReadOnly = True
}
}
{ HPanel3 HPanel
Move(0,228,468,222)
{ Label68 Label
Move(0,0,66,24)
{ Label76 Label
Move(0,96,144,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Product: ")
Text = ("Version: ")
}
{ TextBox40 TextBox
Move(150,0,144,24)
{ TextBox49 TextBox
Move(150,96,144,24)
Expand = True
ReadOnly = True
}
{ Label69 Label
Move(0,24,78,24)
}
{ HPanel4 HPanel
Move(330,24,138,126)
{ Label81 Label
Move(0,0,78,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Max power: ")
Text = ("idVendor: ")
}
{ TextBox41 TextBox
Move(150,24,144,24)
{ TextBox51 TextBox
Move(72,0,144,24)
Expand = True
ReadOnly = True
}
{ Label75 Label
Move(0,48,96,24)
{ Label80 Label
Move(0,24,144,24)
Font = Font["Bold,11"]
Padding = 4
AutoResize = True
Text = ("Manufacturer: ")
Text = ("idProduct: ")
}
{ TextBox42 TextBox
Move(150,48,144,24)
{ TextBox50 TextBox
Move(90,24,144,24)
Expand = True
}
}
{ HPanel2 HPanel
Move(0,150,468,24)
{ TextBox43 TextBox
Move(0,0,144,24)
Expand = True
ReadOnly = True
}
}
{ Separator1 Separator
Move(0,192,468,12)
{ Button11 Button
Move(156,180,144,24)
Text = ("Update usbids")
}
Index = 0
}
Expand Down
66 changes: 25 additions & 41 deletions src/i-nex/.src/USB_Drives.module
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
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 speed As String
Public Version As String
Public idProduct As String
Public idVendor As String
Public lsusb As String

Public Sub _init()

Expand All @@ -15,7 +17,7 @@ Dim righe As New String[]
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
Shell "ls /sys/bus/usb/devices/*/* | grep 'product' | grep [0-9] | cut -d '/' -f 6" To ListAllDiscs
righe = Split(ListAllDiscs, "\n", "%%", True)
For count = 0 To righe.Max
riga = Split(righe[count], " ", "%%", True)
Expand All @@ -26,54 +28,36 @@ Next
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
Shell "cat /sys/bus/usb/devices/" & Finfosys.ComboBox5.Text & "/speed" Wait To speed
Shell "cat /sys/bus/usb/devices/" & Finfosys.ComboBox5.Text & "/version" Wait To Version
Shell "cat /sys/bus/usb/devices/" & Finfosys.ComboBox5.Text & "/idProduct" Wait To idProduct
Shell "cat /sys/bus/usb/devices/" & Finfosys.ComboBox5.Text & "/idVendor" Wait To idVendor
Shell "lsusb -d " & idVendor & ":" & idProduct & "" Wait To lsusb
Debug lsusb
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", "")
speed = Replace(speed, "\n", "")
Version = Replace(Version, "\n", "")
idProduct = Replace(idProduct, "\n", "")
idVendor = Replace(idVendor, "\n", "")
Shell "lsusb -d " & idVendor & ":" & idProduct & "" Wait To lsusb
lsusb = Replace(lsusb, "\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
Finfosys.TextBox46.Text = speed
Finfosys.TextBox49.Text = Version
Finfosys.TextBox50.Text = idProduct
Finfosys.TextBox51.Text = idVendor
Finfosys.TextBox43.Text = lsusb

End

0 comments on commit 02bc685

Please sign in to comment.