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

Zenity dialogs

This commit is contained in:
2023-02-20 21:04:01 +01:00
parent bab7f44ec3
commit bd18b54842
20 changed files with 176 additions and 429 deletions

View File

@ -3,6 +3,7 @@ package app
import (
"strings"
"github.com/ncruces/zenity"
"github.com/wailsapp/wails/v2/pkg/runtime"
"go.mongodb.org/mongo-driver/bson"
)
@ -19,11 +20,7 @@ func (a *App) InsertItems(hostKey, dbKey, collKey, jsonData string) interface{}
if err != nil {
runtime.LogError(a.ctx, "Could not parse insert JSON:")
runtime.LogError(a.ctx, err.Error())
runtime.MessageDialog(a.ctx, runtime.MessageDialogOptions{
Type: runtime.ErrorDialog,
Title: "Couldn't parse JSON",
Message: err.Error(),
})
zenity.Info(err.Error(), zenity.Title("Could not parse JSON"), zenity.ErrorIcon)
return nil
}
@ -37,11 +34,7 @@ func (a *App) InsertItems(hostKey, dbKey, collKey, jsonData string) interface{}
if err != nil {
runtime.LogWarning(a.ctx, "Encountered an error while performing insert:")
runtime.LogWarning(a.ctx, err.Error())
runtime.MessageDialog(a.ctx, runtime.MessageDialogOptions{
Type: runtime.ErrorDialog,
Title: "Encountered an error while performing query",
Message: err.Error(),
})
zenity.Info(err.Error(), zenity.Title("Error while performing insert"), zenity.ErrorIcon)
return nil
}