4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
6 * Contact: MyoungJune Park <mj2004.park@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
21 #include <setting-memory-common.h>
24 int setting_memory_update_popup_with_progress_bar(void *data)
27 SettingMemoryUG *ad = (SettingMemoryUG *) data;
29 if (ad->progress_bar != NULL) {
30 SETTING_TRACE("ad->progress_bar_rate = %f",
31 (float)ad->progress_bar_rate);
32 elm_progressbar_value_set(ad->progress_bar,
33 ad->progress_bar_rate);
36 if (ad->progress_bar_timer != NULL) {
37 ecore_timer_del(ad->progress_bar_timer);
38 ad->progress_bar_timer = NULL;
44 void setting_memory_hide_popup_with_progress_bar(SettingMemoryUG *ad)
47 if (ad->progress_bar) {
48 elm_progressbar_value_set(ad->progress_bar, 1.0);
50 evas_object_del(ad->progress_bar);
51 ad->progress_bar = NULL;
54 evas_object_del(ad->popup);
58 if (ad->popup_timer) {
59 ecore_timer_del(ad->popup_timer);
60 ad->popup_timer = NULL;
65 int setting_system_command(const char *command)
68 int pid = 0, status = 0;
69 char *const environ[] = { NULL };
78 return SETTING_RETURN_FAIL;
82 char *argv[SETTING_MEMORY_SYS_COMMAND_ARGV_LEN];
86 argv[2] = (char *)command;
89 execve("/bin/sh", argv, environ);
95 if (waitpid(pid, &status, 0) == -1) {
97 return SETTING_RETURN_FAIL;