fabiocolacio / Marker

🖊 A gtk3 markdown editor
GNU General Public License v3.0
836 stars 75 forks source link

Extend dialog for exiting with unsaved changes #313

Closed justjosias closed 4 years ago

justjosias commented 4 years ago

Resolves #308.

This is almost complete, except it behaves poorly when dealing with multiple files open at the same time.

justjosias commented 4 years ago

Note that it gives this compile error (but it runs just fine):

../src/marker-window.c: In function ‘show_unsaved_documents_warning’:
../src/marker-window.c:135:26: warning: passing argument 1 of ‘gtk_dialog_add_buttons’ from incompatible pointer type [-Wincompatible-pointer-types]
   gtk_dialog_add_buttons(dialog,
                          ^~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtkaboutdialog.h:30,
                 from /usr/include/gtk-3.0/gtk/gtk.h:31,
                 from ../src/marker.h:25,
                 from ../src/marker-window.c:22:
/usr/include/gtk-3.0/gtk/gtkdialog.h:164:55: note: expected ‘GtkDialog *’ {aka ‘struct _GtkDialog *’} but argument is of type ‘GtkWidget
’ {aka ‘struct _GtkWidget *’}
 void       gtk_dialog_add_buttons       (GtkDialog   *dialog,
                                          ~~~~~~~~~~~~~^~~~~~
justjosias commented 4 years ago

I am currently working on a save-all function to fix the remaining issues.