3 #include "filesystem.h"
10 BC_DeleteFile::BC_DeleteFile(BC_FileBox *filebox, int x, int y)
11 : BC_Window(filebox->get_delete_title(),
22 this->filebox = filebox;
26 BC_DeleteFile::~BC_DeleteFile()
31 void BC_DeleteFile::create_objects()
34 data = new ArrayList<BC_ListBoxItem*>;
39 while((path = filebox->get_path(i)))
41 data->append(new BC_ListBoxItem(path));
46 add_subwindow(title = new BC_Title(x, y, _("Really delete the following files?")));
47 y += title->get_h() + 5;
49 add_subwindow(list = new BC_DeleteList(filebox,
53 get_h() - y - BC_OKButton::calculate_h() - 20,
55 y += list->get_h() + 5;
56 add_subwindow(new BC_OKButton(this));
57 add_subwindow(new BC_CancelButton(this));
65 BC_DeleteList::BC_DeleteList(BC_FileBox *filebox,
70 ArrayList<BC_ListBoxItem*> *data)
78 this->filebox = filebox;
90 BC_DeleteThread::BC_DeleteThread(BC_FileBox *filebox)
93 this->filebox = filebox;
96 void BC_DeleteThread::handle_done_event(int result)
100 filebox->lock_window("BC_DeleteThread::handle_done_event");
101 filebox->delete_files();
102 filebox->unlock_window();
106 BC_Window* BC_DeleteThread::new_gui()
108 int x = filebox->get_abs_cursor_x(1);
109 int y = filebox->get_abs_cursor_y(1);
110 BC_DeleteFile *result = new BC_DeleteFile(filebox, x, y);
111 result->create_objects();