[gnome-initial-setup] Add a new welcome page



commit 9d74dc4d3ec3f243b30b5638b9483d87bd3b509b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Jan 24 16:33:14 2013 -0500

    Add a new welcome page
    
    It's not too useful or pretty yet. The exterior is there, but it just
    needs that special touch before we can call it home.

 configure.ac                                       |    3 +-
 gnome-initial-setup/Makefile.am                    |    3 +
 gnome-initial-setup/gnome-initial-setup.c          |    2 +
 gnome-initial-setup/pages/Makefile.am              |    3 +-
 gnome-initial-setup/pages/welcome/Makefile.am      |    9 +++
 .../pages/welcome/gis-welcome-page.c               |   76 ++++++++++++++++++++
 .../pages/welcome/gis-welcome-page.h               |   58 +++++++++++++++
 .../pages/welcome/gis-welcome-page.ui              |   24 ++++++
 .../pages/welcome/welcome-image.png                |  Bin 0 -> 142308 bytes
 gnome-initial-setup/setup.gresource.xml            |    2 +
 10 files changed, 178 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d4f6bd4..0758971 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ AM_GLIB_GNU_GETTEXT
 
 NETWORK_MANAGER_REQUIRED_VERSION=0.9.6.4
 GLIB_REQUIRED_VERSION=2.29.4
-GTK_REQUIRED_VERSION=3.1.2
+GTK_REQUIRED_VERSION=3.7.7
 CLUTTER_REQUIRED_VERSION=1.11.3
 PANGO_REQUIRED_VERSION=1.32.5
 IBUS_REQUIRED_VERSION=1.4.99
@@ -137,6 +137,7 @@ Makefile
 data/Makefile
 gnome-initial-setup/Makefile
 gnome-initial-setup/pages/Makefile
+gnome-initial-setup/pages/welcome/Makefile
 gnome-initial-setup/pages/language/Makefile
 gnome-initial-setup/pages/eulas/Makefile
 gnome-initial-setup/pages/account/Makefile
diff --git a/gnome-initial-setup/Makefile.am b/gnome-initial-setup/Makefile.am
index a90fcd8..72c4469 100644
--- a/gnome-initial-setup/Makefile.am
+++ b/gnome-initial-setup/Makefile.am
@@ -14,6 +14,8 @@ libexec_PROGRAMS = gnome-initial-setup gnome-initial-setup-copy-worker
 BUILT_SOURCES =
 
 UI_FILES = \
+	pages/welcome/welcome-image.png \
+	pages/welcome/gis-welcome-page.ui \
 	pages/language/gis-language-page.ui \
 	pages/eulas/gis-eula-page.ui \
 	pages/network/gis-network-page.ui \
@@ -45,6 +47,7 @@ gnome_initial_setup_SOURCES += \
 endif
 
 gnome_initial_setup_LDADD =	\
+	pages/welcome/libgiswelcome.la \
 	pages/language/libgislanguage.la \
 	pages/eulas/libgiseulas.la \
 	pages/network/libgisnetwork.la \
diff --git a/gnome-initial-setup/gnome-initial-setup.c b/gnome-initial-setup/gnome-initial-setup.c
index 83923b4..f4d530f 100644
--- a/gnome-initial-setup/gnome-initial-setup.c
+++ b/gnome-initial-setup/gnome-initial-setup.c
@@ -40,6 +40,7 @@
 
 #include <egg-list-box.h>
 
+#include "pages/welcome/gis-welcome-page.h"
 #include "pages/language/gis-language-page.h"
 #include "pages/eulas/gis-eula-pages.h"
 #include "pages/location/gis-location-page.h"
@@ -78,6 +79,7 @@ new_pages_table (void)
 
   PageData *page_data;
 
+  ADD_PAGE (pages, welcome);
   ADD_PAGE (pages, language);
   ADD_PAGE (pages, keyboard);
   ADD_PAGE (pages, eula);
diff --git a/gnome-initial-setup/pages/Makefile.am b/gnome-initial-setup/pages/Makefile.am
index 710528c..1bfb4a2 100644
--- a/gnome-initial-setup/pages/Makefile.am
+++ b/gnome-initial-setup/pages/Makefile.am
@@ -7,4 +7,5 @@ SUBDIRS = \
 	network \
 	goa \
 	summary \
