]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - radiant/commands.cpp
Wrap GTK
[xonotic/netradiant.git] / radiant / commands.cpp
1 /*
2    Copyright (C) 2001-2006, William Joseph.
3    All Rights Reserved.
4
5    This file is part of GtkRadiant.
6
7    GtkRadiant is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    GtkRadiant is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with GtkRadiant; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20  */
21
22 #include "commands.h"
23
24 #include "debugging/debugging.h"
25 #include "warnings.h"
26
27 #include <map>
28 #include "string/string.h"
29 #include "versionlib.h"
30 #include "gtkutil/messagebox.h"
31 #include <gtk/gtk.h>
32 #include "gtkmisc.h"
33
34 typedef std::pair<Accelerator, int> ShortcutValue; // accelerator, isRegistered
35 typedef std::map<CopiedString, ShortcutValue> Shortcuts;
36
37 void Shortcuts_foreach( Shortcuts& shortcuts, CommandVisitor& visitor ){
38         for ( Shortcuts::iterator i = shortcuts.begin(); i != shortcuts.end(); ++i )
39         {
40                 visitor.visit( ( *i ).first.c_str(), ( *i ).second.first );
41         }
42 }
43
44 Shortcuts g_shortcuts;
45
46 const Accelerator& GlobalShortcuts_insert( const char* name, const Accelerator& accelerator ){
47         return ( *g_shortcuts.insert( Shortcuts::value_type( name, ShortcutValue( accelerator, false ) ) ).first ).second.first;
48 }
49
50 void GlobalShortcuts_foreach( CommandVisitor& visitor ){
51         Shortcuts_foreach( g_shortcuts, visitor );
52 }
53
54 void GlobalShortcuts_register( const char* name, int type ){
55         Shortcuts::iterator i = g_shortcuts.find( name );
56         if ( i != g_shortcuts.end() ) {
57                 ( *i ).second.second = type;
58         }
59 }
60
61 void GlobalShortcuts_reportUnregistered(){
62         for ( Shortcuts::iterator i = g_shortcuts.begin(); i != g_shortcuts.end(); ++i )
63         {
64                 if ( ( *i ).second.first.key != 0 && !( *i ).second.second ) {
65                         globalOutputStream() << "shortcut not registered: " << ( *i ).first.c_str() << "\n";
66                 }
67         }
68 }
69
70 typedef std::map<CopiedString, Command> Commands;
71
72 Commands g_commands;
73
74 void GlobalCommands_insert( const char* name, const Callback& callback, const Accelerator& accelerator ){
75         bool added = g_commands.insert( Commands::value_type( name, Command( callback, GlobalShortcuts_insert( name, accelerator ) ) ) ).second;
76         ASSERT_MESSAGE( added, "command already registered: " << makeQuoted( name ) );
77 }
78
79 const Command& GlobalCommands_find( const char* command ){
80         Commands::iterator i = g_commands.find( command );
81         ASSERT_MESSAGE( i != g_commands.end(), "failed to lookup command " << makeQuoted( command ) );
82         return ( *i ).second;
83 }
84
85 typedef std::map<CopiedString, Toggle> Toggles;
86
87
88 Toggles g_toggles;
89
90 void GlobalToggles_insert( const char* name, const Callback& callback, const BoolExportCallback& exportCallback, const Accelerator& accelerator ){
91         bool added = g_toggles.insert( Toggles::value_type( name, Toggle( callback, GlobalShortcuts_insert( name, accelerator ), exportCallback ) ) ).second;
92         ASSERT_MESSAGE( added, "toggle already registered: " << makeQuoted( name ) );
93 }
94 const Toggle& GlobalToggles_find( const char* name ){
95         Toggles::iterator i = g_toggles.find( name );
96         ASSERT_MESSAGE( i != g_toggles.end(), "failed to lookup toggle " << makeQuoted( name ) );
97         return ( *i ).second;
98 }
99
100 typedef std::map<CopiedString, KeyEvent> KeyEvents;
101
102
103 KeyEvents g_keyEvents;
104
105 void GlobalKeyEvents_insert( const char* name, const Accelerator& accelerator, const Callback& keyDown, const Callback& keyUp ){
106         bool added = g_keyEvents.insert( KeyEvents::value_type( name, KeyEvent( GlobalShortcuts_insert( name, accelerator ), keyDown, keyUp ) ) ).second;
107         ASSERT_MESSAGE( added, "command already registered: " << makeQuoted( name ) );
108 }
109 const KeyEvent& GlobalKeyEvents_find( const char* name ){
110         KeyEvents::iterator i = g_keyEvents.find( name );
111         ASSERT_MESSAGE( i != g_keyEvents.end(), "failed to lookup keyEvent " << makeQuoted( name ) );
112         return ( *i ).second;
113 }
114
115
116 void disconnect_accelerator( const char *name ){
117         Shortcuts::iterator i = g_shortcuts.find( name );
118         if ( i != g_shortcuts.end() ) {
119                 switch ( ( *i ).second.second )
120                 {
121                 case 1:
122                         // command
123                         command_disconnect_accelerator( name );
124                         break;
125                 case 2:
126                         // toggle
127                         toggle_remove_accelerator( name );
128                         break;
129                 }
130         }
131 }
132
133 void connect_accelerator( const char *name ){
134         Shortcuts::iterator i = g_shortcuts.find( name );
135         if ( i != g_shortcuts.end() ) {
136                 switch ( ( *i ).second.second )
137                 {
138                 case 1:
139                         // command
140                         command_connect_accelerator( name );
141                         break;
142                 case 2:
143                         // toggle
144                         toggle_add_accelerator( name );
145                         break;
146                 }
147         }
148 }
149
150
151 #include <uilib/uilib.h>
152 #include <gdk/gdkkeysyms.h>
153
154 #include "gtkutil/dialog.h"
155 #include "mainframe.h"
156
157 #include "stream/textfilestream.h"
158 #include "stream/stringstream.h"
159
160
161 struct command_list_dialog_t : public ModalDialog
162 {
163         command_list_dialog_t()
164                 : m_close_button( *this, eIDCANCEL ), m_list( NULL ), m_command_iter(), m_model( NULL ), m_waiting_for_key( false ){
165         }
166         ModalDialogButton m_close_button;
167
168         GtkTreeView *m_list;
169         GtkTreeIter m_command_iter;
170         GtkTreeModel *m_model;
171         bool m_waiting_for_key;
172 };
173
174 void accelerator_clear_button_clicked( GtkButton *btn, gpointer dialogptr ){
175         command_list_dialog_t &dialog = *(command_list_dialog_t *) dialogptr;
176
177         if ( dialog.m_waiting_for_key ) {
178                 // just unhighlight, user wanted to cancel
179                 dialog.m_waiting_for_key = false;
180                 gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 2, false, -1 );
181                 gtk_widget_set_sensitive( GTK_WIDGET( dialog.m_list ), true );
182                 dialog.m_model = NULL;
183                 return;
184         }
185
186         GtkTreeSelection *sel = gtk_tree_view_get_selection( dialog.m_list );
187         GtkTreeModel *model;
188         GtkTreeIter iter;
189         if ( !gtk_tree_selection_get_selected( sel, &model, &iter ) ) {
190                 return;
191         }
192
193         GValue val;
194         memset( &val, 0, sizeof( val ) );
195         gtk_tree_model_get_value( GTK_TREE_MODEL( model ), &iter, 0, &val );
196         const char *commandName = g_value_get_string( &val );;
197
198         // clear the ACTUAL accelerator too!
199         disconnect_accelerator( commandName );
200
201         Shortcuts::iterator thisShortcutIterator = g_shortcuts.find( commandName );
202         if ( thisShortcutIterator == g_shortcuts.end() ) {
203                 return;
204         }
205         thisShortcutIterator->second.first = accelerator_null();
206
207         gtk_list_store_set( GTK_LIST_STORE( model ), &iter, 1, "", -1 );
208
209         g_value_unset( &val );
210 }
211
212 void accelerator_edit_button_clicked( GtkButton *btn, gpointer dialogptr ){
213         command_list_dialog_t &dialog = *(command_list_dialog_t *) dialogptr;
214
215         // 1. find selected row
216         GtkTreeSelection *sel = gtk_tree_view_get_selection( dialog.m_list );
217         GtkTreeModel *model;
218         GtkTreeIter iter;
219         if ( !gtk_tree_selection_get_selected( sel, &model, &iter ) ) {
220                 return;
221         }
222         dialog.m_command_iter = iter;
223         dialog.m_model = model;
224
225         // 2. disallow changing the row
226         //gtk_widget_set_sensitive(GTK_WIDGET(dialog.m_list), false);
227
228         // 3. highlight the row
229         gtk_list_store_set( GTK_LIST_STORE( model ), &iter, 2, true, -1 );
230
231         // 4. grab keyboard focus
232         dialog.m_waiting_for_key = true;
233 }
234
235 bool accelerator_window_key_press( ui::Widget widget, GdkEventKey *event, gpointer dialogptr ){
236         command_list_dialog_t &dialog = *(command_list_dialog_t *) dialogptr;
237
238         if ( !dialog.m_waiting_for_key ) {
239                 return false;
240         }
241
242 #if 0
243         if ( event->is_modifier ) {
244                 return false;
245         }
246 #else
247         switch ( event->keyval )
248         {
249         case GDK_KEY_Shift_L:
250         case GDK_KEY_Shift_R:
251         case GDK_KEY_Control_L:
252         case GDK_KEY_Control_R:
253         case GDK_KEY_Caps_Lock:
254         case GDK_KEY_Shift_Lock:
255         case GDK_KEY_Meta_L:
256         case GDK_KEY_Meta_R:
257         case GDK_KEY_Alt_L:
258         case GDK_KEY_Alt_R:
259         case GDK_KEY_Super_L:
260         case GDK_KEY_Super_R:
261         case GDK_KEY_Hyper_L:
262         case GDK_KEY_Hyper_R:
263                 return false;
264         }
265 #endif
266
267         dialog.m_waiting_for_key = false;
268
269         // 7. find the name of the accelerator
270         GValue val;
271         memset( &val, 0, sizeof( val ) );
272         gtk_tree_model_get_value( GTK_TREE_MODEL( dialog.m_model ), &dialog.m_command_iter, 0, &val );
273         const char *commandName = g_value_get_string( &val );;
274         Shortcuts::iterator thisShortcutIterator = g_shortcuts.find( commandName );
275         if ( thisShortcutIterator == g_shortcuts.end() ) {
276                 gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 2, false, -1 );
277                 gtk_widget_set_sensitive( GTK_WIDGET( dialog.m_list ), true );
278                 return true;
279         }
280
281         // 8. build an Accelerator
282         Accelerator newAccel( event->keyval, (GdkModifierType) event->state );
283
284         // 8. verify the key is still free, show a dialog to ask what to do if not
285         class VerifyAcceleratorNotTaken : public CommandVisitor
286         {
287         const char *commandName;
288         const Accelerator &newAccel;
289         ui::Widget widget;
290         GtkTreeModel *model;
291 public:
292         bool allow;
293         VerifyAcceleratorNotTaken( const char *name, const Accelerator &accelerator, ui::Widget w, GtkTreeModel *m ) : commandName( name ), newAccel( accelerator ), widget( w ), model( m ), allow( true ){
294         }
295         void visit( const char* name, Accelerator& accelerator ){
296                 if ( !strcmp( name, commandName ) ) {
297                         return;
298                 }
299                 if ( !allow ) {
300                         return;
301                 }
302                 if ( accelerator.key == 0 ) {
303                         return;
304                 }
305                 if ( accelerator == newAccel ) {
306                         StringOutputStream msg;
307                         msg << "The command " << name << " is already assigned to the key " << accelerator << ".\n\n"
308                                 << "Do you want to unassign " << name << " first?";
309                         auto r = widget.alert( msg.c_str(), "Key already used", ui::alert_type::YESNOCANCEL );
310                         if ( r == ui::alert_response::YES ) {
311                                 // clear the ACTUAL accelerator too!
312                                 disconnect_accelerator( name );
313                                 // delete the modifier
314                                 accelerator = accelerator_null();
315                                 // empty the cell of the key binds dialog
316                                 GtkTreeIter i;
317                                 if ( gtk_tree_model_get_iter_first( GTK_TREE_MODEL( model ), &i ) ) {
318                                         for (;; )
319                                         {
320                                                 GValue val;
321                                                 memset( &val, 0, sizeof( val ) );
322                                                 gtk_tree_model_get_value( GTK_TREE_MODEL( model ), &i, 0, &val );
323                                                 const char *thisName = g_value_get_string( &val );;
324                                                 if ( !strcmp( thisName, name ) ) {
325                                                         gtk_list_store_set( GTK_LIST_STORE( model ), &i, 1, "", -1 );
326                                                 }
327                                                 g_value_unset( &val );
328                                                 if ( !gtk_tree_model_iter_next( GTK_TREE_MODEL( model ), &i ) ) {
329                                                         break;
330                                                 }
331                                         }
332                                 }
333                         }
334                         else if ( r == ui::alert_response::CANCEL ) {
335                                 // aborted
336                                 allow = false;
337                         }
338                 }
339         }
340         } verify_visitor( commandName, newAccel, widget, dialog.m_model );
341         GlobalShortcuts_foreach( verify_visitor );
342
343         gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 2, false, -1 );
344         gtk_widget_set_sensitive( GTK_WIDGET( dialog.m_list ), true );
345
346         if ( verify_visitor.allow ) {
347                 // clear the ACTUAL accelerator first
348                 disconnect_accelerator( commandName );
349
350                 thisShortcutIterator->second.first = newAccel;
351
352                 // write into the cell
353                 StringOutputStream modifiers;
354                 modifiers << newAccel;
355                 gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 1, modifiers.c_str(), -1 );
356
357                 // set the ACTUAL accelerator too!
358                 connect_accelerator( commandName );
359         }
360
361         g_value_unset( &val );
362
363         dialog.m_model = NULL;
364
365         return true;
366 }
367
368 /*
369     GtkTreeIter row;
370     GValue val;
371     if(!model) {g_error("Unable to get model from cell renderer");}
372     gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(model), &row, path_string);
373
374     gtk_tree_model_get_value(GTK_TREE_MODEL(model), &row, 0, &val);
375     const char *name = g_value_get_string(&val);
376     Shortcuts::iterator i = g_shortcuts.find(name);
377     if(i != g_shortcuts.end())
378     {
379         accelerator_parse(i->second.first, new_text);
380         StringOutputStream modifiers;
381         modifiers << i->second.first;
382         gtk_list_store_set(GTK_LIST_STORE(model), &row, 1, modifiers.c_str(), -1);
383     }
384    };
385  */
386
387 void DoCommandListDlg(){
388         command_list_dialog_t dialog;
389
390         ui::Window window = MainFrame_getWindow().create_modal_dialog_window("Mapped Commands", dialog, -1, 400);
391         window.on_key_press([](ui::Widget widget, GdkEventKey *event, gpointer dialogptr) {
392                 return accelerator_window_key_press(widget, event, dialogptr);
393         }, &dialog);
394
395         GtkAccelGroup* accel = ui::AccelGroup();
396         gtk_window_add_accel_group( window, accel );
397
398         GtkHBox* hbox = create_dialog_hbox( 4, 4 );
399         gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( hbox ) );
400
401         {
402                 GtkScrolledWindow* scr = create_scrolled_window( GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC );
403                 gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( scr ), TRUE, TRUE, 0 );
404
405                 {
406                         GtkListStore* store = gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT );
407
408                         ui::Widget view = ui::TreeView(ui::TreeModel(GTK_TREE_MODEL(store)));
409                         dialog.m_list = GTK_TREE_VIEW( view );
410
411                         gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), false ); // annoying
412
413                         {
414                                 auto renderer = ui::CellRendererText();
415                                 GtkTreeViewColumn* column = ui::TreeViewColumn( "Command", renderer, {{"text", 0}, {"weight-set", 2}, {"weight", 3}} );
416                                 gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
417                         }
418
419                         {
420                                 auto renderer = ui::CellRendererText();
421                                 GtkTreeViewColumn* column = ui::TreeViewColumn( "Key", renderer, {{"text", 1}, {"weight-set", 2}, {"weight", 3}} );
422                                 gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
423                         }
424
425                         gtk_widget_show( view );
426                         gtk_container_add( GTK_CONTAINER( scr ), view );
427
428                         {
429                                 // Initialize dialog
430                                 StringOutputStream path( 256 );
431                                 path << SettingsPath_get() << "commandlist.txt";
432                                 globalOutputStream() << "Writing the command list to " << path.c_str() << "\n";
433                                 class BuildCommandList : public CommandVisitor
434                                 {
435                                 TextFileOutputStream m_commandList;
436                                 GtkListStore* m_store;
437 public:
438                                 BuildCommandList( const char* filename, GtkListStore* store ) : m_commandList( filename ), m_store( store ){
439                                 }
440                                 void visit( const char* name, Accelerator& accelerator ){
441                                         StringOutputStream modifiers;
442                                         modifiers << accelerator;
443
444                                         {
445                                                 GtkTreeIter iter;
446                                                 gtk_list_store_append( m_store, &iter );
447                                                 gtk_list_store_set( m_store, &iter, 0, name, 1, modifiers.c_str(), 2, false, 3, 800, -1 );
448                                         }
449
450                                         if ( !m_commandList.failed() ) {
451                                                 int l = strlen( name );
452                                                 m_commandList << name;
453                                                 while ( l++ < 25 )
454                                                         m_commandList << ' ';
455                                                 m_commandList << modifiers.c_str() << '\n';
456                                         }
457                                 }
458                                 } visitor( path.c_str(), store );
459
460                                 GlobalShortcuts_foreach( visitor );
461                         }
462
463                         g_object_unref( G_OBJECT( store ) );
464                 }
465         }
466
467         GtkVBox* vbox = create_dialog_vbox( 4 );
468         gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 );
469         {
470                 GtkButton* editbutton = create_dialog_button( "Edit", (GCallback) accelerator_edit_button_clicked, &dialog );
471                 gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( editbutton ), FALSE, FALSE, 0 );
472
473                 GtkButton* clearbutton = create_dialog_button( "Clear", (GCallback) accelerator_clear_button_clicked, &dialog );
474                 gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( clearbutton ), FALSE, FALSE, 0 );
475
476                 ui::Widget spacer = ui::Image();
477                 gtk_widget_show( spacer );
478                 gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( spacer ), TRUE, TRUE, 0 );
479
480                 GtkButton* button = create_modal_dialog_button( "Close", dialog.m_close_button );
481                 gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
482                 widget_make_default( GTK_WIDGET( button ) );
483                 gtk_widget_grab_default( GTK_WIDGET( button ) );
484                 gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
485                 gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
486         }
487
488         modal_dialog_show( window, dialog );
489         gtk_widget_destroy( GTK_WIDGET( window ) );
490 }
491
492 #include "profile/profile.h"
493
494 const char* const COMMANDS_VERSION = "1.0-gtk-accelnames";
495
496 void SaveCommandMap( const char* path ){
497         StringOutputStream strINI( 256 );
498         strINI << path << "shortcuts.ini";
499
500         TextFileOutputStream file( strINI.c_str() );
501         if ( !file.failed() ) {
502                 file << "[Version]\n";
503                 file << "number=" << COMMANDS_VERSION << "\n";
504                 file << "\n";
505                 file << "[Commands]\n";
506                 class WriteCommandMap : public CommandVisitor
507                 {
508                 TextFileOutputStream& m_file;
509 public:
510                 WriteCommandMap( TextFileOutputStream& file ) : m_file( file ){
511                 }
512                 void visit( const char* name, Accelerator& accelerator ){
513                         m_file << name << "=";
514
515                         const char* key = gtk_accelerator_name( accelerator.key, accelerator.modifiers );
516                         m_file << key;
517                         m_file << "\n";
518                 }
519                 } visitor( file );
520                 GlobalShortcuts_foreach( visitor );
521         }
522 }
523
524 const char* stringrange_find( const char* first, const char* last, char c ){
525         const char* p = strchr( first, '+' );
526         if ( p == 0 ) {
527                 return last;
528         }
529         return p;
530 }
531
532 class ReadCommandMap : public CommandVisitor
533 {
534 const char* m_filename;
535 std::size_t m_count;
536 public:
537 ReadCommandMap( const char* filename ) : m_filename( filename ), m_count( 0 ){
538 }
539 void visit( const char* name, Accelerator& accelerator ){
540         char value[1024];
541         if ( read_var( m_filename, "Commands", name, value ) ) {
542                 if ( string_empty( value ) ) {
543                         accelerator.key = 0;
544                         accelerator.modifiers = (GdkModifierType)0;
545                         return;
546                 }
547
548                 gtk_accelerator_parse( value, &accelerator.key, &accelerator.modifiers );
549                 accelerator = accelerator; // fix modifiers
550
551                 if ( accelerator.key != 0 ) {
552                         ++m_count;
553                 }
554                 else
555                 {
556                         globalOutputStream() << "WARNING: failed to parse user command " << makeQuoted( name ) << ": unknown key " << makeQuoted( value ) << "\n";
557                 }
558         }
559 }
560 std::size_t count() const {
561         return m_count;
562 }
563 };
564
565 void LoadCommandMap( const char* path ){
566         StringOutputStream strINI( 256 );
567         strINI << path << "shortcuts.ini";
568
569         FILE* f = fopen( strINI.c_str(), "r" );
570         if ( f != 0 ) {
571                 fclose( f );
572                 globalOutputStream() << "loading custom shortcuts list from " << makeQuoted( strINI.c_str() ) << "\n";
573
574                 Version version = version_parse( COMMANDS_VERSION );
575                 Version dataVersion = { 0, 0 };
576
577                 {
578                         char value[1024];
579                         if ( read_var( strINI.c_str(), "Version", "number", value ) ) {
580                                 dataVersion = version_parse( value );
581                         }
582                 }
583
584                 if ( version_compatible( version, dataVersion ) ) {
585                         globalOutputStream() << "commands import: data version " << dataVersion << " is compatible with code version " << version << "\n";
586                         ReadCommandMap visitor( strINI.c_str() );
587                         GlobalShortcuts_foreach( visitor );
588                         globalOutputStream() << "parsed " << Unsigned( visitor.count() ) << " custom shortcuts\n";
589                 }
590                 else
591                 {
592                         globalOutputStream() << "commands import: data version " << dataVersion << " is not compatible with code version " << version << "\n";
593                 }
594         }
595         else
596         {
597                 globalOutputStream() << "failed to load custom shortcuts from " << makeQuoted( strINI.c_str() ) << "\n";
598         }
599 }