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