4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #include "pluginprefs.h"
23 #include "preferences.h"
28 #define _(String) gettext(String)
29 #define gettext_noop(String) String
30 #define N_(String) gettext_noop (String)
33 PluginPrefs::PluginPrefs(MWindow *mwindow, PreferencesWindow *pwindow)
34 : PreferencesDialog(mwindow, pwindow)
38 PluginPrefs::~PluginPrefs()
46 void PluginPrefs::create_objects()
49 int xs5 = xS(5), xs10 = xS(10), xs20 = xS(20), xs30 = xS(30);
50 int ys5 = yS(5), ys10 = yS(10), ys20 = yS(20), ys30 = yS(30);
53 // add_border(get_resources()->get_bg_shadow1(),
54 // get_resources()->get_bg_shadow2(),
55 // get_resources()->get_bg_color(),
56 // get_resources()->get_bg_light2(),
57 // get_resources()->get_bg_light1());
59 add_subwindow(new BC_Title(x, y, _("Plugin Set"), LARGEFONT, BLACK));
61 add_subwindow(new BC_Title(x, y, _("Look for global plugins here"), MEDIUMFONT, BLACK));
63 add_subwindow(ipathtext = new PluginGlobalPathText(x, y,
64 pwindow, pwindow->thread->preferences->global_plugin_dir));
65 add_subwindow(ipath = new BrowseButton(mwindow, this, ipathtext,
66 xS(215), y, pwindow->thread->preferences->global_plugin_dir,
67 _("Global Plugin Path"), _("Select the directory for plugins"),
71 add_subwindow(new BC_Title(x, y, _("Look for personal plugins here"), MEDIUMFONT, BLACK));
73 add_subwindow(lpathtext = new PluginLocalPathText(x, y,
74 pwindow, pwindow->thread->preferences->local_plugin_dir));
75 add_subwindow(lpath = new BrowseButton(mwindow, this, lpathtext,
76 xS(215), y, pwindow->thread->preferences->local_plugin_dir,
77 _("Personal Plugin Path"), _("Select the directory for plugins"),
85 PluginGlobalPathText::PluginGlobalPathText(int x, int y, PreferencesWindow *pwindow, char *text)
86 : BC_TextBox(x, y, xS(200), 1, text)
88 this->pwindow = pwindow;
91 PluginGlobalPathText::~PluginGlobalPathText() {}
93 int PluginGlobalPathText::handle_event()
95 strcpy(pwindow->thread->preferences->global_plugin_dir, get_text());
103 PluginLocalPathText::PluginLocalPathText(int x, int y, PreferencesWindow *pwindow, char *text)
104 : BC_TextBox(x, y, xs(200), 1, text)
106 this->pwindow = pwindow;
109 PluginLocalPathText::~PluginLocalPathText() {}
111 int PluginLocalPathText::handle_event()
113 strcpy(pwindow->thread->preferences->local_plugin_dir, get_text());