Merge lp:~kamstrup/gnome-zeitgeist/gnome-zeitgeist-run-uninstalled into lp:gnome-zeitgeist

Proposed by Mikkel Kamstrup Erlandsen on 2009-06-16
Status: Needs review
Proposed branch: lp:~kamstrup/gnome-zeitgeist/gnome-zeitgeist-run-uninstalled
Merge into: lp:gnome-zeitgeist
Diff against target: None lines
To merge this branch: bzr merge lp:~kamstrup/gnome-zeitgeist/gnome-zeitgeist-run-uninstalled
Reviewer Review Type Date Requested Status
Seif Lotfy 2009-06-16 Pending
Review via email: mp+7496@code.launchpad.net
To post a comment you must log in.

This branch makes it possible to run the journal without installing it - that is, directly from the source dir

Unmerged revisions

754. By Mikkel Kamstrup Erlandsen on 2009-06-16

Merge with trunk

753. By Mikkel Kamstrup Erlandsen on 2009-06-04

Apply changes necessary to run zeitgeist uninstalled, directly from a (compiled) source checkout

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/Makefile.am'
--- data/Makefile.am 2009-06-11 14:02:56 +0000
+++ data/Makefile.am 2009-06-16 10:25:12 +0000
@@ -1,5 +1,8 @@
1SUBDIRS = logo1SUBDIRS = logo
22
3pixmapdir = $(datadir)
4pixmap_DATA = gnome-zeitgeist.xpm
5
3pkgdata_DATA = \6pkgdata_DATA = \
4 bookmark-new.svg \7 bookmark-new.svg \
5 calendar.svg \8 calendar.svg \
69
=== renamed file 'data/logo/gnome-zeitgeist.png' => 'data/gnome-zeitgeist.png'
=== renamed file 'data/logo/gnome-zeitgeist.xpm' => 'data/gnome-zeitgeist.xpm'
=== modified file 'data/logo/Makefile.am'
--- data/logo/Makefile.am 2009-05-24 21:38:30 +0000
+++ data/logo/Makefile.am 2009-06-04 21:49:42 +0000
@@ -1,6 +1,3 @@
1pixmapdir = $(datadir)
2pixmap_DATA = gnome-zeitgeist.xpm
3
4hicolordir = $(datadir)/icons/hicolor1hicolordir = $(datadir)/icons/hicolor
5tango_icons = \2tango_icons = \
6 22x22/apps/gnome-zeitgeist.png \3 22x22/apps/gnome-zeitgeist.png \
74
=== modified file 'zeitgeist-journal'
--- zeitgeist-journal 2009-05-23 21:49:10 +0000
+++ zeitgeist-journal 2009-06-04 21:49:42 +0000
@@ -24,7 +24,7 @@
24 # Window24 # Window
25 self.set_title("GNOME Zeitgeist")25 self.set_title("GNOME Zeitgeist")
26 self.set_resizable(True)26 self.set_resizable(True)
27 self.set_icon_from_file("%s/scalable/apps/gnome-zeitgeist.svg" % config.hicolordir)27 self.set_icon(icon_factory.load_icon("gnome-zeitgeist.png", 192))
28 self._visible = True28 self._visible = True
29 self.connect("destroy", gtk.main_quit)29 self.connect("destroy", gtk.main_quit)
30 self.connect_after("check-resize", self.window_state_event_cb)30 self.connect_after("check-resize", self.window_state_event_cb)
@@ -59,8 +59,7 @@
59 self.notebook.append_page(bookmarks, label)59 self.notebook.append_page(bookmarks, label)
60 self.notebook.set_tab_label_packing(bookmarks, True, True, gtk.PACK_START)60 self.notebook.set_tab_label_packing(bookmarks, True, True, gtk.PACK_START)
61 61
62 journal = "%s/calendar.svg" % config.pkgdatadir62 label = self.create_tab_label(_("Journal"), "calendar.svg")
63 label = self.create_tab_label(_("Journal"), journal)
64 self.notebook.append_page(timeline, label)63 self.notebook.append_page(timeline, label)
65 self.notebook.set_tab_label_packing(timeline, True, True, gtk.PACK_START)64 self.notebook.set_tab_label_packing(timeline, True, True, gtk.PACK_START)
66 65
@@ -105,7 +104,7 @@
105 104
106 def _create_toolbar_buttons(self):105 def _create_toolbar_buttons(self):
107 self.star_button = gtk.ToggleToolButton()106 self.star_button = gtk.ToggleToolButton()
108 pixbuf = gtk.gdk.pixbuf_new_from_file_at_size("%s/bookmark-new.svg" % config.pkgdatadir, 24, 24)107 pixbuf = icon_factory.load_icon("bookmark-new.svg", 24)
109 self.star_button.set_icon_widget(gtk.image_new_from_pixbuf(pixbuf))108 self.star_button.set_icon_widget(gtk.image_new_from_pixbuf(pixbuf))
110 self.star_button.set_label(_("Stars"))109 self.star_button.set_label(_("Stars"))
111 self.star_button.set_tooltip_text(_("Stars"))110 self.star_button.set_tooltip_text(_("Stars"))
112111
=== modified file 'zeitgeist/gui/zeitgeist_journal_widgets.py'
--- zeitgeist/gui/zeitgeist_journal_widgets.py 2009-06-15 17:50:28 +0000
+++ zeitgeist/gui/zeitgeist_journal_widgets.py 2009-06-16 10:25:12 +0000
@@ -752,8 +752,7 @@
752 self.home.connect("clicked", timeline.reset_date)752 self.home.connect("clicked", timeline.reset_date)
753 753
754 self.search = gtk.ToggleToolButton()754 self.search = gtk.ToggleToolButton()
755 pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(755 pixbuf = icon_factory.load_icon("gnome-zeitgeist.png", 24)
756 "%s/32x32/apps/gnome-zeitgeist.png" % config.hicolordir, 24, 24)
757 self.search.set_icon_widget(gtk.image_new_from_pixbuf(pixbuf))756 self.search.set_icon_widget(gtk.image_new_from_pixbuf(pixbuf))
758 self.search.set_label(_("Search"))757 self.search.set_label(_("Search"))
759 self.search.set_tooltip_text(_("Search for activities"))758 self.search.set_tooltip_text(_("Search for activities"))
@@ -802,17 +801,17 @@
802 801
803 gtk.Notebook.__init__(self)802 gtk.Notebook.__init__(self)
804 803
805 label = self.create_tab_label(_("Tags"), htb)804 label = self.create_tab_label(_("Tags"))
806 self.append_page(htb, label)805 self.append_page(htb, label)
807 self.set_tab_label_packing(htb, True, True, gtk.PACK_START)806 self.set_tab_label_packing(htb, True, True, gtk.PACK_START)
808 807
809 label = self.create_tab_label(_("Calendar"), calendar)808 label = self.create_tab_label(_("Calendar"))
810 self.append_page(calendar, label)809 self.append_page(calendar, label)
811 self.set_tab_label_packing(calendar, True, True, gtk.PACK_START)810 self.set_tab_label_packing(calendar, True, True, gtk.PACK_START)
812 811
813 vbox = gtk.VBox()812 vbox = gtk.VBox()
814 #vbox.pack_start(calendar, False, False)813 #vbox.pack_start(calendar, False, False)
815 label = self.create_tab_label(_("Filters"), vbox)814 label = self.create_tab_label(_("Filters"))
816 enable_grouping = gtk.CheckButton()815 enable_grouping = gtk.CheckButton()
817 enable_grouping.set_label(_("Enable Grouping"))816 enable_grouping.set_label(_("Enable Grouping"))
818 enable_grouping.set_active(True)817 enable_grouping.set_active(True)
@@ -831,12 +830,14 @@
831 timeline.group = widget.get_active()830 timeline.group = widget.get_active()
832 timeline.load_month()831 timeline.load_month()
833 832
834 def create_tab_label(self, title, stock):833 def create_tab_label(self, title, stock=None):
835 icon = gtk.image_new_from_pixbuf(icon_factory.load_icon(stock, icon_size = 16 ,cache = False))834 box = gtk.HBox()
836 label = gtk.Label(title)835
836 if stock:
837 icon = gtk.image_new_from_pixbuf(icon_factory.load_icon(stock, icon_size = 16 ,cache = False))
838 box.pack_start(icon, False, False)
837 839
838 box = gtk.HBox() 840 label = gtk.Label(title)
839 box.pack_start(icon, False, False)
840 box.pack_start(label, True, True)841 box.pack_start(label, True, True)
841 box.show_all()842 box.show_all()
842 843
843844
=== modified file 'zeitgeist/gui/zeitgeist_util.py'
--- zeitgeist/gui/zeitgeist_util.py 2009-06-13 13:17:10 +0000
+++ zeitgeist/gui/zeitgeist_util.py 2009-06-16 10:25:12 +0000
@@ -5,6 +5,7 @@
5"""5"""
66
7import os7import os
8import sys
8import gtk9import gtk
9import gnome.ui10import gnome.ui
10import gobject11import gobject
@@ -184,6 +185,14 @@
184 icon_size)185 icon_size)
185 if retval:186 if retval:
186 return retval187 return retval
188
189 # We couldn't find the icon anywhere, try seeing if we are
190 # running uninstalled and load it from the source dir if so
191 srcdir = os.path.join(os.path.dirname(__file__), "..", "..")
192 if os.path.exists(os.path.join(srcdir, "configure.ac")):
193 return self.load_icon_from_path(os.path.join(srcdir, "data", icon_value),
194 icon_size)
195
187 return None196 return None
188 197
189 def transparentize(self, pixbuf, percent):198 def transparentize(self, pixbuf, percent):
@@ -195,47 +204,49 @@
195 204
196 def greyscale(self, pixbuf):205 def greyscale(self, pixbuf):
197 pixbuf = pixbuf.copy()206 pixbuf = pixbuf.copy()
198 for row in pixbuf.get_pixels_array():207 for row in pixbuf.get_pixels_array():
199 for pix in row:208 for pix in row:
200 pix[0] = pix[1] = pix[2] = (int(pix[0]) + int(pix[1]) + int(pix[2])) / 3209 pix[0] = pix[1] = pix[2] = (int(pix[0]) + int(pix[1]) + int(pix[2])) / 3
201 return pixbuf210 return pixbuf
202 211
203 def load_icon(self, icon_value, icon_size, force_size=True, cache=True):212 def load_icon(self, icon_value, icon_size, force_size=True, cache=True):
204 if not self.icon_dict.has_key(icon_value) or not cache:213 if not self.icon_dict.has_key(icon_value) or cache==False:
205 try:214 #print "creating icon for "+icon_value
206 if isinstance(icon_value, gtk.gdk.Pixbuf):215 if isinstance(icon_value, gtk.gdk.Pixbuf):
207 return icon_value216 return icon_value
208 elif os.path.isabs(icon_value):217
209 icon = self.load_icon_from_path(icon_value, icon_size)218 if os.path.isabs(icon_value):
210 if icon:219 icon = self.load_icon_from_path(icon_value, icon_size)
211 return icon220 if icon:
212 icon_name = os.path.basename(icon_value)221 return icon
213 else:222 icon_name = os.path.basename(icon_value)
214 icon_name = icon_value223 else:
215 224 icon_name = icon_value
216 if icon_name.endswith(".png"):225
217 icon_name = icon_name[:-len(".png")]226 if icon_name.endswith(".png"):
218 elif icon_name.endswith(".xpm"):227 icon_name = icon_name[:-len(".png")]
219 icon_name = icon_name[:-len(".xpm")]228 elif icon_name.endswith(".xpm"):
220 elif icon_name.endswith(".svg"):229 icon_name = icon_name[:-len(".xpm")]
221 icon_name = icon_name[:-len(".svg")]230 elif icon_name.endswith(".svg"):
222 231 icon_name = icon_name[:-len(".svg")]
223 icon = None232
224 info = icon_theme.lookup_icon(icon_name, icon_size, gtk.ICON_LOOKUP_USE_BUILTIN)233 icon = None
225 if info:234 info = icon_theme.lookup_icon(icon_name, icon_size, gtk.ICON_LOOKUP_USE_BUILTIN)
226 if icon_name.startswith("gtk-"):235 if info:
227 icon = info.load_icon()236 if icon_name.startswith("gtk-"):
228 elif info.get_filename():237 icon = info.load_icon()
229 icon = self.load_icon_from_path(info.get_filename(), icon_size)238 elif info.get_filename():
230 else:239 icon = self.load_icon_from_path(info.get_filename(), icon_size)
231 icon = self.load_icon_from_data_dirs(icon_value, icon_size) 240 else:
232 241 icon = self.load_icon_from_data_dirs(icon_value, icon_size)
233 if cache:242
234 self.icon_dict[icon_value] = icon243 if cache:
235 return icon244 self.icon_dict[icon_value] = icon
236 except Exception:245
237 self.icon_dict[icon_value] = None246 if not icon:
238 return None247 raise IOError("Failed to find icon '%s'" % icon_value)
248
249 return icon
239 else:250 else:
240 return self.icon_dict[icon_value]251 return self.icon_dict[icon_value]
241 252
242253
=== modified file 'zeitgeist/gui/zeitgeist_util_widgets.py'
--- zeitgeist/gui/zeitgeist_util_widgets.py 2009-06-12 15:47:09 +0000
+++ zeitgeist/gui/zeitgeist_util_widgets.py 2009-06-16 10:25:12 +0000
@@ -56,8 +56,7 @@
56 56
57 self.fromImage = [ ( "text/plain", 0, TARGET_TYPE_TEXT ), ( "image/x-xpixmap", 0, TARGET_TYPE_PIXMAP ) ]57 self.fromImage = [ ( "text/plain", 0, TARGET_TYPE_TEXT ), ( "image/x-xpixmap", 0, TARGET_TYPE_PIXMAP ) ]
58 58
59 self.active_image = gtk.gdk.pixbuf_new_from_file_at_size(59 self.active_image = icon_factory.load_icon("bookmark-new.svg", 24)
60 "%s/bookmark-new.svg" % config.pkgdatadir, 24, 24)
61 60
62 self.inactive_image = icon_factory.greyscale(self.active_image)61 self.inactive_image = icon_factory.greyscale(self.active_image)
63 self.inactive_image = icon_factory.transparentize(self.inactive_image,50)62 self.inactive_image = icon_factory.transparentize(self.inactive_image,50)

Subscribers

People subscribed via source and target branches