[gnome-photos/wip/rishi/misc-fixes: 16/18] Add PhotosExportDialog
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/misc-fixes: 16/18] Add PhotosExportDialog
- Date: Mon, 21 Dec 2015 18:17:09 +0000 (UTC)
commit 062365e4d0fda9f7062a4db44c9599bf7cfc0f74
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Dec 21 18:45:03 2015 +0100
Add PhotosExportDialog
src/Makefile.am | 3 +
src/photos-export-dialog.c | 147 +++++++++++++++++++++++++++++++++++++++++++
src/photos-export-dialog.h | 61 ++++++++++++++++++
src/photos-export-dialog.ui | 41 ++++++++++++
src/photos.gresource.xml | 1 +
5 files changed, 253 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index fa4773e..070f321 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -72,6 +72,8 @@ gnome_photos_SOURCES = \
photos-dlna-renderers-manager.h \
photos-dropdown.c \
photos-dropdown.h \
+ photos-export-dialog.c \
+ photos-export-dialog.h \
photos-edit-palette.c \
photos-edit-palette.h \
photos-edit-palette-row.c \
@@ -247,6 +249,7 @@ EXTRA_DIST = \
photos-generate-about \
photos.gresource.xml \
photos-dlna-renderers-dialog.ui \
+ photos-export-dialog.ui \
photos-help-overlay.ui \
photos-marshalers.list \
photos-menus.ui \
diff --git a/src/photos-export-dialog.c b/src/photos-export-dialog.c
new file mode 100644
index 0000000..0cbf6a8
--- /dev/null
+++ b/src/photos-export-dialog.c
@@ -0,0 +1,147 @@
+/*
+ * Photos - access, organize and share your photos on GNOME
+ * Copyright © 2015 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include <gio/gio.h>
+#include <glib.h>
+#include <glib/gi18n.h>
+
+#include "photos-base-manager.h"
+#include "photos-export-dialog.h"
+#include "photos-icons.h"
+#include "photos-item-manager.h"
+#include "photos-local-item.h"
+#include "photos-remote-display-manager.h"
+#include "photos-search-context.h"
+
+
+struct _PhotosExportDialog
+{
+ GtkDialog parent_instance;
+ PhotosBaseItem *item;
+ PhotosBaseManager *item_mngr;
+ PhotosDlnaRenderersManager *renderers_mngr;
+ PhotosRemoteDisplayManager *remote_mngr;
+ PhotosModeController *mode_cntrlr;
+ GtkListBox *listbox;
+};
+
+struct _PhotosExportDialogClass
+{
+ GtkDialogClass parent_class;
+};
+
+
+enum
+{
+ PROP_0,
+ PROP_ITEM
+};
+
+
+G_DEFINE_TYPE (PhotosExportDialog, photos_export_dialog, GTK_TYPE_DIALOG);
+
+
+static void
+photos_export_dialog_dispose (GObject *object)
+{
+ PhotosExportDialog *self = PHOTOS_EXPORT_DIALOG (object);
+
+ g_clear_object (&self->item);
+ g_clear_object (&priv->item_mngr);
+ g_clear_object (&priv->renderers_mngr);
+ g_clear_object (&priv->remote_mngr);
+ g_clear_object (&priv->mode_cntrlr);
+
+ G_OBJECT_CLASS (photos_export_dialog_parent_class)->dispose (object);
+}
+
+
+static void
+photos_export_dialog_finalize (GObject *object)
+{
+ PhotosExportDialog *self = PHOTOS_EXPORT_DIALOG (object);
+
+ G_OBJECT_CLASS (photos_export_dialog_parent_class)->finalize (object);
+}
+
+
+static void
+photos_export_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+{
+ PhotosExportDialog *self = PHOTOS_EXPORT_DIALOG (object);
+
+ switch (prop_id)
+ {
+ case PROP_ITEM:
+ self->item = PHOTOS_BASE_ITEM (g_value_dup_object (value));
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+
+static void
+photos_export_dialog_init (PhotosExportDialog *self)
+{
+ gtk_widget_init_template (GTK_WIDGET (self));
+}
+
+
+static void
+photos_export_dialog_class_init (PhotosExportDialogClass *class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+
+ object_class->dispose = photos_export_dialog_dispose;
+ object_class->finalize = photos_export_dialog_finalize;
+ object_class->set_property = photos_export_dialog_set_property;
+
+ g_object_class_install_property (object_class,
+ PROP_ITEM,
+ g_param_spec_object ("item",
+ "PhotosBaseItem object",
+ "The item to export",
+ PHOTOS_TYPE_BASE_ITEM,
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE));
+
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Photos/export-dialog.ui");
+ gtk_widget_class_bind_template_child (widget_class, PhotosExportDialog, listbox);
+ gtk_widget_class_bind_template_callback (widget_class, );
+}
+
+
+GtkWidget *
+photos_export_dialog_new (GtkWindow *parent, PhotosBaseItem *item)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (parent), NULL);
+ g_return_val_if_fail (PHOTOS_IS_BASE_ITEM (item), NULL);
+
+ return g_object_new (PHOTOS_TYPE_EXPORT_DIALOG,
+ "item", item,
+ "transient-for", parent,
+ "use-header-bar", TRUE,
+ NULL);
+}
diff --git a/src/photos-export-dialog.h b/src/photos-export-dialog.h
new file mode 100644
index 0000000..37c9a9b
--- /dev/null
+++ b/src/photos-export-dialog.h
@@ -0,0 +1,61 @@
+/*
+ * Photos - access, organize and share your photos on GNOME
+ * Copyright © 2015 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef PHOTOS_EXPORT_DIALOG_H
+#define PHOTOS_EXPORT_DIALOG_H
+
+#include <gtk/gtk.h>
+
+#include "photos-base-item.h"
+
+G_BEGIN_DECLS
+
+#define PHOTOS_TYPE_EXPORT_DIALOG (photos_export_dialog_get_type ())
+
+#define PHOTOS_EXPORT_DIALOG(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ PHOTOS_TYPE_EXPORT_DIALOG, PhotosExportDialog))
+
+#define PHOTOS_EXPORT_DIALOG_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ PHOTOS_TYPE_EXPORT_DIALOG, PhotosExportDialogClass))
+
+#define PHOTOS_IS_EXPORT_DIALOG(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ PHOTOS_TYPE_EXPORT_DIALOG))
+
+#define PHOTOS_IS_EXPORT_DIALOG_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ PHOTOS_TYPE_EXPORT_DIALOG))
+
+#define PHOTOS_EXPORT_DIALOG_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ PHOTOS_TYPE_EXPORT_DIALOG, PhotosExportDialogClass))
+
+typedef struct _PhotosExportDialog PhotosExportDialog;
+typedef struct _PhotosExportDialogClass PhotosExportDialogClass;
+
+GType photos_export_dialog_get_type (void) G_GNUC_CONST;
+
+GtkWidget *photos_export_dialog_new (GtkWindow *parent, PhotosBaseItem *item);
+
+G_END_DECLS
+
+#endif /* PHOTOS_EXPORT_DIALOG_H */
diff --git a/src/photos-export-dialog.ui b/src/photos-export-dialog.ui
new file mode 100644
index 0000000..82b0d5d
--- /dev/null
+++ b/src/photos-export-dialog.ui
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Photos - access, organize and share your photos on GNOME
+ Copyright © 2015 Red Hat, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+-->
+
+
+<interface domain="gnome-photos">
+ <template class="PhotosExportDialog" parent="GtkDialog">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Export</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="default_width">400</property>
+ <property name="type_hint">dialog</property>
+ <property name="skip_taskbar_hint">True</property>
+ <child internal-child="vbox">
+ <object class="GtkGrid" id="dialog-grid">
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">12</property>
+ <child>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/src/photos.gresource.xml b/src/photos.gresource.xml
index 7fa7693..54daa09 100644
--- a/src/photos.gresource.xml
+++ b/src/photos.gresource.xml
@@ -4,6 +4,7 @@
<file alias="Adwaita.css">../data/Adwaita.css</file>
<file alias="dlna-renderers-dialog.ui" preprocess="xml-stripblanks"
compressed="true">photos-dlna-renderers-dialog.ui</file>
<file alias="dnd-counter.svg" preprocess="to-pixdata">../data/dnd-counter.svg</file>
+ <file alias="export-dialog.ui" preprocess="xml-stripblanks"
compressed="true">photos-export-dialog.ui</file>
<file alias="preview-menu.ui" preprocess="xml-stripblanks"
compressed="true">photos-preview-menu.ui</file>
<file alias="selection-menu.ui" preprocess="xml-stripblanks"
compressed="true">photos-selection-menu.ui</file>
<file alias="selection-toolbar.ui" preprocess="xml-stripblanks"
compressed="true">photos-selection-toolbar.ui</file>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]