YaST Commits
Threads by month
- ----- 2025 -----
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
November 2009
- 38 participants
- 1224 discussions

27 Nov '09
Author: rhafer
Date: Fri Nov 27 16:05:49 2009
New Revision: 59826
URL: http://svn.opensuse.org/viewcvs/yast?rev=59826&view=rev
Log:
Created tag branch-Code-11-SP1-2_17_24
Added:
tags/branch-Code-11-SP1-2_17_24/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0

[yast-commit] r59825 - in /trunk/printer/src: Printer.ycp basicadd.ycp basicmodify.ycp connectionwizard.ycp helps.ycp overview.ycp
by jsmeix@svn.opensuse.org 27 Nov '09
by jsmeix@svn.opensuse.org 27 Nov '09
27 Nov '09
Author: jsmeix
Date: Fri Nov 27 14:52:20 2009
New Revision: 59825
URL: http://svn.opensuse.org/viewcvs/yast?rev=59825&view=rev
Log:
connections created by the "Connection Wizard"
can be modified by it, bnc #553871 is now fixed.
Added support for current_queue_name and current_device_uri
in Printer.ycp overview.ycp basicadd.ycp basicmodify.ycp
which means that the currently used queu and/or connection
is preselected in the Overview and/or Add/Modify dialogs
(i.e. there no longer only the default Table widget
prelelection which preselects the first table item).
Needs also to be implemented in connectionwizard.ycp
so that the current URI from the Connection Wizard
gets preselected in the Add/Modify dialogs.
Modified:
trunk/printer/src/Printer.ycp
trunk/printer/src/basicadd.ycp
trunk/printer/src/basicmodify.ycp
trunk/printer/src/connectionwizard.ycp
trunk/printer/src/helps.ycp
trunk/printer/src/overview.ycp
Modified: trunk/printer/src/Printer.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/Printer.ycp?rev=5982…
==============================================================================
--- trunk/printer/src/Printer.ycp (original)
+++ trunk/printer/src/Printer.ycp Fri Nov 27 14:52:20 2009
@@ -207,10 +207,10 @@
* where the last list entry is an emtpy map.
* @struct autodetected_printer_map
* $[ "uri":"the full CUPS DeviceURI (required)",
- * "model":"the manufacturer and model, often "Unknown" (may be the empty string)",
+ * "model":"the manufacturer and model, often 'Unknown' (may be the empty string)",
* "deviceID":"what the printer reported as its device ID (often the empty string)",
* "info":"arbitrary info regarding this connection (may be the empty string)",
- * "class":"the kind of connection, e.g. "direct","network","file" (may be the empty string)"
+ * "class":"one of 'direct','network','file','serial' or 'ConnectionWizardDialog' (may be the empty string)"
* ]
*/
global list< map< string, string > > connections = [];
@@ -224,6 +224,20 @@
global integer selected_connections_index = -1;
/**
+ * Current device uri:
+ * The device uri (i.e. the connection) which is currently in use
+ * so that the BasicAddDialog and BasicModifyDialog could preselect it.
+ * Note that selected_connections_index cannot be used for this
+ * because the ConnectionItems function which generates
+ * the list of connections for BasicAddDialog and BasicModifyDialog
+ * invalidates selected_connections_index because it autodetects
+ * the currently available connections in the system anew because
+ * those would change e.g. after a printer was connected or disconnected
+ * Preset to "" which indicates that no device uri is currently in use.
+ */
+global string current_device_uri = "";
+
+/**
* Autodetected queues:
* Determined at runtime via Printer::AutodetectQueues() which calls the bash script
* "/usr/lib/YaST2/bin/autodetect_print_queues"
@@ -262,9 +276,24 @@
global boolean queue_filter_show_remote = true;
/**
+ * Current queue name:
+ * The name of the queue which is currently in use
+ * so that the Overview dialog could preselect it.
+ * Note that selected_queues_index cannot be used for this
+ * because the QueueItems function which generates
+ * the list of queues for the Overview dialog
+ * invalidates selected_queues_index because it autodetects
+ * the current actual queues in the system anew because
+ * the list of queues in the system would have changed
+ * e.g. after a new queue was added or after a queue was removed.
+ * Preset to "" which indicates that no queue is currently in use.
+ */
+global string current_queue_name = "";
+
+/**
* Driver options (options in the PPD for one specific existing queue):
* Determined at runtime via Printer::DetermineDriverOptions( "queue_name")
-* which calls the bash script "/usr/lib/YaST2/bin/determine_printer_driver_options"
+ * which calls the bash script "/usr/lib/YaST2/bin/determine_printer_driver_options"
* which outputs on stdout a YCP list of @ref driver_option_map
* where the last list entry is an emtpy map.
* @struct driver_option_map
@@ -831,7 +860,8 @@
string is_disabled = queue["disabled"]:"yes";
string is_rejecting = queue["rejecting"]:"yes";
if( name != "" && uri != "" )
- { if( (config=="local" && local) || (config=="class" && local) || (config=="remote" && remote) )
+ { // Have local or remote stuff in the list depending on whether or not each is requested:
+ if( (config=="local" && local) || (config=="class" && local) || (config=="remote" && remote) )
{ if( "local" == config )
{ // When the queue configuration exists on the local host:
config = _("Local");
@@ -876,6 +906,14 @@
queue_state
)
);
+ // Set selected_queues_index when the current_queue_name is in the list
+ // so that the OverviewDialog can preselect the currently used queue
+ // via its id in the list which is the selected_queues_index.
+ // This is correct for any kind of queue ("local", "class", "remote") here
+ // because any queue in the list can be selected in the OverviewDialog:
+ if( current_queue_name == name )
+ { selected_queues_index = queues_index;
+ }
}
}
}
@@ -901,20 +939,24 @@
/**
* Create a list of items from the autodetected connections
- * which is used for the SelectionBox in the BasicAddDialog and SelectConnectionDialog
+ * which is used for the SelectionBox in the BasicAddDialog and BasicModifyDialog.
+ * This function is also called in connectionwizard.ycp and in printer_proposal.ycp.
* @param connection_filter_string string of a search string to return only matching connections
* (return all connections if connection_filter_string is the empty string)
* @return list of connections (i.e. DeviceURI, model, and info of the "lpinfo -l -v" output)
*/
global list ConnectionItems( string connection_filter_string )
-{ // Autodetect printers if the connections list is empty:
+{ // Invalidate selected_connections_index and selected_ppds_index to be safe:
+ selected_connections_index = -1;
+ selected_ppds_index = -1;
+ // Autodetect printers if the connections list is empty:
if( size( connections ) < 1 || "MoreConnections" == connection_filter_string )
{ list< map< string, string > > connection_wizard_connections = [];
// Save existing connections which have been manually added by the connection wizard:
foreach( map< string, string > connection,
connections,
{ if( "ConnectionWizardDialog" == connection["class"]:"" )
- { connection_wizard_connections = add( connection_wizard_connections, connection);
+ { connection_wizard_connections = add( connection_wizard_connections, connection );
}
}
);
@@ -925,13 +967,12 @@
// was called and this function would have shown more specific messages.
_("Failed to autodetect printers.")
);
- // Return only the existing connection wizard connections which is usally an empty list:
- return connection_wizard_connections;
}
// The connection wizard prepends its manually added connections to the connections list.
// Therefore the connection_wizard_connections are also prepended to the connections list.
// There is an error in the YaST documentation regarding "merge" for lists:
- // It reads "Interprets two lists as sets" which would remove duplicates.
+ // It reads "Interprets two lists as sets" which would
+ // remove duplicates in each list before the merge.
// Actually merge([1,2,2,3],[2,3,3,4]) results [1,2,2,3,2,3,3,4]
// which is needed here to preserve any entry to be on the safe side:
connections = (list <map <string, string> >)merge( connection_wizard_connections, connections );
@@ -952,9 +993,9 @@
);
// Make a list of uri, model, and info entries of the connections
// and take the connection_filter_string into account (if it is not the empty string).
- selected_connections_index = -1;
list< term > connection_items = [];
list< term > sorted_connection_items = [];
+ boolean an_item_was_added = false;
integer connections_index = -1;
string uri = "";
string model = "";
@@ -962,7 +1003,8 @@
string class = "";
foreach( map< string, string > connection_entry,
connections,
- { // Set the connections_index to the index number of the current connection_entry:
+ { an_item_was_added = false;
+ // Set the connections_index to the index number of the current connection_entry:
connections_index = connections_index + 1;
// Use local variables to have shorter variable names:
uri = connection_entry["uri"]:"";
@@ -981,6 +1023,7 @@
info
)
);
+ an_item_was_added = true;
}
else
{ // If the connection_filter_string is the special string "BasicAddDialog",
@@ -1051,6 +1094,7 @@
info
)
);
+ an_item_was_added = true;
}
}
}
@@ -1076,6 +1120,7 @@
info
)
);
+ an_item_was_added = true;
}
}
else
@@ -1091,63 +1136,24 @@
info
)
);
+ an_item_was_added = true;
}
}
}
}
+ if( an_item_was_added
+ && "" != current_device_uri
+ )
+ { // Set selected_connections_index when the current_device_uri is in the list so that
+ // BasicAddDialog and BasicModifyDialog can preselect the currently used connection
+ // via its id in the list which is the selected_connections_index.
+ if( current_device_uri == uri )
+ { selected_connections_index = connections_index;
+ }
+ }
}
}
);
-/*
- // Preselect the entry in the connection_items list which matches
- // to the current value of selected_connections_index
- // if such an entry exists in connection_items (e.g. because of the
- // connection_filter_string there may be no such entry in connection_items):
- integer connection_items_index = -1;
- integer selected_connection_items_index = -1;
- // Determine if such an entry exists:
- foreach( term connection_item,
- connection_items,
- { // Set the connection_items_index to the index number of the current connection_item:
- connection_items_index = connection_items_index + 1;
- // connection_item[0] is the term `id(connections_index) and id[0] is the connections_index
- // so that connection_item[0,0] is the connections_index:
- if( selected_connections_index == connection_item[0,0]:-1 )
- { selected_connection_items_index = connection_items_index;
- break;
- }
- }
- );
- if( selected_connection_items_index >= 0 )
- { // Actually preselect the entry and set selected_connections_index accordingly.
- // connection_items[selected_connection_items_index] is a connection_item and
- // connection_item[0] is the term `id(connections_index) so that
- // connection_item[0,0] is the connections_index (see the previous comment) and
- // connection_item[1] is the model string and
- // connection_item[2] is the uri string and
- // connection_item[3] is the info string so that
- // connection_items[selected_connection_items_index,0,0] is the connections_index and
- // connection_items[selected_connection_items_index,1] is the model string and
- // connection_items[selected_connection_items_index,2] is the uri string and
- // connection_items[selected_connection_items_index,3] is the info string:
- selected_connections_index = connection_items[selected_connection_items_index,0,0]:-1;
- model = connection_items[selected_connection_items_index,1]:"";
- uri = connection_items[selected_connection_items_index,2]:"";
- info = connection_items[selected_connection_items_index,3]:"";
- connection_items[selected_connection_items_index] = `item( `id( selected_connections_index ),
- model,
- uri,
- info,
- true
- );
- y2milestone( "Preselected connection shown to the user (model, uri, info): %1, %2, %3", model, uri, info );
- }
- else
- { // Invalidate selected_connections_index to be safe:
- selected_connections_index = -1;
- y2milestone( "No preselected connection shown to the user. The connection_filter_string is: '%1'", connection_filter_string );
- }
-*/
// Sort the list according to the model:
// connection_item[0] is `id(connections_index)
// connection_item[1] is the model
@@ -1195,18 +1201,18 @@
return tolower(this) < tolower(that);
}
);
- // Preselect a particular entry in a Table widget is not possible.
- // The Table widget has always the first entry preselected.
- // Therefore the selected_connections_index (i.e. the selected printer)
- // and the selected_ppds_index (i.e. the selected driver)
- // are invalidated in any case:
- selected_connections_index = -1;
- selected_ppds_index = -1;
- // Additionally an empty first dummy entry is prepended to avoid that the
- // first real printer connection entry becomes always preselected
- // regardless that selected_connections_index is invalidated
- // which leads to arbitrary confusion (e.g. wrong driver selections):
-// sorted_connection_items = prepend( sorted_connection_items, `item( `id( -1 ), "", "", "" ) );
+ if( size( sorted_connection_items ) < 1 )
+ { sorted_connection_items = [ `item( `id( -1 ),
+ "",
+ // Show a fallback text if there are no connections.
+ _("No connections."),
+ // A hint what to do if there are no connections.
+ // 'More Connections' and 'Connection Wizard' are
+ // button lables and must be translated accordingly:
+ _("Try 'More Connections' or use the 'Connection Wizard'.")
+ )
+ ];
+ }
return sorted_connection_items;
}
@@ -1707,6 +1713,8 @@
}
if( "" == uri || "" == ppd || "" == queue_name )
{ y2milestone( "Cannot set up queue because of empty mandatory parameter: queue_name = '%1', uri = '%2', ppd = '%3'", queue_name, uri, ppd );
+ current_queue_name = "";
+ current_device_uri = "";
return false;
}
// Note the bash quotings of the parameters with ' characters:
@@ -1730,6 +1738,8 @@
// it is safe to try to remove the queue in any case if the setup had failed
// but ignore any possible errors here (e.g. when the queue does not exist).
Printerlib::ExecuteBashCommand( "/usr/sbin/lpadmin -h localhost -x '" + queue_name + "'" );
+ current_queue_name = "";
+ current_device_uri = "";
return false;
}
// Try to set the requested default_paper_size if it is an available choice for this queue.
@@ -1758,6 +1768,8 @@
Printerlib::ExecuteBashCommand( commandline );
}
}
+ current_queue_name = queue_name;
+ current_device_uri = uri;
return true;
}
@@ -1766,7 +1778,11 @@
* @return true on success
*/
global boolean DeleteQueue( string queue_name )
-{ if( "" == queue_name )
+{ // To be safe invalidate selected_queues_index, current_queue_name, and current_device_uri in any case:
+ selected_queues_index = -1;
+ current_queue_name = "";
+ current_device_uri = "";
+ if( "" == queue_name )
{ queue_name = queues[selected_queues_index,"name"]:"";
if( "local" != queues[selected_queues_index,"config"]:"remote"
&& "class" != queues[selected_queues_index,"config"]:"remote"
@@ -1781,8 +1797,6 @@
{ y2milestone( "Cannot delete queue because queue_name is the empty string" );
return false;
}
- // To be safe invalidate selected_queues_index in any case:
- selected_queues_index = -1;
// Note the bash quoting of the queue_name string with ' characters:
string commandline = "/usr/sbin/lpadmin -h localhost -x '" + queue_name + "'";
if( ! Printerlib::ExecuteBashCommand( commandline ) )
Modified: trunk/printer/src/basicadd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/basicadd.ycp?rev=598…
==============================================================================
--- trunk/printer/src/basicadd.ycp (original)
+++ trunk/printer/src/basicadd.ycp Fri Nov 27 14:52:20 2009
@@ -227,6 +227,16 @@
Label::OKButton()
);
Wizard::HideAbortButton();
+ // Try to preselect the connection which matches to the current_device_uri
+ // if such a connection exists in the connection_selection table:
+ if( Printer::selected_connections_index >= 0 )
+ { // An item which matches to Printer::selected_connections_index
+ // exists in the connection_selection table because the Printer::ConnectionItems function
+ // sets Printer::selected_connections_index != -1 only if such an item exists in the table
+ // so that this item can be preselected:
+ y2milestone( "Preselected connection: '%1'", Printer::connections[Printer::selected_connections_index]:$[] );
+ UI::ChangeWidget( `connection_selection, `CurrentItem, `id(Printer::selected_connections_index) );
+ }
UI::FakeUserInput( `connection_selection );
any ret = nil;
while(true)
@@ -357,6 +367,16 @@
Printer::ConnectionItems( "MoreConnections" )
)
);
+ // Try to preselect the connection which matches to the current_device_uri
+ // if such a connection exists in the connection_selection table:
+ if( Printer::selected_connections_index >= 0 )
+ { // An item which matches to Printer::selected_connections_index
+ // exists in the connection_selection table because the Printer::ConnectionItems function
+ // sets Printer::selected_connections_index != -1 only if such an item exists in the table
+ // so that this item can be preselected:
+ y2milestone( "Preselected connection: '%1'", Printer::connections[Printer::selected_connections_index]:$[] );
+ UI::ChangeWidget( `connection_selection, `CurrentItem, `id(Printer::selected_connections_index) );
+ }
UI::FakeUserInput( `connection_selection );
continue;
}
@@ -372,6 +392,7 @@
}
if( selected_connection_index != Printer::selected_connections_index )
{ Printer::selected_connections_index = selected_connection_index;
+ Printer::current_device_uri = Printer::connections[selected_connection_index,"uri"]:"";
y2milestone( "Selected connection is: %1", Printer::connections[selected_connection_index]:$[] );
// Invalidate any previously selected driver, if a connection is selected anew
// or if a previously selected connection had changed:
@@ -543,7 +564,9 @@
continue;
}
if( ret == `more_drivers )
- { driver_filter_string = "";
+ { if( "qqqqqqqqqq" != driver_filter_string )
+ { driver_filter_string = "";
+ }
boolean valid_driver_found = false;
list driver_items = [];
// Use the existing value of driver_filter_input_text
@@ -556,6 +579,7 @@
y2milestone( "More drivers for '%1'", driver_filter_input_text );
if( "" != driver_filter_input_text
&& "unknown" != tolower( driver_filter_input_text )
+ && "qqqqqqqqqq" != driver_filter_string
)
{ // If the driver_filter_input_text string does not contain a space,
// words is a singleton list which contains only one word.
Modified: trunk/printer/src/basicmodify.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/basicmodify.ycp?rev=…
==============================================================================
--- trunk/printer/src/basicmodify.ycp (original)
+++ trunk/printer/src/basicmodify.ycp Fri Nov 27 14:52:20 2009
@@ -452,6 +452,16 @@
Label::OKButton()
);
Wizard::HideAbortButton();
+ // Try to preselect the connection which matches to the current_device_uri
+ // if such a connection exists in the connection_selection table:
+ if( Printer::selected_connections_index >= 0 )
+ { // An item which matches to Printer::selected_connections_index
+ // exists in the connection_selection table because the Printer::ConnectionItems function
+ // sets Printer::selected_connections_index != -1 only if such an item exists in the table
+ // so that this item can be preselected:
+ y2milestone( "Preselected connection: '%1'", Printer::connections[Printer::selected_connections_index]:$[] );
+ UI::ChangeWidget( `connection_selection, `CurrentItem, `id(Printer::selected_connections_index) );
+ }
any ret = nil;
while(true)
{ ret = UI::UserInput();
@@ -465,6 +475,7 @@
{ uri = Printer::connections[selected_connection_index,"uri"]:"";
if( "" != uri )
{ commandline = commandline + " -v '" + uri + "'";
+ Printer::current_device_uri = uri;
something_has_changed = true;
}
}
@@ -688,6 +699,16 @@
)
)
);
+ // Try to preselect the connection which matches to the current_device_uri
+ // if such a connection exists in the connection_selection table:
+ if( Printer::selected_connections_index >= 0 )
+ { // An item which matches to Printer::selected_connections_index
+ // exists in the connection_selection table because the Printer::ConnectionItems function
+ // sets Printer::selected_connections_index != -1 only if such an item exists in the table
+ // so that this item can be preselected:
+ y2milestone( "Preselected connection: '%1'", Printer::connections[Printer::selected_connections_index]:$[] );
+ UI::ChangeWidget( `connection_selection, `CurrentItem, `id(Printer::selected_connections_index) );
+ }
UI::FakeUserInput( `connection_selection );
continue;
}
@@ -708,6 +729,7 @@
// Printer::selected_connections_index is set to -1 in this case.
if( selected_connection_index != Printer::selected_connections_index )
{ Printer::selected_connections_index = selected_connection_index;
+ Printer::current_device_uri = Printer::connections[selected_connection_index,"uri"]:"";
y2milestone( "Selected connection is: %1", Printer::connections[selected_connection_index]:$[] );
// Invalidate any previously selected driver, if a connection is selected anew
// or if a previously selected connection had changed:
@@ -1041,7 +1063,9 @@
continue;
}
if( ret == `more_drivers )
- { driver_filter_string = "";
+ { if( "qqqqqqqqqq" != driver_filter_string )
+ { driver_filter_string = "";
+ }
boolean valid_driver_found = false;
list driver_items = [];
// Use the existing value of driver_filter_input_text
@@ -1054,6 +1078,7 @@
y2milestone( "More drivers for '%1'", driver_filter_input_text );
if( "" != driver_filter_input_text
&& "unknown" != tolower( driver_filter_input_text )
+ && "qqqqqqqqqq" != driver_filter_string
)
{ // If the driver_filter_input_text string does not contain a space,
// words is a singleton list which contains only one word.
Modified: trunk/printer/src/connectionwizard.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/connectionwizard.ycp…
==============================================================================
--- trunk/printer/src/connectionwizard.ycp (original)
+++ trunk/printer/src/connectionwizard.ycp Fri Nov 27 14:52:20 2009
@@ -43,6 +43,53 @@
string connection_uri="";
string connection_model="";
+string URIpercentEncoding( string input )
+{ // Replace space and each reserved character ! # $ % & ' ( ) * + , / : ; = ? @ [ ]
+ // in a value of an URI with its percent encoding, see
+ // https://bugzilla.novell.com/show_bug.cgi?id=512549
+ // This function is only meant as "some kind of automated fix"
+ // when the user entered URI values but forgot to do percent encoding.
+ // The help text in the Connection Wizard dilaog explicitely demands
+ // that URI values (components) must be entered with percent encoding.
+ // This function can only be used for percent encoding for a single URI component.
+ // In particular this function cannot be used when the user can enter a whole URI
+ // or the whole set of URI options (e.g. option1=value1&option2=value2).
+ // The '%' character itself would need a special handling because
+ // the input string is usually already percent encoded
+ // (in particular when the URI was retreived from CUPS)
+ // so that the '%' character could be only replaced by '%25'
+ // if not two hexadecimal digits '0123456789AaBbCcDdEeFf' follow
+ // but for now the '%' character is simply not replaced at all
+ // which is no big shortfall for a "some kind of automated fix" function.
+ string output = input;
+ foreach( string reserved_character,
+ string percent_encoding,
+ $[ " ":"%20",
+ "!":"%21",
+ "#":"%23",
+ "$":"%24",
+ "&":"%26",
+ "'":"%27",
+ "(":"%28",
+ ")":"%29",
+ "*":"%2A",
+ "+":"%2B",
+ ",":"%2C",
+ "/":"%2F",
+ ":":"%3A",
+ ";":"%3B",
+ "=":"%3D",
+ "?":"%3F",
+ "@":"%40",
+ "[":"%5B",
+ "]":"%5D"
+ ],
+ { output = mergestring( splitstring( output, reserved_character ), percent_encoding );
+ }
+ );
+ return output;
+}
+
string getCurrentDeviceURI()
{ if( "" != Printer::connections[Printer::selected_connections_index,"uri"]:"")
{ return Printer::connections[Printer::selected_connections_index,"uri"]:"";
@@ -50,6 +97,53 @@
return Printer::queues[Printer::selected_queues_index,"uri"]:"";
}
+string getUriWithUsernameAndPassword( string uri, string scheme )
+{ // CUPS' "lpstat -v" suppresses "username:password@" (if it exists)
+ // so that I may have to retrieve it directly form /etc/cups/printers.conf
+ // but only in this special case (and not in general via tools/autodetect_print_queues)
+ // because I also do not want to show the password needlessly in any dialog.
+ // But the URI may be not in /etc/cups/printers.conf
+ // because there was no queue set up with this device URI
+ // or several queues in /etc/cups/printers.conf may match
+ // or the URI may already contain a "username:password@" part
+ // because it was created by a previous run of the connection wizard dialog
+ // and now "username:password@" in the URI should be changed.
+ // Therefore I do nothing if the URI already contains a '@'
+ // in its second part parts[1] (note that parts[0] = "<scheme>:")
+ // which indicates that a "username:password@" part already exists:
+ list<string> parts = splitstring( uri, "/" );
+ // Remove empty parts (e.g. <scheme>://server results ["<scheme>:","","server"]):
+ parts = filter( string part, parts, { return ( "" != part ); } );
+ if( ! issubstring( parts[1]:"", "@" ) )
+ { // Replace quotes and all special egrep characters by a simple '.':
+ string special_chars = "'\"\\()[]{}|^$?*+";
+ string part1 = mergestring( splitstring( parts[1]:"", special_chars ), "." );
+ string part2 = mergestring( splitstring( parts[2]:"", special_chars ), "." );
+ // Let the whole pipe fail if any of its commands fail (requires bash):
+ string grepcommand = "set -o pipefail ; egrep '^DeviceURI " + scheme + "://[^:]+:[^@]+@" + part1 + "/" + part2;
+ if( "" != parts[3]:"" )
+ { string part3 = mergestring( splitstring( parts[3]:"", special_chars ), "." );
+ grepcommand = grepcommand + "/" + part3;
+ y2milestone( "URI is 'smb://username:password@%1/%2/%3'", parts[1]:"", parts[2]:"", parts[3]:"" );
+ }
+ else
+ { y2milestone( "URI is 'smb://username:password@%1/%2'", parts[1]:"", parts[2]:"" );
+ }
+ grepcommand = grepcommand + "$' /etc/cups/printers.conf";
+ Printerlib::ExecuteBashCommand( grepcommand + " | sort -u | wc -l | tr -d '[:space:]'" );
+ if( "1" == Printerlib::result["stdout"]:"" )
+ { // The DeviceURIs in /etc/cups/printers.conf which match to current_device_uri
+ // are unambiguous (exactly one or several exactly same such DeviceURIs)
+ // so that I can actually get it form /etc/cups/printers.conf:
+ if( Printerlib::ExecuteBashCommand( grepcommand + " | head -n 1 | cut -s -d ' ' -f 2 | tr -d '[:space:]'" ) )
+ { return Printerlib::result["stdout"]:"";
+ }
+ }
+ }
+ // By default and as fallback return the unchanged URI:
+ return uri;
+}
+
term getContentFromCurrentModel( boolean no_default_raw_queue )
{ term content = nil;
string current_model_info = Printer::connections[Printer::selected_connections_index,"model"]:"";
@@ -198,8 +292,14 @@
( `InputField( `id(`port_or_queue), text[1]:"", text[2]:"" )
),
`Left
- ( // TRANSLATORS: InputField for optional Device URI parameters:
- `InputField( `id(`uri_options), _("Optional 'option=value' parameter (usually empty)"), "" )
+ ( `InputField( `id(`uri_options),
+ // Show it as wide as possible because it may have to contain
+ // longer stuff like 'option1=value1&option2=value2':
+ `opt(`hstretch),
+ // TRANSLATORS: InputField for optional Device URI parameters:
+ _("Optional 'option=value' parameter (usually empty)"),
+ ""
+ )
),
`Left
( // TRANSLATORS: Button to test remote printer machine
@@ -213,6 +313,7 @@
{ term content = nil;
term connection_content = nil;
term model_content = nil;
+ string current_device_uri = "";
switch(selected)
{ // directly connected
case(`parallel):
@@ -480,9 +581,9 @@
// Fallback message what the user may run manually when it fails
// to generate the current list of SCSI generic device nodes:
string scsi_device_list = _("It seems there are no SCSI generic devices (/dev/sg...).\nRun 'lsscsi -g' to get a list of SCSI generic devices.");
- if( ! Printerlib::ExecuteBashCommand( "lsscsi -g | tr -s ' ' | cut -s -d ' ' -f 3- | grep '/dev/sg' || echo 'no SCSI generic device found' 1>&2" ) )
- { // Will probably never fail because the final "echo" should exit successfully in any case:
- Popup::ErrorDetails( // Popup::ErrorDetails message:
+ // Let the whole pipe fail if any of its commands fail (requires bash):
+ if( ! Printerlib::ExecuteBashCommand( "set -o pipefail ; lsscsi -g | tr -s ' ' | cut -s -d ' ' -f 3- | grep '/dev/sg' || echo 'no SCSI generic device found' 1>&2" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message:
_("Failed to get a list of SCSI generic devices."),
"lsscsi -g" + "\n" + Printerlib::result["stderr"]:""
);
@@ -561,6 +662,9 @@
( `Left
( `InputField
( `id(`uri),
+ // Show it as wide as possible because it may have to contain
+ // longer stuff like 'ipp://ip-address:port-number/resource':
+ `opt(`hstretch),
// TRANSLATORS: Input field label
_("URI (see the printer's manual)"),
"ipp://ip-address:port-number/resource"
@@ -696,8 +800,14 @@
`InputField( `id(`queue), _("Queue Name") )
),
`Left
- ( // TRANSLATORS: InputField for optional Device URI parameters:
- `InputField( `id(`uri_options), _("Optional 'option=value' parameter (usually empty)"), "" )
+ ( `InputField( `id(`uri_options),
+ // Show it as wide as possible because it may have to contain
+ // longer stuff like 'option1=value1&option2=value2':
+ `opt(`hstretch),
+ // TRANSLATORS: InputField for optional Device URI parameters:
+ _("Optional 'option=value' parameter (usually empty)"),
+ ""
+ )
),
`Left
( `PushButton
@@ -774,13 +884,27 @@
// special
case(`uri):
model_content = getContentFromCurrentModel( true );
+ current_device_uri = getCurrentDeviceURI();
+ if( "smb:/" == substring( current_device_uri, 0, size( "smb:/" ) ) )
+ { // CUPS' "lpstat -v" suppresses "username:password@" (if it exists)
+ // so that it may have to be retrieved form /etc/cups/printers.conf:
+ current_device_uri = getUriWithUsernameAndPassword( current_device_uri, "smb" );
+ }
+ if( "novell:/" == substring( current_device_uri, 0, size( "novell:/" ) ) )
+ { // CUPS' "lpstat -v" suppresses "username:password@" (if it exists)
+ // so that it may have to be retrieved form /etc/cups/printers.conf:
+ current_device_uri = getUriWithUsernameAndPassword( current_device_uri, "novell" );
+ }
content = `VBox
( `Left
( `InputField
( `id(`uri),
+ // Show it as wide as possible because it may have to contain
+ // longer stuff like 'scheme://server:port/path/to/resource':
+ `opt(`hstretch),
// TRANSLATORS: Text entry for URI (Uniform Resource Identifier)
_("URI (Uniform Resource Identifier)"),
- getCurrentDeviceURI()
+ current_device_uri
)
),
model_content
@@ -809,8 +933,12 @@
( `Left
( `InputField
( `id(`program),
+ // Show it as wide as possible because it may have to contain
+ // longer stuff like 'path/to/command?option1=value1&option2=value2':
+ `opt(`hstretch),
// TRANSLATORS: Text entry for program name that will be called via pipe
- _("Program Name")
+ _("Program Name"),
+ "path/to/command?option1=value1&option2=value2"
)
),
model_content
@@ -818,13 +946,32 @@
break;
case(`beh):
model_content = getContentFromCurrentModel( true );
+ current_device_uri = getCurrentDeviceURI();
+ if( "beh:/" == substring( current_device_uri, 0, size( "beh:/" ) ) )
+ { // When it is already a "beh:/<dd>/<att>/<delay>/<originaluri>" URI
+ // remove the beh-related stuff so that only the <originaluri> is left:
+ current_device_uri = mergestring( sublist( splitstring( current_device_uri, "/" ), 4 ), "/" );
+ }
+ if( "smb:/" == substring( current_device_uri, 0, size( "smb:/" ) ) )
+ { // CUPS' "lpstat -v" suppresses "username:password@" (if it exists)
+ // so that it may have to be retrieved form /etc/cups/printers.conf:
+ current_device_uri = getUriWithUsernameAndPassword( current_device_uri, "smb" );
+ }
+ if( "novell:/" == substring( current_device_uri, 0, size( "novell:/" ) ) )
+ { // CUPS' "lpstat -v" suppresses "username:password@" (if it exists)
+ // so that it may have to be retrieved form /etc/cups/printers.conf:
+ current_device_uri = getUriWithUsernameAndPassword( current_device_uri, "novell" );
+ }
content = `VBox
( `Left
( `InputField
- ( `id(`queue),
+ ( `id(`beh_original_uri),
+ // Show it as wide as possible because it may have to contain
+ // longer stuff like 'scheme://server:port/path/to/resource':
+ `opt(`hstretch),
// TRANSLATORS: Text entry for device URI (Uniform Resource Identifier)
_("Device URI (for which 'beh' should be applied)"),
- getCurrentDeviceURI()
+ current_device_uri
)
),
`Left
@@ -1122,18 +1269,110 @@
else if( "smb:/" == substring( current_device_uri, 0, size( "smb:/" ) ) )
{ UI::ChangeWidget( `tree_selection, `CurrentItem, `smb );
changeSettingsDialog( `smb );
+ // The Device URI has one of the forms ([...] is an optional part):
+ // smb://server[:port]/share
+ // smb://workgroup/server[:port]/share
+ // smb://username:password@server[:port]/share
+ // smb://username:password@workgroup/server[:port]/share
+ // CUPS' "lpstat -v" suppresses "username:password@" (if it exists)
+ // so that it may have to be retrieved form /etc/cups/printers.conf:
+ current_device_uri = getUriWithUsernameAndPassword( current_device_uri, "smb" );
+ // Here '/' is the only delimiter (so that username:password and server:port is one part):
+ list<string> uri_parts = splitstring( current_device_uri, "/" );
+ // Remove empty parts (e.g. smb://server results ["smb:","","server"]):
+ uri_parts = filter( string part, uri_parts, { return ( "" != part ); } );
+ y2milestone( "ConnectionWizardDialog uri_parts = '%1'", uri_parts );
+ if( "" != uri_parts[1]:"" && "" != uri_parts[2]:"" )
+ { // uri_parts[1] is server[:port] or workgroup or username:password@...
+ if( issubstring( uri_parts[1]:"", "@" ) )
+ { // smb://username:password@server[:port]/share
+ // or
+ // smb://username:password@workgroup/server[:port]/share
+ if( "" != uri_parts[3]:"" )
+ { // smb://username:password@workgroup/server[:port]/share
+ list<string> user_pass_domain = splitstring( uri_parts[1]:"", ":@" );
+ UI::ChangeWidget( `user, `Value, user_pass_domain[0]:"" );
+ UI::ChangeWidget( `pass, `Value, user_pass_domain[1]:"" );
+ UI::ChangeWidget( `domain, `Value, user_pass_domain[2]:"" );
+ UI::ChangeWidget( `hostname, `Value, uri_parts[2]:"" );
+ UI::ChangeWidget( `printer, `Value, uri_parts[3]:"" );
+ }
+ else
+ { // smb://username:password@server[:port]/share
+ list<string> user_pass_hostname = splitstring( uri_parts[1]:"", ":@" );
+ UI::ChangeWidget( `user, `Value, user_pass_hostname[0]:"" );
+ UI::ChangeWidget( `pass, `Value, user_pass_hostname[1]:"" );
+ UI::ChangeWidget( `hostname, `Value, user_pass_hostname[2]:"" );
+ UI::ChangeWidget( `printer, `Value, uri_parts[2]:"" );
+ }
+ }
+ else
+ { // smb://server[:port]/share
+ // or
+ // smb://workgroup/server[:port]/share
+ if( "" != uri_parts[3]:"" )
+ { // smb://workgroup/server[:port]/share
+ UI::ChangeWidget( `domain, `Value, uri_parts[1]:"" );
+ UI::ChangeWidget( `hostname, `Value, uri_parts[2]:"" );
+ UI::ChangeWidget( `printer, `Value, uri_parts[3]:"" );
+ }
+ else
+ { // smb://server[:port]/share
+ UI::ChangeWidget( `hostname, `Value, uri_parts[1]:"" );
+ UI::ChangeWidget( `printer, `Value, uri_parts[2]:"" );
+ }
+ }
+ }
}
else if( "novell:/" == substring( current_device_uri, 0, size( "novell:/" ) ) )
{ UI::ChangeWidget( `tree_selection, `CurrentItem, `ipx );
changeSettingsDialog( `ipx );
+ // The Device URI has one of the forms ([...] is an optional part):
+ // novell://server/queue
+ // novell://username:password@server/queue
+ // CUPS' "lpstat -v" suppresses "username:password@" (if it exists)
+ // so that it may have to be retrieved form /etc/cups/printers.conf.
+ // Fortunately getSMBuriWithUsernameAndPassword works here too
+ // because the forms of IPX and SMB device URIs match sufficienty:
+ current_device_uri = getUriWithUsernameAndPassword( current_device_uri, "novell" );
+ // Here '/' is the only delimiter (so that username:password and server:port is one part):
+ list<string> uri_parts = splitstring( current_device_uri, "/" );
+ // Remove empty parts (e.g. novell://server results ["novell:","","server"]):
+ uri_parts = filter( string part, uri_parts, { return ( "" != part ); } );
+ y2milestone( "ConnectionWizardDialog uri_parts = '%1'", uri_parts );
+ if( "" != uri_parts[1]:"" && "" != uri_parts[2]:"" )
+ { // uri_parts[1] is server[:port] or username:password@...
+ if( issubstring( uri_parts[1]:"", "@" ) )
+ { // novell://username:password@server/queue
+ list<string> user_pass_hostname = splitstring( uri_parts[1]:"", ":@" );
+ UI::ChangeWidget( `user, `Value, user_pass_hostname[0]:"" );
+ UI::ChangeWidget( `pass, `Value, user_pass_hostname[1]:"" );
+ UI::ChangeWidget( `hostname, `Value, user_pass_hostname[2]:"" );
+ UI::ChangeWidget( `queue, `Value, uri_parts[2]:"" );
+ }
+ else
+ { // novell://server/queue
+ UI::ChangeWidget( `hostname, `Value, uri_parts[1]:"" );
+ UI::ChangeWidget( `queue, `Value, uri_parts[2]:"" );
+ }
+ }
}
else if( "pipe:/" == substring( current_device_uri, 0, size( "pipe:/" ) ) )
{ UI::ChangeWidget( `tree_selection, `CurrentItem, `pipe );
changeSettingsDialog( `pipe );
+ // The Device URI has the form ([...] is an optional part):
+ // pipe:/path/to/command[?option1=value1&option2=value2...]
+ // remove the scheme 'pipe:/' so that only the 'path/to/command...' is left:
+ current_device_uri = mergestring( sublist( splitstring( current_device_uri, "/" ), 1 ), "/" );
+ if( "" != current_device_uri )
+ { UI::ChangeWidget( `program, `Value, current_device_uri );
+ }
}
else if( "beh:/" == substring( current_device_uri, 0, size( "beh:/" ) ) )
{ UI::ChangeWidget( `tree_selection, `CurrentItem, `beh );
changeSettingsDialog( `beh );
+ // No need to preset something here because this happens
+ // already for each call of changeSettingsDialog(`beh).
}
else
{ // Do nothing by default and as fallback.
@@ -1150,9 +1389,10 @@
integer selected_connection_index = (integer)UI::QueryWidget( `id(`connection_selection), `CurrentItem );
if( nil == selected_connection_index )
{ Popup::AnyMessage( // Header of a Popup::AnyMessage when no connection was selected:
- _("No Connection Selected"),
- // Body of a Popup::AnyMessage when no connection was selected:
- _("Select a connection.")
+ _("Select a connection"),
+ // Body of a Popup::AnyMessage when no connection was selected
+ // because there is no connection available to be selected:
+ _("If no connection is shown here, it is not possible\nto access the device via this type of connection. ")
);
break;
}
@@ -1183,18 +1423,19 @@
{ Popup::Error( _("The 'mark' parity checking is only supported with 7 data bits and 1 stop bit.") );
}
else
- { connection_uri = "serial:" + serial_device_node + "?baud=" + serial_baud_rate;
+ { connection_uri = "serial:" + URIpercentEncoding( serial_device_node )
+ + "?baud=" + URIpercentEncoding( serial_baud_rate );
if( size( serial_data_bits ) > 0 )
- { connection_uri = connection_uri + "+bits=" + serial_data_bits;
+ { connection_uri = connection_uri + "+bits=" + URIpercentEncoding( serial_data_bits );
}
if( size( serial_parity ) > 0 )
- { connection_uri = connection_uri + "+parity=" + serial_parity;
+ { connection_uri = connection_uri + "+parity=" + URIpercentEncoding( serial_parity );
}
if( size( serial_flow_control ) > 0 )
- { connection_uri = connection_uri + "+flow=" + serial_flow_control;
+ { connection_uri = connection_uri + "+flow=" + URIpercentEncoding( serial_flow_control );
}
if( size( serial_stop_bits ) > 0 )
- { connection_uri = connection_uri + "+stop=" + serial_stop_bits;
+ { connection_uri = connection_uri + "+stop=" + URIpercentEncoding( serial_stop_bits );
}
valid = true;
}
@@ -1207,7 +1448,7 @@
{ Popup::Error( _("Bluetooth device ID could not be empty.") );
}
else
- { connection_uri = "bluetooth://" + bluetooth_device_id;
+ { connection_uri = "bluetooth://" + URIpercentEncoding( bluetooth_device_id );
valid = true;
}
break;
@@ -1217,67 +1458,66 @@
{ Popup::Error( _("SCSI generic device could not be empty.") );
}
else
- { connection_uri = "scsi:" + scsi_device_node;
+ { connection_uri = "scsi:" + URIpercentEncoding( scsi_device_node );
valid = true;
}
break;
case(`uri):
- connection_uri = (string)UI::QueryWidget( `uri, `Value );
- if( size( connection_uri ) > 0 )
- { valid = true;
- }
- else
- { Popup::Error( _("URI could not be empty.") );
- }
- break;
case(`ipp):
connection_uri = (string)UI::QueryWidget( `uri, `Value );
if( size( connection_uri ) > 0 )
- { valid = true;
+ { // It would be wrong to do URIpercentEncoding(connection_uri)
+ // because special URI characters like ':' or '/' in connection_uri
+ // must stay as is and not be percent encoded because only the values
+ // of the URI parts must be percent encoded but not the whole URI.
+ valid = true;
}
else
{ Popup::Error( _("URI could not be empty.") );
}
break;
case(`smb):
- map<string, any> smb = $[ "hostname" : UI::QueryWidget( `hostname, `Value ),
- "printer" : UI::QueryWidget( `printer, `Value ),
- "domain" : UI::QueryWidget( `domain, `Value ),
- "user" : UI::QueryWidget( `user, `Value ),
- "pass" : UI::QueryWidget( `pass, `Value )
- ];
- if( size( smb["hostname"]:"" ) == 0
- || size( smb["printer"]:"" ) == 0
+ string smb_hostname = (string)UI::QueryWidget( `hostname, `Value );
+ string smb_printer = (string)UI::QueryWidget( `printer, `Value );
+ string smb_domain = (string)UI::QueryWidget( `domain, `Value );
+ string smb_user = (string)UI::QueryWidget( `user, `Value );
+ string smb_pass = (string)UI::QueryWidget( `pass, `Value );
+ if( "" == filterchars( smb_hostname, Printer::alnum_chars )
+ || "" == filterchars( smb_printer, Printer::alnum_chars )
)
{ Popup::Error( _("Servername and printer could not be empty.") );
}
else
- { if( ( size( smb["user"]:"" ) > 0 && size( smb["pass"]:"" ) == 0 )
- || ( size( smb["user"]:"" ) == 0 && size( smb["pass"]:"" ) > 0 )
+ { if( ( "" != filterchars( smb_user, Printer::alnum_chars )
+ && size( smb_pass ) < 1
+ )
+ || ( "" == filterchars( smb_user, Printer::alnum_chars )
+ && size( smb_pass ) > 0
+ )
)
{ Popup::Error( _("Both user and password must be specified.") );
}
else
{ connection_uri = "smb://";
- if( size( smb["user"]:"" ) > 0
- && size( smb["pass"]:"" ) > 0
+ if( "" != filterchars( smb_user, Printer::alnum_chars )
+ && size( smb_pass ) > 0
)
{ connection_uri = sformat( "%1%2:%3@",
connection_uri,
- smb["user"]:"",
- smb["pass"]:""
+ URIpercentEncoding( smb_user ),
+ URIpercentEncoding( smb_pass )
);
}
- if( size( smb["domain"]:"" ) > 0 )
+ if( "" != filterchars( smb_domain, Printer::alnum_chars ) )
{ connection_uri = sformat( "%1%2/",
connection_uri,
- smb["domain"]:""
+ URIpercentEncoding( smb_domain )
);
}
connection_uri = sformat( "%1%2/%3",
connection_uri,
- smb["hostname"]:"",
- smb["printer"]:""
+ URIpercentEncoding( smb_hostname ),
+ URIpercentEncoding( smb_printer )
);
valid = true;
}
@@ -1290,14 +1530,27 @@
if( "" != filterchars( tcp_hostname, Printer::alnum_chars ) )
{ if( "" != filterchars( tcp_port, Printer::alnum_chars ) )
{ if( "" != filterchars( tcp_uri_options, Printer::alnum_chars ) )
- { connection_uri = sformat( "socket://%1:%2?%3", tcp_hostname, tcp_port, tcp_uri_options );
+ { // It would be wrong to do URIpercentEncoding(tcp_uri_options)
+ // because special URI characters like '=' or '&' in tcp_uri_options
+ // must stay as is and not be percent encoded because tcp_uri_options
+ // contains all options like 'option1=value1&option2=value2'.
+ connection_uri = sformat( "socket://%1:%2?%3",
+ URIpercentEncoding( tcp_hostname ),
+ URIpercentEncoding( tcp_port ),
+ tcp_uri_options
+ );
}
else
- { connection_uri = sformat( "socket://%1:%2", tcp_hostname, tcp_port );
+ { connection_uri = sformat( "socket://%1:%2",
+ URIpercentEncoding( tcp_hostname ),
+ URIpercentEncoding( tcp_port )
+ );
}
}
else
- { connection_uri = sformat( "socket://%1", tcp_hostname );
+ { connection_uri = sformat( "socket://%1",
+ URIpercentEncoding( tcp_hostname )
+ );
}
valid = true;
}
@@ -1314,10 +1567,21 @@
&& "" != filterchars( lpd_queue, Printer::alnum_chars )
)
{ if( "" != filterchars( lpd_uri_options, Printer::alnum_chars ) )
- { connection_uri = sformat( "lpd://%1/%2?%3", lpd_hostname, lpd_queue, lpd_uri_options );
+ { // It would be wrong to do URIpercentEncoding(lpd_uri_options)
+ // because special URI characters like '=' or '&' in lpd_uri_options
+ // must stay as is and not be percent encoded because lpd_uri_options
+ // contains all options like 'option1=value1&option2=value2'.
+ connection_uri = sformat( "lpd://%1/%2?%3",
+ URIpercentEncoding( lpd_hostname ),
+ URIpercentEncoding( lpd_queue ),
+ lpd_uri_options
+ );
}
else
- { connection_uri = sformat( "lpd://%1/%2", lpd_hostname, lpd_queue );
+ { connection_uri = sformat( "lpd://%1/%2",
+ URIpercentEncoding( lpd_hostname ),
+ URIpercentEncoding( lpd_queue )
+ );
}
valid=true;
}
@@ -1333,10 +1597,21 @@
&& "" != filterchars( cups_queue, Printer::alnum_chars )
)
{ if( "" != filterchars( cups_uri_options, Printer::alnum_chars ) )
- { connection_uri = sformat( "ipp://%1/printers/%2?%3", cups_hostname, cups_queue, cups_uri_options );
+ { // It would be wrong to do URIpercentEncoding(cups_uri_options)
+ // because special URI characters like '=' or '&' in cups_uri_options
+ // must stay as is and not be percent encoded because cups_uri_options
+ // contains all options like 'option1=value1&option2=value2'.
+ connection_uri = sformat( "ipp://%1/printers/%2?%3",
+ URIpercentEncoding( cups_hostname ),
+ URIpercentEncoding( cups_queue ),
+ cups_uri_options
+ );
}
else
- { connection_uri = sformat( "ipp://%1/printers/%2", cups_hostname, cups_queue );
+ { connection_uri = sformat( "ipp://%1/printers/%2",
+ URIpercentEncoding( cups_hostname ),
+ URIpercentEncoding( cups_queue )
+ );
}
valid=true;
}
@@ -1345,55 +1620,55 @@
}
break;
case(`ipx):
- map<string, any> ipx = $[ "hostname" : UI::QueryWidget( `hostname, `Value ),
- "queue" : UI::QueryWidget( `queue, `Value ),
- "user" : UI::QueryWidget( `user, `Value ),
- "pass" : UI::QueryWidget( `pass, `Value )
- ];
- y2internal( "novell ipx map %1", ipx );
- if( size( ipx["hostname"]:"" ) == 0
- || size( ipx["queue"]:"" ) == 0
+ string ipx_hostname = (string)UI::QueryWidget( `hostname, `Value );
+ string ipx_queue = (string)UI::QueryWidget( `queue, `Value );
+ string ipx_user = (string)UI::QueryWidget( `user, `Value );
+ string ipx_pass = (string)UI::QueryWidget( `pass, `Value );
+ if( "" != filterchars( ipx_hostname, Printer::alnum_chars )
+ && "" != filterchars( ipx_queue, Printer::alnum_chars )
)
- { Popup::Error( _("Servername and queue name could not be empty.") );
- }
- else
{ connection_uri = "novell://";
- if( size( ipx["user"]:"" ) > 0
- && size( ipx["pass"]:"" ) > 0
+ if( "" != filterchars( ipx_user, Printer::alnum_chars )
+ && size( ipx_pass ) > 0
)
- { connection_uri = sformat( "%1%2:%3@", connection_uri, ipx["user"]:"", ipx["pass"]:"" );
+ { connection_uri = sformat( "%1%2:%3@", connection_uri, ipx_user, ipx_pass );
}
- connection_uri = sformat("%1%2/%3", connection_uri, ipx["hostname"]:"", ipx["queue"]:"" );
+ connection_uri = sformat("%1%2/%3", connection_uri, ipx_hostname, ipx_queue );
valid=true;
}
+ else
+ { Popup::Error( _("Servername and queue name could not be empty.") );
+ }
break;
case(`beh):
- map<string, any> beh = $[ "uri" : UI::QueryWidget( `queue, `Value ),
- "do_not_disable" : UI::QueryWidget( `beh_do_not_disable, `Value ),
- "attempts" : UI::QueryWidget( `beh_attempts, `Value ),
- "delay" : UI::QueryWidget( `beh_delay, `Value )
- ];
- y2internal( "beh map %1", beh );
- if( size( beh["uri"]:"") == 0
- || size( beh["attempts"]:"" ) == 0
- || size( beh["delay"]:"" ) == 0
+ string beh_original_uri = (string)UI::QueryWidget( `beh_original_uri, `Value );
+ boolean beh_do_not_disable = (boolean)UI::QueryWidget( `beh_do_not_disable, `Value );
+ string beh_attempts = (string)UI::QueryWidget( `beh_attempts, `Value );
+ string beh_delay = (string)UI::QueryWidget( `beh_delay, `Value );
+ if( "" != filterchars( beh_original_uri, Printer::alnum_chars )
+ && "" != filterchars( beh_attempts, Printer::alnum_chars )
+ && "" != filterchars( beh_delay, Printer::alnum_chars )
)
- { Popup::Error( _("Device URI, number of retries, and delay could not be empty." ) );
- }
- else
{ connection_uri = sformat( "beh:/%1/%2/%3/%4",
- ( beh["dont_disable"]:false ? "1" : "0" ),
- beh["attempts"]:"0",
- beh["delay"]:"30",
- beh["uri"]:""
+ ( beh_do_not_disable ? "1" : "0" ),
+ beh_attempts,
+ beh_delay,
+ beh_original_uri
);
valid = true;
}
+ else
+ { Popup::Error( _("Device URI, number of retries, and delay could not be empty." ) );
+ }
break;
case(`pipe):
string pipe = (string)UI::QueryWidget( `program, `Value );
- if( size( pipe ) > 0 )
- { connection_uri = sformat( "pipe:/%1", pipe );
+ if( "" != filterchars( pipe, Printer::alnum_chars ) )
+ { // It would be wrong to do URIpercentEncoding(pipe)
+ // because special URI characters like '/ ? = &' in pipe
+ // must stay as is and not be percent encoded because pipe
+ // contains all like 'path/to/command?option1=value1&option2=value2'
+ connection_uri = sformat( "pipe:/%1", pipe );
valid = true;
}
else
@@ -1558,7 +1833,7 @@
port,
timeout
);
- if( ! Printerlib::ExecuteBashCommand( test_command) )
+ if( ! Printerlib::ExecuteBashCommand( test_command ) )
{ Popup::ErrorDetails( sformat( // Message of a Popup::ErrorDetails
// where %1 will be replaced by the port number
// and %2 will be replaced by the host name:
Modified: trunk/printer/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/helps.ycp?rev=59825&…
==============================================================================
--- trunk/printer/src/helps.ycp (original)
+++ trunk/printer/src/helps.ycp Fri Nov 27 14:52:20 2009
@@ -378,15 +378,39 @@
Its first word (the so called URI scheme) specifies the kind of data-transfer,
for example 'parallel', 'usb', 'socket', 'lpd', or 'ipp'.<br>
After the scheme there are more or less additional parts
-(separated by slash '/' characters) which specify the details
-for this kind of data-transfer.<br>
+which specify the details for this kind of data-transfer.<br>
+The parts of an URI are separated by special reserved characters like
+colon ':', slash '/', question mark '?', ampersand '&', or equals sign '='.<br>
Finally there could be optional parameters (separated by a question mark '?')
of the form option1=value1&option2=value2&option3=value3 so that
a full device URI could be for example:<br>
ipp://server.domain:631/printers/queuename?waitjob=false&waitprinter=false<br>
-Special characters must be percent-encoded (also known as URL encoding).
-For example a space character ' ' must be written as '%20'
-and a plus sign '+' must be written as '%2B'.<br>
+Reserved characters inside of a part of the URI must be percent-encoded
+(also known as URL encoding).
+In particular a space character ' ' must be written as '%20'.<br>
+Here a list of the reserved characters and their percent encoding:<br>
+space ' ' -> %20<br>
+exclamation mark ! -> %21<br>
+number sign # -> %23<br>
+Dollar sign $ -> %24<br>
+percentage % -> %25<br>
+ampersand & -> %26<br>
+apostrophe / single quotation mark ' -> %27<br>
+left parenthesis ( -> %28<br>
+right parenthesis ) -> %29<br>
+asterisk * -> %2A<br>
+plus sign + -> %2B<br>
+comma , -> %2C<br>
+slash / -> %2F<br>
+colon : -> %3A<br>
+semicolon ; -> %3B<br>
+equals sign = -> %3D<br>
+question mark ? -> %3F<br>
+at sign @ -> %40<br>
+left bracket [ -> %5B<br>
+right bracket ] -> %5D<br>
+For details see 'Uniform Resource Identifier (URI): Generic Syntax' at<br>
+http://tools.ietf.org/html/rfc3986<br>
Some examples:<br>
A USB printer model 'Fun Printer 1000+' made by 'ACME'
with serial number 'A1B2C3' may have a device URI like:<br>
@@ -395,9 +419,9 @@
via port 9100 may have a device URI like:<br>
socket://192.168.100.1:9100<br>
A network printer with IP 192.168.100.2 which is accessible
-via LPD protocol with a remote LPD queue name 'lpt1'
+via LPD protocol with a remote LPD queue name 'LPT1'
may have a device URI like:<br>
-lpd://192.168.100.2/lpt1
+lpd://192.168.100.2/LPT1
</p>") +
// ConnectionWizardDialog help 3/6:
_("<p>
@@ -457,7 +481,7 @@
IPP is the native protocol for CUPS which runs on a real computer
but when IPP is implemented in a small printserver box,
it is often not implemented properly. Only use IPP when the vendor
-actually documents official support for it.
+actually documents official support for it.
The matching device URI is:<br>
ipp://ip-address:port-number/resource<br>
What 'port-number' and 'resource' exactly is depends totally
@@ -481,8 +505,13 @@
A server name and a printer share name and optionally a workgroup name
is needed to access it.
Furthermore a user name and a password may be required to get access.
+Have in mind that spaces and special characters in those values
+must be percent-encoded (see above).
A matching full device URI is:<br>
smb://username:password@workgroup/server/printer<br>
+For example 'John Doe' with password '@home!' may use something like
+the following device URI to access a 'Fun Printer 1000+' share:<br>
+smb://John%20Doe:%40home%21@MYGROUP/homeserver/Fun%20Printer%201000%2B<br>
For <b>more information</b> have a look at <tt>man smbspool</tt> and<br>
http://en.opensuse.org/SDB:Printing_via_SMB_(Samba)_Share_or_Windows_Share<br>
<b>Traditional UNIX Server (LPR)</b><br>
Modified: trunk/printer/src/overview.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/overview.ycp?rev=598…
==============================================================================
--- trunk/printer/src/overview.ycp (original)
+++ trunk/printer/src/overview.ycp Fri Nov 27 14:52:20 2009
@@ -227,6 +227,14 @@
UI::ChangeWidget( `overview_table, `Items,
Printer::QueueItems( Printer::queue_filter_show_local, Printer::queue_filter_show_remote )
);
+ // Try to preselect the current_queue_name if it exists in the overview_table:
+ if( Printer::selected_queues_index >= 0 )
+ { // An item which matches to Printer::selected_queues_index exists in the overview_table
+ // because the Printer::QueueItems function sets Printer::selected_queues_index != -1
+ // only if such an item exists in the overview_table so that this item can be preselected:
+ y2milestone( "Preselected queue: '%1'", Printer::queues[Printer::selected_queues_index]:$[] );
+ UI::ChangeWidget( `overview_table, `CurrentItem, `id(Printer::selected_queues_index) );
+ }
y2milestone( "leaving initOverview" );
}
@@ -298,6 +306,14 @@
UI::ChangeWidget( `overview_table, `Items,
Printer::QueueItems( Printer::queue_filter_show_local, Printer::queue_filter_show_remote )
);
+ // Try to preselect again the current_queue_name if it still exists in the overview_table:
+ if( Printer::selected_queues_index >= 0 )
+ { // An item which matches to Printer::selected_queues_index exists in the overview_table
+ // because the Printer::QueueItems function sets Printer::selected_queues_index != -1
+ // only if such an item exists in the overview_table so that this item can be preselected:
+ y2milestone( "Preselected queue: '%1'", Printer::queues[Printer::selected_queues_index]:$[] );
+ UI::ChangeWidget( `overview_table, `CurrentItem, `id(Printer::selected_queues_index) );
+ }
}
if( `refresh == event["ID"]:nil && "Activated" == event["EventReason"]:"" )
@@ -317,50 +333,72 @@
UI::ChangeWidget( `overview_table, `Items,
Printer::QueueItems( Printer::queue_filter_show_local, Printer::queue_filter_show_remote )
);
+ // Try to preselect again the current_queue_name if it still exists in the overview_table:
+ if( Printer::selected_queues_index >= 0 )
+ { // An item which matches to Printer::selected_queues_index exists in the overview_table
+ // because the Printer::QueueItems function sets Printer::selected_queues_index != -1
+ // only if such an item exists in the overview_table so that this item can be preselected:
+ y2milestone( "Preselected queue: '%1'", Printer::queues[Printer::selected_queues_index]:$[] );
+ UI::ChangeWidget( `overview_table, `CurrentItem, `id(Printer::selected_queues_index) );
+ }
}
// After the above changes of the list of queues, determine which queue is currently selected
- // (because this might change via automated preselection when the table was made anew)
+ // (because this might change via automated preselection when the table was made anew
+ // in particular if the Printer::QueueItems function invalidated Printer::selected_queues_index)
// and enable or disable the "Edit", "Delete", and "Test" buttons accordingly.
// "Edit" and "Delete" are only possible for local queues, "Test" is also possible for remote queues.
// "Test" is disabled when there is no queue selected or no queue in the table
// and when the queue state is not "ready" (i.e. when jobs are rejected and/or when printing is disabled).
integer selected_queue_index = (integer)UI::QueryWidget( `id(`overview_table), `CurrentItem );
+ // To be safe invalidate Printer::selected_queues_index, Printer::current_queue_name,
+ // and Printer::current_device_uri in any case by default and as fallback.
+ // The index of the currently selected queue is stored in selected_queue_index
+ // which is used to re-enable those values later if appropriate conditions are met:
+ Printer::selected_queues_index = -1;
+ Printer::current_queue_name = "";
+ Printer::current_device_uri = "";
if( selected_queue_index == nil || selected_queue_index < 0 )
- { // To be safe invalidate Printer::selected_queues_index when no queue exists:
- Printer::selected_queues_index = -1;
+ { // When no valid queue was selected, nothing can be tested or edited or deleted:
UI::ChangeWidget( `test, `Enabled, false );
+ UI::ChangeWidget( `edit, `Enabled, false );
+ UI::ChangeWidget( `delete, `Enabled, false );
}
else
- { if( "yes" == Printer::queues[selected_queue_index,"rejecting"]:""
- || "yes" == Printer::queues[selected_queue_index,"disabled"]:""
+ { // It is a valid queue with a non-negative selected_queue_index:
+ if( "local" == Printer::queues[selected_queue_index,"config"]:"remote"
+ || "class" == Printer::queues[selected_queue_index,"config"]:"remote"
)
- { UI::ChangeWidget( `test, `Enabled, false );
+ { // Only when it is a local queue or local class Printer::selected_queues_index,
+ // Printer::current_queue_name, and Printer::current_device_uri are re-enabled:
+ Printer::selected_queues_index = selected_queue_index;
+ Printer::current_queue_name = Printer::queues[selected_queue_index,"name"]:"";
+ Printer::current_device_uri = Printer::queues[selected_queue_index,"uri"]:"";
+ // Only local queues or local classes can be deleted:
+ UI::ChangeWidget( `delete, `Enabled, true );
+ // But only a local queue can be edited:
+ if( "local" == Printer::queues[selected_queue_index,"config"]:"remote" )
+ { UI::ChangeWidget( `edit, `Enabled, true );
+ }
+ else
+ { UI::ChangeWidget( `edit, `Enabled, false );
+ }
}
else
- { UI::ChangeWidget( `test, `Enabled, true );
+ { // It is neither a local queue nor a local class:
+ UI::ChangeWidget( `edit, `Enabled, false );
+ UI::ChangeWidget( `delete, `Enabled, false );
}
- // To be safe enable the modify and delete buttons only when it is explicitely verified
- // that the "config" is "local", otherwise have those buttons disabled by fallback:
- if( "local" == Printer::queues[selected_queue_index,"config"]:"remote" )
- { Printer::selected_queues_index = selected_queue_index;
+ // Any queue or class can be tested if it is in "ready" state:
+ if( "yes" == Printer::queues[selected_queue_index,"rejecting"]:""
+ || "yes" == Printer::queues[selected_queue_index,"disabled"]:""
+ )
+ { UI::ChangeWidget( `test, `Enabled, false );
}
else
- { // To be safe invalidate Printer::selected_queues_index when a remote queue is selected:
- Printer::selected_queues_index = -1;
- // Disable the modify and delete buttons when a remote queue is selected and by fallback:
+ { UI::ChangeWidget( `test, `Enabled, true );
}
}
- UI::ChangeWidget( `edit, `Enabled, Printer::selected_queues_index >= 0 );
- // Allow to delete local queues and also local classes:
- if( "local" == Printer::queues[selected_queue_index,"config"]:"remote"
- || "class" == Printer::queues[selected_queue_index,"config"]:"remote"
- )
- { UI::ChangeWidget( `delete, `Enabled, true );
- }
- else
- { UI::ChangeWidget( `delete, `Enabled, false );
- }
if( `delete == event["ID"]:nil && "Activated" == event["EventReason"]:"" )
{ // Delete ' characters because they are used for quoting in the bash commandlines below:
@@ -416,7 +454,7 @@
}
// To be safe invalidate Printer::selected_queues_index in any case:
Printer::selected_queues_index = -1;
- y2milestone( "To be deleted:'%1', selected_queue_index = %2", queue_name, selected_queue_index );
+ y2milestone( "Queue '%1' to be deleted: '%2'", queue_name, Printer::queues[selected_queue_index]:$[] );
// No error messages here because Printer::DeleteQueue already shows them:
Printer::DeleteQueue( queue_name );
// Re-run the OverviewDialog (with a re-created list of queues) via the sequencer:
@@ -698,6 +736,11 @@
// may not notice when a queue name proposal for a new (i.e. added) queue
// already exists as local queue:
Printer::AutodetectQueues();
+ // Invalidate Printer::current_device_uri so that the Printer::ConnectionItems function
+ // does not set a valid Printer::selected_connections_index so that the BasicAddDialog
+ // does not preselect a connection so that the first connection in the list is preselected
+ // (via Table widget fallback) which is still better than an arbitrary preselected entry:
+ Printer::current_device_uri = "";
return `add;
}
@@ -721,7 +764,12 @@
return nil;
}
Printer::selected_queues_index = selected_queue_index;
- y2milestone( "To be modified: '%1', selected_queues_index = %2", queue_name, Printer::selected_queues_index );
+ // Invalidate Printer::current_device_uri so that the Printer::ConnectionItems function
+ // does not set a valid Printer::selected_connections_index so that the BasicAddDialog
+ // does not preselect a connection so that the first connection in the list is preselected
+ // (via Table widget fallback) which is correct because this is the current connection:
+ Printer::current_device_uri = "";
+ y2milestone( "Queue '%1' to be modified: '%2'", queue_name, Printer::queues[selected_queue_index]:$[] );
return `modify;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
ref: refs/heads/master
commit d8f32c95a8d90e30d7d166008e63784523e006be
Author: Josef Reidinger <jreidinger(a)suse.cz>
Date: Fri Nov 27 14:34:59 2009 +0100
fix spec file
---
.../language/package/yast2-webclient-language.spec | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/plugins/language/package/yast2-webclient-language.spec b/plugins/language/package/yast2-webclient-language.spec
index 693f650..752bc14 100644
--- a/plugins/language/package/yast2-webclient-language.spec
+++ b/plugins/language/package/yast2-webclient-language.spec
@@ -10,7 +10,7 @@
Name: yast2-webclient-language
-PreReq: yast2-webclient>= 0.0.26
+PreReq: yast2-webclient >= 0.0.26
Provides: yast2-webclient:/srv/www/yast/app/controllers/language_controller.rb
License: GPL v2 only
Group: Productivity/Networking/Web/Utilities
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0

[yast-commit] <web-client> backgroud_patches_bnc550934 : fix spec file
by Josef Reidinger 27 Nov '09
by Josef Reidinger 27 Nov '09
27 Nov '09
ref: refs/heads/backgroud_patches_bnc550934
commit d8f32c95a8d90e30d7d166008e63784523e006be
Author: Josef Reidinger <jreidinger(a)suse.cz>
Date: Fri Nov 27 14:34:59 2009 +0100
fix spec file
---
.../language/package/yast2-webclient-language.spec | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/plugins/language/package/yast2-webclient-language.spec b/plugins/language/package/yast2-webclient-language.spec
index 693f650..752bc14 100644
--- a/plugins/language/package/yast2-webclient-language.spec
+++ b/plugins/language/package/yast2-webclient-language.spec
@@ -10,7 +10,7 @@
Name: yast2-webclient-language
-PreReq: yast2-webclient>= 0.0.26
+PreReq: yast2-webclient >= 0.0.26
Provides: yast2-webclient:/srv/www/yast/app/controllers/language_controller.rb
License: GPL v2 only
Group: Productivity/Networking/Web/Utilities
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0

27 Nov '09
Author: mzugec
Date: Fri Nov 27 13:26:36 2009
New Revision: 59824
URL: http://svn.opensuse.org/viewcvs/yast?rev=59824&view=rev
Log:
Created tag stable-2_19_3 for network
Added:
tags/stable-2_19_3/network/
- copied from r59823, trunk/network/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0

[yast-commit] r59823 - in /trunk/network: VERSION package/yast2-network.changes src/routines/routines.ycp
by mzugec@svn.opensuse.org 27 Nov '09
by mzugec@svn.opensuse.org 27 Nov '09
27 Nov '09
Author: mzugec
Date: Fri Nov 27 13:26:25 2009
New Revision: 59823
URL: http://svn.opensuse.org/viewcvs/yast?rev=59823&view=rev
Log:
fixed prefixlen validation
Modified:
trunk/network/VERSION
trunk/network/package/yast2-network.changes
trunk/network/src/routines/routines.ycp
Modified: trunk/network/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=59823&r1=598…
==============================================================================
--- trunk/network/VERSION (original)
+++ trunk/network/VERSION Fri Nov 27 13:26:25 2009
@@ -1 +1 @@
-2.19.2
+2.19.3
Modified: trunk/network/package/yast2-network.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.ch…
==============================================================================
--- trunk/network/package/yast2-network.changes (original)
+++ trunk/network/package/yast2-network.changes Fri Nov 27 13:26:25 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Nov 27 13:20:10 CET 2009 - mzugec(a)suse.cz
+
+- fixed prefixlen validation
+- 2.19.3
+
+-------------------------------------------------------------------
Wed Nov 25 15:15:11 CET 2009 - mzugec(a)suse.cz
- disable ipv6 (bnc#558020)
Modified: trunk/network/src/routines/routines.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/routines/routines.yc…
==============================================================================
--- trunk/network/src/routines/routines.ycp (original)
+++ trunk/network/src/routines/routines.ycp Fri Nov 27 13:26:25 2009
@@ -788,7 +788,7 @@
boolean valid_mask=false;
if (substring(mask, 0,1)=="/") mask=substring(mask,1);
- if (IP::Check4(ip) && Netmask::Check4(mask)) valid_mask=true;
+ if (IP::Check4(ip) && (Netmask::Check4(mask) || Netmask::CheckPrefix4(mask))) valid_mask=true;
else if (IP::Check6(ip) && Netmask::Check6(mask)) valid_mask=true;
else y2warning("IP address %1 is not valid", ip);
return valid_mask;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0

[yast-commit] <web-client> master : remove webyast.pem as it is now generated on fly
by Josef Reidinger 27 Nov '09
by Josef Reidinger 27 Nov '09
27 Nov '09
ref: refs/heads/master
commit fbe2d4b93b4741e08ca55ffc0095d92091d650a9
Author: Josef Reidinger <jreidinger(a)suse.cz>
Date: Fri Nov 27 13:14:51 2009 +0100
remove webyast.pem as it is now generated on fly
---
webclient/package/webyast.pem | 38 --------------------------------------
1 files changed, 0 insertions(+), 38 deletions(-)
diff --git a/webclient/package/webyast.pem b/webclient/package/webyast.pem
deleted file mode 100644
index 3a37b44..0000000
--- a/webclient/package/webyast.pem
+++ /dev/null
@@ -1,38 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQC8XT56A/sDhe3zybe17wx3dZCA/w6OxdB8m6urILkZ1kDbn+aO
-lyfIlj+KL4sAM8sF2G06Odh0FJCortX9fPPJOmZFkL0Vl19OjtTFiGPTD/hSWCCq
-pFn+qgOjYyHes42W4g1g0WLJeu7d7IjeAfnJp+F3ynn9I9jOBoAbQT2euQIDAQAB
-AoGBALoemEEP9dLBXyFny7JlBbhz3djYLJY+N4coejOZHcy9u1BHaxSxnonAjAAK
-ghotEwovk53Y0lvAhj9moeLauDYG6/xxICLmKXkw3Sl+ppWYgBRlzWloURJm64jN
-ifZR4na3oWZaoz1TvaoVS85eNXWjSIeGelKP1reNkmzhf9CRAkEA4jC4OOfYucco
-zH1gVq4QQxSEA4QpQ4E8bAtHFXZmaeSQufS9L/QAw/kqf3ZoJXZKA22LixH5VjPJ
-n/ExGJOHVwJBANUwVhZdLw0019aWu9HVj3FTJKnGLSJwILnb5du1eu3cioVMf6fI
-ijmUsgniW6KXL8hjPp9imkXySG2KNV3jkG8CQAf2VRXTu4JWq23/X9vNRs9Fspv5
-FAbHTtwyzW7I+zPxEtMo9Vvxx/EeHUvdXC8tac+TFJ1xpYhOTGOv9t15nAMCQQCb
-V29DOH8ydlDX8lnFWoH9J4JNmzQEJgQSqeLhp2l9rPfajZVvIrdloa3heekfnl6Y
-+4gEB4s2cIbKGq0sTsdNAkA6CUBjA8RUmPg/FeiyBcmQJRkqFzkkdmR5udKvIsaF
-P5zBHamRaLGSVfOJzKso1p2sPbGcoIMR6L4R3eypPASz
------END RSA PRIVATE KEY-----
------BEGIN CERTIFICATE-----
-MIIDxTCCAy6gAwIBAgIJAMmsmELWhDjBMA0GCSqGSIb3DQEBBQUAMIGeMQswCQYD
-VQQGEwJERTEQMA4GA1UECBMHQmF2YXJpYTESMBAGA1UEBxMJTnVyZW1iZXJnMSEw
-HwYDVQQKExhTVVNFIExpbnV4IFByb2R1Y3RzIEdtYkgxDDAKBgNVBAsUA1ImRDEQ
-MA4GA1UEAxMHV2ViWWFTVDEmMCQGCSqGSIb3DQEJARYXeWFzdC1kZXZlbEBvcGVu
-c3VzZS5vcmcwHhcNMDkxMDI3MTIxNTMxWhcNMTAxMDI3MTIxNTMxWjCBnjELMAkG
-A1UEBhMCREUxEDAOBgNVBAgTB0JhdmFyaWExEjAQBgNVBAcTCU51cmVtYmVyZzEh
-MB8GA1UEChMYU1VTRSBMaW51eCBQcm9kdWN0cyBHbWJIMQwwCgYDVQQLFANSJkQx
-EDAOBgNVBAMTB1dlYllhU1QxJjAkBgkqhkiG9w0BCQEWF3lhc3QtZGV2ZWxAb3Bl
-bnN1c2Uub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8XT56A/sDhe3z
-ybe17wx3dZCA/w6OxdB8m6urILkZ1kDbn+aOlyfIlj+KL4sAM8sF2G06Odh0FJCo
-rtX9fPPJOmZFkL0Vl19OjtTFiGPTD/hSWCCqpFn+qgOjYyHes42W4g1g0WLJeu7d
-7IjeAfnJp+F3ynn9I9jOBoAbQT2euQIDAQABo4IBBzCCAQMwHQYDVR0OBBYEFNcC
-3BiE9nLBkkJWwbOF7vunJ+X5MIHTBgNVHSMEgcswgciAFNcC3BiE9nLBkkJWwbOF
-7vunJ+X5oYGkpIGhMIGeMQswCQYDVQQGEwJERTEQMA4GA1UECBMHQmF2YXJpYTES
-MBAGA1UEBxMJTnVyZW1iZXJnMSEwHwYDVQQKExhTVVNFIExpbnV4IFByb2R1Y3Rz
-IEdtYkgxDDAKBgNVBAsUA1ImRDEQMA4GA1UEAxMHV2ViWWFTVDEmMCQGCSqGSIb3
-DQEJARYXeWFzdC1kZXZlbEBvcGVuc3VzZS5vcmeCCQDJrJhC1oQ4wTAMBgNVHRME
-BTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAJgfbbMjnx5FHMUoZhP6xAnOmSQb/WMR
-8QuURWqhy51wHSfAZOTd/+R5CaDasI2hVdYIVYxXNTfixDlA3HwXVGkFYuMD0hBm
-PVH2u7MsxcFQnMrrsmIjTJJg/cbLsQX7Jl87sxWCt7mjhV33xIAkV9HuRLe73kmN
-s3Jr6Qku+ipX
------END CERTIFICATE-----
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0

[yast-commit] <web-client> backgroud_patches_bnc550934 : remove webyast.pem as it is now generated on fly
by Josef Reidinger 27 Nov '09
by Josef Reidinger 27 Nov '09
27 Nov '09
ref: refs/heads/backgroud_patches_bnc550934
commit fbe2d4b93b4741e08ca55ffc0095d92091d650a9
Author: Josef Reidinger <jreidinger(a)suse.cz>
Date: Fri Nov 27 13:14:51 2009 +0100
remove webyast.pem as it is now generated on fly
---
webclient/package/webyast.pem | 38 --------------------------------------
1 files changed, 0 insertions(+), 38 deletions(-)
diff --git a/webclient/package/webyast.pem b/webclient/package/webyast.pem
deleted file mode 100644
index 3a37b44..0000000
--- a/webclient/package/webyast.pem
+++ /dev/null
@@ -1,38 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQC8XT56A/sDhe3zybe17wx3dZCA/w6OxdB8m6urILkZ1kDbn+aO
-lyfIlj+KL4sAM8sF2G06Odh0FJCortX9fPPJOmZFkL0Vl19OjtTFiGPTD/hSWCCq
-pFn+qgOjYyHes42W4g1g0WLJeu7d7IjeAfnJp+F3ynn9I9jOBoAbQT2euQIDAQAB
-AoGBALoemEEP9dLBXyFny7JlBbhz3djYLJY+N4coejOZHcy9u1BHaxSxnonAjAAK
-ghotEwovk53Y0lvAhj9moeLauDYG6/xxICLmKXkw3Sl+ppWYgBRlzWloURJm64jN
-ifZR4na3oWZaoz1TvaoVS85eNXWjSIeGelKP1reNkmzhf9CRAkEA4jC4OOfYucco
-zH1gVq4QQxSEA4QpQ4E8bAtHFXZmaeSQufS9L/QAw/kqf3ZoJXZKA22LixH5VjPJ
-n/ExGJOHVwJBANUwVhZdLw0019aWu9HVj3FTJKnGLSJwILnb5du1eu3cioVMf6fI
-ijmUsgniW6KXL8hjPp9imkXySG2KNV3jkG8CQAf2VRXTu4JWq23/X9vNRs9Fspv5
-FAbHTtwyzW7I+zPxEtMo9Vvxx/EeHUvdXC8tac+TFJ1xpYhOTGOv9t15nAMCQQCb
-V29DOH8ydlDX8lnFWoH9J4JNmzQEJgQSqeLhp2l9rPfajZVvIrdloa3heekfnl6Y
-+4gEB4s2cIbKGq0sTsdNAkA6CUBjA8RUmPg/FeiyBcmQJRkqFzkkdmR5udKvIsaF
-P5zBHamRaLGSVfOJzKso1p2sPbGcoIMR6L4R3eypPASz
------END RSA PRIVATE KEY-----
------BEGIN CERTIFICATE-----
-MIIDxTCCAy6gAwIBAgIJAMmsmELWhDjBMA0GCSqGSIb3DQEBBQUAMIGeMQswCQYD
-VQQGEwJERTEQMA4GA1UECBMHQmF2YXJpYTESMBAGA1UEBxMJTnVyZW1iZXJnMSEw
-HwYDVQQKExhTVVNFIExpbnV4IFByb2R1Y3RzIEdtYkgxDDAKBgNVBAsUA1ImRDEQ
-MA4GA1UEAxMHV2ViWWFTVDEmMCQGCSqGSIb3DQEJARYXeWFzdC1kZXZlbEBvcGVu
-c3VzZS5vcmcwHhcNMDkxMDI3MTIxNTMxWhcNMTAxMDI3MTIxNTMxWjCBnjELMAkG
-A1UEBhMCREUxEDAOBgNVBAgTB0JhdmFyaWExEjAQBgNVBAcTCU51cmVtYmVyZzEh
-MB8GA1UEChMYU1VTRSBMaW51eCBQcm9kdWN0cyBHbWJIMQwwCgYDVQQLFANSJkQx
-EDAOBgNVBAMTB1dlYllhU1QxJjAkBgkqhkiG9w0BCQEWF3lhc3QtZGV2ZWxAb3Bl
-bnN1c2Uub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8XT56A/sDhe3z
-ybe17wx3dZCA/w6OxdB8m6urILkZ1kDbn+aOlyfIlj+KL4sAM8sF2G06Odh0FJCo
-rtX9fPPJOmZFkL0Vl19OjtTFiGPTD/hSWCCqpFn+qgOjYyHes42W4g1g0WLJeu7d
-7IjeAfnJp+F3ynn9I9jOBoAbQT2euQIDAQABo4IBBzCCAQMwHQYDVR0OBBYEFNcC
-3BiE9nLBkkJWwbOF7vunJ+X5MIHTBgNVHSMEgcswgciAFNcC3BiE9nLBkkJWwbOF
-7vunJ+X5oYGkpIGhMIGeMQswCQYDVQQGEwJERTEQMA4GA1UECBMHQmF2YXJpYTES
-MBAGA1UEBxMJTnVyZW1iZXJnMSEwHwYDVQQKExhTVVNFIExpbnV4IFByb2R1Y3Rz
-IEdtYkgxDDAKBgNVBAsUA1ImRDEQMA4GA1UEAxMHV2ViWWFTVDEmMCQGCSqGSIb3
-DQEJARYXeWFzdC1kZXZlbEBvcGVuc3VzZS5vcmeCCQDJrJhC1oQ4wTAMBgNVHRME
-BTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAJgfbbMjnx5FHMUoZhP6xAnOmSQb/WMR
-8QuURWqhy51wHSfAZOTd/+R5CaDasI2hVdYIVYxXNTfixDlA3HwXVGkFYuMD0hBm
-PVH2u7MsxcFQnMrrsmIjTJJg/cbLsQX7Jl87sxWCt7mjhV33xIAkV9HuRLe73kmN
-s3Jr6Qku+ipX
------END CERTIFICATE-----
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0

[yast-commit] <web-client> master : show only SLE11 supported languages bnc#557768
by Josef Reidinger 27 Nov '09
by Josef Reidinger 27 Nov '09
27 Nov '09
ref: refs/heads/master
commit 4fd323240c4c0ed05c895827ab85e8eecd809450
Author: Josef Reidinger <jreidinger(a)suse.cz>
Date: Fri Nov 27 13:01:25 2009 +0100
show only SLE11 supported languages bnc#557768
---
plugins/language/app/views/language/index.rhtml | 2 +-
.../package/yast2-webclient-language.changes | 6 ++++++
.../language/package/yast2-webclient-language.spec | 4 ++--
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/plugins/language/app/views/language/index.rhtml b/plugins/language/app/views/language/index.rhtml
index 9866d0f..0c4d513 100644
--- a/plugins/language/app/views/language/index.rhtml
+++ b/plugins/language/app/views/language/index.rhtml
@@ -5,7 +5,7 @@
<p>
<label><%=_("webYaST language")%> <label>
<%= select_tag "webyast_language",
- options_for_select(LangHelper::LANGUAGES.invert.to_a.reject{|val| !(I18n.supported_locales.include?(val[1]))}.sort_by { |a| a[0].parameterize}, current_locale) %>
+ options_for_select(LangHelper::LANGUAGES.invert.to_a.reject{|val| !(supported_languages.include?(val[1]))}.sort_by { |a| a[0].parameterize}, current_locale) %>
</p>
</fieldset>
<div>
diff --git a/plugins/language/package/yast2-webclient-language.changes b/plugins/language/package/yast2-webclient-language.changes
index dd18886..0b3e093 100644
--- a/plugins/language/package/yast2-webclient-language.changes
+++ b/plugins/language/package/yast2-webclient-language.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Nov 27 12:00:04 UTC 2009 - jreidinger(a)novell.com
+
+- show only supported languages
+- 0.0.11
+
+-------------------------------------------------------------------
Wed Nov 18 11:40:51 UTC 2009 - jreidinger(a)novell.com
- show only webyast language (bnc#547176)
diff --git a/plugins/language/package/yast2-webclient-language.spec b/plugins/language/package/yast2-webclient-language.spec
index 0af66e9..693f650 100644
--- a/plugins/language/package/yast2-webclient-language.spec
+++ b/plugins/language/package/yast2-webclient-language.spec
@@ -10,12 +10,12 @@
Name: yast2-webclient-language
-PreReq: yast2-webclient
+PreReq: yast2-webclient>= 0.0.26
Provides: yast2-webclient:/srv/www/yast/app/controllers/language_controller.rb
License: GPL v2 only
Group: Productivity/Networking/Web/Utilities
Autoreqprov: on
-Version: 0.0.10
+Version: 0.0.11
Release: 0
Summary: YaST2 - Webclient - Language
Source: www.tar.bz2
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0

[yast-commit] <web-client> backgroud_patches_bnc550934 : show only SLE11 supported languages bnc#557768
by Josef Reidinger 27 Nov '09
by Josef Reidinger 27 Nov '09
27 Nov '09
ref: refs/heads/backgroud_patches_bnc550934
commit 4fd323240c4c0ed05c895827ab85e8eecd809450
Author: Josef Reidinger <jreidinger(a)suse.cz>
Date: Fri Nov 27 13:01:25 2009 +0100
show only SLE11 supported languages bnc#557768
---
plugins/language/app/views/language/index.rhtml | 2 +-
.../package/yast2-webclient-language.changes | 6 ++++++
.../language/package/yast2-webclient-language.spec | 4 ++--
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/plugins/language/app/views/language/index.rhtml b/plugins/language/app/views/language/index.rhtml
index 9866d0f..0c4d513 100644
--- a/plugins/language/app/views/language/index.rhtml
+++ b/plugins/language/app/views/language/index.rhtml
@@ -5,7 +5,7 @@
<p>
<label><%=_("webYaST language")%> <label>
<%= select_tag "webyast_language",
- options_for_select(LangHelper::LANGUAGES.invert.to_a.reject{|val| !(I18n.supported_locales.include?(val[1]))}.sort_by { |a| a[0].parameterize}, current_locale) %>
+ options_for_select(LangHelper::LANGUAGES.invert.to_a.reject{|val| !(supported_languages.include?(val[1]))}.sort_by { |a| a[0].parameterize}, current_locale) %>
</p>
</fieldset>
<div>
diff --git a/plugins/language/package/yast2-webclient-language.changes b/plugins/language/package/yast2-webclient-language.changes
index dd18886..0b3e093 100644
--- a/plugins/language/package/yast2-webclient-language.changes
+++ b/plugins/language/package/yast2-webclient-language.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Nov 27 12:00:04 UTC 2009 - jreidinger(a)novell.com
+
+- show only supported languages
+- 0.0.11
+
+-------------------------------------------------------------------
Wed Nov 18 11:40:51 UTC 2009 - jreidinger(a)novell.com
- show only webyast language (bnc#547176)
diff --git a/plugins/language/package/yast2-webclient-language.spec b/plugins/language/package/yast2-webclient-language.spec
index 0af66e9..693f650 100644
--- a/plugins/language/package/yast2-webclient-language.spec
+++ b/plugins/language/package/yast2-webclient-language.spec
@@ -10,12 +10,12 @@
Name: yast2-webclient-language
-PreReq: yast2-webclient
+PreReq: yast2-webclient>= 0.0.26
Provides: yast2-webclient:/srv/www/yast/app/controllers/language_controller.rb
License: GPL v2 only
Group: Productivity/Networking/Web/Utilities
Autoreqprov: on
-Version: 0.0.10
+Version: 0.0.11
Release: 0
Summary: YaST2 - Webclient - Language
Source: www.tar.bz2
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0