Skip to content

Commit

Permalink
Remove screenshot whenever a gconf setting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Schulhof committed Sep 24, 2009
1 parent d656e23 commit 2cecc85
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
@@ -1,3 +1,9 @@
osso-xterm (0.14.mh27) unstable; urgency=low

* Remove the screenshot whenever a gconf setting changes

-- Gabriel Schulhof <gabriel.schulhof@nokia.com> Thu, 24 Sep 2009 12:35:33 +0300

osso-xterm (0.14.mh26) unstable; urgency=low

* Fixes: NB#140310 (Xterm needs to take a screenshot for startup acceleration)
Expand Down
17 changes: 17 additions & 0 deletions src/main.c
Expand Up @@ -36,6 +36,7 @@

#include "terminal-manager.h"
#include "stock-icons.h"
#include "terminal-gconf.h"

static gint osso_xterm_incoming(const gchar *interface,
const gchar *method,
Expand Down Expand Up @@ -65,6 +66,20 @@ static gint osso_xterm_incoming(const gchar *interface,
return OSSO_OK;
}

static void
gconf_setting_changed(GConfClient *client, guint connection_id, GConfEntry *entry, gpointer null)
{
g_unlink(OSSO_XTERM_SCREENSHOT_FILE_NAME);
}

static void
add_screenshot_remover()
{
GConfClient *gconf_client = gconf_client_get_default();

gconf_client_notify_add(gconf_client, OSSO_XTERM_GCONF_PATH, (GConfClientNotifyFunc)gconf_setting_changed, NULL, NULL, NULL);
}

int
main (int argc, char **argv)
{
Expand Down Expand Up @@ -149,6 +164,8 @@ main (int argc, char **argv)
osso_xterm_incoming,
manager);

add_screenshot_remover();

gtk_main ();

if (manager != NULL)
Expand Down
1 change: 1 addition & 0 deletions src/terminal-gconf.h
Expand Up @@ -28,6 +28,7 @@
#define STREQ(a,b) (strcmp((a), (b)) == 0)

#define OSSO_XTERM_GCONF_PATH "/apps/osso/xterm"
#define OSSO_XTERM_SCREENSHOT_FILE_NAME "/home/user/.cache/launch/com.nokia.xterm.pvr"

/* Integer */
#define OSSO_XTERM_GCONF_FONT_BASE_SIZE OSSO_XTERM_GCONF_PATH "/font_size"
Expand Down
4 changes: 1 addition & 3 deletions src/terminal-window.c
Expand Up @@ -633,12 +633,10 @@ notify_match(GtkWidget *widget, GParamSpec *pspec, TerminalWindow *wnd)
}
}

#define SCREENSHOT_FILE_NAME "/home/user/.cache/launch/com.nokia.xterm.pvr"

static gboolean
maybe_take_screenshot(TerminalWindow *window)
{
if (!g_file_test(SCREENSHOT_FILE_NAME, G_FILE_TEST_EXISTS))
if (!g_file_test(OSSO_XTERM_SCREENSHOT_FILE_NAME, G_FILE_TEST_EXISTS))
hildon_gtk_window_take_screenshot(GTK_WINDOW(window), TRUE);
window->take_screenshot_idle_id = 0;

Expand Down

0 comments on commit 2cecc85

Please sign in to comment.