namespace Wrt {
namespace Popup {
-
PopupInvoker::PopupInvoker() :
- m_inputName(tmpnam(NULL)),
- m_outputName(tmpnam(NULL))
+ m_inputName(tmpnam_r(NULL)),
+ m_outputName(tmpnam_r(NULL))
{
Try
{
m_output.Create(m_outputName);
LogDebug("Pipes created");
}
- Catch (DPL::Exception)
+ Catch(DPL::Exception)
{
LogError("Cannot create pipes");
}
m_output.Destroy(m_outputName);
LogDebug("Pipes destroyed");
}
- Catch (DPL::Exception)
+ Catch(DPL::Exception)
{
LogError("Cannot destroy pipes");
}
}
-bool PopupInvoker::askYesNo(const std::string& title, const std::string& message)
+bool PopupInvoker::askYesNo(const std::string& title,
+ const std::string& message)
{
Try
{
}
PopupResponse PopupInvoker::askYesNoCheckbox(const std::string& title,
- const std::string& message, const std::string& checkboxLabel)
+ const std::string& message,
+ const std::string& checkboxLabel)
{
Try
{
const int result = PopupSerializer::getIntArg(*resultData);
const int rememberResult = PopupSerializer::getIntArg(*resultData);
- LogDebug("Popup result is: " << result << " remeber: " << rememberResult);
+ LogDebug(
+ "Popup result is: " << result << " remeber: " << rememberResult);
Assert(resultData->Empty());
tmp.Close();
void PopupInvoker::executePopup()
{
pid_t pid = fork();
- if (pid == -1)
- {
+ if (pid == -1) {
//error occured
LogError("Cannot display popup!");
Assert(false);
}
- if (pid == 0)
- {
+ if (pid == 0) {
//child process
int ret = execl(POPUP_EXEC,
POPUP_EXEC,
DPL::WaitableHandle handle = m_input.WaitableReadHandle();
DPL::WaitForSingleHandle(handle);
}
-
} // Popup
} // Wrt