1 # data file for the Fltk User Interface Designer (fluid)
4 i18n_include <libintl.h>
8 decl {\#include <faraon.H>} {global
11 decl {\#include <FL/fl_ask.H>} {global
14 decl {\#include <FL/Fl_Preferences.H>} {global
17 decl {\#include <Flek/Fl_Toggle_Tree.H>} {global
20 decl {\#include <scroll.H>} {public global
23 decl {\#include "slice.xpm"} {}
25 decl {\#include "note.xpm"} {}
27 decl {Fl_Pixmap slice_pixmap(slice_xpm_data);} {}
29 decl {Fl_Pixmap note_pixmap(note_xpm_data);} {}
31 decl {Fl_Toggle_Tree *config_tree;} {global
34 decl {Fl_Toggle_Tree *slices_tree;} {global
37 decl {Fl_Toggle_Tree *select_slice_tree;} {global
40 decl {Fl_Toggle_Tree *notes_tree;} {global
43 decl {Fl_Toggle_Tree *fill_tree;} {}
45 decl {sfinx_slice_t *fill_tree_except;} {global
48 decl {u32_t fill_tree_mask;} {global
51 decl {sfinx_file_t current_files_module_tree_path(SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST);} {}
53 Function {fill_objects_tree(Fl_Toggle_Tree *ft, u32_t m, sfinx_slice_t *except, bool force)} {open private return_type void
57 fill_tree_except = except;
58 app->refresh_slices(force);} {}
61 Function {relink_slice_action(sfinx_slice_t *selected)} {private return_type void
63 code {sfinx_slice_t slice(SFINX_SLICE_RELINK);
64 // slice to be relinked
65 Fl_Toggle_Node *node = slices_tree->selected();
68 sfinx_slice_t *rslice = (sfinx_slice_t *)node->user_data();
69 slice.id = rslice->id;
71 slice.parent_id = selected->id;
72 debug("moving from %lld to %lld", rslice->parent_id, selected->id);
73 app->sfinx.send(slice);
74 select_slice_w->hide();
75 fill_objects_tree(slices_tree, SFINX_SLICE_OBJECT, 0, 1); // force refresh} {}
78 Function {select_note_atag_action()} {open private return_type void
80 code {sfinx_object_t *obj;
81 Fl_Toggle_Node *node = slices_tree->selected();
84 if (node->can_open()) // slice
85 obj = ((sfinx_slice_t *)node->user_data())->object();
87 obj = (sfinx_object_t *)node->user_data();
88 Fl_Toggle_Node *snode = notes_tree->selected();
89 sfinx_object_t *sobj = (sfinx_object_t *)snode->user_data();
90 if (sobj == obj) // try to self tag
92 if (!obj->cmp((sfinx_object_t *)note_mtag_b->user_data())) // already set as main tag
94 for (int i = 1; i <= note_tags_br->size(); i++) {
95 if (!obj->cmp((sfinx_object_t *)note_tags_br->data(i))) // already set as additional tag
98 string s = obj->name + " [ " + obj->description + " ]";
99 note_tags_br->add(s.c_str(), obj);
100 note_tags_br->redraw();} {}
103 Function {select_note_mtag_action()} {open private return_type void
105 code {sfinx_object_t *obj;
106 Fl_Toggle_Node *node = slices_tree->selected();
109 if (node->can_open()) // slice
110 obj = ((sfinx_slice_t *)node->user_data())->object();
112 obj = (sfinx_object_t *)node->user_data();
113 Fl_Toggle_Node *snode = notes_tree->selected();
114 sfinx_object_t *sobj = (sfinx_object_t *)snode->user_data();
115 if (sobj == obj) // try to self tag
117 note_mtag_b->user_data(obj);
118 note_mtag_b->copy_label((obj->name + " [ " + obj->description + " ]").c_str());
119 note_mtag_b->redraw();
120 // check for additional slices if it is here - remove it
121 for (int i = 1; i <= note_tags_br->size(); i++) {
122 if (!obj->cmp((sfinx_object_t *)note_tags_br->data(i))) {
123 note_tags_br->remove(i);
129 Function {select_file_main_slice_action()} {private return_type void
131 code {//file_main_slice_b->user_data(to_voidp(current_slice_id));
133 sfinx_slice_t *slice = (sfinx_slice_t *)slices_tree->selected()->user_data();
135 file_main_slice_b->label(l.c_str());
136 file_main_slice_b->redraw();
137 // check for additional slices if it is here - remove it
138 for (int i = 1; i <= file_additional_slices_br->size(); i++) {
139 // if (file_additional_slices_br->data(i) == to_voidp(current_slice_id)) {
140 // file_additional_slices_br->remove(i);
146 Function {select_file_additional_slice_action()} {private return_type void
148 code {//if (to_voidp(current_slice_id) == file_main_slice_b->user_data()) // already set as main slice
150 //for (int i = 1; i <= file_additional_slices_br->size(); i++) {
151 // if (file_additional_slices_br->data(i) == to_voidp(current_slice_id))
154 //sfinx_slice_t *slice = (sfinx_slice_t *)slices_tree->selected()->user_data();
155 //file_additional_slices_br->add(slice->name(), to_voidp(current_slice_id));
156 file_additional_slices_br->redraw();} {}
159 Function {search_add_slice_action()} {private return_type void
161 code {for (int i = 1; i <= search_slices_br->size(); i++) {
162 // if (search_slices_br->data(i) == to_voidp(current_slice_id))
165 //sfinx_slice_t *slice = (sfinx_slice_t *)slices_tree->selected()->user_data();
166 //search_slices_br->add(slice->name(), to_voidp(current_slice_id));
167 search_slices_br->redraw();} {}
170 Function {slices_tree_cb(Fl_Widget *, void *)} {open private return_type void
172 code {Fl_Toggle_Node *node = slices_tree->selected();
175 if (!Fl::event_clicks())
177 void (*select_slice_action)(void) = (void (*)())(slices_w->user_data());
178 if (select_slice_action) {
180 slices_w->user_data(0);
181 select_slice_action();
185 Function {notes_tree_cb(Fl_Widget *, void *)} {private return_type void
187 code {Fl_Toggle_Node *node = notes_tree->selected();
190 //current_note_id = from_voidp(node->user_data());
191 //current_slice_name = node->label();
192 if (!Fl::event_clicks())
194 void (*select_note_action)(void) = (void (*)())(notes_w->user_data());
195 if (select_note_action) {
196 notes_w->user_data(0);
197 select_note_action();
201 Function {select_slice_tree_cb(Fl_Widget *, void *)} {private return_type void
203 code {if (!Fl::event_clicks())
205 select_slice_b->do_callback();} {}
208 Function {write_preferences()} {private return_type void
210 code {app->server_name = config_sfinx_server_name_i->value();
211 app->files_module_conf.clear();
212 app->files_module_conf.add(FILES_MODULE_UNSORTED_PATH,
213 config_files_module_unsorted_path_i->value());
214 app->files_module_conf.add(FILES_MODULE_SORTED_TREE_PATH,
215 config_files_module_sorted_path_i->value());
216 app->files_module_conf.add(FILES_MODULE_DESC_FILE_NAME,
217 config_files_module_desc_file_name_i->value());
218 app->files_module_conf.add(FILES_MODULE_DESC_FILE_ENABLE,
219 gen_desc_files_b->value());
220 app->write_preferences();} {}
223 Function {config_tree_cb(Fl_Widget *, void *)} {private return_type void
225 code {static Fl_Group *prev_group;
226 Fl_Toggle_Node *node = config_tree->selected();
228 Fl_Group *gr = *((Fl_Group **)(node->user_data()));
233 //config_tree->unselect();
237 Function {fill_config_tree()} {private return_type void
239 code {config_tree->add_next("Connection", 0, 0, (void *)&config_connection_gr);
240 config_tree->add_next("Files Module", 0, 0, (void *)&config_files_module_gr);
241 config_tree->add_next("Confirmation", 0, 0, (void *)&config_confirmation_gr);
242 config_tree->callback(config_tree_cb);
243 config_tree->edit_on_reselect(0);} {}
246 Function {x11_ui::init()} {open return_type void
250 callback {if (fl_choice("Really quit ?", "No", "Yes", 0L))
252 xywh {171 126 945 365} type Double hide
259 xywh {0 0 67 22} labeltype ENGRAVED_LABEL
262 label {Connect to ...}
263 xywh {0 0 34 22} shortcut 0x80063 labeltype ENGRAVED_LABEL deactivate
266 label {Connect to default server}
267 xywh {10 10 34 22} labeltype ENGRAVED_LABEL deactivate
270 label {Disconnect from Sfinx}
271 xywh {10 10 34 22} labeltype ENGRAVED_LABEL deactivate
274 label {Connection Info}
275 xywh {20 20 34 22} shortcut 0x80069 labeltype ENGRAVED_LABEL deactivate
279 xywh {30 30 34 22} labeltype ENGRAVED_LABEL deactivate divider
283 callback {app->read_preferences();
284 config_sfinx_server_name_i->value(app->server_name.c_str());
285 preferences_w->show();}
286 xywh {30 30 34 22} shortcut 0x80070 labeltype ENGRAVED_LABEL divider
290 callback {if (fl_choice("Really quit ?", "No", "Yes", 0L))
292 xywh {20 20 34 22} shortcut 0x80078 labeltype ENGRAVED_LABEL
297 xywh {10 10 67 22} labeltype ENGRAVED_LABEL
301 callback {if (!app->connected()) {
302 fl_message("Not connected to Sfinx Server !");
305 xywh {10 10 34 22} shortcut 0x61 labeltype ENGRAVED_LABEL deactivate
309 callback {if (!app->connected()) {
310 fl_message("Not connected to Sfinx Server !");
313 fill_objects_tree(slices_tree, 1 << SFINX_SLICE_OBJECT, 0, 0); // fluid bugs if any default params exists !
315 xywh {10 10 34 22} shortcut 0x73 labeltype ENGRAVED_LABEL
318 label {Knowledge Module}
319 callback {if (!app->connected()) {
320 fl_message("Not connected to Sfinx Server !");
323 xywh {40 40 34 22} shortcut 0x6b labeltype ENGRAVED_LABEL deactivate
327 callback {if (!app->connected()) {
328 fl_message("Not connected to Sfinx Server !");
331 xywh {40 40 34 22} shortcut 0x74 labeltype ENGRAVED_LABEL deactivate
335 callback {if (!app->connected()) {
336 fl_message("Not connected to Sfinx Server !");
339 xywh {40 40 34 22} shortcut 0x6d labeltype ENGRAVED_LABEL deactivate
343 callback {if (!app->connected()) {
344 fl_message("Not connected to Sfinx Server !");
347 xywh {50 50 34 22} shortcut 0x63 labeltype ENGRAVED_LABEL deactivate
351 callback {if (!app->connected()) {
352 fl_message("Not connected to Sfinx Server !");
355 xywh {40 40 34 22} shortcut 0x65 labeltype ENGRAVED_LABEL deactivate
359 callback {if (!app->connected()) {
360 fl_message("Not connected to Sfinx Server !");
363 app->sfinx.send(SFINX_FILES_MODULE_CONF_REQUEST, (u8_t) 0);
364 if (app->sfinx.send(current_files_module_tree_path))
366 files_module_w->show();}
367 xywh {20 20 34 22} shortcut 0x66 labeltype ENGRAVED_LABEL
371 callback {if (!app->connected()) {
372 fl_message("Not connected to Sfinx Server !");
375 // ÒÉÓÕÅÍ ÄÅÒÅ×Ï ÚÁÍÅÔÏË
376 fill_objects_tree(notes_tree, 1 << SFINX_NOTE_OBJECT, 0, 0); // fluid bugs if any default params exists !
378 xywh {30 30 34 22} shortcut 0x6e labeltype ENGRAVED_LABEL
383 xywh {20 20 67 22} labeltype ENGRAVED_LABEL
386 label {Browser && Searcher}
387 callback {if (!app->connected()) {
388 fl_message("Not connected to Sfinx Server !");
391 search_i->take_focus();
393 xywh {30 30 34 22} shortcut 0x62 labeltype ENGRAVED_LABEL
397 callback {if (!app->connected()) {
398 fl_message("Not connected to Sfinx Server !");
401 xywh {30 30 34 22} shortcut 0x72 labeltype ENGRAVED_LABEL deactivate divider
405 callback {if (!app->connected()) {
406 fl_message("Not connected to Sfinx Server !");
409 xywh {40 40 34 22} shortcut 0x40061 labeltype ENGRAVED_LABEL deactivate
412 label {Knowledge Tracer}
413 callback {if (!app->connected()) {
414 fl_message("Not connected to Sfinx Server !");
417 xywh {40 40 34 22} shortcut 0x4006b labeltype ENGRAVED_LABEL deactivate
420 label {Indexing machine}
421 callback {if (!app->connected()) {
422 fl_message("Not connected to Sfinx Server !");
425 xywh {30 30 34 22} shortcut 0x40069 labeltype ENGRAVED_LABEL deactivate
428 label {Check Sfinx DB}
429 callback {if (!app->connected()) {
430 fl_message("Not connected to Sfinx Server !");
433 xywh {40 40 34 22} shortcut 0x40064 labeltype ENGRAVED_LABEL deactivate
437 callback {if (!app->connected()) {
438 fl_message("Not connected to Sfinx Server !");
441 xywh {30 30 34 22} shortcut 0x40062 labeltype ENGRAVED_LABEL deactivate divider
444 label {Clear log window}
445 callback {log_br->clear();}
446 xywh {30 30 34 22} shortcut 0x10063 labeltype ENGRAVED_LABEL
451 xywh {20 20 67 22} labeltype ENGRAVED_LABEL deactivate
455 xywh {20 20 67 22} labeltype ENGRAVED_LABEL
459 xywh {30 30 34 22} shortcut 0xffbe labeltype ENGRAVED_LABEL deactivate divider
463 callback {about_w->show();}
464 xywh {30 30 34 22} shortcut 0x80061 labeltype ENGRAVED_LABEL
468 Fl_Output status_bar_o {
469 tooltip Status xywh {0 347 945 20} box PLASTIC_UP_BOX color 31 deactivate
472 xywh {-1 21 948 326} type Select color 31 labelfont 4 textfont 4
475 Fl_Window preferences_w {
477 xywh {215 308 742 373} type Double color 31 hide
481 callback {preferences_w->hide();}
482 xywh {390 330 112 25} labeltype ENGRAVED_LABEL
486 callback {write_preferences();
487 preferences_w->hide();}
488 xywh {572 330 112 25} labeltype ENGRAVED_LABEL
490 Fl_Scroll prefs_tree_scroll {
491 xywh {10 29 173 283} type VERTICAL_ALWAYS box ENGRAVED_FRAME color 28
492 code0 {config_tree = new Fl_Toggle_Tree(12, 12, prefs_tree_scroll->w() - prefs_tree_scroll->scrollbar.w(), 10);}
493 code1 {fill_config_tree();}
495 Fl_Group config_connection_gr {open
496 xywh {183 19 535 283} box ENGRAVED_FRAME hide
498 Fl_Input config_sfinx_server_name_i {
499 label {Sfinx Server Name}
500 xywh {273 89 375 26} color 29 labeltype ENGRAVED_LABEL align 1
503 label {Minimum Auth Level}
504 xywh {227 179 211 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 5 deactivate
507 label {User Name && Passsword}
516 label {Minimum Debug Level}
517 xywh {227 230 211 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 5 deactivate
536 label {Warning Level}
548 label {Critical Level}
557 label {Minimum Crypt Level}
558 xywh {476 179 211 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 5 deactivate
570 Fl_Group config_files_module_gr {
571 xywh {193 29 535 283} box ENGRAVED_FRAME hide
573 Fl_Input config_files_module_unsorted_path_i {
574 label {Unsorted files path on Sfinx server}
575 xywh {283 68 375 26} color 29 labeltype ENGRAVED_LABEL align 1
577 Fl_Input config_files_module_sorted_path_i {
578 label {Sorted file tree path on Sfinx server}
579 xywh {283 128 375 26} color 29 labeltype ENGRAVED_LABEL align 1
581 Fl_Check_Button gen_desc_files_b {
582 label {Generate description files}
583 xywh {209 233 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16
585 Fl_Input config_files_module_desc_file_name_i {
586 label {Description file name}
587 xywh {283 189 375 26} color 29 labeltype ENGRAVED_LABEL align 1
589 Fl_Check_Button process_files_mime_type_b {
590 label {Detect files MIME type}
591 xywh {472 233 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16
594 Fl_Group config_confirmation_gr {
595 xywh {183 19 535 283} box ENGRAVED_FRAME hide
597 Fl_Check_Button exit_confirm_b {
599 xywh {216 45 204 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL deactivate
603 Fl_Window select_slice_w {
604 label {Select Sfinx Slice}
605 xywh {67 62 730 352} type Double color 31 hide modal
609 callback {select_slice_w->hide();}
610 xywh {594 312 112 25} box PLASTIC_UP_BOX labeltype ENGRAVED_LABEL
612 Fl_Button select_slice_b {
614 callback {Fl_Toggle_Node *node = select_slice_tree->selected();
617 sfinx_slice_t *slice = (sfinx_slice_t *) node->user_data();
618 void (*select_slice_action)(sfinx_slice_t *) = (void (*)(sfinx_slice_t *))(select_slice_b->user_data());
619 select_slice_action(slice);}
620 xywh {16 312 548 25} box PLASTIC_UP_BOX labeltype ENGRAVED_LABEL
622 Fl_Scroll select_slice_tree_scroll {open
623 xywh {15 15 702 280} box ENGRAVED_FRAME color 28
624 code0 {select_slice_tree = new Fl_Toggle_Tree(12, 12, select_slice_tree_scroll->w(), 10);}
625 code1 {select_slice_tree->callback(select_slice_tree_cb);select_slice_tree->user_data((void *)select_slice_tree_scroll);}
626 code2 {select_slice_w->resizable(select_slice_tree_scroll);}
627 code3 {select_slice_tree_scroll->resizable(select_slice_tree);}
628 class Fl_Scroll_Resize
632 label {Sfinx Data} open
633 xywh {200 315 866 370} type Double color 31 hide modal
637 callback {slices_w->hide();}
638 xywh {734 312 112 25} labeltype ENGRAVED_LABEL
642 callback {Fl_Toggle_Node *node = slices_tree->selected();
645 sfinx_slice_t *slice = (sfinx_slice_t *)node->user_data();
646 if (slice->id == 1) // Root Slice can't be deleted
648 // set safe deletion mode
649 slice_deletion_type_ch->value(0);
650 data_deletion_type_ch->value(0);
651 delete_sfinx_slice_to->value(slice->name());
652 delete_slice_w->show();}
653 xywh {454 312 128 25} labeltype ENGRAVED_LABEL
655 Fl_Scroll slices_tree_scroll {
656 xywh {15 13 837 280} box ENGRAVED_FRAME color 28
657 code0 {slices_tree = new Fl_Toggle_Tree(12, 12, slices_tree_scroll->w(), 10);}
658 code1 {slices_tree->callback(slices_tree_cb); slices_tree->user_data((void *)slices_tree_scroll);}
659 code2 {slices_w->resizable(slices_tree_scroll);}
660 code3 {slices_tree_scroll->resizable(slices_tree);}
661 class Fl_Scroll_Resize
665 callback {Fl_Toggle_Node *node = slices_tree->selected();
668 sfinx_slice_t *slice = (sfinx_slice_t *)node->user_data();
669 edit_slice_w->user_data((void *)slice);
670 app->sfinx.send(SFINX_EDIT_SLICE_REQUEST, (u32_t)slice->id);
671 edit_slice_w->label("Edit Sfinx Slice");}
672 xywh {305 312 128 25} labeltype ENGRAVED_LABEL
674 Fl_Output slices_status_to {
675 xywh {0 349 866 21} box PLASTIC_UP_BOX color 31 deactivate
679 callback {Fl_Toggle_Node *node = slices_tree->selected();
681 fl_alert("Please select slice connection point !");
684 edit_slice_w->user_data(0); // new slice
685 slice_name_i->value(0);
686 slice_directory_i->value(0);
687 slice_name_i->take_focus();
688 slice_description_i->value(0);
689 sfinx_slice_t *slice = (sfinx_slice_t *)slices_tree->selected()->user_data();
690 edit_slice_to->value(string(string("Parent slice: ") + slice->name()).c_str());
691 edit_slice_w->label("New Sfinx Slice");
692 edit_slice_w->show();}
693 xywh {21 312 112 25} labeltype ENGRAVED_LABEL
697 callback {Fl_Toggle_Node *node = slices_tree->selected();
700 sfinx_slice_t *slice = (sfinx_slice_t *)node->user_data();
701 if (slice->id == 1) // root slice can't be relinked
703 fill_objects_tree(select_slice_tree, SFINX_SLICE_OBJECT, slice, 0);
704 select_slice_b->user_data((void *)relink_slice_action);
705 select_slice_w->show();}
706 xywh {155 312 128 25} labeltype ENGRAVED_LABEL
710 callback {search_mi->do_callback(0, (void *)0);}
711 xywh {600 312 119 25} labeltype ENGRAVED_LABEL
714 Fl_Window edit_slice_w {
715 label {Edit Sfinx Slice}
716 xywh {276 319 595 330} type Double color 31 hide modal
718 Fl_Input slice_name_i {
720 xywh {47 35 496 26} color 29 labeltype ENGRAVED_LABEL align 1
722 Fl_Input slice_directory_i {
723 label {Slice Directory}
724 xywh {47 93 496 26} color 29 labeltype ENGRAVED_LABEL align 1
726 Fl_Input slice_description_i {
727 label {Slice Description}
728 xywh {34 158 523 89} type Multiline color 29 labeltype ENGRAVED_LABEL align 1
730 Fl_Return_Button {} {
732 callback {if (!slice_name_i->size()) {
733 fl_message("Missing slice name !");
736 sfinx_slice_t *eslice = (sfinx_slice_t *)edit_slice_w->user_data();
739 slice.tid(SFINX_EDIT_SLICE);
740 slice.id = eslice->id; // edited slice id
741 slice.parent_id = eslice->parent_id;
743 slice.tid(SFINX_NEW_SLICE);
744 sfinx_slice_t *s = (sfinx_slice_t *)(slices_tree->selected()->user_data());
745 slice.parent_id = s->id; // parent id for new slice
747 slice.name(slice_name_i->value());
748 slice.directory(slice_directory_i->value());
749 slice.description(slice_description_i->value());
750 app->sfinx.send(slice);
751 edit_slice_w->hide();
752 fill_objects_tree(slices_tree, 1 << SFINX_SLICE_OBJECT, 0, 1); // force refresh}
753 xywh {111 270 112 25} labeltype ENGRAVED_LABEL
757 callback {edit_slice_w->hide();}
758 xywh {359 270 112 25} labeltype ENGRAVED_LABEL
760 Fl_Output edit_slice_to {
761 xywh {0 312 598 21} box PLASTIC_UP_BOX color 31 labelsize 10 textsize 10
764 Fl_Window delete_slice_w {
765 label {Delete Sfinx Slice}
766 xywh {350 43 388 223} type Double color 31 hide modal
770 callback {delete_slice_w->hide();}
771 xywh {238 175 112 25} labeltype ENGRAVED_LABEL
775 callback {// need to confirm deletion ?!
776 bool recursivly = slice_deletion_type_ch->value();
777 sfinx_slice_t *slice = (sfinx_slice_t *)slices_tree->selected()->user_data();
778 app->sfinx.send(data_deletion_type_ch->value() ?
779 (recursivly ? SFINX_DELETE_SLICE_ASSOC_DATA_RECURSIVLY : SFINX_DELETE_SLICE_ASSOC_DATA) :
780 (recursivly ? SFINX_DELETE_SLICE_MARK_DATA_UNSORTED_RECURSIVLY : SFINX_DELETE_SLICE_MARK_DATA_UNSORTED),
782 app->sfinx.send(recursivly ? SFINX_DELETE_SLICE_RECURSIVLY : SFINX_DELETE_SLICE_WITH_REATTACH,
784 delete_slice_w->hide();
785 fill_objects_tree(slices_tree, 1 << SFINX_SLICE_OBJECT, 0, 1); // force refresh}
786 xywh {39 175 112 25} labeltype ENGRAVED_LABEL
788 Fl_Output delete_sfinx_slice_to {
789 label {Please confirm deletion of the slice}
790 xywh {35 31 330 26} box ENGRAVED_FRAME color 29 labeltype ENGRAVED_LABEL align 1
792 Fl_Choice slice_deletion_type_ch {
793 label {Slice && Data Deletion Action}
794 xywh {73 82 240 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 1
797 label {Attach subslices to parent}
801 label {Delete all subslices recursivly}
805 Fl_Choice data_deletion_type_ch {
806 label {Associated Data Deletion Action}
807 xywh {73 132 240 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 1
810 label {Mark all data 'Unsorted'}
814 label {Delete all data}
819 Fl_Window progress_w {
821 xywh {286 302 464 98} type Double hide
823 Fl_Progress progress_bar {
825 xywh {22 46 422 27} box PLASTIC_DOWN_BOX selection_color 2
828 label {Doing some work ...}
829 xywh {66 10 330 25} box FLAT_BOX labeltype ENGRAVED_LABEL
832 Fl_Window files_module_w {
834 xywh {87 152 730 370} type Double color 31 hide resizable
838 callback {files_module_w->hide();}
839 xywh {605 312 112 25} labeltype ENGRAVED_LABEL
841 Fl_Output files_module_status_to {
842 xywh {0 349 733 21} box PLASTIC_UP_BOX color 31
844 Fl_Button classify_file_b {
846 callback {int n = files_module_tree_br->value();
849 sfinx_file_t *file = ((sfinx_files_vector_t *)files_module_tree_br->user_data())->files[n - 1];
850 //debug("slice_id - %d, parent_id - %d, name - %s", current_files_module_tree_path.file_id, current_files_module_tree_path.mtag_slice_id,
851 // file->name.c_str());
853 //if (current_files_module_tree_path.tid() == SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST)
854 // app->files_module_conf.get(FILES_MODULE_UNSORTED_PATH, path);
856 // app->files_module_conf.get(FILES_MODULE_SORTED_TREE_PATH, path);
858 int eyear, emonth, eday, ehour, emin, esec, cyear, cmonth, cday, chour, cmin, csec;
859 file->etime.GetDate(eyear, emonth, eday);
860 file->etime.GetTime(ehour, emin, esec);
861 file->ctime.GetDate(cyear, cmonth, cday);
862 file->ctime.GetTime(chour, cmin, csec);
863 sprintf(buf, "%llu bytes | Modified: %02d/%02d/%04d %02d:%02d:%02d | Last Status Changed: %02d/%02d/%04d %02d:%02d:%02d", file->fsize, cday, cmonth,
864 cyear, chour, cmin, csec, eday, emonth, eyear, ehour, emin, esec);
865 string t = "URL: " + path + current_files_module_tree_path.name + "/" + file->name + " | " + file->mimetype + " | Size: " + buf;
866 classify_file_to->value(t.c_str());
867 file_title_i->value(0);
868 file_name_i->value(file->name.c_str());
869 // save orig file name
870 file->orig_name = file->name;
871 file->tid(SFINX_FILES_MODULE_CLASSIFY_REQUEST); // new file
872 file_title_i->take_focus();
873 file_authority_i->value(0);
874 file_description_i->value(0);
875 file_comments_i->value(0);
876 sorted_location_b->value(1);
877 file_compress_b->value(1);
878 file_gen_csum_b->value(1);
879 file_main_slice_b->label("Main Slice (Not Set)");
880 file_main_slice_b->user_data(0); // ÔÕÔÁ ÈÒÁÎÉÔÓÑ slice_id
881 file_additional_slices_br->clear();
882 classify_file_w->user_data((void *)file);
883 classify_file_w->show();}
884 xywh {21 312 112 25} labeltype ENGRAVED_LABEL
888 xywh {154 312 128 25} labeltype ENGRAVED_LABEL
890 Fl_Browser files_module_tree_br {
891 callback {if (!Fl::event_clicks())
893 sfinx_files_vector_t *tree = (sfinx_files_vector_t *) files_module_tree_br->user_data();
894 int n = files_module_tree_br->value();
895 //debug("selected %s file", tree->files[n - 1]->url.c_str());
896 if (tree->files[n - 1]->is_directory) { // ÀÚÅÒ ÓÍÅÎÉÌ ÄÉÒÅËÔÏÒÉÀ
897 // × file_id ÈÒÁÎÉÔÓÑ id ÔÅËÕÝÅÊ ÄÉÒÅËÔÏÒÉÉ-ÓÌÁÊÓÁ × ËÏÔÏÒÏÊ ÎÁÈÏÄÉÍÓÑ/×ÙÂÒÁÌÉ
898 // × mtag_id - parent_id ÄÉÒÅËÔÏÒÉÉ
899 // ÚÁÈÏÄÉÍ × ÄÉÒÅËÔÏÒÉÀ - ÔÅËÕÝÁÑ ÓÔÁÎÏ×ÉÔÓÑ parent'ÏÍ
900 current_files_module_tree_path.file_id = tree->files[n - 1]->file_id;
901 current_files_module_tree_path.mtag_id = tree->files[n - 1]->mtag_id;
902 // × name ÈÒÁÎÉÔÓÑ ×ÅÓØ ÐÕÔØ ÏÔ root location
903 // × orig_name ÔÏÌØËÏ ÉÍÑ ÔÅËÕÝÅÊ
904 string t = current_files_module_tree_path.name.c_str();
905 // current_files_module_tree_path.orig_name = tree->files[n - 1]->name;
906 t += ('/' + tree->files[n - 1]->name);
907 current_files_module_tree_path.name = t;
908 //debug("requesting dir %s", current_files_module_tree_path.c_str());
909 app->sfinx.send(current_files_module_tree_path);
911 if (!(tree->files[n - 1]->file_id)) // classify file
912 classify_file_b->do_callback();
914 // app->sfinx.send(SFINX_SLICES_MODULE_TREE_REQUEST, (u8_t)0); // prepare for slice_name() calls
915 sfinx_file_t *file = tree->files[n - 1];
916 file->tid(SFINX_FILES_MODULE_EDIT_REQUEST);
917 app->sfinx.send(file);
920 xywh {8 45 716 255} type Multi color 31 resizable
921 code0 {static int widths[] = { 10, 450, 200, 200, 0};}
922 code1 {files_module_tree_br->column_widths(widths);}
926 callback {int n = files_module_tree_br->value();
929 sfinx_file_t *file = ((sfinx_files_vector_t *)files_module_tree_br->user_data())->files[n - 1];
931 if (current_files_module_tree_path.tid() == SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST) {
933 string message = "Deleting \\'" + file->name + "\\'. Are you sure ?";
934 if (fl_choice(message.c_str(), "Yes", "No", 0L))
936 app->files_module_conf.get(FILES_MODULE_UNSORTED_PATH, path);
937 path += "/" + file->name;
938 sfinx_string_t f(SFINX_FILES_MODULE_UNLINK);
942 // sorted can be marked unsorted or deleted
943 string message = "Delete or Unsort \\'" + file->name + "\\' ?";
944 int res = fl_choice(message.c_str(), "Cancel", "Unsort", "Delete");
947 if (res == 2) { // delete
948 file->tid(SFINX_FILES_MODULE_SORTED_UNLINK);
949 app->sfinx.send(file);
951 file->tid(SFINX_FILES_MODULE_UNSORT);
952 app->sfinx.send(file);
955 //files_module_tree_br->remove(n);
956 app->sfinx.send(current_files_module_tree_path);}
957 xywh {300 312 112 25} labeltype ENGRAVED_LABEL
959 Fl_Button select_files_tree_b {
961 callback {files_module_tree_br->clear();
962 current_files_module_tree_path.name.clear();
963 current_files_module_tree_path.orig_name.clear();
964 if (select_files_tree_b->user_data()) {
965 select_files_tree_b->user_data(0);
966 select_files_tree_b->label("Sorted tree");
967 current_files_module_tree_path.tid(SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST);
968 current_files_module_tree_path.file_id = 0;
970 select_files_tree_b->user_data((void *)1);
971 select_files_tree_b->label("Unsorted tree");
972 // current_files_module_tree_path.tid(SFINX_FILES_MODULE_SORTED_TREE_REQUEST);
973 current_files_module_tree_path.file_id = 1; // root id
976 select_files_tree_b->redraw();
977 app->sfinx.send(current_files_module_tree_path);}
978 xywh {562 10 128 25} labeltype ENGRAVED_LABEL
982 callback {const char *p = strrchr(current_files_module_tree_path.name.c_str(), '/');
984 current_files_module_tree_path.name.clear();
988 strncat(path, current_files_module_tree_path.name.c_str(), p - current_files_module_tree_path.name.c_str());
989 current_files_module_tree_path.name = path;
990 current_files_module_tree_path.file_id = current_files_module_tree_path.mtag_id;
992 app->sfinx.send(current_files_module_tree_path);}
993 xywh {35 10 112 25} labeltype ENGRAVED_LABEL
997 callback {app->sfinx.send(current_files_module_tree_path);}
998 xywh {166 10 112 25} labeltype ENGRAVED_LABEL
1002 callback {for (int i = 1; i <= files_module_tree_br->size(); i++)
1003 files_module_tree_br->select(i);}
1004 xywh {295 10 112 25} labeltype ENGRAVED_LABEL
1007 label {Unselect All}
1008 callback {files_module_tree_br->deselect();}
1009 xywh {428 10 112 25} labeltype ENGRAVED_LABEL
1012 Fl_Window classify_file_w {
1013 label {Classify File}
1014 xywh {84 298 1020 515} type Double color 31 hide modal
1018 callback {classify_file_w->hide();}
1019 xywh {612 454 112 25} labeltype ENGRAVED_LABEL
1021 Fl_Input file_title_i {
1023 xywh {16 27 496 26} color 29 labeltype ENGRAVED_LABEL align 1
1025 Fl_Input file_authority_i {
1027 xywh {16 83 496 26} color 29 labeltype ENGRAVED_LABEL align 1
1029 Fl_Input file_description_i {
1031 xywh {549 78 447 101} type Multiline color 29 labeltype ENGRAVED_LABEL align 1
1033 Fl_Input file_comments_i {
1035 xywh {582 220 416 212} type Multiline color 29 labeltype ENGRAVED_LABEL align 1
1037 Fl_Output classify_file_to {
1038 xywh {0 497 1022 21} box PLASTIC_UP_BOX color 31 labelsize 10 textsize 10
1040 Fl_Return_Button {} {
1042 callback {if (!file_main_slice_b->user_data()) {
1043 fl_alert("You have to select Main Slice for file !");
1046 if (!file_name_i->size()) {
1047 fl_alert("File must have some name !");
1050 sfinx_file_t *file = (sfinx_file_t *)classify_file_w->user_data();
1051 // file->tid(SFINX_FILES_MODULE_CLASSIFY_REQUEST);
1052 file->name = file_name_i->value();
1053 file->title = file_title_i->value();
1054 file->authority = file_authority_i->value();
1055 file->description = file_description_i->value();
1056 file->comments = file_comments_i->value();
1057 file->sorted_location = sorted_location_b->value();
1058 file->store_compressed = file_compress_b->value();
1059 file->generate_csum = file_gen_csum_b->value();
1060 file->mtag_id = from_voidp(file_main_slice_b->user_data());
1061 file->objects.clear();
1062 for (int i = 1; i <= file_additional_slices_br->size(); i++) {
1063 // file->objects.push_back(from_voidp(file_additional_slices_br->data(i)));
1065 app->sfinx.send(file);}
1066 xywh {243 454 112 25} labeltype ENGRAVED_LABEL
1068 Fl_Check_Button sorted_location_b {
1069 label {Sorted Location}
1070 xywh {15 132 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16
1072 Fl_Check_Button file_crypt_b {
1074 xywh {15 165 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16 deactivate
1076 Fl_Check_Button file_compress_b {
1077 label {Store compressed}
1078 xywh {274 132 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16
1081 xywh {13 205 552 227} box ENGRAVED_FRAME
1083 Fl_Button file_main_slice_b {
1084 label {Main Slice (Not Set)}
1085 callback {app->refresh_slices();
1086 slices_w->user_data((void *)select_file_main_slice_action);
1088 tooltip {File Main Slice} xywh {45 226 489 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1090 Fl_Browser file_additional_slices_br {
1091 label {Additional Slices}
1092 xywh {26 275 525 102} type Multi color 46 labeltype ENGRAVED_LABEL align 1
1094 Fl_Button file_add_slice_b {
1096 callback {app->refresh_slices();
1097 slices_w->user_data((void *)select_file_additional_slice_action);
1099 xywh {82 391 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1101 Fl_Button file_remove_slice_b {
1102 label {Remove Slice}
1103 callback {for (int i = file_additional_slices_br->size(); i >= 1; i--) {
1104 if (file_additional_slices_br->selected(i))
1105 file_additional_slices_br->remove(i);
1107 xywh {358 391 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1109 Fl_Input file_name_i {
1111 xywh {549 26 447 26} color 29 labeltype ENGRAVED_LABEL align 1
1113 Fl_Check_Button file_gen_csum_b {
1114 label {Generate CSUM}
1115 xywh {274 165 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16
1118 Fl_Window search_w {
1120 xywh {169 380 749 389} type Double color 31 hide modal
1124 callback {search_w->hide();}
1125 xywh {182 347 363 25} box PLASTIC_ROUND_UP_BOX labeltype ENGRAVED_LABEL
1127 Fl_Return_Button {} {
1129 callback {sfinx_search_query_t query;
1130 query.pattern = search_i->value();
1131 if (search_in_files_b->value())
1132 query.add_area(SFINX_SEARCH_IN_FILES);
1133 // add restrictions ...
1134 app->sfinx.send(query);}
1135 xywh {539 48 163 25} box PLASTIC_ROUND_UP_BOX labeltype ENGRAVED_LABEL
1137 Fl_Check_Button search_in_files_b {
1138 label {Search in Files}
1139 xywh {48 96 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16 deactivate
1142 xywh {87 141 561 189} box ROUNDED_FRAME
1144 Fl_Browser search_slices_br {
1145 label {Restrict Search by Slices}
1146 xywh {105 173 525 102} type Multi color 46 labeltype ENGRAVED_LABEL align 1
1148 Fl_Button search_add_slice_b {
1150 callback {app->refresh_slices();
1151 slices_w->user_data((void *)search_add_slice_action);
1153 xywh {161 289 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1156 label {Remove Slice}
1157 callback {for (int i = search_slices_br->size(); i >= 1; i--) {
1158 if (search_slices_br->selected(i))
1159 search_slices_br->remove(i);
1161 xywh {437 289 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1164 label {Search for ...}
1165 xywh {46 47 447 26} color 29 labeltype ENGRAVED_LABEL align 1
1168 Fl_Window search_browser_w {
1169 label {Search Browser}
1170 xywh {217 305 854 476} type Double color 31 hide resizable modal
1174 callback {search_browser_w->hide();}
1175 xywh {638 449 187 20} box PLASTIC_ROUND_UP_BOX color 0 labeltype ENGRAVED_LABEL
1177 Fl_Browser search_browser_br {
1178 xywh {4 4 846 439} type Hold box GTK_THIN_UP_BOX color 44 resizable
1181 label {Previous Page}
1182 xywh {25 449 169 20} box PLASTIC_ROUND_UP_BOX color 0 labeltype ENGRAVED_LABEL
1186 xywh {231 449 169 20} box PLASTIC_ROUND_UP_BOX color 0 labeltype ENGRAVED_LABEL
1188 Fl_Choice goto_page_ch {
1189 label {Current Page }
1190 xywh {531 450 72 20} box PLASTIC_THIN_UP_BOX down_box PLASTIC_THIN_UP_BOX color 44 labeltype ENGRAVED_LABEL
1194 label {Notes Module} open
1195 xywh {272 69 730 370} type Double color 31 hide resizable
1199 callback {notes_w->hide();}
1200 xywh {605 312 112 25} labeltype ENGRAVED_LABEL
1202 Fl_Output notes_module_status_to {
1203 xywh {0 349 733 21} box PLASTIC_UP_BOX color 31
1207 callback {Fl_Toggle_Node *node = notes_tree->selected();
1209 fl_alert("Please select slice connection point !");
1212 sfinx_note_t *note = new sfinx_note_t(SFINX_NOTES_MODULE_ADD);
1213 edit_note_w->user_data((void *)note);
1214 sfinx_object_t *obj;
1215 if (node->can_open()) // slice
1216 obj = ((sfinx_slice_t *)node->user_data())->object();
1218 obj = (sfinx_object_t *) node->user_data();
1219 note_mtag_b->user_data(obj);
1220 note_mtag_b->copy_label((obj->name + " [ " + obj->description + " ]").c_str());
1221 note_mtag_b->redraw();
1222 note_name_i->value(0);
1223 note_url_i->value(0);
1224 note_text_i->value(0);
1225 note_name_i->take_focus();
1226 edit_note_w->show();}
1227 xywh {21 312 112 25} labeltype ENGRAVED_LABEL
1231 callback {Fl_Toggle_Node *node = notes_tree->selected();
1232 if (!node || node->can_open()) {
1233 fl_alert("Please select note to edit !");
1236 sfinx_object_t *obj = (sfinx_object_t *) node->user_data();
1237 if (obj->type != SFINX_NOTE_OBJECT)
1239 sfinx_note_t note(SFINX_NOTES_MODULE_EDIT_REQUEST);
1241 app->sfinx.send(note);}
1242 xywh {154 312 128 25} labeltype ENGRAVED_LABEL
1244 Fl_Scroll notes_tree_scroll {selected
1245 xywh {13 10 705 289} box ENGRAVED_FRAME color 28
1246 code0 {notes_tree = new Fl_Toggle_Tree(12, 12, notes_tree_scroll->w(), 10);}
1247 code1 {notes_tree->callback(notes_tree_cb); notes_tree->user_data((void *)notes_tree_scroll);}
1248 code2 {notes_w->resizable(notes_tree_scroll);}
1249 code3 {notes_tree_scroll->resizable(notes_tree);}
1250 class Fl_Scroll_Resize
1254 callback {Fl_Toggle_Node *node = notes_tree->selected();
1255 if (!node || node->can_open())
1257 sfinx_object_t *obj = (sfinx_object_t *) node->user_data();
1258 delete_sfinx_note_to->value(obj->name.c_str());
1259 delete_note_w->user_data(obj);
1260 delete_note_w->show();}
1261 xywh {300 312 112 25} labeltype ENGRAVED_LABEL
1264 Fl_Window edit_note_w {
1266 xywh {212 174 1020 385} type Double color 31 hide modal
1270 callback {edit_note_w->hide();}
1271 xywh {648 321 112 25} labeltype ENGRAVED_LABEL
1273 Fl_Input note_name_i {
1275 xywh {16 27 496 26} color 29 labeltype ENGRAVED_LABEL align 1
1277 Fl_Input note_url_i {
1279 xywh {16 83 496 26} color 29 labeltype ENGRAVED_LABEL align 1
1281 Fl_Input note_text_i {
1283 xywh {16 141 496 158} type Multiline color 29 labeltype ENGRAVED_LABEL align 1
1285 Fl_Output edit_note_to {
1286 xywh {0 364 1022 21} box PLASTIC_UP_BOX color 31 labelsize 10 textsize 10
1288 Fl_Return_Button {} {
1290 callback {if (!note_mtag_b->user_data()) {
1291 fl_alert("You have to select Main Object for note !");
1294 if (!note_name_i->size()) {
1295 fl_alert("Note must have some name !");
1298 if (!note_text_i->size()) {
1299 fl_alert("Note must have some text !");
1302 sfinx_note_t *note = (sfinx_note_t *)edit_note_w->user_data();
1303 note->name = note_name_i->value();
1304 note->url = note_url_i->value();
1305 note->text = note_text_i->value();
1306 sfinx_object_t *obj = (sfinx_object_t *)note_mtag_b->user_data();
1307 note->mtag.id = obj->id;
1308 note->mtag.type = obj->type;
1309 note->mtag.slice_id = obj->slice_id;
1310 note_mtag_b->user_data(0);
1312 for (int i = 1; i <= note_tags_br->size(); i++) {
1313 obj = (sfinx_object_t *)note_tags_br->data(i);
1314 note->tags.push_back(*obj);
1315 note_tags_br->data(i, 0);
1317 app->sfinx.send(note);
1319 edit_note_w->user_data(0);
1320 fill_objects_tree(notes_tree, 1 << SFINX_NOTE_OBJECT, 0, 1); // force refresh}
1321 xywh {279 321 112 25} labeltype ENGRAVED_LABEL
1324 xywh {535 72 467 227} box ENGRAVED_FRAME
1326 Fl_Button note_mtag_b {
1327 label {Main Note Tag (Not Set)}
1328 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 !
1329 slices_w->user_data((void *)select_note_mtag_action);
1331 tooltip {Note Main Tag} xywh {594 93 348 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1333 Fl_Browser note_tags_br {
1334 label {Additional Note Tags}
1335 xywh {559 146 420 102} type Multi color 46 labeltype ENGRAVED_LABEL align 1
1337 Fl_Button note_add_tag_b {
1339 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 !
1340 slices_w->user_data((void *)select_note_atag_action);
1342 xywh {584 258 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1344 Fl_Button note_remove_tag_b {
1346 callback {for (int i = note_tags_br->size(); i >= 1; i--) {
1347 if (note_tags_br->selected(i))
1348 note_tags_br->remove(i);
1350 xywh {811 258 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1352 Fl_Choice note_secured_ch {
1353 label {Secure Level}
1354 xywh {536 27 211 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 5 deactivate
1361 label {Crypted Text}
1366 Fl_Window delete_note_w {
1367 label {Delete Note} open
1368 xywh {44 182 388 168} type Double color 31 hide modal
1372 callback {delete_note_w->hide();}
1373 xywh {239 122 112 25} labeltype ENGRAVED_LABEL
1377 callback {sfinx_object_t *obj = (sfinx_object_t *) delete_note_w->user_data();
1378 sfinx_note_t note(note_deletion_type_ch->value() ? SFINX_NOTES_MODULE_UNLINK : SFINX_NOTES_MODULE_UNSORT);
1380 app->sfinx.send(note);
1381 delete_note_w->user_data(0);
1382 delete_note_w->hide();
1383 fill_objects_tree(notes_tree, (1 << SFINX_SLICE_OBJECT) | (1 << SFINX_NOTE_OBJECT), 0, 1); // force refresh}
1384 xywh {40 122 112 25} labeltype ENGRAVED_LABEL
1386 Fl_Output delete_sfinx_note_to {
1387 label {Please confirm deletion of the note}
1388 xywh {31 26 330 26} box ENGRAVED_FRAME color 29 labeltype ENGRAVED_LABEL align 1
1390 Fl_Choice note_deletion_type_ch {
1391 label {Associated Data Deletion Action}
1392 xywh {74 80 240 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 1
1395 label {Mark all data 'Unsorted'}
1399 label {Delete all data}
1405 xywh {357 229 374 154} type Double hide
1409 callback {about_w->hide();}
1410 xywh {72 122 226 20} box PLASTIC_ROUND_UP_BOX labeltype ENGRAVED_LABEL
1413 image {../docs/sfinx.jpg} xywh {10 9 130 101}
1417 xywh {203 6 99 33} labeltype EMBOSSED_LABEL labelfont 9 labelsize 32
1420 label {Personal knowledge manager}
1421 xywh {150 40 214 22} labeltype EMBOSSED_LABEL labelcolor 64
1424 label {Copyright (C) 2007 Rus V. Brushkoff}
1425 xywh {150 58 214 22} labeltype EMBOSSED_LABEL labelfont 8 labelsize 11 labelcolor 56
1428 label {Email: Rus@@Sfinx.Od.UA}
1429 xywh {150 75 214 22} labeltype EMBOSSED_LABEL labelfont 8 labelsize 11 labelcolor 56
1432 label {http://sfinx.od.ua/index.php?id=sfinx}
1433 xywh {150 93 214 22} labeltype EMBOSSED_LABEL labelfont 8 labelsize 11 labelcolor 56
1436 code {main_w->show();} {}
1439 Function {x11_ui::log(int level, const char *fmt, ...)} {return_type void
1441 code {char buf[10240];
1442 const char *level_str;
1447 ::va_start(args, fmt);
1450 case SFINX_LOG_NOTICE:
1451 level_str = "NOTICE";
1453 case SFINX_LOG_WARN:
1456 case SFINX_LOG_ERROR:
1457 level_str = "ERROR";
1459 case SFINX_LOG_FATAL:
1460 level_str = "FATAL";
1463 level_str = "UNKN_LEVEL";
1466 strcpy(buf, level_str);
1468 ::vsnprintf(buf + strlen(level_str) + 2, sizeof(buf) - (strlen(level_str) + 2), fmt, args);
1471 log_m.leaveMutex();} {}
1474 Function {x11_ui::edit_slice(sfinx_slice_t *slice)} {return_type void
1478 slice_name_i->value(slice->name());
1479 slice_directory_i->value(slice->directory());
1480 slice_name_i->take_focus();
1481 slice_description_i->value(slice->description());
1482 string status_line = "Parent slice: ";
1483 status_line += slice->parent_name();
1484 int cyear, cmonth, cday, eyear, emonth, eday, chour, cmin, csec, ehour, emin, esec;
1485 slice->ctime.GetDate(cyear, cmonth, cday);
1486 slice->etime.GetDate(eyear, emonth, eday);
1487 slice->ctime.GetTime(chour, cmin, csec);
1488 slice->etime.GetTime(ehour, emin, esec);
1490 sprintf(buf, " | Created at %02d/%02d/%02d %02d:%02d:%02d, Modified at %02d/%02d/%02d %02d:%02d:%02d", cyear, cmonth, cday, chour, cmin,
1491 csec, eyear, emonth, eday, ehour, emin, esec);
1493 edit_slice_to->value(status_line.c_str());
1494 edit_slice_w->show();
1498 Function {x11_ui::fill_preferences()} {return_type void
1502 app->files_module_conf.get(FILES_MODULE_UNSORTED_PATH, t);
1503 config_files_module_unsorted_path_i->value(t.c_str());
1504 app->files_module_conf.get(FILES_MODULE_SORTED_TREE_PATH, t);
1505 config_files_module_sorted_path_i->value(t.c_str());
1506 app->files_module_conf.get(FILES_MODULE_DESC_FILE_NAME, t);
1507 config_files_module_desc_file_name_i->value(t.c_str());
1508 u32_t gen_desc_files;
1509 app->files_module_conf.get(FILES_MODULE_DESC_FILE_ENABLE, &gen_desc_files);
1510 gen_desc_files_b->value(gen_desc_files);
1514 Function {x11_ui::fill_files_module_tree(sfinx_files_vector_t *tree_)} {return_type void
1517 static sfinx_files_vector_t tree;
1519 files_module_tree_br->user_data((void *)&tree);
1520 files_module_tree_br->clear();
1522 u32_t files = 0, dirs = 0;
1523 // set parent dir id
1524 if (tree.files.size())
1525 current_files_module_tree_path.mtag_id = tree.files[0]->compressed_fsize;
1526 for (u32_t i = 0; i < tree.files.size(); i++) {
1527 if (tree.files[i]->is_directory)
1528 strcpy(buf, "\\t@b@.");
1531 strncat(buf, tree.files[i]->name.c_str(), 50);
1533 if (tree.files[i]->is_directory) {
1534 strcpy(dir_len, "\\t@b@.< DIR >\\t");
1537 sprintf(dir_len, "\\t%llu\\t", tree.files[i]->fsize);
1540 strcat(buf, dir_len);
1541 int cyear, cmonth, cday, chour, cmin, csec;
1542 tree.files[i]->ctime.GetDate(cyear, cmonth, cday);
1543 tree.files[i]->ctime.GetTime(chour, cmin, csec);
1544 sprintf(dir_len, "%02d/%02d/%04d %02d:%02d:%02d\\t", cday, cmonth, cyear, chour, cmin, csec);
1545 strcat(buf, dir_len);
1546 strcat(buf, tree.files[i]->mimetype.c_str());
1547 files_module_tree_br->add(buf);
1549 files_module_tree_br->redraw();
1551 if (current_files_module_tree_path.tid() == SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST)
1552 app->files_module_conf.get(FILES_MODULE_UNSORTED_PATH, root);
1554 app->files_module_conf.get(FILES_MODULE_SORTED_TREE_PATH, root);
1555 sprintf(buf, "Path: %s | Total %d file%s and %d director%s", (root + current_files_module_tree_path.name.c_str()).c_str(), files, (files == 1) ? "" : "s", dirs,
1556 (dirs == 1) ? "y" : "ies");
1557 files_module_status_to->value(buf);
1558 files_module_status_to->redraw();
1562 Function {x11_ui::files_module_classify_reply(sfinx_string_t *classify_error)} {return_type void
1565 if (classify_error->size() == 1) {
1566 classify_file_w->hide();
1567 app->sfinx.send(current_files_module_tree_path);
1568 // files_module_tree_br->remove(files_module_tree_br->value());
1570 fl_alert(classify_error->c_str());
1574 Function {x11_ui::progress(sfinx_progress_t *p)} {return_type void
1577 static char buf[128];
1578 switch (p->status()) {
1579 case SFINX_PROGRESS_START:
1580 progress_l->label(p->label());
1581 strcpy(buf, p->strvalue());
1582 progress_bar->label(buf);
1583 progress_bar->minimum(0);
1584 progress_bar->maximum(p->max());
1585 progress_bar->value(p->value());
1587 progress_w->redraw();
1589 case SFINX_PROGRESS_END:
1592 case SFINX_PROGRESS_NONE:
1599 Function {x11_ui::alert(sfinx_string_t *alert)} {return_type void
1602 if (alert->size() != 1)
1603 fl_alert(alert->c_str());
1607 Function {x11_ui::notes_module_edit(sfinx_note_t *n)} {open return_type void
1610 sfinx_note_t *note = new sfinx_note_t;
1612 note->tid(SFINX_NOTES_MODULE_EDIT);
1613 edit_note_w->user_data((void *)note);
1615 int eyear, emonth, eday, ehour, emin, esec, cyear, cmonth, cday, chour, cmin, csec;
1616 note->etime.GetDate(eyear, emonth, eday);
1617 note->etime.GetTime(ehour, emin, esec);
1618 note->ctime.GetDate(cyear, cmonth, cday);
1619 note->ctime.GetTime(chour, cmin, csec);
1620 sprintf(buf, "Modified: %02d/%02d/%04d %02d:%02d:%02d | Last Status Changed: %02d/%02d/%04d %02d:%02d:%02d", cday, cmonth, cyear,
1621 chour, cmin, csec, eday, emonth, eyear, ehour, emin, esec);
1622 edit_note_to->value(buf);
1623 note_name_i->value(note->name.c_str());
1624 note_name_i->take_focus();
1625 note_url_i->value(note->url.c_str());
1626 note_text_i->value(note->text.c_str());
1628 note_mtag_b->user_data(&(note->mtag));
1629 note_mtag_b->copy_label((note->mtag.name + " [ " + note->mtag.description + " ]").c_str());
1630 note_mtag_b->redraw();
1632 note_tags_br->clear();
1633 for (u32_t i = 0; i < note->tags.size(); i++) {
1634 string s = note->tags[i].name + " [ " + note->tags[i].description + " ]";
1635 note_tags_br->add(s.c_str(), &(note->tags[i]));
1637 edit_note_w->show();
1641 Function {x11_ui::notes_module_reply(sfinx_string_t *classify_error)} {open return_type void
1644 if (classify_error->size() == 1) {
1645 ::fill_objects_tree(notes_tree, 1 << SFINX_NOTE_OBJECT, 0, 1); // fluid bugs if any default params exists !
1646 edit_note_w->hide();
1648 fl_alert(classify_error->c_str());
1652 Function {x11_ui::files_module_edit_reply(sfinx_string_t *classify_error)} {open return_type void
1655 if (classify_error->size() == 1) {
1656 app->sfinx.send(current_files_module_tree_path);
1657 classify_file_w->hide();
1659 fl_alert(classify_error->c_str());
1663 Function {x11_ui::files_module_edit(sfinx_file_t *f)} {open return_type void
1666 static sfinx_file_t file;
1669 int eyear, emonth, eday, ehour, emin, esec, cyear, cmonth, cday, chour, cmin, csec;
1670 file.etime.GetDate(eyear, emonth, eday);
1671 file.etime.GetTime(ehour, emin, esec);
1672 file.ctime.GetDate(cyear, cmonth, cday);
1673 file.ctime.GetTime(chour, cmin, csec);
1674 sprintf(buf, "%llu bytes | Modified: %02d/%02d/%04d %02d:%02d:%02d | Last Status Changed: %02d/%02d/%04d %02d:%02d:%02d", file.fsize, cday, cmonth, cyear,
1675 chour, cmin, csec, eday, emonth, eyear, ehour, emin, esec);
1677 if (current_files_module_tree_path.tid() == SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST)
1678 app->files_module_conf.get(FILES_MODULE_UNSORTED_PATH, path);
1680 app->files_module_conf.get(FILES_MODULE_SORTED_TREE_PATH, path);
1681 string t = "URL: " + path + current_files_module_tree_path.name + "/" + file.name + " | " + file.mimetype + " | Size: " + buf;
1682 classify_file_to->value(t.c_str());
1683 file_title_i->value(file.title.c_str());
1684 file_name_i->value(file.name.c_str());
1685 // save orig file name
1686 file.orig_name = file.name;
1687 file.tid(SFINX_FILES_MODULE_EDIT_FILE); // edit file
1688 file_title_i->take_focus();
1689 file_authority_i->value(file.authority.c_str());
1690 file_description_i->value(file.description.c_str());
1691 file_comments_i->value(file.comments.c_str());
1692 sorted_location_b->value(file.sorted_location);
1693 file_compress_b->value(file.store_compressed);
1694 file_gen_csum_b->value(file.generate_csum);
1695 static string main_slice_name;
1696 main_slice_name = app->slice_name(file.mtag_id);
1697 file_main_slice_b->label(main_slice_name.c_str());
1698 file_main_slice_b->user_data(to_voidp(file.mtag_id)); // ÔÕÔÁ ÈÒÁÎÉÔÓÑ mtag_slice_id
1699 file_additional_slices_br->clear();
1700 //for (u32_t i = 0; i < file.objects.size(); i++)
1701 // file_additional_slices_br->add((app->slice_name(file.objects[i]).c_str()), to_voidp(file.objects[i]));
1702 classify_file_w->user_data((void *)&file);
1703 classify_file_w->show();
1707 Function {x11_ui::search_browser(sfinx_pair_vector_t *r)} {return_type void
1710 search_browser_br->clear();
1712 search_browser_br->add("Sfinx has no data for this query");
1715 goto_page_ch->clear();
1716 /*for (u32_t i = 1; i < 50; i++) {
1718 sprintf(b, "%d", i);
1719 goto_page_ch->add(b, 0, 0, (void *)i);
1720 // Fl_Menu_Item *item = (Fl_Menu_Item *)(goto_page_ch->menu() + n);
1721 // item->color(FL_GREEN);
1723 goto_page_ch->value(0);
1724 //goto_page_ch->selection_color(FL_GREEN);
1727 for (u32_t i = 0; i < r->len(); i++) {
1728 sfinx_pair_t *p = r->find(i);
1732 if (!p->get(i, &el))
1736 prepare_search_info(el, inf);
1737 string::size_type pos = 0, found;
1738 while ((found = inf.find('\\n', pos)) != string::npos) {
1739 string line(inf, pos, found - pos);
1740 search_browser_br->add(line.c_str());
1743 search_browser_br->add("@-");
1746 search_browser_w->show();
1750 Function {x11_ui::prepare_search_info(sfinx_t *el, string &inf)} {return_type void
1752 code {sfinx_file_t *f;
1753 switch (el->tid()) {
1754 case SFINX_ELEMENT_FILE:
1755 f = (sfinx_file_t *)el;
1756 inf = "\\nType: File\\n";
1757 inf.append("Slice Hierarchy: " + app->slice_hierarchy(f->mtag_id) + "\\n");
1758 /* if (f->slices.size()) {
1759 inf.append("Additional Slices : ");
1760 for (u32_t i = 0; i < f->slices.size(); i++) {
1763 inf.append(app->slice_name(f->slices[i]));
1767 inf.append("Title: " + f->title + "\\n");
1768 inf.append("Authority: " + f->authority + "\\n");
1769 inf.append("Description: " + f->description + "\\n");
1770 inf.append("Comments: " + f->comments + "\\n");
1771 inf.append("Name: " + f->name + "\\n");
1773 sprintf(buf, "%llu bytes\\n", f->fsize);
1774 inf.append("Size: ");
1777 inf.append("Csum: " + f->csum + "\\n");
1778 sprintf(buf, "%llu bytes\\n", f->compressed_fsize);
1779 inf.append("Compressed Size: ");
1781 if (f->compressed_csum.size())
1782 inf.append("Compressed Csum: " + f->compressed_csum + "\\n");
1783 int year, month, day, hour, min, sec;
1784 f->ctime.GetDate(year, month, day);
1785 f->ctime.GetTime(hour, min, sec);
1786 sprintf(buf, "Create Entry Time: %02d/%02d/%04d %02d:%02d:%02d\\n", day, month, year, hour, min, sec);
1788 f->etime.GetDate(year, month, day);
1789 f->etime.GetTime(hour, min, sec);
1790 sprintf(buf, "Edit Entry Time: %02d/%02d/%04d %02d:%02d:%02d\\n", day, month, year, hour, min, sec);
1795 debug("Can't fill element info !");
1800 Function {x11_ui::fill_objects_tree()} {open return_type void
1803 Fl_Toggle_Tree *tree = fill_tree;
1804 u32_t mask = fill_tree_mask;
1807 mask = SFINX_SLICE_OBJECT;
1810 tree->draw_lines(1);
1811 tree->alternate_color(FL_LIGHT2);
1812 tree->trim_color(FL_LIGHT1);
1813 tree->edit_on_reselect(0);
1814 sfinx_slice_t *slice;
1815 Fl_Toggle_Node *node;
1816 u32_t max_name_len = 0;
1817 for (u32_t i = 0; i < app->slices.len(); i++) {
1818 slice = app->slices.get(i);
1819 if (slice == fill_tree_except)
1821 //debug("slice name - %s, id - %lld, parent_id - %lld", slice->name(), slice->id, slice->parent_id);
1822 string name = slice->name() + string(" [ ") +
1823 slice->description() + string(" ]");
1824 // replace \\n with spaces
1825 string filt_elems( "\\n");
1826 string::size_type pos = 0;
1827 while (( pos = name.find_first_of(filt_elems, pos)) != string::npos)
1828 name.replace(pos, 1, string(" "));
1829 if (name.size() > max_name_len)
1830 max_name_len = name.size();
1831 if (!slice->parent_id) {
1832 node = tree->add_sub((char *)name.c_str(), 1, &slice_pixmap, to_voidp(slice));
1833 if (fill_tree_mask & (1 << SFINX_NOTE_OBJECT)) {
1836 for (u32_t x = 0; x < slice->objs.size(); x++) {
1837 tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, ¬e_pixmap,
1838 to_voidp(&(slice->objs[x])));
1839 tree->traverse_up();
1843 node = tree->traverse_start();
1845 sfinx_slice_t *s = (sfinx_slice_t *) node->user_data();
1846 if (s->id == slice->parent_id)
1848 node = tree->traverse_forward();
1852 node = tree->add_sub((char *)name.c_str(), 1, &slice_pixmap, to_voidp(slice));
1853 if (fill_tree_mask & (1 << SFINX_NOTE_OBJECT)) {
1856 for (u32_t x = 0; x < slice->objs.size(); x++) {
1857 tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, ¬e_pixmap,
1858 to_voidp(&(slice->objs[x])));
1859 tree->traverse_up();
1862 } // node not found - just ignore
1865 s32_t width = max_name_len * 8;
1866 // need to count depth for width update
1867 Fl_Scroll_Resize *tree_scroll = (Fl_Scroll_Resize *) tree->user_data();
1868 if (!tree_scroll) // he, forgot to set ;)
1870 tree->resize(tree->x(), tree->y(), width > tree_scroll->w() ? width : tree_scroll->w(), tree->h());
1871 // try to select previous node
1872 //node = slices_tree->find(to_voidp(current_slice_id));
1874 // slices_tree->select_range(node, node);