Commit 662a8eb2f55cde0af5885f1103fec46c54122b4d

Authored by Perry Werneck
1 parent d606a050
Exists in master and in 1 other branch develop

Working on the new IPC plugin module.

pw3270-plugin-ipc.cbp
@@ -80,7 +80,6 @@ @@ -80,7 +80,6 @@
80 <Unit filename="src/core/methods.c"> 80 <Unit filename="src/core/methods.c">
81 <Option compilerVar="CC" /> 81 <Option compilerVar="CC" />
82 </Unit> 82 </Unit>
83 - <Unit filename="src/core/private.h" />  
84 <Unit filename="src/core/setproperties.c"> 83 <Unit filename="src/core/setproperties.c">
85 <Option compilerVar="CC" /> 84 <Option compilerVar="CC" />
86 </Unit> 85 </Unit>
src/plugin/plugin.c
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 30
31 31
32 /** 32 /**
33 - * @brief Plugin startup/stop for linux. 33 + * @brief IPC Plugin startup/stop for linux.
34 * 34 *
35 */ 35 */
36 36
src/testprogram/testprogram.c
@@ -121,6 +121,30 @@ @@ -121,6 +121,30 @@
121 return item; 121 return item;
122 } 122 }
123 123
  124 + static void session_changed(GtkWidget *widget, GtkWidget *window) {
  125 +
  126 + g_autofree gchar * title = NULL;
  127 +
  128 + g_message("Session name was changed");
  129 +
  130 + if(v3270_is_connected(widget)) {
  131 + const gchar *host = v3270_get_hostname(widget);
  132 +
  133 + if(host && *host)
  134 + title = g_strdup_printf("%s - %s",v3270_get_session_name(widget),host);
  135 + else
  136 + title = g_strdup_printf("%s",v3270_get_session_name(widget));
  137 +
  138 + } else {
  139 +
  140 + title = g_strdup_printf("%s - Disconnected",v3270_get_session_name(widget));
  141 + }
  142 +
  143 + gtk_window_set_title(GTK_WINDOW(window),title);
  144 +
  145 +
  146 + }
  147 +
124 static void activate(GtkApplication* app, G_GNUC_UNUSED gpointer user_data) { 148 static void activate(GtkApplication* app, G_GNUC_UNUSED gpointer user_data) {
125 149
126 GtkWidget * window = gtk_application_window_new(app); 150 GtkWidget * window = gtk_application_window_new(app);
@@ -204,6 +228,8 @@ @@ -204,6 +228,8 @@
204 228
205 } 229 }
206 230
  231 + g_signal_connect(terminal,"session_changed",G_CALLBACK(session_changed),window);
  232 +
207 } 233 }
208 234
209 int main (int argc, char **argv) { 235 int main (int argc, char **argv) {