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