Mercurial > projects > pwm
comparison pwm.h @ 13:cf81eb0c2d5a
Warn before quitting if there are unsaved changes
If there are unsaved changes emit a warning when the quit command is used. Only
quit if the quit command is used twice with no other command in between.
Add a new Quit command which immediatly quits pwm without a warning.
author | Guido Berhoerster <guido+pwm@berhoerster.name> |
---|---|
date | Mon, 07 Aug 2017 16:59:47 +0200 |
parents | a7e41e1a79c8 |
children | a07665727c19 |
comparison
equal
deleted
inserted
replaced
12:8768fbd09bc5 | 13:cf81eb0c2d5a |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2016 Guido Berhoerster <guido+pwm@berhoerster.name> | 2 * Copyright (C) 2017 Guido Berhoerster <guido+pwm@berhoerster.name> |
3 * | 3 * |
4 * Permission is hereby granted, free of charge, to any person obtaining | 4 * Permission is hereby granted, free of charge, to any person obtaining |
5 * a copy of this software and associated documentation files (the | 5 * a copy of this software and associated documentation files (the |
6 * "Software"), to deal in the Software without restriction, including | 6 * "Software"), to deal in the Software without restriction, including |
7 * without limitation the rights to use, copy, modify, merge, publish, | 7 * without limitation the rights to use, copy, modify, merge, publish, |
25 #define PWM_H | 25 #define PWM_H |
26 | 26 |
27 #include <pws.h> | 27 #include <pws.h> |
28 | 28 |
29 struct pwm_ctx { | 29 struct pwm_ctx { |
30 const char *prev_cmd; | |
30 char *filename; | 31 char *filename; |
31 struct pws3_file *file; | 32 struct pws3_file *file; |
32 struct record_id_tree *record_id_tree; | 33 struct record_id_tree *record_id_tree; |
34 int unsaved_changes; | |
33 unsigned int next_id; | 35 unsigned int next_id; |
34 char password[PWS3_MAX_PASSWORD_LEN + 1]; | 36 char password[PWS3_MAX_PASSWORD_LEN + 1]; |
35 }; | 37 }; |
36 | 38 |
37 #endif /* PWM_H */ | 39 #endif /* PWM_H */ |