r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / confirmsave.C
blobcd89be930b27e8bf866924715f71901920177e7a
1 #include "confirmsave.h"
2 #include "mwindow.h"
3 #include "mwindowgui.h"
6 #include <libintl.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)
23         FILE *in;
24         if(in = fopen(filename, "rb"))
25         {
26                 fclose(in);
27                 ConfirmSaveWindow cwindow(mwindow, filename);
28                 cwindow.create_objects();
29                 int result = cwindow.run_window();
30                 return result;
31         }
32         return 0;
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, 
44                 375, 
45                 160)
47         this->filename = filename;
50 ConfirmSaveWindow::~ConfirmSaveWindow()
54 int ConfirmSaveWindow::create_objects()
56         char string[1024];
57         int x = 10, y = 10;
58         sprintf(string, _("Overwrite %s?"), filename);
59         add_subwindow(new BC_Title(5, 5, string));
60         y += 30;
61         add_subwindow(new BC_OKButton(this));
62         x = get_w() - 100;
63         add_subwindow(new BC_CancelButton(this));
64         return 0;