Merge lp:~carcohoma/foto/foto into lp:foto

Proposed by Carc
Status: Merged
Approved by: Erasmo Marín
Approved revision: 119
Merged at revision: 119
Proposed branch: lp:~carcohoma/foto/foto
Merge into: lp:foto
Diff against target: 134 lines (+19/-9)
7 files modified
CMakeLists.txt (+2/-0)
src/foto.vala (+2/-2)
src/views/AlbumViewer/FotoAlbumGrid.vala (+1/-1)
src/views/ImageGridView/ImageGridView.vala (+2/-2)
src/widgets/AlbumInfo.vala (+8/-3)
src/widgets/EmbeddedAlert.vala (+0/-1)
src/widgets/Icon.vala (+4/-0)
To merge this branch: bzr merge lp:~carcohoma/foto/foto
Reviewer Review Type Date Requested Status
Erasmo Marín Approve
Review via email: mp+163106@code.launchpad.net

Description of the change

- refresh icon cover image on album updated
- add debug stuff

To post a comment you must log in.
Revision history for this message
Erasmo Marín (erasmo-marin) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-03-25 18:07:06 +0000
3+++ CMakeLists.txt 2013-05-09 08:34:32 +0000
4@@ -7,6 +7,7 @@
5 #
6 # Base bits
7 #
8+set (CMAKE_C_FLAGS "-ggdb")
9 set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
10 set (PKGDATADIR "${DATADIR}/foto")
11 set (GETTEXT_PACKAGE "foto")
12@@ -152,6 +153,7 @@
13 OPTIONS
14 --thread
15 -g
16+ --debug
17 )
18
19 add_definitions(${CFLAGS}-Wall -Winit-self -Wwrite-strings -Wunreachable-code -Wstrict-prototypes)
20
21=== modified file 'src/foto.vala'
22--- src/foto.vala 2012-11-20 23:37:14 +0000
23+++ src/foto.vala 2013-05-09 08:34:32 +0000
24@@ -97,7 +97,7 @@
25 }
26
27 protected override void activate () {
28-
29+ Granite.Services.Logger.DisplayLevel = Granite.Services.LogLevel.DEBUG;
30 if (get_windows () == null) {
31 //get_windows ().data.present (); // present window if app is already running
32 album_manager = new AlbumHelper ();
33@@ -134,7 +134,7 @@
34
35 }
36
37- public static int main (string[] args) {
38+ public static int main (string[] args) {
39 var err = GtkClutter.init (ref args);
40 if (err != Clutter.InitError.SUCCESS) {
41 error ("Could not initalize clutter! "+err.to_string ());
42
43=== modified file 'src/views/AlbumViewer/FotoAlbumGrid.vala'
44--- src/views/AlbumViewer/FotoAlbumGrid.vala 2013-03-25 18:07:06 +0000
45+++ src/views/AlbumViewer/FotoAlbumGrid.vala 2013-05-09 08:34:32 +0000
46@@ -45,7 +45,7 @@
47 this.show_all ();
48 }
49
50- private void attach_album () {
51+ private void attach_album () {
52 var album = album_manager.AlbumList.get (album_manager.AlbumList.size-1);
53 var album_widget = new AlbumWidget.from_album (album,150,150);
54 attach_new_widget (album_widget);
55
56=== modified file 'src/views/ImageGridView/ImageGridView.vala'
57--- src/views/ImageGridView/ImageGridView.vala 2013-03-18 03:04:12 +0000
58+++ src/views/ImageGridView/ImageGridView.vala 2013-05-09 08:34:32 +0000
59@@ -94,7 +94,7 @@
60
61 foreach(File file in files){
62 if (IOHelper.is_valid_file_type (file.get_path() )) {
63- print("\nFile dragged: " + file.get_path());
64+ message("File dragged: " + file.get_path());
65 album_manager.create_picture(file.get_path(), album.album_name, "");
66 var icon = new Foto.Widgets.Icon.from_image_file(file.get_path(), 150, 150);
67 icon.set_have_close_button(false);
68@@ -120,7 +120,7 @@
69 if (IOHelper.is_valid_file_type (new_file.get_path() )) {
70 files += new_file;
71 pics++;
72- print("\nFile dragged: " + new_file.get_path());
73+ message("File dragged: " + new_file.get_path());
74 }
75 }
76 }
77
78=== modified file 'src/widgets/AlbumInfo.vala'
79--- src/widgets/AlbumInfo.vala 2013-03-18 05:53:52 +0000
80+++ src/widgets/AlbumInfo.vala 2013-05-09 08:34:32 +0000
81@@ -104,18 +104,23 @@
82 var new_album = album_manager.get_album_by_name(album_name);
83 rating.set_rating(album.rating);
84
85- if(album == new_album)
86+ if(album == new_album && !cover_has_changed(new_album))
87 return;
88+
89 album = new_album;
90 if(album.album_cover.picture_path != null && album.album_cover.picture_path != "")
91 icon.set_icon(album.album_cover.picture_path);
92- else if(album.picture_list.size > 0) {
93+ else if(album.picture_list.size > 0)
94 icon.set_icon(album.picture_list.get(0).picture_path);
95- }
96 else
97 icon.set_icon(null);
98 }
99
100+ bool cover_has_changed (Album new_album) {
101+ // TODO check if the previous cover photo has been deleted
102+ return icon.is_empty ();
103+ }
104+
105 private string parse_date_label(DateTime time){
106
107 string datetime = "";
108
109=== modified file 'src/widgets/EmbeddedAlert.vala'
110--- src/widgets/EmbeddedAlert.vala 2013-03-25 18:07:06 +0000
111+++ src/widgets/EmbeddedAlert.vala 2013-05-09 08:34:32 +0000
112@@ -131,7 +131,6 @@
113 case Gtk.MessageType.WARNING:
114 image.set_from_icon_name ("dialog-warning", Gtk.IconSize.DIALOG);
115 break;
116- break;
117 case Gtk.MessageType.INFO:
118 image.set_from_icon_name ("dialog-information", Gtk.IconSize.DIALOG);
119 break;
120
121=== modified file 'src/widgets/Icon.vala'
122--- src/widgets/Icon.vala 2013-03-18 03:04:12 +0000
123+++ src/widgets/Icon.vala 2013-05-09 08:34:32 +0000
124@@ -317,6 +317,10 @@
125 this.queue_draw();
126 }
127
128+ public bool is_empty () {
129+ return state == IconState.EMPTY;
130+ }
131+
132 /*public new StyleContext get_style_context() {
133 return style_context;
134 }*/

Subscribers

People subscribed via source and target branches

to all changes: