tweak map media vicon popup timeline drag/select
[goodguy/cinelerra.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; )
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 ) { plugin_locations.remove_object_number(i);  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                 ++i;
274         }
275         for(int i = 0; i < module_locations.total; i++)
276         {
277                 Track *track = mwindow->edl->tracks->number(module_locations.values[i]->module);
278                 module_data.append(new BC_ListBoxItem(track->title));
279         }
280
281
282
283
284
285 // Create widgets
286         add_subwindow(standalone_title = new BC_Title(mwindow->theme->plugindialog_new_x,
287                 mwindow->theme->plugindialog_new_y - 20,
288                 _("Plugins:")));
289         int x1 = mwindow->theme->plugindialog_new_x, y1 = mwindow->theme->plugindialog_new_y;
290         int w1 = mwindow->theme->plugindialog_new_w, h1 = mwindow->theme->plugindialog_new_h;
291         add_subwindow(search_text = new PluginDialogSearchText(this, x1, y1, w1));
292         int dy = search_text->get_h() + 10;
293         y1 += dy;  h1 -= dy;
294         load_plugin_list(0);
295
296         add_subwindow(standalone_list = new PluginDialogNew(this,
297                 &standalone_data, x1, y1, w1, h1));
298 //
299 //      if(thread->plugin)
300 //              add_subwindow(standalone_change = new PluginDialogChangeNew(mwindow,
301 //                      this,
302 //                      mwindow->theme->plugindialog_newattach_x,
303 //                      mwindow->theme->plugindialog_newattach_y));
304 //      else
305 //              add_subwindow(standalone_attach = new PluginDialogAttachNew(mwindow,
306 //                      this,
307 //                      mwindow->theme->plugindialog_newattach_x,
308 //                      mwindow->theme->plugindialog_newattach_y));
309 //
310
311         add_subwindow(shared_title = new BC_Title(mwindow->theme->plugindialog_shared_x,
312                 mwindow->theme->plugindialog_shared_y - 20,
313                 _("Shared effects:")));
314         add_subwindow(shared_list = new PluginDialogShared(this,
315                 &shared_data,
316                 mwindow->theme->plugindialog_shared_x,
317                 mwindow->theme->plugindialog_shared_y,
318                 mwindow->theme->plugindialog_shared_w,
319                 mwindow->theme->plugindialog_shared_h));
320 //      if(thread->plugin)
321 //       add_subwindow(shared_change = new PluginDialogChangeShared(mwindow,
322 //          this,
323 //          mwindow->theme->plugindialog_sharedattach_x,
324 //          mwindow->theme->plugindialog_sharedattach_y));
325 //    else
326 //              add_subwindow(shared_attach = new PluginDialogAttachShared(mwindow,
327 //                      this,
328 //                      mwindow->theme->plugindialog_sharedattach_x,
329 //                      mwindow->theme->plugindialog_sharedattach_y));
330 //
331
332         add_subwindow(module_title = new BC_Title(mwindow->theme->plugindialog_module_x,
333                 mwindow->theme->plugindialog_module_y - 20,
334                 _("Shared tracks:")));
335         add_subwindow(module_list = new PluginDialogModules(this,
336                 &module_data,
337                 mwindow->theme->plugindialog_module_x,
338                 mwindow->theme->plugindialog_module_y,
339                 mwindow->theme->plugindialog_module_w,
340                 mwindow->theme->plugindialog_module_h));
341 //      if(thread->plugin)
342 //       add_subwindow(module_change = new PluginDialogChangeModule(mwindow,
343 //          this,
344 //          mwindow->theme->plugindialog_moduleattach_x,
345 //          mwindow->theme->plugindialog_moduleattach_y));
346 //    else
347 //              add_subwindow(module_attach = new PluginDialogAttachModule(mwindow,
348 //                      this,
349 //                      mwindow->theme->plugindialog_moduleattach_x,
350 //                      mwindow->theme->plugindialog_moduleattach_y));
351 //
352
353
354 // Add option for the menu invocation
355 //      add_subwindow(file_title = new BC_Title(
356 //              mwindow->theme->menueffect_file_x,
357 //              mwindow->theme->menueffect_file_y,
358 //              _("One standalone effect is attached to the first track.\n"
359 //              "Shared effects are attached to the remaining tracks.")));
360
361         if(thread->is_mainmenu)
362                 add_subwindow(single_standalone = new PluginDialogSingle(this,
363                         mwindow->theme->plugindialog_new_x + BC_OKButton::calculate_w() + 10,
364                         mwindow->theme->plugindialog_new_y +
365                                 mwindow->theme->plugindialog_new_h +
366                                 get_text_height(MEDIUMFONT)));
367
368
369
370         add_subwindow(new BC_OKButton(this));
371         add_subwindow(new BC_CancelButton(this));
372
373         selected_available = -1;
374         selected_shared = -1;
375         selected_modules = -1;
376
377         show_window();
378         flush();
379         unlock_window();
380 }
381
382 int PluginDialog::resize_event(int w, int h)
383 {
384         mwindow->session->plugindialog_w = w;
385         mwindow->session->plugindialog_h = h;
386         mwindow->theme->get_plugindialog_sizes();
387
388
389         standalone_title->reposition_window(mwindow->theme->plugindialog_new_x,
390                 mwindow->theme->plugindialog_new_y - 20);
391         int x1 = mwindow->theme->plugindialog_new_x, y1 = mwindow->theme->plugindialog_new_y;
392         int w1 = mwindow->theme->plugindialog_new_w, h1 = mwindow->theme->plugindialog_new_h;
393         search_text->reposition_window(x1, y1, w1);
394         int dy = search_text->get_h() + 10;
395         y1 += dy;  h1 -= dy;
396         standalone_list->reposition_window(x1, y1, w1, h1);
397
398 //      if(standalone_attach)
399 //              standalone_attach->reposition_window(mwindow->theme->plugindialog_newattach_x,
400 //                      mwindow->theme->plugindialog_newattach_y);
401 //      else
402 //              standalone_change->reposition_window(mwindow->theme->plugindialog_newattach_x,
403 //                      mwindow->theme->plugindialog_newattach_y);
404
405         shared_title->reposition_window(mwindow->theme->plugindialog_shared_x,
406                 mwindow->theme->plugindialog_shared_y - 20);
407         shared_list->reposition_window(mwindow->theme->plugindialog_shared_x,
408                 mwindow->theme->plugindialog_shared_y,
409                 mwindow->theme->plugindialog_shared_w,
410                 mwindow->theme->plugindialog_shared_h);
411 //      if(shared_attach)
412 //              shared_attach->reposition_window(mwindow->theme->plugindialog_sharedattach_x,
413 //                      mwindow->theme->plugindialog_sharedattach_y);
414 //      else
415 //              shared_change->reposition_window(mwindow->theme->plugindialog_sharedattach_x,
416 //                      mwindow->theme->plugindialog_sharedattach_y);
417 //
418
419
420
421
422         module_title->reposition_window(mwindow->theme->plugindialog_module_x,
423                 mwindow->theme->plugindialog_module_y - 20);
424         module_list->reposition_window(mwindow->theme->plugindialog_module_x,
425                 mwindow->theme->plugindialog_module_y,
426                 mwindow->theme->plugindialog_module_w,
427                 mwindow->theme->plugindialog_module_h);
428 //      if(module_attach)
429 //              module_attach->reposition_window(mwindow->theme->plugindialog_moduleattach_x,
430 //                      mwindow->theme->plugindialog_moduleattach_y);
431 //      else
432 //              module_change->reposition_window(mwindow->theme->plugindialog_moduleattach_x,
433 //                      mwindow->theme->plugindialog_moduleattach_y);
434
435
436         if(single_standalone)
437                 single_standalone->reposition_window(
438                         mwindow->theme->plugindialog_new_x + BC_OKButton::calculate_w() + 10,
439                         mwindow->theme->plugindialog_new_y + mwindow->theme->plugindialog_new_h +
440                                 get_text_height(MEDIUMFONT));
441
442         flush();
443         return 0;
444 }
445
446 int PluginDialog::attach_new(int number)
447 {
448         if(number >= 0 && number < plugindb.size())
449         {
450                 strcpy(thread->plugin_title, plugindb.values[number]->title);
451                 thread->plugin_type = PLUGIN_STANDALONE;         // type is plugin
452         }
453         return 0;
454 }
455
456 int PluginDialog::attach_shared(int number)
457 {
458         if(number >= 0 && number < plugin_locations.size())
459         {
460                 thread->plugin_type = PLUGIN_SHAREDPLUGIN;         // type is shared plugin
461                 thread->shared_location = *(plugin_locations.values[number]); // copy location
462         }
463         return 0;
464 }
465
466 int PluginDialog::attach_module(int number)
467 {
468         if(number >= 0 && number < module_locations.size())
469         {
470 //              title->update(module_data.values[number]->get_text());
471                 thread->plugin_type = PLUGIN_SHAREDMODULE;         // type is module
472                 thread->shared_location = *(module_locations.values[number]); // copy location
473         }
474         return 0;
475 }
476
477 void PluginDialog::save_settings()
478 {
479 }
480
481
482
483
484
485
486
487 //
488 // PluginDialogTextBox::PluginDialogTextBox(PluginDialog *dialog, char *text, int x, int y)
489 //  : BC_TextBox(x, y, 200, 1, text)
490 // {
491 //      this->dialog = dialog;
492 // }
493 // PluginDialogTextBox::~PluginDialogTextBox()
494 // { }
495 // int PluginDialogTextBox::handle_event()
496 // { }
497 //
498 // PluginDialogDetach::PluginDialogDetach(MWindow *mwindow, PluginDialog *dialog, int x, int y)
499 //  : BC_GenericButton(x, y, _("Detach"))
500 // {
501 //      this->dialog = dialog;
502 // }
503 // PluginDialogDetach::~PluginDialogDetach()
504 // { }
505 // int PluginDialogDetach::handle_event()
506 // {
507 // //   dialog->title->update(_("None"));
508 //      dialog->thread->plugin_type = 0;         // type is none
509 //      dialog->thread->plugin_title[0] = 0;
510 //      return 1;
511 // }
512 //
513
514
515
516
517
518
519
520
521
522
523
524
525
526 PluginDialogNew::PluginDialogNew(PluginDialog *dialog,
527         ArrayList<BC_ListBoxItem*> *standalone_data,
528         int x, int y, int w, int h)
529  : BC_ListBox(x, y, w, h, LISTBOX_TEXT, standalone_data)
530 {
531         this->dialog = dialog;
532 }
533
534 PluginDialogNew::~PluginDialogNew() { }
535 int PluginDialogNew::handle_event()
536 {
537 //      dialog->attach_new(get_selection_number(0, 0));
538 //      deactivate();
539
540         set_done(0);
541         return 1;
542 }
543 int PluginDialogNew::selection_changed()
544 {
545         int no = get_selection_number(0, 0);
546         dialog->selected_available = no >= 0 && no < dialog->standalone_data.size() ?
547                 ((PluginDialogListItem *)dialog->standalone_data[no])->item_no : -1;
548         dialog->shared_list->set_all_selected(&dialog->shared_data, 0);
549         dialog->shared_list->draw_items(1);
550         dialog->selected_shared = -1;
551         dialog->module_list->set_all_selected(&dialog->module_data, 0);
552         dialog->module_list->draw_items(1);
553         dialog->selected_modules = -1;
554         return 1;
555 }
556
557 // PluginDialogAttachNew::PluginDialogAttachNew(MWindow *mwindow, PluginDialog *dialog, int x, int y)
558 //  : BC_GenericButton(x, y, _("Attach"))
559 // {
560 //      this->dialog = dialog;
561 // }
562 // PluginDialogAttachNew::~PluginDialogAttachNew()
563 // {
564 // }
565 // int PluginDialogAttachNew::handle_event()
566 // {
567 //      dialog->attach_new(dialog->selected_available);
568 //      set_done(0);
569 //      return 1;
570 // }
571 //
572 // PluginDialogChangeNew::PluginDialogChangeNew(MWindow *mwindow, PluginDialog *dialog, int x, int y)
573 //  : BC_GenericButton(x, y, _("Change"))
574 // {
575 //    this->dialog = dialog;
576 // }
577 // PluginDialogChangeNew::~PluginDialogChangeNew()
578 // {
579 // }
580 // int PluginDialogChangeNew::handle_event()
581 // {
582 //    dialog->attach_new(dialog->selected_available);
583 //    set_done(0);
584 //    return 1;
585 // }
586
587
588
589
590
591
592
593
594
595
596 PluginDialogShared::PluginDialogShared(PluginDialog *dialog,
597         ArrayList<BC_ListBoxItem*> *shared_data,
598         int x,
599         int y,
600         int w,
601         int h)
602  : BC_ListBox(x,
603         y,
604         w,
605         h,
606         LISTBOX_TEXT,
607         shared_data)
608 {
609         this->dialog = dialog;
610 }
611 PluginDialogShared::~PluginDialogShared() { }
612 int PluginDialogShared::handle_event()
613 {
614 //      dialog->attach_shared(get_selection_number(0, 0));
615 //      deactivate();
616         set_done(0);
617         return 1;
618 }
619 int PluginDialogShared::selection_changed()
620 {
621         dialog->selected_shared = get_selection_number(0, 0);
622
623
624         dialog->standalone_list->set_all_selected(&dialog->standalone_data, 0);
625         dialog->standalone_list->draw_items(1);
626         dialog->module_list->set_all_selected(&dialog->module_data, 0);
627         dialog->module_list->draw_items(1);
628         dialog->selected_available = -1;
629         dialog->selected_modules = -1;
630         return 1;
631 }
632
633 // PluginDialogAttachShared::PluginDialogAttachShared(MWindow *mwindow,
634 //      PluginDialog *dialog,
635 //      int x,
636 //      int y)
637 //  : BC_GenericButton(x, y, _("Attach"))
638 // {
639 //      this->dialog = dialog;
640 // }
641 // PluginDialogAttachShared::~PluginDialogAttachShared() { }
642 // int PluginDialogAttachShared::handle_event()
643 // {
644 //      dialog->attach_shared(dialog->selected_shared);
645 //      set_done(0);
646 //      return 1;
647 // }
648 //
649 // PluginDialogChangeShared::PluginDialogChangeShared(MWindow *mwindow,
650 //    PluginDialog *dialog,
651 //    int x,
652 //    int y)
653 //  : BC_GenericButton(x, y, _("Change"))
654 // {
655 //    this->dialog = dialog;
656 // }
657 // PluginDialogChangeShared::~PluginDialogChangeShared() { }
658 // int PluginDialogChangeShared::handle_event()
659 // {
660 //    dialog->attach_shared(dialog->selected_shared);
661 //    set_done(0);
662 //    return 1;
663 // }
664 //
665
666
667
668
669
670
671
672
673
674
675
676
677 PluginDialogModules::PluginDialogModules(PluginDialog *dialog,
678         ArrayList<BC_ListBoxItem*> *module_data,
679         int x,
680         int y,
681         int w,
682         int h)
683  : BC_ListBox(x,
684         y,
685         w,
686         h,
687         LISTBOX_TEXT,
688         module_data)
689 {
690         this->dialog = dialog;
691 }
692 PluginDialogModules::~PluginDialogModules() { }
693 int PluginDialogModules::handle_event()
694 {
695 //      dialog->attach_module(get_selection_number(0, 0));
696 //      deactivate();
697
698         set_done(0);
699         return 1;
700 }
701 int PluginDialogModules::selection_changed()
702 {
703         dialog->selected_modules = get_selection_number(0, 0);
704
705
706         dialog->standalone_list->set_all_selected(&dialog->standalone_data, 0);
707         dialog->standalone_list->draw_items(1);
708         dialog->shared_list->set_all_selected(&dialog->shared_data, 0);
709         dialog->shared_list->draw_items(1);
710         dialog->selected_available = -1;
711         dialog->selected_shared = -1;
712         return 1;
713 }
714
715 void PluginDialog::load_plugin_list(int redraw)
716 {
717         standalone_data.remove_all_objects();
718         const char *text = search_text->get_text();
719
720         for( int i=0; i<plugindb.total; ++i ) {
721                 const char *title = _(plugindb.values[i]->title);
722                 if( text && text[0] && !bstrcasestr(title, text) ) continue;
723                 standalone_data.append(new PluginDialogListItem(title, i));
724         }
725
726         if( redraw )
727                 standalone_list->draw_items(1);
728 }
729
730 PluginDialogSearchText::PluginDialogSearchText(PluginDialog *dialog, int x, int y, int w)
731  : BC_TextBox(x, y, w, 1, "")
732 {
733         this->dialog = dialog;
734 }
735
736 int PluginDialogSearchText::handle_event()
737 {
738         dialog->load_plugin_list(1);
739         return 1;
740 }
741
742 PluginDialogSingle::PluginDialogSingle(PluginDialog *dialog, int x, int y)
743  : BC_CheckBox(x,
744         y,
745         dialog->thread->single_standalone,
746         _("Attach single standalone and share others"))
747 {
748         this->dialog = dialog;
749 }
750
751 int PluginDialogSingle::handle_event()
752 {
753         dialog->thread->single_standalone = get_value();
754         return 1;
755 }
756
757
758 // PluginDialogAttachModule::PluginDialogAttachModule(MWindow *mwindow,
759 //      PluginDialog *dialog,
760 //      int x,
761 //      int y)
762 //  : BC_GenericButton(x, y, _("Attach"))
763 // {
764 //      this->dialog = dialog;
765 // }
766 // PluginDialogAttachModule::~PluginDialogAttachModule() { }
767 // int PluginDialogAttachModule::handle_event()
768 // {
769 //      dialog->attach_module(dialog->selected_modules);
770 //      set_done(0);
771 //      return 1;
772 // }
773 //
774 // PluginDialogChangeModule::PluginDialogChangeModule(MWindow *mwindow,
775 //    PluginDialog *dialog,
776 //    int x,
777 //    int y)
778 //  : BC_GenericButton(x, y, _("Change"))
779 // {
780 //    this->dialog = dialog;
781 // }
782 // PluginDialogChangeModule::~PluginDialogChangeModule() { }
783 // int PluginDialogChangeModule::handle_event()
784 // {
785 //    dialog->attach_module(dialog->selected_modules);
786 //    set_done(0);
787 //    return 1;
788 // }
789 //
790
791
792
793
794
795
796
797
798
799
800
801
802
803