gedit r6649 - in trunk: . gedit
- From: pborelli svn gnome org
- To: svn-commits-list gnome org
- Subject: gedit r6649 - in trunk: . gedit
- Date: Mon, 1 Dec 2008 23:04:10 +0000 (UTC)
Author: pborelli
Date: Mon Dec 1 23:04:10 2008
New Revision: 6649
URL: http://svn.gnome.org/viewvc/gedit?rev=6649&view=rev
Log:
2008-12-01 Paolo Borelli <pborelli katamail com>
* gedit/gedit-window.c: store the panes state before deactivating
the plugins
Modified:
trunk/ChangeLog
trunk/gedit/gedit-window.c
Modified: trunk/gedit/gedit-window.c
==============================================================================
--- trunk/gedit/gedit-window.c (original)
+++ trunk/gedit/gedit-window.c Mon Dec 1 23:04:10 2008
@@ -112,6 +112,39 @@
}
static void
+save_panes_state (GeditWindow *window)
+{
+ gint pane_page;
+
+ if (gedit_prefs_manager_window_size_can_set ())
+ gedit_prefs_manager_set_window_size (window->priv->width,
+ window->priv->height);
+
+ if (gedit_prefs_manager_window_state_can_set ())
+ gedit_prefs_manager_set_window_state (window->priv->window_state);
+
+ if ((window->priv->side_panel_size > 0) &&
+ gedit_prefs_manager_side_panel_size_can_set ())
+ gedit_prefs_manager_set_side_panel_size (
+ window->priv->side_panel_size);
+
+ pane_page = _gedit_panel_get_active_item_id (GEDIT_PANEL (window->priv->side_panel));
+ if (pane_page != 0 &&
+ gedit_prefs_manager_side_panel_active_page_can_set ())
+ gedit_prefs_manager_set_side_panel_active_page (pane_page);
+
+ if ((window->priv->bottom_panel_size > 0) &&
+ gedit_prefs_manager_bottom_panel_size_can_set ())
+ gedit_prefs_manager_set_bottom_panel_size (
+ window->priv->bottom_panel_size);
+
+ pane_page = _gedit_panel_get_active_item_id (GEDIT_PANEL (window->priv->bottom_panel));
+ if (pane_page != 0 &&
+ gedit_prefs_manager_bottom_panel_active_page_can_set ())
+ gedit_prefs_manager_set_bottom_panel_active_page (pane_page);
+}
+
+static void
gedit_window_dispose (GObject *object)
{
GeditWindow *window;
@@ -125,9 +158,12 @@
*/
gedit_plugins_engine_garbage_collect (gedit_plugins_engine_get_default ());
- /* make sure to deactivate plugins for this window, but only once */
+ /* save the panes position and make sure to deactivate plugins
+ * for this window, but only once */
if (!window->priv->dispose_has_run)
{
+ save_panes_state (window);
+
gedit_plugins_engine_deactivate_plugins (gedit_plugins_engine_get_default (),
window);
window->priv->dispose_has_run = TRUE;
@@ -177,55 +213,6 @@
G_OBJECT_CLASS (gedit_window_parent_class)->finalize (object);
}
-static void
-save_panes_state (GeditWindow *window)
-{
- gint pane_page;
-
- if (gedit_prefs_manager_window_size_can_set ())
- gedit_prefs_manager_set_window_size (window->priv->width,
- window->priv->height);
-
- if (gedit_prefs_manager_window_state_can_set ())
- gedit_prefs_manager_set_window_state (window->priv->window_state);
-
- if ((window->priv->side_panel_size > 0) &&
- gedit_prefs_manager_side_panel_size_can_set ())
- gedit_prefs_manager_set_side_panel_size (
- window->priv->side_panel_size);
-
- pane_page = _gedit_panel_get_active_item_id (GEDIT_PANEL (window->priv->side_panel));
- if (pane_page != 0 &&
- gedit_prefs_manager_side_panel_active_page_can_set ())
- gedit_prefs_manager_set_side_panel_active_page (pane_page);
-
- if ((window->priv->bottom_panel_size > 0) &&
- gedit_prefs_manager_bottom_panel_size_can_set ())
- gedit_prefs_manager_set_bottom_panel_size (
- window->priv->bottom_panel_size);
-
- pane_page = _gedit_panel_get_active_item_id (GEDIT_PANEL (window->priv->bottom_panel));
- if (pane_page != 0 &&
- gedit_prefs_manager_bottom_panel_active_page_can_set ())
- gedit_prefs_manager_set_bottom_panel_active_page (pane_page);
-}
-
-static void
-gedit_window_destroy (GtkObject *object)
-{
- GeditWindow *window;
-
- window = GEDIT_WINDOW (object);
-
- if (!window->priv->destroy_has_run)
- {
- save_panes_state (window);
- window->priv->destroy_has_run = TRUE;
- }
-
- GTK_OBJECT_CLASS (gedit_window_parent_class)->destroy (object);
-}
-
static gboolean
gedit_window_window_state_event (GtkWidget *widget,
GdkEventWindowState *event)
@@ -306,7 +293,6 @@
gedit_window_class_init (GeditWindowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GtkObjectClass *gobject_class = GTK_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
klass->tab_removed = gedit_window_tab_removed;
@@ -315,8 +301,6 @@
object_class->finalize = gedit_window_finalize;
object_class->get_property = gedit_window_get_property;
- gobject_class->destroy = gedit_window_destroy;
-
widget_class->window_state_event = gedit_window_window_state_event;
widget_class->configure_event = gedit_window_configure_event;
widget_class->key_press_event = gedit_window_key_press_event;
@@ -3076,7 +3060,6 @@
window->priv->num_tabs = 0;
window->priv->removing_tabs = FALSE;
window->priv->state = GEDIT_WINDOW_STATE_NORMAL;
- window->priv->destroy_has_run = FALSE;
window->priv->dispose_has_run = FALSE;
window->priv->window_group = gtk_window_group_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]