Commit 20ca9c8a authored by Garrett Regier's avatar Garrett Regier

Bug 621230 - Fixed GeditDocumentsPanel to deal with Tab Groups

parent 33c9c594
......@@ -86,8 +86,10 @@ gedit_debug_init (void)
debug = debug | GEDIT_DEBUG_LOADER;
if (g_getenv ("GEDIT_DEBUG_SAVER") != NULL)
debug = debug | GEDIT_DEBUG_SAVER;
if (g_getenv ("GEDIT_DEBUG_PANEL") != NULL)
debug = debug | GEDIT_DEBUG_PANEL;
out:
out:
#ifdef ENABLE_PROFILING
if (debug != GEDIT_NO_DEBUG)
......
......@@ -56,7 +56,8 @@ typedef enum {
GEDIT_DEBUG_METADATA = 1 << 11,
GEDIT_DEBUG_WINDOW = 1 << 12,
GEDIT_DEBUG_LOADER = 1 << 13,
GEDIT_DEBUG_SAVER = 1 << 14
GEDIT_DEBUG_SAVER = 1 << 14,
GEDIT_DEBUG_PANEL = 1 << 15
} GeditDebugSection;
......@@ -76,6 +77,7 @@ typedef enum {
#define DEBUG_WINDOW GEDIT_DEBUG_WINDOW, __FILE__, __LINE__, G_STRFUNC
#define DEBUG_LOADER GEDIT_DEBUG_LOADER, __FILE__, __LINE__, G_STRFUNC
#define DEBUG_SAVER GEDIT_DEBUG_SAVER, __FILE__, __LINE__, G_STRFUNC
#define DEBUG_PANEL GEDIT_DEBUG_PANEL, __FILE__, __LINE__, G_STRFUNC
void gedit_debug_init (void);
......
This diff is collapsed.
......@@ -5,6 +5,7 @@ VOID:BOOLEAN,POINTER
VOID:BOXED,BOXED
VOID:OBJECT
VOID:OBJECT,OBJECT
VOID:OBJECT,OBJECT,OBJECT,OBJECT
VOID:POINTER
VOID:OBJECT,BOXED,ENUM,ENUM,FLAGS
VOID:OBJECT,BOXED,INT,BOOLEAN
......
......@@ -159,10 +159,12 @@ gedit_multi_notebook_class_init (GeditMultiNotebookClass *klass)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GeditMultiNotebookClass, switch_tab),
NULL, NULL,
gedit_marshal_VOID__OBJECT_OBJECT,
gedit_marshal_VOID__OBJECT_OBJECT_OBJECT_OBJECT,
G_TYPE_NONE,
2,
4,
GEDIT_TYPE_NOTEBOOK,
GEDIT_TYPE_TAB,
GEDIT_TYPE_NOTEBOOK,
GEDIT_TYPE_TAB);
signals[TAB_CLOSE_REQUEST] =
g_signal_new ("tab-close-request",
......@@ -338,7 +340,9 @@ notebook_switch_page (GtkNotebook *book,
g_object_notify (G_OBJECT (mnb), "active-tab");
g_signal_emit (G_OBJECT (mnb), signals[SWITCH_TAB], 0, old_tab, tab);
g_signal_emit (G_OBJECT (mnb), signals[SWITCH_TAB], 0,
mnb->priv->active_notebook, old_tab,
book, tab);
}
}
......@@ -578,6 +582,16 @@ gedit_multi_notebook_get_nth_notebook (GeditMultiNotebook *mnb,
return g_list_nth_data (mnb->priv->notebooks, notebook_num);
}
gint
gedit_multi_notebook_get_notebook_num (GeditMultiNotebook *mnb,
GeditNotebook *notebook)
{
g_return_val_if_fail (GEDIT_IS_MULTI_NOTEBOOK (mnb), -1);
g_return_val_if_fail (GEDIT_IS_NOTEBOOK (notebook), -1);
return g_list_index (mnb->priv->notebooks, notebook);
}
gint
gedit_multi_notebook_get_n_tabs (GeditMultiNotebook *mnb)
{
......@@ -631,6 +645,9 @@ gedit_multi_notebook_set_active_tab (GeditMultiNotebook *mnb,
g_return_if_fail (GEDIT_IS_MULTI_NOTEBOOK (mnb));
g_return_if_fail (GEDIT_IS_TAB (tab));
if (tab == GEDIT_TAB (mnb->priv->active_tab))
return;
l = mnb->priv->notebooks;
do
......
......@@ -66,7 +66,9 @@ struct _GeditMultiNotebookClass
GeditNotebook *notebook,
GeditTab *tab);
void (* switch_tab) (GeditMultiNotebook *mnb,
GeditNotebook *old_notebook,
GeditTab *old_tab,
GeditNotebook *new_notebook,
GeditTab *new_tab);
void (* tab_close_request) (GeditMultiNotebook *mnb,
GeditNotebook *notebook,
......@@ -90,6 +92,9 @@ gint gedit_multi_notebook_get_n_notebooks (GeditMultiNotebook *mnb);
GeditNotebook *gedit_multi_notebook_get_nth_notebook (GeditMultiNotebook *mnb,
gint notebook_num);
gint gedit_multi_notebook_get_notebook_num (GeditMultiNotebook *mnb,
GeditNotebook *notebook);
gint gedit_multi_notebook_get_n_tabs (GeditMultiNotebook *mnb);
gint gedit_multi_notebook_get_page_num (GeditMultiNotebook *mnb,
......
......@@ -2600,9 +2600,11 @@ language_changed (GObject *object,
g_list_free (items);
}
static void
static void
tab_switched (GeditMultiNotebook *mnb,
GeditNotebook *old_notebook,
GeditTab *old_tab,
GeditNotebook *new_notebook,
GeditTab *new_tab,
GeditWindow *window)
{
......@@ -3829,14 +3831,12 @@ create_side_panel (GeditWindow *window)
G_CALLBACK (side_panel_visibility_changed),
window);
/* TODO: implement a new revolutionary documents panel
documents_panel = gedit_documents_panel_new (window);
gedit_panel_add_item_with_stock_icon (GEDIT_PANEL (window->priv->side_panel),
documents_panel,
"GeditWindowDocumentsPanel",
_("Documents"),
GTK_STOCK_FILE);*/
GTK_STOCK_FILE);
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment