2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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.
18 * @author Janusz Kozerski (j.kozerski@samsung.com)
19 * Kyungwook Tak (k.tak@samsung.com)
21 * @brief Popup service main
26 #include <Elementary.h>
32 #include "common/audit/logger.h"
33 #include "popup-service.h"
37 void updateLanguage(void)
39 std::unique_ptr<char> lang(new char);
41 lang.reset(vconf_get_str(VCONFKEY_LANGSET));
43 WARN("Cannot get language_set.");
45 setenv("LANG", lang.get(), 1);
46 setenv("LC_MESSAGES", lang.get(), 1);
49 setlocale(LC_ALL, "");
52 } // namespace anonymous
54 int elm_main(int, char **)
57 Csr::Audit::Logger::setTag("CSR_POPUP");
59 INFO("CSR popup service start!");
61 std::signal(SIGTERM, [](int signal) {
62 WARN("Popup is terminated by signal[" << strsignal(signal) << "]");
63 /* cleanup and close up stuff here */
69 Csr::Ui::PopupService service;
71 // If timeout time is too small and popup service wakes up repeatedly too quickly,
72 // it can be kept out to start by systemd.
73 service.start(POPUP_SERVICE_IDLE_TIMEOUT_TIME);
76 } catch (const std::exception &e) {
77 ERROR("std exception: " << e.what());
80 ERROR("Unhandled exception occured!");