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

@ -101,13 +101,13 @@ func (a *App) UpdateViewStore(jsonData string) error {
var viewStore ViewStore
err := json.Unmarshal([]byte(jsonData), &viewStore)
if err != nil {
zenity.Info(err.Error(), zenity.Title("Could not parse JSON"), zenity.ErrorIcon)
zenity.Error(err.Error(), zenity.Title("Could not parse JSON"), zenity.ErrorIcon)
return errors.New("invalid JSON")
}
err = updateViewStore(a, viewStore)
if err != nil {
zenity.Info(err.Error(), zenity.Title("Error while updating view store"), zenity.ErrorIcon)
zenity.Error(err.Error(), zenity.Title("Error while updating view store"), zenity.ErrorIcon)
return errors.New("could not update view store")
}
@ -117,7 +117,7 @@ func (a *App) UpdateViewStore(jsonData string) error {
func (a *App) RemoveView(viewKey string) error {
views, err := a.Views()
if err != nil {
zenity.Info(err.Error(), zenity.Title("Error while getting views"), zenity.ErrorIcon)
zenity.Error(err.Error(), zenity.Title("Error while getting views"), zenity.ErrorIcon)
return errors.New("could not retrieve existing view store")
}
@ -130,7 +130,7 @@ func (a *App) RemoveView(viewKey string) error {
err = updateViewStore(a, views)
if err != nil {
zenity.Info(err.Error(), zenity.Title("Error while updating view store"), zenity.ErrorIcon)
zenity.Error(err.Error(), zenity.Title("Error while updating view store"), zenity.ErrorIcon)
return errors.New("could not update view store")
}
return nil