-	keyboard
+	keyboard \
+	welcome
diff --git a/gnome-initial-setup/pages/welcome/Makefile.am b/gnome-initial-setup/pages/welcome/Makefile.am
new file mode 100644
index 0000000..06e54aa
--- /dev/null
+++ b/gnome-initial-setup/pages/welcome/Makefile.am
@@ -0,0 +1,9 @@
+
+noinst_LTLIBRARIES = libgiswelcome.la
+
+libgiswelcome_la_SOURCES =	\
+	gis-welcome-page.c gis-welcome-page.h
+
+libgiswelcome_la_CFLAGS = $(INITIAL_SETUP_CFLAGS) -I "$(srcdir)/../.."
+libgiswelcome_la_LIBADD = $(INITIAL_SETUP_LIBS)
+libgiswelcome_la_LDFLAGS = -export_dynamic -avoid-version -module -no-undefined
diff --git a/gnome-initial-setup/pages/welcome/gis-welcome-page.c b/gnome-initial-setup/pages/welcome/gis-welcome-page.c
new file mode 100644
index 0000000..14cfd56
--- /dev/null
+++ b/gnome-initial-setup/pages/welcome/gis-welcome-page.c
@@ -0,0 +1,76 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright (C) 2012 Red Hat
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Written by:
+ *     Jasper St. Pierre <jstpierre mecheye net>
+ */
+
+/* Welcome page {{{1 */
+
+#define PAGE_ID "welcome"
+
+#include "config.h"
+#include "gis-welcome-page.h"
+
+#include <glib/gi18n.h>
+#include <gio/gio.h>
+
+G_DEFINE_TYPE (GisWelcomePage, gis_welcome_page, GIS_TYPE_PAGE);
+
+#define OBJ(type,name) ((type)gtk_builder_get_object(GIS_PAGE(page)->builder,(name)))
+#define WID(name) OBJ(GtkWidget*,name)
+
+static void
+gis_welcome_page_constructed (GObject *object)
+{
+  GisWelcomePage *page = GIS_WELCOME_PAGE (object);
+
+  G_OBJECT_CLASS (gis_welcome_page_parent_class)->constructed (object);
+
+  gis_page_set_title (GIS_PAGE (page), _("Welcome"));
+  gis_page_set_complete (GIS_PAGE (page), TRUE);
+
+  gtk_container_add (GTK_CONTAINER (page), WID ("welcome-page"));
+
+  gtk_widget_show (GTK_WIDGET (page));
+}
+
+static void
+gis_welcome_page_class_init (GisWelcomePageClass *klass)
+{
+  GisPageClass *page_class = GIS_PAGE_CLASS (klass);
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  page_class->page_id = PAGE_ID;
+  object_class->constructed = gis_welcome_page_constructed;
+}
+
+static void
+gis_welcome_page_init (GisWelcomePage *page)
+{
+}
+
+void
+gis_prepare_welcome_page (GisDriver *driver)
+{
+  gis_driver_add_page (driver,
+                       g_object_new (GIS_TYPE_WELCOME_PAGE,
+                                     "driver", driver,
+                                     NULL));
+}
diff --git a/gnome-initial-setup/pages/welcome/gis-welcome-page.h b/gnome-initial-setup/pages/welcome/gis-welcome-page.h
new file mode 100644
index 0000000..2a56f70
--- /dev/null
+++ b/gnome-initial-setup/pages/welcome/gis-welcome-page.h
@@ -0,0 +1,58 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright (C) 2012 Red Hat
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * Written by:
+ *     Jasper St. Pierre <jstpierre mecheye net>
+ */
+
+#ifndef __GIS_WELCOME_PAGE_H__
+#define __GIS_WELCOME_PAGE_H__
+
+#include "gnome-initial-setup.h"
+
+G_BEGIN_DECLS
+
+#define GIS_TYPE_WELCOME_PAGE               (gis_welcome_page_get_type ())
+#define GIS_WELCOME_PAGE(obj)                           (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIS_TYPE_WELCOME_PAGE, GisWelcomePage))
+#define GIS_WELCOME_PAGE_CLASS(klass)                   (G_TYPE_CHECK_CLASS_CAST ((klass),  GIS_TYPE_WELCOME_PAGE, GisWelcomePageClass))
+#define GIS_IS_WELCOME_PAGE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIS_TYPE_WELCOME_PAGE))
+#define GIS_IS_WELCOME_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GIS_TYPE_WELCOME_PAGE))
+#define GIS_WELCOME_PAGE_GET_CLASS(obj)                 (G_TYPE_INSTANCE_GET_CLASS ((obj),  GIS_TYPE_WELCOME_PAGE, GisWelcomePageClass))
+
+typedef struct _GisWelcomePage        GisWelcomePage;
+typedef struct _GisWelcomePageClass   GisWelcomePageClass;
+typedef struct _GisWelcomePagePrivate GisWelcomePagePrivate;
+
+struct _GisWelcomePage
+{
+  GisPage parent;
+};
+
+struct _GisWelcomePageClass
+{
+  GisPageClass parent_class;
+};
+
+GType gis_welcome_page_get_type (void);
+
+void gis_prepare_welcome_page (GisDriver *driver);
+
+G_END_DECLS
+
+#endif /* __GIS_WELCOME_PAGE_H__ */
diff --git a/gnome-initial-setup/pages/welcome/gis-welcome-page.ui b/gnome-initial-setup/pages/welcome/gis-welcome-page.ui
new file mode 100644
index 0000000..4e1aaa9
--- /dev/null
+++ b/gnome-initial-setup/pages/welcome/gis-welcome-page.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkGrid" id="welcome-page">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="halign">fill</property>
+    <property name="margin_left">80</property>
+    <property name="margin_right">80</property>
+    <child>
+      <object class="GtkImage" id="welcome-image">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="resource">/ui/welcome-image.png</property>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">4</property>
+        <property name="width">1</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+  </object>
+</interface>
diff --git a/gnome-initial-setup/pages/welcome/welcome-image.png b/gnome-initial-setup/pages/welcome/welcome-image.png
new file mode 100644
index 0000000..275925a
Binary files /dev/null and b/gnome-initial-setup/pages/welcome/welcome-image.png differ
diff --git a/gnome-initial-setup/setup.gresource.xml b/gnome-initial-setup/setup.gresource.xml
index e008853..a41da5d 100644
--- a/gnome-initial-setup/setup.gresource.xml
+++ b/gnome-initial-setup/setup.gresource.xml
@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
   <gresource prefix="/ui">
+    <file alias="welcome-image.png">pages/welcome/welcome-image.png</file>
+    <file preprocess="xml-stripblanks" alias="gis-welcome-page.ui">pages/welcome/gis-welcome-page.ui</file>
     <file preprocess="xml-stripblanks" alias="gis-language-page.ui">pages/language/gis-language-page.ui</file>
     <file preprocess="xml-stripblanks" alias="gis-eula-page.ui">pages/eulas/gis-eula-page.ui</file>
     <file preprocess="xml-stripblanks" alias="gis-account-page.ui">pages/account/gis-account-page.ui</file>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]