From 4a111a68a2afcda19929971e49dccb84e3bf939a Mon Sep 17 00:00:00 2001 From: Harbour Date: Thu, 24 Apr 2008 00:16:18 +0300 Subject: [PATCH] . --- faraon/faraon.C | 5 +- faraon/x11_ui.C | 230 ++++++++++++++++++++++++++++++++++----------------- faraon/x11_ui.H | 10 ++- faraon/x11_ui.fl | 209 +++++++++++++++++++++++++++++----------------- include/elements.H | 21 +++-- include/faraon.H | 6 +- include/proto_data.H | 1 + include/sfinx.H | 4 +- sfinx/sfinx.C | 58 +++++++++++-- 9 files changed, 364 insertions(+), 180 deletions(-) diff --git a/faraon/faraon.C b/faraon/faraon.C index 1b1c2e8..f431586 100644 --- a/faraon/faraon.C +++ b/faraon/faraon.C @@ -18,6 +18,9 @@ bool faraon_app::process_requests() sfinx_t *el; while ((el = sfinx.rx_elements.next())) { switch (el->tid()) { + case SFINX_NOTES_MODULE_EDIT_REPLY: + ui()->notes_module_reply((sfinx_string_t *)el); + break; case SFINX_NOTES_MODULE_EDIT_REQUEST: ui()->notes_module_edit((sfinx_note_t *)el); break; @@ -31,7 +34,7 @@ bool faraon_app::process_requests() ui()->alert((sfinx_string_t *)el); break; case SFINX_NOTES_MODULE_ADD_REPLY: - ui()->notes_module_add_reply((sfinx_string_t *)el); + ui()->notes_module_reply((sfinx_string_t *)el); break; case SFINX_FILES_MODULE_EDIT_REPLY: ui()->files_module_edit_reply((sfinx_string_t *)el); diff --git a/faraon/x11_ui.C b/faraon/x11_ui.C index a6eb320..244d951 100644 --- a/faraon/x11_ui.C +++ b/faraon/x11_ui.C @@ -18,8 +18,6 @@ static Fl_Toggle_Tree *fill_tree; sfinx_slice_t *fill_tree_except; u32_t fill_tree_mask; static sfinx_file_t current_files_module_tree_path(SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST); -static sfinx_note_t current_note; -static sfinx_slice_t current_note_slice, current_slice; static void fill_objects_tree(Fl_Toggle_Tree *ft, u32_t m, sfinx_slice_t *except, bool force) { fill_tree = ft; @@ -44,21 +42,53 @@ select_slice_w->hide(); fill_objects_tree(slices_tree, SFINX_SLICE_OBJECT, 0, 1); // force refresh } +static void select_note_atag_action() { + sfinx_object_t *obj; +Fl_Toggle_Node *node = slices_tree->selected(); +if (!node) + return; +if (node->can_open()) // slice + obj = ((sfinx_slice_t *)node->user_data())->object(); +else // object + obj = (sfinx_object_t *)node->user_data(); +Fl_Toggle_Node *snode = notes_tree->selected(); +sfinx_object_t *sobj = (sfinx_object_t *)snode->user_data(); +if (sobj == obj) // try to self tag + return; +if (!obj->cmp((sfinx_object_t *)note_mtag_b->user_data())) // already set as main tag + return; +for (int i = 1; i <= note_tags_br->size(); i++) { + if (!obj->cmp((sfinx_object_t *)note_tags_br->data(i))) // already set as additional tag + return; +} +string s = obj->name + " [ " + obj->description + " ]"; +note_tags_br->add(s.c_str(), obj); +note_tags_br->redraw(); +} + static void select_note_mtag_action() { - // re-do global ? -sfinx_object_t *obj = current_slice.object(); -// TODO: arbitrary objects + sfinx_object_t *obj; +Fl_Toggle_Node *node = slices_tree->selected(); +if (!node) + return; +if (node->can_open()) // slice + obj = ((sfinx_slice_t *)node->user_data())->object(); +else // object + obj = (sfinx_object_t *)node->user_data(); +Fl_Toggle_Node *snode = notes_tree->selected(); +sfinx_object_t *sobj = (sfinx_object_t *)snode->user_data(); +if (sobj == obj) // try to self tag + return; note_mtag_b->user_data(obj); -note_mtag_b->copy_label((obj->name + ' ' + obj->description).c_str()); +note_mtag_b->copy_label((obj->name + " [ " + obj->description + " ]").c_str()); note_mtag_b->redraw(); - // check for additional slices if it is here - remove it -//for (int i = 1; i <= file_additional_slices_br->size(); i++) { -// if (file_additional_slices_br->data(i) == to_voidp(current_slice_id)) { -// file_additional_slices_br->remove(i); -// return; -// } -//} +for (int i = 1; i <= note_tags_br->size(); i++) { + if (!obj->cmp((sfinx_object_t *)note_tags_br->data(i))) { + note_tags_br->remove(i); + return; + } +} } static void select_file_main_slice_action() { @@ -103,7 +133,6 @@ static void slices_tree_cb(Fl_Widget *, void *) { Fl_Toggle_Node *node = slices_tree->selected(); if (!node) return; -current_slice.copy((sfinx_slice_t *)from_voidp(node->user_data())); if (!Fl::event_clicks()) return; void (*select_slice_action)(void) = (void (*)())(slices_w->user_data()); @@ -967,7 +996,7 @@ app->sfinx.send(current_files_module_tree_path);*/; } static void cb_Reload1(Fl_Button*, void*) { - app->sfinx.send(current_note); + //app->sfinx.send(current_note); } static void cb_Select1(Fl_Button*, void*) { @@ -1010,18 +1039,17 @@ sfinx_note_t *note = (sfinx_note_t *)edit_note_w->user_data(); note->name = note_name_i->value(); note->url = note_url_i->value(); note->text = note_text_i->value(); -sfinx_object_t *obj = (sfinx_object_t *)from_voidp(note_mtag_b->user_data()); +sfinx_object_t *obj = (sfinx_object_t *)note_mtag_b->user_data(); note->mtag.id = obj->id; note->mtag.type = obj->type; note->mtag.slice_id = obj->slice_id; note_mtag_b->user_data(0); -//note->tags.clear(); -//for (int i = 1; i <= note_additional_tags_br->size(); i++) { -// obj = (sfinx_object_t *)note_additional_tags_br->data(i); -// note->tags.push_back(obj); -// delete obj; -// note_additional_tags_br->data(i, 0); -//} +note->tags.clear(); +for (int i = 1; i <= note_tags_br->size(); i++) { + obj = (sfinx_object_t *)note_tags_br->data(i); + note->tags.push_back(*obj); + note_tags_br->data(i, 0); +} app->sfinx.send(note); delete note; edit_note_w->user_data(0); @@ -1031,27 +1059,27 @@ fill_objects_tree(notes_tree, 1 << SFINX_NOTE_OBJECT, 0, 1); // force refresh; Fl_Button *note_mtag_b=(Fl_Button *)0; static void cb_note_mtag_b(Fl_Button*, void*) { - app->sfinx.send(SFINX_OBJECTS_TREE_REQUEST, (u32_t)0); + fill_objects_tree(slices_tree, (1 << SFINX_SLICE_OBJECT) | (1 << SFINX_FILE_OBJECT) | (1 << SFINX_NOTE_OBJECT), 0, 0); // fluid bugs if any default params exists ! slices_w->user_data((void *)select_note_mtag_action); slices_w->show(); } -Fl_Browser *note_additional_objects_br=(Fl_Browser *)0; +Fl_Browser *note_tags_br=(Fl_Browser *)0; -Fl_Button *note_add_object_b=(Fl_Button *)0; +Fl_Button *note_add_tag_b=(Fl_Button *)0; -static void cb_note_add_object_b(Fl_Button*, void*) { - /*app->sfinx.send(SFINX_SLICES_MODULE_TREE_REQUEST, (u8_t)0); -slices_w->user_data((void *)select_file_additional_slice_action); -slices_w->show();*/; +static void cb_note_add_tag_b(Fl_Button*, void*) { + fill_objects_tree(slices_tree, (1 << SFINX_SLICE_OBJECT) | (1 << SFINX_FILE_OBJECT) | (1 << SFINX_NOTE_OBJECT), 0, 0); // fluid bugs if any default params exists ! +slices_w->user_data((void *)select_note_atag_action); +slices_w->show(); } -Fl_Button *note_remove_object_b=(Fl_Button *)0; +Fl_Button *note_remove_tag_b=(Fl_Button *)0; -static void cb_note_remove_object_b(Fl_Button*, void*) { - for (int i = note_additional_objects_br->size(); i >= 1; i--) { - if (note_additional_objects_br->selected(i)) - note_additional_objects_br->remove(i); +static void cb_note_remove_tag_b(Fl_Button*, void*) { + for (int i = note_tags_br->size(); i >= 1; i--) { + if (note_tags_br->selected(i)) + note_tags_br->remove(i); }; } @@ -1063,6 +1091,34 @@ Fl_Menu_Item menu_note_secured_ch[] = { {0,0,0,0,0,0,0,0,0} }; +Fl_Double_Window *delete_note_w=(Fl_Double_Window *)0; + +static void cb_Cancelb(Fl_Button*, void*) { + delete_note_w->hide(); +} + +static void cb_Delete4(Fl_Button*, void*) { + Fl_Toggle_Node *node = notes_tree->selected(); +if (!node || node->can_open()) + return; +sfinx_object_t *obj = (sfinx_object_t *) node->user_data(); +sfinx_note_t note(note_deletion_type_ch->value() ? SFINX_NOTES_MODULE_UNLINK : SFINX_NOTES_MODULE_UNSORT); +note.id = obj->id; +app->sfinx.send(note); +delete_note_w->hide(); +fill_objects_tree(notes_tree, (1 << SFINX_SLICE_OBJECT) | (1 << SFINX_NOTE_OBJECT), 0, 1); // force refresh; +} + +Fl_Output *delete_sfinx_note_to=(Fl_Output *)0; + +Fl_Choice *note_deletion_type_ch=(Fl_Choice *)0; + +Fl_Menu_Item menu_note_deletion_type_ch[] = { + {gettext("Mark all data \'Unsorted\'"), 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, + {gettext("Delete all data"), 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0}, + {0,0,0,0,0,0,0,0,0} +}; + Fl_Double_Window *about_w=(Fl_Double_Window *)0; static void cb_Ok3(Fl_Button*, void*) { @@ -2854,7 +2910,7 @@ void x11_ui::init() { select_slice_w->set_modal(); select_slice_w->end(); } // Fl_Double_Window* select_slice_w - { slices_w = new Fl_Double_Window(866, 370, gettext("Sfinx Objects")); + { slices_w = new Fl_Double_Window(866, 370, gettext("Sfinx Data")); slices_w->color((Fl_Color)31); { Fl_Button* o = new Fl_Button(734, 312, 112, 25, gettext("Cancel")); o->labeltype(FL_ENGRAVED_LABEL); @@ -2955,18 +3011,18 @@ void x11_ui::init() { delete_sfinx_slice_to->labeltype(FL_ENGRAVED_LABEL); delete_sfinx_slice_to->align(FL_ALIGN_TOP); } // Fl_Output* delete_sfinx_slice_to - { slice_deletion_type_ch = new Fl_Choice(73, 82, 240, 23, gettext("Slice && Data Deletion Type")); + { slice_deletion_type_ch = new Fl_Choice(73, 82, 240, 23, gettext("Slice && Data Deletion Action")); slice_deletion_type_ch->down_box(FL_BORDER_BOX); slice_deletion_type_ch->color((Fl_Color)48); slice_deletion_type_ch->labeltype(FL_ENGRAVED_LABEL); - slice_deletion_type_ch->align(FL_ALIGN_TOP_LEFT); + slice_deletion_type_ch->align(FL_ALIGN_TOP); slice_deletion_type_ch->menu(menu_slice_deletion_type_ch); } // Fl_Choice* slice_deletion_type_ch - { data_deletion_type_ch = new Fl_Choice(73, 132, 240, 23, gettext("Associated Data Deletion Type")); + { data_deletion_type_ch = new Fl_Choice(73, 132, 240, 23, gettext("Associated Data Deletion Action")); data_deletion_type_ch->down_box(FL_BORDER_BOX); data_deletion_type_ch->color((Fl_Color)48); data_deletion_type_ch->labeltype(FL_ENGRAVED_LABEL); - data_deletion_type_ch->align(FL_ALIGN_TOP_LEFT); + data_deletion_type_ch->align(FL_ALIGN_TOP); data_deletion_type_ch->menu(menu_data_deletion_type_ch); } // Fl_Choice* data_deletion_type_ch delete_slice_w->set_modal(); @@ -3311,22 +3367,22 @@ void x11_ui::init() { note_mtag_b->labeltype(FL_ENGRAVED_LABEL); note_mtag_b->callback((Fl_Callback*)cb_note_mtag_b); } // Fl_Button* note_mtag_b - { note_additional_objects_br = new Fl_Browser(559, 146, 420, 102, gettext("Additional Note Tags")); - note_additional_objects_br->type(3); - note_additional_objects_br->color((Fl_Color)46); - note_additional_objects_br->labeltype(FL_ENGRAVED_LABEL); - note_additional_objects_br->align(FL_ALIGN_TOP); - } // Fl_Browser* note_additional_objects_br - { note_add_object_b = new Fl_Button(584, 258, 138, 25, gettext("Add Tag")); - note_add_object_b->box(FL_PLASTIC_THIN_UP_BOX); - note_add_object_b->labeltype(FL_ENGRAVED_LABEL); - note_add_object_b->callback((Fl_Callback*)cb_note_add_object_b); - } // Fl_Button* note_add_object_b - { note_remove_object_b = new Fl_Button(811, 258, 138, 25, gettext("Remove Tag")); - note_remove_object_b->box(FL_PLASTIC_THIN_UP_BOX); - note_remove_object_b->labeltype(FL_ENGRAVED_LABEL); - note_remove_object_b->callback((Fl_Callback*)cb_note_remove_object_b); - } // Fl_Button* note_remove_object_b + { note_tags_br = new Fl_Browser(559, 146, 420, 102, gettext("Additional Note Tags")); + note_tags_br->type(3); + note_tags_br->color((Fl_Color)46); + note_tags_br->labeltype(FL_ENGRAVED_LABEL); + note_tags_br->align(FL_ALIGN_TOP); + } // Fl_Browser* note_tags_br + { note_add_tag_b = new Fl_Button(584, 258, 138, 25, gettext("Add Tag")); + note_add_tag_b->box(FL_PLASTIC_THIN_UP_BOX); + note_add_tag_b->labeltype(FL_ENGRAVED_LABEL); + note_add_tag_b->callback((Fl_Callback*)cb_note_add_tag_b); + } // Fl_Button* note_add_tag_b + { note_remove_tag_b = new Fl_Button(811, 258, 138, 25, gettext("Remove Tag")); + note_remove_tag_b->box(FL_PLASTIC_THIN_UP_BOX); + note_remove_tag_b->labeltype(FL_ENGRAVED_LABEL); + note_remove_tag_b->callback((Fl_Callback*)cb_note_remove_tag_b); + } // Fl_Button* note_remove_tag_b { note_secured_ch = new Fl_Choice(536, 27, 211, 23, gettext("Secure Level")); note_secured_ch->down_box(FL_BORDER_BOX); note_secured_ch->color((Fl_Color)48); @@ -3338,6 +3394,32 @@ void x11_ui::init() { edit_note_w->set_modal(); edit_note_w->end(); } // Fl_Double_Window* edit_note_w + { delete_note_w = new Fl_Double_Window(388, 168, gettext("Delete Note")); + delete_note_w->color((Fl_Color)31); + { Fl_Button* o = new Fl_Button(239, 122, 112, 25, gettext("Cancel")); + o->labeltype(FL_ENGRAVED_LABEL); + o->callback((Fl_Callback*)cb_Cancelb); + } // Fl_Button* o + { Fl_Button* o = new Fl_Button(40, 122, 112, 25, gettext("Delete")); + o->labeltype(FL_ENGRAVED_LABEL); + o->callback((Fl_Callback*)cb_Delete4); + } // Fl_Button* o + { delete_sfinx_note_to = new Fl_Output(31, 26, 330, 26, gettext("Please confirm deletion of the note")); + delete_sfinx_note_to->box(FL_ENGRAVED_FRAME); + delete_sfinx_note_to->color((Fl_Color)29); + delete_sfinx_note_to->labeltype(FL_ENGRAVED_LABEL); + delete_sfinx_note_to->align(FL_ALIGN_TOP); + } // Fl_Output* delete_sfinx_note_to + { note_deletion_type_ch = new Fl_Choice(74, 80, 240, 23, gettext("Associated Data Deletion Action")); + note_deletion_type_ch->down_box(FL_BORDER_BOX); + note_deletion_type_ch->color((Fl_Color)48); + note_deletion_type_ch->labeltype(FL_ENGRAVED_LABEL); + note_deletion_type_ch->align(FL_ALIGN_TOP); + note_deletion_type_ch->menu(menu_note_deletion_type_ch); + } // Fl_Choice* note_deletion_type_ch + delete_note_w->set_modal(); + delete_note_w->end(); + } // Fl_Double_Window* delete_note_w { about_w = new Fl_Double_Window(374, 154); { Fl_Button* o = new Fl_Button(72, 122, 226, 20, gettext("Ok")); o->box(FL_PLASTIC_ROUND_UP_BOX); @@ -3564,16 +3646,20 @@ note_mtag_b->user_data(&(note->mtag)); note_mtag_b->copy_label((note->mtag.name + " [ " + note->mtag.description + " ]").c_str()); note_mtag_b->redraw(); // add tags -// ... +note_tags_br->clear(); +for (u32_t i = 0; i < note->tags.size(); i++) { + string s = note->tags[i].name + " [ " + note->tags[i].description + " ]"; + note_tags_br->add(s.c_str(), &(note->tags[i])); +} edit_note_w->show(); Fl::unlock(); } -void x11_ui::notes_module_edit_reply(sfinx_string_t *classify_error) { +void x11_ui::notes_module_reply(sfinx_string_t *classify_error) { Fl::lock(); if (classify_error->size() == 1) { - app->sfinx.send(current_files_module_tree_path); - classify_file_w->hide(); + ::fill_objects_tree(notes_tree, 1 << SFINX_NOTE_OBJECT, 0, 1); // fluid bugs if any default params exists ! + edit_note_w->hide(); } else fl_alert(classify_error->c_str()); Fl::unlock(); @@ -3723,18 +3809,6 @@ switch (el->tid()) { } } -void x11_ui::notes_module_add_reply(sfinx_string_t *add_error) { - Fl::lock(); -if (add_error->size() == 1) { - edit_note_w->hide(); - // ÐÅÒÅÚÁÐÒÁÛÉ×ÁÅÍ ÄÅÒÅ×Ï ÚÁÍÅÔÏË -// current_note_slice.tid(SFINX_NOTES_MODULE_TREE_REQUEST); - app->sfinx.send(current_note_slice); -} else - fl_alert(add_error->c_str()); -Fl::unlock(); -} - void x11_ui::fill_objects_tree() { Fl::lock(); Fl_Toggle_Tree *tree = fill_tree; @@ -3768,12 +3842,12 @@ for (u32_t i = 0; i < app->slices.len(); i++) { if (!slice->parent_id) { node = tree->add_sub((char *)name.c_str(), 1, &slice_pixmap, to_voidp(slice)); if (fill_tree_mask & (1 << SFINX_NOTE_OBJECT)) { - notes_tree->open(node); + tree->open(node); // add notes for (u32_t x = 0; x < slice->objs.size(); x++) { - notes_tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, ¬e_pixmap, + tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, ¬e_pixmap, to_voidp(&(slice->objs[x]))); - notes_tree->traverse_up(); + tree->traverse_up(); } } } else { @@ -3788,12 +3862,12 @@ for (u32_t i = 0; i < app->slices.len(); i++) { tree->open(node); node = tree->add_sub((char *)name.c_str(), 1, &slice_pixmap, to_voidp(slice)); if (fill_tree_mask & (1 << SFINX_NOTE_OBJECT)) { - notes_tree->open(node); + tree->open(node); // add notes for (u32_t x = 0; x < slice->objs.size(); x++) { - notes_tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, ¬e_pixmap, + tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, ¬e_pixmap, to_voidp(&(slice->objs[x]))); - notes_tree->traverse_up(); + tree->traverse_up(); } } } // node not found - just ignore diff --git a/faraon/x11_ui.H b/faraon/x11_ui.H index 51fbaa9..4ff54e5 100644 --- a/faraon/x11_ui.H +++ b/faraon/x11_ui.H @@ -87,10 +87,13 @@ extern Fl_Input *note_url_i; extern Fl_Input *note_text_i; extern Fl_Output *edit_note_to; extern Fl_Button *note_mtag_b; -extern Fl_Browser *note_additional_objects_br; -extern Fl_Button *note_add_object_b; -extern Fl_Button *note_remove_object_b; +extern Fl_Browser *note_tags_br; +extern Fl_Button *note_add_tag_b; +extern Fl_Button *note_remove_tag_b; extern Fl_Choice *note_secured_ch; +extern Fl_Double_Window *delete_note_w; +extern Fl_Output *delete_sfinx_note_to; +extern Fl_Choice *note_deletion_type_ch; extern Fl_Double_Window *about_w; extern Fl_Menu_Item menu_[]; #define search_mi (menu_+21) @@ -100,4 +103,5 @@ extern Fl_Menu_Item menu_Minimum2[]; extern Fl_Menu_Item menu_slice_deletion_type_ch[]; extern Fl_Menu_Item menu_data_deletion_type_ch[]; extern Fl_Menu_Item menu_note_secured_ch[]; +extern Fl_Menu_Item menu_note_deletion_type_ch[]; #endif diff --git a/faraon/x11_ui.fl b/faraon/x11_ui.fl index 31eb9b9..39ab3b1 100644 --- a/faraon/x11_ui.fl +++ b/faraon/x11_ui.fl @@ -50,11 +50,7 @@ decl {u32_t fill_tree_mask;} {global decl {sfinx_file_t current_files_module_tree_path(SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST);} {} -decl {sfinx_note_t current_note;} {} - -decl {sfinx_slice_t current_note_slice, current_slice;} {} - -Function {fill_objects_tree(Fl_Toggle_Tree *ft, u32_t m, sfinx_slice_t *except, bool force)} {private return_type void +Function {fill_objects_tree(Fl_Toggle_Tree *ft, u32_t m, sfinx_slice_t *except, bool force)} {open private return_type void } { code {fill_tree = ft; fill_tree_mask = m; @@ -79,22 +75,55 @@ select_slice_w->hide(); fill_objects_tree(slices_tree, SFINX_SLICE_OBJECT, 0, 1); // force refresh} {} } -Function {select_note_mtag_action()} {private return_type void +Function {select_note_atag_action()} {open private return_type void } { - code {// re-do global ? -sfinx_object_t *obj = current_slice.object(); -// TODO: arbitrary objects + code {sfinx_object_t *obj; +Fl_Toggle_Node *node = slices_tree->selected(); +if (!node) + return; +if (node->can_open()) // slice + obj = ((sfinx_slice_t *)node->user_data())->object(); +else // object + obj = (sfinx_object_t *)node->user_data(); +Fl_Toggle_Node *snode = notes_tree->selected(); +sfinx_object_t *sobj = (sfinx_object_t *)snode->user_data(); +if (sobj == obj) // try to self tag + return; +if (!obj->cmp((sfinx_object_t *)note_mtag_b->user_data())) // already set as main tag + return; +for (int i = 1; i <= note_tags_br->size(); i++) { + if (!obj->cmp((sfinx_object_t *)note_tags_br->data(i))) // already set as additional tag + return; +} +string s = obj->name + " [ " + obj->description + " ]"; +note_tags_br->add(s.c_str(), obj); +note_tags_br->redraw();} {} +} + +Function {select_note_mtag_action()} {open private return_type void +} { + code {sfinx_object_t *obj; +Fl_Toggle_Node *node = slices_tree->selected(); +if (!node) + return; +if (node->can_open()) // slice + obj = ((sfinx_slice_t *)node->user_data())->object(); +else // object + obj = (sfinx_object_t *)node->user_data(); +Fl_Toggle_Node *snode = notes_tree->selected(); +sfinx_object_t *sobj = (sfinx_object_t *)snode->user_data(); +if (sobj == obj) // try to self tag + return; note_mtag_b->user_data(obj); -note_mtag_b->copy_label((obj->name + ' ' + obj->description).c_str()); +note_mtag_b->copy_label((obj->name + " [ " + obj->description + " ]").c_str()); note_mtag_b->redraw(); - // check for additional slices if it is here - remove it -//for (int i = 1; i <= file_additional_slices_br->size(); i++) { -// if (file_additional_slices_br->data(i) == to_voidp(current_slice_id)) { -// file_additional_slices_br->remove(i); -// return; -// } -//}} {} +for (int i = 1; i <= note_tags_br->size(); i++) { + if (!obj->cmp((sfinx_object_t *)note_tags_br->data(i))) { + note_tags_br->remove(i); + return; + } +}} {} } Function {select_file_main_slice_action()} {private return_type void @@ -138,12 +167,11 @@ Function {search_add_slice_action()} {private return_type void search_slices_br->redraw();} {} } -Function {slices_tree_cb(Fl_Widget *, void *)} {private return_type void +Function {slices_tree_cb(Fl_Widget *, void *)} {open private return_type void } { code {Fl_Toggle_Node *node = slices_tree->selected(); if (!node) return; -current_slice.copy((sfinx_slice_t *)from_voidp(node->user_data())); if (!Fl::event_clicks()) return; void (*select_slice_action)(void) = (void (*)())(slices_w->user_data()); @@ -220,7 +248,7 @@ Function {x11_ui::init()} {open return_type void Fl_Window main_w { label Faraon callback {if (fl_choice("Really quit ?", "No", "Yes", 0L)) - F::shutdown(0);} open + F::shutdown(0);} xywh {171 126 945 365} type Double hide } { Fl_Menu_Bar {} {open @@ -573,7 +601,7 @@ preferences_w->hide();} } } Fl_Window select_slice_w { - label {Select Sfinx Slice} open + label {Select Sfinx Slice} xywh {67 62 730 352} type Double color 31 hide modal } { Fl_Button {} { @@ -601,7 +629,7 @@ select_slice_action(slice);} } {} } Fl_Window slices_w { - label {Sfinx Objects} + label {Sfinx Data} xywh {200 315 866 370} type Double color 31 hide modal } { Fl_Button {} { @@ -684,7 +712,7 @@ select_slice_w->show();} } } Fl_Window edit_slice_w { - label {Edit Sfinx Slice} open + label {Edit Sfinx Slice} xywh {276 319 595 330} type Double color 31 hide modal } { Fl_Input slice_name_i { @@ -735,7 +763,7 @@ fill_objects_tree(slices_tree, 1 << SFINX_SLICE_OBJECT, 0, 1); // force refresh} } Fl_Window delete_slice_w { label {Delete Sfinx Slice} - xywh {252 500 388 223} type Double color 31 hide modal + xywh {350 43 388 223} type Double color 31 hide modal } { Fl_Button {} { label Cancel @@ -762,8 +790,8 @@ fill_objects_tree(slices_tree, 1 << SFINX_SLICE_OBJECT, 0, 1); // force refresh} xywh {35 31 330 26} box ENGRAVED_FRAME color 29 labeltype ENGRAVED_LABEL align 1 } Fl_Choice slice_deletion_type_ch { - label {Slice && Data Deletion Type} - xywh {73 82 240 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 5 + label {Slice && Data Deletion Action} + xywh {73 82 240 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 1 } { MenuItem {} { label {Attach subslices to parent} @@ -775,8 +803,8 @@ fill_objects_tree(slices_tree, 1 << SFINX_SLICE_OBJECT, 0, 1); // force refresh} } } Fl_Choice data_deletion_type_ch { - label {Associated Data Deletion Type} - xywh {73 132 240 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 5 + label {Associated Data Deletion Action} + xywh {73 132 240 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 1 } { MenuItem {} { label {Mark all data 'Unsorted'} @@ -1262,7 +1290,7 @@ app->sfinx.send(current_files_module_tree_path);*/} } Fl_Button {} { label Reload - callback {app->sfinx.send(current_note);} + callback {//app->sfinx.send(current_note);} xywh {166 10 112 25} labeltype ENGRAVED_LABEL } Fl_Button {} { @@ -1278,8 +1306,8 @@ app->sfinx.send(current_files_module_tree_path);*/} } } Fl_Window edit_note_w { - label {Edit Note} open - xywh {145 39 1020 385} type Double color 31 hide modal + label {Edit Note} + xywh {212 174 1020 385} type Double color 31 hide modal } { Fl_Button {} { label Cancel @@ -1319,18 +1347,17 @@ sfinx_note_t *note = (sfinx_note_t *)edit_note_w->user_data(); note->name = note_name_i->value(); note->url = note_url_i->value(); note->text = note_text_i->value(); -sfinx_object_t *obj = (sfinx_object_t *)from_voidp(note_mtag_b->user_data()); +sfinx_object_t *obj = (sfinx_object_t *)note_mtag_b->user_data(); note->mtag.id = obj->id; note->mtag.type = obj->type; note->mtag.slice_id = obj->slice_id; note_mtag_b->user_data(0); -//note->tags.clear(); -//for (int i = 1; i <= note_additional_tags_br->size(); i++) { -// obj = (sfinx_object_t *)note_additional_tags_br->data(i); -// note->tags.push_back(obj); -// delete obj; -// note_additional_tags_br->data(i, 0); -//} +note->tags.clear(); +for (int i = 1; i <= note_tags_br->size(); i++) { + obj = (sfinx_object_t *)note_tags_br->data(i); + note->tags.push_back(*obj); + note_tags_br->data(i, 0); +} app->sfinx.send(note); delete note; edit_note_w->user_data(0); @@ -1342,27 +1369,27 @@ fill_objects_tree(notes_tree, 1 << SFINX_NOTE_OBJECT, 0, 1); // force refresh} } Fl_Button note_mtag_b { label {Main Note Tag (Not Set)} - callback {app->sfinx.send(SFINX_OBJECTS_TREE_REQUEST, (u32_t)0); + callback {fill_objects_tree(slices_tree, (1 << SFINX_SLICE_OBJECT) | (1 << SFINX_FILE_OBJECT) | (1 << SFINX_NOTE_OBJECT), 0, 0); // fluid bugs if any default params exists ! slices_w->user_data((void *)select_note_mtag_action); slices_w->show();} tooltip {Note Main Tag} xywh {594 93 348 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL } - Fl_Browser note_additional_objects_br { + Fl_Browser note_tags_br { label {Additional Note Tags} xywh {559 146 420 102} type Multi color 46 labeltype ENGRAVED_LABEL align 1 } - Fl_Button note_add_object_b { + Fl_Button note_add_tag_b { label {Add Tag} - callback {/*app->sfinx.send(SFINX_SLICES_MODULE_TREE_REQUEST, (u8_t)0); -slices_w->user_data((void *)select_file_additional_slice_action); -slices_w->show();*/} + callback {fill_objects_tree(slices_tree, (1 << SFINX_SLICE_OBJECT) | (1 << SFINX_FILE_OBJECT) | (1 << SFINX_NOTE_OBJECT), 0, 0); // fluid bugs if any default params exists ! +slices_w->user_data((void *)select_note_atag_action); +slices_w->show();} xywh {584 258 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL } - Fl_Button note_remove_object_b { + Fl_Button note_remove_tag_b { label {Remove Tag} - callback {for (int i = note_additional_objects_br->size(); i >= 1; i--) { - if (note_additional_objects_br->selected(i)) - note_additional_objects_br->remove(i); + callback {for (int i = note_tags_br->size(); i >= 1; i--) { + if (note_tags_br->selected(i)) + note_tags_br->remove(i); }} xywh {811 258 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL } @@ -1380,6 +1407,46 @@ slices_w->show();*/} } } } + Fl_Window delete_note_w { + label {Delete Note} open + xywh {44 182 388 168} type Double color 31 hide modal + } { + Fl_Button {} { + label Cancel + callback {delete_note_w->hide();} + xywh {239 122 112 25} labeltype ENGRAVED_LABEL + } + Fl_Button {} { + label Delete + callback {Fl_Toggle_Node *node = notes_tree->selected(); +if (!node || node->can_open()) + return; +sfinx_object_t *obj = (sfinx_object_t *) node->user_data(); +sfinx_note_t note(note_deletion_type_ch->value() ? SFINX_NOTES_MODULE_UNLINK : SFINX_NOTES_MODULE_UNSORT); +note.id = obj->id; +app->sfinx.send(note); +delete_note_w->hide(); +fill_objects_tree(notes_tree, (1 << SFINX_SLICE_OBJECT) | (1 << SFINX_NOTE_OBJECT), 0, 1); // force refresh} selected + xywh {40 122 112 25} labeltype ENGRAVED_LABEL + } + Fl_Output delete_sfinx_note_to { + label {Please confirm deletion of the note} + xywh {31 26 330 26} box ENGRAVED_FRAME color 29 labeltype ENGRAVED_LABEL align 1 + } + Fl_Choice note_deletion_type_ch { + label {Associated Data Deletion Action} + xywh {74 80 240 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 1 + } { + MenuItem {} { + label {Mark all data 'Unsorted'} + xywh {20 20 35 22} + } + MenuItem {} { + label {Delete all data} + xywh {30 30 35 22} + } + } + } Fl_Window about_w { xywh {357 229 374 154} type Double hide } { @@ -1608,24 +1675,27 @@ note_mtag_b->user_data(&(note->mtag)); note_mtag_b->copy_label((note->mtag.name + " [ " + note->mtag.description + " ]").c_str()); note_mtag_b->redraw(); // add tags -// ... +note_tags_br->clear(); +for (u32_t i = 0; i < note->tags.size(); i++) { + string s = note->tags[i].name + " [ " + note->tags[i].description + " ]"; + note_tags_br->add(s.c_str(), &(note->tags[i])); +} edit_note_w->show(); -Fl::unlock();} {selected - } +Fl::unlock();} {} } -Function {x11_ui::notes_module_edit_reply(sfinx_string_t *classify_error)} {return_type void +Function {x11_ui::notes_module_reply(sfinx_string_t *classify_error)} {open return_type void } { code {Fl::lock(); if (classify_error->size() == 1) { - app->sfinx.send(current_files_module_tree_path); - classify_file_w->hide(); + ::fill_objects_tree(notes_tree, 1 << SFINX_NOTE_OBJECT, 0, 1); // fluid bugs if any default params exists ! + edit_note_w->hide(); } else fl_alert(classify_error->c_str()); Fl::unlock();} {} } -Function {x11_ui::files_module_edit_reply(sfinx_string_t *classify_error)} {return_type void +Function {x11_ui::files_module_edit_reply(sfinx_string_t *classify_error)} {open return_type void } { code {Fl::lock(); if (classify_error->size() == 1) { @@ -1636,7 +1706,7 @@ if (classify_error->size() == 1) { Fl::unlock();} {} } -Function {x11_ui::files_module_edit(sfinx_file_t *f)} {return_type void +Function {x11_ui::files_module_edit(sfinx_file_t *f)} {open return_type void } { code {Fl::lock(); static sfinx_file_t file; @@ -1773,19 +1843,6 @@ switch (el->tid()) { }} {} } -Function {x11_ui::notes_module_add_reply(sfinx_string_t *add_error)} {return_type void -} { - code {Fl::lock(); -if (add_error->size() == 1) { - edit_note_w->hide(); - // ÐÅÒÅÚÁÐÒÁÛÉ×ÁÅÍ ÄÅÒÅ×Ï ÚÁÍÅÔÏË -// current_note_slice.tid(SFINX_NOTES_MODULE_TREE_REQUEST); - app->sfinx.send(current_note_slice); -} else - fl_alert(add_error->c_str()); -Fl::unlock();} {} -} - Function {x11_ui::fill_objects_tree()} {open return_type void } { code {Fl::lock(); @@ -1820,12 +1877,12 @@ for (u32_t i = 0; i < app->slices.len(); i++) { if (!slice->parent_id) { node = tree->add_sub((char *)name.c_str(), 1, &slice_pixmap, to_voidp(slice)); if (fill_tree_mask & (1 << SFINX_NOTE_OBJECT)) { - notes_tree->open(node); + tree->open(node); // add notes for (u32_t x = 0; x < slice->objs.size(); x++) { - notes_tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, ¬e_pixmap, + tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, ¬e_pixmap, to_voidp(&(slice->objs[x]))); - notes_tree->traverse_up(); + tree->traverse_up(); } } } else { @@ -1840,12 +1897,12 @@ for (u32_t i = 0; i < app->slices.len(); i++) { tree->open(node); node = tree->add_sub((char *)name.c_str(), 1, &slice_pixmap, to_voidp(slice)); if (fill_tree_mask & (1 << SFINX_NOTE_OBJECT)) { - notes_tree->open(node); + tree->open(node); // add notes for (u32_t x = 0; x < slice->objs.size(); x++) { - notes_tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, ¬e_pixmap, + tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, ¬e_pixmap, to_voidp(&(slice->objs[x]))); - notes_tree->traverse_up(); + tree->traverse_up(); } } } // node not found - just ignore diff --git a/include/elements.H b/include/elements.H index 2de5942..d3120c6 100644 --- a/include/elements.H +++ b/include/elements.H @@ -251,6 +251,11 @@ class sfinx_object_t { ctime = ct; etime = et; } + bool cmp(sfinx_object_t *o) { + if ((o->id == id) && (o->type == type) && (o->slice_id == o->slice_id)) + return false; + return true; + } sfinx_size_t size() { return (2 * sizeof(sfinx_id_t) + sizeof(sfinx_type_t) + name.size() + 1 + path_name.size() + 1 + description.size() + 1 + ctime.size() + etime.size()); } sfinx_size_t get(u8_t *buf) { @@ -963,17 +968,16 @@ class sfinx_files_vector_t : public sfinx_t { class sfinx_note_t : public sfinx_t { sfinx_size_t size() { // count tags size - // ... - return (size_ = sizeof(sfinx_id_t) + mtag.size() + sizeof(u32_t) + name.size() + 1 + + u32_t tags_size = sizeof(u32_t); + for (u32_t i = 0; i < tags.size(); i++) + tags_size += tags[i].size(); + return (size_ = tags_size + sizeof(sfinx_id_t) + mtag.size() + name.size() + 1 + url.size() + 1 + text.size() + 1 + sizeof(u8_t) + ctime.size() + etime.size()); } sfinx_size_t put(u8_t *buf, sfinx_size_t available_buf_space) { if (size() > available_buf_space) return 0; buf += ::put(id, buf); - //buf += ::put(mtag_id, buf); - //buf += ::put(mtag_type, buf); - //buf += ::put(mtag_slice_id, buf); buf += mtag.put(buf); buf += ::put(name, buf); buf += ::put(url, buf); @@ -990,9 +994,6 @@ class sfinx_note_t : public sfinx_t { sfinx_size_t get(u8_t *buf, sfinx_size_t object_size_in_buf) { u8_t *tmp = buf; buf += ::get(&id, buf); - //buf += ::get(&mtag_id, buf); - //buf += ::get(&mtag_type, buf); - //buf += ::get(&mtag_slice_id, buf); buf += mtag.get(buf); buf += ::get(&name, buf); buf += ::get(&url, buf); @@ -1019,9 +1020,6 @@ class sfinx_note_t : public sfinx_t { ((sfinx_t *)s)->size(); copy_size_tid(src); id = src->id; - //mtag_id = src->mtag_id; - //mtag_type = src->mtag_type; - //mtag_slice_id = src->mtag_slice_id; mtag = src->mtag; name = src->name; url = src->url; @@ -1244,6 +1242,7 @@ static sfinx_t *make_sfinx_element(sfinx_tid_t tid) case SFINX_NOTES_MODULE_EDIT_REQUEST: case SFINX_NOTES_MODULE_EDIT: case SFINX_NOTES_MODULE_UNLINK: + case SFINX_NOTES_MODULE_UNSORT: return new sfinx_note_t(tid); default: debug("Unknown element %s (id 0x%x)", sfinx_cmd2str(tid), tid); diff --git a/include/faraon.H b/include/faraon.H index 9498ded..31ccb09 100644 --- a/include/faraon.H +++ b/include/faraon.H @@ -39,12 +39,11 @@ class app_specific_ui { virtual void files_module_classify_reply(sfinx_string_t *) = 0; virtual void files_module_edit_reply(sfinx_string_t *) = 0; virtual void files_module_edit(sfinx_file_t *) = 0; - virtual void notes_module_edit_reply(sfinx_string_t *) = 0; + virtual void notes_module_reply(sfinx_string_t *) = 0; virtual void notes_module_edit(sfinx_note_t *) = 0; virtual void alert(sfinx_string_t *) = 0; virtual void search_browser(sfinx_pair_vector_t *) = 0; virtual void prepare_search_info (sfinx_t *el, string &inf) = 0; - virtual void notes_module_add_reply(sfinx_string_t *) = 0; virtual void fill_objects_tree() = 0; void lock() { big_lock.enterMutex(); } @@ -65,11 +64,10 @@ class x11_ui: public F_FLTK_UI, public app_specific_ui { void files_module_edit_reply(sfinx_string_t *); void files_module_edit(sfinx_file_t *); void notes_module_edit(sfinx_note_t *); - void notes_module_edit_reply(sfinx_string_t *); + void notes_module_reply(sfinx_string_t *); void alert(sfinx_string_t *); void search_browser(sfinx_pair_vector_t *); void prepare_search_info (sfinx_t *el, string &inf); - void notes_module_add_reply(sfinx_string_t *); void fill_objects_tree(); }; diff --git a/include/proto_data.H b/include/proto_data.H index 02921fa..9eedd81 100644 --- a/include/proto_data.H +++ b/include/proto_data.H @@ -114,6 +114,7 @@ _new_enum(SFINX_NOTES_MODULE_EDIT_REQUEST) _new_enum(SFINX_NOTES_MODULE_EDIT) _new_enum(SFINX_NOTES_MODULE_EDIT_REPLY) _new_enum(SFINX_NOTES_MODULE_UNLINK) +_new_enum(SFINX_NOTES_MODULE_UNSORT) // search _new_enum(SFINX_SEARCH_QUERY) diff --git a/include/sfinx.H b/include/sfinx.H index d2c039f..e2b9b90 100644 --- a/include/sfinx.H +++ b/include/sfinx.H @@ -99,7 +99,8 @@ class faraon_session : public sfinx_stream, public TCPSession { void send_file(sfinx_file_t *f); void send_note(sfinx_note_t *n); void files_module_classify(sfinx_file_t *f); - void edit_file(sfinx_file_t *f); + void update_file(sfinx_file_t *f); + void update_note(sfinx_note_t *n); bool gen_desc_file(sfinx_type_t obj_type, sfinx_id_t obj_id, sfinx_id_t slice_id); void search_query(sfinx_search_query_t *); void search_in_files(string &pattern, sfinx_pair_vector_t *r); @@ -109,6 +110,7 @@ class faraon_session : public sfinx_stream, public TCPSession { bool get_object(sfinx_object_t *dst, sfinx_type_t obj_type, sfinx_id_t obj_id); bool get_object(sfinx_object_t *dst) { return get_object(dst, dst->type, dst->id); } void notes_module_add(sfinx_note_t *n); + void note_unlink(sfinx_note_t *n); void fill_notes(sfinx_slice_t *slice); void fill_files(sfinx_slice_t *slice); void add_slices_from_parent(sfinx_id_t parent_id, IBPP::Transaction tr, sfinx_slice_vector_t *slices, diff --git a/sfinx/sfinx.C b/sfinx/sfinx.C index 90d2d10..3a06323 100644 --- a/sfinx/sfinx.C +++ b/sfinx/sfinx.C @@ -555,6 +555,11 @@ void faraon_session::mark_file_unsorted(sfinx_file_t *f, bool remove) gen_desc_file(f->mtag_type, f->mtag_id, f->mtag_slice_id); } +void faraon_session::note_unlink(sfinx_note_t *n) +{ + +} + void faraon_session::update_files_module_conf(sfinx_pair_vector_t *conf) { IBPP::Transaction tr = sfinx->driver_->TransactionFactory(sfinx->db_, IBPP::amWrite, @@ -976,7 +981,8 @@ void faraon_session::send_note(sfinx_note_t *n) st->Prepare("select name, url, text, ctime, etime, mtag_type, mtag_id, secured from notes where id = ?"); st->Set(1, (int64_t)n->id); st->Execute(); - sfinx_note_t note(n->tid()); + sfinx_note_t note; + note.copy(n); if (!st->Fetch()) { sfinx_string_t alert(SFINX_ALERT); alert.set("No such note in database !"); @@ -1309,7 +1315,7 @@ bool faraon_session::get_file_by_id(sfinx_file_t *f) return true; } -void faraon_session::edit_file(sfinx_file_t *f) +void faraon_session::update_file(sfinx_file_t *f) { sfinx_file_t old_file; old_file.file_id = f->file_id; @@ -1397,6 +1403,41 @@ out: send(reply); } +void faraon_session::update_note(sfinx_note_t *n) +{ + IBPP::Transaction tr; + IBPP::Statement st; + sfinx_string_t reply(SFINX_NOTES_MODULE_EDIT_REPLY); + tr = sfinx->driver_->TransactionFactory(sfinx->db_, IBPP::amWrite, IBPP::ilConcurrency, IBPP::lrWait); + tr->Start(); + st = sfinx->driver_->StatementFactory(sfinx->db_, tr); + st->Prepare("update notes set name = ?, url = ?, text = ?, mtag_id = ?, mtag_type = ?, mtag_slice_id = ?," + "secured = ? where id = ?"); + st->Set(1, n->name); + st->Set(2, n->url); + st->Set(3, n->text); + st->Set(4, (int64_t)n->mtag.id); + st->Set(5, (int32_t)n->mtag.type); + st->Set(6, (int64_t)n->mtag.slice_id); + st->Set(7, (int16_t)n->secured); + st->Set(8, (int64_t)n->id); + st->Execute(); + // add to note_tags + st->Prepare("delete from note_tags where note_id = ?"); + st->Set(1, (int64_t)n->id); + st->Execute(); + for (u32_t i = 0; i < n->tags.size(); i++) { + st->Prepare("insert into note_tags (note_id, obj_id, obj_type) values (?, ?, ?)"); + st->Set(1, (int64_t)n->id); + st->Set(2, (int64_t)n->tags[i].id); + st->Set(3, (int32_t)n->tags[i].type); + st->Execute(); + } + tr->Commit(); + reply.set(""); // No error + send(reply); +} + void faraon_session::search_in_files(string &pattern, sfinx_pair_vector_t *r) { IBPP::Transaction tr = sfinx->driver_->TransactionFactory(sfinx->db_, IBPP::amRead, @@ -1469,8 +1510,8 @@ void faraon_session::search_query(sfinx_search_query_t *q) // TODO: make threaded search, add sort rules string ptrn = '%' + q->pattern + '%'; // search_in_slices(q->pattern, &r); - search_in_files(ptrn, &r); // search_in_notes(q->pattern, &r); + search_in_files(ptrn, &r); send(r); } @@ -1484,8 +1525,13 @@ bool faraon_session::process_requests() string root; while ((el = rx_elements.next())) { switch (el->tid()) { -// case SFINX_NOTES_MODULE_EDIT: -// edit_note((sfinx_note_t *)el); + case SFINX_NOTES_MODULE_UNSORT: + case SFINX_NOTES_MODULE_UNLINK: + note_unlink((sfinx_note_t *)el); + break; + case SFINX_NOTES_MODULE_EDIT: + update_note((sfinx_note_t *)el); + break; case SFINX_NOTES_MODULE_EDIT_REQUEST: send_note((sfinx_note_t *)el); break; @@ -1505,7 +1551,7 @@ bool faraon_session::process_requests() search_query((sfinx_search_query_t *)el); break; case SFINX_FILES_MODULE_EDIT_FILE: - edit_file((sfinx_file_t *)el); + update_file((sfinx_file_t *)el); break; case SFINX_FILES_MODULE_EDIT_REQUEST: send_file((sfinx_file_t *)el); -- 2.11.4.GIT