daemon: improved handling of save attempt on stopped studio (notify)

This commit is contained in:
Nedko Arnaudov 2010-04-18 01:53:52 +03:00
parent 94093265e2
commit 5eb4a8eca1
2 changed files with 2 additions and 12 deletions

View File

@ -37,6 +37,7 @@
#include "escape.h"
#include "studio_internal.h"
#include "cmd.h"
#include "../proxies/notify_proxy.h"
struct save_context
{
@ -709,6 +710,7 @@ static bool run(void * command_context)
if (!studio_is_started())
{
log_error("Cannot save not-started studio");
ladish_notify_simple(LADISH_NOTIFY_URGENCY_HIGH, "Cannot save not-started studio", NULL);
goto exit;
}

View File

@ -830,18 +830,6 @@ static void ladish_rename_studio(struct dbus_method_call * call_ptr)
static bool ladish_save_studio_internal(struct dbus_method_call * call_ptr, const char * new_studio_name)
{
/* FIXME: this is wrong place to do such check because state before
command execution needs to be checked and not state before
command is submited, but doing it here will show error to
user. Once notification mechanism is implemented, the
studio_is_started() check in save command run menthod
will send a notification and this check must be removed. */
if (!studio_is_started())
{
lash_dbus_error(call_ptr, LASH_DBUS_ERROR_GENERIC, "Cannot save not-started studio");
return false;
}
return ladish_command_save_studio(call_ptr, &g_studio.cmd_queue, new_studio_name);
}