Skip to content

Commit

Permalink
Add a warning when snapshotting that it will not be saved
Browse files Browse the repository at this point in the history
See #43
  • Loading branch information
chris-y committed May 3, 2023
1 parent 3f3707a commit 1a50daf
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions catalogs/avalanche.cd
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,6 @@ MSG_PARENT (//)
MSG_PACKEDSIZE (//)
Packed Size
;
MSG_SNAPSHOT_WARNING (//)
This will not be persistent until prefs are saved!
;
3 changes: 3 additions & 0 deletions catalogs/avalanche.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,6 @@ New archive...
MSG_PACKEDSIZE
Packed Size
;
MSG_SNAPSHOT_WARNING
This will not be persistent until prefs are saved!
;
4 changes: 4 additions & 0 deletions catalogs/avalanche.ct
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,7 @@ MSG_PACKEDSIZE
Packed Size
; Packed Size
;
MSG_SNAPSHOT_WARNING
This will not be persistent until prefs are saved!
; This will not be persistent until prefs are saved!
;
4 changes: 4 additions & 0 deletions src/locale_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
#define MSG_DIR 79
#define MSG_PARENT 80
#define MSG_PACKEDSIZE 81
#define MSG_SNAPSHOT_WARNING 82

#endif /* CATCOMP_NUMBERS */

Expand Down Expand Up @@ -214,6 +215,7 @@
#define MSG_DIR_STR "(dir)"
#define MSG_PARENT_STR "(parent)"
#define MSG_PACKEDSIZE_STR "Packed Size"
#define MSG_SNAPSHOT_WARNING_STR "This will not be persistent until prefs are saved!"

#endif /* CATCOMP_STRINGS */

Expand Down Expand Up @@ -389,6 +391,8 @@ STATIC CONST UBYTE CatCompBlock[] =
MSG_PARENT_STR "\x00\x00"
"\x00\x00\x00\x51\x00\x0C"
MSG_PACKEDSIZE_STR "\x00"
"\x00\x00\x00\x52\x00\x34"
MSG_SNAPSHOT_WARNING_STR "\x00\x00"
};

#endif /* CATCOMP_BLOCK */
Expand Down
19 changes: 19 additions & 0 deletions src/req.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,25 @@ ULONG ask_quithide_req(void)
return ret;
}

ULONG warning_req(void *awin, const char *message)
{
int ret = 1;

Object *obj = RequesterObj,
REQ_TitleText, VERS,
REQ_Type, REQTYPE_INFO,
REQ_Image, REQIMAGE_WARNING,
REQ_BodyText, message ,
REQ_GadgetText, locale_get_string( MSG_OK ) ,
End;

if(obj) {
ret = OpenRequester(obj, window_get_window(awin));
DisposeObject(obj);
}
return ret;
}

ULONG ask_question(void *awin, const char *q, const char *f)
{
char message[200];
Expand Down
1 change: 1 addition & 0 deletions src/req.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ void show_about(void *awin);
int open_error_req(const char *message, const char *button, void *awin);
void open_info_req(const char *message, const char *buttons, void *awin);
void req_show_arc_info(void *awin);
ULONG warning_req(void *awin, const char *message);
#endif
2 changes: 2 additions & 0 deletions src/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -2047,6 +2047,8 @@ ULONG window_handle_input_events(void *awin, struct avalanche_config *config, UL
GetAttr(WA_Left, aw->objects[OID_MAIN], (APTR)&config->win_y);
GetAttr(WA_Width, aw->objects[OID_MAIN], (APTR)&config->win_w);
GetAttr(WA_Height, aw->objects[OID_MAIN], (APTR)&config->win_h);

warning_req(aw, locale_get_string(MSG_SNAPSHOT_WARNING));
break;

case 3: //prefs
Expand Down

0 comments on commit 1a50daf

Please sign in to comment.