Commit e6ad71bbb343aedec6175b2487e495a515545b5d

Authored by Perry Werneck
1 parent 6f18dd3d

Adjustments in the header bar actions.

schemas/linux/application.gschema.xml.in
@@ -74,15 +74,9 @@ @@ -74,15 +74,9 @@
74 <description></description> 74 <description></description>
75 </key> 75 </key>
76 76
77 - <key name="header-start-action-names" type="s">  
78 - <default>'win.disconnect,win.reconnect,win.file.transfer,win.print'</default>  
79 - <summary>The actions in the first block of the header bar</summary>  
80 - <description></description>  
81 - </key>  
82 -  
83 - <key name="header-end-action-names" type="s">  
84 - <default>'menu.open-menu'</default>  
85 - <summary>The actions in the last block of the header bar</summary> 77 + <key name="header-action-names" type="s">
  78 + <default>'win.disconnect,win.reconnect,win.file.transfer,win.print:menu.open-menu'</default>
  79 + <summary>The actions in the header bar</summary>
86 <description></description> 80 <description></description>
87 </key> 81 </key>
88 82
schemas/windows/application.gschema.xml.in
@@ -74,15 +74,9 @@ @@ -74,15 +74,9 @@
74 <description></description> 74 <description></description>
75 </key> 75 </key>
76 76
77 - <key name="header-start-action-names" type="s">  
78 - <default>'win.disconnect,win.reconnect,win.file.transfer,win.print'</default>  
79 - <summary>The actions in the first block of the header bar</summary>  
80 - <description></description>  
81 - </key>  
82 -  
83 - <key name="header-end-action-names" type="s">  
84 - <default>'menu.open-menu'</default>  
85 - <summary>The actions in the last block of the header bar</summary> 77 + <key name="header-action-names" type="s">
  78 + <default>'win.disconnect,win.reconnect,win.file.transfer,win.print:menu.open-menu'</default>
  79 + <summary>The actions in the header bar</summary>
86 <description></description> 80 <description></description>
87 </key> 81 </key>
88 82
src/objects/window/window.c
@@ -221,28 +221,43 @@ @@ -221,28 +221,43 @@
221 // Create header's action buttons 221 // Create header's action buttons
222 // https://wiki.gnome.org/Initiatives/GnomeGoals/GearIcons 222 // https://wiki.gnome.org/Initiatives/GnomeGoals/GearIcons
223 { 223 {
224 - g_autofree gchar * left = g_settings_get_string(settings, "header-start-action-names");  
225 - g_autofree gchar * right = g_settings_get_string(settings, "header-end-action-names"); 224 + g_autofree gchar * header_actions = g_settings_get_string(settings, "header-action-names");
  225 + gchar ** header_blocks = g_strsplit(header_actions,":",-1);
226 226
227 - gchar ** elements; 227 + if(g_strv_length(header_blocks) >= 2) {
228 228
229 - // First the left side actions.  
230 - elements = g_strsplit(left,",",-1);  
231 - for(ix=0;elements[ix];ix++) {  
232 - gtk_header_bar_pack_start(header, pw3270_header_button_new_from_builder(GTK_WIDGET(window),builder,elements[ix]));  
233 - }  
234 - g_strfreev(elements); 229 + gchar ** elements;
  230 +
  231 + // First the left side actions.
  232 + elements = g_strsplit(header_blocks[0],",",-1);
  233 + for(ix=0;elements[ix];ix++) {
  234 + gtk_header_bar_pack_start(header, pw3270_header_button_new_from_builder(GTK_WIDGET(window),builder,elements[ix]));
  235 + }
  236 + g_strfreev(elements);
  237 +
  238 + // And then, the right side actions;
  239 + elements = g_strsplit(header_blocks[1],",",-1);
  240 + for(ix=0;elements[ix];ix++) {
  241 + gtk_header_bar_pack_end(header, pw3270_header_button_new_from_builder(GTK_WIDGET(window),builder,elements[ix]));
  242 + }
  243 + g_strfreev(elements);
235 244
236 - // And then, the right side actions;  
237 - elements = g_strsplit(right,",",-1);  
238 - for(ix=0;elements[ix];ix++) {  
239 - gtk_header_bar_pack_end(header, pw3270_header_button_new_from_builder(GTK_WIDGET(window),builder,elements[ix]));  
240 } 245 }
241 - g_strfreev(elements); 246 +
  247 + g_strfreev(header_blocks);
242 248
243 } 249 }
244 250
245 /* 251 /*
  252 + {
  253 + g_autofree gchar * left = g_settings_get_string(settings, "header-start-action-names");
  254 + g_autofree gchar * right = g_settings_get_string(settings, "header-end-action-names");
  255 +
  256 +
  257 + }
  258 + */
  259 +
  260 + /*
246 static const gchar * end_actions[] = { 261 static const gchar * end_actions[] = {
247 "menu.open-menu", 262 "menu.open-menu",
248 }; 263 };