removed save, save_as, and new from the dact system
This commit is contained in:
parent
93a1d3931f
commit
d224d8cd7b
61
4ed.cpp
61
4ed.cpp
|
@ -931,8 +931,6 @@ COMMAND_DECL(save){
|
|||
USE_VIEW(view);
|
||||
USE_FILE(file, view);
|
||||
|
||||
Delay *delay = &models->delay1;
|
||||
|
||||
char *filename = 0;
|
||||
int filename_len = 0;
|
||||
int buffer_id = -1;
|
||||
|
@ -963,11 +961,12 @@ COMMAND_DECL(save){
|
|||
if (filename){
|
||||
name = make_string(filename, filename_len);
|
||||
}
|
||||
|
||||
|
||||
if (file){
|
||||
if (name.str){
|
||||
if (!file->state.is_dummy && file_is_ready(file)){
|
||||
delayed_save_as(delay, name, file);
|
||||
view_save_file(system, &models->mem, &models->working_set,
|
||||
file, 0, name, 1);
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
@ -977,7 +976,7 @@ COMMAND_DECL(save){
|
|||
}
|
||||
}
|
||||
else{
|
||||
String name = {};
|
||||
String name = {0};
|
||||
if (filename){
|
||||
name = make_string(filename, filename_len);
|
||||
}
|
||||
|
@ -988,11 +987,13 @@ COMMAND_DECL(save){
|
|||
if (name.size != 0){
|
||||
if (file){
|
||||
if (!file->state.is_dummy && file_is_ready(file)){
|
||||
delayed_save(delay, name, file);
|
||||
view_save_file(system, &models->mem, &models->working_set,
|
||||
file, 0, name, 0);
|
||||
}
|
||||
}
|
||||
else{
|
||||
delayed_save(delay, name);
|
||||
view_save_file(system, &models->mem, &models->working_set,
|
||||
0, 0, name, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4437,54 +4438,20 @@ App_Step_Sig(app_step){
|
|||
}
|
||||
}break;
|
||||
|
||||
#if 0
|
||||
case DACT_SAVE:
|
||||
case DACT_SAVE_AS:
|
||||
{
|
||||
if (!file){
|
||||
if (panel){
|
||||
View *view = panel->view;
|
||||
Assert(view);
|
||||
file = view->file_data.file;
|
||||
}
|
||||
else{
|
||||
file = working_set_lookup_file(working_set, string);
|
||||
}
|
||||
}
|
||||
|
||||
if (file && buffer_get_sync(file) != SYNC_GOOD){
|
||||
if (file_save(system, mem, file, string.str)){
|
||||
if (act->type == DACT_SAVE_AS){
|
||||
file_set_name(working_set, file, string.str);
|
||||
}
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
case DACT_NEW:
|
||||
{
|
||||
Editing_File *file = working_set_alloc_always(working_set, general);
|
||||
file_create_empty(system, models, file, string.str);
|
||||
working_set_add(system, working_set, file, general);
|
||||
|
||||
View *view = panel->view;
|
||||
|
||||
view_set_file(view, file, models);
|
||||
view_show_file(view);
|
||||
view->map = get_map(models, file->settings.base_map_id);
|
||||
|
||||
Hook_Function *new_file_fnc = models->hooks[hook_new_file];
|
||||
if (new_file_fnc){
|
||||
models->buffer_param_indices[models->buffer_param_count++] = file->id.id;
|
||||
new_file_fnc(&models->app_links);
|
||||
models->buffer_param_count = 0;
|
||||
file->settings.is_initialized = 1;
|
||||
}
|
||||
|
||||
#if BUFFER_EXPERIMENT_SCALPEL <= 0
|
||||
if (file->settings.tokens_exist)
|
||||
file_first_lex_parallel(system, general, file);
|
||||
#endif
|
||||
|
||||
}break;
|
||||
#endif
|
||||
|
||||
case DACT_SWITCH:
|
||||
{
|
||||
|
|
|
@ -2,9 +2,6 @@ enum Action_Type{
|
|||
DACT_OPEN,
|
||||
DACT_OPEN_BACKGROUND,
|
||||
DACT_SET_LINE,
|
||||
DACT_SAVE_AS,
|
||||
DACT_SAVE,
|
||||
DACT_NEW,
|
||||
DACT_SWITCH,
|
||||
DACT_TRY_KILL,
|
||||
DACT_KILL,
|
||||
|
@ -130,9 +127,6 @@ delayed_action_repush(Delay *delay, Delayed_Action *act){
|
|||
#define delayed_open(delay, ...) delayed_action_(delay, DACT_OPEN, ##__VA_ARGS__)
|
||||
#define delayed_open_background(delay, ...) delayed_action_(delay, DACT_OPEN_BACKGROUND, ##__VA_ARGS__)
|
||||
#define delayed_set_line(delay, ...) delayed_action_(delay, DACT_SET_LINE, ##__VA_ARGS__)
|
||||
#define delayed_save_as(delay, ...) delayed_action_(delay, DACT_SAVE_AS, ##__VA_ARGS__)
|
||||
#define delayed_save(delay, ...) delayed_action_(delay, DACT_SAVE, ##__VA_ARGS__)
|
||||
#define delayed_new(delay, ...) delayed_action_(delay, DACT_NEW, ##__VA_ARGS__)
|
||||
#define delayed_switch(delay, ...) delayed_action_(delay, DACT_SWITCH, ##__VA_ARGS__)
|
||||
#define delayed_try_kill(delay, ...) delayed_action_(delay, DACT_TRY_KILL, ##__VA_ARGS__)
|
||||
#define delayed_kill(delay, ...) delayed_action_(delay, DACT_KILL, ##__VA_ARGS__)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -149,9 +149,11 @@ char *daction_enum[] = {
|
|||
"OPEN",
|
||||
"OPEN_BACKGROUND",
|
||||
"SET_LINE",
|
||||
#if 0
|
||||
"SAVE_AS",
|
||||
"SAVE",
|
||||
"NEW",
|
||||
#endif
|
||||
"SWITCH",
|
||||
"TRY_KILL",
|
||||
"KILL",
|
||||
|
@ -456,6 +458,7 @@ char* generate_style(){
|
|||
return(filename);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
struct Function_Signature{
|
||||
String name;
|
||||
String ret;
|
||||
|
|
Loading…
Reference in New Issue