[poppler] 4 commits - glib/demo

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Tue Nov 5 00:37:18 PST 2013


 glib/demo/annots.c |   22 +++++++++++++---------
 glib/demo/main.c   |   22 +++++++++++-----------
 2 files changed, 24 insertions(+), 20 deletions(-)

New commits:
commit 4dbd36f5b35dd0964e59d942242aecdc6b474c89
Author: Andres Gomez <agomez at igalia.com>
Date:   Tue Nov 5 09:52:23 2013 +0200

    glib-demo: Fix conding style issue in main.c
    
    https://bugs.freedesktop.org/show_bug.cgi?id=71245

diff --git a/glib/demo/main.c b/glib/demo/main.c
index 3fae584..e7e2ad5 100644
--- a/glib/demo/main.c
+++ b/glib/demo/main.c
@@ -355,7 +355,7 @@ gint main (gint argc, gchar **argv)
 	gtk_accel_group_connect (gtk_accel, gdk_keyval_from_name ("q"),
 				 GDK_CONTROL_MASK, 0, closure);
 	g_closure_unref (closure);
-	gtk_window_add_accel_group (GTK_WINDOW(win), gtk_accel);
+	gtk_window_add_accel_group (GTK_WINDOW (win), gtk_accel);
 
 	hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
 
commit 02f3c235eaf60350c98e88dbe266378fccef59d7
Author: Andres Gomez <agomez at igalia.com>
Date:   Tue Nov 5 09:52:23 2013 +0200

    glib-demo: Fix a typo in function name
    
    https://bugs.freedesktop.org/show_bug.cgi?id=71245

diff --git a/glib/demo/main.c b/glib/demo/main.c
index b2d8921..3fae584 100644
--- a/glib/demo/main.c
+++ b/glib/demo/main.c
@@ -123,7 +123,7 @@ pgd_demo_list_create (void)
 }
 
 static GtkWidget *
-pdg_demo_notebook_create (PopplerDocument *document)
+pgd_demo_notebook_create (PopplerDocument *document)
 {
 	GtkWidget *notebook;
 	gint       i;
@@ -362,8 +362,8 @@ gint main (gint argc, gchar **argv)
 	treeview = pgd_demo_list_create ();
 	gtk_box_pack_start (GTK_BOX (hbox), treeview, FALSE, TRUE, 0);
 	gtk_widget_show (treeview);
-	
-	notebook = pdg_demo_notebook_create (document);
+
+	notebook = pgd_demo_notebook_create (document);
 	gtk_box_pack_start (GTK_BOX (hbox), notebook, TRUE, TRUE, 0);
 	gtk_widget_show (notebook);
 
commit 5620b82e69335b7f12d877a24f1a463604f0e515
Author: Andres Gomez <agomez at igalia.com>
Date:   Tue Nov 5 09:52:23 2013 +0200

    glib-demo: Fix trailing whitespaces in main.c
    
    https://bugs.freedesktop.org/show_bug.cgi?id=71245

diff --git a/glib/demo/main.c b/glib/demo/main.c
index f4d0110..b2d8921 100644
--- a/glib/demo/main.c
+++ b/glib/demo/main.c
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2007 Carlos Garcia Campos  <carlosgc at gnome.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -78,7 +78,7 @@ pgd_demo_changed (GtkTreeSelection *selection,
 
 	if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
 		gint n_page;
-		
+
 		gtk_tree_model_get (model, &iter,
 				    PGD_NPAGE_COLUMN, &n_page,
 				    -1);
@@ -106,7 +106,7 @@ pgd_demo_list_create (void)
 						     renderer,
 						     "text", PGD_TITLE_COLUMN,
 						     NULL);
-	
+
 	for (i = 0; i < G_N_ELEMENTS (demo_list); i++) {
 		GtkTreeIter iter;
 
@@ -118,7 +118,7 @@ pgd_demo_list_create (void)
 	}
 
 	g_object_unref (model);
-	
+
 	return treeview;
 }
 
