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