Skip to content

Commit

Permalink
v1.12: Bug fix and improvement release. Google APIs updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
moisespr123 committed Oct 21, 2019
1 parent b787010 commit abbb234
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 48 deletions.
7 changes: 6 additions & 1 deletion Google Drive Uploader1/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
v1.11.1 (7/13/2019)
v1.12 (10/20/2019)
-Fixed an initialization issue when client_secret.json or credentials.json file was not found.
-A message will be displayed if no client_secret.json or credentials.json file is found.
-Updated Google APIs.

v1.11.1 (7/13/2019)
-Updated the Google Drive API.

v1.11 (6/24/2019)
Expand Down
79 changes: 42 additions & 37 deletions Google Drive Uploader1/Form1.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,44 +31,49 @@ Public Class Form1
End If
'Google Drive initialization
drive = New GoogleDriveClass(SoftwareName)
'Checks whether the language was set. If not, apply English by default
Lang_Select()
'Checks if there are items to upload and if there are, we add them to the list box
If My.Settings.UploadQueue.Count > 0 Then
For Each item In My.Settings.UploadQueue
UploadsListBox.Items.Add(item)
Next
End If
If My.Settings.UploadQueueFolders.Count > 0 Then
For Each item In My.Settings.UploadQueueFolders
FolderToUploadFileList.Add(item)
Next
End If
'Loads the last used Folder ID and lists files
If My.Settings.PreviousFolderIDs.Count > 0 Then
drive.currentFolder = My.Settings.LastFolder 'My.Settings.PreviousFolderIDs.Item(My.Settings.PreviousFolderIDs.Count - 1)
Else
drive.currentFolder = "root"
End If
For Each item In My.Settings.PreviousFolderIDs
drive.previousFolder.Add(item)
Next
SaveCheckumsAsChecksumsmd5ToolStripMenuItem.Checked = My.Settings.SaveAsChecksumsMD5
StartUploadsAutomaticallyToolStripMenuItem.Checked = My.Settings.AutomaticUploads
PreserveFileModifiedDateToolStripMenuItem.Checked = My.Settings.PreserveModifiedDate
UpdateFileAndFolderViewsAfterAnUploadFinishesToolStripMenuItem.Checked = My.Settings.UpdateViews
ChecksumsEncodeFormatComboBox.SelectedIndex = My.Settings.EncodeChecksumsFormat
OrderByComboBox.SelectedIndex = My.Settings.SortByIndex
DescendingOrderToolStripMenuItem.Checked = My.Settings.OrderDesc
CopyFileToRAMBeforeUploadingToolStripMenuItem.Checked = My.Settings.CopyToRAM
EnterFolder(drive.currentFolder, True)
CurrentFolderLabel.Text = drive.currentFolderName
If UploadsListBox.Items.Count > 0 Then
UploadsListBox.SelectedIndex = 0
If Not drive.connected Then
MsgBox(Translations.MsgAndDialogLang("client_secrets_not_found"))
Process.Start("https://developers.google.com/drive/v3/web/quickstart/dotnet")
Me.Close()
Else
FolderIDTextBox.Text = drive.currentFolder
'Checks whether the language was set. If not, apply English by default
Lang_Select()
'Checks if there are items to upload and if there are, we add them to the list box
If My.Settings.UploadQueue.Count > 0 Then
For Each item In My.Settings.UploadQueue
UploadsListBox.Items.Add(item)
Next
End If
If My.Settings.UploadQueueFolders.Count > 0 Then
For Each item In My.Settings.UploadQueueFolders
FolderToUploadFileList.Add(item)
Next
End If
'Loads the last used Folder ID and lists files
If My.Settings.PreviousFolderIDs.Count > 0 Then
drive.currentFolder = My.Settings.LastFolder
Else
drive.currentFolder = "root"
End If
For Each item In My.Settings.PreviousFolderIDs
drive.previousFolder.Add(item)
Next
SaveCheckumsAsChecksumsmd5ToolStripMenuItem.Checked = My.Settings.SaveAsChecksumsMD5
StartUploadsAutomaticallyToolStripMenuItem.Checked = My.Settings.AutomaticUploads
PreserveFileModifiedDateToolStripMenuItem.Checked = My.Settings.PreserveModifiedDate
UpdateFileAndFolderViewsAfterAnUploadFinishesToolStripMenuItem.Checked = My.Settings.UpdateViews
ChecksumsEncodeFormatComboBox.SelectedIndex = My.Settings.EncodeChecksumsFormat
OrderByComboBox.SelectedIndex = My.Settings.SortByIndex
DescendingOrderToolStripMenuItem.Checked = My.Settings.OrderDesc
CopyFileToRAMBeforeUploadingToolStripMenuItem.Checked = My.Settings.CopyToRAM
EnterFolder(drive.currentFolder, True)
CurrentFolderLabel.Text = drive.currentFolderName
If UploadsListBox.Items.Count > 0 Then
UploadsListBox.SelectedIndex = 0
Else
FolderIDTextBox.Text = drive.currentFolder
End If
End If

End Sub

Public Sub Lang_Select()
Expand Down Expand Up @@ -1018,7 +1023,7 @@ Public Class Form1

