Author: jsuchome Date: Tue Apr 15 11:19:17 2008 New Revision: 46646 URL: http://svn.opensuse.org/viewcvs/yast?rev=46646&view=rev Log: - added support for command line interface - better help text and 'import directory' label - 2.16.7 Modified: trunk/fingerprint-reader/VERSION trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes trunk/fingerprint-reader/src/FingerprintReader.ycp trunk/fingerprint-reader/src/dialogs.ycp trunk/fingerprint-reader/src/fingerprint-reader.ycp Modified: trunk/fingerprint-reader/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/VERSION?rev=46... ============================================================================== --- trunk/fingerprint-reader/VERSION (original) +++ trunk/fingerprint-reader/VERSION Tue Apr 15 11:19:17 2008 @@ -1 +1 @@ -2.16.6 +2.16.7 Modified: trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/package/yast2-... ============================================================================== --- trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes (original) +++ trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes Tue Apr 15 11:19:17 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue Apr 15 11:06:53 CEST 2008 - jsuchome@suse.cz + +- added support for command line interface +- better help text and 'import directory' label +- 2.16.7 + +------------------------------------------------------------------- Sun Mar 30 20:48:47 CEST 2008 - jsuchome@suse.cz - merged proofread texts Modified: trunk/fingerprint-reader/src/FingerprintReader.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/src/Fingerprin... ============================================================================== --- trunk/fingerprint-reader/src/FingerprintReader.ycp (original) +++ trunk/fingerprint-reader/src/FingerprintReader.ycp Tue Apr 15 11:19:17 2008 @@ -82,7 +82,7 @@ /** * Directory for storing fingerprint files */ -string bir_dir = "/etc/pam_thinkfinger"; +global string bir_dir = "/etc/pam_thinkfinger"; /** * Get the list of fingerprint readers @@ -220,7 +220,7 @@ global list Summary() { // summary header - string summary = Summary::AddHeader(summary, _("PAM Login")); + string summary = Summary::AddHeader ("", _("PAM Login")); summary = Summary::AddLine (summary, (use_pam) ? // summary item Modified: trunk/fingerprint-reader/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/src/dialogs.yc... ============================================================================== --- trunk/fingerprint-reader/src/dialogs.ycp (original) +++ trunk/fingerprint-reader/src/dialogs.ycp Tue Apr 15 11:19:17 2008 @@ -37,6 +37,7 @@ import "Label"; import "Package"; import "Popup"; +import "Report"; import "Stage"; import "Wizard"; @@ -84,7 +85,7 @@ ") + // help text, cont. - _("<p>To <b>Import Fingerprint Files</b> from different installations, choose the directory where the files are located.</p>"); + sformat (_("<p>To <b>Import Fingerprint Files</b> from different installations, choose the directory where the original files are located. The files will be copied to %1 directory.</p>"), FingerprintReader::bir_dir); term con = `HBox (`HSpacing (3), `VBox ( // frame label @@ -105,7 +106,8 @@ `VSpacing (), `HBox ( // textentry label - `TextEntry (`id(`import_dir),_("Directory with fingerprint files")), + `TextEntry (`id(`import_dir), + _("Directory with fingerprint files for import")), `VBox ( `Label (""), `PushButton (`id (`browse), Label::BrowseButton ()) Modified: trunk/fingerprint-reader/src/fingerprint-reader.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/src/fingerprin... ============================================================================== --- trunk/fingerprint-reader/src/fingerprint-reader.ycp (original) +++ trunk/fingerprint-reader/src/fingerprint-reader.ycp Tue Apr 15 11:19:17 2008 @@ -41,50 +41,90 @@ y2milestone ("----------------------------------------"); y2milestone ("FingerprintReader module started"); -import "Progress"; -import "Report"; -import "Summary"; - import "CommandLine"; +import "FingerprintReader"; + include "fingerprint-reader/wizards.ycp"; +/** + * Enable the Fingerprint reader + * @param options a list of parameters passed as args + * @return boolean true on success + */ +define boolean EnableHandler (map options) { + + if (!FingerprintReader::use_pam) + { + FingerprintReader::use_pam = false; + FingerprintReader::modified = true; + } + return FingerprintReader::modified; +} + +/** + * Disable the Fingerprint reader + * @param options a list of parameters passed as args + * @return boolean true on success + */ +define boolean DisableHandler (map options) { + if (FingerprintReader::use_pam) + { + FingerprintReader::use_pam = true; + FingerprintReader::modified = true; + } + return FingerprintReader::modified; +} + +/** + * Print summary of basic options + * @return boolean false + */ +define boolean SummaryHandler (map options ) { + + CommandLine::Print (FingerprintReader::use_pam ? + // summary item + _("Use Fingerprint Authentication") : + // summary item + _("Do Not Use Fingerprint Authentication")); + return false; // do not call Write... +} + map cmdline_description = $[ - "id" : "fingerprint-reader", + "id" : "fingerprint-reader", /* Command line help text for the Xfingerprint-reader module */ "help" : _("Configuration of fingerprint-reader"), "guihandler" : FingerprintReaderSequence, "initialize" : FingerprintReader::Read, "finish" : FingerprintReader::Write, - "actions" : $[ - // FIXME TODO: fill the functionality description here + "actions" : $[ + "enable" :$[ + "handler" : EnableHandler, + // command line help text for 'enable' action + "help" : _("Enable fingerprint authentication") + ], + "disable" :$[ + "handler" : DisableHandler, + // command line help text for 'disable' action + "help" : _("Disable fingerprint authentication") + ], + "summary" :$[ + "handler" : SummaryHandler, + // command line help text for 'summary' action + "help" : _("Configuration summary") + ], ], "options" : $[ - // FIXME TODO: fill the option descriptions here ], "mappings" : $[ - // FIXME TODO: fill the mappings of actions and options here - ] + "enable" : [], + "disable" : [], + "summary" : [], + ], ]; -/* is this proposal or not? */ -boolean propose = false; -list args = WFM::Args(); -if(size(args) > 0) { - if(is(WFM::Args(0), path) && WFM::Args(0) == .propose) { - y2milestone("Using PROPOSE mode"); - propose = true; - } -} - -/* main ui function */ -any ret = nil; - -if(propose) ret = FingerprintReaderAutoSequence(); -else ret = CommandLine::Run(cmdline_description); -y2debug("ret=%1", ret); +any ret = CommandLine::Run(cmdline_description); -/* Finish */ -y2milestone("FingerprintReader module finished"); +y2milestone("FingerprintReader module finished with %1", ret); y2milestone("----------------------------------------"); return ret; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org