2 #include "awindowgui.h"
10 #define _(String) gettext(String)
11 #define gettext_noop(String) String
12 #define N_(String) gettext_noop (String)
15 NewFolder::NewFolder(MWindow *mwindow, AWindowGUI *awindow, int x, int y)
16 : BC_Window(PROGRAM_NAME ": New folder",
27 this->mwindow = mwindow;
28 this->awindow = awindow;
31 NewFolder::~NewFolder()
36 int NewFolder::create_objects()
39 add_tool(new BC_Title(x, y, _("Enter the name of the folder:")));
41 add_subwindow(textbox = new BC_TextBox(x, y, 300, 1, _("Untitled")));
43 add_subwindow(new BC_OKButton(x, y));
45 add_subwindow(new BC_CancelButton(x, y));
50 char* NewFolder::get_text()
52 return textbox->get_text();
56 NewFolderThread::NewFolderThread(MWindow *mwindow, AWindowGUI *awindow)
58 this->mwindow = mwindow;
59 this->awindow = awindow;
64 NewFolderThread::~NewFolderThread()
68 void NewFolderThread::run()
70 int result = window->run_window();
74 mwindow->new_folder(window->get_text());
77 change_lock.lock("NewFolderThread::run");
81 completion_lock.unlock();
84 int NewFolderThread::interrupt()
86 change_lock.lock("NewFolderThread::interrupt");
89 window->lock_window();
91 window->unlock_window();
96 completion_lock.lock("NewFolderThread::interrupt");
97 completion_lock.unlock();
101 int NewFolderThread::start_new_folder()
103 window = new NewFolder(mwindow,
105 awindow->get_abs_cursor_x(1),
106 awindow->get_abs_cursor_y(1) - 120);
107 window->create_objects();
109 change_lock.lock("NewFolderThread::start_new_folder");
111 change_lock.unlock();
115 completion_lock.lock("NewFolderThread::start_new_folder");