Created
December 17, 2012 19:08
-
-
Save krofna/4320990 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/data/geany.glade b/data/geany.glade | |
index d3d8aa4..3b02f6f 100644 | |
--- a/data/geany.glade | |
+++ b/data/geany.glade | |
@@ -5880,11 +5880,11 @@ | |
</packing> | |
</child> | |
<child> | |
- <object class="GtkLabel" id="terminal_scrollback_lines_label"> | |
+ <object class="GtkLabel" id="bg_image"> | |
<property name="visible">True</property> | |
<property name="can_focus">False</property> | |
<property name="xalign">0</property> | |
- <property name="label" translatable="yes">Scrollback lines:</property> | |
+ <property name="label" translatable="yes">Background image:</property> | |
</object> | |
<packing> | |
<property name="top_attach">3</property> | |
@@ -5894,11 +5894,11 @@ | |
</packing> | |
</child> | |
<child> | |
- <object class="GtkLabel" id="terminal_shell_label"> | |
+ <object class="GtkLabel" id="terminal_scrollback_lines_label"> | |
<property name="visible">True</property> | |
<property name="can_focus">False</property> | |
<property name="xalign">0</property> | |
- <property name="label" translatable="yes">Shell:</property> | |
+ <property name="label" translatable="yes">Scrollback lines:</property> | |
</object> | |
<packing> | |
<property name="top_attach">4</property> | |
@@ -5908,6 +5908,20 @@ | |
</packing> | |
</child> | |
<child> | |
+ <object class="GtkLabel" id="terminal_shell_label"> | |
+ <property name="visible">True</property> | |
+ <property name="can_focus">False</property> | |
+ <property name="xalign">0</property> | |
+ <property name="label" translatable="yes">Shell:</property> | |
+ </object> | |
+ <packing> | |
+ <property name="top_attach">5</property> | |
+ <property name="bottom_attach">6</property> | |
+ <property name="x_options">GTK_FILL</property> | |
+ <property name="y_options">GTK_FILL</property> | |
+ </packing> | |
+ </child> | |
+ <child> | |
<object class="GtkColorButton" id="color_fore"> | |
<property name="use_action_appearance">False</property> | |
<property name="visible">True</property> | |
@@ -5944,6 +5958,49 @@ | |
</packing> | |
</child> | |
<child> | |
+ <object class="GtkEntry" id="entry_image"> | |
+ <property name="visible">True</property> | |
+ <property name="can_focus">True</property> | |
+ <property name="tooltip_text" translatable="yes">Sets the path to the background image in the terminal widget</property> | |
+ <property name="invisible_char">•</property> | |
+ <property name="primary_icon_activatable">False</property> | |
+ <property name="secondary_icon_activatable">False</property> | |
+ <property name="primary_icon_sensitive">True</property> | |
+ <property name="secondary_icon_sensitive">True</property> | |
+ </object> | |
+ <packing> | |
+ <property name="left_attach">1</property> | |
+ <property name="right_attach">2</property> | |
+ <property name="top_attach">3</property> | |
+ <property name="bottom_attach">4</property> | |
+ <property name="y_options">GTK_FILL</property> | |
+ </packing> | |
+ </child> | |
+ <child> | |
+ <object class="GtkButton" id="button_term_image"> | |
+ <property name="use_action_appearance">False</property> | |
+ <property name="visible">True</property> | |
+ <property name="can_focus">True</property> | |
+ <property name="receives_default">True</property> | |
+ <child> | |
+ <object class="GtkImage" id="image1337"> | |
+ <property name="visible">True</property> | |
+ <property name="can_focus">False</property> | |
+ <property name="stock">gtk-open</property> | |
+ <property name="icon-size">1</property> | |
+ </object> | |
+ </child> | |
+ </object> | |
+ <packing> | |
+ <property name="left_attach">2</property> | |
+ <property name="right_attach">3</property> | |
+ <property name="top_attach">3</property> | |
+ <property name="bottom_attach">4</property> | |
+ <property name="x_options">GTK_FILL</property> | |
+ <property name="y_options">GTK_FILL</property> | |
+ </packing> | |
+ </child> | |
+ <child> | |
<object class="GtkSpinButton" id="spin_scrollback"> | |
<property name="visible">True</property> | |
<property name="can_focus">True</property> | |
@@ -5960,8 +6017,8 @@ | |
<packing> | |
<property name="left_attach">1</property> | |
<property name="right_attach">3</property> | |
- <property name="top_attach">3</property> | |
- <property name="bottom_attach">4</property> | |
+ <property name="top_attach">4</property> | |
+ <property name="bottom_attach">5</property> | |
<property name="y_options">GTK_FILL</property> | |
</packing> | |
</child> | |
@@ -5979,8 +6036,8 @@ | |
<packing> | |
<property name="left_attach">1</property> | |
<property name="right_attach">2</property> | |
- <property name="top_attach">4</property> | |
- <property name="bottom_attach">5</property> | |
+ <property name="top_attach">5</property> | |
+ <property name="bottom_attach">6</property> | |
<property name="y_options">GTK_FILL</property> | |
</packing> | |
</child> | |
@@ -6002,8 +6059,8 @@ | |
<packing> | |
<property name="left_attach">2</property> | |
<property name="right_attach">3</property> | |
- <property name="top_attach">4</property> | |
- <property name="bottom_attach">5</property> | |
+ <property name="top_attach">5</property> | |
+ <property name="bottom_attach">6</property> | |
<property name="x_options">GTK_FILL</property> | |
<property name="y_options">GTK_FILL</property> | |
</packing> | |
diff --git a/src/keyfile.c b/src/keyfile.c | |
index 7df84eb..431f491 100644 | |
--- a/src/keyfile.c | |
+++ b/src/keyfile.c | |
@@ -519,6 +519,7 @@ static void save_dialog_prefs(GKeyFile *config) | |
g_key_file_set_boolean(config, "VTE", "cursor_blinks", vc->cursor_blinks); | |
g_key_file_set_integer(config, "VTE", "scrollback_lines", vc->scrollback_lines); | |
g_key_file_set_string(config, "VTE", "font", vc->font); | |
+ g_key_file_set_string(config, "VTE", "image", vc->image); | |
g_key_file_set_string(config, "VTE", "shell", vc->shell); | |
tmp_string = utils_get_hex_from_color(vc->colour_fore); | |
g_key_file_set_string(config, "VTE", "colour_fore", tmp_string); | |
@@ -830,6 +831,7 @@ static void load_dialog_prefs(GKeyFile *config) | |
{ | |
struct passwd *pw = getpwuid(getuid()); | |
const gchar *shell = (pw != NULL) ? pw->pw_shell : "/bin/sh"; | |
+ const gchar *image = NULL; | |
vc = g_new0(VteConfig, 1); | |
vte_info.dir = utils_get_setting_string(config, "VTE", "last_dir", NULL); | |
@@ -843,6 +845,7 @@ static void load_dialog_prefs(GKeyFile *config) | |
vc->emulation = utils_get_setting_string(config, "VTE", "emulation", "xterm"); | |
vc->send_selection_unsafe = utils_get_setting_boolean(config, "VTE", | |
"send_selection_unsafe", FALSE); | |
+ vc->image = utils_get_setting_string(config, "VTE", "image", image); | |
vc->shell = utils_get_setting_string(config, "VTE", "shell", shell); | |
vc->font = utils_get_setting_string(config, "VTE", "font", "Monospace 10"); | |
vc->scroll_on_key = utils_get_setting_boolean(config, "VTE", "scroll_on_key", TRUE); | |
diff --git a/src/prefs.c b/src/prefs.c | |
index 33ed884..f997e6d 100644 | |
--- a/src/prefs.c | |
+++ b/src/prefs.c | |
@@ -744,6 +744,9 @@ static void prefs_init_dialog(void) | |
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "color_back"); | |
gtk_color_button_set_color(GTK_COLOR_BUTTON(widget), vc->colour_back); | |
+ widget = ui_lookup_widget(ui_widgets.prefs_dialog, "entry_image"); | |
+ gtk_entry_set_text(GTK_ENTRY(widget), vc->image); | |
+ | |
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "spin_scrollback"); | |
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), vc->scrollback_lines); | |
@@ -1207,6 +1210,10 @@ on_prefs_dialog_response(GtkDialog *dialog, gint response, gpointer user_data) | |
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "spin_scrollback"); | |
gtk_spin_button_update(GTK_SPIN_BUTTON(widget)); | |
vc->scrollback_lines = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget)); | |
+ | |
+ widget = ui_lookup_widget(ui_widgets.prefs_dialog, "entry_image"); | |
+ g_free(vc->image); | |
+ vc->image = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget))); | |
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "entry_shell"); | |
g_free(vc->shell); | |
diff --git a/src/vte.c b/src/vte.c | |
index 1cd536b..2d76ba7 100644 | |
--- a/src/vte.c | |
+++ b/src/vte.c | |
@@ -112,6 +112,7 @@ struct VteFunctions | |
void (*vte_terminal_set_cursor_blinks) (VteTerminal *terminal, gboolean blink); | |
void (*vte_terminal_select_all) (VteTerminal *terminal); | |
void (*vte_terminal_set_audible_bell) (VteTerminal *terminal, gboolean is_audible); | |
+ void (*vte_terminal_set_background_image_file) (VteTerminal *terminal, const char *path); | |
}; | |
@@ -303,6 +304,7 @@ void vte_close(void) | |
g_object_unref(vc->menu); | |
g_free(vc->emulation); | |
g_free(vc->shell); | |
+ g_free(vc->image); | |
g_free(vc->font); | |
g_free(vc->colour_back); | |
g_free(vc->colour_fore); | |
@@ -451,6 +453,7 @@ static gboolean vte_register_symbols(GModule *mod) | |
BIND_REQUIRED_SYMBOL(vte_terminal_set_color_foreground); | |
BIND_REQUIRED_SYMBOL(vte_terminal_set_color_bold); | |
BIND_REQUIRED_SYMBOL(vte_terminal_set_color_background); | |
+ BIND_REQUIRED_SYMBOL(vte_terminal_set_background_image_file); | |
BIND_REQUIRED_SYMBOL(vte_terminal_feed_child); | |
BIND_REQUIRED_SYMBOL(vte_terminal_im_append_menuitems); | |
if (! BIND_SYMBOL(vte_terminal_set_cursor_blink_mode)) | |
@@ -480,6 +483,7 @@ void vte_apply_user_settings(void) | |
vf->vte_terminal_set_color_foreground(VTE_TERMINAL(vc->vte), vc->colour_fore); | |
vf->vte_terminal_set_color_bold(VTE_TERMINAL(vc->vte), vc->colour_fore); | |
vf->vte_terminal_set_color_background(VTE_TERMINAL(vc->vte), vc->colour_back); | |
+ vf->vte_terminal_set_background_image_file(VTE_TERMINAL(vc->vte), vc->image); | |
vf->vte_terminal_set_audible_bell(VTE_TERMINAL(vc->vte), prefs.beep_on_errors); | |
vte_set_cursor_blink_mode(); | |
@@ -771,12 +775,18 @@ void vte_append_preferences_tab(void) | |
GtkWidget *frame_term, *button_shell, *entry_shell; | |
GtkWidget *check_run_in_vte, *check_skip_script; | |
GtkWidget *font_button, *fg_color_button, *bg_color_button; | |
+ GtkWidget *entry_image, *button_image; | |
button_shell = GTK_WIDGET(ui_lookup_widget(ui_widgets.prefs_dialog, "button_term_shell")); | |
entry_shell = GTK_WIDGET(ui_lookup_widget(ui_widgets.prefs_dialog, "entry_shell")); | |
ui_setup_open_button_callback(button_shell, NULL, | |
GTK_FILE_CHOOSER_ACTION_OPEN, GTK_ENTRY(entry_shell)); | |
+ button_image = GTK_WIDGET(ui_lookup_widget(ui_widgets.prefs_dialog, "button_term_image")); | |
+ entry_image = GTK_WIDGET(ui_lookup_widget(ui_widgets.prefs_dialog, "entry_image")); | |
+ ui_setup_open_button_callback(button_image, NULL, | |
+ GTK_FILE_CHOOSER_ACTION_OPEN, GTK_ENTRY(entry_image)); | |
+ | |
check_skip_script = GTK_WIDGET(ui_lookup_widget(ui_widgets.prefs_dialog, "check_skip_script")); | |
gtk_widget_set_sensitive(check_skip_script, vc->run_in_vte); | |
diff --git a/src/vte.h b/src/vte.h | |
index ddeec2a..667b973 100644 | |
--- a/src/vte.h | |
+++ b/src/vte.h | |
@@ -54,6 +54,7 @@ typedef struct | |
gint scrollback_lines; | |
gchar *emulation; | |
gchar *shell; | |
+ gchar *image; | |
gchar *font; | |
gchar *send_cmd_prefix; | |
GdkColor *colour_fore; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment