[glide] Remove the old animation boxes
- From: Robert Carr <racarr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glide] Remove the old animation boxes
- Date: Sun, 2 May 2010 01:48:42 +0000 (UTC)
commit dd17abebf25c5c2945088546839147d372eb43c5
Author: Robert Carr <racarr Valentine localdomain>
Date: Sat May 1 21:14:18 2010 -0400
Remove the old animation boxes
data/ui/glide-window.ui | 58 ++++---------
src/glide-window.c | 212 -----------------------------------------------
2 files changed, 16 insertions(+), 254 deletions(-)
---
diff --git a/data/ui/glide-window.ui b/data/ui/glide-window.ui
index 52c3ec6..88686ae 100644
--- a/data/ui/glide-window.ui
+++ b/data/ui/glide-window.ui
@@ -22,8 +22,8 @@
<child>
<object class="GtkImageMenuItem" id="new-menuitem">
<property name="visible">True</property>
- <property name="related_action">new-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">new-action</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<accelerator key="n" signal="activate" modifiers="GDK_CONTROL_MASK"/>
@@ -62,8 +62,8 @@
<child>
<object class="GtkImageMenuItem" id="export-pdf-menuitem">
<property name="visible">True</property>
- <property name="related_action">pdf-export-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">pdf-export-action</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
@@ -71,8 +71,8 @@
<child>
<object class="GtkImageMenuItem" id="export-image-menuitem">
<property name="visible">True</property>
- <property name="related_action">png-export-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">png-export-action</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
@@ -136,8 +136,8 @@
<child>
<object class="GtkImageMenuItem" id="undo-menuitem">
<property name="visible">True</property>
- <property name="related_action">undo-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">undo-action</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<accelerator key="z" signal="activate" modifiers="GDK_CONTROL_MASK"/>
@@ -146,8 +146,8 @@
<child>
<object class="GtkImageMenuItem" id="redo-menuitem">
<property name="visible">True</property>
- <property name="related_action">redo-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">redo-action</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<accelerator key="z" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
@@ -171,8 +171,8 @@
<child>
<object class="GtkImageMenuItem" id="copy-menuitem">
<property name="visible">True</property>
- <property name="related_action">copy-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">copy-action</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<accelerator key="c" signal="activate" modifiers="GDK_CONTROL_MASK"/>
@@ -242,8 +242,8 @@
<child>
<object class="GtkToolButton" id="new-toolbutton">
<property name="visible">True</property>
- <property name="related_action">new-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">new-action</property>
<property name="label" translatable="yes">New File</property>
<property name="use_underline">True</property>
</object>
@@ -255,8 +255,8 @@
<child>
<object class="GtkToolButton" id="open-toolbutton">
<property name="visible">True</property>
- <property name="related_action">open-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">open-action</property>
<property name="label" translatable="yes">Open File</property>
<property name="use_underline">True</property>
</object>
@@ -268,8 +268,8 @@
<child>
<object class="GtkToolButton" id="save-toolbutton">
<property name="visible">True</property>
- <property name="related_action">save-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">save-action</property>
<property name="label" translatable="yes">Save File</property>
<property name="use_underline">True</property>
</object>
@@ -290,8 +290,8 @@
<child>
<object class="GtkToolButton" id="undo-toolbutton">
<property name="visible">True</property>
- <property name="related_action">undo-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">undo-action</property>
<property name="label" translatable="yes">Undo</property>
<property name="use_underline">True</property>
</object>
@@ -303,8 +303,8 @@
<child>
<object class="GtkToolButton" id="Redo">
<property name="visible">True</property>
- <property name="related_action">redo-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">redo-action</property>
<property name="label" translatable="yes">Redo</property>
<property name="use_underline">True</property>
</object>
@@ -326,8 +326,8 @@
<object class="GtkToolButton" id="text-toolbutton">
<property name="visible">True</property>
<property name="sensitive">False</property>
- <property name="related_action">new-text-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">new-text-action</property>
<property name="label" translatable="yes">Text</property>
<property name="use_underline">True</property>
</object>
@@ -340,8 +340,8 @@
<object class="GtkToolButton" id="image-toolbutton">
<property name="visible">True</property>
<property name="sensitive">False</property>
- <property name="related_action">new-image-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">new-image-action</property>
<property name="label" translatable="yes">Image</property>
<property name="use_underline">True</property>
</object>
@@ -362,8 +362,8 @@
<child>
<object class="GtkToolButton" id="inspector-button">
<property name="visible">True</property>
- <property name="related_action">inspector-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">inspector-action</property>
<property name="label" translatable="yes">Inspector</property>
<property name="use_underline">True</property>
</object>
@@ -497,8 +497,8 @@
<child>
<object class="GtkToolButton" id="background-toolbutton">
<property name="visible">True</property>
- <property name="related_action">background-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">background-action</property>
<property name="label" translatable="yes">Set Background</property>
<property name="use_underline">True</property>
</object>
@@ -510,8 +510,8 @@
<child>
<object class="GtkToolButton" id="present-toolbutton">
<property name="visible">True</property>
- <property name="related_action">present-action</property>
<property name="use_action_appearance">True</property>
+ <property name="related_action">present-action</property>
<property name="label" translatable="yes">Present</property>
<property name="use_underline">True</property>
</object>
@@ -662,32 +662,6 @@
<property name="position">4</property>
</packing>
</child>
- <child>
- <object class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <child>
- <object class="GtkComboBox" id="animation-combobox">
- <property name="visible">True</property>
- <signal name="changed" handler="glide_window_animations_box_changed_cb"/>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="animation-option-combobox">
- <property name="visible">True</property>
- <signal name="changed" handler="glide_window_animations_option_box_changed_cb"/>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">5</property>
- </packing>
- </child>
</object>
<packing>
<property name="position">3</property>
diff --git a/src/glide-window.c b/src/glide-window.c
index 7e663a8..4850897 100644
--- a/src/glide-window.c
+++ b/src/glide-window.c
@@ -41,7 +41,6 @@
#include "glide-pdf-exporter.h"
//#include "glide-png-exporter.h"
-#include "glide-animation-manager.h"
#include "glide-slide-box.h"
@@ -145,7 +144,6 @@ glide_window_enable_document_actions (GlideWindow *w)
glide_window_enable_action (w, "png-export-action");
glide_window_enable_action (w, "inspector-action");
- glide_window_enable_widget (w, "animation-combobox");
glide_window_enable_widget (w, "text-color-button");
}
@@ -166,93 +164,14 @@ glide_window_update_slide_label (GlideWindow *w)
}
static void
-glide_window_animation_box_set_animation_option (GlideWindow *w,
- const GlideAnimationInfo *info)
-{
- GtkComboBox *c = GTK_COMBO_BOX (GLIDE_WINDOW_UI_OBJECT (w, "animation-option-combobox"));
- GtkTreeModel *m = gtk_combo_box_get_model (c);
- GtkTreeIter iter;
- const gchar *option;
-
- if (!info)
- return;
- else if (!info->option && info->animation->list_options)
- {
- gtk_tree_model_get_iter_first (m, &iter);
- gtk_combo_box_set_active_iter (c, &iter);
-
- return;
- }
- else
- option = info->option;
-
- if (!info->animation->list_options)
- return;
-
- gtk_tree_model_get_iter_first (m, &iter);
- do {
- gchar *e;
-
- gtk_tree_model_get (m, &iter, 0, &e, -1);
- if (!strcmp (e, option))
- {
- gtk_combo_box_set_active_iter (c, &iter);
- g_free (e);
- return;
- }
- g_free (e);
- } while (gtk_tree_model_iter_next (m, &iter));
-
- gtk_tree_model_get_iter_first (m, &iter);
- gtk_combo_box_set_active_iter (c, &iter);
-}
-
-static void
-glide_window_animation_box_set_animation (GlideWindow *w,
- const GlideAnimationInfo *info)
-{
- GtkComboBox *c = GTK_COMBO_BOX (GLIDE_WINDOW_UI_OBJECT (w, "animation-combobox"));
- GtkTreeModel *m = gtk_combo_box_get_model (c);
- GtkTreeIter iter;
- const gchar *animation;
-
- if (!info || !info->animation)
- animation = "None";
- else
- animation = info->animation->name;
-
- gtk_tree_model_get_iter_first (m, &iter);
- do {
- gchar *e;
-
- gtk_tree_model_get (m, &iter, 0, &e, -1);
- if (!strcmp (e, animation))
- {
- gtk_combo_box_set_active_iter (c, &iter);
- // glide_window_animation_box_set_animation_option (w, info);
-
- g_free (e);
- return;
- }
- g_free (e);
- } while (gtk_tree_model_iter_next (m, &iter));
-
-
-
-}
-
-static void
glide_window_slide_changed_cb (GObject *object,
GParamSpec *pspec,
gpointer user_data)
{
GlideWindow *w = (GlideWindow *) user_data;
- GlideSlide *s = glide_document_get_nth_slide (w->priv->document,
- glide_stage_manager_get_current_slide (w->priv->manager));
gint i;
glide_window_update_slide_label (w);
- glide_window_animation_box_set_animation (w, glide_slide_get_animation (s));
i = glide_stage_manager_get_current_slide (w->priv->manager);
@@ -759,99 +678,6 @@ glide_window_slide_background_cb (GtkDialog *dialog,
}
static void
-glide_window_update_animation_options_box (GlideWindow *w,
- const GlideAnimation *anim)
-{
- GtkComboBox *c = GTK_COMBO_BOX (GLIDE_WINDOW_UI_OBJECT(w, "animation-option-combobox"));
- GtkListStore *store;
- GtkTreeIter iter;
- GList *options, *o;
- GlideSlide *s = glide_document_get_nth_slide (w->priv->document,
- glide_stage_manager_get_current_slide (w->priv->manager));
- GlideAnimationInfo *info = glide_slide_get_animation (s);
-
- store = gtk_list_store_new (1, G_TYPE_STRING);
- gtk_combo_box_set_model (c, GTK_TREE_MODEL (store));
- g_object_unref (store);
-
- if (anim && anim->list_options)
- options = anim->list_options ();
- else
- return;
-
- for (o = options; o; o = o->next)
- {
- gchar *option = (gchar *)o->data;
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, option,
- -1);
- }
-
- glide_animation_manager_free_options (options);
- glide_window_animation_box_set_animation_option (w, info);
-}
-
-void
-glide_window_animations_option_box_changed_cb (GtkWidget *cbox,
- gpointer user_data)
-{
- GlideWindow *w = (GlideWindow *)user_data;
- GlideAnimationInfo *info;
- gchar *option = NULL;
- GtkTreeIter iter;
- GlideSlide *s = glide_document_get_nth_slide (w->priv->document,
- glide_stage_manager_get_current_slide (w->priv->manager));
-
- info = glide_slide_get_animation (s);
- if(gtk_combo_box_get_active_iter(GTK_COMBO_BOX (cbox), &iter))
- {
- GtkTreeModel *model;
- model = gtk_combo_box_get_model(GTK_COMBO_BOX (cbox));
-
- gtk_tree_model_get(model, &iter, 0, &option, -1);
- }
- info->option = option;
-}
-
-void
-glide_window_animations_box_changed_cb (GtkWidget *cbox,
- gpointer user_data)
-{
- GlideWindow *w = (GlideWindow *)user_data;
- GtkTreeIter iter;
- gchar *animation;
- GlideSlide *s = glide_document_get_nth_slide (w->priv->document,
- glide_stage_manager_get_current_slide (w->priv->manager));
- GlideAnimationInfo info;
- GlideAnimationInfo *old_info;
- const GlideAnimation *ga;
-
- if(gtk_combo_box_get_active_iter(GTK_COMBO_BOX (cbox), &iter))
- {
- GtkTreeModel *model;
- model = gtk_combo_box_get_model(GTK_COMBO_BOX (cbox));
-
- gtk_tree_model_get(model, &iter, 0, &animation, -1);
- }
-
- old_info = glide_slide_get_animation (s);
-
- ga = glide_animation_manager_get_animation (animation);
- info.duration = 1000;
- info.animation = ga;
- if (old_info && old_info->animation &&
- !strcmp (old_info->animation->name, info.animation->name))
- info.option = g_strdup (old_info->option);
- else
- info.option = NULL;
-
- glide_slide_set_animation (s, &info);
- glide_window_update_animation_options_box (w, ga);
-
- g_free (animation);
-}
-
-static void
glide_window_paste_contents_text_received (GtkClipboard *clipboard,
GtkSelectionData *data,
gpointer user_data)
@@ -1421,43 +1247,6 @@ glide_window_open_action_activate (GtkAction *a,
}
static void
-glide_window_setup_combobox (GlideWindow *w)
-{
- GtkComboBox *c = GTK_COMBO_BOX (GLIDE_WINDOW_UI_OBJECT(w, "animation-combobox"));
- GtkComboBox *c2 = GTK_COMBO_BOX (GLIDE_WINDOW_UI_OBJECT(w, "animation-option-combobox"));
- GtkListStore *store = gtk_list_store_new (1, G_TYPE_STRING);
- GtkCellRenderer *renderer;
- GtkTreeIter iter;
- const GList *animations, *a;
-
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, "None", -1);
-
- animations = glide_animation_manager_get_animations ();
- for (a = animations; a; a = a->next)
- {
- GlideAnimation *animation = (GlideAnimation *)a->data;
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, animation->name,
- -1);
- }
-
-
-
- gtk_combo_box_set_model (c, GTK_TREE_MODEL (store));
- g_object_unref (store);
-
- renderer = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (c), renderer, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT(c), renderer, "text", 0, NULL);
-
- renderer = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (c2), renderer, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT(c2), renderer, "text", 0, NULL);
-}
-
-static void
glide_window_add_accelerator (GlideWindow *w,
GtkActionGroup *group,
GtkAccelGroup *accels,
@@ -1522,7 +1311,6 @@ glide_window_load_ui (GlideWindow *w)
gtk_builder_connect_signals (b, w);
- glide_window_setup_combobox (w);
glide_window_setup_accelerators (w);
main_box = GTK_WIDGET (gtk_builder_get_object (b, "main-vbox"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]