[frogr] Added check for pictures in the UI before trying to upload anything
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] Added check for pictures in the UI before trying to upload anything
- Date: Tue, 27 Nov 2012 10:49:07 +0000 (UTC)
commit 5dfc45c874562643fb00c28ae959c07380088d65
Author: Mario Sanchez Prada <msanchez gnome org>
Date: Thu Nov 22 18:26:51 2012 +0100
Added check for pictures in the UI before trying to upload anything
src/frogr-main-view.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index 73f4756..31c5890 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -1511,6 +1511,21 @@ _load_pictures_dialog (FrogrMainView *self)
}
static gboolean
+_pictures_loaded_required_check (FrogrMainView *self)
+{
+ FrogrMainViewPrivate *priv = FROGR_MAIN_VIEW_GET_PRIVATE (self);
+
+ if (!frogr_model_get_pictures (priv->model))
+ {
+ frogr_util_show_error_dialog (GTK_WINDOW (self),
+ _("You don't have any picture loaded yet"));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static gboolean
_pictures_selected_required_check (FrogrMainView *self)
{
FrogrMainViewPrivate *priv = FROGR_MAIN_VIEW_GET_PRIVATE (self);
@@ -1640,6 +1655,9 @@ _upload_pictures (FrogrMainView *self)
{
FrogrMainViewPrivate *priv = FROGR_MAIN_VIEW_GET_PRIVATE (self);
+ if (!_pictures_loaded_required_check (self))
+ return;
+
gtk_icon_view_unselect_all (GTK_ICON_VIEW (priv->icon_view));
frogr_controller_upload_pictures (priv->controller);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]