Mailinglist Archive: yast-commit (939 mails)
| < Previous | Next > |
[yast-commit] r53261 - in /trunk/printer: ./ package/ src/ tools/
- From: jsmeix@xxxxxxxxxxxxxxxx
- Date: Thu, 13 Nov 2008 10:43:24 -0000
- Message-id: <20081113104325.3771F3A0D6@xxxxxxxxxxxxxxxx>
Author: jsmeix
Date: Thu Nov 13 11:43:24 2008
New Revision: 53261
URL: http://svn.opensuse.org/viewcvs/yast?rev=53261&view=rev
Log:
- In Sharing dialog fixed removing all BrowseAddress values
and made it more user-friendly to change from
"deny any remote access" to "allow remote access".
- Added "Trigger Automatic Configuration" to Autoconfig dialog.
- Removed the "Cancel" button from the Overview dialog
because there is nothing to cancel here.
- Implemented the fixed functionality of the "Cancel" button
in the non-initial dialogs of the DialogTree correctly
(see below Wed Nov 12 12:52:57 CET 2008).
- 2.17.37
Modified:
trunk/printer/VERSION
trunk/printer/package/yast2-printer.changes
trunk/printer/src/autoconfig.ycp
trunk/printer/src/dialogs.ycp
trunk/printer/src/overview.ycp
trunk/printer/src/policies.ycp
trunk/printer/src/printingvianetwork.ycp
trunk/printer/src/sharing.ycp
trunk/printer/tools/modify_cupsd_conf
Modified: trunk/printer/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/VERSION?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/VERSION (original)
+++ trunk/printer/VERSION Thu Nov 13 11:43:24 2008
@@ -1 +1 @@
-2.17.36
+2.17.37
Modified: trunk/printer/package/yast2-printer.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/package/yast2-printer.changes?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/package/yast2-printer.changes (original)
+++ trunk/printer/package/yast2-printer.changes Thu Nov 13 11:43:24 2008
@@ -1,4 +1,18 @@
-------------------------------------------------------------------
+Thu Nov 13 11:27:13 CET 2008 - jsmeix@xxxxxxx
+
+- In Sharing dialog fixed removing all BrowseAddress values
+ and made it more user-friendly to change from
+ "deny any remote access" to "allow remote access".
+- Added "Trigger Automatic Configuration" to Autoconfig dialog.
+- Removed the "Cancel" button from the Overview dialog
+ because there is nothing to cancel here.
+- Implemented the fixed functionality of the "Cancel" button
+ in the non-initial dialogs of the DialogTree correctly
+ (see below Wed Nov 12 12:52:57 CET 2008).
+- 2.17.37
+
+-------------------------------------------------------------------
Wed Nov 12 14:55:36 CET 2008 - jsmeix@xxxxxxx
- Remove the queue if it was only partially added and removed
Modified: trunk/printer/src/autoconfig.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/autoconfig.ycp?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/src/autoconfig.ycp (original)
+++ trunk/printer/src/autoconfig.ycp Thu Nov 13 11:43:24 2008
@@ -66,6 +66,7 @@
// because initAutoconfig checks if
cups-autoconfig is installed
// and if not it tries to install it.
`id("cups_autoconfig_remove"),
+ `opt(`notify),
// CheckBox to have no automatic
configuration of USB printers at all
// by removing the cups-autoconfig RPM
package.
// Do not change or translate
"cups-autoconfig", it is a RPM package name.
@@ -77,7 +78,8 @@
`VSpacing( 1 ),
`Left
( `CheckBox
- (
`id("cups_autoconfig_configure_new_attachend"),
+ (
`id("cups_autoconfig_configure_new_attached"),
+ `opt(`notify),
// CheckBox to enable that a print queue is
automatically created
// when a USB printer is connected for the
first time to the USB:
_("Enable &Automatic Configuration of New
Attachend USB Printers")
@@ -100,6 +102,16 @@
_("Operation &Policy for Automatically
Configured USB Printers"),
[""]
)
+ ),
+ // Have space between the settings for automatic
configuration
+ // and the choice to "Trigger Automatic
Configuration":
+ `VSpacing( 1 ),
+ `Left
+ ( `CheckBox
+ ( `id("cups_autoconfig_trigger"),
+ // CheckBox to trigger that print queues are
automatically created right now:
+ _("&Trigger Automatic Configuration")
+ )
)
)
)
@@ -151,7 +163,7 @@
}
// Set the different values for the different widgets in the dialog
// and use the default values as fallback values:
- UI::ChangeWidget( `id("cups_autoconfig_configure_new_attachend"), `Value,
initial_cups_autoconfig_ConfigureNewPrinters );
+ UI::ChangeWidget( `id("cups_autoconfig_configure_new_attached"), `Value,
initial_cups_autoconfig_ConfigureNewPrinters );
UI::ChangeWidget( `id("cups_autoconfig_disable_on_removal"), `Value,
initial_cups_autoconfig_DisablePrintersOnRemoval );
// Determine the existing policy names in '<Policy policy-name>' sections in
/etc/cups/cupsd.conf:
list< string > operation_policy_names = [ "" ];
@@ -178,32 +190,22 @@
else
{ UI::ChangeWidget( `id("cups_autoconfig_operation_policy"), `Value, "not
set" );
}
+ // The CheckBox to trigger automatic configuration is initially always off:
+ UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Value, false );
+ // Disable all widgets if autoconfig_settings_dialog_is_useless:
if( autoconfig_settings_dialog_is_useless )
{ UI::ChangeWidget( `id("cups_autoconfig_remove"), `Enabled, false );
UI::ChangeWidget( `id("cups_autoconfig_label"), `Enabled, false );
- UI::ChangeWidget( `id("cups_autoconfig_configure_new_attachend"),
`Enabled, false );
+ UI::ChangeWidget( `id("cups_autoconfig_configure_new_attached"), `Enabled,
false );
UI::ChangeWidget( `id("cups_autoconfig_disable_on_removal"), `Enabled,
false );
UI::ChangeWidget( `id("cups_autoconfig_operation_policy"), `Enabled, false
);
+ UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Enabled, false );
}
y2milestone( "leaving initAutoconfig
with\ninitial_cups_autoconfig_ConfigureNewPrinters =
'%1'\ninitial_cups_autoconfig_DisablePrintersOnRemoval =
'%2'\ninitial_cups_autoconfig_DefaultCUPSPolicy = '%3'",
initial_cups_autoconfig_ConfigureNewPrinters,
initial_cups_autoconfig_DisablePrintersOnRemoval,
initial_cups_autoconfig_DefaultCUPSPolicy );
}
-symbol handleAutoconfig( string key, map event )
-{ y2milestone( "entering handleAutoconfig with key '%1'\nand event '%2'", key,
event );
- if( "Activated" == event["EventReason"]:"" )
- { if( `back == event["ID"]:nil )
- { return `autoconfig_back;
- }
- if( `next == event["ID"]:nil )
- { return `autoconfig_next;
- }
- }
- return nil;
-}
-
-void storeAutoconfig( string key, map event )
-{ y2milestone( "entering storeAutoconfig with key '%1'\nand event '%2'", key,
event );
- // If the cups-autoconfig RPM should be removed and when it is currently
installed,
+boolean ApplyAutoconfigSettings()
+{ // If the cups-autoconfig RPM should be removed and when it is currently
installed,
// try to remove it and return because nothing else matters in this case.
// Return even when the user decided to reject the removal because
// it would lead to unexpected results when cups-autoconfig settings
@@ -219,22 +221,25 @@
{ if( Printerlib::TestAndInstallPackage( "cups-autoconfig", "installed" ) )
{ Printerlib::TestAndInstallPackage( "cups-autoconfig", "remove" );
y2milestone( "leaving storeAutoconfig" );
- return nil;
+ //return `autoconfig_next;
+ return true;
}
}
boolean applied_autoconfig_settings = true;
// Get the actual settings and values from the dialog:
- boolean current_cups_autoconfig_ConfigureNewPrinters =
(boolean)UI::QueryWidget( `id("cups_autoconfig_configure_new_attachend"),
`Value );
+ boolean current_cups_autoconfig_ConfigureNewPrinters =
(boolean)UI::QueryWidget( `id("cups_autoconfig_configure_new_attached"), `Value
);
boolean current_cups_autoconfig_DisablePrintersOnRemoval =
(boolean)UI::QueryWidget( `id("cups_autoconfig_disable_on_removal"), `Value );
string current_cups_autoconfig_DefaultCUPSPolicy = (string)UI::QueryWidget(
`id("cups_autoconfig_operation_policy"), `Value );
y2milestone( "current_cups_autoconfig_ConfigureNewPrinters =
'%1'\ncurrent_cups_autoconfig_DisablePrintersOnRemoval =
'%2'\ncurrent_cups_autoconfig_DefaultCUPSPolicy = '%3'",
current_cups_autoconfig_ConfigureNewPrinters,
current_cups_autoconfig_DisablePrintersOnRemoval,
current_cups_autoconfig_DefaultCUPSPolicy );
+ boolean cups_autoconfig_triggered = (boolean)UI::QueryWidget(
`id("cups_autoconfig_trigger"), `Value );
if( current_cups_autoconfig_ConfigureNewPrinters ==
initial_cups_autoconfig_ConfigureNewPrinters
&& current_cups_autoconfig_DisablePrintersOnRemoval ==
initial_cups_autoconfig_DisablePrintersOnRemoval
&& current_cups_autoconfig_DefaultCUPSPolicy ==
initial_cups_autoconfig_DefaultCUPSPolicy
+ && ! cups_autoconfig_triggered
)
{ y2milestone( "Nothing changed in 'Autoconfig Settings' dialog." );
y2milestone( "leaving storeAutoconfig" );
- return nil;
+ return true;
}
if( current_cups_autoconfig_ConfigureNewPrinters !=
initial_cups_autoconfig_ConfigureNewPrinters )
{ if( current_cups_autoconfig_ConfigureNewPrinters )
@@ -299,12 +304,57 @@
applied_autoconfig_settings = false;
}
}
- if( ! applied_autoconfig_settings )
- { Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
+ if( applied_autoconfig_settings )
+ { // After the autoconfig settings have been successfully applied,
+ // check if cups-autoconfig should run now:
+ if( cups_autoconfig_triggered )
+ { if( ! Printerlib::ExecuteBashCommand(
"/usr/lib/cups-autoconfig/cups-autoconfig --add" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message.
+ _("Automatic configuration failed."),
+ Printerlib::result["stderr"]:""
+ );
+ applied_autoconfig_settings = false;
+ }
+ }
}
y2milestone( "leaving storeAutoconfig" );
+ return applied_autoconfig_settings;
+}
+
+symbol handleAutoconfig( string key, map event )
+{ y2milestone( "entering handleAutoconfig with key '%1'\nand event '%2'", key,
event );
+ if( "ValueChanged" == event["EventReason"]:"" )
+ { if( "cups_autoconfig_remove" == event["WidgetID"]:"" )
+ { // Enable or disable the other widgets depending on whether or not
+ // the cups-autoconfig RPM should be removed:
+ boolean have_cups_autoconfig = ! (boolean)UI::QueryWidget(
`id("cups_autoconfig_remove"), `Value );
+ UI::ChangeWidget( `id("cups_autoconfig_configure_new_attached"),
`Enabled, have_cups_autoconfig );
+ UI::ChangeWidget( `id("cups_autoconfig_disable_on_removal"), `Enabled,
have_cups_autoconfig );
+ UI::ChangeWidget( `id("cups_autoconfig_operation_policy"), `Enabled,
have_cups_autoconfig );
+ UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Enabled,
have_cups_autoconfig );
+ }
+ if( "cups_autoconfig_configure_new_attached" == event["WidgetID"]:"" )
+ { // Set the CheckBox to trigger automatic configuration to "off"
+ // when cups-autoconfig should not do an automatic configuration
+ // but do not automatically set the trigger to "on" in the other case:
+ if( ! (boolean)UI::QueryWidget(
`id("cups_autoconfig_configure_new_attached"), `Value ) )
+ { UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Value, false );
+ }
+ }
+ }
+ if( "Activated" == event["EventReason"]:"" )
+ { if( `back == event["ID"]:nil )
+ { return `autoconfig_back;
+ }
+ if( `next == event["ID"]:nil )
+ { if( ! ApplyAutoconfigSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
+ return `autoconfig_next;
+ }
+ }
return nil;
}
Modified: trunk/printer/src/dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/dialogs.ycp?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/src/dialogs.ycp (original)
+++ trunk/printer/src/dialogs.ycp Thu Nov 13 11:43:24 2008
@@ -54,7 +54,6 @@
"custom_widget" :
widgetNetworkPrinting,
"init" : initNetworkPrinting,
"handle" : handleNetworkPrinting,
- "store" : storeNetworkPrinting,
"help" :
HELPS["printing_via_network_dialog"]:""
],
"SHARING" :
@@ -62,7 +61,6 @@
"custom_widget" : widgetSharing,
"init" : initSharing,
"handle": handleSharing,
- "store" : storeSharing,
"help" : HELPS["sharing_dialog"]:""
],
"POLICIES" :
@@ -70,7 +68,6 @@
"custom_widget" : widgetPolicies,
"init" : initPolicies,
"handle": handlePolicies,
- "store" : storePolicies,
"help" : HELPS["policies"]:""
],
"AUTOCONFIG" :
@@ -78,7 +75,6 @@
"custom_widget" : widgetAutoconfig,
"init" : initAutoconfig,
"handle": handleAutoconfig,
- "store" : storeAutoconfig,
"help" : HELPS["autoconfig"]:""
]
];
Modified: trunk/printer/src/overview.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/overview.ycp?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/src/overview.ycp (original)
+++ trunk/printer/src/overview.ycp Thu Nov 13 11:43:24 2008
@@ -122,7 +122,8 @@
);
void initOverview( string key )
-{ // First of all the multi-line string because such strings cannot be
indented:
+{ y2milestone( "entering initOverview with key '%1'", key );
+ // First of all the multi-line string because such strings cannot be
indented:
string required_cupsd_not_accessible =
// Message of a Popup::ErrorDetails
// when a local cupsd is required but it is not accessible.
@@ -151,6 +152,11 @@
the YaST printer modue to configure your printers.
");
Wizard::SetDesktopIcon("printer");
+ // The button with "back/cancel" functionality is removed here
+ // only because here it happens faster than only in the handleOverview
function
+ // to avoid that the button is visible for some time until it is actually
removed.
+ // See the handleOverview function for details why this button is removed.
+ Wizard::HideBackButton();
boolean local_content_selected = Printer::queue_filter_show_local;
boolean remote_content_selected = Printer::queue_filter_show_remote;
boolean local_cupsd_required = true;
@@ -221,6 +227,7 @@
UI::ChangeWidget( `overview_table, `Items,
Printer::QueueItems( Printer::queue_filter_show_local,
Printer::queue_filter_show_remote )
);
+ y2milestone( "leaving initOverview" );
}
/**
@@ -230,7 +237,45 @@
* test button and refresh overview
*/
symbol handleOverview( string key, map event )
-{ if( ( `remote_content_checkbox == event["ID"]:nil
+{ y2milestone( "entering handleOverview with key '%1'\nand event '%2'", key,
event );
+ // In the Overview dialog it does not make sense to have a button with
"back" functionality
+ // which is named "Cancel" according to the new YaST style guide at
+ //
http://en.opensuse.org/YaST/Style_Guide#Single_Configuration.2FOverview.2FEdit_Dialog
+ // because there is nothing to "cancel" in the Overview dialog because it
+ // only shows information about the current state of the configuration
+ // but the Overview dialog itself does not do any change of the
configuration.
+ // The Overview dialog has actually the same meaning for the user
+ // as a plain notification popup which has only a "OK" button.
+ // If the user does not agree to what is shown in the Overview dialog
+ // he must launch a configuration sub-dialog to change the configuration.
+ // If the user accepted in such a configuration sub-dialog what he changed
+ // via the "OK" button there, the change is applied and the Overview dialog
+ // shows the new current state of the configuration, see
+ //
http://en.opensuse.org/YaST/Development/Printer_Enhancement#Basic_Implementation_Principles:
+ // so that it is not possible to "cancel" the change in the Overview dialog.
+ // Any change of the configuration is done in sub-dialogs which are called
+ // from the Overview dialog (even the "Confirm Deletion" popup is such a
sub-dialog)
+ // and in all those sub-dialogs there is a button with "cancel"
functionality.
+ // Note that all the different dialogs in the DialogTree (see dialogs.ycp)
are
+ // for the Wizard only different tabs of one same dialog (see "overview" in
wizards.ycp)
+ // so that the button with "back/cancel" functionality must be carefully
re-enabled
+ // whenever the Overview dialog is replaced by another dialog tab in the
DialogTree
+ // so that the other dialogs in the DialogTree have a button with "cancel"
functionality.
+ Wizard::HideBackButton();
+ if( "MenuEvent" == event["EventType"]:"" )
+ { // When the Overview dialog is to be replaced by another dialog tab in the
DialogTree
+ // the EventType is "MenuEvent" so that testing only this general condition
+ // (without a specific match if "ID" is one of
"network","sharing","policies","autoconfig")
+ // should be sufficiently safe to get the button with "back/cancel"
functionality restored.
+ Wizard::RestoreBackButton();
+ // The above RestoreBackButton restores also its label to the default
"Back"
+ // but according to the new YaST style guide at
+ //
http://en.opensuse.org/YaST/Style_Guide#Single_Configuration.2FOverview.2FEdit_Dialog
+ // this button is now named "Cancel":
+ Wizard::SetBackButton( `back, Label::CancelButton() );
+ }
+
+ if( ( `remote_content_checkbox == event["ID"]:nil
|| `local_content_checkbox == event["ID"]:nil
) && "ValueChanged" == event["EventReason"]:""
)
@@ -353,7 +398,7 @@
// Body of a Popup::AnyMessage when the queue rejects
print jobs:
_("The testpage cannot be printed because print jobs
are rejected.")
);
- return nil;
+ return nil;
}
if( "yes" == Printer::queues[selected_queue_index,"disabled"]:"no" )
{ Popup::AnyMessage( // Header of a Popup::AnyMessage when printing is
disabled for the queue:
Modified: trunk/printer/src/policies.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/policies.ycp?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/src/policies.ycp (original)
+++ trunk/printer/src/policies.ycp Thu Nov 13 11:43:24 2008
@@ -211,22 +211,8 @@
y2milestone( "leaving initPolicies with\ninitial_operation_policy =
'%1'\ninitial_error_policy = '%2'", initial_operation_policy,
initial_error_policy );
}
-symbol handlePolicies( string key, map event )
-{ y2milestone( "entering handlePolicies with key '%1'\nand event '%2'", key,
event );
- if( "Activated" == event["EventReason"]:"" )
- { if( `back == event["ID"]:nil )
- { return `policies_back;
- }
- if( `next == event["ID"]:nil )
- { return `policies_next;
- }
- }
- return nil;
-}
-
-void storePolicies( string key, map event)
-{ y2milestone( "entering storePolicies with key '%1'\nand event '%2'", key,
event );
- boolean applied_policies = true;
+boolean ApplyPoliciesSettings()
+{ boolean applied_policies = true;
// Get the actual settings and values from the dialog:
string current_operation_policy = (string)UI::QueryWidget(
`id("operation_policy"), `Value );
boolean apply_operation_policy = (boolean)UI::QueryWidget(
`id("apply_operation_policy"), `Value );
@@ -241,7 +227,7 @@
)
{ y2milestone( "Nothing changed in 'Policies' dialog." );
y2milestone( "leaving storePolicies" );
- return nil;
+ return true;
}
if( apply_operation_policy
|| apply_error_policy
@@ -318,12 +304,25 @@
}
}
}
- if( ! applied_policies )
- { Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
- }
y2milestone( "leaving storePolicies" );
+ return applied_policies;
+}
+
+symbol handlePolicies( string key, map event )
+{ y2milestone( "entering handlePolicies with key '%1'\nand event '%2'", key,
event );
+ if( "Activated" == event["EventReason"]:"" )
+ { if( `back == event["ID"]:nil )
+ { return `policies_back;
+ }
+ if( `next == event["ID"]:nil )
+ { if( ! ApplyPoliciesSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
+ return `policies_next;
+ }
+ }
return nil;
}
Modified: trunk/printer/src/printingvianetwork.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/printingvianetwork.ycp?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/src/printingvianetwork.ycp (original)
+++ trunk/printer/src/printingvianetwork.ycp Thu Nov 13 11:43:24 2008
@@ -965,7 +965,22 @@
{ return `printing_via_network_back;
}
if( `next == event["ID"]:nil )
- { return `printing_via_network_next;
+ { if( ! ApplyNetworkPrintingSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
+ if( ! printing_via_network_has_changed )
+ { y2milestone( "Nothing changed in 'Printing via Network' dialog." );
+ }
+ else
+ { // Regardles of the ApplyNetworkPrintingSettings result,
+ // when something was to be changed,
+ // enforce to show also remote queues in the "Overview"
+ // in particular when no local queues were shown before:
+ Printer::queue_filter_show_remote = true;
+ }
+ return `printing_via_network_next;
}
if( `connection_wizard == event["ID"]:nil )
{ return `printing_via_network_connection_wizard;
@@ -979,27 +994,6 @@
return nil;
}
-void storeNetworkPrinting( string key, map event )
-{ y2milestone( "entering storeNetworkPrinting with key '%1'\nand event '%2'",
key, event );
- if( ! ApplyNetworkPrintingSettings() )
- { Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
- }
- if( ! printing_via_network_has_changed )
- { y2milestone( "Nothing changed in 'Printing via Network' dialog." );
- }
- else
- { // Regardles of the ApplyNetworkPrintingSettings result,
- // when something was to be changed,
- // enforce to show also remote queues in the "Overview"
- // in particular when no local queues were shown before:
- Printer::queue_filter_show_remote = true;
- }
- y2milestone( "leaving storeNetworkPrinting" );
- return nil;
-}
-
/* EOF */
}
Modified: trunk/printer/src/sharing.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/sharing.ycp?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/src/sharing.ycp (original)
+++ trunk/printer/src/sharing.ycp Thu Nov 13 11:43:24 2008
@@ -499,6 +499,22 @@
return false;
}
}
+ else
+ { // When there are no browse_address_values,
+ // do not change the global "Browsing On/Off" entry in cupsd.conf
+ // because "Browsing Off" disables also receiving
+ // of remote queue information from remote CUPS servers
+ // which might be needed by the "Print Via Network" dialog.
+ // Instead remove only the "BrowseAddress" entries in cupsd.conf:
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir +
"modify_cupsd_conf BrowseAddress none" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message.
+ // Do not change or translate "BrowseAddress", it
is a system settings name.
+ _("Failed to remove 'BrowseAddress' entries from
/etc/cups/cupsd.conf"),
+ Printerlib::result["stderr"]:""
+ );
+ return false;
+ }
+ }
// Only if all the above was successfully set, Listen is set too:
// Currently 'Listen *:631' is simply set for any kind of remote access
// because the Listen directive supports only network addresses as value.
@@ -931,7 +947,15 @@
{ return `sharing_back;
}
if( `next == event["ID"]:nil )
- { return `sharing_next;
+ { if( ! ApplySharingSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
+ if( ! sharing_has_changed )
+ { y2milestone( "Nothing changed in 'Share Printers' dialog." );
+ }
+ return `sharing_next;
}
switch( event["WidgetID"]:`nil )
{ integer current_item = -1;
@@ -1072,19 +1096,5 @@
return nil;
}
-void storeSharing( string key, map event )
-{ y2milestone( "entering storeSharing with key '%1'\nand event '%2'", key,
event );
- if( ! ApplySharingSettings() )
- { Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
- }
- if( ! sharing_has_changed )
- { y2milestone( "Nothing changed in 'Share Printers' dialog." );
- }
- y2milestone( "leaving storeSharing" );
- return nil;
-}
-
/* EOF */
}
Modified: trunk/printer/tools/modify_cupsd_conf
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/tools/modify_cupsd_conf?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/tools/modify_cupsd_conf (original)
+++ trunk/printer/tools/modify_cupsd_conf Thu Nov 13 11:43:24 2008
@@ -270,8 +270,14 @@
do test -n "$V" && sed -i -e "${ROOT_LOCATION_LINE_NUMBER}a$KEY
$V" $CUPSDCONF
done
else # The 'Order allow,deny' line denies packets by default
- # to be 100% on the safe side have explicite 'Allow none' and
'Deny all' lines too:
- sed -i -e "${ROOT_LOCATION_LINE_NUMBER}aDeny all\nAllow none"
$CUPSDCONF
+ # to be on the safe side have en explicite 'Deny all' line
+ # but do not have an additional 'Allow none' line too
+ # because an explicite 'Allow none' line results in YaST
+ # a "none" entry for the experts settings in the Shareing dialog
+ # and such a "none" expert setting overrules any other setting
+ # so that all user would have to remove this expert setting
+ # manually to allow any kind of remote access.
+ sed -i -e "${ROOT_LOCATION_LINE_NUMBER}aDeny all" $CUPSDCONF
fi
fi
# Report the resulting setting in any case:
@@ -286,9 +292,15 @@
# or an error message because of a failed test below) on a new line:
echo 1>&2
# Test if the result is the expected one if a value was specified:
- if test -n "$VALUE" -a "$RESULT" != "$VALUE"
- then echo "Failed to set '$KEY $VALUE' in $CUPSDCONF." 1>&2
- exit 5
+ if test -n "$VALUE"
+ then if test "none" = "$VALUE"
+ then EXPECTED_RESULT=""
+ else EXPECTED_RESULT="$VALUE"
+ fi
+ if test "$RESULT" != "$EXPECTED_RESULT"
+ then echo "Failed to set '$KEY $VALUE' in $CUPSDCONF." 1>&2
+ exit 5
+ fi
fi
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
Date: Thu Nov 13 11:43:24 2008
New Revision: 53261
URL: http://svn.opensuse.org/viewcvs/yast?rev=53261&view=rev
Log:
- In Sharing dialog fixed removing all BrowseAddress values
and made it more user-friendly to change from
"deny any remote access" to "allow remote access".
- Added "Trigger Automatic Configuration" to Autoconfig dialog.
- Removed the "Cancel" button from the Overview dialog
because there is nothing to cancel here.
- Implemented the fixed functionality of the "Cancel" button
in the non-initial dialogs of the DialogTree correctly
(see below Wed Nov 12 12:52:57 CET 2008).
- 2.17.37
Modified:
trunk/printer/VERSION
trunk/printer/package/yast2-printer.changes
trunk/printer/src/autoconfig.ycp
trunk/printer/src/dialogs.ycp
trunk/printer/src/overview.ycp
trunk/printer/src/policies.ycp
trunk/printer/src/printingvianetwork.ycp
trunk/printer/src/sharing.ycp
trunk/printer/tools/modify_cupsd_conf
Modified: trunk/printer/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/VERSION?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/VERSION (original)
+++ trunk/printer/VERSION Thu Nov 13 11:43:24 2008
@@ -1 +1 @@
-2.17.36
+2.17.37
Modified: trunk/printer/package/yast2-printer.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/package/yast2-printer.changes?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/package/yast2-printer.changes (original)
+++ trunk/printer/package/yast2-printer.changes Thu Nov 13 11:43:24 2008
@@ -1,4 +1,18 @@
-------------------------------------------------------------------
+Thu Nov 13 11:27:13 CET 2008 - jsmeix@xxxxxxx
+
+- In Sharing dialog fixed removing all BrowseAddress values
+ and made it more user-friendly to change from
+ "deny any remote access" to "allow remote access".
+- Added "Trigger Automatic Configuration" to Autoconfig dialog.
+- Removed the "Cancel" button from the Overview dialog
+ because there is nothing to cancel here.
+- Implemented the fixed functionality of the "Cancel" button
+ in the non-initial dialogs of the DialogTree correctly
+ (see below Wed Nov 12 12:52:57 CET 2008).
+- 2.17.37
+
+-------------------------------------------------------------------
Wed Nov 12 14:55:36 CET 2008 - jsmeix@xxxxxxx
- Remove the queue if it was only partially added and removed
Modified: trunk/printer/src/autoconfig.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/autoconfig.ycp?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/src/autoconfig.ycp (original)
+++ trunk/printer/src/autoconfig.ycp Thu Nov 13 11:43:24 2008
@@ -66,6 +66,7 @@
// because initAutoconfig checks if
cups-autoconfig is installed
// and if not it tries to install it.
`id("cups_autoconfig_remove"),
+ `opt(`notify),
// CheckBox to have no automatic
configuration of USB printers at all
// by removing the cups-autoconfig RPM
package.
// Do not change or translate
"cups-autoconfig", it is a RPM package name.
@@ -77,7 +78,8 @@
`VSpacing( 1 ),
`Left
( `CheckBox
- (
`id("cups_autoconfig_configure_new_attachend"),
+ (
`id("cups_autoconfig_configure_new_attached"),
+ `opt(`notify),
// CheckBox to enable that a print queue is
automatically created
// when a USB printer is connected for the
first time to the USB:
_("Enable &Automatic Configuration of New
Attachend USB Printers")
@@ -100,6 +102,16 @@
_("Operation &Policy for Automatically
Configured USB Printers"),
[""]
)
+ ),
+ // Have space between the settings for automatic
configuration
+ // and the choice to "Trigger Automatic
Configuration":
+ `VSpacing( 1 ),
+ `Left
+ ( `CheckBox
+ ( `id("cups_autoconfig_trigger"),
+ // CheckBox to trigger that print queues are
automatically created right now:
+ _("&Trigger Automatic Configuration")
+ )
)
)
)
@@ -151,7 +163,7 @@
}
// Set the different values for the different widgets in the dialog
// and use the default values as fallback values:
- UI::ChangeWidget( `id("cups_autoconfig_configure_new_attachend"), `Value,
initial_cups_autoconfig_ConfigureNewPrinters );
+ UI::ChangeWidget( `id("cups_autoconfig_configure_new_attached"), `Value,
initial_cups_autoconfig_ConfigureNewPrinters );
UI::ChangeWidget( `id("cups_autoconfig_disable_on_removal"), `Value,
initial_cups_autoconfig_DisablePrintersOnRemoval );
// Determine the existing policy names in '<Policy policy-name>' sections in
/etc/cups/cupsd.conf:
list< string > operation_policy_names = [ "" ];
@@ -178,32 +190,22 @@
else
{ UI::ChangeWidget( `id("cups_autoconfig_operation_policy"), `Value, "not
set" );
}
+ // The CheckBox to trigger automatic configuration is initially always off:
+ UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Value, false );
+ // Disable all widgets if autoconfig_settings_dialog_is_useless:
if( autoconfig_settings_dialog_is_useless )
{ UI::ChangeWidget( `id("cups_autoconfig_remove"), `Enabled, false );
UI::ChangeWidget( `id("cups_autoconfig_label"), `Enabled, false );
- UI::ChangeWidget( `id("cups_autoconfig_configure_new_attachend"),
`Enabled, false );
+ UI::ChangeWidget( `id("cups_autoconfig_configure_new_attached"), `Enabled,
false );
UI::ChangeWidget( `id("cups_autoconfig_disable_on_removal"), `Enabled,
false );
UI::ChangeWidget( `id("cups_autoconfig_operation_policy"), `Enabled, false
);
+ UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Enabled, false );
}
y2milestone( "leaving initAutoconfig
with\ninitial_cups_autoconfig_ConfigureNewPrinters =
'%1'\ninitial_cups_autoconfig_DisablePrintersOnRemoval =
'%2'\ninitial_cups_autoconfig_DefaultCUPSPolicy = '%3'",
initial_cups_autoconfig_ConfigureNewPrinters,
initial_cups_autoconfig_DisablePrintersOnRemoval,
initial_cups_autoconfig_DefaultCUPSPolicy );
}
-symbol handleAutoconfig( string key, map event )
-{ y2milestone( "entering handleAutoconfig with key '%1'\nand event '%2'", key,
event );
- if( "Activated" == event["EventReason"]:"" )
- { if( `back == event["ID"]:nil )
- { return `autoconfig_back;
- }
- if( `next == event["ID"]:nil )
- { return `autoconfig_next;
- }
- }
- return nil;
-}
-
-void storeAutoconfig( string key, map event )
-{ y2milestone( "entering storeAutoconfig with key '%1'\nand event '%2'", key,
event );
- // If the cups-autoconfig RPM should be removed and when it is currently
installed,
+boolean ApplyAutoconfigSettings()
+{ // If the cups-autoconfig RPM should be removed and when it is currently
installed,
// try to remove it and return because nothing else matters in this case.
// Return even when the user decided to reject the removal because
// it would lead to unexpected results when cups-autoconfig settings
@@ -219,22 +221,25 @@
{ if( Printerlib::TestAndInstallPackage( "cups-autoconfig", "installed" ) )
{ Printerlib::TestAndInstallPackage( "cups-autoconfig", "remove" );
y2milestone( "leaving storeAutoconfig" );
- return nil;
+ //return `autoconfig_next;
+ return true;
}
}
boolean applied_autoconfig_settings = true;
// Get the actual settings and values from the dialog:
- boolean current_cups_autoconfig_ConfigureNewPrinters =
(boolean)UI::QueryWidget( `id("cups_autoconfig_configure_new_attachend"),
`Value );
+ boolean current_cups_autoconfig_ConfigureNewPrinters =
(boolean)UI::QueryWidget( `id("cups_autoconfig_configure_new_attached"), `Value
);
boolean current_cups_autoconfig_DisablePrintersOnRemoval =
(boolean)UI::QueryWidget( `id("cups_autoconfig_disable_on_removal"), `Value );
string current_cups_autoconfig_DefaultCUPSPolicy = (string)UI::QueryWidget(
`id("cups_autoconfig_operation_policy"), `Value );
y2milestone( "current_cups_autoconfig_ConfigureNewPrinters =
'%1'\ncurrent_cups_autoconfig_DisablePrintersOnRemoval =
'%2'\ncurrent_cups_autoconfig_DefaultCUPSPolicy = '%3'",
current_cups_autoconfig_ConfigureNewPrinters,
current_cups_autoconfig_DisablePrintersOnRemoval,
current_cups_autoconfig_DefaultCUPSPolicy );
+ boolean cups_autoconfig_triggered = (boolean)UI::QueryWidget(
`id("cups_autoconfig_trigger"), `Value );
if( current_cups_autoconfig_ConfigureNewPrinters ==
initial_cups_autoconfig_ConfigureNewPrinters
&& current_cups_autoconfig_DisablePrintersOnRemoval ==
initial_cups_autoconfig_DisablePrintersOnRemoval
&& current_cups_autoconfig_DefaultCUPSPolicy ==
initial_cups_autoconfig_DefaultCUPSPolicy
+ && ! cups_autoconfig_triggered
)
{ y2milestone( "Nothing changed in 'Autoconfig Settings' dialog." );
y2milestone( "leaving storeAutoconfig" );
- return nil;
+ return true;
}
if( current_cups_autoconfig_ConfigureNewPrinters !=
initial_cups_autoconfig_ConfigureNewPrinters )
{ if( current_cups_autoconfig_ConfigureNewPrinters )
@@ -299,12 +304,57 @@
applied_autoconfig_settings = false;
}
}
- if( ! applied_autoconfig_settings )
- { Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
+ if( applied_autoconfig_settings )
+ { // After the autoconfig settings have been successfully applied,
+ // check if cups-autoconfig should run now:
+ if( cups_autoconfig_triggered )
+ { if( ! Printerlib::ExecuteBashCommand(
"/usr/lib/cups-autoconfig/cups-autoconfig --add" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message.
+ _("Automatic configuration failed."),
+ Printerlib::result["stderr"]:""
+ );
+ applied_autoconfig_settings = false;
+ }
+ }
}
y2milestone( "leaving storeAutoconfig" );
+ return applied_autoconfig_settings;
+}
+
+symbol handleAutoconfig( string key, map event )
+{ y2milestone( "entering handleAutoconfig with key '%1'\nand event '%2'", key,
event );
+ if( "ValueChanged" == event["EventReason"]:"" )
+ { if( "cups_autoconfig_remove" == event["WidgetID"]:"" )
+ { // Enable or disable the other widgets depending on whether or not
+ // the cups-autoconfig RPM should be removed:
+ boolean have_cups_autoconfig = ! (boolean)UI::QueryWidget(
`id("cups_autoconfig_remove"), `Value );
+ UI::ChangeWidget( `id("cups_autoconfig_configure_new_attached"),
`Enabled, have_cups_autoconfig );
+ UI::ChangeWidget( `id("cups_autoconfig_disable_on_removal"), `Enabled,
have_cups_autoconfig );
+ UI::ChangeWidget( `id("cups_autoconfig_operation_policy"), `Enabled,
have_cups_autoconfig );
+ UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Enabled,
have_cups_autoconfig );
+ }
+ if( "cups_autoconfig_configure_new_attached" == event["WidgetID"]:"" )
+ { // Set the CheckBox to trigger automatic configuration to "off"
+ // when cups-autoconfig should not do an automatic configuration
+ // but do not automatically set the trigger to "on" in the other case:
+ if( ! (boolean)UI::QueryWidget(
`id("cups_autoconfig_configure_new_attached"), `Value ) )
+ { UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Value, false );
+ }
+ }
+ }
+ if( "Activated" == event["EventReason"]:"" )
+ { if( `back == event["ID"]:nil )
+ { return `autoconfig_back;
+ }
+ if( `next == event["ID"]:nil )
+ { if( ! ApplyAutoconfigSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
+ return `autoconfig_next;
+ }
+ }
return nil;
}
Modified: trunk/printer/src/dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/dialogs.ycp?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/src/dialogs.ycp (original)
+++ trunk/printer/src/dialogs.ycp Thu Nov 13 11:43:24 2008
@@ -54,7 +54,6 @@
"custom_widget" :
widgetNetworkPrinting,
"init" : initNetworkPrinting,
"handle" : handleNetworkPrinting,
- "store" : storeNetworkPrinting,
"help" :
HELPS["printing_via_network_dialog"]:""
],
"SHARING" :
@@ -62,7 +61,6 @@
"custom_widget" : widgetSharing,
"init" : initSharing,
"handle": handleSharing,
- "store" : storeSharing,
"help" : HELPS["sharing_dialog"]:""
],
"POLICIES" :
@@ -70,7 +68,6 @@
"custom_widget" : widgetPolicies,
"init" : initPolicies,
"handle": handlePolicies,
- "store" : storePolicies,
"help" : HELPS["policies"]:""
],
"AUTOCONFIG" :
@@ -78,7 +75,6 @@
"custom_widget" : widgetAutoconfig,
"init" : initAutoconfig,
"handle": handleAutoconfig,
- "store" : storeAutoconfig,
"help" : HELPS["autoconfig"]:""
]
];
Modified: trunk/printer/src/overview.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/overview.ycp?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/src/overview.ycp (original)
+++ trunk/printer/src/overview.ycp Thu Nov 13 11:43:24 2008
@@ -122,7 +122,8 @@
);
void initOverview( string key )
-{ // First of all the multi-line string because such strings cannot be
indented:
+{ y2milestone( "entering initOverview with key '%1'", key );
+ // First of all the multi-line string because such strings cannot be
indented:
string required_cupsd_not_accessible =
// Message of a Popup::ErrorDetails
// when a local cupsd is required but it is not accessible.
@@ -151,6 +152,11 @@
the YaST printer modue to configure your printers.
");
Wizard::SetDesktopIcon("printer");
+ // The button with "back/cancel" functionality is removed here
+ // only because here it happens faster than only in the handleOverview
function
+ // to avoid that the button is visible for some time until it is actually
removed.
+ // See the handleOverview function for details why this button is removed.
+ Wizard::HideBackButton();
boolean local_content_selected = Printer::queue_filter_show_local;
boolean remote_content_selected = Printer::queue_filter_show_remote;
boolean local_cupsd_required = true;
@@ -221,6 +227,7 @@
UI::ChangeWidget( `overview_table, `Items,
Printer::QueueItems( Printer::queue_filter_show_local,
Printer::queue_filter_show_remote )
);
+ y2milestone( "leaving initOverview" );
}
/**
@@ -230,7 +237,45 @@
* test button and refresh overview
*/
symbol handleOverview( string key, map event )
-{ if( ( `remote_content_checkbox == event["ID"]:nil
+{ y2milestone( "entering handleOverview with key '%1'\nand event '%2'", key,
event );
+ // In the Overview dialog it does not make sense to have a button with
"back" functionality
+ // which is named "Cancel" according to the new YaST style guide at
+ //
http://en.opensuse.org/YaST/Style_Guide#Single_Configuration.2FOverview.2FEdit_Dialog
+ // because there is nothing to "cancel" in the Overview dialog because it
+ // only shows information about the current state of the configuration
+ // but the Overview dialog itself does not do any change of the
configuration.
+ // The Overview dialog has actually the same meaning for the user
+ // as a plain notification popup which has only a "OK" button.
+ // If the user does not agree to what is shown in the Overview dialog
+ // he must launch a configuration sub-dialog to change the configuration.
+ // If the user accepted in such a configuration sub-dialog what he changed
+ // via the "OK" button there, the change is applied and the Overview dialog
+ // shows the new current state of the configuration, see
+ //
http://en.opensuse.org/YaST/Development/Printer_Enhancement#Basic_Implementation_Principles:
+ // so that it is not possible to "cancel" the change in the Overview dialog.
+ // Any change of the configuration is done in sub-dialogs which are called
+ // from the Overview dialog (even the "Confirm Deletion" popup is such a
sub-dialog)
+ // and in all those sub-dialogs there is a button with "cancel"
functionality.
+ // Note that all the different dialogs in the DialogTree (see dialogs.ycp)
are
+ // for the Wizard only different tabs of one same dialog (see "overview" in
wizards.ycp)
+ // so that the button with "back/cancel" functionality must be carefully
re-enabled
+ // whenever the Overview dialog is replaced by another dialog tab in the
DialogTree
+ // so that the other dialogs in the DialogTree have a button with "cancel"
functionality.
+ Wizard::HideBackButton();
+ if( "MenuEvent" == event["EventType"]:"" )
+ { // When the Overview dialog is to be replaced by another dialog tab in the
DialogTree
+ // the EventType is "MenuEvent" so that testing only this general condition
+ // (without a specific match if "ID" is one of
"network","sharing","policies","autoconfig")
+ // should be sufficiently safe to get the button with "back/cancel"
functionality restored.
+ Wizard::RestoreBackButton();
+ // The above RestoreBackButton restores also its label to the default
"Back"
+ // but according to the new YaST style guide at
+ //
http://en.opensuse.org/YaST/Style_Guide#Single_Configuration.2FOverview.2FEdit_Dialog
+ // this button is now named "Cancel":
+ Wizard::SetBackButton( `back, Label::CancelButton() );
+ }
+
+ if( ( `remote_content_checkbox == event["ID"]:nil
|| `local_content_checkbox == event["ID"]:nil
) && "ValueChanged" == event["EventReason"]:""
)
@@ -353,7 +398,7 @@
// Body of a Popup::AnyMessage when the queue rejects
print jobs:
_("The testpage cannot be printed because print jobs
are rejected.")
);
- return nil;
+ return nil;
}
if( "yes" == Printer::queues[selected_queue_index,"disabled"]:"no" )
{ Popup::AnyMessage( // Header of a Popup::AnyMessage when printing is
disabled for the queue:
Modified: trunk/printer/src/policies.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/policies.ycp?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/src/policies.ycp (original)
+++ trunk/printer/src/policies.ycp Thu Nov 13 11:43:24 2008
@@ -211,22 +211,8 @@
y2milestone( "leaving initPolicies with\ninitial_operation_policy =
'%1'\ninitial_error_policy = '%2'", initial_operation_policy,
initial_error_policy );
}
-symbol handlePolicies( string key, map event )
-{ y2milestone( "entering handlePolicies with key '%1'\nand event '%2'", key,
event );
- if( "Activated" == event["EventReason"]:"" )
- { if( `back == event["ID"]:nil )
- { return `policies_back;
- }
- if( `next == event["ID"]:nil )
- { return `policies_next;
- }
- }
- return nil;
-}
-
-void storePolicies( string key, map event)
-{ y2milestone( "entering storePolicies with key '%1'\nand event '%2'", key,
event );
- boolean applied_policies = true;
+boolean ApplyPoliciesSettings()
+{ boolean applied_policies = true;
// Get the actual settings and values from the dialog:
string current_operation_policy = (string)UI::QueryWidget(
`id("operation_policy"), `Value );
boolean apply_operation_policy = (boolean)UI::QueryWidget(
`id("apply_operation_policy"), `Value );
@@ -241,7 +227,7 @@
)
{ y2milestone( "Nothing changed in 'Policies' dialog." );
y2milestone( "leaving storePolicies" );
- return nil;
+ return true;
}
if( apply_operation_policy
|| apply_error_policy
@@ -318,12 +304,25 @@
}
}
}
- if( ! applied_policies )
- { Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
- }
y2milestone( "leaving storePolicies" );
+ return applied_policies;
+}
+
+symbol handlePolicies( string key, map event )
+{ y2milestone( "entering handlePolicies with key '%1'\nand event '%2'", key,
event );
+ if( "Activated" == event["EventReason"]:"" )
+ { if( `back == event["ID"]:nil )
+ { return `policies_back;
+ }
+ if( `next == event["ID"]:nil )
+ { if( ! ApplyPoliciesSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
+ return `policies_next;
+ }
+ }
return nil;
}
Modified: trunk/printer/src/printingvianetwork.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/printingvianetwork.ycp?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/src/printingvianetwork.ycp (original)
+++ trunk/printer/src/printingvianetwork.ycp Thu Nov 13 11:43:24 2008
@@ -965,7 +965,22 @@
{ return `printing_via_network_back;
}
if( `next == event["ID"]:nil )
- { return `printing_via_network_next;
+ { if( ! ApplyNetworkPrintingSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
+ if( ! printing_via_network_has_changed )
+ { y2milestone( "Nothing changed in 'Printing via Network' dialog." );
+ }
+ else
+ { // Regardles of the ApplyNetworkPrintingSettings result,
+ // when something was to be changed,
+ // enforce to show also remote queues in the "Overview"
+ // in particular when no local queues were shown before:
+ Printer::queue_filter_show_remote = true;
+ }
+ return `printing_via_network_next;
}
if( `connection_wizard == event["ID"]:nil )
{ return `printing_via_network_connection_wizard;
@@ -979,27 +994,6 @@
return nil;
}
-void storeNetworkPrinting( string key, map event )
-{ y2milestone( "entering storeNetworkPrinting with key '%1'\nand event '%2'",
key, event );
- if( ! ApplyNetworkPrintingSettings() )
- { Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
- }
- if( ! printing_via_network_has_changed )
- { y2milestone( "Nothing changed in 'Printing via Network' dialog." );
- }
- else
- { // Regardles of the ApplyNetworkPrintingSettings result,
- // when something was to be changed,
- // enforce to show also remote queues in the "Overview"
- // in particular when no local queues were shown before:
- Printer::queue_filter_show_remote = true;
- }
- y2milestone( "leaving storeNetworkPrinting" );
- return nil;
-}
-
/* EOF */
}
Modified: trunk/printer/src/sharing.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/sharing.ycp?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/src/sharing.ycp (original)
+++ trunk/printer/src/sharing.ycp Thu Nov 13 11:43:24 2008
@@ -499,6 +499,22 @@
return false;
}
}
+ else
+ { // When there are no browse_address_values,
+ // do not change the global "Browsing On/Off" entry in cupsd.conf
+ // because "Browsing Off" disables also receiving
+ // of remote queue information from remote CUPS servers
+ // which might be needed by the "Print Via Network" dialog.
+ // Instead remove only the "BrowseAddress" entries in cupsd.conf:
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir +
"modify_cupsd_conf BrowseAddress none" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message.
+ // Do not change or translate "BrowseAddress", it
is a system settings name.
+ _("Failed to remove 'BrowseAddress' entries from
/etc/cups/cupsd.conf"),
+ Printerlib::result["stderr"]:""
+ );
+ return false;
+ }
+ }
// Only if all the above was successfully set, Listen is set too:
// Currently 'Listen *:631' is simply set for any kind of remote access
// because the Listen directive supports only network addresses as value.
@@ -931,7 +947,15 @@
{ return `sharing_back;
}
if( `next == event["ID"]:nil )
- { return `sharing_next;
+ { if( ! ApplySharingSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
+ if( ! sharing_has_changed )
+ { y2milestone( "Nothing changed in 'Share Printers' dialog." );
+ }
+ return `sharing_next;
}
switch( event["WidgetID"]:`nil )
{ integer current_item = -1;
@@ -1072,19 +1096,5 @@
return nil;
}
-void storeSharing( string key, map event )
-{ y2milestone( "entering storeSharing with key '%1'\nand event '%2'", key,
event );
- if( ! ApplySharingSettings() )
- { Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
- }
- if( ! sharing_has_changed )
- { y2milestone( "Nothing changed in 'Share Printers' dialog." );
- }
- y2milestone( "leaving storeSharing" );
- return nil;
-}
-
/* EOF */
}
Modified: trunk/printer/tools/modify_cupsd_conf
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/printer/tools/modify_cupsd_conf?rev=53261&r1=53260&r2=53261&view=diff
==============================================================================
--- trunk/printer/tools/modify_cupsd_conf (original)
+++ trunk/printer/tools/modify_cupsd_conf Thu Nov 13 11:43:24 2008
@@ -270,8 +270,14 @@
do test -n "$V" && sed -i -e "${ROOT_LOCATION_LINE_NUMBER}a$KEY
$V" $CUPSDCONF
done
else # The 'Order allow,deny' line denies packets by default
- # to be 100% on the safe side have explicite 'Allow none' and
'Deny all' lines too:
- sed -i -e "${ROOT_LOCATION_LINE_NUMBER}aDeny all\nAllow none"
$CUPSDCONF
+ # to be on the safe side have en explicite 'Deny all' line
+ # but do not have an additional 'Allow none' line too
+ # because an explicite 'Allow none' line results in YaST
+ # a "none" entry for the experts settings in the Shareing dialog
+ # and such a "none" expert setting overrules any other setting
+ # so that all user would have to remove this expert setting
+ # manually to allow any kind of remote access.
+ sed -i -e "${ROOT_LOCATION_LINE_NUMBER}aDeny all" $CUPSDCONF
fi
fi
# Report the resulting setting in any case:
@@ -286,9 +292,15 @@
# or an error message because of a failed test below) on a new line:
echo 1>&2
# Test if the result is the expected one if a value was specified:
- if test -n "$VALUE" -a "$RESULT" != "$VALUE"
- then echo "Failed to set '$KEY $VALUE' in $CUPSDCONF." 1>&2
- exit 5
+ if test -n "$VALUE"
+ then if test "none" = "$VALUE"
+ then EXPECTED_RESULT=""
+ else EXPECTED_RESULT="$VALUE"
+ fi
+ if test "$RESULT" != "$EXPECTED_RESULT"
+ then echo "Failed to set '$KEY $VALUE' in $CUPSDCONF." 1>&2
+ exit 5
+ fi
fi
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |