Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2010-05-10 08:31:05 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2010-05-10 08:31:05 (GMT)
commit670a28e7ce5070fb8d4e7f72168892b7323456d2 (patch)
tree29bd7cd4e5d75e478f7bbd3e77dd308d45992d86
parent664e429b9fc4e0c395f97dc42ecc105482a0acb4 (diff)
Popup newly created journal entry
-rw-r--r--src/sugar.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/sugar.c b/src/sugar.c
index ee149f9..59fe343 100644
--- a/src/sugar.c
+++ b/src/sugar.c
@@ -27,11 +27,13 @@
#include <SDL/SDL_syswm.h>
#include <sugar/env.h>
#include <sugar/ds.h>
+#include <sugar/shell.h>
#include "sugar.h"
static SugarHandle * handle;
static SugarJobject * jobject;
+static gboolean new_jobject;
void sugar_init(int * argc, char *** argv)
{
@@ -56,12 +58,17 @@ void sugar_cleanup()
{
g_debug("Cleanup sugar mode");
- if (jobject != NULL) {
+ if (new_jobject)
+ sugar_shell_show_object(sugar_jobject_get_uid(jobject));
+
+ if (jobject != NULL)
+ {
g_object_unref(G_OBJECT(jobject));
jobject = NULL;
}
- if (handle != NULL) {
+ if (handle != NULL)
+ {
sugar_handle_unref(handle);
handle = NULL;
}
@@ -75,7 +82,8 @@ void sugar_setup_x11(int * window_width, int * window_height)
SDL_SysWMinfo wminfo;
SDL_VERSION(&wminfo.version);
- if (SDL_GetWMInfo(&wminfo)) {
+ if (SDL_GetWMInfo(&wminfo))
+ {
Display * display = wminfo.info.x11.display;
Window window = wminfo.info.x11.wmwindow;
@@ -86,7 +94,9 @@ void sugar_setup_x11(int * window_width, int * window_height)
*window_height = DisplayHeight(display, DefaultScreen(display));
wminfo.info.x11.unlock_func();
- } else {
+ }
+ else
+ {
g_warning ("Cannot get WMInfo to setup X11 properties");
}
}
@@ -114,6 +124,9 @@ void sugar_save_jobject_file(char * path)
if (!sugar_detected())
return;
+ if (sugar_jobject_get_uid(jobject) == NULL)
+ new_jobject |= TRUE;
+
sugar_jobject_write_file(jobject, path, TRUE);
g_debug("Saved %s image to journal entry %s", path,