Commit dd84d543b5b37fc0e14540188a8c577b17a87e0d
1 parent
1e0bb556
Exists in
master
and in
1 other branch
Adding method to get the session title (the one who goes in the window
title).
Showing
2 changed files
with
15 additions
and
0 deletions
Show diff stats
src/include/v3270.h
... | ... | @@ -242,6 +242,8 @@ |
242 | 242 | LIB3270_EXPORT const gchar * v3270_get_session_name(GtkWidget *widget); |
243 | 243 | LIB3270_EXPORT void v3270_set_session_name(GtkWidget *widget, const gchar *name); |
244 | 244 | |
245 | + LIB3270_EXPORT gchar * v3270_get_session_title(GtkWidget *widget); | |
246 | + | |
245 | 247 | LIB3270_EXPORT int v3270_set_script(GtkWidget *widget, const gchar id); |
246 | 248 | LIB3270_EXPORT void v3270_set_scaled_fonts(GtkWidget *widget, gboolean on); |
247 | 249 | LIB3270_EXPORT int v3270_set_session_color_type(GtkWidget *widget, unsigned short colortype); | ... | ... |
src/terminal/properties/get.c
... | ... | @@ -141,6 +141,19 @@ LIB3270_EXPORT const gchar * v3270_get_session_name(GtkWidget *widget) |
141 | 141 | |
142 | 142 | } |
143 | 143 | |
144 | +LIB3270_EXPORT gchar * v3270_get_session_title(GtkWidget *widget) | |
145 | +{ | |
146 | + g_return_val_if_fail(GTK_IS_V3270(widget),NULL); | |
147 | + | |
148 | + const char * url = lib3270_get_url(GTK_V3270(widget)->host); | |
149 | + | |
150 | + if(!url) | |
151 | + url = _( "No host defined" ); | |
152 | + | |
153 | + return g_strconcat(v3270_get_session_name(widget)," - ",url,NULL); | |
154 | + | |
155 | +} | |
156 | + | |
144 | 157 | LIB3270_EXPORT H3270 * v3270_get_session(GtkWidget *widget) |
145 | 158 | { |
146 | 159 | g_return_val_if_fail(GTK_IS_V3270(widget),NULL); | ... | ... |