gnome-terminal r2577 - trunk/src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-terminal r2577 - trunk/src
- Date: Thu, 29 May 2008 19:35:13 +0000 (UTC)
Author: chpe
Date: Thu May 29 19:35:13 2008
New Revision: 2577
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2577&view=rev
Log:
Make the profile-set signal transport the old profile too.
Modified:
trunk/src/terminal-screen.c
trunk/src/terminal-screen.h
trunk/src/terminal-window.c
Modified: trunk/src/terminal-screen.c
==============================================================================
--- trunk/src/terminal-screen.c (original)
+++ trunk/src/terminal-screen.c Thu May 29 19:35:13 2008
@@ -404,8 +404,9 @@
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (TerminalScreenClass, profile_set),
NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE,
+ 1, TERMINAL_TYPE_PROFILE);
signals[SHOW_POPUP_MENU] =
g_signal_new (I_("show-popup-menu"),
@@ -882,10 +883,12 @@
TerminalProfile *profile)
{
TerminalScreenPrivate *priv = screen->priv;
+ TerminalProfile *old_profile;
- if (profile == priv->profile)
+ old_profile = priv->profile;
+ if (profile == old_profile)
return;
-
+
if (priv->profile_changed_id)
{
g_signal_handler_disconnect (G_OBJECT (priv->profile),
@@ -922,18 +925,15 @@
profile ? terminal_profile_get_visible_name (profile) : "none");
#endif
- if (priv->profile)
- {
- g_object_unref (G_OBJECT (priv->profile));
- }
-
priv->profile = profile;
terminal_screen_reread_profile (screen);
if (priv->profile)
- g_signal_emit (G_OBJECT (screen), signals[PROFILE_SET], 0);
+ g_signal_emit (G_OBJECT (screen), signals[PROFILE_SET], 0, old_profile);
+ if (old_profile)
+ g_object_unref (old_profile);
}
TerminalProfile*
Modified: trunk/src/terminal-screen.h
==============================================================================
--- trunk/src/terminal-screen.h (original)
+++ trunk/src/terminal-screen.h Thu May 29 19:35:13 2008
@@ -54,7 +54,8 @@
{
VteTerminalClass parent_class;
- void (* profile_set) (TerminalScreen *screen);
+ void (* profile_set) (TerminalScreen *screen,
+ TerminalProfile *old_profile);
void (* show_popup_menu) (TerminalScreen *screen,
TerminalScreenPopupInfo *info);
};
Modified: trunk/src/terminal-window.c
==============================================================================
--- trunk/src/terminal-window.c (original)
+++ trunk/src/terminal-window.c Thu May 29 19:35:13 2008
@@ -198,6 +198,7 @@
static gboolean confirm_close_window (TerminalWindow *window);
static void
profile_set_callback (TerminalScreen *screen,
+ TerminalProfile *old_profile,
TerminalWindow *window);
G_DEFINE_TYPE (TerminalWindow, terminal_window, GTK_TYPE_WINDOW)
@@ -286,7 +287,8 @@
if (terminal_profile_get_forgotten (profile))
return;
-
+
+ /* FIXMEchpe why block here? */
g_signal_handlers_block_by_func (priv->active_term, G_CALLBACK (profile_set_callback), window);
terminal_screen_set_profile (priv->active_term, profile);
g_signal_handlers_unblock_by_func (priv->active_term, G_CALLBACK (profile_set_callback), window);
@@ -1517,6 +1519,7 @@
static void
profile_set_callback (TerminalScreen *screen,
+ TerminalProfile *old_profile,
TerminalWindow *window)
{
terminal_window_update_set_profile_menu (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]