2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <setting-memory-common.h>
20 int setting_memory_update_popup_with_progress_bar(void *data)
23 SettingMemoryUG *ad = (SettingMemoryUG *) data;
25 if (ad->progress_bar != NULL) {
26 SETTING_TRACE("ad->progress_bar_rate = %f",
27 (float)ad->progress_bar_rate);
28 elm_progressbar_value_set(ad->progress_bar,
29 ad->progress_bar_rate);
32 if (ad->progress_bar_timer != NULL) {
33 ecore_timer_del(ad->progress_bar_timer);
34 ad->progress_bar_timer = NULL;
40 void setting_memory_hide_popup_with_progress_bar(SettingMemoryUG *ad)
43 if (ad->progress_bar) {
44 elm_progressbar_value_set(ad->progress_bar, 1.0);
46 evas_object_del(ad->progress_bar);
47 ad->progress_bar = NULL;
50 evas_object_del(ad->popup);
54 if (ad->popup_timer) {
55 ecore_timer_del(ad->popup_timer);
56 ad->popup_timer = NULL;
61 int setting_system_command(const char *command)
64 int pid = 0, status = 0;
65 char *const environ[] = { NULL };
74 return SETTING_RETURN_FAIL;
78 char *argv[SETTING_MEMORY_SYS_COMMAND_ARGV_LEN];
82 argv[2] = (char *)command;
85 execve("/bin/sh", argv, environ);
91 if (waitpid(pid, &status, 0) == -1) {
93 return SETTING_RETURN_FAIL;