Commit 487f9bad authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

add skeleton for sending path/startup libs to the preferences dialog

parent 4e391f5e
......@@ -702,6 +702,14 @@ function gui_prefs_callback(name) {
}
}
function path_prefs_callback(use_stdpath, verbose, path_array) {
pdgui.post("path callback: " + path_array.join("\n"));
}
function lib_prefs_callback(defeat_rt, flag_string, lib_array) {
pdgui.post("lib callback: " + lib_array.join("\n"));
}
// This gets called from the nw_create_window function in index.html
// It provides us with our window id from the C side. Once we have it
// we can create the menu and register event callbacks
......@@ -720,6 +728,8 @@ function register_window_id(gfxstub, attr_arrays) {
pdgui.pdsend("pd audio-properties"); // request audio pref attrs
pdgui.pdsend("pd midi-properties"); // request midi pref attrs
pdgui.pdsend("pd gui-properties"); // request saved gui properties
pdgui.pdsend("pd start-path-dialog"); // request default system paths
pdgui.pdsend("pd start-startup-dialog"); // request default loaded libs
document.getElementsByClassName("container")[0].style.setProperty("display", "inline");
}
......
......@@ -4480,6 +4480,18 @@ function gui_gui_properties(dummy, name) {
}
}
function gui_path_properties(dummy, use_stdpath, verbose, path_array) {
if (dialogwin["prefs"] !== null) {
dialogwin["prefs"].window.path_prefs_callback(use_stdpath, verbose, path_array);
}
}
function gui_lib_properties(dummy, defeat_rt, flag_string, lib_array) {
if (dialogwin["prefs"] !== null) {
dialogwin["prefs"].window.lib_prefs_callback(defeat_rt, flag_string, lib_array);
}
}
// Let's try a closure for gui skins
var skin = exports.skin = (function () {
var dir = "css/";
......
......@@ -772,11 +772,22 @@ void glob_start_path_dialog(t_pd *dummy)
int i;
t_namelist *nl;
sys_gui("global pd_path; set pd_path {}\n");
//sys_gui("global pd_path; set pd_path {}\n");
gui_start_vmess("gui_path_properties", "xii",
dummy,
sys_usestdpath,
sys_verbose
);
gui_start_array();
for (nl = sys_searchpath, i = 0; nl; nl = nl->nl_next, i++)
sys_vgui("lappend pd_path {%s}\n", nl->nl_string);
sprintf(buf, "pdtk_path_dialog %%s %d %d\n", sys_usestdpath, sys_verbose);
gfxstub_new(&glob_pdobject, (void *)glob_start_path_dialog, buf);
{
//sys_vgui("lappend pd_path {%s}\n", nl->nl_string);
gui_s(nl->nl_string);
}
gui_end_array();
gui_end_vmess();
//sprintf(buf, "pdtk_path_dialog %%s %d %d\n", sys_usestdpath, sys_verbose);
//gfxstub_new(&glob_pdobject, (void *)glob_start_path_dialog, buf);
}
/* new values from dialog window */
......@@ -802,12 +813,23 @@ void glob_start_startup_dialog(t_pd *dummy)
int i;
t_namelist *nl;
sys_gui("global pd_startup; set pd_startup {}\n");
//sys_gui("global pd_startup; set pd_startup {}\n");
gui_start_vmess("gui_lib_properties", "xis",
dummy,
sys_defeatrt,
sys_flags->s_name
);
gui_start_array();
for (nl = sys_externlist, i = 0; nl; nl = nl->nl_next, i++)
sys_vgui("lappend pd_startup {%s}\n", nl->nl_string);
sprintf(buf, "pdtk_startup_dialog %%s %d \"%s\"\n", sys_defeatrt,
sys_flags->s_name);
gfxstub_new(&glob_pdobject, (void *)glob_start_startup_dialog, buf);
{
//sys_vgui("lappend pd_startup {%s}\n", nl->nl_string);
gui_s(nl->nl_string);
}
gui_end_array();
gui_end_vmess();
//sprintf(buf, "pdtk_startup_dialog %%s %d \"%s\"\n", sys_defeatrt,
// sys_flags->s_name);
//gfxstub_new(&glob_pdobject, (void *)glob_start_startup_dialog, buf);
}
/* new values from dialog window */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment