gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r6611 - in gnunet-gtk: pixmaps src/common src/core src/incl


From: gnunet
Subject: [GNUnet-SVN] r6611 - in gnunet-gtk: pixmaps src/common src/core src/include
Date: Mon, 24 Mar 2008 09:15:54 -0600 (MDT)

Author: moon
Date: 2008-03-24 09:15:53 -0600 (Mon, 24 Mar 2008)
New Revision: 6611

Modified:
   gnunet-gtk/pixmaps/gnunet-gtk-status-connected.svg
   gnunet-gtk/src/common/helper.c
   gnunet-gtk/src/core/eggtrayicon.c
   gnunet-gtk/src/include/gnunetgtk_common.h
Log:
add a global GtkIconFactory to host gnunet-gtk icons that should intergrate the 
stock
use it for the initial GtkStatusIcon
correct the connected status icon file

Modified: gnunet-gtk/pixmaps/gnunet-gtk-status-connected.svg
===================================================================
--- gnunet-gtk/pixmaps/gnunet-gtk-status-connected.svg  2008-03-24 07:38:22 UTC 
(rev 6610)
+++ gnunet-gtk/pixmaps/gnunet-gtk-status-connected.svg  2008-03-24 15:15:53 UTC 
(rev 6611)
@@ -14,7 +14,7 @@
    id="svg3440"
    sodipodi:version="0.32"
    inkscape:version="0.45.1"
-   sodipodi:docbase="/home/milan/Dev/gnunet-gtk/pixmaps/icons"
+   sodipodi:docbase="/home/milan/Dev/gnunet-gtk/pixmaps/drafting"
    sodipodi:docname="gnunet-gtk.svg"
    inkscape:output_extension="org.inkscape.output.svg.inkscape"
    version="1.0"
@@ -38,7 +38,7 @@
      inkscape:window-width="1024"
      inkscape:window-height="719"
      inkscape:window-x="0"
-     inkscape:window-y="49"
+     inkscape:window-y="48"
      inkscape:showpageshadow="true"
      gridempspacing="5"
      gridcolor="#23236f"
@@ -52,71 +52,6 @@
   <defs
      id="defs3">
     <linearGradient
-       id="linearGradient3957">
-      <stop
-         style="stop-color:#fffeff;stop-opacity:0.33333334;"
-         offset="0"
-         id="stop3959" />
-      <stop
-         style="stop-color:#fffeff;stop-opacity:0.21568628;"
-         offset="1"
-         id="stop3961" />
-    </linearGradient>
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient3957"
-       id="linearGradient3982"
-       gradientUnits="userSpaceOnUse"
-       x1="21.993773"
-       y1="33.955299"
-       x2="20.917078"
-       y2="15.814602"
-       gradientTransform="matrix(0.509273,0,0,0.473768,23.78749,24.00915)" />
-    <linearGradient
-       inkscape:collect="always"
-       id="linearGradient11503">
-      <stop
-         style="stop-color:#ef2929"
-         offset="0"
-         id="stop11505" />
-      <stop
-         style="stop-color:#cc0000"
-         offset="1"
-         id="stop11507" />
-    </linearGradient>
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient11503"
-       id="linearGradient11509"
-       x1="31.542158"
-       y1="27.633146"
-       x2="39.232777"
-       y2="40.738911"
-       gradientUnits="userSpaceOnUse" />
-    <linearGradient
-       inkscape:collect="always"
-       id="linearGradient11521">
-      <stop
-         style="stop-color:#000000;stop-opacity:1;"
-         offset="0"
-         id="stop11523" />
-      <stop
-         style="stop-color:#000000;stop-opacity:0;"
-         offset="1"
-         id="stop11525" />
-    </linearGradient>
-    <radialGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient11521"
-       id="radialGradient11527"
-       cx="34.625000"
-       cy="46.352013"
-       fx="34.625000"
-       fy="46.352013"
-       r="10.937500"
-       
gradientTransform="matrix(0.93716,5.010655e-6,-1.282451e-6,0.239994,2.175866,34.06314)"
-       gradientUnits="userSpaceOnUse" />
-    <linearGradient
        id="linearGradient4750">
       <stop
          offset="0"
@@ -3595,56 +3530,6 @@
        d="M 1.5438413,18.461044 C 0.44489524,16.960494 0.73862238,15.708678 
