38 Commits

Author SHA1 Message Date
MikeMaximus
248efa8878 Fixed some export issues 2018-02-02 10:28:17 -06:00
MikeMaximus
93517f5236 Updated readme.txt for v107 2018-02-02 09:32:52 -06:00
Michael J. Seiferling
5be80b2f02 Better fix for issue #94 2018-01-28 23:14:54 -06:00
Michael J. Seiferling
2f2177fb84 Fixed issue #94 again 2018-01-28 22:43:44 -06:00
MikeMaximus
636c1495a4 Fixed sessions form tab order 2018-01-20 14:09:15 -06:00
MikeMaximus
f69d10065a Changes for issue #121 2018-01-20 14:05:10 -06:00
MikeMaximus
99d70b96fb Cleaned up column sorting for cross-platform 2018-01-19 09:26:30 -06:00
MikeMaximus
f88cf1bd18 Linux sorting fix for issue #120 2018-01-18 14:08:22 -06:00
MikeMaximus
b4d9c84c36 Update version 2018-01-18 12:06:03 -06:00
MikeMaximus
5996e28edf Changes for issue #120 2018-01-18 12:04:48 -06:00
MikeMaximus
6b9ebaab36 Fixed issue #117 again 2018-01-18 09:17:14 -06:00
MikeMaximus
85588686cd Updated readme.txt for v106 2018-01-15 11:28:07 -06:00
Michael J. Seiferling
2cab8b7ec4 Stop resetting filters on session delete 2018-01-05 22:52:15 -06:00
MikeMaximus
93361bcd87 Fixed ignoring sessions 2018-01-01 10:57:23 -06:00
MikeMaximus
a89fdceb1a Fixed bad practice issues with sessions 2018-01-01 09:56:12 -06:00
MikeMaximus
fa2910e184 Updated version and copyright 2018-01-01 09:06:57 -06:00
MikeMaximus
ef6df6e89e Updated credits.txt 2018-01-01 09:05:29 -06:00
MikeMaximus
36af55cacc Added Start with Windows setting admin warning 2017-12-29 14:21:27 -06:00
MikeMaximus
f6a5d7bba1 Update makefile
Change deb DESTDIR
2017-12-29 14:05:12 -06:00
MikeMaximus
27917f5859 Merge pull request #118 from basxto/master
Add debian package
2017-12-29 14:01:35 -06:00
MikeMaximus
2c8e0a1275 Fix for session delete 2017-12-28 13:18:10 -06:00
MikeMaximus
04f7b76456 Reset settings form to normal DPI 2017-12-27 20:05:34 -06:00
MikeMaximus
477c1fa623 Changes for issue #117 2017-12-27 19:51:54 -06:00
MikeMaximus
a5d7d6697a Changes for issue #115 2017-12-27 17:03:00 -06:00
MikeMaximus
b1e6e7a9e6 Changes for issue #116 2017-12-27 16:23:50 -06:00
Sebastian Riedel
c8db7ae4e4 Correct run path for package manager installation 2017-12-27 15:31:06 +01:00
Sebastian Riedel
f9a9074e56 Adapt to changed package directory name 2017-12-27 14:42:02 +01:00
Sebastian Riedel
77df7cf3dc Merge branch 'deb' 2017-12-27 14:34:37 +01:00
Sebastian Riedel
1122499609 Update icon and application database after install 2017-12-27 14:33:31 +01:00
Sebastian Riedel
ecedda0779 Build .deb package with 'make deb' 2017-12-19 01:24:12 +01:00
MikeMaximus
40e36aaafd Merge pull request #113 from basxto/master
Start GBM via script
2017-12-18 15:41:36 -06:00
Sebastian Riedel
3c72799ceb Fix script path detection 2017-12-18 22:36:35 +01:00
Sebastian Riedel
0779132be9 Avoid wrong paths 2017-12-18 21:25:03 +01:00
Sebastian Riedel
35cb711ca1 Remove BASHisms from start script 2017-12-18 21:14:41 +01:00
Sebastian Riedel
aacda9eeb9 Use changeable paths 2017-12-15 01:20:10 +01:00
Sebastian Riedel
1ec5439c5d Fix checking for needed libraries 2017-12-14 23:19:55 +01:00
Sebastian Riedel
ebd7081b29 Merge github.com:MikeMaximus/gbm 2017-12-10 03:20:35 +01:00
Sebastian Riedel
03becc209c Run GBM.exe with a script 2017-11-19 22:31:55 +01:00
24 changed files with 1231 additions and 148 deletions
Vendored
+1 -2
View File
@@ -188,5 +188,4 @@ _Pvt_Extensions/
ModelManifest.xml ModelManifest.xml
/.vs/slnx.sqlite /.vs/slnx.sqlite
/.vs/VSWorkspaceState.json /.vs/VSWorkspaceState.json
/.vs/Game Backup Monitor/v15/sqlite3/storage.ide /.vs/Game Backup Monitor/v15
/.vs/Game Backup Monitor/v15/sqlite3/storage.ide-journal
@@ -0,0 +1,49 @@
Imports System.Xml.Serialization
<XmlRoot("Session")>
Public Class Session
Private sGame As String
Private sStart As String
Private sEnd As String
Private sHours As String
<XmlElement("Game")>
Public Property GameName As String
Set(value As String)
sGame = value
End Set
Get
Return sGame
End Get
End Property
<XmlElement("Start")>
Public Property StartDate As String
Set(value As String)
sStart = value
End Set
Get
Return sStart
End Get
End Property
<XmlElement("End")>
Public Property EndDate As String
Set(value As String)
sEnd = value
End Set
Get
Return sEnd
End Get
End Property
<XmlElement("Hours")>
Public Property Hours As String
Set(value As String)
sHours = value
End Set
Get
Return sHours
End Get
End Property
End Class
+30 -17
View File
@@ -1,9 +1,8 @@
Public Class clsSession Public Class clsSession
Private sMonitorID As String Private sMonitorID As String
Private dStart As DateTime Private iStart As Int64
Private dEnd As DateTime Private iEnd As Int64
Private sComputerName As String = My.Computer.Name
Public Property MonitorID As String Public Property MonitorID As String
Set(value As String) Set(value As String)
@@ -14,31 +13,45 @@
End Get End Get
End Property End Property
Public Property SessionStart As DateTime Public Property SessionStart As Int64
Set(value As Int64)
iStart = value
End Set
Get
Return iStart
End Get
End Property
Public WriteOnly Property SessionStartFromDate As DateTime
Set(value As DateTime) Set(value As DateTime)
dStart = value iStart = mgrCommon.DateToUnix(value)
End Set End Set
End Property
Public ReadOnly Property SessionStartFormatted As DateTime
Get Get
Return dStart Return mgrCommon.UnixToDate(iStart)
End Get End Get
End Property End Property
Public Property SessionEnd As DateTime Public Property SessionEnd As Int64
Set(value As Int64)
iEnd = value
End Set
Get
Return iEnd
End Get
End Property
Public WriteOnly Property SessionEndFromDate As DateTime
Set(value As DateTime) Set(value As DateTime)
dEnd = value iEnd = mgrCommon.DateToUnix(value)
End Set End Set
Get
Return dEnd
End Get
End Property End Property
Public Property ComputerName As String Public ReadOnly Property SessionEndFormatted As DateTime
Set(value As String)
sComputerName = value
End Set
Get Get
Return sComputerName Return mgrCommon.UnixToDate(iEnd)
End Get End Get
End Property End Property
End Class End Class
+11 -8
View File
@@ -294,7 +294,7 @@ Public Class frmMain
OperationStarted(False) OperationStarted(False)
If oProcess.GameInfo.MonitorOnly = False Then If oProcess.GameInfo.MonitorOnly = False Then
If SupressBackup() Then If SupressSession() Then
bDoBackup = False bDoBackup = False
UpdateLog(mgrCommon.FormatString(frmMain_ErrorBackupSessionLength, oProcess.GameInfo.Name), False) UpdateLog(mgrCommon.FormatString(frmMain_ErrorBackupSessionLength, oProcess.GameInfo.Name), False)
SetLastAction(mgrCommon.FormatString(frmMain_ErrorBackupSessionLength, oProcess.GameInfo.CroppedName)) SetLastAction(mgrCommon.FormatString(frmMain_ErrorBackupSessionLength, oProcess.GameInfo.CroppedName))
@@ -715,17 +715,20 @@ Public Class frmMain
End Sub End Sub
Private Sub HandleSession() Private Sub HandleSession()
Dim oSession As New clsSession Dim oSession As clsSession
'Record Session If Not SupressSession() Then
oSession.MonitorID = oProcess.GameInfo.ID 'Record Session
oSession.SessionStart = oProcess.StartTime oSession = New clsSession
oSession.SessionEnd = oProcess.EndTime oSession.MonitorID = oProcess.GameInfo.ID
oSession.SessionStartFromDate = oProcess.StartTime
oSession.SessionEndFromDate = oProcess.EndTime
mgrSessions.AddSession(oSession) mgrSessions.AddSession(oSession)
End If
End Sub End Sub
Private Function SupressBackup() As Boolean Private Function SupressSession() As Boolean
Dim iSession As Integer Dim iSession As Integer
If oSettings.SupressBackup Then If oSettings.SupressBackup Then
iSession = Math.Ceiling(oProcess.TimeSpent.TotalMinutes) iSession = Math.Ceiling(oProcess.TimeSpent.TotalMinutes)
+180
View File
@@ -0,0 +1,180 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmSessionExport
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.btnExport = New System.Windows.Forms.Button()
Me.btnCancel = New System.Windows.Forms.Button()
Me.grpExportType = New System.Windows.Forms.GroupBox()
Me.grpDateType = New System.Windows.Forms.GroupBox()
Me.optCSV = New System.Windows.Forms.RadioButton()
Me.optXML = New System.Windows.Forms.RadioButton()
Me.optCurrentLocale = New System.Windows.Forms.RadioButton()
Me.optUnix = New System.Windows.Forms.RadioButton()
Me.grpOptions = New System.Windows.Forms.GroupBox()
Me.chkCSVHeaders = New System.Windows.Forms.CheckBox()
Me.grpExportType.SuspendLayout()
Me.grpDateType.SuspendLayout()
Me.grpOptions.SuspendLayout()
Me.SuspendLayout()
'
'btnExport
'
Me.btnExport.Location = New System.Drawing.Point(116, 226)
Me.btnExport.Name = "btnExport"
Me.btnExport.Size = New System.Drawing.Size(75, 23)
Me.btnExport.TabIndex = 3
Me.btnExport.Text = "&Export"
Me.btnExport.UseVisualStyleBackColor = True
'
'btnCancel
'
Me.btnCancel.Location = New System.Drawing.Point(197, 226)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 4
Me.btnCancel.Text = "&Cancel"
Me.btnCancel.UseVisualStyleBackColor = True
'
'grpExportType
'
Me.grpExportType.Controls.Add(Me.optXML)
Me.grpExportType.Controls.Add(Me.optCSV)
Me.grpExportType.Location = New System.Drawing.Point(12, 12)
Me.grpExportType.Name = "grpExportType"
Me.grpExportType.Size = New System.Drawing.Size(260, 70)
Me.grpExportType.TabIndex = 0
Me.grpExportType.TabStop = False
Me.grpExportType.Text = "Export Type"
'
'grpDateType
'
Me.grpDateType.Controls.Add(Me.optUnix)
Me.grpDateType.Controls.Add(Me.optCurrentLocale)
Me.grpDateType.Location = New System.Drawing.Point(12, 88)
Me.grpDateType.Name = "grpDateType"
Me.grpDateType.Size = New System.Drawing.Size(260, 70)
Me.grpDateType.TabIndex = 1
Me.grpDateType.TabStop = False
Me.grpDateType.Text = "Date Type"
'
'optCSV
'
Me.optCSV.AutoSize = True
Me.optCSV.Location = New System.Drawing.Point(6, 19)
Me.optCSV.Name = "optCSV"
Me.optCSV.Size = New System.Drawing.Size(46, 17)
Me.optCSV.TabIndex = 0
Me.optCSV.TabStop = True
Me.optCSV.Text = "CSV"
Me.optCSV.UseVisualStyleBackColor = True
'
'optXML
'
Me.optXML.AutoSize = True
Me.optXML.Location = New System.Drawing.Point(6, 42)
Me.optXML.Name = "optXML"
Me.optXML.Size = New System.Drawing.Size(47, 17)
Me.optXML.TabIndex = 1
Me.optXML.TabStop = True
Me.optXML.Text = "XML"
Me.optXML.UseVisualStyleBackColor = True
'
'optCurrentLocale
'
Me.optCurrentLocale.AutoEllipsis = True
Me.optCurrentLocale.Location = New System.Drawing.Point(6, 19)
Me.optCurrentLocale.Name = "optCurrentLocale"
Me.optCurrentLocale.Size = New System.Drawing.Size(248, 17)
Me.optCurrentLocale.TabIndex = 0
Me.optCurrentLocale.TabStop = True
Me.optCurrentLocale.Text = "Current Locale"
Me.optCurrentLocale.UseVisualStyleBackColor = True
'
'optUnix
'
Me.optUnix.AutoEllipsis = True
Me.optUnix.Location = New System.Drawing.Point(6, 42)
Me.optUnix.Name = "optUnix"
Me.optUnix.Size = New System.Drawing.Size(248, 17)
Me.optUnix.TabIndex = 1
Me.optUnix.TabStop = True
Me.optUnix.Text = "Unix Timestamp"
Me.optUnix.UseVisualStyleBackColor = True
'
'grpOptions
'
Me.grpOptions.Controls.Add(Me.chkCSVHeaders)
Me.grpOptions.Location = New System.Drawing.Point(12, 164)
Me.grpOptions.Name = "grpOptions"
Me.grpOptions.Size = New System.Drawing.Size(260, 45)
Me.grpOptions.TabIndex = 2
Me.grpOptions.TabStop = False
Me.grpOptions.Text = "Other Options"
'
'chkCSVHeaders
'
Me.chkCSVHeaders.AutoSize = True
Me.chkCSVHeaders.Location = New System.Drawing.Point(6, 19)
Me.chkCSVHeaders.Name = "chkCSVHeaders"
Me.chkCSVHeaders.Size = New System.Drawing.Size(167, 17)
Me.chkCSVHeaders.TabIndex = 0
Me.chkCSVHeaders.Text = "Export Column Headers (CSV)"
Me.chkCSVHeaders.UseVisualStyleBackColor = True
'
'frmSessionExport
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 261)
Me.Controls.Add(Me.grpOptions)
Me.Controls.Add(Me.grpDateType)
Me.Controls.Add(Me.grpExportType)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnExport)
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmSessionExport"
Me.ShowIcon = False
Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Session Export Options"
Me.grpExportType.ResumeLayout(False)
Me.grpExportType.PerformLayout()
Me.grpDateType.ResumeLayout(False)
Me.grpOptions.ResumeLayout(False)
Me.grpOptions.PerformLayout()
Me.ResumeLayout(False)
End Sub
Friend WithEvents btnExport As Button
Friend WithEvents btnCancel As Button
Friend WithEvents grpExportType As GroupBox
Friend WithEvents optXML As RadioButton
Friend WithEvents optCSV As RadioButton
Friend WithEvents grpDateType As GroupBox
Friend WithEvents optUnix As RadioButton
Friend WithEvents optCurrentLocale As RadioButton
Friend WithEvents grpOptions As GroupBox
Friend WithEvents chkCSVHeaders As CheckBox
End Class
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+90
View File
@@ -0,0 +1,90 @@
Imports GBM.My.Resources
Public Class frmSessionExport
Private bXML As Boolean = True
Private bUnix As Boolean = False
Private bCSVHeaders As Boolean = True
Public ReadOnly Property XML As Boolean
Get
Return bXML
End Get
End Property
Public ReadOnly Property Unix As Boolean
Get
Return bUnix
End Get
End Property
Public ReadOnly Property Headers As Boolean
Get
Return bCSVHeaders
End Get
End Property
Private Sub SetOptions()
If optXML.Checked Then
bXML = True
Else
bXML = False
End If
If optUnix.Checked Then
bUnix = True
Else
bUnix = False
End If
If chkCSVHeaders.Checked Then
bCSVHeaders = True
Else
bCSVHeaders = False
End If
End Sub
Private Sub SetForm()
Me.Text = frmSessionExport_FormName
grpExportType.Text = frmSessionExport_grpExportType
grpDateType.Text = frmSessionExport_grpDateType
grpOptions.Text = frmSessionExport_grpOptions
optCSV.Text = frmSessionExport_optCSV
optXML.Text = frmSessionExport_optXML
optCurrentLocale.Text = frmSessionExport_optCurrentLocale & " - " & Now
optUnix.Text = frmSessionExport_optUnix & " - " & mgrCommon.DateToUnix(Now)
chkCSVHeaders.Text = frmSessionExport_chkCSVHeaders
btnExport.Text = frmSessionExport_btnExport
btnCancel.Text = frmSessionExport_btnCancel
optCSV.Checked = True
optCurrentLocale.Checked = True
End Sub
Private Sub frmSessionExport_Load(sender As Object, e As EventArgs) Handles MyBase.Load
SetForm()
End Sub
Private Sub btnExport_Click(sender As Object, e As EventArgs) Handles btnExport.Click
SetOptions()
Me.DialogResult = DialogResult.OK
End Sub
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
Me.DialogResult = DialogResult.Cancel
End Sub
Private Sub optCSV_CheckedChanged(sender As Object, e As EventArgs) Handles optCSV.CheckedChanged
If Not optCSV.Checked Then
chkCSVHeaders.Checked = False
chkCSVHeaders.Enabled = False
Else
chkCSVHeaders.Checked = True
chkCSVHeaders.Enabled = True
End If
End Sub
End Class
+31 -4
View File
@@ -32,6 +32,8 @@ Partial Class frmSessions
Me.btnDelete = New System.Windows.Forms.Button() Me.btnDelete = New System.Windows.Forms.Button()
Me.btnClose = New System.Windows.Forms.Button() Me.btnClose = New System.Windows.Forms.Button()
Me.lblDateRange = New System.Windows.Forms.Label() Me.lblDateRange = New System.Windows.Forms.Label()
Me.lblTotalHours = New System.Windows.Forms.Label()
Me.btnExport = New System.Windows.Forms.Button()
CType(Me.dgSessions, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.dgSessions, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout() Me.SuspendLayout()
' '
@@ -41,7 +43,7 @@ Partial Class frmSessions
Me.lblFilter.Location = New System.Drawing.Point(12, 9) Me.lblFilter.Location = New System.Drawing.Point(12, 9)
Me.lblFilter.Name = "lblFilter" Me.lblFilter.Name = "lblFilter"
Me.lblFilter.Size = New System.Drawing.Size(63, 13) Me.lblFilter.Size = New System.Drawing.Size(63, 13)
Me.lblFilter.TabIndex = 0 Me.lblFilter.TabIndex = 1
Me.lblFilter.Text = "Game Filter:" Me.lblFilter.Text = "Game Filter:"
' '
'txtFilter 'txtFilter
@@ -100,7 +102,7 @@ Partial Class frmSessions
Me.btnReset.Location = New System.Drawing.Point(591, 526) Me.btnReset.Location = New System.Drawing.Point(591, 526)
Me.btnReset.Name = "btnReset" Me.btnReset.Name = "btnReset"
Me.btnReset.Size = New System.Drawing.Size(100, 23) Me.btnReset.Size = New System.Drawing.Size(100, 23)
Me.btnReset.TabIndex = 2 Me.btnReset.TabIndex = 10
Me.btnReset.Text = "&Reset Filters" Me.btnReset.Text = "&Reset Filters"
Me.btnReset.UseVisualStyleBackColor = True Me.btnReset.UseVisualStyleBackColor = True
' '
@@ -120,7 +122,7 @@ Partial Class frmSessions
Me.btnClose.Location = New System.Drawing.Point(697, 526) Me.btnClose.Location = New System.Drawing.Point(697, 526)
Me.btnClose.Name = "btnClose" Me.btnClose.Name = "btnClose"
Me.btnClose.Size = New System.Drawing.Size(75, 23) Me.btnClose.Size = New System.Drawing.Size(75, 23)
Me.btnClose.TabIndex = 8 Me.btnClose.TabIndex = 11
Me.btnClose.Text = "&Close" Me.btnClose.Text = "&Close"
Me.btnClose.UseVisualStyleBackColor = True Me.btnClose.UseVisualStyleBackColor = True
' '
@@ -131,14 +133,37 @@ Partial Class frmSessions
Me.lblDateRange.Location = New System.Drawing.Point(310, 9) Me.lblDateRange.Location = New System.Drawing.Point(310, 9)
Me.lblDateRange.Name = "lblDateRange" Me.lblDateRange.Name = "lblDateRange"
Me.lblDateRange.Size = New System.Drawing.Size(68, 13) Me.lblDateRange.Size = New System.Drawing.Size(68, 13)
Me.lblDateRange.TabIndex = 9 Me.lblDateRange.TabIndex = 2
Me.lblDateRange.Text = "Date Range:" Me.lblDateRange.Text = "Date Range:"
' '
'lblTotalHours
'
Me.lblTotalHours.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lblTotalHours.Location = New System.Drawing.Point(118, 531)
Me.lblTotalHours.Name = "lblTotalHours"
Me.lblTotalHours.Size = New System.Drawing.Size(361, 13)
Me.lblTotalHours.TabIndex = 8
Me.lblTotalHours.Text = "Total Hours:"
Me.lblTotalHours.TextAlign = System.Drawing.ContentAlignment.TopCenter
'
'btnExport
'
Me.btnExport.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnExport.Location = New System.Drawing.Point(485, 526)
Me.btnExport.Name = "btnExport"
Me.btnExport.Size = New System.Drawing.Size(100, 23)
Me.btnExport.TabIndex = 9
Me.btnExport.Text = "&Export Grid"
Me.btnExport.UseVisualStyleBackColor = True
'
'frmSessions 'frmSessions
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(784, 561) Me.ClientSize = New System.Drawing.Size(784, 561)
Me.Controls.Add(Me.btnExport)
Me.Controls.Add(Me.lblTotalHours)
Me.Controls.Add(Me.lblDateRange) Me.Controls.Add(Me.lblDateRange)
Me.Controls.Add(Me.btnClose) Me.Controls.Add(Me.btnClose)
Me.Controls.Add(Me.btnDelete) Me.Controls.Add(Me.btnDelete)
@@ -170,4 +195,6 @@ Partial Class frmSessions
Friend WithEvents btnDelete As Button Friend WithEvents btnDelete As Button
Friend WithEvents btnClose As Button Friend WithEvents btnClose As Button
Friend WithEvents lblDateRange As Label Friend WithEvents lblDateRange As Label
Friend WithEvents lblTotalHours As Label
Friend WithEvents btnExport As Button
End Class End Class
+160 -7
View File
@@ -1,24 +1,55 @@
Imports GBM.My.Resources Imports GBM.My.Resources
Imports System.Globalization Imports System.Globalization
Imports System.ComponentModel
Public Class frmSessions Public Class frmSessions
Private bInitFinished As Boolean = False Private bInitFinished As Boolean = False
Private WithEvents tmFilterTimer As Timer Private WithEvents tmFilterTimer As Timer
Private bStartSortAsc As Boolean = True
Private iStartDataCol As Integer
Private iStartDisplayCol As Integer
Private bEndSortAsc As Boolean = True
Private iEndDataCol As Integer
Private iEndDisplayCol As Integer
Private bHoursSortAsc As Boolean = True
Private iHoursCol As Integer
Private Sub FormatGrid() Private Sub FormatGrid()
'Build Columns
dgSessions.Columns.Add("MonitorID", frmSessions_ColumnMonitorID) dgSessions.Columns.Add("MonitorID", frmSessions_ColumnMonitorID)
dgSessions.Columns.Add("Name", frmSessions_ColumnGameName) dgSessions.Columns.Add("Name", frmSessions_ColumnGameName)
dgSessions.Columns.Add("StartUnix", frmSessions_ColumnStart)
dgSessions.Columns.Add("Start", frmSessions_ColumnStart) dgSessions.Columns.Add("Start", frmSessions_ColumnStart)
dgSessions.Columns.Add("EndUnix", frmSessions_ColumnEnd)
dgSessions.Columns.Add("End", frmSessions_ColumnEnd) dgSessions.Columns.Add("End", frmSessions_ColumnEnd)
dgSessions.Columns.Add("Hours", frmSessions_ColumnHours)
'Hide the ID 'Get Column Indexes
iStartDataCol = dgSessions.Columns.IndexOf(dgSessions.Columns("StartUnix"))
iStartDisplayCol = dgSessions.Columns.IndexOf(dgSessions.Columns("Start"))
iEndDataCol = dgSessions.Columns.IndexOf(dgSessions.Columns("EndUnix"))
iEndDisplayCol = dgSessions.Columns.IndexOf(dgSessions.Columns("End"))
iHoursCol = dgSessions.Columns.IndexOf(dgSessions.Columns("Hours"))
'Set Sorting
dgSessions.Columns("Start").SortMode = DataGridViewColumnSortMode.Programmatic
dgSessions.Columns("End").SortMode = DataGridViewColumnSortMode.Programmatic
dgSessions.Columns("Hours").SortMode = DataGridViewColumnSortMode.Programmatic
'Hide Columns
dgSessions.Columns("MonitorID").Visible = False dgSessions.Columns("MonitorID").Visible = False
dgSessions.Columns("StartUnix").Visible = False
dgSessions.Columns("EndUnix").Visible = False
End Sub End Sub
Private Sub LoadData() Private Sub LoadData()
Dim oData As DataSet Dim oData As DataSet
Dim sFilter As String Dim sFilter As String
Dim dStart As DateTime
Dim dEnd As DateTime
Dim dHours As Double
Dim dTotalHours As Double
If txtFilter.Text = String.Empty Then If txtFilter.Text = String.Empty Then
oData = mgrSessions.GetSessionRange(dtpStart.Value, dtpEnd.Value) oData = mgrSessions.GetSessionRange(dtpStart.Value, dtpEnd.Value)
@@ -30,9 +61,15 @@ Public Class frmSessions
dgSessions.Rows.Clear() dgSessions.Rows.Clear()
For Each dr As DataRow In oData.Tables(0).Rows For Each dr As DataRow In oData.Tables(0).Rows
dgSessions.Rows.Add(New Object() {dr("MonitorID"), dr("Name"), mgrCommon.UnixToDate(dr("Start")), mgrCommon.UnixToDate(dr("End"))}) dStart = mgrCommon.UnixToDate(dr("Start"))
dEnd = mgrCommon.UnixToDate(dr("End"))
dHours = Math.Round(dEnd.Subtract(dStart).TotalHours, 2)
dTotalHours += dHours
dgSessions.Rows.Add(New Object() {dr("MonitorID"), dr("Name"), dr("Start"), dStart, dr("End"), dEnd, dHours})
Next Next
lblTotalHours.Text = mgrCommon.FormatString(frmSessions_lblTotalHours, dTotalHours)
dgSessions.AutoResizeColumns() dgSessions.AutoResizeColumns()
End Sub End Sub
@@ -51,14 +88,18 @@ Public Class frmSessions
tmFilterTimer.Interval = 1000 tmFilterTimer.Interval = 1000
tmFilterTimer.Enabled = False tmFilterTimer.Enabled = False
End Sub End Sub
Private Sub ResetFilterFields() Private Sub ResetFilterFields()
Dim dtMinDate As DateTime = mgrSessions.GetMinimumDateTime Dim dtMinDate As DateTime = mgrSessions.GetMinimumDateTime
Dim dtMaxDate As DateTime = mgrSessions.GetMaximumDateTime Dim dtMaxDate As DateTime = mgrSessions.GetMaximumDateTime
Dim dtRecent As DateTime = dtMaxDate.Subtract(TimeSpan.FromDays(7))
Dim sDateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern & " " & CultureInfo.CurrentCulture.DateTimeFormat.LongTimePattern Dim sDateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern & " " & CultureInfo.CurrentCulture.DateTimeFormat.LongTimePattern
If dtRecent < dtMinDate Then
dtRecent = dtMinDate
End If
bInitFinished = False bInitFinished = False
'Init Date Fields 'Init Date Fields
@@ -75,7 +116,7 @@ Public Class frmSessions
dtpEnd.MaxDate = dtMaxDate dtpEnd.MaxDate = dtMaxDate
End If End If
dtpStart.Value = dtMinDate dtpStart.Value = dtRecent
dtpEnd.Value = dtMaxDate dtpEnd.Value = dtMaxDate
'Init Text Filter 'Init Text Filter
@@ -85,6 +126,7 @@ Public Class frmSessions
End Sub End Sub
Private Sub Reset() Private Sub Reset()
ClearManualSortGlyphs()
ResetFilterFields() ResetFilterFields()
LoadData() LoadData()
End Sub End Sub
@@ -96,8 +138,8 @@ Public Class frmSessions
For Each dgvRow As DataGridViewRow In dgSessions.SelectedRows For Each dgvRow As DataGridViewRow In dgSessions.SelectedRows
oSession = New clsSession oSession = New clsSession
oSession.MonitorID = dgvRow.Cells(0).Value oSession.MonitorID = dgvRow.Cells(0).Value
oSession.SessionStart = dgvRow.Cells(2).Value oSession.SessionStart = CInt(dgvRow.Cells(iStartDataCol).Value)
oSession.SessionEnd = dgvRow.Cells(3).Value oSession.SessionEnd = CInt(dgvRow.Cells(iEndDataCol).Value)
oSessions.Add(oSession) oSessions.Add(oSession)
Next Next
@@ -106,6 +148,60 @@ Public Class frmSessions
End If End If
End Sub End Sub
Private Sub ClearManualSortGlyphs()
dgSessions.Columns(iStartDisplayCol).HeaderCell.SortGlyphDirection = SortOrder.None
dgSessions.Columns(iEndDisplayCol).HeaderCell.SortGlyphDirection = SortOrder.None
dgSessions.Columns(iHoursCol).HeaderCell.SortGlyphDirection = SortOrder.None
End Sub
Private Sub DoSort(ByRef bToggle As Boolean, ByVal iCol As Integer, ByVal iType As RowCompareHelper.iDataType)
bToggle = Not bToggle
If bToggle Then
dgSessions.Sort(New RowCompareHelper(SortOrder.Ascending, iCol, iType))
dgSessions.Columns(iCol).HeaderCell.SortGlyphDirection = SortOrder.Ascending
Else
dgSessions.Sort(New RowCompareHelper(SortOrder.Descending, iCol, iType))
dgSessions.Columns(iCol).HeaderCell.SortGlyphDirection = SortOrder.Descending
End If
End Sub
Private Sub HandleSort(ByVal iCol As Integer)
ClearManualSortGlyphs()
Select Case iCol
Case iStartDisplayCol
DoSort(bStartSortAsc, iStartDisplayCol, RowCompareHelper.iDataType.DateTimeType)
Case iEndDisplayCol
DoSort(bEndSortAsc, iEndDisplayCol, RowCompareHelper.iDataType.DateTimeType)
Case iHoursCol
DoSort(bHoursSortAsc, iHoursCol, RowCompareHelper.iDataType.DecimalType)
End Select
End Sub
Private Sub ExportGrid()
Dim frm As New frmSessionExport
Dim sLocation As String
frm.ShowDialog()
If frm.DialogResult = DialogResult.OK Then
If frm.XML Then
sLocation = mgrCommon.SaveFileBrowser("Session_Export", frmSessions_ChooseExportLocation, "xml", frmSessions_XML, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), frmSessions_DefaultExportFileName)
Else
sLocation = mgrCommon.SaveFileBrowser("Session_Export", frmSessions_ChooseExportLocation, "csv", frmSessions_CSV, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), frmSessions_DefaultExportFileName)
End If
If sLocation <> String.Empty Then
If frm.XML Then
mgrSessions.ExportAsXML(sLocation, frm.Unix, dgSessions)
Else
mgrSessions.ExportAsCSV(sLocation, frm.Unix, frm.Headers, dgSessions)
End If
End If
End If
End Sub
Private Sub frmSession_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub frmSession_Load(sender As Object, e As EventArgs) Handles MyBase.Load
SetForm() SetForm()
ResetFilterFields() ResetFilterFields()
@@ -146,8 +242,65 @@ Public Class frmSessions
If dgSessions.SelectedRows.Count > 0 Then If dgSessions.SelectedRows.Count > 0 Then
If mgrCommon.ShowMessage(frmSessions_ConfirmDelete, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then If mgrCommon.ShowMessage(frmSessions_ConfirmDelete, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
DeleteSession() DeleteSession()
Reset() LoadData()
End If End If
End If End If
End Sub End Sub
Private Sub btnExport_Click(sender As Object, e As EventArgs) Handles btnExport.Click
ExportGrid()
End Sub
Private Sub dgSessions_ColumnHeaderMouseClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles dgSessions.ColumnHeaderMouseClick
HandleSort(e.ColumnIndex)
End Sub
'The Mono version of the DataGridView control automatically treats all data as a string for sorting purposes.
'This class manually handles column sorting by data type.
Private Class RowCompareHelper
Implements System.Collections.IComparer
'We need to manually define data types as the column ValueType doesn't work in Mono either.
Public Enum iDataType As Integer
StringType = 1
DateTimeType = 2
IntType = 3
DecimalType = 4
End Enum
Private iSortOrderModifier As Integer = 1
Private iSortCol As Integer = 0
Private iDataTypeCol As iDataType = iDataType.StringType
Public Sub New(ByVal sortOrder As SortOrder, ByVal iCol As Integer, ByVal iType As iDataType)
iSortCol = iCol
iDataTypeCol = iType
If sortOrder = SortOrder.Descending Then
iSortOrderModifier = -1
ElseIf sortOrder = SortOrder.Ascending Then
iSortOrderModifier = 1
End If
End Sub
Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare
Dim iCompareResult As Integer
Dim dgRow1 As DataGridViewRow = CType(x, DataGridViewRow)
Dim dgRow2 As DataGridViewRow = CType(y, DataGridViewRow)
Select Case iDataTypeCol
Case iDataType.DecimalType
iCompareResult = If(CDec(dgRow1.Cells(iSortCol).Value) < CDec(dgRow2.Cells(iSortCol).Value), -1, 1)
Case iDataType.IntType
iCompareResult = If(CInt(dgRow1.Cells(iSortCol).Value) < CInt(dgRow2.Cells(iSortCol).Value), -1, 1)
Case iDataType.StringType
iCompareResult = String.Compare(CStr(dgRow1.Cells(iSortCol).Value), CStr(dgRow2.Cells(iSortCol).Value))
Case iDataType.DateTimeType
iCompareResult = Date.Compare(CDate(dgRow1.Cells(iSortCol).Value), CDate(dgRow2.Cells(iSortCol).Value))
End Select
Return iCompareResult * iSortOrderModifier
End Function
End Class
End Class End Class
+61 -61
View File
@@ -50,9 +50,6 @@ Partial Class frmSettings
Me.lbl7zProduct = New System.Windows.Forms.Label() Me.lbl7zProduct = New System.Windows.Forms.Label()
Me.btnDefaults = New System.Windows.Forms.Button() Me.btnDefaults = New System.Windows.Forms.Button()
Me.pnlBackup = New System.Windows.Forms.Panel() Me.pnlBackup = New System.Windows.Forms.Panel()
Me.lblMinutes = New System.Windows.Forms.Label()
Me.nudSupressBackupThreshold = New System.Windows.Forms.NumericUpDown()
Me.chkSupressBackup = New System.Windows.Forms.CheckBox()
Me.chkBackupConfirm = New System.Windows.Forms.CheckBox() Me.chkBackupConfirm = New System.Windows.Forms.CheckBox()
Me.chkOverwriteWarning = New System.Windows.Forms.CheckBox() Me.chkOverwriteWarning = New System.Windows.Forms.CheckBox()
Me.grpBackupHandling = New System.Windows.Forms.GroupBox() Me.grpBackupHandling = New System.Windows.Forms.GroupBox()
@@ -63,19 +60,22 @@ Partial Class frmSettings
Me.grp7zAdvanced = New System.Windows.Forms.GroupBox() Me.grp7zAdvanced = New System.Windows.Forms.GroupBox()
Me.grp7zInformation = New System.Windows.Forms.GroupBox() Me.grp7zInformation = New System.Windows.Forms.GroupBox()
Me.pnlGeneral = New System.Windows.Forms.Panel() Me.pnlGeneral = New System.Windows.Forms.Panel()
Me.lblMinutes = New System.Windows.Forms.Label()
Me.nudSupressBackupThreshold = New System.Windows.Forms.NumericUpDown()
Me.chkSupressBackup = New System.Windows.Forms.CheckBox()
Me.grpGameData = New System.Windows.Forms.GroupBox() Me.grpGameData = New System.Windows.Forms.GroupBox()
Me.lstSettings = New System.Windows.Forms.ListBox()
Me.chkSessionTracking = New System.Windows.Forms.CheckBox() Me.chkSessionTracking = New System.Windows.Forms.CheckBox()
Me.lstSettings = New System.Windows.Forms.ListBox()
Me.grpStartup.SuspendLayout() Me.grpStartup.SuspendLayout()
Me.grpFolderOptions.SuspendLayout() Me.grpFolderOptions.SuspendLayout()
Me.grp7zGeneral.SuspendLayout() Me.grp7zGeneral.SuspendLayout()
Me.pnlBackup.SuspendLayout() Me.pnlBackup.SuspendLayout()
CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).BeginInit()
Me.grpBackupHandling.SuspendLayout() Me.grpBackupHandling.SuspendLayout()
Me.pnl7z.SuspendLayout() Me.pnl7z.SuspendLayout()
Me.grp7zAdvanced.SuspendLayout() Me.grp7zAdvanced.SuspendLayout()
Me.grp7zInformation.SuspendLayout() Me.grp7zInformation.SuspendLayout()
Me.pnlGeneral.SuspendLayout() Me.pnlGeneral.SuspendLayout()
CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).BeginInit()
Me.grpGameData.SuspendLayout() Me.grpGameData.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
' '
@@ -124,10 +124,10 @@ Partial Class frmSettings
'chkAutoSaveLog 'chkAutoSaveLog
' '
Me.chkAutoSaveLog.AutoSize = True Me.chkAutoSaveLog.AutoSize = True
Me.chkAutoSaveLog.Location = New System.Drawing.Point(12, 228) Me.chkAutoSaveLog.Location = New System.Drawing.Point(12, 251)
Me.chkAutoSaveLog.Name = "chkAutoSaveLog" Me.chkAutoSaveLog.Name = "chkAutoSaveLog"
Me.chkAutoSaveLog.Size = New System.Drawing.Size(231, 17) Me.chkAutoSaveLog.Size = New System.Drawing.Size(231, 17)
Me.chkAutoSaveLog.TabIndex = 3 Me.chkAutoSaveLog.TabIndex = 5
Me.chkAutoSaveLog.Text = "Autosave log when max length is exceeded" Me.chkAutoSaveLog.Text = "Autosave log when max length is exceeded"
Me.chkAutoSaveLog.UseVisualStyleBackColor = True Me.chkAutoSaveLog.UseVisualStyleBackColor = True
' '
@@ -136,7 +136,7 @@ Partial Class frmSettings
Me.btnOptionalFields.Location = New System.Drawing.Point(103, 61) Me.btnOptionalFields.Location = New System.Drawing.Point(103, 61)
Me.btnOptionalFields.Name = "btnOptionalFields" Me.btnOptionalFields.Name = "btnOptionalFields"
Me.btnOptionalFields.Size = New System.Drawing.Size(134, 23) Me.btnOptionalFields.Size = New System.Drawing.Size(134, 23)
Me.btnOptionalFields.TabIndex = 2 Me.btnOptionalFields.TabIndex = 3
Me.btnOptionalFields.Text = "Choose &Optional Fields..." Me.btnOptionalFields.Text = "Choose &Optional Fields..."
Me.btnOptionalFields.UseVisualStyleBackColor = True Me.btnOptionalFields.UseVisualStyleBackColor = True
' '
@@ -156,17 +156,17 @@ Partial Class frmSettings
Me.chkSync.Location = New System.Drawing.Point(6, 65) Me.chkSync.Location = New System.Drawing.Point(6, 65)
Me.chkSync.Name = "chkSync" Me.chkSync.Name = "chkSync"
Me.chkSync.Size = New System.Drawing.Size(98, 17) Me.chkSync.Size = New System.Drawing.Size(98, 17)
Me.chkSync.TabIndex = 1 Me.chkSync.TabIndex = 2
Me.chkSync.Text = "Enable syncing" Me.chkSync.Text = "Enable syncing"
Me.chkSync.UseVisualStyleBackColor = True Me.chkSync.UseVisualStyleBackColor = True
' '
'chkShowDetectionTips 'chkShowDetectionTips
' '
Me.chkShowDetectionTips.AutoSize = True Me.chkShowDetectionTips.AutoSize = True
Me.chkShowDetectionTips.Location = New System.Drawing.Point(12, 205) Me.chkShowDetectionTips.Location = New System.Drawing.Point(12, 228)
Me.chkShowDetectionTips.Name = "chkShowDetectionTips" Me.chkShowDetectionTips.Name = "chkShowDetectionTips"
Me.chkShowDetectionTips.Size = New System.Drawing.Size(159, 17) Me.chkShowDetectionTips.Size = New System.Drawing.Size(159, 17)
Me.chkShowDetectionTips.TabIndex = 2 Me.chkShowDetectionTips.TabIndex = 4
Me.chkShowDetectionTips.Text = "Show detection notifications" Me.chkShowDetectionTips.Text = "Show detection notifications"
Me.chkShowDetectionTips.UseVisualStyleBackColor = True Me.chkShowDetectionTips.UseVisualStyleBackColor = True
' '
@@ -337,9 +337,6 @@ Partial Class frmSettings
' '
'pnlBackup 'pnlBackup
' '
Me.pnlBackup.Controls.Add(Me.lblMinutes)
Me.pnlBackup.Controls.Add(Me.nudSupressBackupThreshold)
Me.pnlBackup.Controls.Add(Me.chkSupressBackup)
Me.pnlBackup.Controls.Add(Me.chkBackupConfirm) Me.pnlBackup.Controls.Add(Me.chkBackupConfirm)
Me.pnlBackup.Controls.Add(Me.chkOverwriteWarning) Me.pnlBackup.Controls.Add(Me.chkOverwriteWarning)
Me.pnlBackup.Controls.Add(Me.grpBackupHandling) Me.pnlBackup.Controls.Add(Me.grpBackupHandling)
@@ -349,37 +346,10 @@ Partial Class frmSettings
Me.pnlBackup.Size = New System.Drawing.Size(367, 314) Me.pnlBackup.Size = New System.Drawing.Size(367, 314)
Me.pnlBackup.TabIndex = 3 Me.pnlBackup.TabIndex = 3
' '
'lblMinutes
'
Me.lblMinutes.AutoSize = True
Me.lblMinutes.Location = New System.Drawing.Point(286, 228)
Me.lblMinutes.Name = "lblMinutes"
Me.lblMinutes.Size = New System.Drawing.Size(43, 13)
Me.lblMinutes.TabIndex = 14
Me.lblMinutes.Text = "minutes"
'
'nudSupressBackupThreshold
'
Me.nudSupressBackupThreshold.Location = New System.Drawing.Point(229, 226)
Me.nudSupressBackupThreshold.Maximum = New Decimal(New Integer() {999, 0, 0, 0})
Me.nudSupressBackupThreshold.Name = "nudSupressBackupThreshold"
Me.nudSupressBackupThreshold.Size = New System.Drawing.Size(51, 20)
Me.nudSupressBackupThreshold.TabIndex = 5
'
'chkSupressBackup
'
Me.chkSupressBackup.AutoSize = True
Me.chkSupressBackup.Location = New System.Drawing.Point(6, 228)
Me.chkSupressBackup.Name = "chkSupressBackup"
Me.chkSupressBackup.Size = New System.Drawing.Size(217, 17)
Me.chkSupressBackup.TabIndex = 4
Me.chkSupressBackup.Text = "Backup only when session time exceeds"
Me.chkSupressBackup.UseVisualStyleBackColor = True
'
'chkBackupConfirm 'chkBackupConfirm
' '
Me.chkBackupConfirm.AutoSize = True Me.chkBackupConfirm.AutoSize = True
Me.chkBackupConfirm.Location = New System.Drawing.Point(6, 180) Me.chkBackupConfirm.Location = New System.Drawing.Point(14, 180)
Me.chkBackupConfirm.Name = "chkBackupConfirm" Me.chkBackupConfirm.Name = "chkBackupConfirm"
Me.chkBackupConfirm.Size = New System.Drawing.Size(160, 17) Me.chkBackupConfirm.Size = New System.Drawing.Size(160, 17)
Me.chkBackupConfirm.TabIndex = 2 Me.chkBackupConfirm.TabIndex = 2
@@ -389,7 +359,7 @@ Partial Class frmSettings
'chkOverwriteWarning 'chkOverwriteWarning
' '
Me.chkOverwriteWarning.AutoSize = True Me.chkOverwriteWarning.AutoSize = True
Me.chkOverwriteWarning.Location = New System.Drawing.Point(6, 204) Me.chkOverwriteWarning.Location = New System.Drawing.Point(14, 203)
Me.chkOverwriteWarning.Name = "chkOverwriteWarning" Me.chkOverwriteWarning.Name = "chkOverwriteWarning"
Me.chkOverwriteWarning.Size = New System.Drawing.Size(139, 17) Me.chkOverwriteWarning.Size = New System.Drawing.Size(139, 17)
Me.chkOverwriteWarning.TabIndex = 3 Me.chkOverwriteWarning.TabIndex = 3
@@ -402,9 +372,9 @@ Partial Class frmSettings
Me.grpBackupHandling.Controls.Add(Me.chkRestoreNotify) Me.grpBackupHandling.Controls.Add(Me.chkRestoreNotify)
Me.grpBackupHandling.Controls.Add(Me.chkAutoMark) Me.grpBackupHandling.Controls.Add(Me.chkAutoMark)
Me.grpBackupHandling.Location = New System.Drawing.Point(6, 88) Me.grpBackupHandling.Location = New System.Drawing.Point(6, 88)
Me.grpBackupHandling.Margin = New System.Windows.Forms.Padding(2) Me.grpBackupHandling.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.grpBackupHandling.Name = "grpBackupHandling" Me.grpBackupHandling.Name = "grpBackupHandling"
Me.grpBackupHandling.Padding = New System.Windows.Forms.Padding(2) Me.grpBackupHandling.Padding = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.grpBackupHandling.Size = New System.Drawing.Size(354, 87) Me.grpBackupHandling.Size = New System.Drawing.Size(354, 87)
Me.grpBackupHandling.TabIndex = 1 Me.grpBackupHandling.TabIndex = 1
Me.grpBackupHandling.TabStop = False Me.grpBackupHandling.TabStop = False
@@ -414,7 +384,7 @@ Partial Class frmSettings
' '
Me.chkAutoRestore.AutoSize = True Me.chkAutoRestore.AutoSize = True
Me.chkAutoRestore.Location = New System.Drawing.Point(8, 41) Me.chkAutoRestore.Location = New System.Drawing.Point(8, 41)
Me.chkAutoRestore.Margin = New System.Windows.Forms.Padding(2) Me.chkAutoRestore.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.chkAutoRestore.Name = "chkAutoRestore" Me.chkAutoRestore.Name = "chkAutoRestore"
Me.chkAutoRestore.Size = New System.Drawing.Size(190, 17) Me.chkAutoRestore.Size = New System.Drawing.Size(190, 17)
Me.chkAutoRestore.TabIndex = 1 Me.chkAutoRestore.TabIndex = 1
@@ -425,7 +395,7 @@ Partial Class frmSettings
' '
Me.chkRestoreNotify.AutoSize = True Me.chkRestoreNotify.AutoSize = True
Me.chkRestoreNotify.Location = New System.Drawing.Point(8, 19) Me.chkRestoreNotify.Location = New System.Drawing.Point(8, 19)
Me.chkRestoreNotify.Margin = New System.Windows.Forms.Padding(2) Me.chkRestoreNotify.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2)
Me.chkRestoreNotify.Name = "chkRestoreNotify" Me.chkRestoreNotify.Name = "chkRestoreNotify"
Me.chkRestoreNotify.Size = New System.Drawing.Size(216, 17) Me.chkRestoreNotify.Size = New System.Drawing.Size(216, 17)
Me.chkRestoreNotify.TabIndex = 0 Me.chkRestoreNotify.TabIndex = 0
@@ -479,6 +449,9 @@ Partial Class frmSettings
' '
'pnlGeneral 'pnlGeneral
' '
Me.pnlGeneral.Controls.Add(Me.lblMinutes)
Me.pnlGeneral.Controls.Add(Me.nudSupressBackupThreshold)
Me.pnlGeneral.Controls.Add(Me.chkSupressBackup)
Me.pnlGeneral.Controls.Add(Me.chkAutoSaveLog) Me.pnlGeneral.Controls.Add(Me.chkAutoSaveLog)
Me.pnlGeneral.Controls.Add(Me.grpGameData) Me.pnlGeneral.Controls.Add(Me.grpGameData)
Me.pnlGeneral.Controls.Add(Me.chkShowDetectionTips) Me.pnlGeneral.Controls.Add(Me.chkShowDetectionTips)
@@ -488,6 +461,33 @@ Partial Class frmSettings
Me.pnlGeneral.Size = New System.Drawing.Size(367, 314) Me.pnlGeneral.Size = New System.Drawing.Size(367, 314)
Me.pnlGeneral.TabIndex = 1 Me.pnlGeneral.TabIndex = 1
' '
'lblMinutes
'
Me.lblMinutes.AutoSize = True
Me.lblMinutes.Location = New System.Drawing.Point(232, 205)
Me.lblMinutes.Name = "lblMinutes"
Me.lblMinutes.Size = New System.Drawing.Size(43, 13)
Me.lblMinutes.TabIndex = 17
Me.lblMinutes.Text = "minutes"
'
'nudSupressBackupThreshold
'
Me.nudSupressBackupThreshold.Location = New System.Drawing.Point(176, 203)
Me.nudSupressBackupThreshold.Maximum = New Decimal(New Integer() {999, 0, 0, 0})
Me.nudSupressBackupThreshold.Name = "nudSupressBackupThreshold"
Me.nudSupressBackupThreshold.Size = New System.Drawing.Size(51, 20)
Me.nudSupressBackupThreshold.TabIndex = 3
'
'chkSupressBackup
'
Me.chkSupressBackup.AutoSize = True
Me.chkSupressBackup.Location = New System.Drawing.Point(12, 204)
Me.chkSupressBackup.Name = "chkSupressBackup"
Me.chkSupressBackup.Size = New System.Drawing.Size(158, 17)
Me.chkSupressBackup.TabIndex = 2
Me.chkSupressBackup.Text = "Ignore sessions shorter than"
Me.chkSupressBackup.UseVisualStyleBackColor = True
'
'grpGameData 'grpGameData
' '
Me.grpGameData.Controls.Add(Me.chkSessionTracking) Me.grpGameData.Controls.Add(Me.chkSessionTracking)
@@ -501,6 +501,16 @@ Partial Class frmSettings
Me.grpGameData.TabStop = False Me.grpGameData.TabStop = False
Me.grpGameData.Text = "Game Data" Me.grpGameData.Text = "Game Data"
' '
'chkSessionTracking
'
Me.chkSessionTracking.AutoSize = True
Me.chkSessionTracking.Location = New System.Drawing.Point(6, 42)
Me.chkSessionTracking.Name = "chkSessionTracking"
Me.chkSessionTracking.Size = New System.Drawing.Size(138, 17)
Me.chkSessionTracking.TabIndex = 1
Me.chkSessionTracking.Text = "Enable session tracking"
Me.chkSessionTracking.UseVisualStyleBackColor = True
'
'lstSettings 'lstSettings
' '
Me.lstSettings.FormattingEnabled = True Me.lstSettings.FormattingEnabled = True
@@ -509,16 +519,6 @@ Partial Class frmSettings
Me.lstSettings.Size = New System.Drawing.Size(162, 303) Me.lstSettings.Size = New System.Drawing.Size(162, 303)
Me.lstSettings.TabIndex = 0 Me.lstSettings.TabIndex = 0
' '
'chkSessionTracking
'
Me.chkSessionTracking.AutoSize = True
Me.chkSessionTracking.Location = New System.Drawing.Point(6, 42)
Me.chkSessionTracking.Name = "chkSessionTracking"
Me.chkSessionTracking.Size = New System.Drawing.Size(138, 17)
Me.chkSessionTracking.TabIndex = 3
Me.chkSessionTracking.Text = "Enable session tracking"
Me.chkSessionTracking.UseVisualStyleBackColor = True
'
'frmSettings 'frmSettings
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -547,7 +547,6 @@ Partial Class frmSettings
Me.grp7zGeneral.PerformLayout() Me.grp7zGeneral.PerformLayout()
Me.pnlBackup.ResumeLayout(False) Me.pnlBackup.ResumeLayout(False)
Me.pnlBackup.PerformLayout() Me.pnlBackup.PerformLayout()
CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).EndInit()
Me.grpBackupHandling.ResumeLayout(False) Me.grpBackupHandling.ResumeLayout(False)
Me.grpBackupHandling.PerformLayout() Me.grpBackupHandling.PerformLayout()
Me.pnl7z.ResumeLayout(False) Me.pnl7z.ResumeLayout(False)
@@ -556,6 +555,7 @@ Partial Class frmSettings
Me.grp7zInformation.ResumeLayout(False) Me.grp7zInformation.ResumeLayout(False)
Me.pnlGeneral.ResumeLayout(False) Me.pnlGeneral.ResumeLayout(False)
Me.pnlGeneral.PerformLayout() Me.pnlGeneral.PerformLayout()
CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).EndInit()
Me.grpGameData.ResumeLayout(False) Me.grpGameData.ResumeLayout(False)
Me.grpGameData.PerformLayout() Me.grpGameData.PerformLayout()
Me.ResumeLayout(False) Me.ResumeLayout(False)
@@ -595,9 +595,6 @@ Partial Class frmSettings
Friend WithEvents lstSettings As ListBox Friend WithEvents lstSettings As ListBox
Friend WithEvents grp7zAdvanced As GroupBox Friend WithEvents grp7zAdvanced As GroupBox
Friend WithEvents grp7zInformation As GroupBox Friend WithEvents grp7zInformation As GroupBox
Friend WithEvents lblMinutes As Label
Friend WithEvents nudSupressBackupThreshold As NumericUpDown
Friend WithEvents chkSupressBackup As CheckBox
Friend WithEvents chkBackupConfirm As CheckBox Friend WithEvents chkBackupConfirm As CheckBox
Friend WithEvents chkOverwriteWarning As CheckBox Friend WithEvents chkOverwriteWarning As CheckBox
Friend WithEvents grpBackupHandling As GroupBox Friend WithEvents grpBackupHandling As GroupBox
@@ -605,4 +602,7 @@ Partial Class frmSettings
Friend WithEvents chkAutoRestore As CheckBox Friend WithEvents chkAutoRestore As CheckBox
Friend WithEvents chkRestoreNotify As CheckBox Friend WithEvents chkRestoreNotify As CheckBox
Friend WithEvents chkSessionTracking As CheckBox Friend WithEvents chkSessionTracking As CheckBox
Friend WithEvents lblMinutes As Label
Friend WithEvents nudSupressBackupThreshold As NumericUpDown
Friend WithEvents chkSupressBackup As CheckBox
End Class End Class
+5
View File
@@ -34,6 +34,11 @@ Public Class frmSettings
Private Function ValidateSettings() As Boolean Private Function ValidateSettings() As Boolean
'Show Start with Windows warning if running as admin
If chkStartWindows.Checked And mgrCommon.IsElevated Then
mgrCommon.ShowMessage(frmSettings_WarningAdminStart, MsgBoxStyle.Exclamation)
End If
'Only modify registry key when the value changed 'Only modify registry key when the value changed
If chkStartWindows.Checked <> oSettings.StartWithWindows Then If chkStartWindows.Checked <> oSettings.StartWithWindows Then
HandleRegistryUpdate(chkStartWindows.Checked) HandleRegistryUpdate(chkStartWindows.Checked)
+10
View File
@@ -127,6 +127,7 @@
<Compile Include="Classes\clsSavedPath.vb" /> <Compile Include="Classes\clsSavedPath.vb" />
<Compile Include="Classes\clsSession.vb" /> <Compile Include="Classes\clsSession.vb" />
<Compile Include="Classes\XML Serialize Classes\ExportData.vb" /> <Compile Include="Classes\XML Serialize Classes\ExportData.vb" />
<Compile Include="Classes\XML Serialize Classes\Session.vb" />
<Compile Include="Classes\XML Serialize Classes\Tag.vb" /> <Compile Include="Classes\XML Serialize Classes\Tag.vb" />
<Compile Include="Classes\XML Serialize Classes\Game.vb" /> <Compile Include="Classes\XML Serialize Classes\Game.vb" />
<Compile Include="Classes\clsGameTag.vb" /> <Compile Include="Classes\clsGameTag.vb" />
@@ -170,6 +171,12 @@
<Compile Include="Forms\frmIncludeExclude.vb"> <Compile Include="Forms\frmIncludeExclude.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Forms\frmSessionExport.Designer.vb">
<DependentUpon>frmSessionExport.vb</DependentUpon>
</Compile>
<Compile Include="Forms\frmSessionExport.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmSessions.Designer.vb"> <Compile Include="Forms\frmSessions.Designer.vb">
<DependentUpon>frmSessions.vb</DependentUpon> <DependentUpon>frmSessions.vb</DependentUpon>
</Compile> </Compile>
@@ -276,6 +283,9 @@
<EmbeddedResource Include="Forms\frmIncludeExclude.resx"> <EmbeddedResource Include="Forms\frmIncludeExclude.resx">
<DependentUpon>frmIncludeExclude.vb</DependentUpon> <DependentUpon>frmIncludeExclude.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Forms\frmSessionExport.resx">
<DependentUpon>frmSessionExport.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmSessions.resx"> <EmbeddedResource Include="Forms\frmSessions.resx">
<DependentUpon>frmSessions.vb</DependentUpon> <DependentUpon>frmSessions.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
+8 -1
View File
@@ -1,5 +1,12 @@
Game Backup Monitor would like to credit the following people/organizations: Game Backup Monitor would like to credit the following people/organizations:
7-zip - Igor Pavlov Contributors:
Michael J. Seiferling (MikeMaximus) - Design, Programming and Windows Game Configuration Maintainer.
Sebastian Riedel (basxto) - Linux Packaging, Installation and Game Configuration Maintainer.
Special Thanks:
7-Zip - Igor Pavlov
Sixpack Status Icons - JankoAtWarpSpeed.com Sixpack Status Icons - JankoAtWarpSpeed.com
Primo Icon Set - webdesignerdepot.com Primo Icon Set - webdesignerdepot.com
+1 -1
View File
@@ -114,7 +114,7 @@ Public Class mgrBackup
sSavePath = VerifySavePath(oGame) sSavePath = VerifySavePath(oGame)
'Calculate space 'Calculate space
lAvailableSpace = mgrCommon.GetAvailableDiskSpace(sBackupFile) lAvailableSpace = mgrCommon.GetAvailableDiskSpace(oSettings.BackupFolder)
lFolderSize = mgrCommon.GetFolderSize(sSavePath, oGame.IncludeArray, oGame.ExcludeArray) lFolderSize = mgrCommon.GetFolderSize(sSavePath, oGame.IncludeArray, oGame.ExcludeArray)
'Show Available Space 'Show Available Space
+131 -6
View File
@@ -1,11 +1,17 @@
Public Class mgrSessions Imports GBM.My.Resources
Imports System.IO
Imports System.Xml.Serialization
Imports System.Globalization
Public Class mgrSessions
Private Shared Function MapToObject(ByVal dr As DataRow) As clsSession Private Shared Function MapToObject(ByVal dr As DataRow) As clsSession
Dim oSession As New clsSession Dim oSession As New clsSession
oSession.MonitorID = CStr(dr("MonitorID")) oSession.MonitorID = CStr(dr("MonitorID"))
oSession.SessionStart = mgrCommon.UnixToDate(CInt(dr("Start"))) oSession.SessionStart = CInt(dr("Start"))
oSession.SessionEnd = mgrCommon.UnixToDate(CInt(dr("End"))) oSession.SessionEnd = CInt(dr("End"))
Return oSession Return oSession
End Function End Function
@@ -14,8 +20,8 @@
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
hshParams.Add("MonitorID", oSession.MonitorID) hshParams.Add("MonitorID", oSession.MonitorID)
hshParams.Add("Start", mgrCommon.DateToUnix(oSession.SessionStart)) hshParams.Add("Start", oSession.SessionStart)
hshParams.Add("End", mgrCommon.DateToUnix(oSession.SessionEnd)) hshParams.Add("End", oSession.SessionEnd)
Return hshParams Return hshParams
End Function End Function
@@ -80,7 +86,7 @@
For Each oSession As clsSession In oSessions For Each oSession As clsSession In oSessions
hshParams = New Hashtable hshParams = New Hashtable
hshParams.Add("MonitorID", oSession.MonitorID) hshParams.Add("MonitorID", oSession.MonitorID)
hshParams.Add("Start", mgrCommon.DateToUnix(oSession.SessionStart)) hshParams.Add("Start", oSession.SessionStart)
oParamList.Add(hshParams) oParamList.Add(hshParams)
Next Next
@@ -123,4 +129,123 @@
Return iRowCount Return iRowCount
End Function End Function
Public Shared Function ExportAsCSV(ByVal sLocation As String, ByVal bUnixTime As Boolean, ByVal bHeaders As Boolean, ByRef dg As DataGridView) As Boolean
Dim oWriter As StreamWriter
Dim sHeader As String
Dim sCurrentRow As String
Dim dDecimal As Decimal
Dim oBannedColumns As New List(Of DataGridViewColumn)
Dim oDecimalColumns As New List(Of DataGridViewColumn)
Dim oNfi As New NumberFormatInfo
'We want to force a specific decimal seperator when exporting CSV files due to certain regions using a comma.
oNfi.NumberDecimalSeparator = "."
Try
oWriter = New StreamWriter(sLocation)
'Set Decimal Columns
oDecimalColumns.Add(dg.Columns("Hours"))
'Set Ban Columns
oBannedColumns.Add(dg.Columns("MonitorID"))
If bUnixTime Then
oBannedColumns.Add(dg.Columns("Start"))
oBannedColumns.Add(dg.Columns("End"))
Else
oBannedColumns.Add(dg.Columns("StartUnix"))
oBannedColumns.Add(dg.Columns("EndUnix"))
End If
'Handle Headers
If bHeaders Then
sHeader = String.Empty
For Each dgCol As DataGridViewColumn In dg.Columns
If Not oBannedColumns.Contains(dgCol) Then
sHeader &= dgCol.HeaderText & ","
End If
Next
sHeader = sHeader.TrimEnd(",")
oWriter.WriteLine(sHeader)
End If
'Handle Rows
For Each dgRow As DataGridViewRow In dg.Rows
sCurrentRow = String.Empty
For Each dgCell As DataGridViewCell In dgRow.Cells
If Not oBannedColumns.Contains(dg.Columns(dgCell.ColumnIndex)) Then
If oDecimalColumns.Contains(dg.Columns(dgCell.ColumnIndex)) Then
dDecimal = CDec(dgCell.Value)
sCurrentRow &= dDecimal.ToString(oNfi) & ","
Else
sCurrentRow &= dgCell.Value.ToString & ","
End If
End If
Next
sCurrentRow = sCurrentRow.TrimEnd(",")
'Don't write a LF on the last row
If dg.Rows.Count = (dgRow.Index + 1) Then
oWriter.Write(sCurrentRow)
Else
oWriter.WriteLine(sCurrentRow)
End If
Next
'Finish up
oWriter.Flush()
oWriter.Close()
mgrCommon.ShowMessage(mgrSessions_ExportSuccess, MsgBoxStyle.Information)
Return True
Catch ex As Exception
mgrCommon.ShowMessage(mgrSessions_ErrorExportFailure, ex.Message, MsgBoxStyle.Exclamation)
Return False
End Try
End Function
Public Shared Function ExportAsXML(ByVal sLocation As String, ByVal bUnixTime As Boolean, ByRef dg As DataGridView) As Boolean
Dim oSerializer As XmlSerializer
Dim oWriter As StreamWriter
Dim oCurrentSession As Session
Dim oSessions As New List(Of Session)
Dim oBannedColumns As New List(Of DataGridViewColumn)
Try
'Format data for export
For Each dgRow As DataGridViewRow In dg.Rows
oCurrentSession = New Session
oCurrentSession.GameName = dgRow.Cells("Name").Value.ToString
If bUnixTime Then
oCurrentSession.StartDate = dgRow.Cells("StartUnix").Value.ToString
oCurrentSession.EndDate = dgRow.Cells("EndUnix").Value.ToString
Else
oCurrentSession.StartDate = dgRow.Cells("Start").Value.ToString
oCurrentSession.EndDate = dgRow.Cells("End").Value.ToString
End If
oCurrentSession.Hours = dgRow.Cells("Hours").Value.ToString
oSessions.Add(oCurrentSession)
Next
'Serialize
oSerializer = New XmlSerializer(oSessions.GetType, New XmlRootAttribute("Sessions"))
oWriter = New StreamWriter(sLocation)
oSerializer.Serialize(oWriter.BaseStream, oSessions)
'Finish up
oWriter.Flush()
oWriter.Close()
mgrCommon.ShowMessage(mgrSessions_ExportSuccess, MsgBoxStyle.Information)
Return True
Catch ex As Exception
mgrCommon.ShowMessage(mgrSessions_ErrorExportFailure, ex.Message, MsgBoxStyle.Exclamation)
Return False
End Try
End Function
End Class End Class
+3 -3
View File
@@ -14,7 +14,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("Game Backup Monitor")> <Assembly: AssemblyDescription("Game Backup Monitor")>
<Assembly: AssemblyCompany("Michael J. Seiferling")> <Assembly: AssemblyCompany("Michael J. Seiferling")>
<Assembly: AssemblyProduct("Game Backup Monitor")> <Assembly: AssemblyProduct("Game Backup Monitor")>
<Assembly: AssemblyCopyright("Copyright © 2017 Michael J. Seiferling")> <Assembly: AssemblyCopyright("Copyright © 2018 Michael J. Seiferling")>
<Assembly: AssemblyTrademark("")> <Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)> <Assembly: ComVisible(False)>
@@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.5.*")> <Assembly: AssemblyVersion("1.0.7.*")>
<Assembly: AssemblyFileVersion("1.0.5.0")> <Assembly: AssemblyFileVersion("1.0.7.0")>
<Assembly: NeutralResourcesLanguageAttribute("en")> <Assembly: NeutralResourcesLanguageAttribute("en")>
+190 -1
View File
@@ -3624,6 +3624,105 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to &amp;Cancel.
'''</summary>
Friend ReadOnly Property frmSessionExport_btnCancel() As String
Get
Return ResourceManager.GetString("frmSessionExport_btnCancel", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &amp;Export.
'''</summary>
Friend ReadOnly Property frmSessionExport_btnExport() As String
Get
Return ResourceManager.GetString("frmSessionExport_btnExport", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Export Column Headers (CSV).
'''</summary>
Friend ReadOnly Property frmSessionExport_chkCSVHeaders() As String
Get
Return ResourceManager.GetString("frmSessionExport_chkCSVHeaders", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Session Export Options.
'''</summary>
Friend ReadOnly Property frmSessionExport_FormName() As String
Get
Return ResourceManager.GetString("frmSessionExport_FormName", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Date Type.
'''</summary>
Friend ReadOnly Property frmSessionExport_grpDateType() As String
Get
Return ResourceManager.GetString("frmSessionExport_grpDateType", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Export Type.
'''</summary>
Friend ReadOnly Property frmSessionExport_grpExportType() As String
Get
Return ResourceManager.GetString("frmSessionExport_grpExportType", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Other Options.
'''</summary>
Friend ReadOnly Property frmSessionExport_grpOptions() As String
Get
Return ResourceManager.GetString("frmSessionExport_grpOptions", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to CSV.
'''</summary>
Friend ReadOnly Property frmSessionExport_optCSV() As String
Get
Return ResourceManager.GetString("frmSessionExport_optCSV", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Current Locale.
'''</summary>
Friend ReadOnly Property frmSessionExport_optCurrentLocale() As String
Get
Return ResourceManager.GetString("frmSessionExport_optCurrentLocale", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Unix Timestamp.
'''</summary>
Friend ReadOnly Property frmSessionExport_optUnix() As String
Get
Return ResourceManager.GetString("frmSessionExport_optUnix", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to XML.
'''</summary>
Friend ReadOnly Property frmSessionExport_optXML() As String
Get
Return ResourceManager.GetString("frmSessionExport_optXML", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to &amp;Close. ''' Looks up a localized string similar to &amp;Close.
'''</summary> '''</summary>
@@ -3642,6 +3741,15 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to &amp;Export Grid.
'''</summary>
Friend ReadOnly Property frmSessions_btnExport() As String
Get
Return ResourceManager.GetString("frmSessions_btnExport", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to &amp;Reset Filters. ''' Looks up a localized string similar to &amp;Reset Filters.
'''</summary> '''</summary>
@@ -3651,6 +3759,15 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to Choose a location for the export file.
'''</summary>
Friend ReadOnly Property frmSessions_ChooseExportLocation() As String
Get
Return ResourceManager.GetString("frmSessions_ChooseExportLocation", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to End. ''' Looks up a localized string similar to End.
'''</summary> '''</summary>
@@ -3669,6 +3786,15 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to Hours.
'''</summary>
Friend ReadOnly Property frmSessions_ColumnHours() As String
Get
Return ResourceManager.GetString("frmSessions_ColumnHours", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to MonitorID. ''' Looks up a localized string similar to MonitorID.
'''</summary> '''</summary>
@@ -3696,6 +3822,24 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to CSV.
'''</summary>
Friend ReadOnly Property frmSessions_CSV() As String
Get
Return ResourceManager.GetString("frmSessions_CSV", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Game Session Export.
'''</summary>
Friend ReadOnly Property frmSessions_DefaultExportFileName() As String
Get
Return ResourceManager.GetString("frmSessions_DefaultExportFileName", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to Date Range:. ''' Looks up a localized string similar to Date Range:.
'''</summary> '''</summary>
@@ -3714,6 +3858,15 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to Total Hours: [PARAM].
'''</summary>
Friend ReadOnly Property frmSessions_lblTotalHours() As String
Get
Return ResourceManager.GetString("frmSessions_lblTotalHours", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to Session Viewer. ''' Looks up a localized string similar to Session Viewer.
'''</summary> '''</summary>
@@ -3723,6 +3876,15 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to XML.
'''</summary>
Friend ReadOnly Property frmSessions_XML() As String
Get
Return ResourceManager.GetString("frmSessions_XML", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to Executable. ''' Looks up a localized string similar to Executable.
'''</summary> '''</summary>
@@ -3958,7 +4120,7 @@ Namespace My.Resources
End Property End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to Backup only when session time exceeds. ''' Looks up a localized string similar to Ignore sessions shorter than.
'''</summary> '''</summary>
Friend ReadOnly Property frmSettings_chkSupressBackup() As String Friend ReadOnly Property frmSettings_chkSupressBackup() As String
Get Get
@@ -4155,6 +4317,15 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to Please note that GBM will not &quot;Start with Windows&quot; as Administrator.[BR][BR]See the Online Manual in the Help menu for details..
'''</summary>
Friend ReadOnly Property frmSettings_WarningAdminStart() As String
Get
Return ResourceManager.GetString("frmSettings_WarningAdminStart", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to Invalid or poorly formatted 7-Zip arguments can cause backup or restore operations to fail.[BR][BR]If problems occur, clear the custom arguments and try again.. ''' Looks up a localized string similar to Invalid or poorly formatted 7-Zip arguments can cause backup or restore operations to fail.[BR][BR]If problems occur, clear the custom arguments and try again..
'''</summary> '''</summary>
@@ -5500,6 +5671,24 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to An error occured exporting the session data.[BR][BR][PARAM].
'''</summary>
Friend ReadOnly Property mgrSessions_ErrorExportFailure() As String
Get
Return ResourceManager.GetString("mgrSessions_ErrorExportFailure", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to The data has been exported successfully..
'''</summary>
Friend ReadOnly Property mgrSessions_ExportSuccess() As String
Get
Return ResourceManager.GetString("mgrSessions_ExportSuccess", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to An error occured creating a backup of the database file at [PARAM][BR][BR][PARAM]. ''' Looks up a localized string similar to An error occured creating a backup of the database file at [PARAM][BR][BR][PARAM].
'''</summary> '''</summary>
+64 -1
View File
@@ -1082,7 +1082,7 @@
<value>Start with Windows</value> <value>Start with Windows</value>
</data> </data>
<data name="frmSettings_chkSupressBackup" xml:space="preserve"> <data name="frmSettings_chkSupressBackup" xml:space="preserve">
<value>Backup only when session time exceeds</value> <value>Ignore sessions shorter than</value>
</data> </data>
<data name="frmSettings_chkSync" xml:space="preserve"> <data name="frmSettings_chkSync" xml:space="preserve">
<value>Enable syncing</value> <value>Enable syncing</value>
@@ -1945,4 +1945,67 @@
<data name="frmSettings_chkSessionTracking" xml:space="preserve"> <data name="frmSettings_chkSessionTracking" xml:space="preserve">
<value>Enable session tracking</value> <value>Enable session tracking</value>
</data> </data>
<data name="frmSettings_WarningAdminStart" xml:space="preserve">
<value>Please note that GBM will not "Start with Windows" as Administrator.[BR][BR]See the Online Manual in the Help menu for details.</value>
</data>
<data name="frmSessions_ColumnHours" xml:space="preserve">
<value>Hours</value>
</data>
<data name="frmSessions_lblTotalHours" xml:space="preserve">
<value>Total Hours: [PARAM]</value>
</data>
<data name="frmSessions_ChooseExportLocation" xml:space="preserve">
<value>Choose a location for the export file</value>
</data>
<data name="frmSessions_CSV" xml:space="preserve">
<value>CSV</value>
</data>
<data name="frmSessions_DefaultExportFileName" xml:space="preserve">
<value>Game Session Export</value>
</data>
<data name="frmSessions_XML" xml:space="preserve">
<value>XML</value>
</data>
<data name="mgrSessions_ErrorExportFailure" xml:space="preserve">
<value>An error occured exporting the session data.[BR][BR][PARAM]</value>
</data>
<data name="mgrSessions_ExportSuccess" xml:space="preserve">
<value>The data has been exported successfully.</value>
</data>
<data name="frmSessionExport_btnCancel" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="frmSessionExport_btnExport" xml:space="preserve">
<value>&amp;Export</value>
</data>
<data name="frmSessionExport_chkCSVHeaders" xml:space="preserve">
<value>Export Column Headers (CSV)</value>
</data>
<data name="frmSessionExport_FormName" xml:space="preserve">
<value>Session Export Options</value>
</data>
<data name="frmSessionExport_grpDateType" xml:space="preserve">
<value>Date Type</value>
</data>
<data name="frmSessionExport_grpExportType" xml:space="preserve">
<value>Export Type</value>
</data>
<data name="frmSessionExport_grpOptions" xml:space="preserve">
<value>Other Options</value>
</data>
<data name="frmSessionExport_optCSV" xml:space="preserve">
<value>CSV</value>
</data>
<data name="frmSessionExport_optCurrentLocale" xml:space="preserve">
<value>Current Locale</value>
</data>
<data name="frmSessionExport_optUnix" xml:space="preserve">
<value>Unix Timestamp</value>
</data>
<data name="frmSessionExport_optXML" xml:space="preserve">
<value>XML</value>
</data>
<data name="frmSessions_btnExport" xml:space="preserve">
<value>&amp;Export Grid</value>
</data>
</root> </root>
+12 -18
View File
@@ -1,31 +1,25 @@
Game Backup Monitor v1.0.5 Readme Game Backup Monitor v1.0.7 Readme
http://mikemaximus.github.io/gbm-web/ http://mikemaximus.github.io/gbm-web/
gamebackupmonitor@gmail.com gamebackupmonitor@gmail.com
December 8, 2017 February 2, 2018
New in 1.0.5 New in 1.0.7
All Platforms: All Platforms:
- You can now add Comments to a game configuration. - Added Hours and Total Hours to the Session Viewer
- You can now exclude tags and use negative filters on the Game Manager. - An Hours column now shows the time spent each session.
- Fixed a bug causing backup size calculations to be incorrect when including sub-folders in a configuration. - The Total Hours of the currently displayed sessions is now displayed under the grid.
- Fixed a bug causing GBM to calculate the backup size of an incorrect location when using a relative path configuration. This could cause very long delays when a backup was running.
- XML export files now contain the date, version and amount of configurations. The Import window will now display the date of the XML file in the title bar if applicable.
- Fixed a bug causing games not to be detected if more than one copy of the process was running.
- GBM can now save statistical data from each detected gaming session:
- This feature records the start and end time of each detected gaming session. In future versions more data may be available.
- You can view session data using the new "Session Viewer" available in the Tools menu.
- This feature is disabled by default. It can be enabled on the Setting screen.
- Session data is stored locally, it is currently not synced with the backup folder.
Windows Only: - Added Export feature to the Sessions Viewer
- The session data currently displayed on the grid can be exported in CSV or XML format.
- Only one instance of GBM can now be running. - Dates can be exported in Unix format or the current system format.
- The CSV format can exported with or without headers.
Linux Only: Linux Only:
- Added makefile for easy Linux installation. Thanks basxto! - A low disk space warning will no longer be displayed on every backup.
- Fixed the column sorting issues on the Session Viewer.
The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html
+9
View File
@@ -0,0 +1,9 @@
Package: gbm
Architecture: all
Maintainer: Sebastian Riedel <git@basxto.de>
Priority: optional
Version: 1.0.5
Homepage: https://mikemaximus.github.io/gbm-web/
Bugs: https://github.com/MikeMaximus/gbm/issues
Depends: mono-vbnc, libsqlite3-0, p7zip-full
Description: Automatically backup your saved games!
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
set -e
XDG_DESKTOP_MENU="`which xdg-desktop-menu 2> /dev/null`"
XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null`"
if [ -x "$XDG_DESKTOP_MENU" ]; then
xdg-desktop-menu forceupdate --mode system;
fi
if [ -x "$XDG_ICON_RESOURCE" ]; then
xdg-icon-resource forceupdate --mode system;
fi
+1 -2
View File
@@ -6,9 +6,8 @@ Name=Game Backup Monitor
Comment=Monitors games and backs up their savegames Comment=Monitors games and backs up their savegames
Comment[de]=Beobachtet Spiele und sichert ihre Spielstände Comment[de]=Beobachtet Spiele und sichert ihre Spielstände
Path=/usr/local/bin
TryExec=mono TryExec=mono
Exec=mono gbm Exec=gbm
Terminal=false Terminal=false
Icon=gbm Icon=gbm
Executable
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh -e
#check for all dependencies
for prog in mono readlink df 7za;do
[ -n "`whereis -b ${prog} | cut -sd' ' -f2`" ] || (echo "Please install ${prog}" && exit 1);
done
for lib in libsqlite3;do
[ -n "`ldconfig -p | grep ${lib}`" ] || (echo "Please install ${lib}" && exit 1);
done
dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
echo "Located in ${dir}";
gbmpath='./';
#locate GBM.exe
if [ "${dir}" = '/usr/bin' ] && [ -s '/usr/share/gbm/GBM.exe' ]; then
gbmpath='/usr/share/gbm/';
elif [ "${dir}" = '/usr/local/bin' ] && [ -s '/usr/local/share/gbm/GBM.exe' ]; then
gbmpath='/usr/local/share/gbm/';
elif [ ! -s './GBM.exe' ]; then
echo 'GBM.exe not found';
exit 2;
fi
mono --desktop ${gbmpath}'GBM.exe' "$@";
exit $?;
+29 -16
View File
@@ -1,31 +1,44 @@
ICONSIZES := 16 24 32 48 64 72 96 128 256 ICONSIZES := 16 24 32 48 64 72 96 128 256
IMGMAGICK := $(shell command -v convert 2> /dev/null) IMGMAGICK := $(shell command -v convert 2> /dev/null)
XDGUTILS := $(shell command -v xdg-desktop-menu 2> /dev/null) DESTDIR :=
PREFIX := usr/local
define \n define \n
endef endef
install: GBM.exe $(foreach size,$(ICONSIZES),gbm_$(size)x$(size).png) install: GBM.exe $(foreach size,$(ICONSIZES),gbm_$(size)x$(size).png)
ifndef XDGUTILS
$(error "xdg-desktop-menu is not available, please install xdg-utils")
endif
#rename it in a way, it can easily started from terminal #rename it in a way, it can easily started from terminal
install GBM.exe /usr/local/bin/gbm; install -d $(DESTDIR)/$(PREFIX)/bin;
install gbm.sh $(DESTDIR)/$(PREFIX)/bin/gbm;
install -d $(DESTDIR)/$(PREFIX)/share/gbm/;
install GBM.exe $(DESTDIR)/$(PREFIX)/share/gbm/;
#install icon in different sizes #install icon in different sizes
$(foreach size,$(ICONSIZES),xdg-icon-resource install --mode system --novendor --noupdate --size $(size) gbm_$(size)x$(size).png gbm;$(\n)) $(foreach size,$(ICONSIZES),install -d $(DESTDIR)/$(PREFIX)/share/icons/hicolor/$(size)x$(size)/apps/;$(\n))
xdg-icon-resource forceupdate --mode system; $(foreach size,$(ICONSIZES),install -m644 gbm_$(size)x$(size).png $(DESTDIR)/$(PREFIX)/share/icons/hicolor/$(size)x$(size)/apps/gbm.png;$(\n))
#install .desktop file, which is used for running gbm from desktop and menus #install .desktop file, which is used for running gbm from desktop and menus
xdg-desktop-menu install --mode system --novendor gbm.desktop; install -d $(DESTDIR)/$(PREFIX)/share/applications/
install -m644 gbm.desktop $(DESTDIR)/$(PREFIX)/share/applications/gbm.desktop
uninstall: /usr/local/bin/gbm ifeq ($(DESTDIR),)
ifndef XDGUTILS -xdg-icon-resource forceupdate --mode system;
$(error "xdg-desktop-menu is not available, please install xdg-utils") -xdg-desktop-menu forceupdate --mode system;
endif endif
rm /usr/local/bin/gbm;
$(foreach size,$(ICONSIZES),xdg-icon-resource uninstall --mode system --novendor --noupdate --size $(size) gbm;$(\n)) uninstall: $(DESTDIR)/$(PREFIX)/bin/gbm
xdg-icon-resource forceupdate --mode system; -rm $(DESTDIR)/$(PREFIX)/bin/gbm;
xdg-desktop-menu uninstall --mode system --novendor gbm.desktop; -rm -r $(DESTDIR)/$(PREFIX)/share/gbm/;
$(foreach size,$(ICONSIZES),-rm $(DESTDIR)/$(PREFIX)/share/icons/hicolor/$(size)x$(size)/apps/gbm.png;$(\n))
-rm $(DESTDIR)/$(PREFIX)/share/applications/gbm.desktop
ifeq ($(DESTDIR),)
-xdg-icon-resource forceupdate --mode system;
-xdg-desktop-menu forceupdate --mode system;
endif
#must be root
deb: DESTDIR := deb-package/gbm
deb: PREFIX := usr
deb: install
cd deb-package;dpkg-deb --build gbm
gbm_%.png: gbm.ico gbm_%.png: gbm.ico
ifndef IMGMAGICK ifndef IMGMAGICK