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 {\#include "file.xpm"} {}
29 decl {Fl_Pixmap slice_pixmap(slice_xpm_data);} {}
31 decl {Fl_Pixmap note_pixmap(note_xpm_data);} {}
33 decl {Fl_Pixmap file_pixmap(file_xpm_data);} {}
35 decl {Fl_Toggle_Tree *config_tree;} {global
38 decl {Fl_Toggle_Tree *slices_tree;} {global
41 decl {Fl_Toggle_Tree *select_slice_tree;} {global
44 decl {Fl_Toggle_Tree *notes_tree;} {global
47 decl {Fl_Toggle_Tree *files_tree;} {global
50 decl {Fl_Toggle_Tree *fill_tree;} {}
52 decl {sfinx_slice_t *fill_tree_except;} {global
55 decl {u32_t fill_tree_mask;} {global
58 decl {sfinx_file_t current_file(SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST);} {}
60 Function {fill_objects_tree(Fl_Toggle_Tree *ft, u32_t m, sfinx_slice_t *except, bool force)} {private return_type void
64 fill_tree_except = except;
65 app->refresh_slices(force);} {}
68 Function {relink_slice_action()} {private return_type void
70 code {sfinx_slice_t slice(SFINX_SLICE_RELINK);
71 // slice to be relinked
72 Fl_Toggle_Node *node = slices_tree->selected();
75 Fl_Toggle_Node *snode = select_slice_tree->selected();
78 sfinx_slice_t *selected = (sfinx_slice_t *)snode->user_data();
79 sfinx_slice_t *rslice = (sfinx_slice_t *)node->user_data();
80 slice.id = rslice->id;
82 slice.parent_id = selected->id;
83 debug("moving from %lld to %lld", rslice->parent_id, selected->id);
84 app->sfinx.send(slice);
85 fill_objects_tree(slices_tree, SFINX_SLICE_OBJECT, 0, 1); // force refresh} {}
88 Function {select_note_atag_action()} {private return_type void
90 code {sfinx_object_t *obj;
91 Fl_Toggle_Node *node = slices_tree->selected();
94 if (node->can_open()) // slice
95 obj = ((sfinx_slice_t *)node->user_data())->object();
97 obj = (sfinx_object_t *)node->user_data();
98 Fl_Toggle_Node *snode = notes_tree->selected();
99 sfinx_object_t *sobj = (sfinx_object_t *)snode->user_data();
100 if (sobj == obj) // try to self tag
102 if (note_mtag_b->user_data() && !obj->cmp((sfinx_object_t *)note_mtag_b->user_data())) // already set as main tag
104 for (int i = 1; i <= note_tags_br->size(); i++) {
105 if (!obj->cmp((sfinx_object_t *)note_tags_br->data(i))) // already set as additional tag
108 string s = obj->name + " [ " + obj->description + " ]";
109 note_tags_br->add(s.c_str(), obj);
110 note_tags_br->redraw();} {}
113 Function {select_note_mtag_action()} {private return_type void
115 code {sfinx_object_t *obj;
116 Fl_Toggle_Node *node = slices_tree->selected();
119 if (node->can_open()) // slice
120 obj = ((sfinx_slice_t *)node->user_data())->object();
122 obj = (sfinx_object_t *)node->user_data();
123 Fl_Toggle_Node *snode = notes_tree->selected();
124 sfinx_object_t *sobj = (sfinx_object_t *)snode->user_data();
125 if (sobj == obj) // try to self tag
127 note_mtag_b->user_data(obj);
128 note_mtag_b->copy_label((obj->name + " [ " + obj->description + " ]").c_str());
129 note_mtag_b->redraw();
130 // check for additional slices if it is here - remove it
131 for (int i = 1; i <= note_tags_br->size(); i++) {
132 if (!obj->cmp((sfinx_object_t *)note_tags_br->data(i))) {
133 note_tags_br->remove(i);
139 Function {select_file_mtag_action()} {open private return_type void
141 code {sfinx_object_t *obj;
142 Fl_Toggle_Node *node = select_slice_tree->selected();
145 if (node->can_open()) // slice
146 obj = ((sfinx_slice_t *)node->user_data())->object();
148 obj = (sfinx_object_t *)node->user_data();
149 file_mtag_b->user_data(obj);
150 file_mtag_b->copy_label((obj->name + " [ " + obj->description + " ]").c_str());
151 file_mtag_b->redraw();
152 // check for additional tags if it is here - remove it
153 for (int i = 1; i <= file_tags_br->size(); i++) {
154 if (!obj->cmp((sfinx_object_t *)file_tags_br->data(i))) {
155 file_tags_br->remove(i);
161 Function {select_file_atag_action()} {open private return_type void
163 code {sfinx_object_t *obj;
164 Fl_Toggle_Node *node = select_slice_tree->selected();
168 if (node->can_open()) { // slice
169 obj = ((sfinx_slice_t *)node->user_data())->object();
170 s = obj->name + " [ " + obj->description + " ]";
172 obj = (sfinx_object_t *)node->user_data();
173 s = obj->name + obj->description;
175 if (file_mtag_b->user_data() && !obj->cmp((sfinx_object_t *)file_mtag_b->user_data())) // already set as main tag
177 for (int i = 1; i <= file_tags_br->size(); i++) {
178 if (!obj->cmp((sfinx_object_t *)file_tags_br->data(i))) // already set as additional tag
181 file_tags_br->add(s.c_str(), obj);
182 file_tags_br->redraw();} {}
185 Function {search_add_slice_action()} {private return_type void
187 code {for (int i = 1; i <= search_slices_br->size(); i++) {
188 // if (search_slices_br->data(i) == to_voidp(current_slice_id))
191 //sfinx_slice_t *slice = (sfinx_slice_t *)slices_tree->selected()->user_data();
192 //search_slices_br->add(slice->name(), to_voidp(current_slice_id));
193 search_slices_br->redraw();} {}
196 Function {slices_tree_cb(Fl_Widget *, void *)} {private return_type void
198 code {Fl_Toggle_Node *node = slices_tree->selected();
201 if (!Fl::event_clicks())
203 void (*select_slice_action)(void) = (void (*)())(slices_w->user_data());
204 if (select_slice_action) {
206 slices_w->user_data(0);
207 select_slice_action();
211 Function {notes_tree_cb(Fl_Widget *, void *)} {private return_type void
213 code {Fl_Toggle_Node *node = notes_tree->selected();
216 //current_note_id = from_voidp(node->user_data());
217 //current_slice_name = node->label();
218 if (!Fl::event_clicks())
220 void (*select_note_action)(void) = (void (*)())(notes_w->user_data());
221 if (select_note_action) {
222 notes_w->user_data(0);
223 select_note_action();
227 Function {files_tree_cb(Fl_Widget *, void *)} {private return_type void
229 code {Fl_Toggle_Node *node = files_tree->selected();
232 if (!Fl::event_clicks())
234 void (*select_file_action)(void) = (void (*)())(files_module_w->user_data());
235 if (select_file_action) {
236 files_module_w->user_data(0);
237 select_file_action();
241 Function {select_slice_tree_cb(Fl_Widget *, void *)} {private return_type void
243 code {if (!Fl::event_clicks())
245 select_slice_b->do_callback();} {}
248 Function {write_preferences()} {private return_type void
250 code {app->server_name = config_sfinx_server_name_i->value();
251 app->files_module_conf.clear();
252 app->files_module_conf.add(FILES_MODULE_UNSORTED_PATH,
253 config_files_module_unsorted_path_i->value());
254 app->files_module_conf.add(FILES_MODULE_SORTED_TREE_PATH,
255 config_files_module_sorted_path_i->value());
256 app->files_module_conf.add(FILES_MODULE_DESC_FILE_NAME,
257 config_files_module_desc_file_name_i->value());
258 app->files_module_conf.add(FILES_MODULE_DESC_FILE_ENABLE,
259 gen_desc_files_b->value());
260 app->write_preferences();} {}
263 Function {config_tree_cb(Fl_Widget *, void *)} {private return_type void
265 code {static Fl_Group *prev_group;
266 Fl_Toggle_Node *node = config_tree->selected();
268 Fl_Group *gr = *((Fl_Group **)(node->user_data()));
273 //config_tree->unselect();
277 Function {fill_config_tree()} {private return_type void
279 code {config_tree->add_next("Connection", 0, 0, (void *)&config_connection_gr);
280 config_tree->add_next("Files Module", 0, 0, (void *)&config_files_module_gr);
281 config_tree->add_next("Confirmation", 0, 0, (void *)&config_confirmation_gr);
282 config_tree->callback(config_tree_cb);
283 config_tree->edit_on_reselect(0);} {}
286 Function {x11_ui::init()} {open return_type void
290 callback {if (fl_choice("Really quit ?", "No", "Yes", 0L))
291 F::shutdown(0);} open
292 xywh {171 126 945 365} type Double hide
299 xywh {0 0 67 22} labeltype ENGRAVED_LABEL
302 label {Connect to ...}
303 xywh {0 0 34 22} shortcut 0x80063 labeltype ENGRAVED_LABEL deactivate
306 label {Connect to default server}
307 xywh {10 10 34 22} labeltype ENGRAVED_LABEL deactivate
310 label {Disconnect from Sfinx}
311 xywh {10 10 34 22} labeltype ENGRAVED_LABEL deactivate
314 label {Connection Info}
315 xywh {20 20 34 22} shortcut 0x80069 labeltype ENGRAVED_LABEL deactivate
319 xywh {30 30 34 22} labeltype ENGRAVED_LABEL deactivate divider
323 callback {app->read_preferences();
324 config_sfinx_server_name_i->value(app->server_name.c_str());
325 preferences_w->show();}
326 xywh {30 30 34 22} shortcut 0x80070 labeltype ENGRAVED_LABEL divider
330 callback {if (fl_choice("Really quit ?", "No", "Yes", 0L))
332 xywh {20 20 34 22} shortcut 0x80078 labeltype ENGRAVED_LABEL
337 xywh {10 10 67 22} labeltype ENGRAVED_LABEL
341 callback {if (!app->connected()) {
342 fl_message("Not connected to Sfinx Server !");
345 xywh {10 10 34 22} shortcut 0x61 labeltype ENGRAVED_LABEL deactivate
349 callback {if (!app->connected()) {
350 fl_message("Not connected to Sfinx Server !");
353 fill_objects_tree(slices_tree, 1 << SFINX_SLICE_OBJECT, 0, 0); // fluid bugs if any default params exists !
355 xywh {10 10 34 22} shortcut 0x73 labeltype ENGRAVED_LABEL
358 label {Knowledge Module}
359 callback {if (!app->connected()) {
360 fl_message("Not connected to Sfinx Server !");
363 xywh {40 40 34 22} shortcut 0x6b labeltype ENGRAVED_LABEL deactivate
367 callback {if (!app->connected()) {
368 fl_message("Not connected to Sfinx Server !");
371 xywh {40 40 34 22} shortcut 0x74 labeltype ENGRAVED_LABEL deactivate
375 callback {if (!app->connected()) {
376 fl_message("Not connected to Sfinx Server !");
379 xywh {40 40 34 22} shortcut 0x6d labeltype ENGRAVED_LABEL deactivate
383 callback {if (!app->connected()) {
384 fl_message("Not connected to Sfinx Server !");
387 xywh {50 50 34 22} shortcut 0x63 labeltype ENGRAVED_LABEL deactivate
391 callback {if (!app->connected()) {
392 fl_message("Not connected to Sfinx Server !");
395 xywh {40 40 34 22} shortcut 0x65 labeltype ENGRAVED_LABEL deactivate
399 callback {if (!app->connected()) {
400 fl_message("Not connected to Sfinx Server !");
403 if (app->sfinx.send(current_file))
405 files_module_w->show();}
406 xywh {20 20 34 22} shortcut 0x66 labeltype ENGRAVED_LABEL
410 callback {if (!app->connected()) {
411 fl_message("Not connected to Sfinx Server !");
414 // ÒÉÓÕÅÍ ÄÅÒÅ×Ï ÚÁÍÅÔÏË
415 fill_objects_tree(notes_tree, 1 << SFINX_NOTE_OBJECT, 0, 0); // fluid bugs if any default params exists !
417 xywh {30 30 34 22} shortcut 0x6e labeltype ENGRAVED_LABEL
422 xywh {20 20 67 22} labeltype ENGRAVED_LABEL
425 label {Browser && Searcher}
426 callback {if (!app->connected()) {
427 fl_message("Not connected to Sfinx Server !");
430 search_i->take_focus();
432 xywh {30 30 34 22} shortcut 0x62 labeltype ENGRAVED_LABEL
436 callback {if (!app->connected()) {
437 fl_message("Not connected to Sfinx Server !");
440 xywh {30 30 34 22} shortcut 0x72 labeltype ENGRAVED_LABEL deactivate divider
444 callback {if (!app->connected()) {
445 fl_message("Not connected to Sfinx Server !");
448 xywh {40 40 34 22} shortcut 0x40061 labeltype ENGRAVED_LABEL deactivate
451 label {Knowledge Tracer}
452 callback {if (!app->connected()) {
453 fl_message("Not connected to Sfinx Server !");
456 xywh {40 40 34 22} shortcut 0x4006b labeltype ENGRAVED_LABEL deactivate
459 label {Indexing machine}
460 callback {if (!app->connected()) {
461 fl_message("Not connected to Sfinx Server !");
464 xywh {30 30 34 22} shortcut 0x40069 labeltype ENGRAVED_LABEL deactivate
467 label {Check Sfinx DB}
468 callback {if (!app->connected()) {
469 fl_message("Not connected to Sfinx Server !");
472 xywh {40 40 34 22} shortcut 0x40064 labeltype ENGRAVED_LABEL deactivate
476 callback {if (!app->connected()) {
477 fl_message("Not connected to Sfinx Server !");
480 xywh {30 30 34 22} shortcut 0x40062 labeltype ENGRAVED_LABEL deactivate divider
483 label {Clear log window}
484 callback {log_br->clear();}
485 xywh {30 30 34 22} shortcut 0x10063 labeltype ENGRAVED_LABEL
490 xywh {20 20 67 22} labeltype ENGRAVED_LABEL deactivate
494 xywh {20 20 67 22} labeltype ENGRAVED_LABEL
498 xywh {30 30 34 22} shortcut 0xffbe labeltype ENGRAVED_LABEL deactivate divider
502 callback {about_w->show();}
503 xywh {30 30 34 22} shortcut 0x80061 labeltype ENGRAVED_LABEL
507 Fl_Output status_bar_o {
508 tooltip Status xywh {0 347 945 20} box PLASTIC_UP_BOX color 31 deactivate
511 xywh {-1 21 948 326} type Select color 31 labelfont 4 textfont 4
514 Fl_Window preferences_w {
516 xywh {215 308 742 373} type Double color 31 hide
520 callback {preferences_w->hide();}
521 xywh {390 330 112 25} labeltype ENGRAVED_LABEL
525 callback {write_preferences();
526 preferences_w->hide();}
527 xywh {572 330 112 25} labeltype ENGRAVED_LABEL
529 Fl_Scroll prefs_tree_scroll {
530 xywh {10 29 173 283} type VERTICAL_ALWAYS box ENGRAVED_FRAME color 28
531 code0 {config_tree = new Fl_Toggle_Tree(12, 12, prefs_tree_scroll->w() - prefs_tree_scroll->scrollbar.w(), 10);}
532 code1 {fill_config_tree();}
534 Fl_Group config_connection_gr {open
535 xywh {183 19 535 283} box ENGRAVED_FRAME hide
537 Fl_Input config_sfinx_server_name_i {
538 label {Sfinx Server Name}
539 xywh {273 89 375 26} color 29 labeltype ENGRAVED_LABEL align 1
542 label {Minimum Auth Level}
543 xywh {227 179 211 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 5 deactivate
546 label {User Name && Passsword}
555 label {Minimum Debug Level}
556 xywh {227 230 211 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 5 deactivate
575 label {Warning Level}
587 label {Critical Level}
596 label {Minimum Crypt Level}
597 xywh {476 179 211 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 5 deactivate
609 Fl_Group config_files_module_gr {
610 xywh {193 29 535 283} box ENGRAVED_FRAME hide
612 Fl_Input config_files_module_unsorted_path_i {
613 label {Unsorted files path on Sfinx server}
614 xywh {283 68 375 26} color 29 labeltype ENGRAVED_LABEL align 1
616 Fl_Input config_files_module_sorted_path_i {
617 label {Sorted file tree path on Sfinx server}
618 xywh {283 128 375 26} color 29 labeltype ENGRAVED_LABEL align 1
620 Fl_Check_Button gen_desc_files_b {
621 label {Generate description files}
622 xywh {209 233 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16
624 Fl_Input config_files_module_desc_file_name_i {
625 label {Description file name}
626 xywh {283 189 375 26} color 29 labeltype ENGRAVED_LABEL align 1
628 Fl_Check_Button process_files_mime_type_b {
629 label {Detect files MIME type}
630 xywh {472 233 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16
633 Fl_Group config_confirmation_gr {
634 xywh {183 19 535 283} box ENGRAVED_FRAME hide
636 Fl_Check_Button exit_confirm_b {
638 xywh {216 45 204 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL deactivate
642 Fl_Window select_slice_w {
643 label {Select Sfinx Slice}
644 xywh {67 62 730 352} type Double color 31 hide modal
648 callback {select_slice_w->hide();}
649 xywh {594 312 112 25} box PLASTIC_UP_BOX labeltype ENGRAVED_LABEL
651 Fl_Button select_slice_b {
653 callback {Fl_Toggle_Node *node = select_slice_tree->selected();
656 void (*select_slice_action)() = (void (*)())(select_slice_w->user_data());
657 if (select_slice_action) {
658 select_slice_w->user_data(0);
659 select_slice_action();
661 select_slice_w->hide();}
662 xywh {16 312 548 25} box PLASTIC_UP_BOX labeltype ENGRAVED_LABEL
664 Fl_Scroll select_slice_tree_scroll {open
665 xywh {15 15 702 280} box ENGRAVED_FRAME color 28
666 code0 {select_slice_tree = new Fl_Toggle_Tree(12, 12, select_slice_tree_scroll->w(), 10);}
667 code1 {select_slice_tree->callback(select_slice_tree_cb);select_slice_tree->user_data((void *)select_slice_tree_scroll);}
668 code2 {select_slice_w->resizable(select_slice_tree_scroll);}
669 code3 {select_slice_tree_scroll->resizable(select_slice_tree);}
670 class Fl_Scroll_Resize
675 xywh {200 315 866 370} type Double color 31 hide modal
679 callback {slices_w->hide();}
680 xywh {734 312 112 25} labeltype ENGRAVED_LABEL
684 callback {Fl_Toggle_Node *node = slices_tree->selected();
687 sfinx_slice_t *slice = (sfinx_slice_t *)node->user_data();
688 if (slice->id == 1) // Root Slice can't be deleted
690 // set safe deletion mode
691 slice_deletion_type_ch->value(0);
692 data_deletion_type_ch->value(0);
693 delete_sfinx_slice_to->value(slice->name());
694 delete_slice_w->show();}
695 xywh {454 312 128 25} labeltype ENGRAVED_LABEL
697 Fl_Scroll slices_tree_scroll {
698 xywh {15 13 837 280} box ENGRAVED_FRAME color 28
699 code0 {slices_tree = new Fl_Toggle_Tree(12, 12, slices_tree_scroll->w(), 10);}
700 code1 {slices_tree->callback(slices_tree_cb); slices_tree->user_data((void *)slices_tree_scroll);}
701 code2 {slices_w->resizable(slices_tree_scroll);}
702 code3 {slices_tree_scroll->resizable(slices_tree);}
703 class Fl_Scroll_Resize
707 callback {Fl_Toggle_Node *node = slices_tree->selected();
710 sfinx_slice_t *slice = (sfinx_slice_t *)node->user_data();
711 edit_slice_w->user_data((void *)slice);
712 app->sfinx.send(SFINX_EDIT_SLICE_REQUEST, (u32_t)slice->id);
713 edit_slice_w->label("Edit Sfinx Slice");}
714 xywh {305 312 128 25} labeltype ENGRAVED_LABEL
716 Fl_Output slices_status_to {
717 xywh {0 349 866 21} box PLASTIC_UP_BOX color 31 deactivate
721 callback {Fl_Toggle_Node *node = slices_tree->selected();
723 fl_alert("Please select slice connection point !");
726 edit_slice_w->user_data(0); // new slice
727 slice_name_i->value(0);
728 slice_directory_i->value(0);
729 slice_name_i->take_focus();
730 slice_description_i->value(0);
731 sfinx_slice_t *slice = (sfinx_slice_t *)slices_tree->selected()->user_data();
732 edit_slice_to->value(string(string("Parent slice: ") + slice->name()).c_str());
733 edit_slice_w->label("New Sfinx Slice");
734 edit_slice_w->show();}
735 xywh {21 312 112 25} labeltype ENGRAVED_LABEL
739 callback {Fl_Toggle_Node *node = slices_tree->selected();
742 sfinx_slice_t *slice = (sfinx_slice_t *)node->user_data();
743 if (slice->id == 1) // root slice can't be relinked
745 fill_objects_tree(select_slice_tree, SFINX_SLICE_OBJECT, slice, 0);
746 select_slice_w->user_data((void *)relink_slice_action);
747 select_slice_w->show();}
748 xywh {155 312 128 25} labeltype ENGRAVED_LABEL
752 callback {search_mi->do_callback(0, (void *)0);}
753 xywh {600 312 119 25} labeltype ENGRAVED_LABEL
756 Fl_Window edit_slice_w {
757 label {Edit Sfinx Slice}
758 xywh {276 319 595 330} type Double color 31 hide modal
760 Fl_Input slice_name_i {
762 xywh {47 35 496 26} color 29 labeltype ENGRAVED_LABEL align 1
764 Fl_Input slice_directory_i {
765 label {Slice Directory}
766 xywh {47 93 496 26} color 29 labeltype ENGRAVED_LABEL align 1
768 Fl_Input slice_description_i {
769 label {Slice Description}
770 xywh {34 158 523 89} type Multiline color 29 labeltype ENGRAVED_LABEL align 1
772 Fl_Return_Button {} {
774 callback {if (!slice_name_i->size()) {
775 fl_message("Missing slice name !");
778 sfinx_slice_t *eslice = (sfinx_slice_t *)edit_slice_w->user_data();
781 slice.tid(SFINX_EDIT_SLICE);
782 slice.id = eslice->id; // edited slice id
783 slice.parent_id = eslice->parent_id;
785 slice.tid(SFINX_NEW_SLICE);
786 sfinx_slice_t *s = (sfinx_slice_t *)(slices_tree->selected()->user_data());
787 slice.parent_id = s->id; // parent id for new slice
789 slice.name(slice_name_i->value());
790 slice.directory(slice_directory_i->value());
791 slice.description(slice_description_i->value());
792 app->sfinx.send(slice);
793 edit_slice_w->hide();
794 fill_objects_tree(slices_tree, 1 << SFINX_SLICE_OBJECT, 0, 1); // force refresh}
795 xywh {111 270 112 25} labeltype ENGRAVED_LABEL
799 callback {edit_slice_w->hide();}
800 xywh {359 270 112 25} labeltype ENGRAVED_LABEL
802 Fl_Output edit_slice_to {
803 xywh {0 312 598 21} box PLASTIC_UP_BOX color 31 labelsize 10 textsize 10
806 Fl_Window delete_slice_w {
807 label {Delete Sfinx Slice}
808 xywh {350 43 388 223} type Double color 31 hide modal
812 callback {delete_slice_w->hide();}
813 xywh {238 175 112 25} labeltype ENGRAVED_LABEL
817 callback {// need to confirm deletion ?!
818 bool recursivly = slice_deletion_type_ch->value();
819 sfinx_slice_t *slice = (sfinx_slice_t *)slices_tree->selected()->user_data();
820 app->sfinx.send(data_deletion_type_ch->value() ?
821 (recursivly ? SFINX_DELETE_SLICE_ASSOC_DATA_RECURSIVLY : SFINX_DELETE_SLICE_ASSOC_DATA) :
822 (recursivly ? SFINX_DELETE_SLICE_MARK_DATA_UNSORTED_RECURSIVLY : SFINX_DELETE_SLICE_MARK_DATA_UNSORTED),
824 app->sfinx.send(recursivly ? SFINX_DELETE_SLICE_RECURSIVLY : SFINX_DELETE_SLICE_WITH_REATTACH,
826 delete_slice_w->hide();
827 fill_objects_tree(slices_tree, 1 << SFINX_SLICE_OBJECT, 0, 1); // force refresh}
828 xywh {39 175 112 25} labeltype ENGRAVED_LABEL
830 Fl_Output delete_sfinx_slice_to {
831 label {Please confirm deletion of the slice}
832 xywh {35 31 330 26} box ENGRAVED_FRAME color 29 labeltype ENGRAVED_LABEL align 1
834 Fl_Choice slice_deletion_type_ch {
835 label {Slice && Data Deletion Action}
836 xywh {73 82 240 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 1
839 label {Attach subslices to parent}
843 label {Delete all subslices recursivly}
847 Fl_Choice data_deletion_type_ch {
848 label {Associated Data Deletion Action}
849 xywh {73 132 240 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 1
852 label {Mark all data 'Unsorted'}
856 label {Delete all data}
861 Fl_Window progress_w {
863 xywh {286 302 464 98} type Double hide
865 Fl_Progress progress_bar {
867 xywh {22 46 422 27} box PLASTIC_DOWN_BOX selection_color 2
870 label {Doing some work ...}
871 xywh {66 10 330 25} box FLAT_BOX labeltype ENGRAVED_LABEL
874 Fl_Window files_module_w {
875 label {Files Module} open
876 xywh {87 152 730 370} type Double color 31 hide resizable
880 callback {files_module_w->hide();}
881 xywh {605 312 112 25} labeltype ENGRAVED_LABEL
883 Fl_Output files_module_status_to {
884 xywh {0 349 733 21} box PLASTIC_UP_BOX color 31
886 Fl_Button classify_file_b {
888 callback {int n = files_module_tree_br->value();
891 sfinx_file_t *file = ((sfinx_files_vector_t *)files_module_tree_br->user_data())->files[n - 1];
893 app->files_module_conf.get(FILES_MODULE_UNSORTED_PATH, path);
895 int eyear, emonth, eday, ehour, emin, esec, cyear, cmonth, cday, chour, cmin, csec;
896 file->etime.GetDate(eyear, emonth, eday);
897 file->etime.GetTime(ehour, emin, esec);
898 file->ctime.GetDate(cyear, cmonth, cday);
899 file->ctime.GetTime(chour, cmin, csec);
900 sprintf(buf, "%llu bytes | Modified: %02d/%02d/%04d %02d:%02d:%02d | Last Status Changed: %02d/%02d/%04d %02d:%02d:%02d", file->fsize, cday, cmonth,
901 cyear, chour, cmin, csec, eday, emonth, eyear, ehour, emin, esec);
902 string t = "URL: " + path + current_file.name + "/" + file->name + " | " + file->mimetype + " | Size: " + buf;
903 classify_file_to->value(t.c_str());
904 file_title_i->value(0);
905 file_name_i->value(file->name.c_str());
906 // save orig file name
907 file->orig_name = file->name;
908 file->tid(SFINX_FILES_MODULE_CLASSIFY_REQUEST); // new file
909 file_title_i->take_focus();
910 file_authority_i->value(0);
911 file_description_i->value(0);
912 file_comments_i->value(0);
913 sorted_location_b->value(1);
914 file_compress_b->value(1);
915 file_gen_csum_b->value(1);
916 file_mtag_b->label("Main Slice (Not Set)");
917 file_mtag_b->user_data(0); // ÔÕÔÁ ÈÒÁÎÉÔÓÑ mtag
918 file_tags_br->clear();
919 classify_file_w->user_data((void *)file);
920 classify_file_w->show();}
921 xywh {21 312 112 25} labeltype ENGRAVED_LABEL
925 callback {Fl_Toggle_Node *node = files_tree->selected();
926 if (!node || node->can_open()) {
927 fl_alert("Please select file to edit !");
930 sfinx_object_t *obj = (sfinx_object_t *) node->user_data();
931 if (obj->type != SFINX_FILE_OBJECT)
933 sfinx_file_t file(SFINX_FILES_MODULE_EDIT_REQUEST);
935 app->sfinx.send(file);}
936 xywh {154 312 128 25} labeltype ENGRAVED_LABEL
938 Fl_Browser files_module_tree_br {
939 callback {if (!Fl::event_clicks())
941 sfinx_files_vector_t *tree = (sfinx_files_vector_t *) files_module_tree_br->user_data();
942 int n = files_module_tree_br->value();
943 //debug("selected %s file", tree->files[n - 1]->url.c_str());
944 if (tree->files[n - 1]->is_directory) { // ÀÚÅÒ ÓÍÅÎÉÌ ÄÉÒÅËÔÏÒÉÀ
945 // × file_id ÈÒÁÎÉÔÓÑ id ÔÅËÕÝÅÊ ÄÉÒÅËÔÏÒÉÉ-ÓÌÁÊÓÁ × ËÏÔÏÒÏÊ ÎÁÈÏÄÉÍÓÑ/×ÙÂÒÁÌÉ
946 // × mtag_id - parent_id ÄÉÒÅËÔÏÒÉÉ
947 // ÚÁÈÏÄÉÍ × ÄÉÒÅËÔÏÒÉÀ - ÔÅËÕÝÁÑ ÓÔÁÎÏ×ÉÔÓÑ parent'ÏÍ
948 current_file.id = tree->files[n - 1]->id;
949 current_file.mtag.id = tree->files[n - 1]->mtag.id;
950 // × name ÈÒÁÎÉÔÓÑ ×ÅÓØ ÐÕÔØ ÏÔ root location
951 // × orig_name ÔÏÌØËÏ ÉÍÑ ÔÅËÕÝÅÊ
952 string t = current_file.name.c_str();
953 // current_file.orig_name = tree->files[n - 1]->name;
954 t += ('/' + tree->files[n - 1]->name);
955 current_file.name = t;
956 //debug("requesting dir %s", current_file.c_str());
957 app->sfinx.send(current_file);
959 if (!(tree->files[n - 1]->id)) // classify file
960 classify_file_b->do_callback();
962 // app->sfinx.send(SFINX_SLICES_MODULE_TREE_REQUEST, (u8_t)0); // prepare for slice_name() calls
963 sfinx_file_t *file = tree->files[n - 1];
964 file->tid(SFINX_FILES_MODULE_EDIT_REQUEST);
965 app->sfinx.send(file);
968 xywh {7 45 716 255} type Multi color 31 resizable
969 code0 {static int widths[] = { 10, 450, 200, 200, 0};}
970 code1 {files_module_tree_br->column_widths(widths);}
974 callback {if (current_file.tid() == SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST) { // unsorted tree
975 int n = files_module_tree_br->value();
978 sfinx_file_t *file = ((sfinx_files_vector_t *)files_module_tree_br->user_data())->files[n - 1];
979 string path; // sure ?
980 string message = "Deleting ";
981 if (file->is_directory)
982 message += "directory";
985 message += (" \\'" + file->name + "\\'. Are you sure ?");
986 if (fl_choice(message.c_str(), "Yes", "No", 0L))
988 file->tid(SFINX_FILES_MODULE_UNSORTED_DELETE);
989 app->sfinx.send(file); // check for errors ?
990 app->sfinx.send(current_file);
991 } else { // sorted tree
992 Fl_Toggle_Node *node = files_tree->selected();
993 if (!node || node->can_open())
995 sfinx_object_t *obj = (sfinx_object_t *) node->user_data();
996 string message = "Delete or Unsort \\'" + obj->name + "\\' ?";
997 int res = fl_choice(message.c_str(), "Cancel", "Unsort", "Delete");
1000 file.mtag.slice_id = obj->slice_id;
1003 if (res == 2) // delete
1004 file.tid(SFINX_FILES_MODULE_SORTED_UNLINK);
1006 file.tid(SFINX_FILES_MODULE_UNSORT);
1007 app->sfinx.send(file);
1008 fill_objects_tree(files_tree, (1 << SFINX_FILE_OBJECT), 0, 1); // fluid bugs if any default params exists !
1011 xywh {300 312 112 25} labeltype ENGRAVED_LABEL
1013 Fl_Button select_files_tree_b {
1015 callback {current_file.name.clear();
1016 current_file.orig_name.clear();
1017 if (select_files_tree_b->user_data()) {
1018 current_file.tid(SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST);
1019 current_file.id = 0;
1020 app->sfinx.send(current_file);
1022 select_files_tree_b->user_data((void *)1);
1023 select_files_tree_b->label("Show Unsorted");
1024 select_files_tree_b->redraw();
1025 current_file.tid(0);
1026 current_file.id = 1; // root id
1027 fill_objects_tree(files_tree, 1 << SFINX_FILE_OBJECT, 0, 0); // fluid bugs if any default params exists !
1028 files_module_tree_br->hide();
1029 files_tree_scroll->show();
1031 xywh {562 10 128 25} labeltype ENGRAVED_LABEL
1035 callback {const char *p = strrchr(current_file.name.c_str(), '/');
1037 if (!current_file.name.size())
1039 current_file.name.clear();
1043 strncat(path, current_file.name.c_str(), p - current_file.name.c_str());
1044 current_file.name = path;
1045 current_file.id = current_file.mtag.id;
1047 app->sfinx.send(current_file);}
1048 xywh {35 10 112 25} labeltype ENGRAVED_LABEL
1052 callback {app->sfinx.send(current_file);}
1053 xywh {166 10 112 25} labeltype ENGRAVED_LABEL
1057 callback {//for (int i = 1; i <= files_module_tree_br->size(); i++)
1058 // files_module_tree_br->select(i);}
1059 xywh {295 10 112 25} labeltype ENGRAVED_LABEL
1062 label {Unselect All}
1063 callback {files_module_tree_br->deselect();}
1064 xywh {428 10 112 25} labeltype ENGRAVED_LABEL
1066 Fl_Scroll files_tree_scroll {
1067 xywh {7 45 716 255} box ENGRAVED_FRAME color 28 hide
1068 code0 {files_tree = new Fl_Toggle_Tree(12, 12, files_tree_scroll->w(), 10);}
1069 code1 {files_tree->callback(files_tree_cb); files_tree->user_data((void *)files_tree_scroll);}
1070 code2 {files_module_w->resizable(files_tree_scroll);}
1071 code3 {files_tree_scroll->resizable(files_tree);}
1072 class Fl_Scroll_Resize
1075 Fl_Window classify_file_w {
1076 label {Classify File} open
1077 xywh {84 298 1020 515} type Double color 31 hide modal
1081 callback {classify_file_w->hide();}
1082 xywh {612 454 112 25} labeltype ENGRAVED_LABEL
1084 Fl_Input file_title_i {
1086 xywh {16 27 496 26} color 29 labeltype ENGRAVED_LABEL align 1
1088 Fl_Input file_authority_i {
1090 xywh {16 83 496 26} color 29 labeltype ENGRAVED_LABEL align 1
1092 Fl_Input file_description_i {
1094 xywh {549 78 447 101} type Multiline color 29 labeltype ENGRAVED_LABEL align 1
1096 Fl_Input file_comments_i {
1098 xywh {582 220 416 212} type Multiline color 29 labeltype ENGRAVED_LABEL align 1
1100 Fl_Output classify_file_to {
1101 xywh {0 497 1022 21} box PLASTIC_UP_BOX color 31 labelsize 10 textsize 10
1103 Fl_Return_Button {} {
1105 callback {if (!file_mtag_b->user_data()) {
1106 fl_alert("You have to select Main Slice for file !");
1109 if (!file_name_i->size()) {
1110 fl_alert("File must have some name !");
1113 sfinx_file_t *file = (sfinx_file_t *)classify_file_w->user_data();
1114 file->name = file_name_i->value();
1115 file->title = file_title_i->value();
1116 file->authority = file_authority_i->value();
1117 file->description = file_description_i->value();
1118 file->comments = file_comments_i->value();
1119 file->sorted_location = sorted_location_b->value();
1120 file->store_compressed = file_compress_b->value();
1121 file->generate_csum = file_gen_csum_b->value();
1122 sfinx_object_t *obj = (sfinx_object_t *)file_mtag_b->user_data();
1123 file->mtag.id = obj->id;
1124 file->mtag.type = obj->type;
1125 file->mtag.slice_id = obj->slice_id;
1126 file_mtag_b->user_data(0);
1128 for (int i = 1; i <= file_tags_br->size(); i++) {
1129 obj = (sfinx_object_t *)file_tags_br->data(i);
1130 file->tags.push_back(*obj);
1131 file_tags_br->data(i, 0);
1133 app->sfinx.send(file);}
1134 xywh {243 454 112 25} labeltype ENGRAVED_LABEL
1136 Fl_Check_Button sorted_location_b {
1137 label {Sorted Location}
1138 xywh {15 132 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16
1140 Fl_Check_Button file_crypt_b {
1142 xywh {15 165 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16 deactivate
1144 Fl_Check_Button file_compress_b {
1145 label {Store compressed}
1146 xywh {274 132 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16
1149 xywh {13 205 552 227} box ENGRAVED_FRAME
1151 Fl_Button file_mtag_b {
1152 label {Main Slice (Not Set)}
1153 callback {fill_objects_tree(select_slice_tree, (1 << SFINX_SLICE_OBJECT) | (1 << SFINX_FILE_OBJECT) | (1 << SFINX_NOTE_OBJECT), 0, 0); // fluid bugs if any default params exists !
1154 select_slice_w->user_data((void *)select_file_mtag_action);
1155 select_slice_w->show();}
1156 tooltip {File Main Slice} xywh {45 226 489 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1158 Fl_Browser file_tags_br {
1159 label {Additional Slices}
1160 xywh {26 275 525 102} type Multi color 46 labeltype ENGRAVED_LABEL align 1
1162 Fl_Button file_add_tag_b {
1164 callback {fill_objects_tree(select_slice_tree, (1 << SFINX_SLICE_OBJECT) | (1 << SFINX_FILE_OBJECT) | (1 << SFINX_NOTE_OBJECT), 0, 0); // fluid bugs if any default params exists !
1165 select_slice_w->user_data((void *)select_file_atag_action);
1166 select_slice_w->show();}
1167 xywh {82 391 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1169 Fl_Button file_remove_tag_b {
1170 label {Remove Slice}
1171 callback {for (int i = file_tags_br->size(); i >= 1; i--) {
1172 if (file_tags_br->selected(i))
1173 file_tags_br->remove(i);
1175 xywh {358 391 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1177 Fl_Input file_name_i {
1179 xywh {549 26 447 26} color 29 labeltype ENGRAVED_LABEL align 1
1181 Fl_Check_Button file_gen_csum_b {
1182 label {Generate CSUM}
1183 xywh {274 165 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16
1187 label {Notes Module}
1188 xywh {272 69 730 370} type Double color 31 resizable visible
1192 callback {notes_w->hide();}
1193 xywh {605 312 112 25} labeltype ENGRAVED_LABEL
1195 Fl_Output notes_module_status_to {
1196 xywh {0 349 733 21} box PLASTIC_UP_BOX color 31
1200 callback {Fl_Toggle_Node *node = notes_tree->selected();
1202 fl_alert("Please select slice connection point !");
1205 sfinx_note_t *note = new sfinx_note_t(SFINX_NOTES_MODULE_ADD);
1206 edit_note_w->user_data((void *)note);
1207 sfinx_object_t *obj;
1208 if (node->can_open()) // slice
1209 obj = ((sfinx_slice_t *)node->user_data())->object();
1211 obj = (sfinx_object_t *) node->user_data();
1212 note_mtag_b->user_data(obj);
1213 note_mtag_b->copy_label((obj->name + " [ " + obj->description + " ]").c_str());
1214 note_mtag_b->redraw();
1215 note_name_i->value(0);
1216 note_url_i->value(0);
1217 note_text_i->value(0);
1218 note_name_i->take_focus();
1219 edit_note_w->show();}
1220 xywh {21 312 112 25} labeltype ENGRAVED_LABEL
1224 callback {Fl_Toggle_Node *node = notes_tree->selected();
1225 if (!node || node->can_open()) {
1226 fl_alert("Please select note to edit !");
1229 sfinx_object_t *obj = (sfinx_object_t *) node->user_data();
1230 if (obj->type != SFINX_NOTE_OBJECT)
1232 sfinx_note_t note(SFINX_NOTES_MODULE_EDIT_REQUEST);
1234 app->sfinx.send(note);}
1235 xywh {154 312 128 25} labeltype ENGRAVED_LABEL
1237 Fl_Scroll notes_tree_scroll {
1238 xywh {13 10 705 289} box ENGRAVED_FRAME color 28
1239 code0 {notes_tree = new Fl_Toggle_Tree(12, 12, notes_tree_scroll->w(), 10);}
1240 code1 {notes_tree->callback(notes_tree_cb); notes_tree->user_data((void *)notes_tree_scroll);}
1241 code2 {notes_w->resizable(notes_tree_scroll);}
1242 code3 {notes_tree_scroll->resizable(notes_tree);}
1243 class Fl_Scroll_Resize
1247 callback {Fl_Toggle_Node *node = notes_tree->selected();
1248 if (!node || node->can_open())
1250 sfinx_object_t *obj = (sfinx_object_t *) node->user_data();
1251 delete_sfinx_note_to->value(obj->name.c_str());
1252 delete_note_w->user_data(obj);
1253 delete_note_w->show();}
1254 xywh {300 312 112 25} labeltype ENGRAVED_LABEL
1257 Fl_Window edit_note_w {
1259 xywh {212 174 1020 385} type Double color 31 hide modal
1263 callback {edit_note_w->hide();}
1264 xywh {648 321 112 25} labeltype ENGRAVED_LABEL
1266 Fl_Input note_name_i {
1268 xywh {16 27 496 26} color 29 labeltype ENGRAVED_LABEL align 1
1270 Fl_Input note_url_i {
1272 xywh {16 83 496 26} color 29 labeltype ENGRAVED_LABEL align 1
1274 Fl_Input note_text_i {
1276 xywh {16 141 496 158} type Multiline color 29 labeltype ENGRAVED_LABEL align 1
1278 Fl_Output edit_note_to {
1279 xywh {0 364 1022 21} box PLASTIC_UP_BOX color 31 labelsize 10 textsize 10
1281 Fl_Return_Button {} {
1283 callback {if (!note_mtag_b->user_data()) {
1284 fl_alert("You have to select Main Object for note !");
1287 if (!note_name_i->size()) {
1288 fl_alert("Note must have some name !");
1291 if (!note_text_i->size()) {
1292 fl_alert("Note must have some text !");
1295 sfinx_note_t *note = (sfinx_note_t *)edit_note_w->user_data();
1296 note->name = note_name_i->value();
1297 note->url = note_url_i->value();
1298 note->text = note_text_i->value();
1299 sfinx_object_t *obj = (sfinx_object_t *)note_mtag_b->user_data();
1300 note->mtag.id = obj->id;
1301 note->mtag.type = obj->type;
1302 note->mtag.slice_id = obj->slice_id;
1303 note_mtag_b->user_data(0);
1305 for (int i = 1; i <= note_tags_br->size(); i++) {
1306 obj = (sfinx_object_t *)note_tags_br->data(i);
1307 note->tags.push_back(*obj);
1308 note_tags_br->data(i, 0);
1310 app->sfinx.send(note);
1312 edit_note_w->user_data(0);}
1313 xywh {279 321 112 25} labeltype ENGRAVED_LABEL
1316 xywh {535 72 467 227} box ENGRAVED_FRAME
1318 Fl_Button note_mtag_b {
1319 label {Main Note Tag (Not Set)}
1320 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 !
1321 slices_w->user_data((void *)select_note_mtag_action);
1323 tooltip {Note Main Tag} xywh {594 93 348 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1325 Fl_Browser note_tags_br {
1326 label {Additional Note Tags}
1327 xywh {559 146 420 102} type Multi color 46 labeltype ENGRAVED_LABEL align 1
1329 Fl_Button note_add_tag_b {
1331 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 !
1332 slices_w->user_data((void *)select_note_atag_action);
1334 xywh {584 258 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1336 Fl_Button note_remove_tag_b {
1338 callback {for (int i = note_tags_br->size(); i >= 1; i--) {
1339 if (note_tags_br->selected(i))
1340 note_tags_br->remove(i);
1342 xywh {811 258 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1344 Fl_Choice note_secured_ch {
1345 label {Secure Level}
1346 xywh {536 27 211 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 5 deactivate
1353 label {Crypted Text}
1358 Fl_Window delete_note_w {
1360 xywh {44 182 388 168} type Double color 31 hide modal
1364 callback {delete_note_w->hide();}
1365 xywh {239 122 112 25} labeltype ENGRAVED_LABEL
1369 callback {sfinx_object_t *obj = (sfinx_object_t *) delete_note_w->user_data();
1370 sfinx_note_t note(note_deletion_type_ch->value() ? SFINX_NOTES_MODULE_UNLINK : SFINX_NOTES_MODULE_UNSORT);
1372 note.mtag.slice_id = obj->slice_id;
1373 app->sfinx.send(note);
1374 delete_note_w->user_data(0);
1375 delete_note_w->hide();
1376 fill_objects_tree(notes_tree, (1 << SFINX_SLICE_OBJECT) | (1 << SFINX_NOTE_OBJECT), 0, 1); // force refresh}
1377 xywh {40 122 112 25} labeltype ENGRAVED_LABEL
1379 Fl_Output delete_sfinx_note_to {
1380 label {Please confirm deletion of the note}
1381 xywh {31 26 330 26} box ENGRAVED_FRAME color 29 labeltype ENGRAVED_LABEL align 1
1383 Fl_Choice note_deletion_type_ch {
1384 label {Associated Data Deletion Action}
1385 xywh {74 80 240 23} down_box BORDER_BOX color 48 labeltype ENGRAVED_LABEL align 1
1388 label {Mark all data 'Unsorted'}
1392 label {Delete all data}
1397 Fl_Window search_browser_w {
1398 label {Search Browser}
1399 xywh {217 305 854 476} type Double color 31 hide resizable modal
1403 callback {search_browser_w->hide();}
1404 xywh {638 449 187 20} box PLASTIC_ROUND_UP_BOX color 0 labeltype ENGRAVED_LABEL
1406 Fl_Browser search_browser_br {
1407 xywh {4 4 846 439} type Hold box GTK_THIN_UP_BOX color 44 resizable
1410 label {Previous Page}
1411 xywh {25 449 169 20} box PLASTIC_ROUND_UP_BOX color 0 labeltype ENGRAVED_LABEL
1415 xywh {231 449 169 20} box PLASTIC_ROUND_UP_BOX color 0 labeltype ENGRAVED_LABEL
1417 Fl_Choice goto_page_ch {
1418 label {Current Page }
1419 xywh {531 450 72 20} box PLASTIC_THIN_UP_BOX down_box PLASTIC_THIN_UP_BOX color 44 labeltype ENGRAVED_LABEL
1422 Fl_Window search_w {
1424 xywh {169 380 749 389} type Double color 31 hide modal
1428 callback {search_w->hide();}
1429 xywh {182 347 363 25} box PLASTIC_ROUND_UP_BOX labeltype ENGRAVED_LABEL
1431 Fl_Return_Button {} {
1433 callback {sfinx_search_query_t query;
1434 query.pattern = search_i->value();
1435 if (search_in_files_b->value())
1436 query.add_area(SFINX_SEARCH_IN_FILES);
1437 // add restrictions ...
1438 app->sfinx.send(query);}
1439 xywh {539 48 163 25} box PLASTIC_ROUND_UP_BOX labeltype ENGRAVED_LABEL
1441 Fl_Check_Button search_in_files_b {
1442 label {Search in Files}
1443 xywh {48 96 241 23} box PLASTIC_UP_BOX down_box DOWN_BOX selection_color 15 labeltype ENGRAVED_LABEL align 16 deactivate
1446 xywh {87 141 561 189} box ROUNDED_FRAME
1448 Fl_Browser search_slices_br {
1449 label {Restrict Search by Slices}
1450 xywh {105 173 525 102} type Multi color 46 labeltype ENGRAVED_LABEL align 1
1452 Fl_Button search_add_slice_b {
1454 callback {app->refresh_slices();
1455 slices_w->user_data((void *)search_add_slice_action);
1457 xywh {161 289 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1460 label {Remove Slice}
1461 callback {for (int i = search_slices_br->size(); i >= 1; i--) {
1462 if (search_slices_br->selected(i))
1463 search_slices_br->remove(i);
1465 xywh {437 289 138 25} box PLASTIC_THIN_UP_BOX labeltype ENGRAVED_LABEL
1468 label {Search for ...}
1469 xywh {46 47 447 26} color 29 labeltype ENGRAVED_LABEL align 1
1473 xywh {357 229 374 154} type Double hide
1477 callback {about_w->hide();}
1478 xywh {72 122 226 20} box PLASTIC_ROUND_UP_BOX labeltype ENGRAVED_LABEL
1481 image {../docs/sfinx.jpg} xywh {10 9 130 101}
1485 xywh {203 6 99 33} labeltype EMBOSSED_LABEL labelfont 9 labelsize 32
1488 label {Personal knowledge manager}
1489 xywh {150 40 214 22} labeltype EMBOSSED_LABEL labelcolor 64
1492 label {Copyright (C) 2007 Rus V. Brushkoff}
1493 xywh {150 58 214 22} labeltype EMBOSSED_LABEL labelfont 8 labelsize 11 labelcolor 56
1496 label {Email: Rus@@Sfinx.Od.UA}
1497 xywh {150 75 214 22} labeltype EMBOSSED_LABEL labelfont 8 labelsize 11 labelcolor 56
1500 label {http://sfinx.od.ua/index.php?id=sfinx}
1501 xywh {150 93 214 22} labeltype EMBOSSED_LABEL labelfont 8 labelsize 11 labelcolor 56
1504 code {main_w->show();} {}
1507 Function {x11_ui::edit_slice(sfinx_slice_t *slice)} {return_type void
1511 slice_name_i->value(slice->name());
1512 slice_directory_i->value(slice->directory());
1513 slice_name_i->take_focus();
1514 slice_description_i->value(slice->description());
1515 string status_line = "Parent slice: ";
1516 status_line += slice->parent_name();
1517 int cyear, cmonth, cday, eyear, emonth, eday, chour, cmin, csec, ehour, emin, esec;
1518 slice->ctime.GetDate(cyear, cmonth, cday);
1519 slice->etime.GetDate(eyear, emonth, eday);
1520 slice->ctime.GetTime(chour, cmin, csec);
1521 slice->etime.GetTime(ehour, emin, esec);
1523 sprintf(buf, " | Created at %02d/%02d/%02d %02d:%02d:%02d, Modified at %02d/%02d/%02d %02d:%02d:%02d", cyear, cmonth, cday, chour, cmin,
1524 csec, eyear, emonth, eday, ehour, emin, esec);
1526 edit_slice_to->value(status_line.c_str());
1527 edit_slice_w->show();
1531 Function {x11_ui::notes_module_edit(sfinx_note_t *n)} {open return_type void
1534 sfinx_note_t *note = new sfinx_note_t;
1536 note->tid(SFINX_NOTES_MODULE_EDIT);
1537 edit_note_w->user_data((void *)note);
1539 int eyear, emonth, eday, ehour, emin, esec, cyear, cmonth, cday, chour, cmin, csec;
1540 note->etime.GetDate(eyear, emonth, eday);
1541 note->etime.GetTime(ehour, emin, esec);
1542 note->ctime.GetDate(cyear, cmonth, cday);
1543 note->ctime.GetTime(chour, cmin, csec);
1544 sprintf(buf, "Modified: %02d/%02d/%04d %02d:%02d:%02d | Last Status Changed: %02d/%02d/%04d %02d:%02d:%02d", cday, cmonth, cyear,
1545 chour, cmin, csec, eday, emonth, eyear, ehour, emin, esec);
1546 edit_note_to->value(buf);
1547 note_name_i->value(note->name.c_str());
1548 note_name_i->take_focus();
1549 note_url_i->value(note->url.c_str());
1550 note_text_i->value(note->text.c_str());
1552 note_mtag_b->user_data(&(note->mtag));
1553 note_mtag_b->copy_label((note->mtag.name + " [ " + note->mtag.description + " ]").c_str());
1554 note_mtag_b->redraw();
1556 note_tags_br->clear();
1557 for (u32_t i = 0; i < note->tags.size(); i++) {
1558 string s = note->tags[i].name + " [ " + note->tags[i].description + " ]";
1559 note_tags_br->add(s.c_str(), &(note->tags[i]));
1561 edit_note_w->show();
1565 Function {x11_ui::notes_module_reply(sfinx_string_t *classify_error)} {return_type void
1568 if (classify_error->size() == 1) {
1569 ::fill_objects_tree(notes_tree, 1 << SFINX_NOTE_OBJECT, 0, 1); // fluid bugs if any default params exists !
1570 edit_note_w->hide();
1572 fl_alert(classify_error->c_str());
1576 Function {x11_ui::files_module_edit_reply(sfinx_string_t *classify_error)} {open return_type void
1579 if (classify_error->size() == 1) {
1580 if (current_file.tid() != SFINX_FILES_MODULE_UNSORTED_TREE_REQUEST)
1581 ::fill_objects_tree(files_tree, (1 << SFINX_FILE_OBJECT), 0, 1); // fluid bugs if any default params exists !
1583 app->sfinx.send(current_file);
1584 classify_file_w->hide();
1586 fl_alert(classify_error->c_str());
1590 Function {x11_ui::files_module_edit(sfinx_file_t *f)} {return_type void
1593 static sfinx_file_t file;
1596 int eyear, emonth, eday, ehour, emin, esec, cyear, cmonth, cday, chour, cmin, csec;
1597 file.etime.GetDate(eyear, emonth, eday);
1598 file.etime.GetTime(ehour, emin, esec);
1599 file.ctime.GetDate(cyear, cmonth, cday);
1600 file.ctime.GetTime(chour, cmin, csec);
1601 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,
1602 chour, cmin, csec, eday, emonth, eyear, ehour, emin, esec);
1604 app->files_module_conf.get(FILES_MODULE_SORTED_TREE_PATH, path);
1605 string t = "URL: " + path + current_file.name + "/" + file.name + " | " + file.mimetype + " | Size: " + buf;
1606 classify_file_to->value(t.c_str());
1607 file_title_i->value(file.title.c_str());
1608 file_name_i->value(file.name.c_str());
1609 // save orig file name
1610 file.orig_name = file.name;
1611 file.tid(SFINX_FILES_MODULE_EDIT_FILE); // edit file
1612 file_title_i->take_focus();
1613 file_authority_i->value(file.authority.c_str());
1614 file_description_i->value(file.description.c_str());
1615 file_comments_i->value(file.comments.c_str());
1616 sorted_location_b->value(file.sorted_location);
1617 file_compress_b->value(file.store_compressed);
1618 file_gen_csum_b->value(file.generate_csum);
1619 file_mtag_b->copy_label((file.mtag.name + " [ " + file.mtag.description + " ]").c_str());
1620 file_mtag_b->user_data(&file.mtag);
1621 file_tags_br->clear();
1622 for (u32_t i = 0; i < file.tags.size(); i++) {
1623 string s = file.tags[i].name + " [ " + file.tags[i].description + " ]";
1624 file_tags_br->add(s.c_str(), &(file.tags[i]));
1626 classify_file_w->user_data((void *)&file);
1627 classify_file_w->show();
1631 Function {x11_ui::search_browser(sfinx_pair_vector_t *r)} {return_type void
1634 search_browser_br->clear();
1636 search_browser_br->add("Sfinx has no data for this query");
1639 goto_page_ch->clear();
1640 /*for (u32_t i = 1; i < 50; i++) {
1642 sprintf(b, "%d", i);
1643 goto_page_ch->add(b, 0, 0, (void *)i);
1644 // Fl_Menu_Item *item = (Fl_Menu_Item *)(goto_page_ch->menu() + n);
1645 // item->color(FL_GREEN);
1647 goto_page_ch->value(0);
1648 //goto_page_ch->selection_color(FL_GREEN);
1651 for (u32_t i = 0; i < r->len(); i++) {
1652 sfinx_pair_t *p = r->find(i);
1656 if (!p->get(i, &el))
1660 prepare_search_info(el, inf);
1661 string::size_type pos = 0, found;
1662 while ((found = inf.find('\\n', pos)) != string::npos) {
1663 string line(inf, pos, found - pos);
1664 search_browser_br->add(line.c_str());
1667 search_browser_br->add("@-");
1670 search_browser_w->show();
1674 Function {x11_ui::prepare_search_info(sfinx_t *el, string &inf)} {return_type void
1676 code {sfinx_file_t *f;
1677 switch (el->tid()) {
1678 case SFINX_ELEMENT_FILE:
1679 f = (sfinx_file_t *)el;
1680 inf = "\\nType: File\\n";
1681 inf.append("Slice Hierarchy: " + app->slice_hierarchy(f->mtag.id) + "\\n");
1682 /* if (f->slices.size()) {
1683 inf.append("Additional Slices : ");
1684 for (u32_t i = 0; i < f->slices.size(); i++) {
1687 inf.append(app->slice_name(f->slices[i]));
1691 inf.append("Title: " + f->title + "\\n");
1692 inf.append("Authority: " + f->authority + "\\n");
1693 inf.append("Description: " + f->description + "\\n");
1694 inf.append("Comments: " + f->comments + "\\n");
1695 inf.append("Name: " + f->name + "\\n");
1697 sprintf(buf, "%llu bytes\\n", f->fsize);
1698 inf.append("Size: ");
1701 inf.append("Csum: " + f->csum + "\\n");
1702 sprintf(buf, "%llu bytes\\n", f->compressed_fsize);
1703 inf.append("Compressed Size: ");
1705 if (f->compressed_csum.size())
1706 inf.append("Compressed Csum: " + f->compressed_csum + "\\n");
1707 int year, month, day, hour, min, sec;
1708 f->ctime.GetDate(year, month, day);
1709 f->ctime.GetTime(hour, min, sec);
1710 sprintf(buf, "Create Entry Time: %02d/%02d/%04d %02d:%02d:%02d\\n", day, month, year, hour, min, sec);
1712 f->etime.GetDate(year, month, day);
1713 f->etime.GetTime(hour, min, sec);
1714 sprintf(buf, "Edit Entry Time: %02d/%02d/%04d %02d:%02d:%02d\\n", day, month, year, hour, min, sec);
1719 debug("Can't fill element info !");
1724 Function {x11_ui::fill_objects_tree()} {return_type void
1727 Fl_Toggle_Tree *tree = fill_tree;
1728 u32_t mask = fill_tree_mask;
1731 mask = SFINX_SLICE_OBJECT;
1734 tree->draw_lines(1);
1735 tree->alternate_color(FL_LIGHT2);
1736 tree->trim_color(FL_LIGHT1);
1737 tree->edit_on_reselect(0);
1738 sfinx_slice_t *slice;
1739 Fl_Toggle_Node *node;
1740 u32_t max_name_len = 0;
1741 for (u32_t i = 0; i < app->slices.len(); i++) {
1742 slice = app->slices.get(i);
1743 if (slice == fill_tree_except)
1745 //debug("slice name - %s, id - %lld, parent_id - %lld", slice->name(), slice->id, slice->parent_id);
1746 string name = slice->name() + string(" [ ") +
1747 slice->description() + string(" ]");
1748 // replace \\n with spaces
1749 string filt_elems( "\\n");
1750 string::size_type pos = 0;
1751 while (( pos = name.find_first_of(filt_elems, pos)) != string::npos)
1752 name.replace(pos, 1, string(" "));
1753 if (name.size() > max_name_len)
1754 max_name_len = name.size();
1755 if (!slice->parent_id) {
1756 node = tree->add_sub((char *)name.c_str(), 1, &slice_pixmap, to_voidp(slice));
1757 if (fill_tree_mask & ((1 << SFINX_NOTE_OBJECT) | (1 << SFINX_FILE_OBJECT))) {
1760 for (u32_t x = 0; x < slice->objs.size(); x++) {
1761 switch (slice->objs[x].type) {
1762 case SFINX_NOTE_OBJECT:
1763 if (fill_tree_mask & (1 << SFINX_NOTE_OBJECT))
1764 tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, ¬e_pixmap,
1765 to_voidp(&(slice->objs[x])));
1767 case SFINX_FILE_OBJECT:
1768 if (fill_tree_mask & (1 << SFINX_FILE_OBJECT))
1769 tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, &file_pixmap,
1770 to_voidp(&(slice->objs[x])));
1773 debug("unsupported fill tree type %d", slice->objs[x].type);
1776 tree->traverse_up();
1780 node = tree->traverse_start();
1782 sfinx_slice_t *s = (sfinx_slice_t *) node->user_data();
1783 if (s->id == slice->parent_id)
1785 node = tree->traverse_forward();
1789 node = tree->add_sub((char *)name.c_str(), 1, &slice_pixmap, to_voidp(slice));
1790 if (fill_tree_mask & ((1 << SFINX_NOTE_OBJECT) | (1 << SFINX_FILE_OBJECT))) {
1793 for (u32_t x = 0; x < slice->objs.size(); x++) {
1794 switch (slice->objs[x].type) {
1795 case SFINX_NOTE_OBJECT:
1796 if (fill_tree_mask & (1 << SFINX_NOTE_OBJECT))
1797 tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, ¬e_pixmap,
1798 to_voidp(&(slice->objs[x])));
1800 case SFINX_FILE_OBJECT:
1801 if (fill_tree_mask & (1 << SFINX_FILE_OBJECT))
1802 tree->add_sub((char *)(slice->objs[x].name + slice->objs[x].description).c_str(), 0, &file_pixmap,
1803 to_voidp(&(slice->objs[x])));
1806 debug("unsupported fill tree type %d", slice->objs[x].type);
1809 tree->traverse_up();
1812 } // node not found - just ignore
1815 s32_t width = max_name_len * 8;
1816 // need to count depth for width update
1817 Fl_Scroll_Resize *tree_scroll = (Fl_Scroll_Resize *) tree->user_data();
1818 if (!tree_scroll) // he, forgot to set ;)
1820 tree->resize(tree->x(), tree->y(), width > tree_scroll->w() ? width : tree_scroll->w(), tree->h());
1821 // try to select previous node
1822 //node = slices_tree->find(to_voidp(current_slice_id));
1824 // slices_tree->select_range(node, node);
1828 Function {x11_ui::fill_unsorted_files_tree(sfinx_files_vector_t *tree_)} {open return_type void
1831 static sfinx_files_vector_t tree;
1833 files_module_tree_br->user_data((void *)&tree);
1834 files_module_tree_br->clear();
1836 u32_t files = 0, dirs = 0;
1837 // set parent dir id
1838 if (tree.files.size())
1839 current_file.mtag.id = tree.files[0]->compressed_fsize;
1840 for (u32_t i = 0; i < tree.files.size(); i++) {
1841 if (tree.files[i]->is_directory)
1842 strcpy(buf, "\\t@b@.");
1845 strncat(buf, tree.files[i]->name.c_str(), 50);
1847 if (tree.files[i]->is_directory) {
1848 strcpy(dir_len, "\\t@b@.< DIR >\\t");
1851 sprintf(dir_len, "\\t%llu\\t", tree.files[i]->fsize);
1854 strcat(buf, dir_len);
1855 int cyear, cmonth, cday, chour, cmin, csec;
1856 tree.files[i]->ctime.GetDate(cyear, cmonth, cday);
1857 tree.files[i]->ctime.GetTime(chour, cmin, csec);
1858 sprintf(dir_len, "%02d/%02d/%04d %02d:%02d:%02d\\t", cday, cmonth, cyear, chour, cmin, csec);
1859 strcat(buf, dir_len);
1860 strcat(buf, tree.files[i]->mimetype.c_str());
1861 files_module_tree_br->add(buf);
1863 files_module_tree_br->redraw();
1865 app->files_module_conf.get(FILES_MODULE_UNSORTED_PATH, root);
1866 sprintf(buf, "Path: %s | Total %d file%s and %d director%s", (root + current_file.name.c_str()).c_str(), files, (files == 1) ? "" : "s", dirs,
1867 (dirs == 1) ? "y" : "ies");
1868 files_module_status_to->value(buf);
1869 files_module_status_to->redraw();
1870 // this is unsorted tree
1871 select_files_tree_b->user_data(0);
1872 select_files_tree_b->label("Show Sorted");
1873 select_files_tree_b->redraw();
1874 files_tree_scroll->hide();
1875 files_module_tree_br->show();
1876 Fl::unlock();} {selected
1880 Function {x11_ui::fill_preferences()} {return_type void
1884 app->files_module_conf.get(FILES_MODULE_UNSORTED_PATH, t);
1885 config_files_module_unsorted_path_i->value(t.c_str());
1886 app->files_module_conf.get(FILES_MODULE_SORTED_TREE_PATH, t);
1887 config_files_module_sorted_path_i->value(t.c_str());
1888 app->files_module_conf.get(FILES_MODULE_DESC_FILE_NAME, t);
1889 config_files_module_desc_file_name_i->value(t.c_str());
1890 u32_t gen_desc_files;
1891 app->files_module_conf.get(FILES_MODULE_DESC_FILE_ENABLE, &gen_desc_files);
1892 gen_desc_files_b->value(gen_desc_files);
1896 Function {x11_ui::log(int level, const char *fmt, ...)} {return_type void
1898 code {char buf[10240];
1899 const char *level_str;
1904 ::va_start(args, fmt);
1907 case SFINX_LOG_NOTICE:
1908 level_str = "NOTICE";
1910 case SFINX_LOG_WARN:
1913 case SFINX_LOG_ERROR:
1914 level_str = "ERROR";
1916 case SFINX_LOG_FATAL:
1917 level_str = "FATAL";
1920 level_str = "UNKN_LEVEL";
1923 strcpy(buf, level_str);
1925 ::vsnprintf(buf + strlen(level_str) + 2, sizeof(buf) - (strlen(level_str) + 2), fmt, args);
1928 log_m.leaveMutex();} {}
1931 Function {x11_ui::progress(sfinx_progress_t *p)} {return_type void
1934 static char buf[128];
1935 switch (p->status()) {
1936 case SFINX_PROGRESS_START:
1937 progress_l->label(p->label());
1938 strcpy(buf, p->strvalue());
1939 progress_bar->label(buf);
1940 progress_bar->minimum(0);
1941 progress_bar->maximum(p->max());
1942 progress_bar->value(p->value());
1944 progress_w->redraw();
1946 case SFINX_PROGRESS_END:
1949 case SFINX_PROGRESS_NONE:
1956 Function {x11_ui::alert(sfinx_string_t *alert)} {return_type void
1959 if (alert->size() != 1)
1960 fl_alert(alert->c_str());