2.7889337,13.154672 C 4.3108819,11.258825 9.0089856,7.5461814 
9.3353762,7.9813886 C 9.4400091,8.1209064 8.7728654,9.6731504 
7.8528347,11.430816 C 6.8871558,13.275696 6.285064,14.766601 
6.4284763,14.957829 C 6.5718885,15.149055 8.138879,14.26688 10.135476,12.870884 
C 15.222614,9.3140149 18.176335,8.0117034 22.172331,7.563771 C 
26.560631,7.0718619 30.496826,8.227591 36.763249,11.847893 C 
40.412609,13.956237 40.853972,14.137144 41.382098,13.741069 C 
41.910221,13.344995 41.911646,12.982701 41.396997,9.9496859 C 
41.084034,8.1052802 40.898228,6.5435344 40.984095,6.4791397 C 41.3344,6.2164225 
44.888276,10.423535 45.937779,12.343363 C 47.625229,15.430158 
47.506191,17.413076 45.558585,18.659867 C 43.307736,20.100783 
39.725188,19.081789 35.674054,15.848372 C 32.332102,13.180993 
30.216662,12.209106 26.655418,11.704988 C 23.519364,11.261056 
20.298596,11.580927 18.171507,12.653858 C 14.596799,14.456987 
14.223302,14.81254 12.343691,16.001388 C 10.820751,16.964642 
7.8424063,19.041391 5.6468166,19.611049 C 3.6787084,20.121692 2.52275,19.79769 
1.5438413,18.461044 z "
        sodipodi:nodetypes="csssssssssssssssssc"
        id="path3743" />
-    <g
-       id="g1676"
-       transform="translate(-1.875,-1.0018336)">
-      <path
-         transform="translate(1.3125,-0.185898)"
-         d="M 45.5625 44.625 A 10.9375 3.5625 0 1 1  23.6875,44.625 A 10.9375 
3.5625 0 1 1  45.5625 44.625 z"
-         sodipodi:ry="3.5625"
-         sodipodi:rx="10.9375"
-         sodipodi:cy="44.625"
-         sodipodi:cx="34.625"
-         id="path11511"
-         
style="opacity:0.5;fill:url(#radialGradient11527);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-         sodipodi:type="arc" />
-      <path
-         transform="matrix(1.292963,0,0,1.298265,-11.62357,-12.79906)"
-         d="M 44.857088 36.818874 A 8.087534 8.087534 0 1 1  
28.68202,36.818874 A 8.087534 8.087534 0 1 1  44.857088 36.818874 z"
-         sodipodi:ry="8.087534"
-         sodipodi:rx="8.087534"
-         sodipodi:cy="36.818874"
-         sodipodi:cx="36.769554"
-         id="path2815"
-         
style="opacity:1;fill:url(#linearGradient11509);fill-opacity:1;stroke:#a40000;stroke-width:0.77183652;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-         sodipodi:type="arc" />
-      <rect
-         ry="0"
-         rx="0"
-         y="33.001602"
-         x="29.875"
-         height="4"
-         width="12"
-         id="rect2522"
-         
style="opacity:1;fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
 />
-      <path
-         transform="matrix(1.172757,0,0,1.174351,-7.233043,-8.235886)"
-         d="M 44.857088 36.818874 A 8.087534 8.087534 0 1 1  
28.68202,36.818874 A 8.087534 8.087534 0 1 1  44.857088 36.818874 z"
-         sodipodi:ry="8.087534"
-         sodipodi:rx="8.087534"
-         sodipodi:cy="36.818874"
-         sodipodi:cx="36.769554"
-         id="path2817"
-         
style="opacity:0.3;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.85211307;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-         sodipodi:type="arc" />
-      <path
-         inkscape:r_cy="true"
-         inkscape:r_cx="true"
-         
style="fill:url(#linearGradient3982);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
-         d="M 45.875,34.297252 C 45.875,39.42845 40.601824,31.328475 
36.364468,34.480309 C 32.225956,37.558622 25.875,40.2558 25.875,35.124602 C 
25.875,29.873333 30.303326,25.001602 35.819064,25.001602 C 41.3348,25.001602 
45.875,29.166053 45.875,34.297252 z "
-         id="path3955"
-         sodipodi:nodetypes="czssc" />
-    </g>
   </g>
   <g
      inkscape:label="Key"

Modified: gnunet-gtk/src/common/helper.c
===================================================================
--- gnunet-gtk/src/common/helper.c      2008-03-24 07:38:22 UTC (rev 6610)
+++ gnunet-gtk/src/common/helper.c      2008-03-24 15:15:53 UTC (rev 6611)
@@ -63,6 +63,8 @@
 
 static GladeXML *mainXML;
 
