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