summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-01-22 18:40:57 +0100
committerJohn Ankarström <john@ankarstrom.se>2022-01-22 18:40:57 +0100
commit90c0c874a58993a278c0841588a9a5dd8ed5212d (patch)
treedc262864ded6f65ef73b5d5c391e2b1123526d5a
parent960418c239da83786f09846639b0cdd2e064aae5 (diff)
downloadsave-90c0c874a58993a278c0841588a9a5dd8ed5212d.tar.gz
M save.pl
M save.pl~
-rw-r--r--save.pl11
-rw-r--r--save.pl~11
2 files changed, 14 insertions, 8 deletions
diff --git a/save.pl b/save.pl
index a793e06..18c5b57 100644
--- a/save.pl
+++ b/save.pl
@@ -15,9 +15,7 @@ unlink(D) :->
:- pce_global(@editor, new(editor)).
:- pce_global(@browser, new(browser)).
:- pce_global(@save_button,
- new(button(save,
- message(@prolog, save),
- 'RET'))).
+ new(button(save, message(@prolog, save), 'RET'))).
main :-
pce_main_loop(main).
@@ -54,7 +52,12 @@ added(0) :-
refresh :-
send(@files, clear),
status(@files),
- send(@browser, members(@files)).
+ send(@browser, members(@files)),
+ get(@files, size, L),
+ ( L > 0
+ -> send(@save_button, status, active)
+ ; send(@save_button, sattus, inactive)
+ ).
status(C) :-
setup_call_cleanup(
diff --git a/save.pl~ b/save.pl~
index ad99f3c..d0b0b80 100644
--- a/save.pl~
+++ b/save.pl~
@@ -15,9 +15,7 @@ unlink(D) :->
:- pce_global(@editor, new(editor)).
:- pce_global(@browser, new(browser)).
:- pce_global(@save_button,
- new(button(save,
- message(@prolog, save),
- RET))).
+ new(button(save, message(@prolog, save), 'RET'))).
main :-
pce_main_loop(main).
@@ -54,7 +52,12 @@ added(0) :-
refresh :-
send(@files, clear),
status(@files),
- send(@browser, members(@files)).
+ send(@browser, members(@files)),
+ get(@files, size, L),
+ ( L > 0
+ -> send(@save_button, status, execute)
+ ; send(@save_button, sattus, active)
+ ).
status(C) :-
setup_call_cleanup(