+static GtkIconFactory *iconFactory;
+
 #if GTK_CHECK_VERSION(2,10,0)
 static GtkStatusIcon *trayIcon;
 #endif
@@ -184,6 +186,14 @@
 /**
  * Simple accessor method.
  */
+GtkIconFactory *GNUNET_GTK_get_iconFactory ()
+{
+  return iconFactory;
+}
+
+/**
+ * Simple accessor method.
+ */
 #if GTK_CHECK_VERSION(2,10,0)
 GtkStatusIcon *
 GNUNET_GTK_get_trayIcon ()
@@ -357,6 +367,8 @@
                                  GNUNET_GE_FATAL | GNUNET_GE_USER |
                                  GNUNET_GE_IMMEDIATE, "glade_xml_new",
                                  gladeFile);
+  iconFactory = gtk_icon_factory_new();
+  gtk_icon_factory_add_default (iconFactory);
 #if GTK_CHECK_VERSION (2,10,0)
   trayIcon = gtk_status_icon_new ();
 #endif

Modified: gnunet-gtk/src/core/eggtrayicon.c
===================================================================
--- gnunet-gtk/src/core/eggtrayicon.c   2008-03-24 07:38:22 UTC (rev 6610)
+++ gnunet-gtk/src/core/eggtrayicon.c   2008-03-24 15:15:53 UTC (rev 6611)
@@ -672,6 +672,8 @@
   GtkWidget *trayContextMenu;
   GladeXML *trayContextMenuXML;
   GtkWidget *tray_quit;
+  GtkIconSet *iconSet;
+  GtkIconSource *iconSource;
 
   trayContextMenuXML =
     glade_xml_new (GNUNET_GTK_get_glade_filename (), "trayContextMenu",
@@ -680,12 +682,29 @@
                                           "trayContextMenu");
   trayIcon = GNUNET_GTK_get_trayIcon ();
   instDir = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
+  iconSet = gtk_icon_set_new ();
+  iconSource = gtk_icon_source_new ();
   iconPath =
-    g_strconcat (instDir, "/../gnunet-gtk/gnunet-gtk-status-nodaemon.svg",
-                 NULL);
+    g_build_filename (instDir, "..", "gnunet-gtk",
+                      "gnunet-gtk-status-connected.svg", NULL);
+  gtk_icon_source_set_filename (iconSource, iconPath);
+  g_free (iconPath); 
+  gtk_icon_set_add_source (iconSet, iconSource);
+  iconPath =
+    g_build_filename (instDir, "..", "gnunet-gtk",
+                      "gnunet-gtk-status-connected.png", NULL);
+  gtk_icon_source_set_filename (iconSource, iconPath);
+  g_free (iconPath);
+  gtk_icon_source_set_size_wildcarded (iconSource, FALSE);
+  gtk_icon_set_add_source (iconSet, iconSource);
+
+  gtk_icon_factory_add (GNUNET_GTK_get_iconFactory(),
+                        "gnunet-gtk-status-connected",
+                        iconSet);
+  gtk_icon_set_unref (iconSet);
+  gtk_icon_source_free (iconSource);
   GNUNET_free (instDir);
-  gtk_status_icon_set_from_file (trayIcon, iconPath);
-  g_free (iconPath);
+  gtk_status_icon_set_from_stock (trayIcon, "gnunet-gtk-status-connected");
   gtk_status_icon_set_tooltip (trayIcon, _("GNU's peer-to-peer network"));
   tray_quit = glade_xml_get_widget (trayContextMenuXML, "tray_quit");
   g_signal_connect_swapped (G_OBJECT (tray_quit), "activate",

Modified: gnunet-gtk/src/include/gnunetgtk_common.h
===================================================================
--- gnunet-gtk/src/include/gnunetgtk_common.h   2008-03-24 07:38:22 UTC (rev 
6610)
+++ gnunet-gtk/src/include/gnunetgtk_common.h   2008-03-24 15:15:53 UTC (rev 
6611)
@@ -63,6 +63,11 @@
 GladeXML *GNUNET_GTK_get_main_glade_XML (void);
 
 /**
+ * Get the GtkIconFactory for gnunet-gtk
+ */
+GtkIconFactory *GNUNET_GTK_get_iconFactory (void);
+
+/**
  * Get the GtkStatusIcon for the tray icon (if GTK >= 2.10)
  */
 #if GTK_CHECK_VERSION(2,10,0)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]