rework android-rmt display, add a few buttons
[goodguy/history.git] / cinelerra-5.0 / cinelerra / plugindialog.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * 
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  */
21
22 #include "bcsignals.h"
23 #include "condition.h"
24 #include "edl.h"
25 #include "edlsession.h"
26 #include "language.h"
27 #include "localsession.h"
28 #include "mainsession.h"
29 #include "mainundo.h"
30 #include "mwindow.h"
31 #include "mwindowgui.h"
32 #include "module.h"
33 #include "mutex.h"
34 #include "plugin.h"
35 #include "plugindialog.h"
36 #include "pluginserver.h"
37 #include "theme.h"
38 #include "track.h"
39 #include "tracks.h"
40 #include "transition.h"
41
42
43 PluginDialogThread::PluginDialogThread(MWindow *mwindow)
44  : BC_DialogThread()
45 {
46         this->mwindow = mwindow;
47         plugin = 0;
48 }
49
50 PluginDialogThread::~PluginDialogThread()
51 {
52         close_window();
53 }
54
55 void PluginDialogThread::start_window(Track *track,
56         Plugin *plugin, 
57         const char *title,
58         int is_mainmenu,
59         int data_type)
60 {
61         if(!BC_DialogThread::is_running())
62         {
63 // At this point, the caller should hold the main window mutex.
64 //              mwindow->gui->lock_window("PluginDialogThread::start_window");
65                 this->track = track;
66                 this->data_type = data_type;
67                 this->plugin = plugin;
68                 this->is_mainmenu = is_mainmenu;
69                 single_standalone = mwindow->edl->session->single_standalone;
70
71                 if(plugin)
72                 {
73                         plugin->calculate_title(plugin_title, 0);
74                         this->shared_location = plugin->shared_location;
75                         this->plugin_type = plugin->plugin_type;
76                 }
77                 else
78                 {
79                         this->plugin_title[0] = 0;
80                         this->shared_location.plugin = -1;
81                         this->shared_location.module = -1;
82                         this->plugin_type = PLUGIN_NONE;
83                 }
84
85                 strcpy(this->window_title, title);
86                 mwindow->gui->unlock_window();
87
88                 BC_DialogThread::start();
89                 mwindow->gui->lock_window("PluginDialogThread::start_window");
90         }
91 }
92
93 BC_Window* PluginDialogThread::new_gui()
94 {
95         mwindow->gui->lock_window("PluginDialogThread::new_gui");
96         int x = mwindow->gui->get_abs_cursor_x(0) - 
97                 mwindow->session->plugindialog_w / 2;
98         int y = mwindow->gui->get_abs_cursor_y(0) - 
99                 mwindow->session->plugindialog_h / 2;
100         plugin_type = 0;
101         PluginDialog *window = new PluginDialog(mwindow, 
102                 this, 
103                 window_title, 
104                 x, 
105                 y);
106         window->create_objects();
107         mwindow->gui->unlock_window();
108         return window;
109 }
110
111 void PluginDialogThread::handle_done_event(int result)
112 {
113         PluginDialog *window = (PluginDialog*)BC_DialogThread::get_gui();
114         if(window->selected_available >= 0)
115         {
116                 window->attach_new(window->selected_available);
117         }
118         else
119         if(window->selected_shared >= 0)
120         {
121                 window->attach_shared(window->selected_shared);
122         }
123         else
124         if(window->selected_modules >= 0)
125         {
126                 window->attach_module(window->selected_modules);
127         }
128         mwindow->edl->session->single_standalone = single_standalone;
129 }
130
131 void PluginDialogThread::handle_close_event(int result)
132 {
133         if(!result)
134         {
135                 if(plugin_type)
136                 {
137                         mwindow->gui->lock_window("PluginDialogThread::run 3");
138
139
140                         mwindow->undo->update_undo_before();
141                         if(is_mainmenu)
142                         {
143                                 mwindow->insert_effect(plugin_title, 
144                                         &shared_location,
145                                         data_type,
146                                         plugin_type,
147                                         single_standalone);
148                         }
149                         else
150                         {
151                                 if(plugin)
152                                 {
153                                         if(mwindow->edl->tracks->plugin_exists(plugin))
154                                         {
155                                                 plugin->change_plugin(plugin_title,
156                                                         &shared_location,
157                                                         plugin_type);
158                                         }
159                                 }
160                                 else
161                                 {
162                                         if(mwindow->edl->tracks->track_exists(track))
163                                         {
164                                                 mwindow->insert_effect(plugin_title, 
165                                                                                 &shared_location,
166                                                                                 track,
167                                                                                 0,
168                                                                                 0,
169                                                                                 0,
170                                                                                 plugin_type);
171                                         }
172                                 }
173                         }
174                         
175                         mwindow->save_backup();
176                         mwindow->undo->update_undo_after(_("attach effect"), LOAD_EDITS | LOAD_PATCHES);
177                         mwindow->restart_brender();
178                         mwindow->update_plugin_states();
179                         mwindow->sync_parameters(CHANGE_EDL);
180                         mwindow->gui->update(1,
181                                 1,
182                                 0,
183                                 0,
184                                 1, 
185                                 0,
186                                 0);
187
188                         mwindow->gui->unlock_window();
189                 }
190         }
191         plugin = 0;
192 }
193
194
195
196
197
198
199
200
201
202 PluginDialog::PluginDialog(MWindow *mwindow, 
203         PluginDialogThread *thread, 
204         const char *window_title,
205         int x,
206         int y)
207  : BC_Window(window_title, 
208         x,
209         y,
210         mwindow->session->plugindialog_w, 
211         mwindow->session->plugindialog_h, 
212         510, 
213         415,
214         1,
215         0,
216         1)
217 {
218         this->mwindow = mwindow;  
219         this->thread = thread;
220         single_standalone = 0;
221 }
222
223 PluginDialog::~PluginDialog()
224 {
225         lock_window("PluginDialog::~PluginDialog");
226         standalone_data.remove_all_objects();
227         
228         shared_data.remove_all_objects();
229         
230         module_data.remove_all_objects();
231
232         plugin_locations.remove_all_objects();
233
234         module_locations.remove_all_objects();
235
236         delete standalone_list;
237         delete shared_list;
238         delete module_list;
239         unlock_window();
240 }
241
242 void PluginDialog::create_objects()
243 {
244 //      int use_default = 1;
245         char string[BCTEXTLEN];
246         mwindow->theme->get_plugindialog_sizes();
247
248         lock_window("PluginDialog::create_objects");
249         if(thread->plugin)
250         {
251                 strcpy(string, thread->plugin->title);
252                 //use_default = 0;
253         }
254         else
255         {
256 // no plugin
257                 sprintf(string, _("None"));
258         }
259
260
261
262
263
264
265 // GET A LIST OF ALL THE PLUGINS AVAILABLE
266         mwindow->search_plugindb(thread->data_type == TRACK_AUDIO, 
267                 thread->data_type == TRACK_VIDEO, 
268                 1, 0, 0, plugindb);
269
270         mwindow->edl->get_shared_plugins(thread->track,
271                 &plugin_locations,
272                 thread->is_mainmenu,
273                 thread->data_type);
274         mwindow->edl->get_shared_tracks(thread->track,
275                 &module_locations,
276                 thread->is_mainmenu,
277                 thread->data_type);
278
279 // Construct listbox items
280         for(int i = 0; i < plugindb.total; i++)
281                 standalone_data.append(new BC_ListBoxItem(_(plugindb.values[i]->title)));
282         for(int i = 0; i < plugin_locations.total; i++)
283         {
284                 Track *track = mwindow->edl->tracks->number(plugin_locations.values[i]->module);
285                 char *track_title = track->title;
286                 int number = plugin_locations.values[i]->plugin;
287                 Plugin *plugin = track->get_current_plugin(mwindow->edl->local_session->get_selectionstart(1), 
288                         number, 
289                         PLAY_FORWARD,
290                         1,
291                         0);
292                 char *plugin_title = plugin->title;
293                 char string[BCTEXTLEN];
294
295                 sprintf(string, "%s: %s", track_title, _(plugin_title));
296                 shared_data.append(new BC_ListBoxItem(string));
297         }
298         for(int i = 0; i < module_locations.total; i++)
299         {
300                 Track *track = mwindow->edl->tracks->number(module_locations.values[i]->module);
301                 module_data.append(new BC_ListBoxItem(track->title));
302         }
303
304
305
306
307
308 // Create widgets
309         add_subwindow(standalone_title = new BC_Title(mwindow->theme->plugindialog_new_x, 
310                 mwindow->theme->plugindialog_new_y - 20, 
311                 _("Plugins:")));
312         add_subwindow(standalone_list = new PluginDialogNew(this, 
313                 &standalone_data, 
314                 mwindow->theme->plugindialog_new_x, 
315                 mwindow->theme->plugindialog_new_y,
316                 mwindow->theme->plugindialog_new_w,
317                 mwindow->theme->plugindialog_new_h));
318 // 
319 //      if(thread->plugin)
320 //              add_subwindow(standalone_change = new PluginDialogChangeNew(mwindow,
321 //                      this,
322 //                      mwindow->theme->plugindialog_newattach_x,
323 //                      mwindow->theme->plugindialog_newattach_y));
324 //      else
325 //              add_subwindow(standalone_attach = new PluginDialogAttachNew(mwindow, 
326 //                      this, 
327 //                      mwindow->theme->plugindialog_newattach_x, 
328 //                      mwindow->theme->plugindialog_newattach_y));
329 // 
330
331
332
333
334
335
336
337         add_subwindow(shared_title = new BC_Title(mwindow->theme->plugindialog_shared_x, 
338                 mwindow->theme->plugindialog_shared_y - 20, 
339                 _("Shared effects:")));
340         add_subwindow(shared_list = new PluginDialogShared(this, 
341                 &shared_data, 
342                 mwindow->theme->plugindialog_shared_x, 
343                 mwindow->theme->plugindialog_shared_y,
344                 mwindow->theme->plugindialog_shared_w,
345                 mwindow->theme->plugindialog_shared_h));
346 //      if(thread->plugin)
347 //       add_subwindow(shared_change = new PluginDialogChangeShared(mwindow,
348 //          this,
349 //          mwindow->theme->plugindialog_sharedattach_x,
350 //          mwindow->theme->plugindialog_sharedattach_y));
351 //    else
352 //              add_subwindow(shared_attach = new PluginDialogAttachShared(mwindow, 
353 //                      this, 
354 //                      mwindow->theme->plugindialog_sharedattach_x, 
355 //                      mwindow->theme->plugindialog_sharedattach_y));
356 // 
357
358
359
360
361
362
363
364
365         add_subwindow(module_title = new BC_Title(mwindow->theme->plugindialog_module_x, 
366                 mwindow->theme->plugindialog_module_y - 20, 
367                 _("Shared tracks:")));
368         add_subwindow(module_list = new PluginDialogModules(this, 
369                 &module_data, 
370                 mwindow->theme->plugindialog_module_x, 
371                 mwindow->theme->plugindialog_module_y,
372                 mwindow->theme->plugindialog_module_w,
373                 mwindow->theme->plugindialog_module_h));
374 //      if(thread->plugin)
375 //       add_subwindow(module_change = new PluginDialogChangeModule(mwindow,
376 //          this,
377 //          mwindow->theme->plugindialog_moduleattach_x,
378 //          mwindow->theme->plugindialog_moduleattach_y));
379 //    else
380 //              add_subwindow(module_attach = new PluginDialogAttachModule(mwindow, 
381 //                      this, 
382 //                      mwindow->theme->plugindialog_moduleattach_x, 
383 //                      mwindow->theme->plugindialog_moduleattach_y));
384 // 
385
386
387 // Add option for the menu invocation
388 //      add_subwindow(file_title = new BC_Title(
389 //              mwindow->theme->menueffect_file_x, 
390 //              mwindow->theme->menueffect_file_y, 
391 //              _("One standalone effect is attached to the first track.\n"
392 //              "Shared effects are attached to the remaining tracks.")));
393
394         if(thread->is_mainmenu)
395                 add_subwindow(single_standalone = new PluginDialogSingle(this, 
396                         mwindow->theme->plugindialog_new_x + BC_OKButton::calculate_w() + 10, 
397                         mwindow->theme->plugindialog_new_y + 
398                                 mwindow->theme->plugindialog_new_h +
399                                 get_text_height(MEDIUMFONT)));
400
401
402
403         add_subwindow(new BC_OKButton(this));
404         add_subwindow(new BC_CancelButton(this));
405
406         selected_available = -1;
407         selected_shared = -1;
408         selected_modules = -1;
409         
410         show_window();
411         flush();
412         unlock_window();
413 }
414
415 int PluginDialog::resize_event(int w, int h)
416 {
417         mwindow->session->plugindialog_w = w;
418         mwindow->session->plugindialog_h = h;
419         mwindow->theme->get_plugindialog_sizes();
420
421
422         standalone_title->reposition_window(mwindow->theme->plugindialog_new_x, 
423                 mwindow->theme->plugindialog_new_y - 20);
424         standalone_list->reposition_window(mwindow->theme->plugindialog_new_x, 
425                 mwindow->theme->plugindialog_new_y,
426                 mwindow->theme->plugindialog_new_w,
427                 mwindow->theme->plugindialog_new_h);
428 //      if(standalone_attach)
429 //              standalone_attach->reposition_window(mwindow->theme->plugindialog_newattach_x, 
430 //                      mwindow->theme->plugindialog_newattach_y);
431 //      else
432 //              standalone_change->reposition_window(mwindow->theme->plugindialog_newattach_x,
433 //                      mwindow->theme->plugindialog_newattach_y);
434
435
436
437
438
439         shared_title->reposition_window(mwindow->theme->plugindialog_shared_x, 
440                 mwindow->theme->plugindialog_shared_y - 20);
441         shared_list->reposition_window(mwindow->theme->plugindialog_shared_x, 
442                 mwindow->theme->plugindialog_shared_y,
443                 mwindow->theme->plugindialog_shared_w,
444                 mwindow->theme->plugindialog_shared_h);
445 //      if(shared_attach)
446 //              shared_attach->reposition_window(mwindow->theme->plugindialog_sharedattach_x, 
447 //                      mwindow->theme->plugindialog_sharedattach_y);
448 //      else
449 //              shared_change->reposition_window(mwindow->theme->plugindialog_sharedattach_x,
450 //                      mwindow->theme->plugindialog_sharedattach_y);
451 // 
452
453
454
455
456         module_title->reposition_window(mwindow->theme->plugindialog_module_x, 
457                 mwindow->theme->plugindialog_module_y - 20);
458         module_list->reposition_window(mwindow->theme->plugindialog_module_x, 
459                 mwindow->theme->plugindialog_module_y,
460                 mwindow->theme->plugindialog_module_w,
461                 mwindow->theme->plugindialog_module_h);
462 //      if(module_attach)
463 //              module_attach->reposition_window(mwindow->theme->plugindialog_moduleattach_x, 
464 //                      mwindow->theme->plugindialog_moduleattach_y);
465 //      else
466 //              module_change->reposition_window(mwindow->theme->plugindialog_moduleattach_x,
467 //                      mwindow->theme->plugindialog_moduleattach_y);
468
469
470         if(single_standalone)
471                 single_standalone->reposition_window(mwindow->theme->plugindialog_new_x, 
472                         mwindow->theme->plugindialog_new_y + 
473                                 mwindow->theme->plugindialog_new_h +
474                                 get_text_height(MEDIUMFONT));
475
476         flush();
477         return 0;
478 }
479
480 int PluginDialog::attach_new(int number)
481 {
482         if(number > -1 && number < standalone_data.total) 
483         {
484                 strcpy(thread->plugin_title, plugindb.values[number]->title);
485                 thread->plugin_type = PLUGIN_STANDALONE;         // type is plugin
486         }
487         return 0;
488 }
489
490 int PluginDialog::attach_shared(int number)
491 {
492         if(number > -1 && number < shared_data.total) 
493         {
494                 thread->plugin_type = PLUGIN_SHAREDPLUGIN;         // type is shared plugin
495                 thread->shared_location = *(plugin_locations.values[number]); // copy location
496         }
497         return 0;
498 }
499
500 int PluginDialog::attach_module(int number)
501 {
502         if(number > -1 && number < module_data.total) 
503         {
504 //              title->update(module_data.values[number]->get_text());
505                 thread->plugin_type = PLUGIN_SHAREDMODULE;         // type is module
506                 thread->shared_location = *(module_locations.values[number]); // copy location
507         }
508         return 0;
509 }
510
511 int PluginDialog::save_settings()
512 {
513         return 0;
514 }
515
516
517
518
519
520
521
522 // 
523 // PluginDialogTextBox::PluginDialogTextBox(PluginDialog *dialog, char *text, int x, int y)
524 //  : BC_TextBox(x, y, 200, 1, text) 
525 // { 
526 //      this->dialog = dialog;
527 // }
528 // PluginDialogTextBox::~PluginDialogTextBox() 
529 // { }
530 // int PluginDialogTextBox::handle_event() 
531 // { }
532 // 
533 // PluginDialogDetach::PluginDialogDetach(MWindow *mwindow, PluginDialog *dialog, int x, int y)
534 //  : BC_GenericButton(x, y, _("Detach")) 
535 // { 
536 //      this->dialog = dialog; 
537 // }
538 // PluginDialogDetach::~PluginDialogDetach() 
539 // { }
540 // int PluginDialogDetach::handle_event() 
541 // {
542 // //   dialog->title->update(_("None"));
543 //      dialog->thread->plugin_type = 0;         // type is none
544 //      dialog->thread->plugin_title[0] = 0;
545 //      return 1;
546 // }
547 // 
548
549
550
551
552
553
554
555
556
557
558
559
560
561 PluginDialogNew::PluginDialogNew(PluginDialog *dialog, 
562         ArrayList<BC_ListBoxItem*> *standalone_data, 
563         int x,
564         int y,
565         int w,
566         int h)
567  : BC_ListBox(x, 
568         y, 
569         w, 
570         h, 
571         LISTBOX_TEXT,
572         standalone_data) 
573
574         this->dialog = dialog; 
575 }
576 PluginDialogNew::~PluginDialogNew() { }
577 int PluginDialogNew::handle_event() 
578
579 //      dialog->attach_new(get_selection_number(0, 0)); 
580 //      deactivate();
581
582         set_done(0); 
583         return 1;
584 }
585 int PluginDialogNew::selection_changed()
586 {
587         dialog->selected_available = get_selection_number(0, 0);
588
589
590         dialog->shared_list->set_all_selected(&dialog->shared_data, 0);
591         dialog->shared_list->draw_items(1);
592         dialog->module_list->set_all_selected(&dialog->module_data, 0);
593         dialog->module_list->draw_items(1);
594         dialog->selected_shared = -1;
595         dialog->selected_modules = -1;
596         return 1;
597 }
598
599 // PluginDialogAttachNew::PluginDialogAttachNew(MWindow *mwindow, PluginDialog *dialog, int x, int y)
600 //  : BC_GenericButton(x, y, _("Attach")) 
601 // { 
602 //      this->dialog = dialog; 
603 // }
604 // PluginDialogAttachNew::~PluginDialogAttachNew() 
605 // {
606 // }
607 // int PluginDialogAttachNew::handle_event() 
608 // {
609 //      dialog->attach_new(dialog->selected_available); 
610 //      set_done(0);
611 //      return 1;
612 // }
613 // 
614 // PluginDialogChangeNew::PluginDialogChangeNew(MWindow *mwindow, PluginDialog *dialog, int x, int y)
615 //  : BC_GenericButton(x, y, _("Change"))
616 // {
617 //    this->dialog = dialog;
618 // }
619 // PluginDialogChangeNew::~PluginDialogChangeNew()
620 // {
621 // }
622 // int PluginDialogChangeNew::handle_event() 
623 // {  
624 //    dialog->attach_new(dialog->selected_available);
625 //    set_done(0);
626 //    return 1;
627 // }
628
629
630
631
632
633
634
635
636
637
638 PluginDialogShared::PluginDialogShared(PluginDialog *dialog, 
639         ArrayList<BC_ListBoxItem*> *shared_data, 
640         int x,
641         int y,
642         int w,
643         int h)
644  : BC_ListBox(x, 
645         y, 
646         w, 
647         h, 
648         LISTBOX_TEXT, 
649         shared_data) 
650
651         this->dialog = dialog; 
652 }
653 PluginDialogShared::~PluginDialogShared() { }
654 int PluginDialogShared::handle_event()
655
656 //      dialog->attach_shared(get_selection_number(0, 0)); 
657 //      deactivate();
658         set_done(0); 
659         return 1;
660 }
661 int PluginDialogShared::selection_changed()
662 {
663         dialog->selected_shared = get_selection_number(0, 0);
664
665
666         dialog->standalone_list->set_all_selected(&dialog->standalone_data, 0);
667         dialog->standalone_list->draw_items(1);
668         dialog->module_list->set_all_selected(&dialog->module_data, 0);
669         dialog->module_list->draw_items(1);
670         dialog->selected_available = -1;
671         dialog->selected_modules = -1;
672         return 1;
673 }
674
675 // PluginDialogAttachShared::PluginDialogAttachShared(MWindow *mwindow, 
676 //      PluginDialog *dialog, 
677 //      int x,
678 //      int y)
679 //  : BC_GenericButton(x, y, _("Attach")) 
680 // { 
681 //      this->dialog = dialog; 
682 // }
683 // PluginDialogAttachShared::~PluginDialogAttachShared() { }
684 // int PluginDialogAttachShared::handle_event() 
685 // { 
686 //      dialog->attach_shared(dialog->selected_shared); 
687 //      set_done(0);
688 //      return 1;
689 // }
690 // 
691 // PluginDialogChangeShared::PluginDialogChangeShared(MWindow *mwindow,
692 //    PluginDialog *dialog,
693 //    int x,
694 //    int y)
695 //  : BC_GenericButton(x, y, _("Change"))
696 // {
697 //    this->dialog = dialog;
698 // }
699 // PluginDialogChangeShared::~PluginDialogChangeShared() { }
700 // int PluginDialogChangeShared::handle_event()
701 // {
702 //    dialog->attach_shared(dialog->selected_shared);
703 //    set_done(0);
704 //    return 1;
705 // }
706 // 
707
708
709
710
711
712
713
714
715
716
717
718
719 PluginDialogModules::PluginDialogModules(PluginDialog *dialog, 
720         ArrayList<BC_ListBoxItem*> *module_data, 
721         int x, 
722         int y,
723         int w,
724         int h)
725  : BC_ListBox(x, 
726         y, 
727         w, 
728         h, 
729         LISTBOX_TEXT, 
730         module_data) 
731
732         this->dialog = dialog; 
733 }
734 PluginDialogModules::~PluginDialogModules() { }
735 int PluginDialogModules::handle_event()
736
737 //      dialog->attach_module(get_selection_number(0, 0)); 
738 //      deactivate();
739
740         set_done(0); 
741         return 1;
742 }
743 int PluginDialogModules::selection_changed()
744 {
745         dialog->selected_modules = get_selection_number(0, 0);
746
747
748         dialog->standalone_list->set_all_selected(&dialog->standalone_data, 0);
749         dialog->standalone_list->draw_items(1);
750         dialog->shared_list->set_all_selected(&dialog->shared_data, 0);
751         dialog->shared_list->draw_items(1);
752         dialog->selected_available = -1;
753         dialog->selected_shared = -1;
754         return 1;
755 }
756
757
758 PluginDialogSingle::PluginDialogSingle(PluginDialog *dialog, int x, int y)
759  : BC_CheckBox(x, 
760         y, 
761         dialog->thread->single_standalone, 
762         _("Attach single standlone and share others"))
763 {
764         this->dialog = dialog;
765 }
766
767 int PluginDialogSingle::handle_event()
768 {
769         dialog->thread->single_standalone = get_value();
770         return 1;
771 }
772
773
774 // PluginDialogAttachModule::PluginDialogAttachModule(MWindow *mwindow, 
775 //      PluginDialog *dialog, 
776 //      int x, 
777 //      int y)
778 //  : BC_GenericButton(x, y, _("Attach")) 
779 // { 
780 //      this->dialog = dialog; 
781 // }
782 // PluginDialogAttachModule::~PluginDialogAttachModule() { }
783 // int PluginDialogAttachModule::handle_event() 
784 // { 
785 //      dialog->attach_module(dialog->selected_modules);
786 //      set_done(0);
787 //      return 1;
788 // }
789 // 
790 // PluginDialogChangeModule::PluginDialogChangeModule(MWindow *mwindow,
791 //    PluginDialog *dialog,
792 //    int x,
793 //    int y)
794 //  : BC_GenericButton(x, y, _("Change"))
795 // {
796 //    this->dialog = dialog;
797 // }
798 // PluginDialogChangeModule::~PluginDialogChangeModule() { }
799 // int PluginDialogChangeModule::handle_event()
800 // {
801 //    dialog->attach_module(dialog->selected_modules);
802 //    set_done(0);
803 //    return 1;
804 // }
805 // 
806
807
808
809
810
811
812
813
814
815
816
817
818
819