Private Sub BtnLogout_Click(sender As Object, e As EventArgs) Handles btnLogout.Click
Dim credPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
credPath = Path.Combine(credPath, ".credentials\" + SoftwareName + ".json")
credPath = Path.Combine(credPath, ".credentials\" + SoftwareName)
Dim credfiles As String() = Directory.GetFiles(credPath, "*.TokenResponse-user")
For Each credfile In credfiles
Debug.WriteLine(credfile)
Expand Down
2 changes: 1 addition & 1 deletion Google Drive Uploader1/Google Drive Uploader1.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<HintPath>bin\Debug\MemoryTributary.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.12.0.3-beta2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
Expand Down
2 changes: 1 addition & 1 deletion Google Drive Uploader1/GoogleDriveClass.vb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Public Class GoogleDriveClass
If Not SectretsFile = String.Empty Then
Using stream = New FileStream(SectretsFile, FileMode.Open, FileAccess.Read)
Dim credPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
credPath = Path.Combine(credPath, ".credentials/" & SoftwareName & ".json")
credPath = Path.Combine(credPath, ".credentials/" & SoftwareName)
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(GoogleClientSecrets.Load(stream).Secrets, Scopes, "user", CancellationToken.None, New FileDataStore(credPath, True)).Result
End Using
service = New DriveService(New BaseClientService.Initializer() With {
Expand Down
4 changes: 2 additions & 2 deletions Google Drive Uploader1/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.11.2.0")>
<Assembly: AssemblyFileVersion("1.11.2.0")>
<Assembly: AssemblyVersion("1.12.0.0")>
<Assembly: AssemblyFileVersion("1.12.0.0")>
10 changes: 5 additions & 5 deletions Google Drive Uploader1/Translations.vb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Form1.FileSizeUploadLabel.Text = "File Size:"
Form1.ProcessedFileSizeUploadLabel.Text = "Processed:"
Form1.UploadInstructionsLabel.Text = "Drag and Drop Files to add them to the list"
Form1.AboutLabel.Text = "By Moisés Cardona" & vbNewLine & "v1.11.2"
Form1.AboutLabel.Text = "By Moisés Cardona" & vbNewLine & "v1.12"
Form1.UploadStatusLabel.Text = "Status:"
Form1.UploadPercentLabel.Text = "Percent: "
Form1.FilesLabel.Text = "Files:"
Expand Down Expand Up @@ -108,7 +108,7 @@
Form1.FileSizeUploadLabel.Text = "文件大小:"
Form1.ProcessedFileSizeUploadLabel.Text = "Processed:"
Form1.UploadInstructionsLabel.Text = "請將文件拖到下方"
Form1.AboutLabel.Text = "By Moisés Cardona" & vbNewLine & "v1.11.2" & vbNewLine & "Translated by mic4126"
Form1.AboutLabel.Text = "By Moisés Cardona" & vbNewLine & "v1.12" & vbNewLine & "Translated by mic4126"
Form1.UploadStatusLabel.Text = "狀態:"
Form1.UploadPercentLabel.Text = "百份比: "
Form1.FilesLabel.Text = "文件:"
Expand Down Expand Up @@ -212,7 +212,7 @@
Form1.FileSizeUploadLabel.Text = "Tamaño:"
Form1.ProcessedFileSizeUploadLabel.Text = "Procesado:"
Form1.UploadInstructionsLabel.Text = "Arrastre archivos aquí para añadirlos a la lista"
Form1.AboutLabel.Text = "Por Moisés Cardona" & vbNewLine & "v1.11.2"
Form1.AboutLabel.Text = "Por Moisés Cardona" & vbNewLine & "v1.12"
Form1.UploadStatusLabel.Text = "Estado:"
Form1.UploadPercentLabel.Text = "Porcentaje: "
Form1.FilesLabel.Text = "Archivos:"
Expand Down Expand Up @@ -317,9 +317,9 @@
Case "client_secrets_not_found"
Select Case My.Settings.Language
Case "English"
Return "client_secret.json file not found. Please follow Step 1 in this guide: https://developers.google.com/drive/v3/web/quickstart/dotnet" & vbCr & vbCrLf & "This file should be located in the folder where this software is located."
Return "client_secret.json or credentials.json file not found. Please follow Step 1 in this guide: https://developers.google.com/drive/v3/web/quickstart/dotnet" & vbCr & vbCrLf & "This file should be located in the folder where this software is located."
Case "Spanish"
Return "El archivo client_secret.json no fue encontrado. Por favor, siga el Paso 1 de esta guía: https://developers.google.com/drive/v3/web/quickstart/dotnet" & vbCr & vbCrLf & "Este archivo debe estar localizado en la carpeta donde se encuentra este programa."
Return "El archivo client_secret.json o credentials.json no fue encontrado. Por favor, siga el Paso 1 de esta guía: https://developers.google.com/drive/v3/web/quickstart/dotnet" & vbCr & vbCrLf & "Este archivo debe estar localizado en la carpeta donde se encuentra este programa."
Case "TChinese"
Return "client_secret.json 檔案找不到.請做: https://developers.google.com/drive/v3/web/quickstart/dotnet" & "的第一歩" & vbCr & vbCrLf & "請將client_secret.json放到軟體的根目錄."
Case Else
Expand Down
2 changes: 1 addition & 1 deletion Google Drive Uploader1/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<package id="Google.Apis.Auth" version="1.41.1" targetFramework="net48" />
<package id="Google.Apis.Core" version="1.41.1" targetFramework="net48" />
<package id="Google.Apis.Drive.v3" version="1.41.1.1734" targetFramework="net48" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net48" />
<package id="Newtonsoft.Json" version="12.0.3-beta2" targetFramework="net48" />
<package id="System.IO" version="4.3.0" targetFramework="net48" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net48" />
<package id="System.Runtime" version="4.3.1" targetFramework="net48" />
Expand Down

0 comments on commit abbb234

Please sign in to comment.