Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Adding patch for Geany's source to support moving the VTE to the side…

…bar.
  • Loading branch information...
commit 8c97858d8aa8dfab012cff34dff0c70f4a9d23f5 1 parent e7023a1
Matthew Brush authored December 14, 2010

Showing 1 changed file with 157 additions and 0 deletions. Show diff stats Hide diff stats

  1. 157  geany_vte.patch
157  geany_vte.patch
... ...
@@ -0,0 +1,157 @@
  1
+diff -rupN geany-svn/src/keyfile.c geany-vte/src/keyfile.c
  2
+--- geany-svn/src/keyfile.c	2010-12-14 02:27:25.556686074 -0800
  3
++++ geany-vte/src/keyfile.c	2010-12-14 02:23:42.816686071 -0800
  4
+@@ -479,6 +479,7 @@ static void save_dialog_prefs(GKeyFile *
  5
+ 		g_free(tmp_string);
  6
+ 		vte_get_working_directory();	/* refresh vte_info.dir */
  7
+ 		g_key_file_set_string(config, "VTE", "last_dir", vte_info.dir);
  8
++        g_key_file_set_boolean(config, "VTE", "in_message_window", vc->in_message_window);
  9
+ 	}
  10
+ #endif
  11
+ }
  12
+@@ -782,6 +783,7 @@ static void load_dialog_prefs(GKeyFile *
  13
+ 		tmp_string = utils_get_setting_string(config, "VTE", "colour_back", "#000000");
  14
+ 		gdk_color_parse(tmp_string, vc->colour_back);
  15
+ 		g_free(tmp_string);
  16
++        vc->in_message_window = utils_get_setting_integer(config, "VTE", "in_message_window", TRUE);
  17
+ 	}
  18
+ #endif
  19
+ 	/* templates */
  20
+diff -rupN geany-svn/src/prefs.c geany-vte/src/prefs.c
  21
+--- geany-svn/src/prefs.c	2010-12-14 02:27:25.546686069 -0800
  22
++++ geany-vte/src/prefs.c	2010-12-14 02:19:41.936686072 -0800
  23
+@@ -739,6 +739,9 @@ static void prefs_init_dialog(void)
  24
+ 
  25
+ 		widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_cursor_blinks");
  26
+ 		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), vc->cursor_blinks);
  27
++        
  28
++        widget = ui_lookup_widget(ui_widgets.prefs_dialog, "radio_vte_message_window");
  29
++        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), vc->in_message_window);
  30
+ 	}
  31
+ #endif
  32
+ }
  33
+@@ -1186,6 +1189,9 @@ on_prefs_dialog_response(GtkDialog *dial
  34
+ 
  35
+ 			widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_cursor_blinks");
  36
+ 			vc->cursor_blinks = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
  37
++            
  38
++            widget = ui_lookup_widget(ui_widgets.prefs_dialog, "radio_vte_message_window");
  39
++            vc->in_message_window = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
  40
+ 
  41
+ 			vte_apply_user_settings();
  42
+ 		}
  43
+diff -rupN geany-svn/src/vte.c geany-vte/src/vte.c
  44
+--- geany-svn/src/vte.c	2010-12-14 02:27:25.560019403 -0800
  45
++++ geany-vte/src/vte.c	2010-12-14 01:54:42.120019400 -0800
  46
+@@ -239,8 +239,9 @@ static void create_vte(void)
  47
+ 	vc->vte = vte = vf->vte_terminal_new();
  48
+ 	scrollbar = gtk_vscrollbar_new(GTK_ADJUSTMENT(VTE_TERMINAL(vte)->adjustment));
  49
+ 	GTK_WIDGET_UNSET_FLAGS(scrollbar, GTK_CAN_FOCUS);
  50
+-
  51
++    
  52
+ 	frame = gtk_frame_new(NULL);
  53
++    ui_hookup_widget(main_widgets.window, frame, "vte_frame");
  54
+ 
  55
+ 	hbox = gtk_hbox_new(FALSE, 0);
  56
+ 	gtk_container_add(GTK_CONTAINER(frame), hbox);
  57
+@@ -726,6 +727,36 @@ static void on_color_button_choose_cb(Gt
  58
+ 	}
  59
+ }
  60
+ 
  61
++static void on_vte_location_radio_toggled(GtkToggleButton *btn, gpointer user_data)
  62
++{
  63
++	GtkWidget *vte_frame, *vte_tab_label;
  64
++	GtkNotebook *current_notebook, *new_notebook; 
  65
++	
  66
++	vte_frame = ui_lookup_widget(main_widgets.window, "vte_frame");
  67
++	if (G_UNLIKELY(vte_frame == NULL))
  68
++		return;
  69
++
  70
++	current_notebook = GTK_NOTEBOOK(gtk_widget_get_parent(vte_frame));
  71
++	
  72
++	if (!gtk_toggle_button_get_active(btn))
  73
++		new_notebook = GTK_NOTEBOOK(main_widgets.sidebar_notebook);
  74
++	else
  75
++		new_notebook = GTK_NOTEBOOK(main_widgets.message_window_notebook);
  76
++	
  77
++	vte_tab_label = gtk_notebook_get_tab_label(current_notebook, vte_frame);
  78
++	
  79
++	g_object_ref(vte_tab_label);
  80
++	
  81
++	gtk_widget_reparent(vte_frame, GTK_WIDGET(new_notebook));
  82
++	
  83
++	gtk_notebook_set_tab_label(new_notebook, vte_frame, vte_tab_label);
  84
++	
  85
++	g_object_unref(vte_tab_label);
  86
++	
  87
++	/* is this desirable? */
  88
++	gtk_notebook_set_current_page(new_notebook, -1);
  89
++	
  90
++}
  91
