build_setting: add a main edc file path.

Support to change main edc file in build setting.
Also, Enventor will support a shortcut key to change main edc file.
This commit is contained in:
Hermet Park 2016-08-07 04:35:08 +09:00
parent c1f05cf8b8
commit 534805a688
11 changed files with 152 additions and 36 deletions

View File

@ -12,7 +12,6 @@ EXTRA_DIST = \
bt_hilight.png \
bt_shine.png \
bub_over_bot.png \
folder.png \
glow_small.png \
holes_tiny_glow_horiz.png \
holes_tiny_glow_vert.png \
@ -59,7 +58,6 @@ EXTRA_DIST = \
live_spacer_icon.png \
live_text.png \
live_textblock.png \
new.png \
slider_up.png \
slider_down.png \
save.png \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 B

View File

@ -1,8 +1,8 @@
images {
image: "frame_bg.png" COMP;
image: "warning.png" COMP;
image: "folder.png" COMP;
image: "new.png" COMP;
image: "icon_folder.png" COMP;
image: "brows_logo.png" COMP;
image: "shine.png" COMP;
image: "bub_over_bot.png" COMP;
image: "disabler.png" COMP;
@ -82,7 +82,7 @@ group { "fileselector_layout";
fixed: 1 1;
rel1.to: "title_frame";
rel2.to: "title_frame";
image.normal: "folder.png";
image.normal: "icon_folder.png";
}
}
text { "elm.text.title";
@ -278,7 +278,7 @@ group { "newfile_layout";
fixed: 1 1;
rel1.to: "title_frame";
rel2.to: "title_frame";
image.normal: "new.png";
image.normal: "brows_logo.png";
}
}
text { "elm.text.title";

View File

@ -1,7 +1,8 @@
images {
image: "frame_bg.png" COMP;
image: "setting_icon.png" COMP;
image: "folder.png" COMP;
image: "icon_folder.png" COMP;
image: "brows_logo.png" COMP;
}
group { "setting_layout";
@ -210,7 +211,7 @@ group { "setting_layout";
group { "build_setting_layout";
parts {
spacer { "img_path_frame";
spacer { "main_edc_frame";
desc {
rel1 { relative: 0 0; }
rel2 { relative: 1 0; }
@ -219,6 +220,15 @@ group { "build_setting_layout";
fixed: 0 1;
}
}
spacer { "img_path_frame";
desc {
rel1 { to: "main_edc_frame"; relative: 0 1; }
rel2 { to: "main_edc_frame"; relative: 1 1; }
align: 0.5 0;
min: 0 30;
fixed: 0 1;
}
}
spacer { "snd_path_frame";
scale: 1;
desc {
@ -259,6 +269,57 @@ group { "build_setting_layout";
fixed: 0 1;
}
}
image { "main_edc_icon";
scale: 1;
desc {
align: 0 0.5;
min: 20 20;
max: 20 20;
fixed: 1 1;
rel1.to: "main_edc_frame";
rel2.to: "main_edc_frame";
image.normal: "brows_logo.png";
}
}
text { "main_edc_guide";
scale: 1;
effect: SHADOW BOTTOM;
desc {
rel1 { to: "main_edc_icon"; relative: 1 0; offset: 5 1; }
rel2 { to: "main_edc_icon"; relative: 1 1; }
color: COL_NM;
align: 0 0.5;
fixed: 1 1;
text {
font: FN;
text: "Main EDC File:";
size: 11;
align: 0 0.5;
min: 1 0;
ellipsis: -1;
}
}
}
swallow { "elm.swallow.main_edc_entry";
scale: 1;
desc {
align: 0 0;
fixed: 1 1;
rel1.to_x: "main_edc_guide";
rel1.to_y: "main_edc_guide";
rel1.offset: 5 0;
rel1.relative: 1 0;
rel2.to: "main_edc_frame";
}
}
swallow { "main_edc_tooltip";
repeat_events: 1;
desc {
rel1.to: "main_edc_frame";
rel2.to: "main_edc_frame";
fixed: 1 1;
}
}
image { "img_path_icon";
scale: 1;
desc {
@ -268,7 +329,7 @@ group { "build_setting_layout";
fixed: 1 1;
rel1.to: "img_path_frame";
rel2.to: "img_path_frame";
image.normal: "folder.png";
image.normal: "icon_folder.png";
}
}
text { "img_path_guide";
@ -319,7 +380,7 @@ group { "build_setting_layout";
fixed: 1 1;
rel1.to: "snd_path_frame";
rel2.to: "snd_path_frame";
image.normal: "folder.png";
image.normal: "icon_folder.png";
}
}
text { "snd_path_guide";
@ -370,7 +431,7 @@ group { "build_setting_layout";
fixed: 1 1;
rel1.to: "fnt_path_frame";
rel2.to: "fnt_path_frame";
image.normal: "folder.png";
image.normal: "icon_folder.png";
}
}
text { "fnt_path_guide";
@ -421,7 +482,7 @@ group { "build_setting_layout";
fixed: 1 1;
rel1.to: "dat_path_frame";
rel2.to: "dat_path_frame";
image.normal: "folder.png";
image.normal: "icon_folder.png";
}
}
text { "dat_path_guide";

View File

@ -6,6 +6,7 @@
typedef struct build_setting_s
{
Evas_Object *layout;
Evas_Object *main_edc_entry;
Evas_Object *img_path_entry;
Evas_Object *snd_path_entry;
Evas_Object *fnt_path_entry;
@ -28,6 +29,12 @@ entry_create(Evas_Object *parent)
return entry;
}
static void
main_edc_entry_update(Evas_Object *entry, const char *path)
{
elm_entry_entry_set(entry, path);
}
static void
img_path_entry_update(Evas_Object *entry, Eina_List *edc_img_paths)
{
@ -93,7 +100,7 @@ build_setting_focus_set(build_setting_data *bsd)
{
EINA_SAFETY_ON_NULL_RETURN(bsd);
elm_object_focus_set(bsd->img_path_entry, EINA_TRUE);
elm_object_focus_set(bsd->main_edc_entry, EINA_TRUE);
}
void
@ -101,6 +108,7 @@ build_setting_config_set(build_setting_data *bsd)
{
if (!bsd) return;
config_input_path_set(elm_object_text_get(bsd->main_edc_entry));
config_img_path_set(elm_object_text_get(bsd->img_path_entry));
config_snd_path_set(elm_object_text_get(bsd->snd_path_entry));
config_fnt_path_set(elm_object_text_get(bsd->fnt_path_entry));
@ -112,6 +120,7 @@ build_setting_reset(build_setting_data *bsd)
{
if (!bsd) return;
main_edc_entry_update(bsd->main_edc_entry, config_input_path_get());
img_path_entry_update(bsd->img_path_entry,
(Eina_List *)config_img_path_list_get());
snd_path_entry_update(bsd->snd_path_entry,
@ -135,11 +144,29 @@ build_setting_content_get(build_setting_data *bsd, Evas_Object *parent)
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(layout);
//Main EDC Path Entry
Evas_Object *main_edc_entry = entry_create(layout);
main_edc_entry_update(main_edc_entry, config_input_path_get());
elm_object_focus_set(main_edc_entry, EINA_TRUE);
elm_object_part_content_set(layout, "elm.swallow.main_edc_entry",
main_edc_entry);
elm_layout_text_set(layout, "main_edc_guide", _("Main EDC File:"));
//Main EDC Path Tooltip
Evas_Object *main_edc_tooltip = elm_button_add(layout);
elm_object_style_set(main_edc_tooltip, ENVENTOR_NAME);
elm_object_part_content_set(layout, "main_edc_tooltip", main_edc_tooltip);
elm_object_tooltip_text_set(main_edc_tooltip,
_("Main EDC File path, which is containing<br>"
"collections, used for a current<br>"
"project."));
elm_object_focus_allow_set(main_edc_tooltip, EINA_FALSE);
//Image Path Entry
Evas_Object *img_path_entry = entry_create(layout);
img_path_entry_update(img_path_entry,
(Eina_List *)config_img_path_list_get());
elm_object_focus_set(img_path_entry, EINA_TRUE);
elm_object_part_content_set(layout, "elm.swallow.img_path_entry",
img_path_entry);
elm_layout_text_set(layout, "img_path_guide", _("Image paths:"));
@ -209,6 +236,7 @@ build_setting_content_get(build_setting_data *bsd, Evas_Object *parent)
elm_object_focus_allow_set(data_path_tooltip, EINA_FALSE);
bsd->layout = layout;
bsd->main_edc_entry = main_edc_entry;
bsd->img_path_entry = img_path_entry;
bsd->snd_path_entry = snd_path_entry;
bsd->fnt_path_entry = fnt_path_entry;

View File

@ -331,6 +331,7 @@ void
config_input_path_set(const char *input_path)
{
config_data *cd = g_cd;
if (input_path == cd->input_path) return;
eina_stringshare_replace(&cd->input_path, input_path);
config_edj_path_update(cd);
}

View File

@ -586,20 +586,7 @@ static void
refresh_btn_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
brows_data *bd = g_bd;
if (!bd) return;
if (bd->mode == FILE_BROWSER_MODE_DEFAULT)
file_browser_workspace_reset();
else
{
if (bd->search_file_list)
{
brows_file_list_free(bd->search_file_list);
bd->search_file_list = NULL;
}
search_file_set(config_workspace_path_get());
}
file_browser_refresh();
}
static void
@ -821,3 +808,23 @@ file_browser_tools_visible_set(Eina_Bool visible)
else
elm_object_signal_emit(bd->base_layout, "elm,state,tools,hide", "");
}
void
file_browser_refresh(void)
{
brows_data *bd = g_bd;
if (!bd) return;
if (bd->mode == FILE_BROWSER_MODE_DEFAULT)
file_browser_workspace_reset();
else
{
if (bd->search_file_list)
{
brows_file_list_free(bd->search_file_list);
bd->search_file_list = NULL;
}
search_file_set(config_workspace_path_get());
}
}

View File

@ -115,6 +115,19 @@ syntax_color_init(Enventor_Object *enventor)
}
}
static void
main_edc_update(void)
{
//Update file browser only if main item is changed,
Enventor_Item *main_it = enventor_object_main_item_get(base_enventor_get());
const char *prev_path = NULL;
if (main_it) prev_path = enventor_item_file_get(main_it);
if (prev_path == config_input_path_get()) return;
file_mgr_main_file_set(config_input_path_get());
file_browser_refresh();
}
static void
config_update_cb(void *data EINA_UNUSED)
{
@ -127,6 +140,8 @@ config_update_cb(void *data EINA_UNUSED)
base_tools_toggle(EINA_FALSE);
base_statusbar_toggle(EINA_FALSE);
base_console_auto_hide();
main_edc_update();
}
static Eina_Bool
@ -563,7 +578,7 @@ enventor_mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
base_edc_navigator_deselect();
}
static void
static Enventor_Object *
enventor_setup(app_data *ad)
{
Enventor_Object *enventor = enventor_object_add(base_layout_get());
@ -603,8 +618,8 @@ enventor_setup(app_data *ad)
enventor_common_setup(enventor);
base_enventor_set(enventor);
file_mgr_main_file_set(config_input_path_get());
base_live_view_set(enventor_object_live_view_get(enventor));
return enventor;
}
static Eina_Bool
@ -1059,33 +1074,38 @@ init(app_data *ad, int argc, char **argv)
enventor_init(argc, argv);
if (!enventor_lock_create()) return EINA_FALSE;
sigaction_setup();
sigaction_setup();
Eina_Bool template = EINA_FALSE;
Eina_Bool default_edc = EINA_TRUE;
if (!config_data_set(argc, argv, &default_edc, &template))
return EINA_FALSE;
newfile_default_set(default_edc);
base_gui_init();
statusbar_set();
enventor_setup(ad);
Enventor_Object *enventor = enventor_setup(ad);
file_mgr_init();
file_mgr_main_file_set(config_input_path_get());
base_live_view_set(enventor_object_live_view_get(enventor));
tools_set();
live_edit_set();
base_gui_show();
//Guarantee Enventor editor has focus.
enventor_object_focus_set(base_enventor_get(), EINA_TRUE);
enventor_object_focus_set(enventor, EINA_TRUE);
menu_init();
if (template) menu_edc_new(EINA_TRUE);
//Initialize syntax color.
syntax_color_init(base_enventor_get());
syntax_color_update(base_enventor_get());
syntax_color_init(enventor);
syntax_color_update(enventor);
keygrabber_init(ad);

View File

@ -3,3 +3,4 @@ void file_browser_term(void);
void file_browser_workspace_set(const char *workspace_dir);
void file_browser_tools_set(void);
void file_browser_tools_visible_set(Eina_Bool visible);
void file_browser_refresh(void);