Permalink
Browse files

Lock up UI when no DB is selected.

  • Loading branch information...
1 parent 4adc57e commit 5957c5bb1b6c1441ea6b19bc5bbee985e74fadac @leiflm committed May 30, 2012
Showing with 10 additions and 9 deletions.
  1. +1 −1 src/controller/bks_controller.c
  2. +4 −0 src/include/Bks_Ui.h
  3. +5 −8 src/ui/bks_ui.c
@@ -309,7 +309,7 @@ void bks_controller_ui_db_path_retrieved(Eina_Stringshare *path)
if (!path)
{
_db_get_count = MAX_DB_GET_COUNT;
- bks_ui_controller_notification_set(DB_FILE_SELECT_ABORT_MSG, ELM_POPUP_ORIENT_CENTER, -1.0, EINA_TRUE);
+ bks_ui_controller_lock_set(EINA_TRUE, DB_FILE_SELECT_ABORT_MSG);
}
eina_lock_release(&ctrl.db_lock);
}
View
@@ -137,4 +137,8 @@ void bks_ui_controller_db_path_get(void);
*/
void bks_ui_controller_notification_set(const char* text, Elm_Popup_Orient orient, double timeout, Eina_Bool block_input);
+/**
+ * @brief locks the ui and displays a message
+ */
+void bks_ui_controller_lock_set(Eina_Bool locked, const char *msg);
#endif
View
@@ -80,15 +80,13 @@ void bks_ui_shutdown(void)
elm_shutdown();
}
-/**
- * @brief Indicates that the entire ui data is being refetched.
- */
-void bks_ui_update_set(const Eina_Bool update)
+void bks_ui_controller_lock_set(Eina_Bool locked, const char *msg)
{
- printf("Jetzt sollte die UI %sbenutzbar sein.\n", (update ? "un" : ""));
- if (update)
+ printf("Jetzt sollte die UI %sbenutzbar sein.\n", (locked ? "un" : ""));
+ if (locked)
{
ecore_thread_main_loop_begin();
+ elm_object_text_set(ui.lock_window.content, msg);
elm_win_inwin_activate(ui.lock_window.win);
ecore_thread_main_loop_end();
}
@@ -110,8 +108,7 @@ _ui_window_key(void *data UNUSED, Evas *e UNUSED, Evas_Object *obj UNUSED, void
if (!strncmp(ev->keyname, "Escape", sizeof("Escape")))
{
- fullscreen_state = elm_win_fullscreen_get(ui.win);
- fullscreen_state ^= 1;
+ fullscreen_state = !elm_win_fullscreen_get(ui.win);
elm_win_fullscreen_set(ui.win, fullscreen_state);
}
}

0 comments on commit 5957c5b

Please sign in to comment.