Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Aayush
purr-data
Commits
3cb11303
Commit
3cb11303
authored
Jan 29, 2017
by
Albert Gräf
Browse files
Bugfix: patch files opened via the command line (-open) are now recorded in the recent files list.
parent
6af6311f
Changes
2
Hide whitespace changes
Inline
Side-by-side
pd/nw/pdgui.js
View file @
3cb11303
...
...
@@ -947,11 +947,8 @@ exports.set_app_quitfn = function(quitfn) {
nw_app_quit
=
quitfn
;
}
function
open_file
(
file
)
{
var
filename
=
defunkify_windows_path
(
file
),
directory
=
path
.
dirname
(
filename
),
basename
=
path
.
basename
(
filename
),
cyclist
;
function
import_file
(
directory
,
basename
)
{
if
(
basename
.
match
(
/
\.(
pat|mxb|help
)
$/
)
!=
null
)
{
post
(
"
warning: opening pat|mxb|help not implemented yet
"
);
if
(
pd_nt
==
0
)
{
...
...
@@ -976,9 +973,19 @@ function open_file(file) {
// puts stderr "converted Max binary to text format: $directory/$basename"
//}
}
}
function
process_file
(
file
,
do_open
)
{
var
filename
=
defunkify_windows_path
(
file
),
directory
=
path
.
dirname
(
filename
),
basename
=
path
.
basename
(
filename
),
cyclist
;
if
(
do_open
)
import_file
(
directory
,
basename
);
if
(
basename
.
match
(
/
\.(
pd|pat|mxt
)
$/i
)
!=
null
)
{
pdsend
(
"
pd open
"
,
enquote
(
basename
),
(
enquote
(
directory
)));
if
(
do_open
)
{
pdsend
(
"
pd open
"
,
enquote
(
basename
),
(
enquote
(
directory
)));
}
set_pd_opendir
(
directory
);
//::pd_guiprefs::update_recentfiles "$filename" 1
// update the recent files list
...
...
@@ -987,6 +994,17 @@ function open_file(file) {
}
}
function
open_file
(
file
)
{
process_file
(
file
,
1
);
}
function
gui_process_open_arg
(
file
)
{
// AG: This is invoked when the engine opens a patch file via the command
// line (-open). In this case the file is already loaded, so we just
// update the opendir and the recent files list.
process_file
(
file
,
0
);
}
function
open_html
(
target
)
{
nw_open_html
(
target
);
}
...
...
pd/src/s_main.c
View file @
3cb11303
...
...
@@ -171,8 +171,7 @@ static void openit(const char *dirname, const char *filename)
{
close
(
fd
);
glob_evalfile
(
0
,
gensym
(
nameptr
),
gensym
(
dirbuf
));
gui_vmess
(
"gui_set_current_dir"
,
"xs"
,
0
,
filename
);
gui_vmess
(
"gui_process_open_arg"
,
"s"
,
filename
);
}
else
error
(
"%s: can't open"
,
filename
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment