Skip to content

Commit

Permalink
Add gui for udisks --show-info and some fixes in GUI and more standards
Browse files Browse the repository at this point in the history
I-Nex any windows have this same width and height.
Change screenshot, picture is now big
In drivers, add gui for udisks
  • Loading branch information
eloaders committed Nov 2, 2013
1 parent 02642b2 commit 4603bf1
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 15 deletions.
16 changes: 16 additions & 0 deletions src/i-nex/.lang/FCPU.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# /home/michal/Baazar/i-nex/src/i-nex/.src/FCPU.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"

44 changes: 44 additions & 0 deletions src/i-nex/.lang/FUdisks.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# /home/michal/Baazar/git-i-nex/src/i-nex/.src/FUdisks.class
# 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"

#: FUdisks.form:16
msgid "UDisks"
msgstr ""

#: FUdisks.form:29
msgid "Close this program"
msgstr ""

#: FUdisks.form:30
msgid "Close"
msgstr ""

#: FUdisks.form:54
msgid "About this app"
msgstr ""

#: FUdisks.form:60
msgid "Generate report"
msgstr ""

#: FUdisks.form:67
msgid "Report a bug"
msgstr ""

#: FUdisks.form:74
msgid "ComboBox1"
msgstr ""

2 changes: 1 addition & 1 deletion src/i-nex/.settings
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ SearchComment=False
SearchString=True

[OpenFile]
Active=1
File[1]=".src/Finfosys.form"
File[2]=".src/Global.class:92.57"
Active=3
File[3]=".src/About.form"
File[4]=".src/About.class:41.49"
File[5]=".src/battery.module:70.77"
Expand Down
10 changes: 10 additions & 0 deletions src/i-nex/.src/FCPU.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
' Gambas module file

'
Public Sub _init()

Dim central_processor_unit As String = Finfosys.cpu
central_processor_unit = Replace(Replace(Replace(central_processor_unit, "(", ""), "(", ""), "\n", "")
central_processor_unit = Replace(Replace(central_processor_unit, "TM", ""), "R", "")

End
64 changes: 64 additions & 0 deletions src/i-nex/.src/FUdisks.class
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
' Gambas class file


Public Sub Form_Open()
Udisks
Finfosys.Hide
Me.Center
End

Public Sub Button1_Click()

ScreenShotM.pic = Desktop.Screenshot(Me.X, Me.Y, Me.W + 4, Me.H + 30)
ScreenShot.Show

End

Public Sub Button2_Click()

Me.Close
Finfosys.Show
End

Public Sub Form_Close()

Me.Close
Finfosys.Show

End

Public Sub Udisks()

Dim sdx As String
Dim Avail_HDD As Integer
Dim Max_HDD As Integer
Dim cache As String
Debug "Add Drives to ComboBox"
Shell "ls /sys/block/ | grep -e 'sd' -e 'sr' | tr ' ' '\n' | wc -l" Wait To cache
Max_HDD = Val(cache)
For Avail_HDD = 1 To Max_HDD
Shell "ls /sys/block/ | grep -e 'sd' -e 'sr' | tr ' ' '\n' | sed -n '" & Avail_HDD & "p'" Wait To sdx
sdx = Replace(sdx, "\n", "")
ComboBox1.Add(sdx)
Next
Debug "Get information from udisks --show-info"
Udisks_get_info
End

Public Sub Udisks_get_info()
Dim native_path, device, device_file, presentation, by_id_1, by_id_2, by_id_3, by_path, detected_at, system_internal, removable, has_media As String
Shell "udisks --show-info /dev/" & ComboBox1.Text & " >/tmp/udisks_inex"
Shell "grep 'native-path' /tmp/udisks_inex | awl {'print $2'}" Wait To native_path
Shell "sed -n '3p' /tmp/udisks_inex | awk {'print $2'}" Wait To device
Shell "grep 'device-file' /tmp/udisks_inex | awk {'print $2'}" Wait To device_file
Shell "sed -n '5p' /tmp/udisks_inex | awk {'print $2'}" Wait To presentation
Shell "grep 'by-id' /tmp/udisks_inex | sed -n '1p' | awk {'print $2'}" Wait To by_id_1
Shell "grep 'by-id' /tmp/udisks_inex | sed -n '2p' | awk {'print $2'}" Wait To by_id_2
Shell "grep 'by-id' /tmp/udisks_inex | sed -n '3p' | awk {'print $2'}" Wait To by_id_3
Shell "grep 'by-path' /tmp/udisks_inex | awk {'print $2'}" Wait To by_path
Shell "grep 'detected at:' /tmp/udisks_inex | cut -d ':' -f 2" Wait To detected_at
Shell "grep 'system internal:' /tmp/udisks_inex | awk {'print $3'}" Wait To system_internal
Shell "grep 'removable:' /tmp/udisks_inex | awk {'print $2'}" Wait To removable
Shell "grep 'has media:' /tmp/udisks_inex | cut -d ':' -f 2" Wait To has_media

