]> spindle.queued.net Git - midori/commitdiff
Use 'midori' icon and update icon cache in waf
authorChristian Dywan <christian@twotoasts.de>
Sat, 31 May 2008 12:20:36 +0000 (14:20 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sat, 31 May 2008 12:31:10 +0000 (14:31 +0200)
midori.desktop.in
src/midori-browser.c
wscript

index a4bf004e80d483434c38e2a13f262e083736f98f..ad78064a1ac93c065030612e95fecae8ada04832 100644 (file)
@@ -1,14 +1,13 @@
-
 [Desktop Entry]
 Version=1.0
 Encoding=UTF-8
 Type=Application
-_Name=Midori Web Browser
+_Name=Midori
 _GenericName=Web Browser
 _Comment=Lightweight web browser
 Categories=GTK;Network;
 MimeType=text/html;text/xml;application/xhtml+xml;application/xml;
 Exec=midori %u
-Icon=web-browser
+Icon=midori
 Terminal=false
 StartupNotify=true
index eef956621695711448378761e1f0b0a60ba27eb4..b3f2c2f60057a982f25413790f14ff2a12af49c2 100644 (file)
@@ -2312,7 +2312,7 @@ midori_browser_destroy_cb (MidoriBrowser* browser)
 
     // Destroy tabs first, so widgets can still see window elements on destroy
     gtk_container_foreach (GTK_CONTAINER (priv->notebook),
-                           G_CALLBACK (gtk_widget_destroy), NULL);
+                           (GtkCallback) gtk_widget_destroy, NULL);
 }
 
 static const gchar* ui_markup =
@@ -2435,6 +2435,20 @@ static const gchar* ui_markup =
   "</popup>"
  "</ui>";
 
+static void
+midori_browser_realize_cb (GtkStyle* style, MidoriBrowser* browser)
+{
+    GdkScreen* screen = gtk_widget_get_screen (GTK_WIDGET (browser));
+    if (screen)
+    {
+        GtkIconTheme* icon_theme = gtk_icon_theme_get_for_screen (screen);
+        if (gtk_icon_theme_has_icon (icon_theme, "midori"))
+            gtk_window_set_icon_name (GTK_WINDOW (browser), "midori");
+        else
+            gtk_window_set_icon_name (GTK_WINDOW (browser), "web-browser");
+    }
+}
+
 static void
 midori_browser_init (MidoriBrowser* browser)
 {
@@ -2443,13 +2457,14 @@ midori_browser_init (MidoriBrowser* browser)
     MidoriBrowserPrivate* priv = browser->priv;
 
     // Setup the window metrics
+    g_signal_connect (browser, "realize",
+                      G_CALLBACK (midori_browser_realize_cb), browser);
     g_signal_connect (browser, "window-state-event",
                       G_CALLBACK (midori_browser_window_state_event_cb), NULL);
     g_signal_connect (browser, "size-allocate",
                       G_CALLBACK (midori_browser_size_allocate_cb), NULL);
     g_signal_connect (browser, "destroy",
                       G_CALLBACK (midori_browser_destroy_cb), NULL);
-    // FIXME: Use custom program icon
     gtk_window_set_icon_name (GTK_WINDOW (browser), "web-browser");
     gtk_window_set_title (GTK_WINDOW (browser), g_get_application_name ());
     GtkWidget* vbox = gtk_vbox_new (FALSE, 0);
diff --git a/wscript b/wscript
index 2b1b66c8892e8c97352528bdb354bb7f6677f648..0d1eec382768db464cfa607d02d09d57b7df2b30 100644 (file)
--- a/wscript
+++ b/wscript
@@ -2,7 +2,8 @@
 # WAF build script for midori
 
 import Params
-import subprocess
+import pproc as subprocess
+import Common
 
 APPNAME = 'midori'
 VERSION = '0.0.18'
@@ -58,7 +59,7 @@ def configure (conf):
     conf.define ('SOKOKE_DEBUG_', '-')
     conf.write_config_header ('config.h')
 
-def set_options(opt):
+def set_options (opt):
     opt.tool_options ('compiler_cc')
     opt.tool_options ('intltool')
 
@@ -82,3 +83,14 @@ def build (bld):
         Params.pprint ('BLUE', "File midori.desktop not generated")
     if bld.env ()['INTLTOOL']:
         install_files ('DATADIR', 'applications', 'midori.desktop')
+
+def shutdown ():
+    dir = Common.path_install('DATADIR', 'icons/hicolor')
+    if Params.g_commands['install']:
+        if not Params.g_options.destdir:
+            # update the pixmap cache directory
+            Params.pprint('YELLOW', "Updating Gtk icon cache.")
+            subprocess.call (['gtk-update-icon-cache', '-q', '-f', '-t', dir])
+        else:
+            Params.pprint('YELLOW', "Icon cache not updated. After install, run this:")
+            Params.pprint('YELLOW', "gtk-update-icon-cache -q -f -t %s" % dir)