5c682797c6c77e59e5497bbc1abef9114c91eb86
[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 "edl.h"
24 #include "edlsession.h"
25 #include "language.h"
26 #include "localsession.h"
27 #include "mainsession.h"
28 #include "mainundo.h"
29 #include "mwindow.h"
30 #include "mwindowgui.h"
31 #include "module.h"
32 #include "mutex.h"
33 #include "plugin.h"
34 #include "plugindialog.h"
35 #include "pluginserver.h"
36 #include "theme.h"
37 #include "track.h"
38 #include "tracks.h"
39 #include "transition.h"
40
41
42 PluginDialogThread::PluginDialogThread(MWindow *mwindow)
43  : BC_DialogThread()
44 {
45         this->mwindow = mwindow;
46         plugin = 0;
47 }
48
49 PluginDialogThread::~PluginDialogThread()
50 {
51         close_window();
52 }
53
54 void PluginDialogThread::start_window(Track *track,
55         Plugin *plugin,
56         const char *title,
57         int is_mainmenu,
58         int data_type)
59 {
60         if(!BC_DialogThread::is_running())
61         {
62 // At this point, the caller should hold the main window mutex.
63 //              mwindow->gui->lock_window("PluginDialogThread::start_window");
64                 this->track = track;
65                 this->data_type = data_type;
66                 this->plugin = plugin;
67                 this->is_mainmenu = is_mainmenu;
68                 single_standalone = mwindow->edl->session->single_standalone;
69
70                 if(plugin)
71                 {
72                         plugin->calculate_title(plugin_title, 0);
73                         this->shared_location = plugin->shared_location;
74                         this->plugin_type = plugin->plugin_type;
75                 }
76                 else
77                 {
78                         this->plugin_title[0] = 0;
79                         this->shared_location.plugin = -1;
80                         this->shared_location.module = -1;
81                         this->plugin_type = PLUGIN_NONE;
82                 }
83
84                 strcpy(this->window_title, title);
85                 mwindow->gui->unlock_window();
86
87                 BC_DialogThread::start();
88                 mwindow->gui->lock_window("PluginDialogThread::start_window");
89         }
90 }
91
92 BC_Window* PluginDialogThread::new_gui()
93 {
94         mwindow->gui->lock_window("PluginDialogThread::new_gui");
95         int x = mwindow->gui->get_abs_cursor_x(0) -
96                 mwindow->session->plugindialog_w / 2;
97         int y = mwindow->gui->get_abs_cursor_y(0) -
98                 mwindow->session->plugindialog_h / 2;
99         plugin_type = 0;
100         PluginDialog *window = new PluginDialog(mwindow,
101                 this,
102                 window_title,
103                 x,
104                 y);
105         window->create_objects();
106         mwindow->gui->unlock_window();
107         return window;
108 }
109
110 void PluginDialogThread::handle_done_event(int result)
111 {
112         PluginDialog *window = (PluginDialog*)BC_DialogThread::get_gui();
113         if(window->selected_available >= 0)
114         {
115                 window->attach_new(window->selected_available);
116         }
117         else
118         if(window->selected_shared >= 0)
119         {
120                 window->attach_shared(window->selected_shared);
121         }
122         else
123         if(window->selected_modules >= 0)
124         {
125                 window->attach_module(window->selected_modules);
126         }
127         if( mwindow->edl )
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 < plugin_locations.total; i++)
281         {
282                 Track *track = mwindow->edl->tracks->number(plugin_locations.values[i]->module);
283                 char *track_title = track->title;
284                 int number = plugin_locations.values[i]->plugin;
285                 Plugin *plugin = track->get_current_plugin(mwindow->edl->local_session->get_selectionstart(1),
286                         number,
287                         PLAY_FORWARD,
288                         1,
289                         0);
290                 char *plugin_title = plugin->title;
291                 char string[BCTEXTLEN];
292
293                 snprintf(string, sizeof(string), "%s: %s", track_title, _(plugin_title));
294                 shared_data.append(new BC_ListBoxItem(string));
295         }
296         for(int i = 0; i < module_locations.total; i++)
297         {
298                 Track *track = mwindow->edl->tracks->number(module_locations.values[i]->module);
299                 module_data.append(new BC_ListBoxItem(track->title));
300         }
301
302
303
304
305
306 // Create widgets
307         add_subwindow(standalone_title = new BC_Title(mwindow->theme->plugindialog_new_x,
308                 mwindow->theme->plugindialog_new_y - 20,
309                 _("Plugins:")));
310         int x1 = mwindow->theme->plugindialog_new_x, y1 = mwindow->theme->plugindialog_new_y;
311         int w1 = mwindow->theme->plugindialog_new_w, h1 = mwindow->theme->plugindialog_new_h;
312         add_subwindow(search_text = new PluginDialogSearchText(this, x1, y1, w1));
313         int dy = search_text->get_h() + 10;
314         y1 += dy;  h1 -= dy;
315         load_plugin_list(0);
316
317         add_subwindow(standalone_list = new PluginDialogNew(this,
318                 &standalone_data, x1, y1, w1, h1));
319 //
320 //      if(thread->plugin)
321 //              add_subwindow(standalone_change = new PluginDialogChangeNew(mwindow,
322 //                      this,
323 //                      mwindow->theme->plugindialog_newattach_x,
324 //                      mwindow->theme->plugindialog_newattach_y));
325 //      else
326 //              add_subwindow(standalone_attach = new PluginDialogAttachNew(mwindow,
327 //                      this,
328 //                      mwindow->theme->plugindialog_newattach_x,
329 //                      mwindow->theme->plugindialog_newattach_y));
330 //
331
332
333
334
335
336
337
338         add_subwindow(shared_title = new BC_Title(mwindow->theme->plugindialog_shared_x,
339                 mwindow->theme->plugindialog_shared_y - 20,
340                 _("Shared effects:")));
341         add_subwindow(shared_list = new PluginDialogShared(this,
342                 &shared_data,
343                 mwindow->theme->plugindialog_shared_x,
344                 mwindow->theme->plugindialog_shared_y,
345                 mwindow->theme->plugindialog_shared_w,
346                 mwindow->theme->plugindialog_shared_h));
347 //      if(thread->plugin)
348 //       add_subwindow(shared_change = new PluginDialogChangeShared(mwindow,
349 //          this,
350 //          mwindow->theme->plugindialog_sharedattach_x,
351 //          mwindow->theme->plugindialog_sharedattach_y));
352 //    else
353 //              add_subwindow(shared_attach = new PluginDialogAttachShared(mwindow,
354 //                      this,
355 //                      mwindow->theme->plugindialog_sharedattach_x,
356 //                      mwindow->theme->plugindialog_sharedattach_y));
357 //
358
359
360
361
362
363
364
365
366         add_subwindow(module_title = new BC_Title(mwindow->theme->plugindialog_module_x,
367                 mwindow->theme->plugindialog_module_y - 20,
368                 _("Shared tracks:")));
369         add_subwindow(module_list = new PluginDialogModules(this,
370                 &module_data,
371                 mwindow->theme->plugindialog_module_x,
372                 mwindow->theme->plugindialog_module_y,
373                 mwindow->theme->plugindialog_module_w,
374                 mwindow->theme->plugindialog_module_h));
375 //      if(thread->plugin)
376 //       add_subwindow(module_change = new PluginDialogChangeModule(mwindow,
377 //          this,
378 //          mwindow->theme->plugindialog_moduleattach_x,
379 //          mwindow->theme->plugindialog_moduleattach_y));
380 //    else
381 //              add_subwindow(module_attach = new PluginDialogAttachModule(mwindow,
382 //                      this,
383 //                      mwindow->theme->plugindialog_moduleattach_x,
384 //                      mwindow->theme->plugindialog_moduleattach_y));
385 //
386
387
388 // Add option for the menu invocation
389 //      add_subwindow(file_title = new BC_Title(
390 //              mwindow->theme->menueffect_file_x,
391 //              mwindow->theme->menueffect_file_y,
392 //              _("One standalone effect is attached to the first track.\n"
393 //              "Shared effects are attached to the remaining tracks.")));
394
395         if(thread->is_mainmenu)
396                 add_subwindow(single_standalone = new PluginDialogSingle(this,
397                         mwindow->theme->plugindialog_new_x + BC_OKButton::calculate_w() + 10,
398                         mwindow->theme->plugindialog_new_y +
399                                 mwindow->theme->plugindialog_new_h +
400                                 get_text_height(MEDIUMFONT)));
401
402
403
404         add_subwindow(new BC_OKButton(this));
405         add_subwindow(new BC_CancelButton(this));
406
407         selected_available = -1;
408         selected_shared = -1;
409         selected_modules = -1;
410
411         show_window();
412         flush();
413         unlock_window();
414 }
415
416 int PluginDialog::resize_event(int w, int h)
417 {
418         mwindow->session->plugindialog_w = w;
419         mwindow->session->plugindialog_h = h;
420         mwindow->theme->get_plugindialog_sizes();
421
422
423         standalone_title->reposition_window(mwindow->theme->plugindialog_new_x,
424                 mwindow->theme->plugindialog_new_y - 20);
425         int x1 = mwindow->theme->plugindialog_new_x, y1 = mwindow->theme->plugindialog_new_y;
426         int w1 = mwindow->theme->plugindialog_new_w, h1 = mwindow->theme->plugindialog_new_h;
427         search_text->reposition_window(x1, y1, w1);
428         int dy = search_text->get_h() + 10;
429         y1 += dy;  h1 -= dy;
430         standalone_list->reposition_window(x1, y1, w1, h1);
431
432 //      if(standalone_attach)
433 //              standalone_attach->reposition_window(mwindow->theme->plugindialog_newattach_x,
434 //                      mwindow->theme->plugindialog_newattach_y);
435 //      else
436 //              standalone_change->reposition_window(mwindow->theme->plugindialog_newattach_x,
437 //                      mwindow->theme->plugindialog_newattach_y);
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 void PluginDialog::save_settings()
512 {
513 }
514
515
516
517
518
519
520
521 //
522 // PluginDialogTextBox::PluginDialogTextBox(PluginDialog *dialog, char *text, int x, int y)
523 //  : BC_TextBox(x, y, 200, 1, text)
524 // {
525 //      this->dialog = dialog;
526 // }
527 // PluginDialogTextBox::~PluginDialogTextBox()
528 // { }
529 // int PluginDialogTextBox::handle_event()
530 // { }
531 //
532 // PluginDialogDetach::PluginDialogDetach(MWindow *mwindow, PluginDialog *dialog, int x, int y)
533 //  : BC_GenericButton(x, y, _("Detach"))
534 // {
535 //      this->dialog = dialog;
536 // }
537 // PluginDialogDetach::~PluginDialogDetach()
538 // { }
539 // int PluginDialogDetach::handle_event()
540 // {
541 // //   dialog->title->update(_("None"));
542 //      dialog->thread->plugin_type = 0;         // type is none
543 //      dialog->thread->plugin_title[0] = 0;
544 //      return 1;
545 // }
546 //
547
548
549
550
551
552
553
554
555
556
557
558
559
560 PluginDialogNew::PluginDialogNew(PluginDialog *dialog,
561         ArrayList<BC_ListBoxItem*> *standalone_data,
562         int x, int y, int w, int h)
563  : BC_ListBox(x, y, w, h, LISTBOX_TEXT, standalone_data)
564 {
565         this->dialog = dialog;
566 }
567
568 PluginDialogNew::~PluginDialogNew() { }
569 int PluginDialogNew::handle_event()
570 {
571 //      dialog->attach_new(get_selection_number(0, 0));
572 //      deactivate();
573
574         set_done(0);
575         return 1;
576 }
577 int PluginDialogNew::selection_changed()
578 {
579         dialog->selected_available = get_selection_number(0, 0);
580
581
582         dialog->shared_list->set_all_selected(&dialog->shared_data, 0);
583         dialog->shared_list->draw_items(1);
584         dialog->module_list->set_all_selected(&dialog->module_data, 0);
585         dialog->module_list->draw_items(1);
586         dialog->selected_shared = -1;
587         dialog->selected_modules = -1;
588         return 1;
589 }
590
591 // PluginDialogAttachNew::PluginDialogAttachNew(MWindow *mwindow, PluginDialog *dialog, int x, int y)
592 //  : BC_GenericButton(x, y, _("Attach"))
593 // {
594 //      this->dialog = dialog;
595 // }
596 // PluginDialogAttachNew::~PluginDialogAttachNew()
597 // {
598 // }
599 // int PluginDialogAttachNew::handle_event()
600 // {
601 //      dialog->attach_new(dialog->selected_available);
602 //      set_done(0);
603 //      return 1;
604 // }
605 //
606 // PluginDialogChangeNew::PluginDialogChangeNew(MWindow *mwindow, PluginDialog *dialog, int x, int y)
607 //  : BC_GenericButton(x, y, _("Change"))
608 // {
609 //    this->dialog = dialog;
610 // }
611 // PluginDialogChangeNew::~PluginDialogChangeNew()
612 // {
613 // }
614 // int PluginDialogChangeNew::handle_event()
615 // {
616 //    dialog->attach_new(dialog->selected_available);
617 //    set_done(0);
618 //    return 1;
619 // }
620
621
622
623
624
625
626
627
628
629
630 PluginDialogShared::PluginDialogShared(PluginDialog *dialog,
631         ArrayList<BC_ListBoxItem*> *shared_data,
632         int x,
633         int y,
634         int w,
635         int h)
636  : BC_ListBox(x,
637         y,
638         w,
639         h,
640         LISTBOX_TEXT,
641         shared_data)
642 {
643         this->dialog = dialog;
644 }
645 PluginDialogShared::~PluginDialogShared() { }
646 int PluginDialogShared::handle_event()
647 {
648 //      dialog->attach_shared(get_selection_number(0, 0));
649 //      deactivate();
650         set_done(0);
651         return 1;
652 }
653 int PluginDialogShared::selection_changed()
654 {
655         dialog->selected_shared = get_selection_number(0, 0);
656
657
658         dialog->standalone_list->set_all_selected(&dialog->standalone_data, 0);
659         dialog->standalone_list->draw_items(1);
660         dialog->module_list->set_all_selected(&dialog->module_data, 0);
661         dialog->module_list->draw_items(1);
662         dialog->selected_available = -1;
663         dialog->selected_modules = -1;
664         return 1;
665 }
666
667 // PluginDialogAttachShared::PluginDialogAttachShared(MWindow *mwindow,
668 //      PluginDialog *dialog,
669 //      int x,
670 //      int y)
671 //  : BC_GenericButton(x, y, _("Attach"))
672 // {
673 //      this->dialog = dialog;
674 // }
675 // PluginDialogAttachShared::~PluginDialogAttachShared() { }
676 // int PluginDialogAttachShared::handle_event()
677 // {
678 //      dialog->attach_shared(dialog->selected_shared);
679 //      set_done(0);
680 //      return 1;
681 // }
682 //
683 // PluginDialogChangeShared::PluginDialogChangeShared(MWindow *mwindow,
684 //    PluginDialog *dialog,
685 //    int x,
686 //    int y)
687 //  : BC_GenericButton(x, y, _("Change"))
688 // {
689 //    this->dialog = dialog;
690 // }
691 // PluginDialogChangeShared::~PluginDialogChangeShared() { }
692 // int PluginDialogChangeShared::handle_event()
693 // {
694 //    dialog->attach_shared(dialog->selected_shared);
695 //    set_done(0);
696 //    return 1;
697 // }
698 //
699
700
701
702
703
704
705
706
707
708
709
710
711 PluginDialogModules::PluginDialogModules(PluginDialog *dialog,
712         ArrayList<BC_ListBoxItem*> *module_data,
713         int x,
714         int y,
715         int w,
716         int h)
717  : BC_ListBox(x,
718         y,
719         w,
720         h,
721         LISTBOX_TEXT,
722         module_data)
723 {
724         this->dialog = dialog;
725 }
726 PluginDialogModules::~PluginDialogModules() { }
727 int PluginDialogModules::handle_event()
728 {
729 //      dialog->attach_module(get_selection_number(0, 0));
730 //      deactivate();
731
732         set_done(0);
733         return 1;
734 }
735 int PluginDialogModules::selection_changed()
736 {
737         dialog->selected_modules = get_selection_number(0, 0);
738
739
740         dialog->standalone_list->set_all_selected(&dialog->standalone_data, 0);
741         dialog->standalone_list->draw_items(1);
742         dialog->shared_list->set_all_selected(&dialog->shared_data, 0);
743         dialog->shared_list->draw_items(1);
744         dialog->selected_available = -1;
745         dialog->selected_shared = -1;
746         return 1;
747 }
748
749 void PluginDialog::load_plugin_list(int redraw)
750 {
751         standalone_data.remove_all_objects();
752         const char *text = search_text->get_text();
753
754         for( int i=0; i<plugindb.total; ++i ) {
755                 const char *title = plugindb.values[i]->title;
756                 if( text && text[0] && !strstr(title, text) ) continue;
757                 standalone_data.append(new BC_ListBoxItem(title));
758         }
759
760         if( redraw )
761                 standalone_list->draw_items(1);
762 }
763
764 PluginDialogSearchText::PluginDialogSearchText(PluginDialog *dialog, int x, int y, int w)
765  : BC_TextBox(x, y, w, 1, "")
766 {
767         this->dialog = dialog;
768 }
769
770 int PluginDialogSearchText::handle_event()
771 {
772         dialog->load_plugin_list(1);
773         return 1;
774 }
775
776 PluginDialogSingle::PluginDialogSingle(PluginDialog *dialog, int x, int y)
777  : BC_CheckBox(x,
778         y,
779         dialog->thread->single_standalone,
780         _("Attach single standlone and share others"))
781 {
782         this->dialog = dialog;
783 }
784
785 int PluginDialogSingle::handle_event()
786 {
787         dialog->thread->single_standalone = get_value();
788         return 1;
789 }
790
791
792 // PluginDialogAttachModule::PluginDialogAttachModule(MWindow *mwindow,
793 //      PluginDialog *dialog,
794 //      int x,
795 //      int y)
796 //  : BC_GenericButton(x, y, _("Attach"))
797 // {
798 //      this->dialog = dialog;
799 // }
800 // PluginDialogAttachModule::~PluginDialogAttachModule() { }
801 // int PluginDialogAttachModule::handle_event()
802 // {
803 //      dialog->attach_module(dialog->selected_modules);
804 //      set_done(0);
805 //      return 1;
806 // }
807 //
808 // PluginDialogChangeModule::PluginDialogChangeModule(MWindow *mwindow,
809 //    PluginDialog *dialog,
810 //    int x,
811 //    int y)
812 //  : BC_GenericButton(x, y, _("Change"))
813 // {
814 //    this->dialog = dialog;
815 // }
816 // PluginDialogChangeModule::~PluginDialogChangeModule() { }
817 // int PluginDialogChangeModule::handle_event()
818 // {
819 //    dialog->attach_module(dialog->selected_modules);
820 //    set_done(0);
821 //    return 1;
822 // }
823 //
824
825
826
827
828
829
830
831
832
833
834
835
836
837