1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-22 15:18:02 +00:00

Correct use of zenity methods

This commit is contained in:
2023-02-21 17:27:44 +01:00
parent 1f76b16e75
commit 5b1f410a50
15 changed files with 64 additions and 64 deletions

View File

@ -30,7 +30,7 @@ func (a *App) FindItems(hostKey, dbKey, collKey, formJson string) QueryResult {
if err != nil {
runtime.LogError(a.ctx, "Could not parse find form:")
runtime.LogError(a.ctx, err.Error())
zenity.Info(err.Error(), zenity.Title("Could not parse form"), zenity.ErrorIcon)
zenity.Error(err.Error(), zenity.Title("Could not parse form"), zenity.ErrorIcon)
return out
}
@ -48,7 +48,7 @@ func (a *App) FindItems(hostKey, dbKey, collKey, formJson string) QueryResult {
if err != nil {
runtime.LogInfo(a.ctx, "Invalid find query:")
runtime.LogInfo(a.ctx, err.Error())
zenity.Info(err.Error(), zenity.Title("Invalid query"), zenity.ErrorIcon)
zenity.Error(err.Error(), zenity.Title("Invalid query"), zenity.ErrorIcon)
return out
}
@ -56,7 +56,7 @@ func (a *App) FindItems(hostKey, dbKey, collKey, formJson string) QueryResult {
if err != nil {
runtime.LogInfo(a.ctx, "Invalid find projection:")
runtime.LogInfo(a.ctx, err.Error())
zenity.Info(err.Error(), zenity.Title("Invalid projection"), zenity.ErrorIcon)
zenity.Error(err.Error(), zenity.Title("Invalid projection"), zenity.ErrorIcon)
return out
}
@ -64,7 +64,7 @@ func (a *App) FindItems(hostKey, dbKey, collKey, formJson string) QueryResult {
if err != nil {
runtime.LogInfo(a.ctx, "Invalid find sort:")
runtime.LogInfo(a.ctx, err.Error())
zenity.Info(err.Error(), zenity.Title("Invalid sort"), zenity.ErrorIcon)
zenity.Error(err.Error(), zenity.Title("Invalid sort"), zenity.ErrorIcon)
return out
}
@ -79,7 +79,7 @@ func (a *App) FindItems(hostKey, dbKey, collKey, formJson string) QueryResult {
if err != nil {
runtime.LogWarning(a.ctx, "Encountered an error while counting documents:")
runtime.LogWarning(a.ctx, err.Error())
zenity.Info(err.Error(), zenity.Title("Error while counting docs"), zenity.ErrorIcon)
zenity.Error(err.Error(), zenity.Title("Error while counting docs"), zenity.ErrorIcon)
return out
}
@ -87,7 +87,7 @@ func (a *App) FindItems(hostKey, dbKey, collKey, formJson string) QueryResult {
if err != nil {
runtime.LogWarning(a.ctx, "Encountered an error while performing query:")
runtime.LogWarning(a.ctx, err.Error())
zenity.Info(err.Error(), zenity.Title("Error while querying"), zenity.ErrorIcon)
zenity.Error(err.Error(), zenity.Title("Error while querying"), zenity.ErrorIcon)
return out
}
@ -98,7 +98,7 @@ func (a *App) FindItems(hostKey, dbKey, collKey, formJson string) QueryResult {
if err != nil {
runtime.LogWarning(a.ctx, "Encountered an error while performing query:")
runtime.LogWarning(a.ctx, err.Error())
zenity.Info(err.Error(), zenity.Title("Error while querying"), zenity.ErrorIcon)
zenity.Error(err.Error(), zenity.Title("Error while querying"), zenity.ErrorIcon)
return out
}
@ -109,7 +109,7 @@ func (a *App) FindItems(hostKey, dbKey, collKey, formJson string) QueryResult {
if err != nil {
runtime.LogError(a.ctx, "Failed to marshal find BSON:")
runtime.LogError(a.ctx, err.Error())
zenity.Info(err.Error(), zenity.Title("Failed to marshal JSON"), zenity.ErrorIcon)
zenity.Error(err.Error(), zenity.Title("Failed to marshal JSON"), zenity.ErrorIcon)
return out
}
out.Results = append(out.Results, string(marshalled))