00001 #include "pluginprefs.h"
00002 #include "preferences.h"
00003 #include <string.h>
00004
00005
00006 #include <libintl.h>
00007 #define _(String) gettext(String)
00008 #define gettext_noop(String) String
00009 #define N_(String) gettext_noop (String)
00010
00011
00012 PluginPrefs::PluginPrefs(MWindow *mwindow, PreferencesWindow *pwindow)
00013 : PreferencesDialog(mwindow, pwindow)
00014 {
00015 }
00016
00017 PluginPrefs::~PluginPrefs()
00018 {
00019 delete ipath;
00020 delete ipathtext;
00021 delete lpath;
00022 delete lpathtext;
00023 }
00024
00025 int PluginPrefs::create_objects()
00026 {
00027 char string[1024];
00028 int x = 5, y = 5;
00029
00030
00031
00032
00033
00034
00035
00036 add_subwindow(new BC_Title(x, y, _("Plugin Set"), LARGEFONT, BLACK));
00037 y += 35;
00038 add_subwindow(new BC_Title(x, y, _("Look for global plugins here"), MEDIUMFONT, BLACK));
00039 y += 20;
00040 add_subwindow(ipathtext = new PluginGlobalPathText(x, y, pwindow, pwindow->thread->preferences->global_plugin_dir));
00041 add_subwindow(ipath = new BrowseButton(mwindow,
00042 this,
00043 ipathtext,
00044 215,
00045 y,
00046 pwindow->thread->preferences->global_plugin_dir,
00047 _("Global Plugin Path"),
00048 _("Select the directory for plugins"),
00049 1));
00050
00051 y += 35;
00052 add_subwindow(new BC_Title(x, y, _("Look for personal plugins here"), MEDIUMFONT, BLACK));
00053 y += 20;
00054 add_subwindow(lpathtext = new PluginLocalPathText(x, y, pwindow, pwindow->thread->preferences->local_plugin_dir));
00055 add_subwindow(lpath = new BrowseButton(mwindow,
00056 this,
00057 lpathtext,
00058 215,
00059 y,
00060 pwindow->thread->preferences->local_plugin_dir,
00061 _("Personal Plugin Path"),
00062 _("Select the directory for plugins"),
00063 1));
00064
00065
00066 return 0;
00067 }
00068
00069
00070
00071
00072 PluginGlobalPathText::PluginGlobalPathText(int x, int y, PreferencesWindow *pwindow, char *text)
00073 : BC_TextBox(x, y, 200, 1, text)
00074 {
00075 this->pwindow = pwindow;
00076 }
00077
00078 PluginGlobalPathText::~PluginGlobalPathText() {}
00079
00080 int PluginGlobalPathText::handle_event()
00081 {
00082 strcpy(pwindow->thread->preferences->global_plugin_dir, get_text());
00083 }
00084
00085
00086
00087
00088
00089 PluginLocalPathText::PluginLocalPathText(int x, int y, PreferencesWindow *pwindow, char *text)
00090 : BC_TextBox(x, y, 200, 1, text)
00091 {
00092 this->pwindow = pwindow;
00093 }
00094
00095 PluginLocalPathText::~PluginLocalPathText() {}
00096
00097 int PluginLocalPathText::handle_event()
00098 {
00099 strcpy(pwindow->thread->preferences->local_plugin_dir, get_text());
00100 }