Credit Andrew - improve in-tree documentation
[goodguy/cinelerra.git] / cinelerra / interfaceprefs.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 "deleteallindexes.h"
23 #include "edl.h"
24 #include "edlsession.h"
25 #include "file.h"
26 #include "filesystem.h"
27 #include "language.h"
28 #include "mwindow.h"
29 #include "preferences.h"
30 #include "preferencesthread.h"
31 #include "probeprefs.h"
32 #include "interfaceprefs.h"
33 #include "shbtnprefs.h"
34 #include "theme.h"
35
36 #if 0
37 N_("Drag all following edits")
38 N_("Drag only one edit")
39 N_("Drag source only")
40 N_("No effect")
41 #endif
42
43 #define MOVE_ALL_EDITS_TITLE N_("Drag all following edits")
44 #define MOVE_ONE_EDIT_TITLE N_("Drag only one edit")
45 #define MOVE_NO_EDITS_TITLE N_("Drag source only")
46 #define MOVE_EDITS_DISABLED_TITLE N_("No effect")
47
48 InterfacePrefs::InterfacePrefs(MWindow *mwindow, PreferencesWindow *pwindow)
49  : PreferencesDialog(mwindow, pwindow)
50 {
51         min_db = 0;
52         max_db = 0;
53         shbtn_dialog = 0;
54         file_probe_dialog = 0;
55 }
56
57 InterfacePrefs::~InterfacePrefs()
58 {
59         delete min_db;
60         delete max_db;
61         delete shbtn_dialog;
62         delete file_probe_dialog;
63 }
64
65
66 void InterfacePrefs::create_objects()
67 {
68         BC_Resources *resources = BC_WindowBase::get_resources();
69         int margin = mwindow->theme->widget_border;
70         char string[BCTEXTLEN];
71         int x0 = mwindow->theme->preferencesoptions_x;
72         int y0 = mwindow->theme->preferencesoptions_y;
73         int x = x0, y = y0;
74
75         add_subwindow(new BC_Title(x, y, _("Editing:"), LARGEFONT,
76                 resources->text_default));
77         y += 35;
78
79         int x2 = get_w()/2, y2 = y;
80         x = x2;
81         BC_Title *title;
82         add_subwindow(title = new BC_Title(x, y, _("Keyframe reticle:")));
83         y += title->get_h() + 5;
84         keyframe_reticle = new KeyframeReticle(pwindow, this, x, y,
85                 &pwindow->thread->preferences->keyframe_reticle);
86         add_subwindow(keyframe_reticle);
87         keyframe_reticle->create_objects();
88
89         y += 30;
90         add_subwindow(title = new BC_Title(x, y, _("Snapshot path:")));
91         y += title->get_h() + 5;
92         add_subwindow(snapshot_path = new SnapshotPathText(pwindow, this, x, y, get_w()-x-30));
93
94         x = x0;  y = y2;
95         add_subwindow(new BC_Title(x, y, _("Clicking on edit boundaries does what:")));
96         y += 25;
97         add_subwindow(new BC_Title(x, y, _("Button 1:")));
98
99         int x1 = x + 100;
100         ViewBehaviourText *text;
101         add_subwindow(text = new ViewBehaviourText(x1, y - 5,
102                 behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[0]),
103                         pwindow,
104                         &(pwindow->thread->edl->session->edit_handle_mode[0])));
105         text->create_objects();
106         y += 30;
107         add_subwindow(new BC_Title(x, y, _("Button 2:")));
108         add_subwindow(text = new ViewBehaviourText(x1,
109                 y - 5,
110                 behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[1]),
111                         pwindow,
112                         &(pwindow->thread->edl->session->edit_handle_mode[1])));
113         text->create_objects();
114         y += 30;
115         add_subwindow(new BC_Title(x, y, _("Button 3:")));
116         add_subwindow(text = new ViewBehaviourText(x1, y - 5,
117                 behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[2]),
118                         pwindow,
119                         &(pwindow->thread->edl->session->edit_handle_mode[2])));
120         text->create_objects();
121         y += text->get_h() + 30;
122
123         x = x0;
124         add_subwindow(new BC_Bar(5, y,  get_w() - 10));
125         y += 5;
126         add_subwindow(new BC_Title(x, y, _("Operation:"), LARGEFONT,
127                 resources->text_default));
128
129         int y1 = y;
130         y += 15;
131
132         AndroidRemote *android_remote = new AndroidRemote(pwindow, x2, y);
133         add_subwindow(android_remote);
134         y += android_remote->get_h() + 10;
135         add_subwindow(title = new BC_Title(x2, y, _("Port:")));
136         int x3 = x2 + title->get_w() + margin;
137         AndroidPort *android_port = new AndroidPort(pwindow, x3, y);
138         add_subwindow(android_port);
139         y += title->get_h() + 10;
140         add_subwindow(title = new BC_Title(x2, y, _("PIN:")));
141         AndroidPIN *android_pin = new AndroidPIN(pwindow, x3, y);
142         add_subwindow(android_pin);
143         y += title->get_h() + 20;
144
145         ShBtnPrefs *shbtn_prefs = new ShBtnPrefs(pwindow, this, x2, y);
146         add_subwindow(shbtn_prefs);
147         y += shbtn_prefs->get_h() + 20;
148
149         add_subwindow(reload_plugins = new PrefsReloadPlugins(pwindow, this, x2, y));
150         y += reload_plugins->get_h() + 10;
151
152         add_subwindow(title = new BC_Title(x2, y, _("Default LV2_PATH:")));
153         y += title->get_h() + 10;
154         PrefsLV2PathText *lv2_path_text = new PrefsLV2PathText(pwindow, this, x2, y, get_w()-x2-30);
155         add_subwindow(lv2_path_text);
156         y += 30;
157
158         y2 = y;
159         x = x0;  y = y1 + 35;
160         add_subwindow(file_probes = new PrefsFileProbes(pwindow, this, x, y));
161         y += 30;
162
163         PrefsTrapSigSEGV *trap_segv = new PrefsTrapSigSEGV(this, x, y);
164         add_subwindow(trap_segv);
165         x1 = x + trap_segv->get_w() + 10;
166         add_subwindow(new BC_Title(x1, y, _("(must be root)"), MEDIUMFONT, RED));
167         y += 30;
168
169         PrefsTrapSigINTR *trap_intr = new PrefsTrapSigINTR(this, x, y);
170         add_subwindow(trap_intr);
171         add_subwindow(new BC_Title(x1, y, _("(must be root)"), MEDIUMFONT, RED));
172         y += 30;
173
174         yuv420p_dvdlace = new PrefsYUV420P_DVDlace(pwindow, this, x, y);
175         add_subwindow(yuv420p_dvdlace);
176         y += 30;
177
178         add_subwindow(title = new BC_Title(x1=x, y + 5, _("Min DB for meter:")));
179         x1 += title->get_w() + 4;
180         sprintf(string, "%d", pwindow->thread->edl->session->min_meter_db);
181         add_subwindow(min_db = new MeterMinDB(pwindow, string, x1, y));
182         x1 += min_db->get_w() + 4;
183         add_subwindow(title = new BC_Title(x1, y + 5, _("Max:")));
184         x1 += title->get_w() + 4;
185         sprintf(string, "%d", pwindow->thread->edl->session->max_meter_db);
186         add_subwindow(max_db = new MeterMaxDB(pwindow, string, x1, y));
187         y += 30;
188
189         StillImageUseDuration *use_stduration = new StillImageUseDuration(pwindow,
190                 pwindow->thread->edl->session->si_useduration, x, y);
191         add_subwindow(use_stduration);
192         x1 = x + use_stduration->get_w() + 10;
193         StillImageDuration *stduration = new StillImageDuration(pwindow, x1, y);
194         add_subwindow(stduration);
195         x1 += stduration->get_w() + 10;
196         add_subwindow(new BC_Title(x1, y, _("Seconds")));
197         y += 30;
198
199         PrefsAutostartLV2UI *autostart_lv2ui = new PrefsAutostartLV2UI(x, y,pwindow);
200         add_subwindow(autostart_lv2ui);
201         y += autostart_lv2ui->get_h() + 10;
202
203         if( y2 > y ) y = y2;
204         x = x0;
205         add_subwindow(new BC_Bar(5, y,  get_w() - 10));
206         y += 5;
207
208         add_subwindow(new BC_Title(x, y, _("Index files:"), LARGEFONT, resources->text_default));
209         y += 30;
210
211         add_subwindow(new BC_Title(x, y + 5,
212                 _("Index files go here:"), MEDIUMFONT, resources->text_default));
213         x1 = x + 230;
214         add_subwindow(ipathtext = new IndexPathText(x1, y, pwindow,
215                 pwindow->thread->preferences->index_directory));
216         x1 +=  ipathtext->get_w();
217         add_subwindow(ipath = new BrowseButton(mwindow->theme, this, ipathtext, x1, y,
218                 pwindow->thread->preferences->index_directory,
219                 _("Index Path"), _("Select the directory for index files"), 1));
220
221         y += 30;
222         add_subwindow(new BC_Title(x, y + 5, _("Size of index file:"),
223                 MEDIUMFONT, resources->text_default));
224         sprintf(string, "%jd", pwindow->thread->preferences->index_size);
225         add_subwindow(isize = new IndexSize(x + 230, y, pwindow, string));
226         add_subwindow(new ScanCommercials(pwindow, 400,y));
227
228         y += 30;
229         add_subwindow(new BC_Title(x, y + 5, _("Number of index files to keep:"),
230                 MEDIUMFONT, resources->text_default));
231         sprintf(string, "%ld", (long)pwindow->thread->preferences->index_count);
232         add_subwindow(icount = new IndexCount(x + 230, y, pwindow, string));
233         add_subwindow(del_indexes = new DeleteAllIndexes(mwindow, pwindow, 400, y,
234                 _("Delete existing indexes"), "[*.idx][*.toc][*.mkr]"));
235         y += 30;
236         add_subwindow(ffmpeg_marker_files = new IndexFFMPEGMarkerFiles(this, x, y));
237         add_subwindow(del_clipngs = new DeleteAllIndexes(mwindow, pwindow, 400, y,
238                 _("Delete clip thumbnails"), "clip_*.png"));
239 }
240
241 const char* InterfacePrefs::behavior_to_text(int mode)
242 {
243         switch(mode) {
244                 case MOVE_ALL_EDITS: return _(MOVE_ALL_EDITS_TITLE);
245                 case MOVE_ONE_EDIT:  return _(MOVE_ONE_EDIT_TITLE);
246                 case MOVE_NO_EDITS:  return _(MOVE_NO_EDITS_TITLE);
247                 case MOVE_EDITS_DISABLED: return _(MOVE_EDITS_DISABLED_TITLE);
248                 default: return "";
249         }
250 }
251
252 IndexPathText::IndexPathText(int x, int y, PreferencesWindow *pwindow, char *text)
253  : BC_TextBox(x, y, 240, 1, text)
254 {
255         this->pwindow = pwindow;
256 }
257
258 IndexPathText::~IndexPathText() {}
259
260 int IndexPathText::handle_event()
261 {
262         strcpy(pwindow->thread->preferences->index_directory, get_text());
263         return 1;
264 }
265
266
267
268
269 IndexSize::IndexSize(int x, int y, PreferencesWindow *pwindow, char *text)
270  : BC_TextBox(x, y, 100, 1, text)
271 {
272         this->pwindow = pwindow;
273 }
274
275 int IndexSize::handle_event()
276 {
277         long result;
278
279         result = atol(get_text());
280         if(result < 64000) result = 64000;
281         //if(result < 500000) result = 500000;
282         pwindow->thread->preferences->index_size = result;
283         return 0;
284 }
285
286
287
288 IndexCount::IndexCount(int x, int y, PreferencesWindow *pwindow, char *text)
289  : BC_TextBox(x, y, 100, 1, text)
290 {
291         this->pwindow = pwindow;
292 }
293
294 int IndexCount::handle_event()
295 {
296         long result;
297
298         result = atol(get_text());
299         if(result < 1) result = 1;
300         pwindow->thread->preferences->index_count = result;
301         return 0;
302 }
303
304
305
306 IndexFFMPEGMarkerFiles::IndexFFMPEGMarkerFiles(InterfacePrefs *iface_prefs, int x, int y)
307  : BC_CheckBox(x, y,
308         iface_prefs->pwindow->thread->preferences->ffmpeg_marker_indexes,
309         _("build ffmpeg marker indexes"))
310 {
311         this->iface_prefs = iface_prefs;
312 }
313 IndexFFMPEGMarkerFiles::~IndexFFMPEGMarkerFiles()
314 {
315 }
316
317 int IndexFFMPEGMarkerFiles::handle_event()
318 {
319         iface_prefs->pwindow->thread->preferences->ffmpeg_marker_indexes = get_value();
320         return 1;
321 }
322
323
324 ViewBehaviourText::ViewBehaviourText(int x, int y, const char *text, PreferencesWindow *pwindow,
325         int *output)
326  : BC_PopupMenu(x, y, 200, text)
327 {
328         this->output = output;
329 }
330
331 ViewBehaviourText::~ViewBehaviourText()
332 {
333 }
334
335 int ViewBehaviourText::handle_event()
336 {
337         return 0;
338 }
339
340 void ViewBehaviourText::create_objects()
341 {
342         add_item(new ViewBehaviourItem(this, _(MOVE_ALL_EDITS_TITLE), MOVE_ALL_EDITS));
343         add_item(new ViewBehaviourItem(this, _(MOVE_ONE_EDIT_TITLE), MOVE_ONE_EDIT));
344         add_item(new ViewBehaviourItem(this, _(MOVE_NO_EDITS_TITLE), MOVE_NO_EDITS));
345         add_item(new ViewBehaviourItem(this, _(MOVE_EDITS_DISABLED_TITLE), MOVE_EDITS_DISABLED));
346 }
347
348
349 ViewBehaviourItem::ViewBehaviourItem(ViewBehaviourText *popup, char *text, int behaviour)
350  : BC_MenuItem(text)
351 {
352         this->popup = popup;
353         this->behaviour = behaviour;
354 }
355
356 ViewBehaviourItem::~ViewBehaviourItem()
357 {
358 }
359
360 int ViewBehaviourItem::handle_event()
361 {
362         popup->set_text(get_text());
363         *(popup->output) = behaviour;
364         return 1;
365 }
366
367
368 MeterMinDB::MeterMinDB(PreferencesWindow *pwindow, char *text, int x, int y)
369  : BC_TextBox(x, y, 50, 1, text)
370 {
371         this->pwindow = pwindow;
372 }
373
374 int MeterMinDB::handle_event()
375 {
376         pwindow->thread->redraw_meters = 1;
377         pwindow->thread->edl->session->min_meter_db = atol(get_text());
378         return 0;
379 }
380
381
382 MeterMaxDB::MeterMaxDB(PreferencesWindow *pwindow, char *text, int x, int y)
383  : BC_TextBox(x, y, 50, 1, text)
384 {
385         this->pwindow = pwindow;
386 }
387
388 int MeterMaxDB::handle_event()
389 {
390         pwindow->thread->redraw_meters = 1;
391         pwindow->thread->edl->session->max_meter_db = atol(get_text());
392         return 0;
393 }
394
395
396 ScanCommercials::ScanCommercials(PreferencesWindow *pwindow, int x, int y)
397  : BC_CheckBox(x,
398         y,
399         pwindow->thread->preferences->scan_commercials,
400         _("Scan for commercials during toc build"))
401 {
402         this->pwindow = pwindow;
403 }
404 int ScanCommercials::handle_event()
405 {
406         pwindow->thread->preferences->scan_commercials = get_value();
407         return 1;
408 }
409
410
411 AndroidRemote::AndroidRemote(PreferencesWindow *pwindow, int x, int y)
412  : BC_CheckBox(x, y,
413         pwindow->thread->preferences->android_remote,
414         _("Android Remote Control"))
415 {
416         this->pwindow = pwindow;
417 }
418 int AndroidRemote::handle_event()
419 {
420         pwindow->thread->preferences->android_remote = get_value();
421         return 1;
422 }
423
424 AndroidPIN::AndroidPIN(PreferencesWindow *pwindow, int x, int y)
425  : BC_TextBox(x, y, 240, 1, pwindow->thread->preferences->android_pin)
426 {
427         this->pwindow = pwindow;
428 }
429
430 int AndroidPIN::handle_event()
431 {
432         char *txt = pwindow->thread->preferences->android_pin;
433         int len = sizeof(pwindow->thread->preferences->android_pin);
434         strncpy(txt, get_text(), len);
435         return 1;
436 }
437
438
439 AndroidPort::AndroidPort(PreferencesWindow *pwindow, int x, int y)
440  : BC_TextBox(x, y, 72, 1, pwindow->thread->preferences->android_port)
441 {
442         this->pwindow = pwindow;
443 }
444
445 int AndroidPort::handle_event()
446 {
447         unsigned short port = atoi(get_text());
448         if( port < 1024 ) port = 1024;
449         pwindow->thread->preferences->android_port = port;
450         char str[BCSTRLEN];
451         sprintf(str,"%u",port);
452         update(str);
453         return 1;
454 }
455
456 int InterfacePrefs::start_shbtn_dialog()
457 {
458         if( !shbtn_dialog )
459                 shbtn_dialog = new ShBtnEditDialog(pwindow);
460         shbtn_dialog->start();
461         return 1;
462 }
463
464 ShBtnPrefs::ShBtnPrefs(PreferencesWindow *pwindow, InterfacePrefs *iface_prefs, int x, int y)
465  : BC_GenericButton(x, y, _("Shell Commands"))
466 {
467         this->pwindow = pwindow;
468         this->iface_prefs = iface_prefs;
469         set_tooltip(_("Main Menu Shell Commands"));
470 }
471
472 int ShBtnPrefs::handle_event()
473 {
474         return iface_prefs->start_shbtn_dialog();
475 }
476
477
478 StillImageUseDuration::StillImageUseDuration(PreferencesWindow *pwindow, int value, int x, int y)
479  : BC_CheckBox(x, y, value, _("Import images with a duration of"))
480 {
481         this->pwindow = pwindow;
482 }
483
484 int StillImageUseDuration::handle_event()
485 {
486         pwindow->thread->edl->session->si_useduration = get_value();
487         return 1;
488 }
489
490 StillImageDuration::StillImageDuration(PreferencesWindow *pwindow, int x, int y)
491  : BC_TextBox(x, y, 70, 1, pwindow->thread->edl->session->si_duration)
492 {
493         this->pwindow = pwindow;
494 }
495 int StillImageDuration::handle_event()
496 {
497         pwindow->thread->edl->session->si_duration = atof(get_text());
498         return 1;
499 }
500
501
502 HairlineItem::HairlineItem(KeyframeReticle *popup, int hairline)
503  : BC_MenuItem(popup->hairline_to_string(hairline))
504 {
505         this->popup = popup;
506         this->hairline = hairline;
507 }
508
509 HairlineItem::~HairlineItem()
510 {
511 }
512
513 int HairlineItem::handle_event()
514 {
515         popup->pwindow->thread->redraw_overlays = 1;
516         popup->set_text(get_text());
517         *(popup->output) = hairline;
518         return 1;
519 }
520
521
522 KeyframeReticle::KeyframeReticle(PreferencesWindow *pwindow,
523         InterfacePrefs *iface_prefs, int x, int y, int *output)
524  : BC_PopupMenu(x, y, 220, hairline_to_string(*output))
525 {
526         this->pwindow = pwindow;
527         this->iface_prefs = iface_prefs;
528         this->output = output;
529 }
530
531 KeyframeReticle::~KeyframeReticle()
532 {
533 }
534
535 const char *KeyframeReticle::hairline_to_string(int type)
536 {
537         switch( type ) {
538         case HAIRLINE_NEVER:    return _("Never");
539         case HAIRLINE_DRAGGING: return _("Dragging");
540         case HAIRLINE_ALWAYS:   return _("Always");
541         }
542         return _("Unknown");
543 }
544
545 void KeyframeReticle::create_objects()
546 {
547         add_item(new HairlineItem(this, HAIRLINE_NEVER));
548         add_item(new HairlineItem(this, HAIRLINE_DRAGGING));
549         add_item(new HairlineItem(this, HAIRLINE_ALWAYS));
550 }
551
552 PrefsTrapSigSEGV::PrefsTrapSigSEGV(InterfacePrefs *subwindow, int x, int y)
553  : BC_CheckBox(x, y,
554         subwindow->pwindow->thread->preferences->trap_sigsegv,
555         _("trap sigSEGV"))
556 {
557         this->subwindow = subwindow;
558 }
559 PrefsTrapSigSEGV::~PrefsTrapSigSEGV()
560 {
561 }
562 int PrefsTrapSigSEGV::handle_event()
563 {
564         subwindow->pwindow->thread->preferences->trap_sigsegv = get_value();
565         return 1;
566 }
567
568 PrefsTrapSigINTR::PrefsTrapSigINTR(InterfacePrefs *subwindow, int x, int y)
569  : BC_CheckBox(x, y,
570         subwindow->pwindow->thread->preferences->trap_sigintr,
571         _("trap sigINT"))
572 {
573         this->subwindow = subwindow;
574 }
575 PrefsTrapSigINTR::~PrefsTrapSigINTR()
576 {
577 }
578 int PrefsTrapSigINTR::handle_event()
579 {
580         subwindow->pwindow->thread->preferences->trap_sigintr = get_value();
581         return 1;
582 }
583
584
585 void InterfacePrefs::start_probe_dialog()
586 {
587         if( !file_probe_dialog )
588                 file_probe_dialog = new FileProbeDialog(pwindow);
589         file_probe_dialog->start();
590 }
591
592 PrefsFileProbes::PrefsFileProbes(PreferencesWindow *pwindow,
593                 InterfacePrefs *subwindow, int x, int y)
594  : BC_GenericButton(x, y, _("Probe Order"))
595 {
596         this->pwindow = pwindow;
597         this->subwindow = subwindow;
598         set_tooltip(_("File Open Probe Ordering"));
599 }
600
601 int PrefsFileProbes::handle_event()
602 {
603         subwindow->start_probe_dialog();
604         return 1;
605 }
606
607
608 PrefsYUV420P_DVDlace::PrefsYUV420P_DVDlace(PreferencesWindow *pwindow,
609         InterfacePrefs *subwindow, int x, int y)
610  : BC_CheckBox(x, y, pwindow->thread->preferences->dvd_yuv420p_interlace,
611         _("Use yuv420p dvd interlace format"))
612 {
613         this->pwindow = pwindow;
614         this->subwindow = subwindow;
615 }
616
617 int PrefsYUV420P_DVDlace::handle_event()
618 {
619         pwindow->thread->preferences->dvd_yuv420p_interlace = get_value();
620         return 1;
621 }
622
623
624 SnapshotPathText::SnapshotPathText(PreferencesWindow *pwindow,
625         InterfacePrefs *subwindow, int x, int y, int w)
626  : BC_TextBox(x, y, w, 1, pwindow->thread->preferences->snapshot_path)
627 {
628         this->pwindow = pwindow;
629         this->subwindow = subwindow;
630 }
631
632 SnapshotPathText::~SnapshotPathText()
633 {
634 }
635
636 int SnapshotPathText::handle_event()
637 {
638         strcpy(pwindow->thread->preferences->snapshot_path, get_text());
639         return 1;
640 }
641
642 PrefsAutostartLV2UI::PrefsAutostartLV2UI(int x, int y, PreferencesWindow *pwindow)
643  : BC_CheckBox(x, y,
644         pwindow->thread->preferences->autostart_lv2ui, _("Auto start lv2 gui"))
645 {
646         this->pwindow = pwindow;
647 }
648 int PrefsAutostartLV2UI::handle_event()
649 {
650         pwindow->thread->preferences->autostart_lv2ui = get_value();
651         return 1;
652 }
653
654 PrefsReloadPlugins::PrefsReloadPlugins(PreferencesWindow *pwindow,
655         InterfacePrefs *iface_prefs, int x, int y)
656  : BC_GenericButton(x, y, _("Reload plugin index"))
657 {
658         this->pwindow = pwindow;
659         this->iface_prefs = iface_prefs;
660 }
661
662 int PrefsReloadPlugins::handle_event()
663 {
664         pwindow->thread->reload_plugins = 1;
665         text_color(get_resources()->button_highlighted);
666         draw_face(1);
667         return 1;
668 }
669
670 PrefsLV2PathText::PrefsLV2PathText(PreferencesWindow *pwindow,
671         InterfacePrefs *subwindow, int x, int y, int w)
672  : BC_TextBox(x, y, w, 1, pwindow->thread->preferences->lv2_path)
673 {
674         this->pwindow = pwindow;
675         this->subwindow = subwindow;
676 }
677
678 PrefsLV2PathText::~PrefsLV2PathText()
679 {
680 }
681
682 int PrefsLV2PathText::handle_event()
683 {
684         strcpy(pwindow->thread->preferences->lv2_path, get_text());
685         return 1;
686 }
687