@@ -131,7 +131,7 @@ pdg_demo_notebook_create (PopplerDocument *document)
 	notebook = gtk_notebook_new ();
 	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
 	gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
-	
+
 	for (i = 0; i < G_N_ELEMENTS (demo_list); i++) {
 		GtkWidget *demo_widget;
 
@@ -374,12 +374,12 @@ gint main (gint argc, gchar **argv)
 
 	gtk_container_add (GTK_CONTAINER (win), hbox);
 	gtk_widget_show (hbox);
-	
+
 	gtk_widget_show (win);
 
 	gtk_main ();
 
 	g_object_unref (document);
-	
+
 	return 0;
 }
commit 43309d92d327b4ae8e89edb15482247045d726a4
Author: Germán Poo-Caamaño <gpoo at gnome.org>
Date:   Sat Sep 28 20:45:32 2013 -0700

    glib-demo: Make the Remove annotation button prominent in demo
    
    Move out from Annotation properties to the top. This make better
    use of the space.
    Make the remove button active only if there is an annotation
    selected.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=69978

diff --git a/glib/demo/annots.c b/glib/demo/annots.c
index 39ff235..0708abf 100644
--- a/glib/demo/annots.c
+++ b/glib/demo/annots.c
@@ -45,6 +45,7 @@ typedef struct {
     GtkWidget       *darea;
     GtkWidget       *annot_view;
     GtkWidget       *timer_label;
+    GtkWidget       *remove_button;
 
     gint             num_page;
 
@@ -491,7 +492,6 @@ pgd_annot_view_set_annot (PgdAnnotsDemo *demo,
 {
     GtkWidget  *alignment;
     GtkWidget  *table;
-    GtkWidget  *button;
     gint        row = 0;
     gchar      *text;
     time_t      timet;
@@ -561,13 +561,6 @@ pgd_annot_view_set_annot (PgdAnnotsDemo *demo,
           break;
     }
 
-    button = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
-    g_signal_connect (G_OBJECT (button), "clicked",
-                      G_CALLBACK (pgd_annots_remove_annot),
-                      (gpointer) demo);
-    gtk_grid_attach (GTK_GRID (table), button, 0, row, 2, 1);
-    gtk_widget_show (button);
-
     gtk_container_add (GTK_CONTAINER (alignment), table);
     gtk_widget_show (table);
 }
@@ -676,8 +669,11 @@ pgd_annots_selection_changed (GtkTreeSelection *treeselection,
                            -1);
         pgd_annot_view_set_annot (demo, annot);
         g_object_unref (annot);
+
+        gtk_widget_set_sensitive (demo->remove_button, TRUE);
     } else {
         pgd_annot_view_set_annot (demo, NULL);
+        gtk_widget_set_sensitive (demo->remove_button, FALSE);
     }
 }
 
@@ -929,8 +925,8 @@ pgd_annots_create_widget (PopplerDocument *document)
     PgdAnnotsDemo    *demo;
     GtkWidget        *label;
     GtkWidget        *vbox, *vbox2;
-    GtkWidget        *hbox, *page_selector;
     GtkWidget        *button;
+    GtkWidget        *hbox, *page_selector;
     GtkWidget        *hpaned;
     GtkWidget        *swindow, *treeview;
     GtkTreeSelection *selection;
@@ -967,6 +963,14 @@ pgd_annots_create_widget (PopplerDocument *document)
     gtk_widget_show (label);
     g_free (str);
 
+    demo->remove_button = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
+    gtk_widget_set_sensitive (demo->remove_button, FALSE);
+    g_signal_connect (G_OBJECT (demo->remove_button), "clicked",
+                      G_CALLBACK (pgd_annots_remove_annot),
+                      (gpointer) demo);
+    gtk_box_pack_end (GTK_BOX (hbox), demo->remove_button, FALSE, FALSE, 6);
+    gtk_widget_show (demo->remove_button);
+
     button = gtk_button_new_with_label ("Add Annotation");
     g_signal_connect (G_OBJECT (button), "clicked",
 		      G_CALLBACK (pgd_annots_add_annot),


More information about the poppler mailing list