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());
81 completion_lock.unlock();
84 int NewFolderThread::interrupt()
89 window->lock_window();
91 window->unlock_window();
96 completion_lock.lock();
97 completion_lock.unlock();
101 int NewFolderThread::start_new_folder()
103 window = new NewFolder(mwindow, awindow, awindow->get_abs_cursor_x(), awindow->get_abs_cursor_y() - 120);
104 window->create_objects();
108 change_lock.unlock();
112 completion_lock.lock();