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