#include <pthread.h>
#include <app.h>
#include <efl_extension.h>
+#include <app_preference.h>
#include <storage.h>
#include "gl-data.h"
#include "gl-util.h"
#endif
#define GL_NAVIFRAME_POP_CB_KEY "gl_naviframe_pop_cb_key"
+#define GL_LAUNCH_STATE "gallery_launch_state"
+
/******** Enumeration ********/
typedef enum _gl_view_mode
{
char *_gl_get_edje_path(void);
char *_gl_get_directory_path(int storage_directory_type);
char *_gl_get_root_directory_path(int storage_type);
+void _gl_set_launch_state_preference(void *data);
+bool _gl_get_launch_state_preference();
#ifdef __cplusplus
}
timeline_d->date_layout = layout;
if (_gl_timeline_create_grid_view(timeline_d, genlist, update) < 0) {
+ if (timeline_d->nocontents) {
+ return timeline_d->nocontents;
+ }
return NULL;
}
GL_IF_DEL_OBJ(layout);
return -1;
}
+ _gl_main_add_reg_idler(ad);
timeline_d->view = view;
elm_object_part_content_set(timeline_d->layout, "elm.swallow", view);
_gl_data_get_cluster_list(ad);
GL_CHECK_FALSE(ad->albuminfo.elist);
gl_dbg("_gl_data_get_cluster_list:done");
- _gl_ctrl_show_view(data, GL_STR_ALBUMS);
+ if(_gl_get_launch_state_preference()) {
+ _gl_ctrl_show_view(data, "Timeline");
+ } else {
+ _gl_ctrl_show_view(data, GL_STR_ALBUMS);
+ }
gl_dbg("done");
GL_PROFILE_OUT;
return ECORE_CALLBACK_CANCEL;
gl_appdata *ad = (gl_appdata *)data;
GL_CHECK_VAL(ad->maininfo.win, -1);
int view_mode = gl_get_view_mode(ad);
- gl_dbg("");
if (view_mode == GL_VIEW_NONE) {
/* First launch gallery then show shortcut album/tag */
gl_dbg("Launch gallery at the first time");
_gl_data_get_cluster_list(ad);
GL_CHECK_VAL(ad->albuminfo.elist, -1);
- /* Set view mode */
- gl_set_view_mode(ad, GL_VIEW_ALBUMS);
- /* Select tabbar item contains shortcut item */
- _gl_ctrl_show_view(data, GL_STR_ALBUMS);
+ if(_gl_get_launch_state_preference()) {
+ /* Set view mode */
+ gl_set_view_mode(ad, GL_VIEW_TIMELINE);
+ /* Select tabbar item contains shortcut item */
+ _gl_ctrl_show_view(data, "Timeline");
+ } else {
+ /* Set view mode */
+ gl_set_view_mode(ad, GL_VIEW_ALBUMS);
+ /* Select tabbar item contains shortcut item */
+ _gl_ctrl_show_view(data, GL_STR_ALBUMS);
+ }
/* Register servier if albums view wasn't created */
_gl_main_add_reg_idler(data);
}
{
gl_dbgW("==Terminate==");
GL_CHECK(data);
+ _gl_set_launch_state_preference(data);
_gallery_close_app(data);
}
storage_get_root_directory(storage_type, &path);
return path;
}
+
+void _gl_set_launch_state_preference(void *data)
+{
+ int ret;
+ if (gl_get_view_mode(data) == GL_VIEW_TIMELINE) {
+ ret = preference_set_boolean(GL_LAUNCH_STATE, true);
+ } else {
+ ret = preference_set_boolean(GL_LAUNCH_STATE, false);
+ }
+ if (ret != PREFERENCE_ERROR_NONE) {
+ gl_dbgE(" Unable to set preference for launch State ERROR(%d)", ret);
+ }
+}
+
+bool _gl_get_launch_state_preference()
+{
+ int ret;
+ bool launch_state = true;
+ ret = preference_get_boolean(GL_LAUNCH_STATE, &launch_state);
+ if (ret != PREFERENCE_ERROR_NONE) {
+ gl_dbgE("Unable to get preference for launch State ERROR(%d)",ret);
+ return false;
+ }
+ return launch_state;
+}