[frogr] Renamed 'album' to 'photoset' all around
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] Renamed 'album' to 'photoset' all around
- Date: Tue, 18 Jan 2011 11:59:45 +0000 (UTC)
commit e7b30629504d8306c3bb7ca2680941ee1891255e
Author: Mario Sanchez Prada <msanchez igalia com>
Date: Tue Jan 18 12:19:59 2011 +0100
Renamed 'album' to 'photoset' all around
po/POTFILES.in | 4 +-
po/en_GB.po | 48 ++--
po/es.po | 34 ++--
po/fr.po | 34 ++--
po/gl.po | 34 ++--
po/sv.po | 34 ++--
src/Makefile.am | 12 +-
src/frogr-add-to-album-dialog.h | 58 -----
src/frogr-add-to-group-dialog.c | 2 +-
...to-album-dialog.c => frogr-add-to-set-dialog.c} | 230 +++++++++---------
src/frogr-add-to-set-dialog.h | 58 +++++
src/frogr-album.h | 81 ------
src/frogr-controller.c | 268 ++++++++++----------
src/frogr-controller.h | 8 +-
src/frogr-create-new-album-dialog.h | 58 -----
...lbum-dialog.c => frogr-create-new-set-dialog.c} | 146 ++++++------
src/frogr-create-new-set-dialog.h | 58 +++++
src/frogr-main-view-model.c | 70 +++---
src/frogr-main-view-model.h | 24 +-
src/frogr-main-view.c | 100 ++++----
src/{frogr-album.c => frogr-photoset.c} | 174 +++++++-------
src/frogr-photoset.h | 81 ++++++
src/frogr-picture.c | 54 ++--
src/frogr-picture.h | 12 +-
24 files changed, 841 insertions(+), 841 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index bca2910..7963a34 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,11 +2,11 @@
src/frogr-about-dialog.c
src/frogr-add-tags-dialog.c
-src/frogr-add-to-album-dialog.c
+src/frogr-add-to-set-dialog.c
src/frogr-add-to-group-dialog.c
src/frogr-auth-dialog.c
src/frogr-controller.c
-src/frogr-create-new-album-dialog.c
+src/frogr-create-new-set-dialog.c
src/frogr-details-dialog.c
src/frogr-main-view.c
src/frogr-picture-loader.c
diff --git a/po/en_GB.po b/po/en_GB.po
index ce72a44..70ef8a3 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -32,19 +32,19 @@ msgstr ""
msgid "Add Tags"
msgstr "Add Tags"
-#: ../src/frogr-add-to-album-dialog.c:133
-msgid "Album Title"
-msgstr "Album Title"
+#: ../src/frogr-add-to-set-dialog.c:133
+msgid "Set Title"
+msgstr "Set Title"
-#: ../src/frogr-add-to-album-dialog.c:148
+#: ../src/frogr-add-to-set-dialog.c:148
#: ../src/frogr-add-to-group-dialog.c:148
msgid "Elements"
msgstr ""
-#: ../src/frogr-add-to-album-dialog.c:577
+#: ../src/frogr-add-to-set-dialog.c:577
#, fuzzy
-msgid "Add to Albums"
-msgstr "Add to Album"
+msgid "Add to Sets"
+msgstr "Add to Sets"
#: ../src/frogr-add-to-group-dialog.c:133
msgid "Group Name"
@@ -53,7 +53,7 @@ msgstr ""
#: ../src/frogr-add-to-group-dialog.c:577
#, fuzzy
msgid "Add to Groups"
-msgstr "Add to Album"
+msgstr "Add to Groups"
#: ../src/frogr-auth-dialog.c:31
#, fuzzy, c-format
@@ -244,11 +244,11 @@ msgid "Retrieving list of tagsâ?¦"
msgstr ""
#: ../src/frogr-controller.c:1477 ../src/frogr-controller.c:1509
-msgid "Retrieving list of albumsâ?¦"
+msgid "Retrieving list of setsâ?¦"
msgstr ""
#: ../src/frogr-controller.c:1522
-msgid "No albums found"
+msgid "No sets found"
msgstr ""
#: ../src/frogr-controller.c:1544
@@ -269,23 +269,23 @@ msgstr ""
"Please re-authorise it."
#. This shows a dialog notifying the problem to the user
-#: ../src/frogr-create-new-album-dialog.c:120
+#: ../src/frogr-create-new-set-dialog.c:120
#: ../src/frogr-details-dialog.c:894
msgid "Missing data required"
msgstr "Missing data required"
-#: ../src/frogr-create-new-album-dialog.c:304
+#: ../src/frogr-create-new-set-dialog.c:304
#, fuzzy
-msgid "Album's title:"
-msgstr "Album Title"
+msgid "Set's title:"
+msgstr "Set Title"
-#: ../src/frogr-create-new-album-dialog.c:317
+#: ../src/frogr-create-new-set-dialog.c:317
#, fuzzy
-msgid "Album's description:"
+msgid "Set's description:"
msgstr "Description:"
-#: ../src/frogr-create-new-album-dialog.c:356
-msgid "Create new Album"
+#: ../src/frogr-create-new-set-dialog.c:356
+msgid "Create new Set"
msgstr ""
#: ../src/frogr-details-dialog.c:160
@@ -421,20 +421,20 @@ msgstr "Add _Tagsâ?¦"
msgid "Add to _Groupâ?¦"
msgstr "Add to Al_bumâ?¦"
-#. Add to album
+#. Add to set
#: ../src/frogr-main-view.c:314 ../src/frogr-main-view.c:431
#, fuzzy
msgid "Add to Al_bum"
-msgstr "Add to Album"
+msgstr "Add to Set"
#: ../src/frogr-main-view.c:321 ../src/frogr-main-view.c:437
-msgid "_Create New Albumâ?¦"
+msgid "_Create New Setâ?¦"
msgstr ""
#: ../src/frogr-main-view.c:328 ../src/frogr-main-view.c:444
#, fuzzy
-msgid "Add to _Existing Albumâ?¦"
-msgstr "Add to Albumâ?¦"
+msgid "Add to _Existing Setâ?¦"
+msgstr "Add to Setâ?¦"
#: ../src/frogr-main-view.c:337
msgid "_Upload All"
@@ -575,7 +575,7 @@ msgstr "frogr"
#, fuzzy
#~ msgid "Add to Groupâ?¦"
-#~ msgstr "Add to Albumâ?¦"
+#~ msgstr "Add to Setâ?¦"
#~ msgid "Tags:"
#~ msgstr "Tags:"
diff --git a/po/es.po b/po/es.po
index 5148f4a..f26e957 100644
--- a/po/es.po
+++ b/po/es.po
@@ -35,18 +35,18 @@ msgstr ""
msgid "Add Tags"
msgstr "Añadir Etiquetas"
-#: ../src/frogr-add-to-album-dialog.c:133
-msgid "Album Title"
+#: ../src/frogr-add-to-set-dialog.c:133
+msgid "Set Title"
msgstr "TÃtulo del Ã?lbum"
-#: ../src/frogr-add-to-album-dialog.c:148
+#: ../src/frogr-add-to-set-dialog.c:148
#: ../src/frogr-add-to-group-dialog.c:148
msgid "Elements"
msgstr ""
-#: ../src/frogr-add-to-album-dialog.c:577
+#: ../src/frogr-add-to-set-dialog.c:577
#, fuzzy
-msgid "Add to Albums"
+msgid "Add to Sets"
msgstr "Añadir a �lbumes"
#: ../src/frogr-add-to-group-dialog.c:133
@@ -228,11 +228,11 @@ msgid "Retrieving list of tagsâ?¦"
msgstr ""
#: ../src/frogr-controller.c:1477 ../src/frogr-controller.c:1509
-msgid "Retrieving list of albumsâ?¦"
+msgid "Retrieving list of setsâ?¦"
msgstr ""
#: ../src/frogr-controller.c:1522
-msgid "No albums found"
+msgid "No sets found"
msgstr ""
#: ../src/frogr-controller.c:1544
@@ -253,23 +253,23 @@ msgstr ""
"Por favor autorÃcelo de nuevo."
#. This shows a dialog notifying the problem to the user
-#: ../src/frogr-create-new-album-dialog.c:120
+#: ../src/frogr-create-new-set-dialog.c:120
#: ../src/frogr-details-dialog.c:894
msgid "Missing data required"
msgstr "Falta información necesaria"
-#: ../src/frogr-create-new-album-dialog.c:304
+#: ../src/frogr-create-new-set-dialog.c:304
#, fuzzy
-msgid "Album's title:"
+msgid "Set's title:"
msgstr "TÃtulo del Ã?lbum"
-#: ../src/frogr-create-new-album-dialog.c:317
+#: ../src/frogr-create-new-set-dialog.c:317
#, fuzzy
-msgid "Album's description:"
+msgid "Set's description:"
msgstr "Descripción:"
-#: ../src/frogr-create-new-album-dialog.c:356
-msgid "Create new Album"
+#: ../src/frogr-create-new-set-dialog.c:356
+msgid "Create new Set"
msgstr ""
#: ../src/frogr-details-dialog.c:160
@@ -405,19 +405,19 @@ msgstr "Añadir Etiquetas�"
msgid "Add to _Groupâ?¦"
msgstr "Añadir a �lbumes�"
-#. Add to album
+#. Add to set
#: ../src/frogr-main-view.c:314 ../src/frogr-main-view.c:431
#, fuzzy
msgid "Add to Al_bum"
msgstr "Añadir a �lbumes"
#: ../src/frogr-main-view.c:321 ../src/frogr-main-view.c:437
-msgid "_Create New Albumâ?¦"
+msgid "_Create New Setâ?¦"
msgstr ""
#: ../src/frogr-main-view.c:328 ../src/frogr-main-view.c:444
#, fuzzy
-msgid "Add to _Existing Albumâ?¦"
+msgid "Add to _Existing Setâ?¦"
msgstr "Añadir a �lbumes�"
#: ../src/frogr-main-view.c:337
diff --git a/po/fr.po b/po/fr.po
index 5007ad6..1898485 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -32,18 +32,18 @@ msgstr "Saisissez une liste d'étiquettes séparées par des espaces :"
msgid "Add Tags"
msgstr "Ajouter des étiquettes"
-#: ../src/frogr-add-to-album-dialog.c:133
-msgid "Album Title"
+#: ../src/frogr-add-to-set-dialog.c:133
+msgid "Set Title"
msgstr "Titre de l'album"
-#: ../src/frogr-add-to-album-dialog.c:148
+#: ../src/frogr-add-to-set-dialog.c:148
#: ../src/frogr-add-to-group-dialog.c:148
msgid "Elements"
msgstr "�léments"
-#: ../src/frogr-add-to-album-dialog.c:577
+#: ../src/frogr-add-to-set-dialog.c:577
#, fuzzy
-msgid "Add to Albums"
+msgid "Add to Sets"
msgstr "Ajouter à l'album"
#: ../src/frogr-add-to-group-dialog.c:133
@@ -241,11 +241,11 @@ msgid "Retrieving list of tagsâ?¦"
msgstr ""
#: ../src/frogr-controller.c:1477 ../src/frogr-controller.c:1509
-msgid "Retrieving list of albumsâ?¦"
+msgid "Retrieving list of setsâ?¦"
msgstr ""
#: ../src/frogr-controller.c:1522
-msgid "No albums found"
+msgid "No sets found"
msgstr ""
#: ../src/frogr-controller.c:1544
@@ -267,21 +267,21 @@ msgstr ""
"Veuillez l'autoriser à nouveau."
#. This shows a dialog notifying the problem to the user
-#: ../src/frogr-create-new-album-dialog.c:120
+#: ../src/frogr-create-new-set-dialog.c:120
#: ../src/frogr-details-dialog.c:894
msgid "Missing data required"
msgstr "Données manquantes requises"
-#: ../src/frogr-create-new-album-dialog.c:304
-msgid "Album's title:"
+#: ../src/frogr-create-new-set-dialog.c:304
+msgid "Set's title:"
msgstr "Titre de l'album :"
-#: ../src/frogr-create-new-album-dialog.c:317
-msgid "Album's description:"
+#: ../src/frogr-create-new-set-dialog.c:317
+msgid "Set's description:"
msgstr "Description de l'album :"
-#: ../src/frogr-create-new-album-dialog.c:356
-msgid "Create new Album"
+#: ../src/frogr-create-new-set-dialog.c:356
+msgid "Create new Set"
msgstr "Créer un nouvel album"
#: ../src/frogr-details-dialog.c:160
@@ -416,19 +416,19 @@ msgstr "A_jouter des étiquettes�"
msgid "Add to _Groupâ?¦"
msgstr "Ajouter au _groupeâ?¦"
-#. Add to album
+#. Add to set
#: ../src/frogr-main-view.c:314 ../src/frogr-main-view.c:431
msgid "Add to Al_bum"
msgstr "Ajouter à l'al_bum"
#: ../src/frogr-main-view.c:321 ../src/frogr-main-view.c:437
#, fuzzy
-msgid "_Create New Albumâ?¦"
+msgid "_Create New Setâ?¦"
msgstr "Créer un nouvel album�"
#: ../src/frogr-main-view.c:328 ../src/frogr-main-view.c:444
#, fuzzy
-msgid "Add to _Existing Albumâ?¦"
+msgid "Add to _Existing Setâ?¦"
msgstr "Ajouter à un album existant�"
#: ../src/frogr-main-view.c:337
diff --git a/po/gl.po b/po/gl.po
index f9f6f5b..7e35d4b 100644
--- a/po/gl.po
+++ b/po/gl.po
@@ -41,17 +41,17 @@ msgstr "Escriba unha lista de etiquetas separadas por espacios:"
msgid "Add Tags"
msgstr "Engadir etiquetas"
-#: ../src/frogr-add-to-album-dialog.c:133
-msgid "Album Title"
+#: ../src/frogr-add-to-set-dialog.c:133
+msgid "Set Title"
msgstr "TÃtulo do álbum"
-#: ../src/frogr-add-to-album-dialog.c:148
+#: ../src/frogr-add-to-set-dialog.c:148
#: ../src/frogr-add-to-group-dialog.c:148
msgid "Elements"
msgstr "Elementos"
-#: ../src/frogr-add-to-album-dialog.c:577
-msgid "Add to Albums"
+#: ../src/frogr-add-to-set-dialog.c:577
+msgid "Add to Sets"
msgstr "Engadir aos álbums"
#: ../src/frogr-add-to-group-dialog.c:133
@@ -247,11 +247,11 @@ msgid "Retrieving list of tagsâ?¦"
msgstr "Obtendo a lista de etiquetas..."
#: ../src/frogr-controller.c:1477 ../src/frogr-controller.c:1509
-msgid "Retrieving list of albumsâ?¦"
+msgid "Retrieving list of setsâ?¦"
msgstr "Obtendo a lista de álbums..."
#: ../src/frogr-controller.c:1522
-msgid "No albums found"
+msgid "No sets found"
msgstr "Non se encontrou ningún álbum"
#: ../src/frogr-controller.c:1544
@@ -272,21 +272,21 @@ msgstr ""
"Por favor autorÃcelo de novo."
#. This shows a dialog notifying the problem to the user
-#: ../src/frogr-create-new-album-dialog.c:120
+#: ../src/frogr-create-new-set-dialog.c:120
#: ../src/frogr-details-dialog.c:894
msgid "Missing data required"
msgstr "Falta información necesaria"
-#: ../src/frogr-create-new-album-dialog.c:304
-msgid "Album's title:"
+#: ../src/frogr-create-new-set-dialog.c:304
+msgid "Set's title:"
msgstr "TÃtulo do álbum:"
-#: ../src/frogr-create-new-album-dialog.c:317
-msgid "Album's description:"
+#: ../src/frogr-create-new-set-dialog.c:317
+msgid "Set's description:"
msgstr "Descrición:"
-#: ../src/frogr-create-new-album-dialog.c:356
-msgid "Create new Album"
+#: ../src/frogr-create-new-set-dialog.c:356
+msgid "Create new Set"
msgstr "Crear novo álbum"
#: ../src/frogr-details-dialog.c:160
@@ -412,17 +412,17 @@ msgstr "Engadir _etiquetasâ?¦"
msgid "Add to _Groupâ?¦"
msgstr "Engaidr ao _grupoâ?¦"
-#. Add to album
+#. Add to set
#: ../src/frogr-main-view.c:314 ../src/frogr-main-view.c:431
msgid "Add to Al_bum"
msgstr "Engadir ao ál_bum..."
#: ../src/frogr-main-view.c:321 ../src/frogr-main-view.c:437
-msgid "_Create New Albumâ?¦"
+msgid "_Create New Setâ?¦"
msgstr "_Crear novo álbum..."
#: ../src/frogr-main-view.c:328 ../src/frogr-main-view.c:444
-msgid "Add to _Existing Albumâ?¦"
+msgid "Add to _Existing Setâ?¦"
msgstr "Engadir a un álbum _existente..."
#: ../src/frogr-main-view.c:337
diff --git a/po/sv.po b/po/sv.po
index 4c518f4..34fd3b7 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -40,17 +40,17 @@ msgstr ""
msgid "Add Tags"
msgstr "Lägg till taggar"
-#: ../src/frogr-add-to-album-dialog.c:133
-msgid "Album Title"
+#: ../src/frogr-add-to-set-dialog.c:133
+msgid "Set Title"
msgstr "Albumtitel"
-#: ../src/frogr-add-to-album-dialog.c:148
+#: ../src/frogr-add-to-set-dialog.c:148
#: ../src/frogr-add-to-group-dialog.c:148
msgid "Elements"
msgstr "Element"
-#: ../src/frogr-add-to-album-dialog.c:577
-msgid "Add to Albums"
+#: ../src/frogr-add-to-set-dialog.c:577
+msgid "Add to Sets"
msgstr "Lägg till i album"
#: ../src/frogr-add-to-group-dialog.c:133
@@ -210,11 +210,11 @@ msgstr ""
#: ../src/frogr-controller.c:1477
#: ../src/frogr-controller.c:1509
-msgid "Retrieving list of albumsâ?¦"
+msgid "Retrieving list of setsâ?¦"
msgstr ""
#: ../src/frogr-controller.c:1522
-msgid "No albums found"
+msgid "No sets found"
msgstr "Inga album hittades"
#: ../src/frogr-controller.c:1544
@@ -233,21 +233,21 @@ msgid ""
msgstr ""
#. This shows a dialog notifying the problem to the user
-#: ../src/frogr-create-new-album-dialog.c:120
+#: ../src/frogr-create-new-set-dialog.c:120
#: ../src/frogr-details-dialog.c:894
msgid "Missing data required"
msgstr ""
-#: ../src/frogr-create-new-album-dialog.c:304
-msgid "Album's title:"
+#: ../src/frogr-create-new-set-dialog.c:304
+msgid "Set's title:"
msgstr "Albumets titel:"
-#: ../src/frogr-create-new-album-dialog.c:317
-msgid "Album's description:"
+#: ../src/frogr-create-new-set-dialog.c:317
+msgid "Set's description:"
msgstr "Albumets beskrivning:"
-#: ../src/frogr-create-new-album-dialog.c:356
-msgid "Create new Album"
+#: ../src/frogr-create-new-set-dialog.c:356
+msgid "Create new Set"
msgstr "Skapa nytt album"
#: ../src/frogr-details-dialog.c:160
@@ -388,7 +388,7 @@ msgstr "Lägg till _taggar�"
msgid "Add to _Groupâ?¦"
msgstr "Lägg till i _grupp�"
-#. Add to album
+#. Add to set
#: ../src/frogr-main-view.c:314
#: ../src/frogr-main-view.c:431
msgid "Add to Al_bum"
@@ -396,12 +396,12 @@ msgstr "Lägg till i al_bum"
#: ../src/frogr-main-view.c:321
#: ../src/frogr-main-view.c:437
-msgid "_Create New Albumâ?¦"
+msgid "_Create New Setâ?¦"
msgstr "_Skapa nytt albumâ?¦"
#: ../src/frogr-main-view.c:328
#: ../src/frogr-main-view.c:444
-msgid "Add to _Existing Albumâ?¦"
+msgid "Add to _Existing Setâ?¦"
msgstr "Lägg till i _befintligt album�"
#: ../src/frogr-main-view.c:337
diff --git a/src/Makefile.am b/src/Makefile.am
index 1b457fc..130b496 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,20 +46,20 @@ frogr_SOURCES = \
frogr-account.h \
frogr-add-tags-dialog.c \
frogr-add-tags-dialog.h \
- frogr-add-to-album-dialog.c \
- frogr-add-to-album-dialog.h \
+ frogr-add-to-set-dialog.c \
+ frogr-add-to-set-dialog.h \
frogr-add-to-group-dialog.c \
frogr-add-to-group-dialog.h \
- frogr-album.c \
- frogr-album.h \
+ frogr-photoset.c \
+ frogr-photoset.h \
frogr-auth-dialog.c \
frogr-auth-dialog.h \
frogr-config.c \
frogr-config.h \
frogr-controller.c \
frogr-controller.h \
- frogr-create-new-album-dialog.c \
- frogr-create-new-album-dialog.h \
+ frogr-create-new-set-dialog.c \
+ frogr-create-new-set-dialog.h \
frogr-details-dialog.c \
frogr-details-dialog.h \
frogr-group.c \
diff --git a/src/frogr-add-to-group-dialog.c b/src/frogr-add-to-group-dialog.c
index 5de8e83..4d5d764 100644
--- a/src/frogr-add-to-group-dialog.c
+++ b/src/frogr-add-to-group-dialog.c
@@ -130,7 +130,7 @@ _create_tree_view (FrogrAddToGroupDialog *self)
/* Name */
rend = gtk_cell_renderer_text_new ();
- col = gtk_tree_view_column_new_with_attributes (_("Group Name"),
+ col = gtk_tree_view_column_new_with_attributes (_("Name"),
rend,
"text", NAME_COL,
NULL);
diff --git a/src/frogr-add-to-album-dialog.c b/src/frogr-add-to-set-dialog.c
similarity index 67%
rename from src/frogr-add-to-album-dialog.c
rename to src/frogr-add-to-set-dialog.c
index aa40ecf..335e5f3 100644
--- a/src/frogr-add-to-album-dialog.c
+++ b/src/frogr-add-to-set-dialog.c
@@ -1,5 +1,5 @@
/*
- * frogr-add-to-album-dialog.c -- 'Add to album' dialog
+ * frogr-add-to-set-dialog.c -- 'Add to set' dialog
*
* Copyright (C) 2010, 2011 Mario Sanchez Prada
* Authors: Mario Sanchez Prada <msanchez igalia com>
@@ -20,9 +20,9 @@
*
*/
-#include "frogr-add-to-album-dialog.h"
+#include "frogr-add-to-set-dialog.h"
-#include "frogr-album.h"
+#include "frogr-photoset.h"
#include "frogr-picture.h"
#include <config.h>
@@ -31,14 +31,14 @@
#define MINIMUM_WINDOW_WIDTH 540
#define MINIMUM_WINDOW_HEIGHT 420
-#define FROGR_ADD_TO_ALBUM_DIALOG_GET_PRIVATE(object) \
+#define FROGR_ADD_TO_SET_DIALOG_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- FROGR_TYPE_ADD_TO_ALBUM_DIALOG, \
- FrogrAddToAlbumDialogPrivate))
+ FROGR_TYPE_ADD_TO_SET_DIALOG, \
+ FrogrAddToSetDialogPrivate))
-G_DEFINE_TYPE (FrogrAddToAlbumDialog, frogr_add_to_album_dialog, GTK_TYPE_DIALOG);
+G_DEFINE_TYPE (FrogrAddToSetDialog, frogr_add_to_set_dialog, GTK_TYPE_DIALOG);
-typedef struct _FrogrAddToAlbumDialogPrivate {
+typedef struct _FrogrAddToSetDialogPrivate {
GtkWidget *treeview;
GtkTreeModel *treemodel;
@@ -47,14 +47,14 @@ typedef struct _FrogrAddToAlbumDialogPrivate {
GtkTreeViewColumn *n_elements_col;
GSList *pictures;
- GSList *albums;
-} FrogrAddToAlbumDialogPrivate;
+ GSList *sets;
+} FrogrAddToSetDialogPrivate;
/* Properties */
enum {
PROP_0,
PROP_PICTURES,
- PROP_ALBUMS
+ PROP_SETS
};
@@ -63,14 +63,14 @@ enum {
CHECKBOX_COL,
TITLE_COL,
N_ELEMENTS_COL,
- ALBUM_COL,
+ SET_COL,
N_COLS
};
/* Prototypes */
-static GtkWidget *_create_tree_view (FrogrAddToAlbumDialog *self);
+static GtkWidget *_create_tree_view (FrogrAddToSetDialog *self);
static void _column_clicked_cb (GtkTreeViewColumn *col, gpointer data);
@@ -83,31 +83,31 @@ static gint _tree_iter_compare_n_elements_func (GtkTreeModel *model,
GtkTreeIter *b,
gpointer data);
-static void _populate_treemodel_with_albums (FrogrAddToAlbumDialog *self);
+static void _populate_treemodel_with_sets (FrogrAddToSetDialog *self);
-static void _fill_dialog_with_data (FrogrAddToAlbumDialog *self);
+static void _fill_dialog_with_data (FrogrAddToSetDialog *self);
-static void _album_toggled_cb (GtkCellRendererToggle *celltoggle,
- gchar *path_string,
- GtkTreeView *treeview);
+static void _set_toggled_cb (GtkCellRendererToggle *celltoggle,
+ gchar *path_string,
+ GtkTreeView *treeview);
-static GSList *_get_selected_albums (FrogrAddToAlbumDialog *self);
+static GSList *_get_selected_sets (FrogrAddToSetDialog *self);
-static void _update_pictures (FrogrAddToAlbumDialog *self);
+static void _update_pictures (FrogrAddToSetDialog *self);
static void _dialog_response_cb (GtkDialog *dialog, gint response, gpointer data);
/* Private API */
static GtkWidget *
-_create_tree_view (FrogrAddToAlbumDialog *self)
+_create_tree_view (FrogrAddToSetDialog *self)
{
- FrogrAddToAlbumDialogPrivate *priv = NULL;
+ FrogrAddToSetDialogPrivate *priv = NULL;
GtkWidget *treeview = NULL;
GtkTreeViewColumn *col = NULL;
GtkCellRenderer *rend = NULL;
- priv = FROGR_ADD_TO_ALBUM_DIALOG_GET_PRIVATE (self);
+ priv = FROGR_ADD_TO_SET_DIALOG_GET_PRIVATE (self);
treeview = gtk_tree_view_new();
/* Checkbox */
@@ -121,7 +121,7 @@ _create_tree_view (FrogrAddToAlbumDialog *self)
gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), col);
g_signal_connect (rend, "toggled",
- G_CALLBACK (_album_toggled_cb), treeview);
+ G_CALLBACK (_set_toggled_cb), treeview);
g_signal_connect (col, "clicked",
G_CALLBACK (_column_clicked_cb), self);
@@ -130,7 +130,7 @@ _create_tree_view (FrogrAddToAlbumDialog *self)
/* Title */
rend = gtk_cell_renderer_text_new ();
- col = gtk_tree_view_column_new_with_attributes (_("Album Title"),
+ col = gtk_tree_view_column_new_with_attributes (_("Title"),
rend,
"text", TITLE_COL,
NULL);
@@ -164,12 +164,12 @@ _create_tree_view (FrogrAddToAlbumDialog *self)
static void
_column_clicked_cb (GtkTreeViewColumn *col, gpointer data)
{
- FrogrAddToAlbumDialog *self = NULL;
- FrogrAddToAlbumDialogPrivate *priv = NULL;
+ FrogrAddToSetDialog *self = NULL;
+ FrogrAddToSetDialogPrivate *priv = NULL;
GtkTreeModel *model = NULL;
- self = FROGR_ADD_TO_ALBUM_DIALOG (data);
- priv = FROGR_ADD_TO_ALBUM_DIALOG_GET_PRIVATE (self);
+ self = FROGR_ADD_TO_SET_DIALOG (data);
+ priv = FROGR_ADD_TO_SET_DIALOG_GET_PRIVATE (self);
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview));
if (!GTK_IS_TREE_SORTABLE (model))
@@ -233,68 +233,68 @@ _tree_iter_compare_n_elements_func (GtkTreeModel *model,
}
static void
-_populate_treemodel_with_albums (FrogrAddToAlbumDialog *self)
+_populate_treemodel_with_sets (FrogrAddToSetDialog *self)
{
- FrogrAddToAlbumDialogPrivate *priv = NULL;
- FrogrAlbum *album = NULL;
+ FrogrAddToSetDialogPrivate *priv = NULL;
+ FrogrPhotoSet *set = NULL;
GtkTreeIter iter;
GSList *current = NULL;
gchar *n_elements_str = NULL;
- priv = FROGR_ADD_TO_ALBUM_DIALOG_GET_PRIVATE (self);
+ priv = FROGR_ADD_TO_SET_DIALOG_GET_PRIVATE (self);
- for (current = priv->albums; current; current = g_slist_next (current))
+ for (current = priv->sets; current; current = g_slist_next (current))
{
- if (!FROGR_IS_ALBUM (current->data))
+ if (!FROGR_IS_SET (current->data))
continue;
- album = FROGR_ALBUM (current->data);
- n_elements_str = g_strdup_printf ("%d", frogr_album_get_n_photos (album));
+ set = FROGR_PHOTOSET (current->data);
+ n_elements_str = g_strdup_printf ("%d", frogr_photoset_get_n_photos (set));
gtk_list_store_append (GTK_LIST_STORE (priv->treemodel), &iter);
gtk_list_store_set (GTK_LIST_STORE (priv->treemodel), &iter,
CHECKBOX_COL, FALSE,
- TITLE_COL, frogr_album_get_title (album),
+ TITLE_COL, frogr_photoset_get_title (set),
N_ELEMENTS_COL, n_elements_str,
- ALBUM_COL, album,
+ SET_COL, set,
-1);
g_free (n_elements_str);
}
}
static void
-_fill_dialog_with_data (FrogrAddToAlbumDialog *self)
+_fill_dialog_with_data (FrogrAddToSetDialog *self)
{
- FrogrAddToAlbumDialogPrivate *priv = NULL;
+ FrogrAddToSetDialogPrivate *priv = NULL;
GtkTreeIter iter;
- gint n_albums;
+ gint n_sets;
gint n_pictures;
- priv = FROGR_ADD_TO_ALBUM_DIALOG_GET_PRIVATE (self);
- n_albums = g_slist_length (priv->albums);
+ priv = FROGR_ADD_TO_SET_DIALOG_GET_PRIVATE (self);
+ n_sets = g_slist_length (priv->sets);
n_pictures = g_slist_length (priv->pictures);
- /* No albums, nothing to do */
- if (n_albums == 0 || n_pictures == 0)
+ /* No sets, nothing to do */
+ if (n_sets == 0 || n_pictures == 0)
return;
/* Iterate over all the items */
gtk_tree_model_get_iter_first (priv->treemodel, &iter);
do
{
- FrogrAlbum *album = NULL;
+ FrogrPhotoSet *set = NULL;
GSList *p_item = NULL;
gboolean do_check = TRUE;
gtk_tree_model_get (GTK_TREE_MODEL (priv->treemodel), &iter,
- ALBUM_COL, &album, -1);
+ SET_COL, &set, -1);
for (p_item = priv->pictures; p_item; p_item = g_slist_next (p_item))
{
FrogrPicture *picture = NULL;
picture = FROGR_PICTURE (p_item->data);
- if (!frogr_picture_in_album (picture, album))
+ if (!frogr_picture_in_set (picture, set))
{
do_check = FALSE;
break;
@@ -308,9 +308,9 @@ _fill_dialog_with_data (FrogrAddToAlbumDialog *self)
}
static void
-_album_toggled_cb (GtkCellRendererToggle *celltoggle,
- gchar *path_string,
- GtkTreeView *treeview)
+_set_toggled_cb (GtkCellRendererToggle *celltoggle,
+ gchar *path_string,
+ GtkTreeView *treeview)
{
GtkTreeModel *model = NULL;
GtkTreePath *path;
@@ -333,18 +333,18 @@ _album_toggled_cb (GtkCellRendererToggle *celltoggle,
}
static GSList *
-_get_selected_albums (FrogrAddToAlbumDialog *self)
+_get_selected_sets (FrogrAddToSetDialog *self)
{
- FrogrAddToAlbumDialogPrivate *priv = NULL;
+ FrogrAddToSetDialogPrivate *priv = NULL;
GtkTreeIter iter;
gboolean selected = FALSE;
- FrogrAlbum *album = NULL;
- GSList *selected_albums = NULL;
+ FrogrPhotoSet *set = NULL;
+ GSList *selected_sets = NULL;
- priv = FROGR_ADD_TO_ALBUM_DIALOG_GET_PRIVATE (self);
+ priv = FROGR_ADD_TO_SET_DIALOG_GET_PRIVATE (self);
- /* No albums, nothing to do */
- if (g_slist_length (priv->albums) == 0)
+ /* No sets, nothing to do */
+ if (g_slist_length (priv->sets) == 0)
return NULL;
/* Iterate over all the items */
@@ -357,38 +357,38 @@ _get_selected_albums (FrogrAddToAlbumDialog *self)
continue;
gtk_tree_model_get (GTK_TREE_MODEL (priv->treemodel), &iter,
- ALBUM_COL, &album, -1);
+ SET_COL, &set, -1);
- if (FROGR_IS_ALBUM (album))
+ if (FROGR_IS_SET (set))
{
- selected_albums = g_slist_append (selected_albums, album);
- g_object_ref (album);
+ selected_sets = g_slist_append (selected_sets, set);
+ g_object_ref (set);
}
}
while (gtk_tree_model_iter_next (priv->treemodel, &iter));
- return selected_albums;
+ return selected_sets;
}
static void
-_update_pictures (FrogrAddToAlbumDialog *self)
+_update_pictures (FrogrAddToSetDialog *self)
{
- FrogrAddToAlbumDialogPrivate *priv = NULL;
+ FrogrAddToSetDialogPrivate *priv = NULL;
FrogrPicture *picture = NULL;
- GSList *selected_albums = NULL;
+ GSList *selected_sets = NULL;
GSList *item = NULL;
- priv = FROGR_ADD_TO_ALBUM_DIALOG_GET_PRIVATE (self);
+ priv = FROGR_ADD_TO_SET_DIALOG_GET_PRIVATE (self);
- selected_albums = _get_selected_albums (self);
+ selected_sets = _get_selected_sets (self);
for (item = priv->pictures; item; item = g_slist_next (item))
{
picture = FROGR_PICTURE (item->data);
- frogr_picture_set_albums (picture, selected_albums);
+ frogr_picture_set_sets (picture, selected_sets);
}
- g_slist_foreach (selected_albums, (GFunc)g_object_unref, NULL);
- g_slist_free (selected_albums);
+ g_slist_foreach (selected_sets, (GFunc)g_object_unref, NULL);
+ g_slist_free (selected_sets);
}
static void
@@ -396,9 +396,9 @@ _dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
{
if (response == GTK_RESPONSE_OK)
{
- FrogrAddToAlbumDialog *self = NULL;
+ FrogrAddToSetDialog *self = NULL;
- self = FROGR_ADD_TO_ALBUM_DIALOG (dialog);
+ self = FROGR_ADD_TO_SET_DIALOG (dialog);
_update_pictures (self);
}
@@ -407,20 +407,20 @@ _dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
}
static void
-_frogr_add_to_album_dialog_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+_frogr_add_to_set_dialog_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- FrogrAddToAlbumDialogPrivate *priv = FROGR_ADD_TO_ALBUM_DIALOG_GET_PRIVATE (object);
+ FrogrAddToSetDialogPrivate *priv = FROGR_ADD_TO_SET_DIALOG_GET_PRIVATE (object);
switch (prop_id)
{
case PROP_PICTURES:
priv->pictures = (GSList *) g_value_get_pointer (value);
break;
- case PROP_ALBUMS:
- priv->albums = (GSList *) g_value_get_pointer (value);
+ case PROP_SETS:
+ priv->sets = (GSList *) g_value_get_pointer (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -429,20 +429,20 @@ _frogr_add_to_album_dialog_set_property (GObject *object,
}
static void
-_frogr_add_to_album_dialog_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+_frogr_add_to_set_dialog_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- FrogrAddToAlbumDialogPrivate *priv = FROGR_ADD_TO_ALBUM_DIALOG_GET_PRIVATE (object);
+ FrogrAddToSetDialogPrivate *priv = FROGR_ADD_TO_SET_DIALOG_GET_PRIVATE (object);
switch (prop_id)
{
case PROP_PICTURES:
g_value_set_pointer (value, priv->pictures);
break;
- case PROP_ALBUMS:
- g_value_set_pointer (value, priv->albums);
+ case PROP_SETS:
+ g_value_set_pointer (value, priv->sets);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -451,9 +451,9 @@ _frogr_add_to_album_dialog_get_property (GObject *object,
}
static void
-_frogr_add_to_album_dialog_dispose (GObject *object)
+_frogr_add_to_set_dialog_dispose (GObject *object)
{
- FrogrAddToAlbumDialogPrivate *priv = FROGR_ADD_TO_ALBUM_DIALOG_GET_PRIVATE (object);
+ FrogrAddToSetDialogPrivate *priv = FROGR_ADD_TO_SET_DIALOG_GET_PRIVATE (object);
if (priv->pictures)
{
@@ -462,8 +462,8 @@ _frogr_add_to_album_dialog_dispose (GObject *object)
priv->pictures = NULL;
}
- if (priv->albums)
- priv->albums = NULL;
+ if (priv->sets)
+ priv->sets = NULL;
if (priv->treemodel)
{
@@ -471,50 +471,50 @@ _frogr_add_to_album_dialog_dispose (GObject *object)
priv->treemodel = NULL;
}
- G_OBJECT_CLASS(frogr_add_to_album_dialog_parent_class)->dispose (object);
+ G_OBJECT_CLASS(frogr_add_to_set_dialog_parent_class)->dispose (object);
}
static void
-frogr_add_to_album_dialog_class_init (FrogrAddToAlbumDialogClass *klass)
+frogr_add_to_set_dialog_class_init (FrogrAddToSetDialogClass *klass)
{
GObjectClass *obj_class = (GObjectClass *)klass;
GParamSpec *pspec;
/* GObject signals */
- obj_class->set_property = _frogr_add_to_album_dialog_set_property;
- obj_class->get_property = _frogr_add_to_album_dialog_get_property;
- obj_class->dispose = _frogr_add_to_album_dialog_dispose;
+ obj_class->set_property = _frogr_add_to_set_dialog_set_property;
+ obj_class->get_property = _frogr_add_to_set_dialog_get_property;
+ obj_class->dispose = _frogr_add_to_set_dialog_dispose;
/* Install properties */
pspec = g_param_spec_pointer ("pictures",
"pictures",
"List of pictures for "
- "the 'add to album' dialog",
+ "the 'add to set' dialog",
G_PARAM_READWRITE
| G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_property (obj_class, PROP_PICTURES, pspec);
- pspec = g_param_spec_pointer ("albums",
- "albums",
- "List of albums currently available "
- "for the 'add to album' dialog",
+ pspec = g_param_spec_pointer ("sets",
+ "sets",
+ "List of sets currently available "
+ "for the 'add to set' dialog",
G_PARAM_READWRITE
| G_PARAM_CONSTRUCT_ONLY);
- g_object_class_install_property (obj_class, PROP_ALBUMS, pspec);
+ g_object_class_install_property (obj_class, PROP_SETS, pspec);
- g_type_class_add_private (obj_class, sizeof (FrogrAddToAlbumDialogPrivate));
+ g_type_class_add_private (obj_class, sizeof (FrogrAddToSetDialogPrivate));
}
static void
-frogr_add_to_album_dialog_init (FrogrAddToAlbumDialog *self)
+frogr_add_to_set_dialog_init (FrogrAddToSetDialog *self)
{
- FrogrAddToAlbumDialogPrivate *priv = NULL;
+ FrogrAddToSetDialogPrivate *priv = NULL;
GtkWidget *vbox = NULL;
GtkWidget *widget = NULL;
- priv = FROGR_ADD_TO_ALBUM_DIALOG_GET_PRIVATE (self);
+ priv = FROGR_ADD_TO_SET_DIALOG_GET_PRIVATE (self);
priv->pictures = NULL;
- priv->albums = NULL;
+ priv->sets = NULL;
/* Create widgets */
gtk_dialog_add_buttons (GTK_DIALOG (self),
@@ -568,23 +568,23 @@ frogr_add_to_album_dialog_init (FrogrAddToAlbumDialog *self)
/* Public API */
void
-frogr_add_to_album_dialog_show (GtkWindow *parent, GSList *pictures, GSList *albums)
+frogr_add_to_set_dialog_show (GtkWindow *parent, GSList *pictures, GSList *sets)
{
- FrogrAddToAlbumDialog *self = NULL;
+ FrogrAddToSetDialog *self = NULL;
GObject *new = NULL;
- new = g_object_new (FROGR_TYPE_ADD_TO_ALBUM_DIALOG,
- "title", _("Add to Albums"),
+ new = g_object_new (FROGR_TYPE_ADD_TO_SET_DIALOG,
+ "title", _("Add to Sets"),
"modal", TRUE,
"pictures", pictures,
- "albums", albums,
+ "sets", sets,
"transient-for", parent,
"resizable", TRUE,
NULL);
- self = FROGR_ADD_TO_ALBUM_DIALOG (new);
+ self = FROGR_ADD_TO_SET_DIALOG (new);
- _populate_treemodel_with_albums (self);
+ _populate_treemodel_with_sets (self);
_fill_dialog_with_data (self);
gtk_widget_show_all (GTK_WIDGET (self));
diff --git a/src/frogr-add-to-set-dialog.h b/src/frogr-add-to-set-dialog.h
new file mode 100644
index 0000000..4f6ceca
--- /dev/null
+++ b/src/frogr-add-to-set-dialog.h
@@ -0,0 +1,58 @@
+/*
+ * frogr-add-to-set-dialog.h -- 'Add to set' dialog
+ *
+ * Copyright (C) 2010, 2011 Mario Sanchez Prada
+ * Authors: Mario Sanchez Prada <msanchez igalia com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 3 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef FROGR_ADD_TO_SET_DIALOG_H
+#define FROGR_ADD_TO_SET_DIALOG_H
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define FROGR_TYPE_ADD_TO_SET_DIALOG (frogr_add_to_set_dialog_get_type())
+#define FROGR_ADD_TO_SET_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, FROGR_TYPE_ADD_TO_SET_DIALOG, FrogrAddToSetDialog))
+#define FROGR_ADD_TO_SET_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST(klass, FROGR_TYPE_ADD_TO_SET_DIALOG, FrogrAddToSetDialogClass))
+#define FROGR_IS_ADD_TO_SET_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, FROGR_TYPE_ADD_TO_SET_DIALOG))
+#define FROGR_IS_ADD_TO_SET_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), FROGR_TYPE_ADD_TO_SET_DIALOG))
+#define FROGR_ADD_TO_SET_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FROGR_TYPE_ADD_TO_SET_DIALOG, FrogrAddToSetDialogClass))
+
+typedef struct _FrogrAddToSetDialog FrogrAddToSetDialog;
+typedef struct _FrogrAddToSetDialogClass FrogrAddToSetDialogClass;
+
+struct _FrogrAddToSetDialogClass
+{
+ GtkDialogClass parent_class;
+};
+
+struct _FrogrAddToSetDialog
+{
+ GtkDialog parent;
+};
+
+GType frogr_add_to_set_dialog_get_type (void) G_GNUC_CONST;
+
+void frogr_add_to_set_dialog_show (GtkWindow *parent,
+ GSList *pictures,
+ GSList *sets);
+
+G_END_DECLS /* FROGR_ADD_TO_SET_DIALOG_H */
+
+#endif
diff --git a/src/frogr-controller.c b/src/frogr-controller.c
index 33917c7..2b92bf9 100644
--- a/src/frogr-controller.c
+++ b/src/frogr-controller.c
@@ -26,11 +26,11 @@
#include "frogr-about-dialog.h"
#include "frogr-account.h"
#include "frogr-add-tags-dialog.h"
-#include "frogr-add-to-album-dialog.h"
+#include "frogr-add-to-set-dialog.h"
#include "frogr-add-to-group-dialog.h"
#include "frogr-auth-dialog.h"
#include "frogr-config.h"
-#include "frogr-create-new-album-dialog.h"
+#include "frogr-create-new-set-dialog.h"
#include "frogr-details-dialog.h"
#include "frogr-main-view.h"
#include "frogr-picture-loader.h"
@@ -74,15 +74,15 @@ struct _FrogrControllerPrivate
gboolean uploading_picture;
gboolean fetching_account_info;
gboolean fetching_account_extra_info;
- gboolean fetching_albums;
+ gboolean fetching_sets;
gboolean fetching_groups;
gboolean fetching_tags;
- gboolean adding_to_album;
+ gboolean adding_to_set;
gboolean adding_to_group;
/* We use these to know when an empty list of tags means that the
user has no tags at all, as fetching already happened before */
- gboolean albums_fetched;
+ gboolean sets_fetched;
gboolean groups_fetched;
gboolean tags_fetched;
};
@@ -107,7 +107,7 @@ static FrogrController *_instance = NULL;
typedef struct {
FrogrController *controller;
FrogrPicture *picture;
- GSList *albums;
+ GSList *sets;
GSList *groups;
FrogrPictureUploadedCallback callback;
GObject *object;
@@ -138,10 +138,10 @@ static void _upload_picture (FrogrController *self, FrogrPicture *picture,
static void _upload_picture_cb (GObject *object, GAsyncResult *res, gpointer data);
-static gboolean _create_album_or_add_picture (FrogrController *self,
- GSList *albums,
- FrogrPicture *picture,
- upload_picture_st *up_st);
+static gboolean _create_set_or_add_picture (FrogrController *self,
+ GSList *sets,
+ FrogrPicture *picture,
+ upload_picture_st *up_st);
static void _create_photoset_cb (GObject *object, GAsyncResult *res, gpointer data);
@@ -153,13 +153,13 @@ static gboolean _add_picture_to_groups_on_idle (gpointer data);
static gboolean _complete_picture_upload_on_idle (gpointer data);
-static void _notify_creating_album (FrogrController *self,
- FrogrPicture *picture,
- FrogrAlbum *album);
+static void _notify_creating_set (FrogrController *self,
+ FrogrPicture *picture,
+ FrogrPhotoSet *set);
-static void _notify_adding_to_album (FrogrController *self,
- FrogrPicture *picture,
- FrogrAlbum *album);
+static void _notify_adding_to_set (FrogrController *self,
+ FrogrPicture *picture,
+ FrogrPhotoSet *set);
static void _notify_adding_to_group (FrogrController *self,
FrogrPicture *picture,
@@ -178,9 +178,9 @@ static void _open_browser_to_edit_details (FrogrController *self);
static void _fetch_everything (FrogrController *self);
-static void _fetch_albums (FrogrController *self);
+static void _fetch_sets (FrogrController *self);
-static void _fetch_albums_cb (GObject *object, GAsyncResult *res, gpointer data);
+static void _fetch_sets_cb (GObject *object, GAsyncResult *res, gpointer data);
static void _fetch_groups (FrogrController *self);
@@ -202,9 +202,9 @@ static gboolean _show_details_dialog_on_idle (GSList *pictures);
static gboolean _show_add_tags_dialog_on_idle (GSList *pictures);
-static gboolean _show_create_new_album_dialog_on_idle (GSList *pictures);
+static gboolean _show_create_new_set_dialog_on_idle (GSList *pictures);
-static gboolean _show_add_to_album_dialog_on_idle (GSList *pictures);
+static gboolean _show_add_to_set_dialog_on_idle (GSList *pictures);
static gboolean _show_add_to_group_dialog_on_idle (GSList *pictures);
@@ -476,7 +476,7 @@ _upload_picture (FrogrController *self, FrogrPicture *picture,
up_st = g_slice_new0 (upload_picture_st);
up_st->controller = self;
up_st->picture = picture;
- up_st->albums = NULL;
+ up_st->sets = NULL;
up_st->groups = NULL;
up_st->callback = picture_uploaded_cb;
up_st->object = object;
@@ -534,22 +534,22 @@ _upload_picture_cb (GObject *object, GAsyncResult *res, gpointer data)
priv = FROGR_CONTROLLER_GET_PRIVATE (controller);
priv->uploading_picture = FALSE;
- /* Check whether it's needed or not to add the picture to the album */
+ /* Check whether it's needed or not to add the picture to the set */
if (!error)
{
- GSList *albums = NULL;
+ GSList *sets = NULL;
GSList *groups = NULL;
- albums = frogr_picture_get_albums (picture);
+ sets = frogr_picture_get_sets (picture);
groups = frogr_picture_get_groups (picture);
- if (g_slist_length (albums) > 0)
+ if (g_slist_length (sets) > 0)
{
- priv->adding_to_album = TRUE;
- _create_album_or_add_picture (controller, albums, picture, up_st);
+ priv->adding_to_set = TRUE;
+ _create_set_or_add_picture (controller, sets, picture, up_st);
}
- /* Pictures will be added to groups AFTER being added to albums,
+ /* Pictures will be added to groups AFTER being added to sets,
so that's why we don't start the process now but on idle */
if (g_slist_length (groups) > 0)
{
@@ -564,42 +564,42 @@ _upload_picture_cb (GObject *object, GAsyncResult *res, gpointer data)
}
static gboolean
-_create_album_or_add_picture (FrogrController *self,
- GSList *albums,
- FrogrPicture *picture,
- upload_picture_st *up_st)
+_create_set_or_add_picture (FrogrController *self,
+ GSList *sets,
+ FrogrPicture *picture,
+ upload_picture_st *up_st)
{
gboolean result = FALSE;
- if (g_slist_length (albums) > 0)
+ if (g_slist_length (sets) > 0)
{
FrogrControllerPrivate *priv = NULL;
- FrogrAlbum *album = NULL;
+ FrogrPhotoSet *set = NULL;
const gchar *id = NULL;
priv = FROGR_CONTROLLER_GET_PRIVATE (self);
- album = FROGR_ALBUM (albums->data);
- up_st->albums = albums;
+ set = FROGR_PHOTOSET (sets->data);
+ up_st->sets = sets;
- id = frogr_album_get_id (album);
+ id = frogr_photoset_get_id (set);
if (id != NULL)
{
- /* Album with ID: Add picture to it */
- _notify_adding_to_album (self, picture, album);
+ /* Set with ID: Add picture to it */
+ _notify_adding_to_set (self, picture, set);
fsp_session_add_to_photoset_async (priv->session,
frogr_picture_get_id (picture),
- frogr_album_get_id (album),
+ frogr_photoset_get_id (set),
priv->cancellable,
_add_to_photoset_cb,
up_st);
}
else
{
- /* Album with ID: Create album aliong with this picture */
- _notify_creating_album (self, picture, album);
+ /* Set with ID: Create set aliong with this picture */
+ _notify_creating_set (self, picture, set);
fsp_session_create_photoset_async (priv->session,
- frogr_album_get_title (album),
- frogr_album_get_description (album),
+ frogr_photoset_get_title (set),
+ frogr_photoset_get_description (set),
frogr_picture_get_id (picture),
priv->cancellable,
_create_photoset_cb,
@@ -620,8 +620,8 @@ _create_photoset_cb (GObject *object, GAsyncResult *res, gpointer data)
FrogrController *controller = NULL;
FrogrControllerPrivate *priv = NULL;
FrogrPicture *picture = NULL;
- FrogrAlbum *album = NULL;
- GSList *albums = NULL;
+ FrogrPhotoSet *set = NULL;
+ GSList *sets = NULL;
gchar *photoset_id = NULL;
GError *error = NULL;
gboolean keep_going = FALSE;
@@ -630,35 +630,35 @@ _create_photoset_cb (GObject *object, GAsyncResult *res, gpointer data)
up_st = (upload_picture_st*) data;
controller = up_st->controller;
picture = up_st->picture;
- albums = up_st->albums;
+ sets = up_st->sets;
photoset_id = fsp_session_create_photoset_finish (session, res, &error);
up_st->error = error;
- /* Update album with the new ID */
- album = FROGR_ALBUM (albums->data);
- frogr_album_set_id (album, photoset_id);
+ /* Update set with the new ID */
+ set = FROGR_PHOTOSET (sets->data);
+ frogr_photoset_set_id (set, photoset_id);
g_free (photoset_id);
priv = FROGR_CONTROLLER_GET_PRIVATE (controller);
- albums = g_slist_next (albums);
+ sets = g_slist_next (sets);
- /* When adding pictures to albums, we only stop if the process was
+ /* When adding pictures to sets, we only stop if the process was
not explicitly cancelled by the user */
if (!error || error->code != FSP_ERROR_CANCELLED)
- keep_going = _create_album_or_add_picture (controller, albums, picture, up_st);
+ keep_going = _create_set_or_add_picture (controller, sets, picture, up_st);
if (error && error->code != FSP_ERROR_CANCELLED)
{
/* We plainly ignore errors in this stage, as we don't want
them to interrupt the global upload process */
- g_debug ("Error creating album: %s", error->message);
+ g_debug ("Error creating set: %s", error->message);
g_error_free (error);
up_st->error = NULL;
}
if (!keep_going)
- priv->adding_to_album = FALSE;
+ priv->adding_to_set = FALSE;
}
static void
@@ -669,7 +669,7 @@ _add_to_photoset_cb (GObject *object, GAsyncResult *res, gpointer data)
FrogrController *controller = NULL;
FrogrControllerPrivate *priv = NULL;
FrogrPicture *picture = NULL;
- GSList *albums = NULL;
+ GSList *sets = NULL;
GError *error = NULL;
gboolean keep_going = FALSE;
@@ -677,30 +677,30 @@ _add_to_photoset_cb (GObject *object, GAsyncResult *res, gpointer data)
up_st = (upload_picture_st*) data;
controller = up_st->controller;
picture = up_st->picture;
- albums = up_st->albums;
+ sets = up_st->sets;
fsp_session_add_to_photoset_finish (session, res, &error);
up_st->error = error;
priv = FROGR_CONTROLLER_GET_PRIVATE (controller);
- albums = g_slist_next (albums);
+ sets = g_slist_next (sets);
- /* When adding pictures to albums, we only stop if the process was
+ /* When adding pictures to sets, we only stop if the process was
not explicitly cancelled by the user */
if (!error || error->code != FSP_ERROR_CANCELLED)
- keep_going = _create_album_or_add_picture (controller, albums, picture, up_st);
+ keep_going = _create_set_or_add_picture (controller, sets, picture, up_st);
if (error && error->code != FSP_ERROR_CANCELLED)
{
/* We plainly ignore errors in this stage, as we don't want
them to interrupt the global upload process */
- g_debug ("Error adding picture to album: %s", error->message);
+ g_debug ("Error adding picture to set: %s", error->message);
g_error_free (error);
up_st->error = NULL;
}
if (!keep_going)
- priv->adding_to_album = FALSE;
+ priv->adding_to_set = FALSE;
}
static void
@@ -781,7 +781,7 @@ _add_picture_to_groups_on_idle (gpointer data)
session = priv->session;
/* Keep the source while busy */
- if (priv->adding_to_album)
+ if (priv->adding_to_set)
return TRUE;
/* Mark the start of the process */
@@ -817,7 +817,7 @@ _complete_picture_upload_on_idle (gpointer data)
priv = FROGR_CONTROLLER_GET_PRIVATE (controller);
/* Keep the source while busy */
- if (priv->adding_to_album || priv->adding_to_group)
+ if (priv->adding_to_set || priv->adding_to_group)
return TRUE;
picture = up_st->picture;
@@ -836,14 +836,14 @@ _complete_picture_upload_on_idle (gpointer data)
}
static void
-_notify_creating_album (FrogrController *self,
- FrogrPicture *picture,
- FrogrAlbum *album)
+_notify_creating_set (FrogrController *self,
+ FrogrPicture *picture,
+ FrogrPhotoSet *set)
{
FrogrControllerPrivate *priv = NULL;
const gchar *picture_title = NULL;
- const gchar *album_title = NULL;
- const gchar *album_desc = NULL;
+ const gchar *set_title = NULL;
+ const gchar *set_desc = NULL;
gchar *progress_text = NULL;
priv = FROGR_CONTROLLER_GET_PRIVATE (self);
@@ -851,24 +851,24 @@ _notify_creating_album (FrogrController *self,
_("Creating new photosetâ?¦"));
picture_title = frogr_picture_get_title (picture);
- album_title = frogr_album_get_title (album);
- album_desc = frogr_album_get_description (album);
+ set_title = frogr_photoset_get_title (set);
+ set_desc = frogr_photoset_get_description (set);
progress_text = g_strdup_printf ("Creating new photoset for picture %s. "
"Title: %s / Description: %s",
- picture_title, album_title, album_desc);
+ picture_title, set_title, set_desc);
g_debug ("%s", progress_text);
g_free (progress_text);
}
static void
-_notify_adding_to_album (FrogrController *self,
- FrogrPicture *picture,
- FrogrAlbum *album)
+_notify_adding_to_set (FrogrController *self,
+ FrogrPicture *picture,
+ FrogrPhotoSet *set)
{
FrogrControllerPrivate *priv = NULL;
const gchar *picture_title = NULL;
- const gchar *album_title = NULL;
+ const gchar *set_title = NULL;
gchar *progress_text = NULL;
priv = FROGR_CONTROLLER_GET_PRIVATE (self);
@@ -876,9 +876,9 @@ _notify_adding_to_album (FrogrController *self,
_("Adding picture to photosetâ?¦"));
picture_title = frogr_picture_get_title (picture);
- album_title = frogr_album_get_title (album);
+ set_title = frogr_photoset_get_title (set);
progress_text = g_strdup_printf ("Adding picture %s to photoset %sâ?¦",
- picture_title, album_title);
+ picture_title, set_title);
g_debug ("%s", progress_text);
g_free (progress_text);
@@ -963,8 +963,8 @@ _on_pictures_uploaded (FrogrController *self,
window = frogr_main_view_get_window (priv->mainview);
frogr_util_show_info_dialog (window, _("Operation successfully completed!"));
- /* Fetch albums and tags right after finishing */
- _fetch_albums (self);
+ /* Fetch sets and tags right after finishing */
+ _fetch_sets (self);
_fetch_tags (self);
g_debug ("%s", "Success uploading pictures!");
@@ -1034,13 +1034,13 @@ _fetch_everything (FrogrController *self)
_fetch_account_info (self);
_fetch_account_extra_info (self);
- _fetch_albums (self);
+ _fetch_sets (self);
_fetch_groups (self);
_fetch_tags (self);
}
static void
-_fetch_albums (FrogrController *self)
+_fetch_sets (FrogrController *self)
{
g_return_if_fail(FROGR_IS_CONTROLLER (self));
@@ -1050,15 +1050,15 @@ _fetch_albums (FrogrController *self)
return;
priv = FROGR_CONTROLLER_GET_PRIVATE (self);
- priv->fetching_albums = TRUE;
+ priv->fetching_sets = TRUE;
_enable_cancellable (self, TRUE);
fsp_session_get_photosets_async (priv->session, priv->cancellable,
- _fetch_albums_cb, self);
+ _fetch_sets_cb, self);
}
static void
-_fetch_albums_cb (GObject *object, GAsyncResult *res, gpointer data)
+_fetch_sets_cb (GObject *object, GAsyncResult *res, gpointer data)
{
FspSession *session = NULL;
FrogrController *controller = NULL;
@@ -1073,7 +1073,7 @@ _fetch_albums_cb (GObject *object, GAsyncResult *res, gpointer data)
photosets_list = fsp_session_get_photosets_finish (session, res, &error);
if (error != NULL)
{
- g_debug ("Fetching list of albums: %s", error->message);
+ g_debug ("Fetching list of sets: %s", error->message);
if (error->code == FSP_ERROR_NOT_AUTHENTICATED)
frogr_controller_revoke_authorization (controller);
@@ -1083,27 +1083,27 @@ _fetch_albums_cb (GObject *object, GAsyncResult *res, gpointer data)
else
{
FrogrMainViewModel *mainview_model = NULL;
- GSList *albums_list = NULL;
+ GSList *sets_list = NULL;
- priv->albums_fetched = TRUE;
+ priv->sets_fetched = TRUE;
if (photosets_list)
{
GSList *item = NULL;
- FspDataPhotoSet *current_photoset = NULL;
- FrogrAlbum *current_album = NULL;
+ FspDataPhotoSet *current_data_set = NULL;
+ FrogrPhotoSet *current_set = NULL;
for (item = photosets_list; item; item = g_slist_next (item))
{
- current_photoset = FSP_DATA_PHOTO_SET (item->data);
- current_album = frogr_album_new (current_photoset->title,
- current_photoset->description);
- frogr_album_set_id (current_album, current_photoset->id);
- frogr_album_set_primary_photo_id (current_album, current_photoset->primary_photo_id);
- frogr_album_set_n_photos (current_album, current_photoset->n_photos);
+ current_data_set = FSP_DATA_PHOTO_SET (item->data);
+ current_set = frogr_photoset_new (current_data_set->title,
+ current_data_set->description);
+ frogr_photoset_set_id (current_set, current_data_set->id);
+ frogr_photoset_set_primary_photo_id (current_set, current_data_set->primary_photo_id);
+ frogr_photoset_set_n_photos (current_set, current_data_set->n_photos);
- albums_list = g_slist_append (albums_list, current_album);
+ sets_list = g_slist_append (sets_list, current_set);
- fsp_data_free (FSP_DATA (current_photoset));
+ fsp_data_free (FSP_DATA (current_data_set));
}
g_slist_free (photosets_list);
@@ -1111,10 +1111,10 @@ _fetch_albums_cb (GObject *object, GAsyncResult *res, gpointer data)
/* Update main view's model */
mainview_model = frogr_main_view_get_model (priv->mainview);
- frogr_main_view_model_set_albums (mainview_model, albums_list);
+ frogr_main_view_model_set_sets (mainview_model, sets_list);
}
- priv->fetching_albums = FALSE;
+ priv->fetching_sets = FALSE;
}
static void
@@ -1417,7 +1417,7 @@ _show_details_dialog_on_idle (GSList *pictures)
mainview_model = frogr_main_view_get_model (priv->mainview);
tags_list = frogr_main_view_model_get_tags_list (mainview_model);
- /* Albums already pre-fetched: show the dialog */
+ /* Sets already pre-fetched: show the dialog */
window = frogr_main_view_get_window (priv->mainview);
frogr_details_dialog_show (window, pictures, tags_list);
@@ -1450,7 +1450,7 @@ _show_add_tags_dialog_on_idle (GSList *pictures)
mainview_model = frogr_main_view_get_model (priv->mainview);
tags_list = frogr_main_view_model_get_tags_list (mainview_model);
- /* Albums already pre-fetched: show the dialog */
+ /* Sets already pre-fetched: show the dialog */
window = frogr_main_view_get_window (priv->mainview);
frogr_add_tags_dialog_show (window, pictures, tags_list);
@@ -1458,68 +1458,68 @@ _show_add_tags_dialog_on_idle (GSList *pictures)
}
static gboolean
-_show_create_new_album_dialog_on_idle (GSList *pictures)
+_show_create_new_set_dialog_on_idle (GSList *pictures)
{
FrogrController *controller = NULL;
FrogrControllerPrivate *priv = NULL;
FrogrMainView *mainview = NULL;
FrogrMainViewModel *mainview_model = NULL;
GtkWindow *window = NULL;
- GSList *albums = NULL;
+ GSList *sets = NULL;
controller = frogr_controller_get_instance ();
priv = FROGR_CONTROLLER_GET_PRIVATE (controller);
mainview = priv->mainview;
/* Keep the source while internally busy */
- if (priv->fetching_albums)
+ if (priv->fetching_sets)
{
- frogr_main_view_set_progress_text (mainview, _("Retrieving list of albumsâ?¦"));
+ frogr_main_view_set_progress_text (mainview, _("Retrieving list of setsâ?¦"));
frogr_main_view_pulse_progress (mainview);
return TRUE;
}
frogr_main_view_hide_progress (mainview);
mainview_model = frogr_main_view_get_model (priv->mainview);
- albums = frogr_main_view_model_get_albums (mainview_model);
+ sets = frogr_main_view_model_get_sets (mainview_model);
window = frogr_main_view_get_window (priv->mainview);
- frogr_create_new_album_dialog_show (window, pictures, albums);
+ frogr_create_new_set_dialog_show (window, pictures, sets);
return FALSE;
}
static gboolean
-_show_add_to_album_dialog_on_idle (GSList *pictures)
+_show_add_to_set_dialog_on_idle (GSList *pictures)
{
FrogrController *controller = NULL;
FrogrControllerPrivate *priv = NULL;
FrogrMainView *mainview = NULL;
FrogrMainViewModel *mainview_model = NULL;
GtkWindow *window = NULL;
- GSList *albums = NULL;
+ GSList *sets = NULL;
controller = frogr_controller_get_instance ();
priv = FROGR_CONTROLLER_GET_PRIVATE (controller);
mainview = priv->mainview;
/* Keep the source while internally busy */
- if (priv->fetching_albums)
+ if (priv->fetching_sets)
{
- frogr_main_view_set_progress_text (mainview, _("Retrieving list of albumsâ?¦"));
+ frogr_main_view_set_progress_text (mainview, _("Retrieving list of setsâ?¦"));
frogr_main_view_pulse_progress (mainview);
return TRUE;
}
frogr_main_view_hide_progress (mainview);
mainview_model = frogr_main_view_get_model (priv->mainview);
- albums = frogr_main_view_model_get_albums (mainview_model);
+ sets = frogr_main_view_model_get_sets (mainview_model);
window = frogr_main_view_get_window (priv->mainview);
- if (frogr_main_view_model_n_albums (mainview_model) > 0)
- frogr_add_to_album_dialog_show (window, pictures, albums);
- else if (priv->albums_fetched)
- frogr_util_show_info_dialog (window, _("No albums found"));
+ if (frogr_main_view_model_n_sets (mainview_model) > 0)
+ frogr_add_to_set_dialog_show (window, pictures, sets);
+ else if (priv->sets_fetched)
+ frogr_util_show_info_dialog (window, _("No sets found"));
return FALSE;
}
@@ -1702,13 +1702,13 @@ frogr_controller_init (FrogrController *self)
priv->cancellable = NULL;
priv->app_running = FALSE;
priv->uploading_picture = FALSE;
- priv->fetching_albums = FALSE;
+ priv->fetching_sets = FALSE;
priv->fetching_groups = FALSE;
priv->fetching_account_extra_info = FALSE;
priv->fetching_tags = FALSE;
- priv->adding_to_album = FALSE;
+ priv->adding_to_set = FALSE;
priv->adding_to_group = FALSE;
- priv->albums_fetched = FALSE;
+ priv->sets_fetched = FALSE;
priv->groups_fetched = FALSE;
priv->tags_fetched = FALSE;
@@ -1850,7 +1850,7 @@ frogr_controller_set_active_account (FrogrController *self,
accounts_changed = frogr_config_remove_account (priv->config, account_id);
}
- /* Update internal pointer in the controller and token in the session */
+ /* Update internal pointer in the controller and token in the session */
if (priv->account)
g_object_unref (priv->account);
@@ -1858,7 +1858,7 @@ frogr_controller_set_active_account (FrogrController *self,
fsp_session_set_token (priv->session, token);
/* Prefetch info for this user */
- priv->albums_fetched = FALSE;
+ priv->sets_fetched = FALSE;
priv->groups_fetched = FALSE;
priv->tags_fetched = FALSE;
if (new_account)
@@ -2014,8 +2014,8 @@ frogr_controller_show_add_tags_dialog (FrogrController *self,
}
void
-frogr_controller_show_create_new_album_dialog (FrogrController *self,
- GSList *pictures)
+frogr_controller_show_create_new_set_dialog (FrogrController *self,
+ GSList *pictures)
{
g_return_if_fail(FROGR_IS_CONTROLLER (self));
@@ -2025,17 +2025,17 @@ frogr_controller_show_create_new_album_dialog (FrogrController *self,
priv = FROGR_CONTROLLER_GET_PRIVATE (self);
mainview_model = frogr_main_view_get_model (priv->mainview);
- /* Fetch the albums first if needed */
- if (frogr_main_view_model_n_albums (mainview_model) == 0 && !priv->albums_fetched)
- _fetch_albums (self);
+ /* Fetch the sets first if needed */
+ if (frogr_main_view_model_n_sets (mainview_model) == 0 && !priv->sets_fetched)
+ _fetch_sets (self);
/* Show the dialog when possible */
- gdk_threads_add_timeout (DEFAULT_TIMEOUT, (GSourceFunc) _show_create_new_album_dialog_on_idle, pictures);
+ gdk_threads_add_timeout (DEFAULT_TIMEOUT, (GSourceFunc) _show_create_new_set_dialog_on_idle, pictures);
}
void
-frogr_controller_show_add_to_album_dialog (FrogrController *self,
- GSList *pictures)
+frogr_controller_show_add_to_set_dialog (FrogrController *self,
+ GSList *pictures)
{
g_return_if_fail(FROGR_IS_CONTROLLER (self));
@@ -2045,12 +2045,12 @@ frogr_controller_show_add_to_album_dialog (FrogrController *self,
priv = FROGR_CONTROLLER_GET_PRIVATE (self);
mainview_model = frogr_main_view_get_model (priv->mainview);
- /* Fetch the albums first if needed */
- if (frogr_main_view_model_n_albums (mainview_model) == 0 && !priv->albums_fetched)
- _fetch_albums (self);
+ /* Fetch the sets first if needed */
+ if (frogr_main_view_model_n_sets (mainview_model) == 0 && !priv->sets_fetched)
+ _fetch_sets (self);
/* Show the dialog when possible */
- gdk_threads_add_timeout (DEFAULT_TIMEOUT, (GSourceFunc) _show_add_to_album_dialog_on_idle, pictures);
+ gdk_threads_add_timeout (DEFAULT_TIMEOUT, (GSourceFunc) _show_add_to_set_dialog_on_idle, pictures);
}
void
diff --git a/src/frogr-controller.h b/src/frogr-controller.h
index 32a3c35..e4ea732 100644
--- a/src/frogr-controller.h
+++ b/src/frogr-controller.h
@@ -93,11 +93,11 @@ void frogr_controller_show_details_dialog (FrogrController *self,
void frogr_controller_show_add_tags_dialog (FrogrController *self,
GSList *pictures);
-void frogr_controller_show_create_new_album_dialog (FrogrController *self,
- GSList *pictures);
+void frogr_controller_show_create_new_set_dialog (FrogrController *self,
+ GSList *pictures);
-void frogr_controller_show_add_to_album_dialog (FrogrController *self,
- GSList *pictures);
+void frogr_controller_show_add_to_set_dialog (FrogrController *self,
+ GSList *pictures);
void frogr_controller_show_add_to_group_dialog (FrogrController *self,
GSList *pictures);
diff --git a/src/frogr-create-new-album-dialog.c b/src/frogr-create-new-set-dialog.c
similarity index 66%
rename from src/frogr-create-new-album-dialog.c
rename to src/frogr-create-new-set-dialog.c
index 08ecb6d..24845aa 100644
--- a/src/frogr-create-new-album-dialog.c
+++ b/src/frogr-create-new-set-dialog.c
@@ -1,5 +1,5 @@
/*
- * frogr-create-new-album-dialog.c -- 'Create new album' dialog
+ * frogr-create-new-set-dialog.c -- 'Create new set' dialog
*
* Copyright (C) 2010, 2011 Mario Sanchez Prada
* Authors: Mario Sanchez Prada <msanchez igalia com>
@@ -20,9 +20,9 @@
*
*/
-#include "frogr-create-new-album-dialog.h"
+#include "frogr-create-new-set-dialog.h"
-#include "frogr-album.h"
+#include "frogr-photoset.h"
#include "frogr-controller.h"
#include "frogr-main-view-model.h"
#include "frogr-main-view.h"
@@ -35,37 +35,37 @@
#define MINIMUM_WINDOW_WIDTH 450
#define MINIMUM_WINDOW_HEIGHT 280
-#define FROGR_CREATE_NEW_ALBUM_DIALOG_GET_PRIVATE(object) \
+#define FROGR_CREATE_NEW_SET_DIALOG_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- FROGR_TYPE_CREATE_NEW_ALBUM_DIALOG, \
- FrogrCreateNewAlbumDialogPrivate))
+ FROGR_TYPE_CREATE_NEW_SET_DIALOG, \
+ FrogrCreateNewSetDialogPrivate))
-G_DEFINE_TYPE (FrogrCreateNewAlbumDialog, frogr_create_new_album_dialog, GTK_TYPE_DIALOG);
+G_DEFINE_TYPE (FrogrCreateNewSetDialog, frogr_create_new_set_dialog, GTK_TYPE_DIALOG);
-typedef struct _FrogrCreateNewAlbumDialogPrivate {
+typedef struct _FrogrCreateNewSetDialogPrivate {
GtkWidget *title_entry;
GtkWidget *description_tv;
GtkTextBuffer *description_buffer;
GSList *pictures;
- GSList *albums;
-} FrogrCreateNewAlbumDialogPrivate;
+ GSList *sets;
+} FrogrCreateNewSetDialogPrivate;
/* Properties */
enum {
PROP_0,
PROP_PICTURES,
- PROP_ALBUMS
+ PROP_SETS
};
/* Prototypes */
-static gboolean _validate_dialog_data (FrogrCreateNewAlbumDialog *self);
+static gboolean _validate_dialog_data (FrogrCreateNewSetDialog *self);
-static gboolean _save_data (FrogrCreateNewAlbumDialog *self);
+static gboolean _save_data (FrogrCreateNewSetDialog *self);
-static gboolean _update_model (FrogrCreateNewAlbumDialog *self,
+static gboolean _update_model (FrogrCreateNewSetDialog *self,
const gchar *title,
const gchar *description);
@@ -74,15 +74,15 @@ static void _dialog_response_cb (GtkDialog *dialog, gint response, gpointer data
/* Private API */
static gboolean
-_validate_dialog_data (FrogrCreateNewAlbumDialog *self)
+_validate_dialog_data (FrogrCreateNewSetDialog *self)
{
- FrogrCreateNewAlbumDialogPrivate *priv = NULL;
+ FrogrCreateNewSetDialogPrivate *priv = NULL;
gchar *title = NULL;
gboolean result = TRUE;
- priv = FROGR_CREATE_NEW_ALBUM_DIALOG_GET_PRIVATE (self);
+ priv = FROGR_CREATE_NEW_SET_DIALOG_GET_PRIVATE (self);
- /* Validate album's title */
+ /* Validate set's title */
title = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->title_entry)));
if ((title == NULL) || g_str_equal (g_strstrip (title), ""))
result = FALSE;
@@ -92,16 +92,16 @@ _validate_dialog_data (FrogrCreateNewAlbumDialog *self)
}
static gboolean
-_save_data (FrogrCreateNewAlbumDialog *self)
+_save_data (FrogrCreateNewSetDialog *self)
{
- FrogrCreateNewAlbumDialogPrivate *priv = NULL;
+ FrogrCreateNewSetDialogPrivate *priv = NULL;
GtkTextIter start;
GtkTextIter end;
gchar *title = NULL;
gchar *description = NULL;
gboolean result = FALSE;
- priv = FROGR_CREATE_NEW_ALBUM_DIALOG_GET_PRIVATE (self);
+ priv = FROGR_CREATE_NEW_SET_DIALOG_GET_PRIVATE (self);
/* Save data */
title = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->title_entry)));
@@ -128,33 +128,33 @@ _save_data (FrogrCreateNewAlbumDialog *self)
}
static gboolean
-_update_model (FrogrCreateNewAlbumDialog *self,
+_update_model (FrogrCreateNewSetDialog *self,
const gchar *title,
const gchar *description)
{
- FrogrCreateNewAlbumDialogPrivate *priv = NULL;
+ FrogrCreateNewSetDialogPrivate *priv = NULL;
FrogrController *controller = NULL;
FrogrMainView *mainview = NULL;
FrogrMainViewModel *mainview_model = NULL;
- FrogrAlbum *new_album = NULL;
+ FrogrPhotoSet *new_set = NULL;
FrogrPicture *picture = NULL;
GSList *item = NULL;
gboolean result = FALSE;
- priv = FROGR_CREATE_NEW_ALBUM_DIALOG_GET_PRIVATE (self);
+ priv = FROGR_CREATE_NEW_SET_DIALOG_GET_PRIVATE (self);
controller = frogr_controller_get_instance ();
mainview = frogr_controller_get_main_view (controller);
mainview_model = frogr_main_view_get_model (mainview);
- /* Add the album to the model */
- new_album = frogr_album_new (title, description);
- frogr_main_view_model_add_album (mainview_model, new_album);
+ /* Add the set to the model */
+ new_set = frogr_photoset_new (title, description);
+ frogr_main_view_model_add_set (mainview_model, new_set);
- /* Add the album to the list of albums for each picture */
+ /* Add the set to the list of sets for each picture */
for (item = priv->pictures; item; item = g_slist_next (item))
{
picture = FROGR_PICTURE (item->data);
- frogr_picture_add_album (picture, new_album);
+ frogr_picture_add_set (picture, new_set);
result = TRUE;
}
@@ -164,32 +164,32 @@ _update_model (FrogrCreateNewAlbumDialog *self,
static void
_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
{
- FrogrCreateNewAlbumDialog *self = NULL;
+ FrogrCreateNewSetDialog *self = NULL;
/* Try to save data if response is OK */
- self = FROGR_CREATE_NEW_ALBUM_DIALOG (dialog);
+ self = FROGR_CREATE_NEW_SET_DIALOG (dialog);
if (response == GTK_RESPONSE_OK && _save_data (self) == FALSE)
- return;
+ return;
/* Destroy the dialog */
gtk_widget_destroy (GTK_WIDGET (dialog));
}
static void
-_frogr_create_new_album_dialog_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+_frogr_create_new_set_dialog_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- FrogrCreateNewAlbumDialogPrivate *priv = FROGR_CREATE_NEW_ALBUM_DIALOG_GET_PRIVATE (object);
+ FrogrCreateNewSetDialogPrivate *priv = FROGR_CREATE_NEW_SET_DIALOG_GET_PRIVATE (object);
switch (prop_id)
{
case PROP_PICTURES:
priv->pictures = (GSList *) g_value_get_pointer (value);
break;
- case PROP_ALBUMS:
- priv->albums = (GSList *) g_value_get_pointer (value);
+ case PROP_SETS:
+ priv->sets = (GSList *) g_value_get_pointer (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -198,20 +198,20 @@ _frogr_create_new_album_dialog_set_property (GObject *object,
}
static void
-_frogr_create_new_album_dialog_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+_frogr_create_new_set_dialog_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- FrogrCreateNewAlbumDialogPrivate *priv = FROGR_CREATE_NEW_ALBUM_DIALOG_GET_PRIVATE (object);
+ FrogrCreateNewSetDialogPrivate *priv = FROGR_CREATE_NEW_SET_DIALOG_GET_PRIVATE (object);
switch (prop_id)
{
case PROP_PICTURES:
g_value_set_pointer (value, priv->pictures);
break;
- case PROP_ALBUMS:
- g_value_set_pointer (value, priv->albums);
+ case PROP_SETS:
+ g_value_set_pointer (value, priv->sets);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -220,9 +220,9 @@ _frogr_create_new_album_dialog_get_property (GObject *object,
}
static void
-_frogr_create_new_album_dialog_dispose (GObject *object)
+_frogr_create_new_set_dialog_dispose (GObject *object)
{
- FrogrCreateNewAlbumDialogPrivate *priv = FROGR_CREATE_NEW_ALBUM_DIALOG_GET_PRIVATE (object);
+ FrogrCreateNewSetDialogPrivate *priv = FROGR_CREATE_NEW_SET_DIALOG_GET_PRIVATE (object);
if (priv->pictures)
{
@@ -231,47 +231,47 @@ _frogr_create_new_album_dialog_dispose (GObject *object)
priv->pictures = NULL;
}
- if (priv->albums)
- priv->albums = NULL;
+ if (priv->sets)
+ priv->sets = NULL;
- G_OBJECT_CLASS(frogr_create_new_album_dialog_parent_class)->dispose (object);
+ G_OBJECT_CLASS(frogr_create_new_set_dialog_parent_class)->dispose (object);
}
static void
-frogr_create_new_album_dialog_class_init (FrogrCreateNewAlbumDialogClass *klass)
+frogr_create_new_set_dialog_class_init (FrogrCreateNewSetDialogClass *klass)
{
GObjectClass *obj_class = (GObjectClass *)klass;
GParamSpec *pspec;
/* GObject signals */
- obj_class->set_property = _frogr_create_new_album_dialog_set_property;
- obj_class->get_property = _frogr_create_new_album_dialog_get_property;
- obj_class->dispose = _frogr_create_new_album_dialog_dispose;
+ obj_class->set_property = _frogr_create_new_set_dialog_set_property;
+ obj_class->get_property = _frogr_create_new_set_dialog_get_property;
+ obj_class->dispose = _frogr_create_new_set_dialog_dispose;
/* Install properties */
pspec = g_param_spec_pointer ("pictures",
"pictures",
"List of pictures for "
- "the 'add to album' dialog",
+ "the 'add to set' dialog",
G_PARAM_READWRITE
| G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_property (obj_class, PROP_PICTURES, pspec);
- pspec = g_param_spec_pointer ("albums",
- "albums",
- "List of albums currently available "
- "for the 'add to album' dialog",
+ pspec = g_param_spec_pointer ("sets",
+ "sets",
+ "List of sets currently available "
+ "for the 'add to set' dialog",
G_PARAM_READWRITE
| G_PARAM_CONSTRUCT_ONLY);
- g_object_class_install_property (obj_class, PROP_ALBUMS, pspec);
+ g_object_class_install_property (obj_class, PROP_SETS, pspec);
- g_type_class_add_private (obj_class, sizeof (FrogrCreateNewAlbumDialogPrivate));
+ g_type_class_add_private (obj_class, sizeof (FrogrCreateNewSetDialogPrivate));
}
static void
-frogr_create_new_album_dialog_init (FrogrCreateNewAlbumDialog *self)
+frogr_create_new_set_dialog_init (FrogrCreateNewSetDialog *self)
{
- FrogrCreateNewAlbumDialogPrivate *priv = NULL;
+ FrogrCreateNewSetDialogPrivate *priv = NULL;
GtkWidget *vbox = NULL;
GtkWidget *table = NULL;
GtkWidget *align = NULL;
@@ -279,9 +279,9 @@ frogr_create_new_album_dialog_init (FrogrCreateNewAlbumDialog *self)
GtkWidget *widget = NULL;
GdkGeometry hints;
- priv = FROGR_CREATE_NEW_ALBUM_DIALOG_GET_PRIVATE (self);
+ priv = FROGR_CREATE_NEW_SET_DIALOG_GET_PRIVATE (self);
priv->pictures = NULL;
- priv->albums = NULL;
+ priv->sets = NULL;
/* Create widgets */
gtk_dialog_add_buttons (GTK_DIALOG (self),
@@ -301,7 +301,7 @@ frogr_create_new_album_dialog_init (FrogrCreateNewAlbumDialog *self)
table = gtk_table_new (2, 2, FALSE);
gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 6);
- widget = gtk_label_new (_("Album's title:"));
+ widget = gtk_label_new (_("Set's title:"));
align = gtk_alignment_new (1, 0, 1, 0);
gtk_container_add (GTK_CONTAINER (align), widget);
gtk_table_attach (GTK_TABLE (table), align, 0, 1, 0, 1,
@@ -314,7 +314,7 @@ frogr_create_new_album_dialog_init (FrogrCreateNewAlbumDialog *self)
GTK_EXPAND | GTK_FILL, 0, 6, 6);
priv->title_entry = widget;
- widget = gtk_label_new (_("Album's description:"));
+ widget = gtk_label_new (_("Set's description:"));
align = gtk_alignment_new (1, 0, 1, 0);
gtk_container_add (GTK_CONTAINER (align), widget);
gtk_table_attach (GTK_TABLE (table), align, 0, 1, 1, 2,
@@ -349,14 +349,14 @@ frogr_create_new_album_dialog_init (FrogrCreateNewAlbumDialog *self)
/* Public API */
void
-frogr_create_new_album_dialog_show (GtkWindow *parent, GSList *pictures, GSList *albums)
+frogr_create_new_set_dialog_show (GtkWindow *parent, GSList *pictures, GSList *sets)
{
GtkWidget *dialog = NULL;
- dialog = GTK_WIDGET (g_object_new (FROGR_TYPE_CREATE_NEW_ALBUM_DIALOG,
- "title", _("Create new Album"),
+ dialog = GTK_WIDGET (g_object_new (FROGR_TYPE_CREATE_NEW_SET_DIALOG,
+ "title", _("Create new Set"),
"modal", TRUE,
"pictures", pictures,
- "albums", albums,
+ "sets", sets,
"transient-for", parent,
"resizable", FALSE,
NULL));
diff --git a/src/frogr-create-new-set-dialog.h b/src/frogr-create-new-set-dialog.h
new file mode 100644
index 0000000..cc0fe82
--- /dev/null
+++ b/src/frogr-create-new-set-dialog.h
@@ -0,0 +1,58 @@
+/*
+ * frogr-create-new-set-dialog.h -- 'Create new set' dialog
+ *
+ * Copyright (C) 2010, 2011 Mario Sanchez Prada
+ * Authors: Mario Sanchez Prada <msanchez igalia com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 3 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef FROGR_CREATE_NEW_SET_DIALOG_H
+#define FROGR_CREATE_NEW_SET_DIALOG_H
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define FROGR_TYPE_CREATE_NEW_SET_DIALOG (frogr_create_new_set_dialog_get_type())
+#define FROGR_CREATE_NEW_SET_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, FROGR_TYPE_CREATE_NEW_SET_DIALOG, FrogrCreateNewSetDialog))
+#define FROGR_CREATE_NEW_SET_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST(klass, FROGR_TYPE_CREATE_NEW_SET_DIALOG, FrogrCreateNewSetDialogClass))
+#define FROGR_IS_CREATE_NEW_SET_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, FROGR_TYPE_CREATE_NEW_SET_DIALOG))
+#define FROGR_IS_CREATE_NEW_SET_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), FROGR_TYPE_CREATE_NEW_SET_DIALOG))
+#define FROGR_CREATE_NEW_SET_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FROGR_TYPE_CREATE_NEW_SET_DIALOG, FrogrCreateNewSetDialogClass))
+
+typedef struct _FrogrCreateNewSetDialog FrogrCreateNewSetDialog;
+typedef struct _FrogrCreateNewSetDialogClass FrogrCreateNewSetDialogClass;
+
+struct _FrogrCreateNewSetDialogClass
+{
+ GtkDialogClass parent_class;
+};
+
+struct _FrogrCreateNewSetDialog
+{
+ GtkDialog parent;
+};
+
+GType frogr_create_new_set_dialog_get_type (void) G_GNUC_CONST;
+
+void frogr_create_new_set_dialog_show (GtkWindow *parent,
+ GSList *pictures,
+ GSList *sets);
+
+G_END_DECLS /* FROGR_CREATE_NEW_SET_DIALOG_H */
+
+#endif
diff --git a/src/frogr-main-view-model.c b/src/frogr-main-view-model.c
index 53eaacb..7d5b5df 100644
--- a/src/frogr-main-view-model.c
+++ b/src/frogr-main-view-model.c
@@ -40,8 +40,8 @@ struct _FrogrMainViewModelPrivate
GSList *pictures_list;
guint n_pictures;
- GSList *albums_list;
- guint n_albums;
+ GSList *sets_list;
+ guint n_sets;
GSList *groups_list;
guint n_groups;
@@ -67,11 +67,11 @@ _frogr_main_view_model_dispose (GObject* object)
priv->pictures_list = NULL;
}
- if (priv->albums_list)
+ if (priv->sets_list)
{
- g_slist_foreach (priv->albums_list, (GFunc)g_object_unref, NULL);
- g_slist_free (priv->albums_list);
- priv->albums_list = NULL;
+ g_slist_foreach (priv->sets_list, (GFunc)g_object_unref, NULL);
+ g_slist_free (priv->sets_list);
+ priv->sets_list = NULL;
}
if (priv->groups_list)
@@ -118,8 +118,8 @@ frogr_main_view_model_init (FrogrMainViewModel *self)
priv->pictures_list = NULL;
priv->n_pictures = 0;
- priv->albums_list = NULL;
- priv->n_albums = 0;
+ priv->sets_list = NULL;
+ priv->n_sets = 0;
priv->groups_list = NULL;
priv->n_groups = 0;
@@ -206,76 +206,76 @@ frogr_main_view_model_get_pictures (FrogrMainViewModel *self)
}
void
-frogr_main_view_model_add_album (FrogrMainViewModel *self,
- FrogrAlbum *album)
+frogr_main_view_model_add_set (FrogrMainViewModel *self,
+ FrogrPhotoSet *set)
{
g_return_if_fail(FROGR_IS_MAIN_VIEW_MODEL (self));
- g_return_if_fail(FROGR_IS_ALBUM (album));
+ g_return_if_fail(FROGR_IS_SET (set));
FrogrMainViewModelPrivate *priv =
FROGR_MAIN_VIEW_MODEL_GET_PRIVATE (self);
/* When adding one by one we prepend always to keep the order */
- priv->albums_list = g_slist_prepend (priv->albums_list, album);
- g_object_ref (album);
+ priv->sets_list = g_slist_prepend (priv->sets_list, set);
+ g_object_ref (set);
- priv->n_albums++;
+ priv->n_sets++;
}
void
-frogr_main_view_model_remove_album (FrogrMainViewModel *self,
- FrogrAlbum *album)
+frogr_main_view_model_remove_set (FrogrMainViewModel *self,
+ FrogrPhotoSet *set)
{
g_return_if_fail(FROGR_IS_MAIN_VIEW_MODEL (self));
FrogrMainViewModelPrivate *priv =
FROGR_MAIN_VIEW_MODEL_GET_PRIVATE (self);
- priv->albums_list = g_slist_remove (priv->albums_list, album);
- priv->n_albums--;
- g_object_unref (album);
+ priv->sets_list = g_slist_remove (priv->sets_list, set);
+ priv->n_sets--;
+ g_object_unref (set);
}
void
-frogr_main_view_model_remove_all_albums (FrogrMainViewModel *self)
+frogr_main_view_model_remove_all_sets (FrogrMainViewModel *self)
{
g_return_if_fail(FROGR_IS_MAIN_VIEW_MODEL (self));
FrogrMainViewModelPrivate *priv =
FROGR_MAIN_VIEW_MODEL_GET_PRIVATE (self);
- g_slist_foreach (priv->albums_list, (GFunc)g_object_unref, NULL);
- g_slist_free (priv->albums_list);
+ g_slist_foreach (priv->sets_list, (GFunc)g_object_unref, NULL);
+ g_slist_free (priv->sets_list);
- priv->albums_list = NULL;
- priv->n_albums = 0;
+ priv->sets_list = NULL;
+ priv->n_sets = 0;
}
guint
-frogr_main_view_model_n_albums (FrogrMainViewModel *self)
+frogr_main_view_model_n_sets (FrogrMainViewModel *self)
{
g_return_val_if_fail(FROGR_IS_MAIN_VIEW_MODEL (self), 0);
FrogrMainViewModelPrivate *priv =
FROGR_MAIN_VIEW_MODEL_GET_PRIVATE (self);
- return priv->n_albums;
+ return priv->n_sets;
}
GSList *
-frogr_main_view_model_get_albums (FrogrMainViewModel *self)
+frogr_main_view_model_get_sets (FrogrMainViewModel *self)
{
g_return_val_if_fail(FROGR_IS_MAIN_VIEW_MODEL (self), NULL);
FrogrMainViewModelPrivate *priv =
FROGR_MAIN_VIEW_MODEL_GET_PRIVATE (self);
- return priv->albums_list;
+ return priv->sets_list;
}
void
-frogr_main_view_model_set_albums (FrogrMainViewModel *self,
- GSList *albums_list)
+frogr_main_view_model_set_sets (FrogrMainViewModel *self,
+ GSList *sets_list)
{
g_return_if_fail(FROGR_IS_MAIN_VIEW_MODEL (self));
@@ -283,17 +283,17 @@ frogr_main_view_model_set_albums (FrogrMainViewModel *self,
FrogrPicture *picture = NULL;
GSList *item = NULL;
- frogr_main_view_model_remove_all_albums (self);
+ frogr_main_view_model_remove_all_sets (self);
priv = FROGR_MAIN_VIEW_MODEL_GET_PRIVATE (self);
- priv->albums_list = albums_list;
- priv->n_albums = g_slist_length (albums_list);
+ priv->sets_list = sets_list;
+ priv->n_sets = g_slist_length (sets_list);
- /* Remove all the albums attached to every picture */
+ /* Remove all the sets attached to every picture */
for (item = priv->pictures_list; item; item = g_slist_next (item))
{
picture = FROGR_PICTURE (item->data);
- frogr_picture_remove_albums (picture);
+ frogr_picture_remove_sets (picture);
}
}
diff --git a/src/frogr-main-view-model.h b/src/frogr-main-view-model.h
index 42dfda7..0a34040 100644
--- a/src/frogr-main-view-model.h
+++ b/src/frogr-main-view-model.h
@@ -24,7 +24,7 @@
#define _FROGR_MAIN_VIEW_MODEL_H
#include "frogr-account.h"
-#include "frogr-album.h"
+#include "frogr-photoset.h"
#include "frogr-picture.h"
#include <glib.h>
@@ -58,27 +58,27 @@ GType frogr_main_view_model_get_type(void) G_GNUC_CONST;
FrogrMainViewModel *frogr_main_view_model_new (void);
void frogr_main_view_model_add_picture (FrogrMainViewModel *self,
- FrogrPicture *falbum);
+ FrogrPicture *fset);
void frogr_main_view_model_remove_picture (FrogrMainViewModel *self,
- FrogrPicture *falbum);
+ FrogrPicture *fset);
void frogr_main_view_model_remove_all_pictures (FrogrMainViewModel *self);
guint frogr_main_view_model_n_pictures (FrogrMainViewModel *self);
GSList *frogr_main_view_model_get_pictures (FrogrMainViewModel *self);
-void frogr_main_view_model_add_album (FrogrMainViewModel *self,
- FrogrAlbum *falbum);
-void frogr_main_view_model_remove_album (FrogrMainViewModel *self,
- FrogrAlbum *falbum);
-void frogr_main_view_model_remove_all_albums (FrogrMainViewModel *self);
+void frogr_main_view_model_add_set (FrogrMainViewModel *self,
+ FrogrPhotoSet *fset);
+void frogr_main_view_model_remove_set (FrogrMainViewModel *self,
+ FrogrPhotoSet *fset);
+void frogr_main_view_model_remove_all_sets (FrogrMainViewModel *self);
-guint frogr_main_view_model_n_albums (FrogrMainViewModel *self);
+guint frogr_main_view_model_n_sets (FrogrMainViewModel *self);
-GSList *frogr_main_view_model_get_albums (FrogrMainViewModel *self);
+GSList *frogr_main_view_model_get_sets (FrogrMainViewModel *self);
-void frogr_main_view_model_set_albums (FrogrMainViewModel *self,
- GSList *albums_list);
+void frogr_main_view_model_set_sets (FrogrMainViewModel *self,
+ GSList *sets_list);
void frogr_main_view_model_add_group (FrogrMainViewModel *self,
FrogrGroup *fgroup);
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index f1e1d0a..91c65f9 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -78,9 +78,9 @@ typedef struct _FrogrMainViewPrivate {
GtkWidget *upload_menu_item;
GtkWidget *edit_details_menu_item;
GtkWidget *add_tags_menu_item;
- GtkWidget *add_to_album_menu_item;
- GtkWidget *add_to_new_album_menu_item;
- GtkWidget *add_to_existing_album_menu_item;
+ GtkWidget *add_to_set_menu_item;
+ GtkWidget *add_to_new_set_menu_item;
+ GtkWidget *add_to_existing_set_menu_item;
GtkWidget *add_to_group_menu_item;
GtkWidget *ctxt_menu;
@@ -110,10 +110,10 @@ static void _populate_accounts_submenu (FrogrMainView *self);
static GtkWidget *_ctxt_menu_create (FrogrMainView *self);
static void _ctxt_menu_add_tags_item_activated (GtkWidget *widget,
gpointer data);
-static void _ctxt_menu_add_to_new_album_item_activated (GtkWidget *widget,
- gpointer data);
-static void _ctxt_menu_add_to_existing_album_item_activated (GtkWidget *widget,
- gpointer data);
+static void _ctxt_menu_add_to_new_set_item_activated (GtkWidget *widget,
+ gpointer data);
+static void _ctxt_menu_add_to_existing_set_item_activated (GtkWidget *widget,
+ gpointer data);
static void _ctxt_menu_add_to_group_item_activated (GtkWidget *widget,
gpointer data);
static void _ctxt_menu_edit_details_item_activated (GtkWidget *widget,
@@ -145,8 +145,8 @@ void _on_settings_menu_item_activate (GtkWidget *widget, gpointer self);
void _on_quit_menu_item_activate (GtkWidget *widget, gpointer self);
void _on_edit_details_menu_item_activate (GtkWidget *widget, gpointer self);
void _on_add_tags_menu_item_activate (GtkWidget *widget, gpointer self);
-void _on_add_to_new_album_menu_item_activate (GtkWidget *widget, gpointer self);
-void _on_add_to_existing_album_menu_item_activate (GtkWidget *widget, gpointer self);
+void _on_add_to_new_set_menu_item_activate (GtkWidget *widget, gpointer self);
+void _on_add_to_existing_set_menu_item_activate (GtkWidget *widget, gpointer self);
void _on_add_to_group_menu_item_activate (GtkWidget *widget, gpointer self);
void _on_upload_menu_item_activate (GtkWidget *widget, gpointer self);
void _on_about_menu_item_activate (GtkWidget *widget, gpointer self);
@@ -169,8 +169,8 @@ static void _add_pictures_dialog (FrogrMainView *self);
static gboolean _pictures_selected_required_check (FrogrMainView *self);
static void _add_tags_to_pictures (FrogrMainView *self);
-static void _add_pictures_to_new_album (FrogrMainView *self);
-static void _add_pictures_to_existing_album (FrogrMainView *self);
+static void _add_pictures_to_new_set (FrogrMainView *self);
+static void _add_pictures_to_existing_set (FrogrMainView *self);
static void _add_pictures_to_group (FrogrMainView *self);
static void _edit_selected_pictures (FrogrMainView *self);
static void _remove_selected_pictures (FrogrMainView *self);
@@ -311,26 +311,26 @@ _populate_menu_bar (FrogrMainView *self)
self);
priv->add_to_group_menu_item = menu_item;
- menu_item = gtk_menu_item_new_with_mnemonic (_("Add to Al_bum"));
+ menu_item = gtk_menu_item_new_with_mnemonic (_("Add to _Set"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
- priv->add_to_album_menu_item = menu_item;
+ priv->add_to_set_menu_item = menu_item;
submenu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), submenu);
- menu_item = gtk_menu_item_new_with_mnemonic (_("_Create New Albumâ?¦"));
+ menu_item = gtk_menu_item_new_with_mnemonic (_("_Create New Setâ?¦"));
gtk_menu_shell_append (GTK_MENU_SHELL (submenu), menu_item);
g_signal_connect (G_OBJECT (menu_item), "activate",
- G_CALLBACK (_on_add_to_new_album_menu_item_activate),
+ G_CALLBACK (_on_add_to_new_set_menu_item_activate),
self);
- priv->add_to_new_album_menu_item = menu_item;
+ priv->add_to_new_set_menu_item = menu_item;
- menu_item = gtk_menu_item_new_with_mnemonic (_("Add to _Existing Albumâ?¦"));
+ menu_item = gtk_menu_item_new_with_mnemonic (_("Add to _Existing Setâ?¦"));
gtk_menu_shell_append (GTK_MENU_SHELL (submenu), menu_item);
g_signal_connect (G_OBJECT (menu_item), "activate",
- G_CALLBACK (_on_add_to_existing_album_menu_item_activate),
+ G_CALLBACK (_on_add_to_existing_set_menu_item_activate),
self);
- priv->add_to_existing_album_menu_item = menu_item;
+ priv->add_to_existing_set_menu_item = menu_item;
gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_separator_menu_item_new ());
@@ -383,8 +383,8 @@ _populate_accounts_submenu (FrogrMainView *self)
menu_item = gtk_menu_item_new_with_label (login);
g_object_set_data (G_OBJECT (menu_item), "frogr-account", account);
g_signal_connect (G_OBJECT (menu_item), "activate",
- G_CALLBACK (_on_account_menu_item_activate),
- self);
+ G_CALLBACK (_on_account_menu_item_activate),
+ self);
gtk_menu_shell_append (GTK_MENU_SHELL (priv->accounts_menu), menu_item);
}
@@ -427,25 +427,25 @@ _ctxt_menu_create (FrogrMainView *self)
G_CALLBACK (_ctxt_menu_add_to_group_item_activated),
self);
- /* Add to album */
- item = gtk_menu_item_new_with_mnemonic (_("Add to Al_bum"));
+ /* Add to set */
+ item = gtk_menu_item_new_with_mnemonic (_("Add to _Set"));
gtk_menu_shell_append (GTK_MENU_SHELL (ctxt_menu), item);
ctxt_submenu = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), ctxt_submenu);
- item = gtk_menu_item_new_with_mnemonic (_("_Create New Albumâ?¦"));
+ item = gtk_menu_item_new_with_mnemonic (_("_Create New Setâ?¦"));
gtk_menu_shell_append (GTK_MENU_SHELL (ctxt_submenu), item);
g_signal_connect(item,
"activate",
- G_CALLBACK (_ctxt_menu_add_to_new_album_item_activated),
+ G_CALLBACK (_ctxt_menu_add_to_new_set_item_activated),
self);
- item = gtk_menu_item_new_with_mnemonic (_("Add to _Existing Albumâ?¦"));
+ item = gtk_menu_item_new_with_mnemonic (_("Add to _Existing Setâ?¦"));
gtk_menu_shell_append (GTK_MENU_SHELL (ctxt_submenu), item);
g_signal_connect(item,
"activate",
- G_CALLBACK (_ctxt_menu_add_to_existing_album_item_activated),
+ G_CALLBACK (_ctxt_menu_add_to_existing_set_item_activated),
self);
gtk_menu_shell_append (GTK_MENU_SHELL (ctxt_menu), gtk_separator_menu_item_new ());
@@ -472,17 +472,17 @@ _ctxt_menu_add_tags_item_activated (GtkWidget *widget, gpointer data)
}
static void
-_ctxt_menu_add_to_new_album_item_activated (GtkWidget *widget, gpointer data)
+_ctxt_menu_add_to_new_set_item_activated (GtkWidget *widget, gpointer data)
{
FrogrMainView *mainview = FROGR_MAIN_VIEW (data);
- _add_pictures_to_new_album (mainview);
+ _add_pictures_to_new_set (mainview);
}
static void
-_ctxt_menu_add_to_existing_album_item_activated (GtkWidget *widget, gpointer data)
+_ctxt_menu_add_to_existing_set_item_activated (GtkWidget *widget, gpointer data)
{
FrogrMainView *mainview = FROGR_MAIN_VIEW (data);
- _add_pictures_to_existing_album (mainview);
+ _add_pictures_to_existing_set (mainview);
}
static void
@@ -764,17 +764,17 @@ _on_add_tags_menu_item_activate (GtkWidget *widget, gpointer self)
}
void
-_on_add_to_new_album_menu_item_activate (GtkWidget *widget, gpointer self)
+_on_add_to_new_set_menu_item_activate (GtkWidget *widget, gpointer self)
{
FrogrMainView *mainview = FROGR_MAIN_VIEW (self);
- _add_pictures_to_new_album (mainview);
+ _add_pictures_to_new_set (mainview);
}
void
-_on_add_to_existing_album_menu_item_activate (GtkWidget *widget, gpointer self)
+_on_add_to_existing_set_menu_item_activate (GtkWidget *widget, gpointer self)
{
FrogrMainView *mainview = FROGR_MAIN_VIEW (self);
- _add_pictures_to_existing_album (mainview);
+ _add_pictures_to_existing_set (mainview);
}
void
@@ -1009,29 +1009,29 @@ _add_tags_to_pictures (FrogrMainView *self)
}
static void
-_add_pictures_to_new_album (FrogrMainView *self)
+_add_pictures_to_new_set (FrogrMainView *self)
{
FrogrMainViewPrivate *priv = FROGR_MAIN_VIEW_GET_PRIVATE (self);
if (!_pictures_selected_required_check (self))
return;
- /* Call the controller to add the pictures to albums */
- frogr_controller_show_create_new_album_dialog (priv->controller,
- _get_selected_pictures (self));
+ /* Call the controller to add the pictures to sets */
+ frogr_controller_show_create_new_set_dialog (priv->controller,
+ _get_selected_pictures (self));
}
static void
-_add_pictures_to_existing_album (FrogrMainView *self)
+_add_pictures_to_existing_set (FrogrMainView *self)
{
FrogrMainViewPrivate *priv = FROGR_MAIN_VIEW_GET_PRIVATE (self);
if (!_pictures_selected_required_check (self))
return;
- /* Call the controller to add the pictures to albums */
- frogr_controller_show_add_to_album_dialog (priv->controller,
- _get_selected_pictures (self));
+ /* Call the controller to add the pictures to sets */
+ frogr_controller_show_add_to_set_dialog (priv->controller,
+ _get_selected_pictures (self));
}
static void
@@ -1042,7 +1042,7 @@ _add_pictures_to_group (FrogrMainView *self)
if (!_pictures_selected_required_check (self))
return;
- /* Call the controller to add the pictures to albums */
+ /* Call the controller to add the pictures to sets */
frogr_controller_show_add_to_group_dialog (priv->controller,
_get_selected_pictures (self));
}
@@ -1309,9 +1309,9 @@ _update_ui (FrogrMainView *self)
gtk_widget_set_sensitive (priv->upload_menu_item, FALSE);
gtk_widget_set_sensitive (priv->edit_details_menu_item, FALSE);
gtk_widget_set_sensitive (priv->add_tags_menu_item, FALSE);
- gtk_widget_set_sensitive (priv->add_to_album_menu_item, FALSE);
- gtk_widget_set_sensitive (priv->add_to_new_album_menu_item, FALSE);
- gtk_widget_set_sensitive (priv->add_to_existing_album_menu_item, FALSE);
+ gtk_widget_set_sensitive (priv->add_to_set_menu_item, FALSE);
+ gtk_widget_set_sensitive (priv->add_to_new_set_menu_item, FALSE);
+ gtk_widget_set_sensitive (priv->add_to_existing_set_menu_item, FALSE);
gtk_widget_set_sensitive (priv->add_to_group_menu_item, FALSE);
break;
@@ -1329,9 +1329,9 @@ _update_ui (FrogrMainView *self)
gtk_widget_set_sensitive (priv->upload_menu_item, has_pics);
gtk_widget_set_sensitive (priv->edit_details_menu_item, has_pics);
gtk_widget_set_sensitive (priv->add_tags_menu_item, has_pics);
- gtk_widget_set_sensitive (priv->add_to_album_menu_item, has_pics);
- gtk_widget_set_sensitive (priv->add_to_new_album_menu_item, has_pics);
- gtk_widget_set_sensitive (priv->add_to_existing_album_menu_item, has_pics);
+ gtk_widget_set_sensitive (priv->add_to_set_menu_item, has_pics);
+ gtk_widget_set_sensitive (priv->add_to_new_set_menu_item, has_pics);
+ gtk_widget_set_sensitive (priv->add_to_existing_set_menu_item, has_pics);
gtk_widget_set_sensitive (priv->add_to_group_menu_item, has_pics);
/* Update status bar from model's account description */
diff --git a/src/frogr-album.c b/src/frogr-photoset.c
similarity index 58%
rename from src/frogr-album.c
rename to src/frogr-photoset.c
index e14ffac..724d830 100644
--- a/src/frogr-album.c
+++ b/src/frogr-photoset.c
@@ -1,5 +1,5 @@
/*
- * frogr-album.c -- An album in frogr (a photoset from flickr)
+ * frogr-photoset.c -- An set in frogr (a photoset from flickr)
*
* Copyright (C) 2010, 2011 Mario Sanchez Prada
* Authors: Mario Sanchez Prada <msanchez igalia com>
@@ -20,18 +20,18 @@
*
*/
-#include "frogr-album.h"
+#include "frogr-photoset.h"
-#define FROGR_ALBUM_GET_PRIVATE(object) \
+#define FROGR_PHOTOSET_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- FROGR_TYPE_ALBUM, \
- FrogrAlbumPrivate))
+ FROGR_TYPE_SET, \
+ FrogrPhotoSetPrivate))
-G_DEFINE_TYPE (FrogrAlbum, frogr_album, G_TYPE_OBJECT);
+G_DEFINE_TYPE (FrogrPhotoSet, frogr_photoset, G_TYPE_OBJECT);
/* Private struct */
-typedef struct _FrogrAlbumPrivate FrogrAlbumPrivate;
-struct _FrogrAlbumPrivate
+typedef struct _FrogrPhotoSetPrivate FrogrPhotoSetPrivate;
+struct _FrogrPhotoSetPrivate
{
gchar *title;
gchar *description;
@@ -56,29 +56,29 @@ enum {
/* Private API */
static void
-_frogr_album_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+_frogr_photoset_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- FrogrAlbum *self = FROGR_ALBUM (object);
+ FrogrPhotoSet *self = FROGR_PHOTOSET (object);
switch (prop_id)
{
case PROP_TITLE:
- frogr_album_set_title (self, g_value_get_string (value));
+ frogr_photoset_set_title (self, g_value_get_string (value));
break;
case PROP_DESCRIPTION:
- frogr_album_set_description (self, g_value_get_string (value));
+ frogr_photoset_set_description (self, g_value_get_string (value));
break;
case PROP_ID:
- frogr_album_set_id (self, g_value_get_string (value));
+ frogr_photoset_set_id (self, g_value_get_string (value));
break;
case PROP_PRIMARY_PHOTO_ID:
- frogr_album_set_primary_photo_id (self, g_value_get_string (value));
+ frogr_photoset_set_primary_photo_id (self, g_value_get_string (value));
break;
case PROP_N_PHOTOS:
- frogr_album_set_n_photos (self, g_value_get_int (value));
+ frogr_photoset_set_n_photos (self, g_value_get_int (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -87,12 +87,12 @@ _frogr_album_set_property (GObject *object,
}
static void
-_frogr_album_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+_frogr_photoset_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- FrogrAlbumPrivate *priv = FROGR_ALBUM_GET_PRIVATE (object);
+ FrogrPhotoSetPrivate *priv = FROGR_PHOTOSET_GET_PRIVATE (object);
switch (prop_id)
{
@@ -118,9 +118,9 @@ _frogr_album_get_property (GObject *object,
}
static void
-_frogr_album_finalize (GObject* object)
+_frogr_photoset_finalize (GObject* object)
{
- FrogrAlbumPrivate *priv = FROGR_ALBUM_GET_PRIVATE (object);
+ FrogrPhotoSetPrivate *priv = FROGR_PHOTOSET_GET_PRIVATE (object);
/* free strings */
g_free (priv->title);
@@ -129,32 +129,32 @@ _frogr_album_finalize (GObject* object)
g_free (priv->primary_photo_id);
/* call super class */
- G_OBJECT_CLASS (frogr_album_parent_class)->finalize(object);
+ G_OBJECT_CLASS (frogr_photoset_parent_class)->finalize(object);
}
static void
-frogr_album_class_init(FrogrAlbumClass *klass)
+frogr_photoset_class_init(FrogrPhotoSetClass *klass)
{
GObjectClass *obj_class = G_OBJECT_CLASS(klass);
/* GtkObject signals */
- obj_class->set_property = _frogr_album_set_property;
- obj_class->get_property = _frogr_album_get_property;
- obj_class->finalize = _frogr_album_finalize;
+ obj_class->set_property = _frogr_photoset_set_property;
+ obj_class->get_property = _frogr_photoset_get_property;
+ obj_class->finalize = _frogr_photoset_finalize;
/* Install properties */
g_object_class_install_property (obj_class,
PROP_TITLE,
g_param_spec_string ("title",
"title",
- "Album's title",
+ "Set's title",
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (obj_class,
PROP_DESCRIPTION,
g_param_spec_string ("description",
"description",
- "Album's description",
+ "Set's description",
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (obj_class,
@@ -170,7 +170,7 @@ frogr_album_class_init(FrogrAlbumClass *klass)
g_param_spec_string ("primary-photo-id",
"primary-photo-id",
"ID of the primary photo "
- "for the album",
+ "for the set",
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (obj_class,
@@ -178,19 +178,19 @@ frogr_album_class_init(FrogrAlbumClass *klass)
g_param_spec_int ("n-photos",
"n-photos",
"Number of photos "
- "inside the album",
+ "inside the set",
0,
G_MAXINT,
0,
G_PARAM_READWRITE));
- g_type_class_add_private (obj_class, sizeof (FrogrAlbumPrivate));
+ g_type_class_add_private (obj_class, sizeof (FrogrPhotoSetPrivate));
}
static void
-frogr_album_init (FrogrAlbum *self)
+frogr_photoset_init (FrogrPhotoSet *self)
{
- FrogrAlbumPrivate *priv = FROGR_ALBUM_GET_PRIVATE (self);
+ FrogrPhotoSetPrivate *priv = FROGR_PHOTOSET_GET_PRIVATE (self);
/* Default values */
priv->title = NULL;
@@ -203,139 +203,139 @@ frogr_album_init (FrogrAlbum *self)
/* Public API */
-FrogrAlbum *
-frogr_album_new (const gchar *title,
- const gchar *description)
+FrogrPhotoSet *
+frogr_photoset_new (const gchar *title,
+ const gchar *description)
{
g_return_val_if_fail (title, NULL);
g_return_val_if_fail (description, NULL);
- GObject *new = g_object_new(FROGR_TYPE_ALBUM,
+ GObject *new = g_object_new(FROGR_TYPE_SET,
"title", title,
"description", description,
NULL);
- return FROGR_ALBUM (new);
+ return FROGR_PHOTOSET (new);
}
/* Data Managing functions */
const gchar *
-frogr_album_get_title (FrogrAlbum *self)
+frogr_photoset_get_title (FrogrPhotoSet *self)
{
- g_return_val_if_fail(FROGR_IS_ALBUM(self), NULL);
+ g_return_val_if_fail(FROGR_IS_SET(self), NULL);
- FrogrAlbumPrivate *priv =
- FROGR_ALBUM_GET_PRIVATE (self);
+ FrogrPhotoSetPrivate *priv =
+ FROGR_PHOTOSET_GET_PRIVATE (self);
return (const gchar *)priv->title;
}
void
-frogr_album_set_title (FrogrAlbum *self,
- const gchar *title)
+frogr_photoset_set_title (FrogrPhotoSet *self,
+ const gchar *title)
{
- g_return_if_fail(FROGR_IS_ALBUM(self));
+ g_return_if_fail(FROGR_IS_SET(self));
g_return_if_fail(title != NULL);
- FrogrAlbumPrivate *priv =
- FROGR_ALBUM_GET_PRIVATE (self);
+ FrogrPhotoSetPrivate *priv =
+ FROGR_PHOTOSET_GET_PRIVATE (self);
g_free (priv->title);
priv->title = g_strdup (title);
}
const gchar *
-frogr_album_get_description (FrogrAlbum *self)
+frogr_photoset_get_description (FrogrPhotoSet *self)
{
- g_return_val_if_fail(FROGR_IS_ALBUM(self), NULL);
+ g_return_val_if_fail(FROGR_IS_SET(self), NULL);
- FrogrAlbumPrivate *priv =
- FROGR_ALBUM_GET_PRIVATE (self);
+ FrogrPhotoSetPrivate *priv =
+ FROGR_PHOTOSET_GET_PRIVATE (self);
return (const gchar *)priv->description;
}
void
-frogr_album_set_description (FrogrAlbum *self,
- const gchar *description)
+frogr_photoset_set_description (FrogrPhotoSet *self,
+ const gchar *description)
{
- g_return_if_fail(FROGR_IS_ALBUM(self));
+ g_return_if_fail(FROGR_IS_SET(self));
- FrogrAlbumPrivate *priv =
- FROGR_ALBUM_GET_PRIVATE (self);
+ FrogrPhotoSetPrivate *priv =
+ FROGR_PHOTOSET_GET_PRIVATE (self);
g_free (priv->description);
priv->description = g_strdup (description);
}
const gchar *
-frogr_album_get_id (FrogrAlbum *self)
+frogr_photoset_get_id (FrogrPhotoSet *self)
{
- g_return_val_if_fail(FROGR_IS_ALBUM(self), NULL);
+ g_return_val_if_fail(FROGR_IS_SET(self), NULL);
- FrogrAlbumPrivate *priv =
- FROGR_ALBUM_GET_PRIVATE (self);
+ FrogrPhotoSetPrivate *priv =
+ FROGR_PHOTOSET_GET_PRIVATE (self);
return (const gchar *)priv->id;
}
void
-frogr_album_set_id (FrogrAlbum *self,
- const gchar *id)
+frogr_photoset_set_id (FrogrPhotoSet *self,
+ const gchar *id)
{
- g_return_if_fail(FROGR_IS_ALBUM(self));
+ g_return_if_fail(FROGR_IS_SET(self));
- FrogrAlbumPrivate *priv =
- FROGR_ALBUM_GET_PRIVATE (self);
+ FrogrPhotoSetPrivate *priv =
+ FROGR_PHOTOSET_GET_PRIVATE (self);
g_free (priv->id);
priv->id = g_strdup (id);
}
const gchar *
-frogr_album_get_primary_photo_id (FrogrAlbum *self)
+frogr_photoset_get_primary_photo_id (FrogrPhotoSet *self)
{
- g_return_val_if_fail(FROGR_IS_ALBUM(self), NULL);
+ g_return_val_if_fail(FROGR_IS_SET(self), NULL);
- FrogrAlbumPrivate *priv =
- FROGR_ALBUM_GET_PRIVATE (self);
+ FrogrPhotoSetPrivate *priv =
+ FROGR_PHOTOSET_GET_PRIVATE (self);
return (const gchar *)priv->primary_photo_id;
}
void
-frogr_album_set_primary_photo_id (FrogrAlbum *self,
- const gchar *primary_photo_id)
+frogr_photoset_set_primary_photo_id (FrogrPhotoSet *self,
+ const gchar *primary_photo_id)
{
- g_return_if_fail(FROGR_IS_ALBUM(self));
+ g_return_if_fail(FROGR_IS_SET(self));
- FrogrAlbumPrivate *priv =
- FROGR_ALBUM_GET_PRIVATE (self);
+ FrogrPhotoSetPrivate *priv =
+ FROGR_PHOTOSET_GET_PRIVATE (self);
g_free (priv->primary_photo_id);
priv->primary_photo_id = g_strdup (primary_photo_id);
}
gint
-frogr_album_get_n_photos (FrogrAlbum *self)
+frogr_photoset_get_n_photos (FrogrPhotoSet *self)
{
- g_return_val_if_fail(FROGR_IS_ALBUM(self), FALSE);
+ g_return_val_if_fail(FROGR_IS_SET(self), FALSE);
- FrogrAlbumPrivate *priv =
- FROGR_ALBUM_GET_PRIVATE (self);
+ FrogrPhotoSetPrivate *priv =
+ FROGR_PHOTOSET_GET_PRIVATE (self);
return priv->n_photos;
}
void
-frogr_album_set_n_photos (FrogrAlbum *self,
- gint n)
+frogr_photoset_set_n_photos (FrogrPhotoSet *self,
+ gint n)
{
- g_return_if_fail(FROGR_IS_ALBUM(self));
+ g_return_if_fail(FROGR_IS_SET(self));
- FrogrAlbumPrivate *priv =
- FROGR_ALBUM_GET_PRIVATE (self);
+ FrogrPhotoSetPrivate *priv =
+ FROGR_PHOTOSET_GET_PRIVATE (self);
priv->n_photos = n;
}
diff --git a/src/frogr-photoset.h b/src/frogr-photoset.h
new file mode 100644
index 0000000..fc341c9
--- /dev/null
+++ b/src/frogr-photoset.h
@@ -0,0 +1,81 @@
+/*
+ * frogr-photoset.h -- An set in frogr (a photoset from flickr)
+ *
+ * Copyright (C) 2010, 2011 Mario Sanchez Prada
+ * Authors: Mario Sanchez Prada <msanchez igalia com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 3 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _FROGR_PHOTOSET_H
+#define _FROGR_PHOTOSET_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define FROGR_TYPE_SET (frogr_photoset_get_type())
+#define FROGR_PHOTOSET(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, FROGR_TYPE_SET, FrogrPhotoSet))
+#define FROGR_PHOTOSET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST(klass, FROGR_TYPE_SET, FrogrPhotoSetClass))
+#define FROGR_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, FROGR_TYPE_SET))
+#define FROGR_IS_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), FROGR_TYPE_SET))
+#define FROGR_PHOTOSET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FROGR_TYPE_SET, FrogrPhotoSetClass))
+
+typedef struct _FrogrPhotoSet FrogrPhotoSet;
+typedef struct _FrogrPhotoSetClass FrogrPhotoSetClass;
+
+struct _FrogrPhotoSet
+{
+ GObject parent_instance;
+};
+
+struct _FrogrPhotoSetClass
+{
+ GObjectClass parent_class;
+};
+
+
+GType frogr_photoset_get_type(void) G_GNUC_CONST;
+
+/* Constructors */
+FrogrPhotoSet *frogr_photoset_new (const gchar *title,
+ const gchar *description);
+
+/* Data managing methods */
+
+const gchar *frogr_photoset_get_id (FrogrPhotoSet *self);
+void frogr_photoset_set_id (FrogrPhotoSet *self,
+ const gchar *id);
+
+const gchar *frogr_photoset_get_title (FrogrPhotoSet *self);
+void frogr_photoset_set_title (FrogrPhotoSet *self,
+ const gchar *title);
+
+const gchar *frogr_photoset_get_description (FrogrPhotoSet *self);
+void frogr_photoset_set_description (FrogrPhotoSet *self,
+ const gchar *description);
+
+const gchar *frogr_photoset_get_primary_photo_id (FrogrPhotoSet *self);
+void frogr_photoset_set_primary_photo_id (FrogrPhotoSet *self,
+ const gchar *id);
+
+gint frogr_photoset_get_n_photos (FrogrPhotoSet *self);
+void frogr_photoset_set_n_photos (FrogrPhotoSet *self,
+ gint n);
+G_END_DECLS
+
+#endif
diff --git a/src/frogr-picture.c b/src/frogr-picture.c
index fe4c649..893f6f2 100644
--- a/src/frogr-picture.c
+++ b/src/frogr-picture.c
@@ -42,7 +42,7 @@ struct _FrogrPicturePrivate
gchar *tags_string;
GSList *tags_list;
- GSList *albums;
+ GSList *sets;
GSList *groups;
gboolean is_public;
@@ -289,11 +289,11 @@ _frogr_picture_dispose (GObject* object)
priv->pixbuf = NULL;
}
- if (priv->albums)
+ if (priv->sets)
{
- g_slist_foreach (priv->albums, (GFunc) g_object_unref, NULL);
- g_slist_free (priv->albums);
- priv->albums = NULL;
+ g_slist_foreach (priv->sets, (GFunc) g_object_unref, NULL);
+ g_slist_free (priv->sets);
+ priv->sets = NULL;
}
if (priv->groups)
@@ -457,7 +457,7 @@ frogr_picture_init (FrogrPicture *self)
priv->tags_string = NULL;
priv->tags_list = NULL;
- priv->albums = NULL;
+ priv->sets = NULL;
priv->groups = NULL;
priv->is_public = FALSE;
@@ -818,75 +818,75 @@ frogr_picture_set_pixbuf (FrogrPicture *self,
}
GSList *
-frogr_picture_get_albums (FrogrPicture *self)
+frogr_picture_get_sets (FrogrPicture *self)
{
g_return_val_if_fail(FROGR_IS_PICTURE(self), NULL);
FrogrPicturePrivate *priv = NULL;
priv = FROGR_PICTURE_GET_PRIVATE (self);
- return priv->albums;
+ return priv->sets;
}
void
-frogr_picture_set_albums (FrogrPicture *self, GSList *albums)
+frogr_picture_set_sets (FrogrPicture *self, GSList *sets)
{
g_return_if_fail(FROGR_IS_PICTURE(self));
GSList *new_list = NULL;
GSList *item = NULL;
- FrogrAlbum *album = NULL;
+ FrogrPhotoSet *set = NULL;
FrogrPicturePrivate *priv = NULL;
priv = FROGR_PICTURE_GET_PRIVATE (self);
- /* First remove all the previous albums list */
- g_slist_foreach (priv->albums, (GFunc) g_object_unref, NULL);
- g_slist_free (priv->albums);
- priv->albums = NULL;
+ /* First remove all the previous sets list */
+ g_slist_foreach (priv->sets, (GFunc) g_object_unref, NULL);
+ g_slist_free (priv->sets);
+ priv->sets = NULL;
- for (item = albums; item; item = g_slist_next (item))
+ for (item = sets; item; item = g_slist_next (item))
{
- album = FROGR_ALBUM (item->data);
- new_list = g_slist_append (new_list, g_object_ref (album));
+ set = FROGR_PHOTOSET (item->data);
+ new_list = g_slist_append (new_list, g_object_ref (set));
}
- priv->albums = new_list;
+ priv->sets = new_list;
}
void
-frogr_picture_add_album (FrogrPicture *self, FrogrAlbum *album)
+frogr_picture_add_set (FrogrPicture *self, FrogrPhotoSet *set)
{
g_return_if_fail(FROGR_IS_PICTURE(self));
- g_return_if_fail(FROGR_IS_ALBUM(album));
+ g_return_if_fail(FROGR_IS_SET(set));
FrogrPicturePrivate *priv = NULL;
- /* Do not add the same album twice */
- if (frogr_picture_in_album (self, album))
+ /* Do not add the same set twice */
+ if (frogr_picture_in_set (self, set))
return;
priv = FROGR_PICTURE_GET_PRIVATE (self);
- priv->albums = g_slist_append (priv->albums, g_object_ref (album));
+ priv->sets = g_slist_append (priv->sets, g_object_ref (set));
}
void
-frogr_picture_remove_albums (FrogrPicture *self)
+frogr_picture_remove_sets (FrogrPicture *self)
{
g_return_if_fail(FROGR_IS_PICTURE(self));
- frogr_picture_set_albums (self, NULL);
+ frogr_picture_set_sets (self, NULL);
}
gboolean
-frogr_picture_in_album (FrogrPicture *self, FrogrAlbum *album)
+frogr_picture_in_set (FrogrPicture *self, FrogrPhotoSet *set)
{
g_return_val_if_fail(FROGR_IS_PICTURE(self), FALSE);
FrogrPicturePrivate *priv = NULL;
priv = FROGR_PICTURE_GET_PRIVATE (self);
- if (g_slist_index (priv->albums, album) != -1)
+ if (g_slist_index (priv->sets, set) != -1)
return TRUE;
return FALSE;
diff --git a/src/frogr-picture.h b/src/frogr-picture.h
index 7103be7..a710287 100644
--- a/src/frogr-picture.h
+++ b/src/frogr-picture.h
@@ -23,7 +23,7 @@
#ifndef _FROGR_PICTURE_H
#define _FROGR_PICTURE_H
-#include "frogr-album.h"
+#include "frogr-photoset.h"
#include "frogr-group.h"
#include <glib.h>
@@ -113,11 +113,11 @@ GdkPixbuf *frogr_picture_get_pixbuf (FrogrPicture *self);
void frogr_picture_set_pixbuf (FrogrPicture *self,
GdkPixbuf *pixbuf);
-GSList *frogr_picture_get_albums (FrogrPicture *self);
-void frogr_picture_set_albums (FrogrPicture *self, GSList *albums);
-void frogr_picture_add_album (FrogrPicture *self, FrogrAlbum *album);
-void frogr_picture_remove_albums (FrogrPicture *self);
-gboolean frogr_picture_in_album (FrogrPicture *self, FrogrAlbum *album);
+GSList *frogr_picture_get_sets (FrogrPicture *self);
+void frogr_picture_set_sets (FrogrPicture *self, GSList *sets);
+void frogr_picture_add_set (FrogrPicture *self, FrogrPhotoSet *set);
+void frogr_picture_remove_sets (FrogrPicture *self);
+gboolean frogr_picture_in_set (FrogrPicture *self, FrogrPhotoSet *set);
GSList *frogr_picture_get_groups (FrogrPicture *self);
void frogr_picture_set_groups (FrogrPicture *self, GSList *groups);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]