+ 
  92
+ void vte_append_preferences_tab(void)
  93
+ {
  94
+@@ -736,6 +767,7 @@ void vte_append_preferences_tab(void)
  95
+ 		GtkWidget *check_scroll_key, *check_scroll_out, *check_follow_path;
  96
+ 		GtkWidget *check_enable_bash_keys, *check_ignore_menu_key, *check_cursor_blinks;
  97
+ 		GtkWidget *check_run_in_vte, *check_skip_script, *entry_shell, *button_shell, *image_shell;
  98
++		GtkWidget *radio_vte_message_window, *radio_vte_sidebar;
  99
+ 		GtkObject *spin_scrollback_adj;
  100
+ 
  101
+ 		notebook = ui_lookup_widget(ui_widgets.prefs_dialog, "notebook2");
  102
+@@ -748,7 +780,7 @@ void vte_append_preferences_tab(void)
  103
+ 		label = gtk_label_new(_("Terminal"));
  104
+ 		vte_prefs_tab_num = gtk_notebook_append_page(GTK_NOTEBOOK(notebook), frame, label);
  105
+ 
  106
+-		table = gtk_table_new(6, 2, FALSE);
  107
++		table = gtk_table_new(7, 2, FALSE);
  108
+ 		gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
  109
+ 		gtk_table_set_row_spacings(GTK_TABLE(table), 3);
  110
+ 		gtk_table_set_col_spacings(GTK_TABLE(table), 10);
  111
+@@ -830,6 +862,26 @@ void vte_append_preferences_tab(void)
  112
+ 		image_shell = gtk_image_new_from_stock("gtk-open", GTK_ICON_SIZE_BUTTON);
  113
+ 		gtk_widget_show(image_shell);
  114
+ 		gtk_container_add(GTK_CONTAINER(button_shell), image_shell);
  115
++		
  116
++		label = gtk_label_new(_("Location:"));
  117
++		gtk_table_attach(GTK_TABLE(table), label, 0, 1, 6, 7,
  118
++			(GtkAttachOptions) (GTK_FILL),
  119
++			(GtkAttachOptions) (0), 0, 0);
  120
++		gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
  121
++		
  122
++		box = gtk_hbox_new(FALSE, 6);
  123
++		radio_vte_message_window = gtk_radio_button_new_with_label(NULL, _("Message window"));
  124
++		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_vte_message_window), TRUE);
  125
++		radio_vte_sidebar = gtk_radio_button_new_with_label(
  126
++							gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_vte_message_window)), 
  127
++							_("Sidebar"));
  128
++		gtk_box_pack_start(GTK_BOX(box), radio_vte_message_window, FALSE, FALSE, 0);
  129
++		gtk_box_pack_start(GTK_BOX(box), radio_vte_sidebar, FALSE, FALSE, 0);
  130
++		gtk_table_attach(GTK_TABLE(table), box, 1, 2, 6, 7,
  131
++				(GtkAttachOptions) (GTK_FILL),
  132
++				(GtkAttachOptions) (0), 0, 0);
  133
++		g_signal_connect(radio_vte_message_window, "toggled", 
  134
++			G_CALLBACK(on_vte_location_radio_toggled), NULL);
  135
+ 
  136
+ 		box = gtk_vbox_new(FALSE, 3);
  137
+ 		check_scroll_key = gtk_check_button_new_with_mnemonic(_("Scroll on keystroke"));
  138
+@@ -887,6 +939,8 @@ void vte_append_preferences_tab(void)
  139
+ 		ui_hookup_widget(ui_widgets.prefs_dialog, check_follow_path, "check_follow_path");
  140
+ 		ui_hookup_widget(ui_widgets.prefs_dialog, check_run_in_vte, "check_run_in_vte");
  141
+ 		ui_hookup_widget(ui_widgets.prefs_dialog, check_skip_script, "check_skip_script");
  142
++		ui_hookup_widget(ui_widgets.prefs_dialog, radio_vte_message_window, "radio_vte_message_window");
  143
++		ui_hookup_widget(ui_widgets.prefs_dialog, radio_vte_sidebar, "radio_vte_sidebar");
  144
+ 
  145
+ 		gtk_widget_show_all(frame);
  146
+ 
  147
+diff -rupN geany-svn/src/vte.h geany-vte/src/vte.h
  148
+--- geany-svn/src/vte.h	2010-12-14 02:27:25.560019403 -0800
  149
++++ geany-vte/src/vte.h	2010-12-14 02:11:47.786686074 -0800
  150
+@@ -59,6 +59,7 @@ typedef struct
  151
+ 	gchar *font;
  152
+ 	GdkColor *colour_fore;
  153
+ 	GdkColor *colour_back;
  154
++    gboolean in_message_window;
  155
+ } VteConfig;
  156
+ extern VteConfig *vc;
  157
+ 

0 notes on commit 8c97858

Please sign in to comment.
Something went wrong with that request. Please try again.