Replace OpResult with "op" module.

This commit is contained in:
2020-07-01 23:39:52 +02:00
parent 7cce11dc66
commit 243a41fa7a
3 changed files with 28 additions and 34 deletions

View File

@@ -1,4 +1,5 @@
import os, options, strformat
import op
import gintro/[glib, gobject, gtk, gio]
import gintro/gdk except Window
import argparse except run
@@ -102,13 +103,13 @@ proc updateImage(image: Image): bool =
var wWidth, wHeight: int
window.getSize(wWidth, wHeight)
let op = imageProvider.next(wWidth, wHeight)
result = op.success
if not op.success:
label.notify op.errorMsg
let r = imageProvider.next(wWidth, wHeight)
result = r.isOk
if not r.isOk:
label.notify r.error
return
image.setFromFile(op.file)
image.setFromFile(r.val)
if imageProvider.mode != Mode.None:
label.notify
except: