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()
51 // add_border(get_resources()->get_bg_shadow1(),
52 // get_resources()->get_bg_shadow2(),
53 // get_resources()->get_bg_color(),
54 // get_resources()->get_bg_light2(),
55 // get_resources()->get_bg_light1());
57 add_subwindow(new BC_Title(x, y, _("Plugin Set"), LARGEFONT, BLACK));
59 add_subwindow(new BC_Title(x, y, _("Look for global plugins here"), MEDIUMFONT, BLACK));
61 add_subwindow(ipathtext = new PluginGlobalPathText(x, y, pwindow, pwindow->thread->preferences->global_plugin_dir));
62 add_subwindow(ipath = new BrowseButton(mwindow,
67 pwindow->thread->preferences->global_plugin_dir,
68 _("Global Plugin Path"),
69 _("Select the directory for plugins"),
73 add_subwindow(new BC_Title(x, y, _("Look for personal plugins here"), MEDIUMFONT, BLACK));
75 add_subwindow(lpathtext = new PluginLocalPathText(x, y, pwindow, pwindow->thread->preferences->local_plugin_dir));
76 add_subwindow(lpath = new BrowseButton(mwindow,
81 pwindow->thread->preferences->local_plugin_dir,
82 _("Personal Plugin Path"),
83 _("Select the directory for plugins"),
91 PluginGlobalPathText::PluginGlobalPathText(int x, int y, PreferencesWindow *pwindow, char *text)
92 : BC_TextBox(x, y, 200, 1, text)
94 this->pwindow = pwindow;
97 PluginGlobalPathText::~PluginGlobalPathText() {}
99 int PluginGlobalPathText::handle_event()
101 strcpy(pwindow->thread->preferences->global_plugin_dir, get_text());
108 PluginLocalPathText::PluginLocalPathText(int x, int y, PreferencesWindow *pwindow, char *text)
109 : BC_TextBox(x, y, 200, 1, text)
111 this->pwindow = pwindow;
114 PluginLocalPathText::~PluginLocalPathText() {}
116 int PluginLocalPathText::handle_event()
118 strcpy(pwindow->thread->preferences->local_plugin_dir, get_text());