mirror of
https://github.com/Picocrypt/Picocrypt.git
synced 2025-05-12 13:48:31 +02:00
remove warning for external storage target
since temporary files are now encrypted so no longer matters
This commit is contained in:
parent
159944a619
commit
757c9c23e4
1 changed files with 5 additions and 32 deletions
|
@ -30,7 +30,6 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"runtime"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -131,9 +130,7 @@ var startLabel = "Start"
|
||||||
var mainStatus = "Ready"
|
var mainStatus = "Ready"
|
||||||
var mainStatusColor = WHITE
|
var mainStatusColor = WHITE
|
||||||
var popupStatus string
|
var popupStatus string
|
||||||
|
var usingTempZip bool
|
||||||
var temporaryZip bool
|
|
||||||
var externalDst bool
|
|
||||||
|
|
||||||
// Progress variables
|
// Progress variables
|
||||||
var progress float32
|
var progress float32
|
||||||
|
@ -637,7 +634,7 @@ func draw() {
|
||||||
giu.Checkbox("Paranoid mode", ¶noid),
|
giu.Checkbox("Paranoid mode", ¶noid),
|
||||||
giu.Tooltip("Provides the highest level of security attainable"),
|
giu.Tooltip("Provides the highest level of security attainable"),
|
||||||
giu.Dummy(-170, 0),
|
giu.Dummy(-170, 0),
|
||||||
giu.Style().SetDisabled(recursively).To(
|
giu.Style().SetDisabled(recursively || !(len(allFiles) > 1 || len(onlyFolders) > 0)).To(
|
||||||
giu.Checkbox("Compress files", &compress).OnChange(func() {
|
giu.Checkbox("Compress files", &compress).OnChange(func() {
|
||||||
if !(len(allFiles) > 1 || len(onlyFolders) > 0) {
|
if !(len(allFiles) > 1 || len(onlyFolders) > 0) {
|
||||||
if compress {
|
if compress {
|
||||||
|
@ -767,21 +764,6 @@ func draw() {
|
||||||
} else {
|
} else {
|
||||||
file += filepath.Ext(inputFile) + ".pcv"
|
file += filepath.Ext(inputFile) + ".pcv"
|
||||||
}
|
}
|
||||||
externalDst = false
|
|
||||||
GOOS := strings.ToLower(runtime.GOOS)
|
|
||||||
if strings.HasPrefix(GOOS, "windows") {
|
|
||||||
if !strings.HasPrefix(file, "C:") {
|
|
||||||
externalDst = true
|
|
||||||
}
|
|
||||||
} else if strings.HasPrefix(GOOS, "linux") {
|
|
||||||
if strings.Contains(file, "/media/") || strings.Contains(file, "/mnt/") {
|
|
||||||
externalDst = true
|
|
||||||
}
|
|
||||||
} else if strings.HasPrefix(GOOS, "darwin") {
|
|
||||||
if strings.Contains(file, "/Volumes/") {
|
|
||||||
externalDst = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if strings.HasSuffix(inputFile, ".zip.pcv") {
|
if strings.HasSuffix(inputFile, ".zip.pcv") {
|
||||||
file += ".zip"
|
file += ".zip"
|
||||||
|
@ -814,18 +796,10 @@ func draw() {
|
||||||
).Build()
|
).Build()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if temporaryZip && externalDst {
|
if usingTempZip {
|
||||||
giu.Style().SetColor(giu.StyleColorText, YELLOW).To(
|
|
||||||
giu.Label("Warning: unencrypted temp files will be created"),
|
|
||||||
).Build()
|
|
||||||
} else if temporaryZip {
|
|
||||||
giu.Style().SetColor(giu.StyleColorText, WHITE).To(
|
giu.Style().SetColor(giu.StyleColorText, WHITE).To(
|
||||||
giu.Label("Ready (info: will create a temporary zip file)"),
|
giu.Label("Ready (info: will create a temporary zip file)"),
|
||||||
).Build()
|
).Build()
|
||||||
} else if externalDst {
|
|
||||||
giu.Style().SetColor(giu.StyleColorText, WHITE).To(
|
|
||||||
giu.Label("Ready (info: target may be an external drive)"),
|
|
||||||
).Build()
|
|
||||||
} else {
|
} else {
|
||||||
giu.Style().SetColor(giu.StyleColorText, mainStatusColor).To(
|
giu.Style().SetColor(giu.StyleColorText, mainStatusColor).To(
|
||||||
giu.Label("Ready"),
|
giu.Label("Ready"),
|
||||||
|
@ -1068,7 +1042,7 @@ func onDrop(names []string) {
|
||||||
// Set the input and output paths
|
// Set the input and output paths
|
||||||
inputFile = filepath.Join(filepath.Dir(names[0]), "Encrypted") + ".zip"
|
inputFile = filepath.Join(filepath.Dir(names[0]), "Encrypted") + ".zip"
|
||||||
outputFile = inputFile + ".pcv"
|
outputFile = inputFile + ".pcv"
|
||||||
temporaryZip = true
|
usingTempZip = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recursively add all files in 'onlyFolders' to 'allFiles'
|
// Recursively add all files in 'onlyFolders' to 'allFiles'
|
||||||
|
@ -2357,8 +2331,7 @@ func resetUI() {
|
||||||
mainStatus = "Ready"
|
mainStatus = "Ready"
|
||||||
mainStatusColor = WHITE
|
mainStatusColor = WHITE
|
||||||
popupStatus = ""
|
popupStatus = ""
|
||||||
temporaryZip = false
|
usingTempZip = false
|
||||||
externalDst = false
|
|
||||||
|
|
||||||
progress = 0
|
progress = 0
|
||||||
progressInfo = ""
|
progressInfo = ""
|
||||||
|
|
Loading…
Add table
Reference in a new issue