11-- ----------------------------------------------------------------------------
22-- GNAT Studio --
33-- --
4- -- Copyright (C) 2000-2024 , AdaCore --
4+ -- Copyright (C) 2000-2025 , AdaCore --
55-- --
66-- This is free software; you can redistribute it and/or modify it under --
77-- terms of the GNU General Public License as published by the Free Soft- --
1515-- of the license. --
1616-- ----------------------------------------------------------------------------
1717
18- with Ada.Calendar ; use Ada.Calendar;
18+ with Ada.Calendar ; use Ada.Calendar;
1919with Ada.Strings.Fixed ;
20- with Ada.Strings.Equal_Case_Insensitive ; use Ada.Strings;
20+ with Ada.Strings.Equal_Case_Insensitive ;
21+ use Ada.Strings;
2122with Ada.Unchecked_Conversion ;
2223with Ada.Unchecked_Deallocation ;
23-
2424with GNAT.Directory_Operations ; use GNAT.Directory_Operations;
2525with GNAT.OS_Lib ; use GNAT.OS_Lib;
2626with GNATCOLL.Utils ; use GNATCOLL.Utils;
27+ with Interfaces.C ;
28+
29+ with GNATCOLL.Traces ; use GNATCOLL.Traces;
2730
28- with VSS.Strings ; use VSS.Strings;
29- with VSS.Strings.Conversions ; use VSS.Strings.Conversions;
30-
31- with Glib.Convert ; use Glib.Convert;
32- with Glib.Object ; use Glib.Object;
33- with Glib.Properties ; use Glib.Properties;
34- with Glib.Menu_Model ; use Glib.Menu_Model;
35- with Glib.Values ; use Glib.Values;
36- with Glib.Variant ; use Glib.Variant;
37-
38- with Gdk ; use Gdk;
39- with Gdk.Cursor ; use Gdk.Cursor;
40- with Gdk.Device ; use Gdk.Device;
41- with Gdk.Event ; use Gdk.Event;
42- with Gdk.Keyval ; use Gdk.Keyval;
31+ with VSS.Application ;
32+ with VSS.Strings ; use VSS.Strings;
33+ with VSS.Strings.Conversions ;
34+ with VSS.Strings.Formatters.Strings ; use VSS.Strings.Formatters.Strings;
35+ with VSS.Strings.Templates ; use VSS.Strings.Templates;
36+
37+ with Glib.Convert ; use Glib.Convert;
38+ with Glib.Object ; use Glib.Object;
39+ with Glib.Properties ; use Glib.Properties;
40+ with Glib.Menu_Model ; use Glib.Menu_Model;
41+ with Glib.Values ; use Glib.Values;
42+ with Glib.Variant ; use Glib.Variant;
43+
44+ with Gdk ; use Gdk;
45+ with Gdk.Cursor ; use Gdk.Cursor;
46+ with Gdk.Device ; use Gdk.Device;
47+ with Gdk.Event ; use Gdk.Event;
48+ with Gdk.Keyval ; use Gdk.Keyval;
4349with Gdk.Main ;
4450with Gdk.Pixbuf ;
45- with Gdk.RGBA ; use Gdk.RGBA;
46- with Gdk.Types.Keysyms ; use Gdk.Types.Keysyms;
47- with Gdk.Types ; use Gdk.Types;
48- with Gdk.Window ; use Gdk.Window;
49-
50- with Gtk.Adjustment ; use Gtk.Adjustment;
51- with Gtk.Alignment ; use Gtk.Alignment;
52- with Gtk.Bin ; use Gtk.Bin;
53- with Gtk.Box ; use Gtk.Box;
54- with Gtk.Button ; use Gtk.Button;
55- with Gtk.Cell_Renderer ; use Gtk.Cell_Renderer;
56- with Gtk.Cell_Renderer_Pixbuf ; use Gtk.Cell_Renderer_Pixbuf;
57- with Gtk.Check_Button ; use Gtk.Check_Button;
58- with Gtk.Container ; use Gtk.Container;
59- with Gtk.Dialog ; use Gtk.Dialog;
60- with Gtk.Enums ; use Gtk.Enums;
61- with Gtk.Event_Box ; use Gtk.Event_Box;
62- with Gtk.Frame ; use Gtk.Frame;
63- with Gtk.GEntry ; use Gtk.GEntry;
64- with Gtk.Handlers ; use Gtk.Handlers;
65- with Gtk.Image ; use Gtk.Image;
66- with Gtk.Label ; use Gtk.Label;
67- with Gtk.List_Store ; use Gtk.List_Store;
68- with Gtk.Menu ; use Gtk.Menu;
69- with Gtk.Menu_Bar ; use Gtk.Menu_Bar;
70- with Gtk.Menu_Item ; use Gtk.Menu_Item;
71- with Gtk.Menu_Shell ; use Gtk.Menu_Shell;
72- with Gtk.Separator_Menu_Item ; use Gtk.Separator_Menu_Item;
73- with Gtk.Style_Context ; use Gtk.Style_Context;
74- with Gtk.Text_Iter ; use Gtk.Text_Iter;
75- with Gtk.Text_Mark ; use Gtk.Text_Mark;
76- with Gtk.Text_Tag ; use Gtk.Text_Tag;
77- with Gtk.Text_View ; use Gtk.Text_View;
78- with Gtk.Tree_Selection ; use Gtk.Tree_Selection;
79- with Gtk.Tree_Store ; use Gtk.Tree_Store;
80- with Gtk.Tree_View ; use Gtk.Tree_View;
81- with Gtk.Tree_View_Column ; use Gtk.Tree_View_Column;
82- with Gtk.Widget ; use Gtk.Widget;
51+ with Gdk.RGBA ; use Gdk.RGBA;
52+ with Gdk.Types.Keysyms ; use Gdk.Types.Keysyms;
53+ with Gdk.Types ; use Gdk.Types;
54+ with Gdk.Window ; use Gdk.Window;
55+
56+ with Gtk.Adjustment ; use Gtk.Adjustment;
57+ with Gtk.Alignment ; use Gtk.Alignment;
58+ with Gtk.Bin ; use Gtk.Bin;
59+ with Gtk.Box ; use Gtk.Box;
60+ with Gtk.Button ; use Gtk.Button;
61+ with Gtk.Cell_Renderer ; use Gtk.Cell_Renderer;
62+ with Gtk.Cell_Renderer_Pixbuf ; use Gtk.Cell_Renderer_Pixbuf;
63+ with Gtk.Check_Button ; use Gtk.Check_Button;
64+ with Gtk.Container ; use Gtk.Container;
65+ with Gtk.Dialog ; use Gtk.Dialog;
66+ with Gtk.Enums ; use Gtk.Enums;
67+ with Gtk.Event_Box ; use Gtk.Event_Box;
68+ with Gtk.Frame ; use Gtk.Frame;
69+ with Gtk.GEntry ; use Gtk.GEntry;
70+ with Gtk.Handlers ; use Gtk.Handlers;
71+ with Gtk.Image ; use Gtk.Image;
72+ with Gtk.Label ; use Gtk.Label;
73+ with Gtk.List_Store ; use Gtk.List_Store;
74+ with Gtk.Menu ; use Gtk.Menu;
75+ with Gtk.Menu_Bar ; use Gtk.Menu_Bar;
76+ with Gtk.Menu_Item ; use Gtk.Menu_Item;
77+ with Gtk.Menu_Shell ; use Gtk.Menu_Shell;
78+ with Gtk.Separator_Menu_Item ; use Gtk.Separator_Menu_Item;
79+ with Gtk.Style_Context ; use Gtk.Style_Context;
80+ with Gtk.Text_Iter ; use Gtk.Text_Iter;
81+ with Gtk.Text_Mark ; use Gtk.Text_Mark;
82+ with Gtk.Text_Tag ; use Gtk.Text_Tag;
83+ with Gtk.Text_View ; use Gtk.Text_View;
84+ with Gtk.Tree_Selection ; use Gtk.Tree_Selection;
85+ with Gtk.Tree_Store ; use Gtk.Tree_Store;
86+ with Gtk.Tree_View ; use Gtk.Tree_View;
87+ with Gtk.Tree_View_Column ; use Gtk.Tree_View_Column;
88+ with Gtk.Widget ; use Gtk.Widget;
8389with Gtkada.Types ;
8490
85- with Pango.Enums ; use Pango.Enums;
91+ with Pango.Enums ; use Pango.Enums;
8692
87- with Gtkada.Handlers ; use Gtkada.Handlers;
88- with Gtkada.MDI ; use Gtkada.MDI;
93+ with Gtkada.Handlers ; use Gtkada.Handlers;
94+ with Gtkada.MDI ; use Gtkada.MDI;
8995
90- with VSS.Application ;
91-
92- with Basic_Types ; use Basic_Types;
93- with Config ; use Config;
94- with Interfaces.C ;
95- with String_List_Utils ; use String_List_Utils;
96- with String_Utils ; use String_Utils;
97- with Glib_String_Utils ; use Glib_String_Utils;
98- with GNATCOLL.Traces ; use GNATCOLL.Traces;
96+ with Basic_Types ; use Basic_Types;
97+ with Config ; use Config;
98+ with String_List_Utils ; use String_List_Utils;
99+ with String_Utils ; use String_Utils;
100+ with Glib_String_Utils ; use Glib_String_Utils;
99101
100102package body GUI_Utils is
101103
@@ -259,12 +261,17 @@ package body GUI_Utils is
259261 while Iter /= Null_Iter loop
260262 declare
261263 Str : Virtual_String
262- renames To_Virtual_String (Model.Get_String (Iter, Col));
264+ renames VSS.Strings.Conversions.To_Virtual_String
265+ (Model.Get_String (Iter, Col));
263266 begin
264- exit when Str = Text
267+ exit when
268+ Str = Text
265269 or else (not Case_Sensitive
266270 and then Equal_Case_Insensitive
267- (To_UTF_8_String (Text), To_UTF_8_String (Str)));
271+ (VSS.Strings.Conversions.To_UTF_8_String
272+ (Text),
273+ VSS.Strings.Conversions.To_UTF_8_String
274+ (Str)));
268275 end ;
269276
270277 Model.Next (Iter);
@@ -277,7 +284,7 @@ package body GUI_Utils is
277284 Gtk.List_Store.Append (Model, Iter);
278285 end if ;
279286
280- Model.Set (Iter, Col, To_UTF_8_String (Text));
287+ Model.Set (Iter, Col, VSS.Strings.Conversions. To_UTF_8_String (Text));
281288 end if ;
282289
283290 if Select_Text then
@@ -3046,11 +3053,13 @@ package body GUI_Utils is
30463053 function Create_Logo_And_Title_Area
30473054 (Is_Dark_Theme : Boolean) return Gtk_Widget
30483055 is
3049- Frame : Gtk_Frame;
3050- Vbox : Gtk_Box;
3051- Logo : Gtk_Image;
3052- Label : Gtk_Label;
3053- Suffix : constant String := (if Is_Dark_Theme then " -dark" else " " );
3056+ Frame : Gtk_Frame;
3057+ Vbox : Gtk_Box;
3058+ Logo : Gtk_Image;
3059+ Label : Gtk_Label;
3060+ Suffix : constant String := (if Is_Dark_Theme then " -dark" else " " );
3061+ Template : VSS.Strings.Templates.Virtual_String_Template := " Version {}" ;
3062+
30543063 begin
30553064 Gtk_New (Frame);
30563065 Get_Style_Context (Frame).Add_Class (" gps-welcome-dialog-logo-area" );
@@ -3065,7 +3074,10 @@ package body GUI_Utils is
30653074 Size => Icon_Size_Dialog);
30663075 Vbox.Pack_Start (Logo, Expand => False);
30673076
3068- Gtk_New (Label, " Version " & To_String (Config.Version));
3077+ Gtk_New
3078+ (Label,
3079+ VSS.Strings.Conversions.To_UTF_8_String
3080+ (Template.Format (Image (Config.Version))));
30693081 Label.Set_Alignment (0.75 , 0.5 );
30703082 Get_Style_Context (Label).Add_Class (" gps-welcome-dialog-version" );
30713083 Vbox.Pack_Start (Label, Expand => False, Padding => 10 );
0 commit comments