Commit 72fde623b3181831111bba511d85c405cb0ba52f
1 parent
33cbc7b2
Exists in
master
and in
2 other branches
Storing last command line passed session as a default one.
Showing
4 changed files
with
60 additions
and
7 deletions
Show diff stats
schemas/linux/application.gschema.xml.in
@@ -38,6 +38,7 @@ | @@ -38,6 +38,7 @@ | ||
38 | <description>The ID of the current user interface style</description> | 38 | <description>The ID of the current user interface style</description> |
39 | </key> | 39 | </key> |
40 | 40 | ||
41 | + | ||
41 | <key name="allow-host-settings" type="b"> | 42 | <key name="allow-host-settings" type="b"> |
42 | <default>true</default> | 43 | <default>true</default> |
43 | <summary>Allow host settings</summary> | 44 | <summary>Allow host settings</summary> |
@@ -62,6 +63,12 @@ | @@ -62,6 +63,12 @@ | ||
62 | <description></description> | 63 | <description></description> |
63 | </key> | 64 | </key> |
64 | 65 | ||
66 | + <key name="update-session-file" type="b"> | ||
67 | + <default>true</default> | ||
68 | + <summary>Update default session time from command line</summary> | ||
69 | + <description></description> | ||
70 | + </key> | ||
71 | + | ||
65 | </schema> | 72 | </schema> |
66 | 73 | ||
67 | </schemalist> | 74 | </schemalist> |
schemas/windows/application.gschema.xml.in
@@ -38,16 +38,47 @@ | @@ -38,16 +38,47 @@ | ||
38 | <description>The ID of the current user interface style</description> | 38 | <description>The ID of the current user interface style</description> |
39 | </key> | 39 | </key> |
40 | 40 | ||
41 | + <key name="gtk-csd" type="i"> | ||
42 | + <default>0</default> | ||
43 | + <summary>GTK CSD</summary> | ||
44 | + <description>Gtk Client side decorations</description> | ||
45 | + </key> | ||
46 | + | ||
47 | + | ||
41 | <key name="allow-host-settings" type="b"> | 48 | <key name="allow-host-settings" type="b"> |
42 | <default>true</default> | 49 | <default>true</default> |
43 | <summary>Allow host settings</summary> | 50 | <summary>Allow host settings</summary> |
44 | <description>Allow changing of host session properties</description> | 51 | <description>Allow changing of host session properties</description> |
45 | </key> | 52 | </key> |
46 | 53 | ||
47 | - <key name="gtk-csd" type="i"> | ||
48 | - <default>0</default> | ||
49 | - <summary>GTK CSD</summary> | ||
50 | - <description>Gtk Client side decorations</description> | 54 | + <key name="allow-host-settings" type="b"> |
55 | + <default>true</default> | ||
56 | + <summary>Allow host settings</summary> | ||
57 | + <description>Allow changing of host session properties</description> | ||
58 | + </key> | ||
59 | + | ||
60 | + <key name="allow-new-tab-actions" type="b"> | ||
61 | + <default>true</default> | ||
62 | + <summary>Enable new tab actions</summary> | ||
63 | + <description>Enable new tab actions</description> | ||
64 | + </key> | ||
65 | + | ||
66 | + <key name="allow-new-window-actions" type="b"> | ||
67 | + <default>true</default> | ||
68 | + <summary>Enable new window actions</summary> | ||
69 | + <description>Enable new window actions</description> | ||
70 | + </key> | ||
71 | + | ||
72 | + <key name="default-session-file" type="s"> | ||
73 | + <default>'~/.config/default.3270'</default> | ||
74 | + <summary>Path of the default session file</summary> | ||
75 | + <description></description> | ||
76 | + </key> | ||
77 | + | ||
78 | + <key name="update-session-file" type="b"> | ||
79 | + <default>true</default> | ||
80 | + <summary>Update default session time from command line</summary> | ||
81 | + <description></description> | ||
51 | </key> | 82 | </key> |
52 | 83 | ||
53 | </schema> | 84 | </schema> |
src/objects/application/application.c
@@ -240,6 +240,7 @@ | @@ -240,6 +240,7 @@ | ||
240 | 240 | ||
241 | // Bind properties | 241 | // Bind properties |
242 | if(app->settings) { | 242 | if(app->settings) { |
243 | + | ||
243 | g_object_ref_sink(G_OBJECT(app->settings)); | 244 | g_object_ref_sink(G_OBJECT(app->settings)); |
244 | 245 | ||
245 | #ifdef _WIN32 | 246 | #ifdef _WIN32 |
@@ -296,8 +297,6 @@ | @@ -296,8 +297,6 @@ | ||
296 | 297 | ||
297 | } | 298 | } |
298 | 299 | ||
299 | - | ||
300 | - | ||
301 | } | 300 | } |
302 | 301 | ||
303 | g_dir_close(dir); | 302 | g_dir_close(dir); |
@@ -310,7 +309,6 @@ | @@ -310,7 +309,6 @@ | ||
310 | 309 | ||
311 | } | 310 | } |
312 | 311 | ||
313 | - | ||
314 | } | 312 | } |
315 | 313 | ||
316 | } | 314 | } |
src/objects/application/open.c
@@ -28,6 +28,7 @@ | @@ -28,6 +28,7 @@ | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "private.h" | 30 | #include "private.h" |
31 | + #include <pw3270/application.h> | ||
31 | 32 | ||
32 | gchar * v3270_keyfile_find(const gchar *name) { | 33 | gchar * v3270_keyfile_find(const gchar *name) { |
33 | // | 34 | // |
@@ -71,6 +72,8 @@ | @@ -71,6 +72,8 @@ | ||
71 | void pw3270_application_open(GApplication *application, GFile **files, gint n_files, const gchar G_GNUC_UNUSED(*hint)) { | 72 | void pw3270_application_open(GApplication *application, GFile **files, gint n_files, const gchar G_GNUC_UNUSED(*hint)) { |
72 | 73 | ||
73 | GtkWidget * window = GTK_WIDGET(gtk_application_get_active_window(GTK_APPLICATION(application))); | 74 | GtkWidget * window = GTK_WIDGET(gtk_application_get_active_window(GTK_APPLICATION(application))); |
75 | + GSettings * settings = pw3270_application_get_settings(application); | ||
76 | + | ||
74 | gint file; | 77 | gint file; |
75 | 78 | ||
76 | debug("%s files=%d",__FUNCTION__,n_files); | 79 | debug("%s files=%d",__FUNCTION__,n_files); |
@@ -113,6 +116,13 @@ | @@ -113,6 +116,13 @@ | ||
113 | pw3270_application_window_new_tab(window,path); | 116 | pw3270_application_window_new_tab(window,path); |
114 | } | 117 | } |
115 | 118 | ||
119 | + if(g_settings_get_boolean(settings,"update-session-file")) { | ||
120 | + | ||
121 | + g_message("Updating default session file to '%s'",path); | ||
122 | + g_settings_set_string(settings,"default-session-file",path); | ||
123 | + | ||
124 | + } | ||
125 | + | ||
116 | continue; | 126 | continue; |
117 | } | 127 | } |
118 | 128 | ||
@@ -130,6 +140,13 @@ | @@ -130,6 +140,13 @@ | ||
130 | pw3270_application_window_new_tab(window, filename); | 140 | pw3270_application_window_new_tab(window, filename); |
131 | } | 141 | } |
132 | 142 | ||
143 | + if(g_settings_get_boolean(settings,"update-session-file")) { | ||
144 | + | ||
145 | + g_message("Updating default session file to '%s'",filename); | ||
146 | + g_settings_set_string(settings,"default-session-file",filename); | ||
147 | + | ||
148 | + } | ||
149 | + | ||
133 | continue; | 150 | continue; |
134 | } | 151 | } |
135 | 152 |