5 #define _(String) gettext(String)
6 #define gettext_noop(String) String
7 #define N_(String) gettext_noop (String)
10 ReIndex::ReIndex(MWindow *mwindow)
11 : BC_MenuItem(_("Redraw Indexes"), "", 0), Thread()
13 this->mwindow = mwindow;
20 ReIndex::handle_event() { start(); }
26 if(mwindow->gui) mwindow->gui->disable_window();
27 if(mwindow->gui) mwindow->lock_resize();
31 window.create_objects();
32 result = window.run_window();
35 if(!result) // user didn't cancel
37 // ========== need pointers since mainmenu is created after tracks
38 // ==================================== delete old index files
39 mwindow->tracks->delete_index_files();
40 // ==================================== create new index files
41 mwindow->tracks->create_index_files(1);
42 // ==================================== draw
45 if(mwindow->gui) mwindow->unlock_resize();
46 if(mwindow->gui) mwindow->gui->enable_window();
49 ReIndexWindow::ReIndexWindow(char *display = "")
50 : BC_Window(display, MEGREY, PROGRAM_NAME ": Redraw Indexes", 340, 140, 340, 140)
54 ReIndexWindow::~ReIndexWindow()
60 ReIndexWindow::create_objects()
62 BC_SubWindow *subwindow;
64 add_subwindow(subwindow = new BC_SubWindow(0, 0, w, h, MEGREY));
65 subwindow->add_subwindow(new BC_Title(5, 5, _("Redraw all indexes for the current project?")));
66 subwindow->add_subwindow(ok = new ReIndexOkButton(this));
67 subwindow->add_subwindow(cancel = new ReIndexCancelButton(this));
70 ReIndexOkButton::ReIndexOkButton(ReIndexWindow *window)
71 : BC_Button(5, 80, _("Yes"))
73 this->window = window;
76 ReIndexOkButton::handle_event()
81 ReIndexOkButton::keypress_event()
83 if(window->get_keypress() == 13) { handle_event(); return 1; }
87 ReIndexCancelButton::ReIndexCancelButton(ReIndexWindow *window)
88 : BC_Button(140, 80, _("No"))
90 this->window = window;
93 ReIndexCancelButton::handle_event()
98 ReIndexCancelButton::keypress_event()
100 if(window->get_keypress() == ESC) { handle_event(); return 1; }