End
56 changes: 56 additions & 0 deletions src/i-nex/.src/FUdisks.form
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Gambas Form File 3.0

{ Form Form
MoveScaled(0,0,70,75)
ToolTip = ("UDisks")
Text = ("UDisks")
Icon = Picture["logo/i-nex.0.4.x.png"]
Resizable = False
{ Button1 Button
MoveScaled(1,71,3,3.4286)
Picture = Picture["icon:/16/camera"]
}
{ Button2 Button
MoveScaled(56,71,12,3.4286)
Font = Font["10"]
ToolTip = ("Close this program")
Text = ("Close")
Picture = Picture["icon:/16/quit"]
}
{ HBox11 HBox
MoveScaled(20,70,22.2857,5.1429)
{ Label25 Label
MoveScaled(11.1429,0.8571,6.8571,3.4286)
Foreground = &HFF0000&
AutoResize = True
Alignment = Align.Center
Transparent = True
}
}
{ Button11 Button
MoveScaled(15,71,3.4286,3.4286)
Picture = Picture["logo/fb.png"]
}
{ Button3 Button
MoveScaled(11,71,3.4286,3.4286)
Font = Font["10"]
ToolTip = ("About this app")
Picture = Picture["icon:/16/help"]
}
{ Button12 Button
MoveScaled(7,71,3.4286,3.4286)
ToolTip = ("Generate report")
Picture = Picture["icon:/16/printer"]
}
{ Button13 Button
MoveScaled(4,71,3.4286,3.4286)
Visible = False
ToolTip = ("Report a bug")
Picture = Picture["icon:/16/important"]
}
{ ComboBox1 ComboBox
MoveScaled(48,71,9,4)
ReadOnly = True
Text = ("ComboBox1")
}
}
28 changes: 14 additions & 14 deletions src/i-nex/.src/Finfosys.form
Original file line number Diff line number Diff line change
Expand Up @@ -805,70 +805,70 @@
Index = 7
Text = ("Memory")
{ TextLabel31 TextLabel
Move(1,0,126,21)
Move(7,364,126,21)
Text = ("Ram used:")
}
{ ProgressBar1 ProgressBar
Move(1,21,462,21)
Move(7,434,259,21)
}
{ TextLabel23 TextLabel
Move(1,49,168,21)
Move(7,413,168,21)
Text = ("SWAP memory used:")
}
{ ProgressBar4 ProgressBar
Move(1,77,462,21)
Move(7,385,259,21)
}
{ HPanel8 HPanel
Move(0,107,312,336)
Move(273,308,189,147)
{ Label85 Label
Move(0,12,312,24)
Move(0,0,189,21)
Expand = True
Padding = 4
Border = Border.Plain
}
{ Label86 Label
Move(0,42,312,24)
Move(0,21,189,21)
Expand = True
Padding = 4
Border = Border.Plain
}
{ Label87 Label
Move(0,72,312,24)
Move(0,42,189,21)
Expand = True
Padding = 4
Border = Border.Plain
}
{ Label88 Label
Move(0,102,312,24)
Move(0,63,189,21)
Expand = True
Padding = 4
Border = Border.Plain
}
{ Label89 Label
Move(0,132,312,24)
Move(0,84,189,21)
Expand = True
Padding = 4
Border = Border.Plain
}
{ Label90 Label
Move(0,162,312,24)
Move(0,105,189,21)
Expand = True
Padding = 4
Border = Border.Plain
}
{ Label91 Label
Move(0,192,312,24)
Move(0,126,189,21)
Expand = True
Padding = 4
Border = Border.Plain
}
}
{ TextLabel7 TextLabel
Move(134,0,77,21)
Move(140,364,77,21)
Text = ("N/A")
}
{ TextLabel24 TextLabel
Move(141,49,154,21)
Move(147,413,119,21)
Text = ("N/A")
}
Index = 8
Expand Down

0 comments on commit 4603bf1

Please sign in to comment.