1 #include "confirmsave.h"
3 #include "mwindowgui.h"
7 #define _(String) gettext(String)
8 #define gettext_noop(String) String
9 #define N_(String) gettext_noop (String)
12 ConfirmSave::ConfirmSave(MWindow *mwindow)
14 this->mwindow = mwindow;
17 ConfirmSave::~ConfirmSave()
21 int ConfirmSave::test_file(char *filename)
24 if(in = fopen(filename, "rb"))
27 ConfirmSaveWindow cwindow(mwindow, filename);
28 cwindow.create_objects();
29 int result = cwindow.run_window();
40 ConfirmSaveWindow::ConfirmSaveWindow(MWindow *mwindow, char *filename)
41 : BC_Window(PROGRAM_NAME ": File Exists",
42 mwindow->gui->get_abs_cursor_x() - 140,
43 mwindow->gui->get_abs_cursor_y() - 80,
47 this->filename = filename;
50 ConfirmSaveWindow::~ConfirmSaveWindow()
54 int ConfirmSaveWindow::create_objects()
58 sprintf(string, _("Overwrite %s?"), filename);
59 add_subwindow(new BC_Title(5, 5, string));
61 add_subwindow(new BC_OKButton(this));
63 add_subwindow(new BC_CancelButton(this));