+
+EditPopupShow::EditPopupShow(MWindow *mwindow, EditPopup *popup)
+ : BC_MenuItem(_("Show edit"))
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+ dialog_thread = new EditShowDialogThread(this);
+}
+
+EditPopupShow::~EditPopupShow()
+{
+ delete dialog_thread;
+}
+
+int EditPopupShow::handle_event()
+{
+ if( popup->edit ) {
+ dialog_thread->close_window();
+ int wx = mwindow->gui->get_abs_cursor_x(0) - 400 / 2;
+ int wy = mwindow->gui->get_abs_cursor_y(0) - 500 / 2;
+ dialog_thread->start(wx, wy);
+ }
+ return 1;
+}
+
+void EditShowDialogThread::start(int wx, int wy)
+{
+ this->wx = wx; this->wy = wy;
+ BC_DialogThread::start();
+}
+
+EditShowDialogThread::EditShowDialogThread(EditPopupShow *edit_show)
+{
+ this->edit_show = edit_show;
+ window = 0;
+}
+EditShowDialogThread::~EditShowDialogThread()
+{
+ close_window();
+}
+
+BC_Window* EditShowDialogThread::new_gui()
+{
+ MWindow *mwindow = edit_show->mwindow;
+ EditPopup *popup = edit_show->popup;
+ window = new EditPopupShowWindow(mwindow, popup, wx, wy);
+ window->create_objects();
+ return window;
+}
+
+void EditShowDialogThread::handle_close_event(int result)
+{
+ window = 0;
+}
+
+EditPopupShowWindow::EditPopupShowWindow(MWindow *mwindow,
+ EditPopup *popup, int wx, int wy)
+ : BC_Window(_(PROGRAM_NAME ": Show edit"), wx, wy,
+ 300, 200, 300, 200, 0, 0, 1)
+{
+ this->mwindow = mwindow;
+ this->popup = popup;
+}
+
+EditPopupShowWindow::~EditPopupShowWindow()
+{
+}
+
+void EditPopupShowWindow::create_objects()
+{
+ lock_window("EditPopupShowWindow::create_objects");
+ int x = 10, y = 10;
+ add_subwindow(new BC_Title(x, y, _("Show edit:")));
+
+ EDLSession *session = mwindow->edl->session;
+ int time_format = session->time_format;
+ int sample_rate = session->sample_rate;
+ double frame_rate = session->frame_rate;
+ double frames_per_foot = session->frames_per_foot;
+
+ Track *track = popup->track;
+ Edit *edit = popup->edit;
+ double startsource = track->from_units(edit->startsource);
+ double startproject = track->from_units(edit->startproject);
+ double length = track->from_units(edit->length);
+
+ char text[BCTEXTLEN], text_length[BCSTRLEN];
+ char text_startsource[BCSTRLEN], text_startproject[BCSTRLEN];
+ sprintf(text, _("StartSource: %s\nStartProject: %s\nLength: %s\n"),
+ Units::totext(text_startsource, startsource,
+ time_format, sample_rate, frame_rate, frames_per_foot),
+ Units::totext(text_startproject, startproject,
+ time_format, sample_rate, frame_rate, frames_per_foot),
+ Units::totext(text_length, length,
+ time_format, sample_rate, frame_rate, frames_per_foot));
+ show_text = new EditPopupShowText(this, mwindow, x+15, y+20, text);
+ add_subwindow(show_text);
+ add_tool(new BC_OKButton(this));
+
+ show_window();
+ flush();
+ unlock_window();
+}
+
+
+EditPopupShowText::EditPopupShowText(EditPopupShowWindow *window,
+ MWindow *mwindow, int x, int y, const char *text)
+ : BC_TextBox(x, y, 250, 4, text)
+{
+ this->window = window;
+ this->mwindow = mwindow;
+}
+
+EditPopupShowText::~EditPopupShowText()
+{
+}
+