2013-09-20 Keith Marshall <keithmarshall@users.sourceforge.net>
+ Establish default preferences for GUI; (cf. MinGW-Feature #2036)
+
+ * src/pkgbase.h (pkgXmlDocument::EstablishPreferences): Adjust its
+ prototype; add argument identifying prospective client classification.
+
+ * src/pkgopts.cpp (client_key): New XML property keyword; define it.
+ (pkgXmlDocument::EstablishPreferences): Implement filter, based on new
+ client classification argument, to restrict preference selection to a
+ matching client class specification.
+
+ * src/climain.cpp (dbase.EstablishPreferences): Filter on class "cli".
+ * src/guiexec.cpp (pkgData->EstablishPreferences): Likewise, on "gui".
+
+ * xml/profile.xml (preferences): Add client="cli" attribute for the
+ existing specification; add another for client="gui".
+
+2013-09-20 Keith Marshall <keithmarshall@users.sourceforge.net>
+
Force canonical comparison of shell links; (cf. MinGW-Bug #2054)
* scripts/libexec/unlink.js [FileExists(filename) && (chklink != "")]:
* $Id$
*
* Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2009, 2010, 2011, 2012, MinGW Project
+ * Copyright (C) 2009-2013, MinGW.org Project
*
*
* Implementation of the main program function, which is invoked by
/* ...initialise any preferences which the user may
* have specified within profile.xml...
*/
- dbase.EstablishPreferences();
+ dbase.EstablishPreferences( "cli" );
/* ...and invoke the appropriate action handler.
*/
throw WTK::runtime_error( "Cannot read package catalogue" );
/* Finally, load the installation records pertaining to
- * the active system map.
+ * the active system map...
*/
pkgData->LoadSystemMap();
+
+ /* ...and establish any preferences which the user may have
+ * specified within profile.xml
+ */
+ pkgData->EstablishPreferences( "gui" );
}
static void pkgInvokeInitDataLoad( void *window )
* $Id$
*
* Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2009, 2010, 2011, 2012, 2013, MinGW.org Project
+ * Copyright (C) 2009-2013, MinGW.org Project
*
*
* Public interface for the package directory management routines;
* options, which are specified within profile.xml rather than on
* the command line.
*/
- void EstablishPreferences();
+ void EstablishPreferences( const char* = NULL );
/* Method to synchronise the state of the local package manifest
* with the master copy held on the distribution server.
* $Id$
*
* Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2012, MinGW Project
+ * Copyright (C) 2012, 2013, MinGW.org Project
*
*
* Implementation of XML interpreter for configuation of preferences.
/* XML tag/attribute key names, used exclusively within this module.
*/
static const char *prefs_key = "preferences";
+static const char *client_key = "client";
static const char *option_key = "option";
static const char *value_key = "value";
}
}
-void pkgXmlDocument::EstablishPreferences()
+void pkgXmlDocument::EstablishPreferences( const char *client )
{
/* Method to interpret the content of any "preferences" sections
* appearing within the XML database.
pkgXmlNode *prefs = dbase_root->FindFirstAssociate( prefs_key );
while( prefs != NULL )
{
- /* ...and interpret any contained "enable" specifications.
+ /* ...then, for it and any of its siblings which apply within
+ * the active application profile classification...
*/
- pkgPreferenceEvaluator opt( prefs->FindFirstAssociate( option_key ));
- while( opt.Current() != NULL )
+ if( (client == NULL)
+ || (strcasecmp( client, prefs->GetPropVal( client_key, client )) == 0) )
{
- const char *optname;
- if( (optname = opt.SetName()) != NULL )
+ /* ...interpret any contained "enable" specifications.
+ */
+ pkgPreferenceEvaluator opt( prefs->FindFirstAssociate( option_key ));
+ while( opt.Current() != NULL )
{
- if( opt_strcmp( optname, desktop_option ) == 0 )
- /*
- * Enable post-install hook for creation of desktop shortcuts;
- * by default, these are defined for current user only, but may
- * optionally be provided for all users.
- */
- opt.SetScriptHook( PKG_DESKTOP_HOOK, NULL );
+ const char *optname;
+ if( (optname = opt.SetName()) != NULL )
+ {
+ if( opt_strcmp( optname, desktop_option ) == 0 )
+ /*
+ * Enable post-install hook for creation of desktop shortcuts;
+ * by default, these are defined for current user only, but may
+ * optionally be provided for all users.
+ */
+ opt.SetScriptHook( PKG_DESKTOP_HOOK, NULL );
- else if( opt_strcmp( optname, start_menu_option ) == 0 )
- /*
- * Similarly, enable hook for creation of start menu shortcuts.
- */
- opt.SetScriptHook( PKG_START_MENU_HOOK, NULL );
+ else if( opt_strcmp( optname, start_menu_option ) == 0 )
+ /*
+ * Similarly, enable hook for creation of start menu shortcuts.
+ */
+ opt.SetScriptHook( PKG_START_MENU_HOOK, NULL );
- else
- /* Any unrecognised option specification is simply ignored,
- * after posting an appropriate diagnostic message.
- */
- dmh_notify( DMH_WARNING, "unknown option '%s' ignored\n", optname );
+ else
+ /* Any unrecognised option specification is simply ignored,
+ * after posting an appropriate diagnostic message.
+ */
+ dmh_notify( DMH_WARNING, "unknown option '%s' ignored\n", optname );
+ }
+ /* Repeat for any further "enable" specifations...
+ */
+ opt.GetNext( option_key );
}
- /* Repeat for any further "enable" specifations...
- */
- opt.GetNext( option_key );
}
/* ...and for any additional "preferences" sections.
*/
$Id$
Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- Copyright (C) 2009, 2010, 2012, MinGW Project
+ Copyright (C) 2009, 2010, 2012, 2013, MinGW.org Project
Master configuration profile for mingw-get.
arising from the use of this software.
-->
- <preferences>
+ <preferences client="cli">
<!--
"preferences" specifications provide a mechanism for defining
user specified default attributes for command line options such
<!--option name="start-menu" value="all-users" /-->
</preferences>
+ <preferences client="gui">
+ <!--
+ The preceding "preferences" section applies exclusively to the
+ CLI client, (where command line options may be used); here, we
+ specify defaults for the GUI client, (which provides no support
+ for command line options), such that shortcuts will be created
+ on the desktop, and in the start menu, for the current user.
+
+ Note that matching of the "client" attribute will be performed
+ case-insensitively, against a keyword defined by the respective
+ client; any "preferences" section with no "client" assignment
+ will be matched for ALL clients.
+ -->
+
+ <option name="desktop" />
+ <option name="start-menu" />
+ </preferences>
+
<repository uri="http://prdownloads.sourceforge.net/mingw/%F.xml.lzma?download">
<!--
The "repository" specification identifies the URI where package