Author: jsmeix
Date: Thu Nov 27 14:32:38 2008
New Revision: 53648
URL: http://svn.opensuse.org/viewcvs/yast?rev=53648&view=rev
Log:
- Several fixes regarding the Connection Wizard like
misaligned layout, wrong Device URIs,
Buttons without any functionality,
wrong error and debug messages,
inaccurate search string for drivers,
improper preset URIs and model info,...
so that the Connection Wizard should now basically work
(see Novell/Suse Bugzilla bnc#440903
and Novell/Suse Bugzilla bnc#442247
and Novell/Suse Bugzilla bnc#446432
and Novell/Suse Bugzilla bnc#441416).
- 2.17.47
Modified:
trunk/printer/VERSION
trunk/printer/package/yast2-printer.changes
trunk/printer/src/basicadd.ycp
trunk/printer/src/basicmodify.ycp
trunk/printer/src/connectionwizard.ycp
Modified: trunk/printer/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/VERSION?rev=53648&r1=53647&r2=53648&view=diff
==============================================================================
--- trunk/printer/VERSION (original)
+++ trunk/printer/VERSION Thu Nov 27 14:32:38 2008
@@ -1 +1 @@
-2.17.46
+2.17.47
Modified: trunk/printer/package/yast2-printer.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/package/yast2-printer.changes?rev=53648&r1=53647&r2=53648&view=diff
==============================================================================
--- trunk/printer/package/yast2-printer.changes (original)
+++ trunk/printer/package/yast2-printer.changes Thu Nov 27 14:32:38 2008
@@ -1,4 +1,20 @@
-------------------------------------------------------------------
+Thu Nov 27 14:05:38 CET 2008 - jsmeix@suse.de
+
+- Several fixes regarding the Connection Wizard like
+ misaligned layout, wrong Device URIs,
+ Buttons without any functionality,
+ wrong error and debug messages,
+ inaccurate search string for drivers,
+ improper preset URIs and model info,...
+ so that the Connection Wizard should now basically work
+ (see Novell/Suse Bugzilla bnc#440903
+ and Novell/Suse Bugzilla bnc#442247
+ and Novell/Suse Bugzilla bnc#446432
+ and Novell/Suse Bugzilla bnc#441416).
+- 2.17.47
+
+-------------------------------------------------------------------
Wed Nov 26 16:20:09 CET 2008 - jsmeix@suse.de
- Several fixes for the Connection Wizard but it is still
Modified: trunk/printer/src/basicadd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/basicadd.ycp?rev=53648&r1=53647&r2=53648&view=diff
==============================================================================
--- trunk/printer/src/basicadd.ycp (original)
+++ trunk/printer/src/basicadd.ycp Thu Nov 27 14:32:38 2008
@@ -328,10 +328,10 @@
{ queue_name_proposal = Printer::NewQueueName( tolower( model ) );
driver_filter_input_text = model;
driver_filter_string = filterchars( tolower( model ), Printer::lower_alnum_chars );
- if( Printer::connections[Printer::selected_connections_index,"class"]:"" != "ConnectionWizardDialog" )
- { // Match at the beginning only if the connection is not from the connection wizard:
- driver_filter_string = "^" + driver_filter_string;
- }
+ // Match at the beginning also if the connection is from the connection wizard
+ // because here the model is only the manufacturer name (or "Generic" or "Raw Queue")
+ // so that match at the beginning is exactly right for connections from the connection wizard:
+ driver_filter_string = "^" + driver_filter_string;
}
if( "" == driver_filter_string )
{ // Set a fallback driver_filter_string which does not match to anything
Modified: trunk/printer/src/basicmodify.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/basicmodify.ycp?rev=53648&r1=53647&r2=53648&view=diff
==============================================================================
--- trunk/printer/src/basicmodify.ycp (original)
+++ trunk/printer/src/basicmodify.ycp Thu Nov 27 14:32:38 2008
@@ -627,16 +627,16 @@
)
{ driver_filter_input_text = model;
driver_filter_string = filterchars( tolower( model ), Printer::lower_alnum_chars );
- if( Printer::connections[Printer::selected_connections_index,"class"]:"" != "ConnectionWizardDialog" )
- { // Match at the beginning only if the connection is not from the connection wizard:
- driver_filter_string = "^" + driver_filter_string;
- }
+ // Match at the beginning also if the connection is from the connection wizard
+ // because here the model is only the manufacturer name (or "Generic" or "Raw Queue")
+ // so that match at the beginning is exactly right for connections from the connection wizard:
+ driver_filter_string = "^" + driver_filter_string;
}
}
else
{ // When the currently used connection is re-selected,
// derive the driver_filter_string from the NickName of the currently used PPD
- // or derive the driver_filter_string from the description of the currently used connection:
+ // or derive the driver_filter_string from the description of the currently used connection:
if( "" != nick_name )
{ driver_filter_input_text = nick_name;
// Match only at the beginning of the NickName entry in the PPD:
Modified: trunk/printer/src/connectionwizard.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/connectionwizard.ycp?rev=53648&r1=53647&r2=53648&view=diff
==============================================================================
--- trunk/printer/src/connectionwizard.ycp (original)
+++ trunk/printer/src/connectionwizard.ycp Thu Nov 27 14:32:38 2008
@@ -41,8 +41,7 @@
string connection_uri="";
string connection_model="";
-list< string > known_manufacturers = [ "",
- "Generic",
+list< string > known_manufacturers = [ "Generic",
"Alps",
"Anitech",
"Apollo",
@@ -93,9 +92,67 @@
"Tektronix",
"Toshiba",
"Xerox",
- "Zebra",
- "Raw Queue"
+ "Zebra"
];
+list< string > manufacturers_for_using_driver = prepend( add( known_manufacturers, "Raw Queue" ), "" );
+list< string > manufacturers_for_raw_queue = prepend( known_manufacturers, "Raw Queue" );
+
+string getCurrentDeviceURI()
+{ if( "" != Printer::connections[Printer::selected_connections_index,"uri"]:"")
+ { return Printer::connections[Printer::selected_connections_index,"uri"]:"";
+ }
+ return Printer::queues[Printer::selected_queues_index,"uri"]:"";
+}
+
+term getContentFromCurrentModel()
+{ term content = nil;
+ string current_model_info = Printer::connections[Printer::selected_connections_index,"model"]:"";
+ if( "" == current_model_info
+ || "unknown" == tolower( current_model_info )
+ )
+ { current_model_info = Printer::queues[Printer::selected_queues_index,"description"]:"";
+ if( "" != current_model_info
+ && "unknown" != tolower( current_model_info )
+ )
+ { list <string> description_words = splitstring( current_model_info, " " );
+ if( size( description_words ) > 2 )
+ { current_model_info = description_words[0]:"" + " "
+ + description_words[1]:"" + " "
+ + description_words[2]:"";
+ }
+ if( size( description_words ) == 2 )
+ { current_model_info = description_words[0]:"" + " "
+ + description_words[1]:"";
+ }
+ if( size( description_words ) == 1 )
+ { current_model_info = description_words[0]:"";
+ }
+ }
+ }
+ if( "" != current_model_info
+ && "unknown" != tolower( current_model_info )
+ )
+ { content = `Left
+ ( `ComboBox
+ ( `id("manufacturers_combo_box"),
+ // Header for a ComboBox to keep the printer model or select another manufacturer:
+ _("Keep the printer model or select another &manufacturer"),
+ prepend( add( known_manufacturers, "Raw Queue" ), current_model_info )
+ )
+ );
+ }
+ else
+ { content = `Left
+ ( `ComboBox
+ ( `id("manufacturers_combo_box"),
+ // Header for a ComboBox to select the printer manufacturer:
+ _("Select the printer &manufacturer"),
+ manufacturers_for_using_driver
+ )
+ );
+ }
+ return content;
+}
term getContentFromBackend( string backend )
{ list items = [];
@@ -140,22 +197,22 @@
return nil;
}
term content = `VBox
- ( `HBox
- ( `Left
+ ( `Left
+ ( `HBox
( `ComboBox
( `id(`hostname),
`opt(`editable),
// TRANSLATORS: Text entry to fill IP or hostname of remote server
_("&IP Address or Host Name")
+ ),
+ `MenuButton
+ ( // TRANSLATORS: Label for menu to search for remote servers
+ _("Look Up"),
+ [ `item( `id(`scan), text[0]:"" ),
+ // TRANSLATORS: Button to search for remote servers
+ `item( `id(`scan_all), _("Look Up for All Hosts") )
+ ]
)
- ),
- `MenuButton
- ( // TRANSLATORS: Label for menu to search for remote servers
- _("Look Up"),
- [ `item( `id(`scan), text[0]:"" ),
- // TRANSLATORS: Button to search for remote servers
- `item( `id(`scan_all), _("Look Up for All Hosts") )
- ]
)
),
`Left
@@ -170,16 +227,27 @@
}
void changeSettingsDialog( symbol selected )
-{ term content=nil;
+{ term content = nil;
term connection_content = nil;
- term model_content = `Left
- ( `ComboBox
- ( `id("known_manufacturers_combo_box"),
- // Header for a ComboBox to select the printer manufacturer:
- _("Select the printer &manufacturer"),
- known_manufacturers
- )
- );
+ term model_content = nil;
+ term model_for_using_driver_content = `Left
+ ( `ComboBox
+ ( `id("manufacturers_combo_box"),
+ // Header for a ComboBox to select the printer manufacturer:
+ _("Select the printer &manufacturer"),
+ manufacturers_for_using_driver
+ )
+ );
+ term model_for_raw_queue_content = `Left
+ ( `ComboBox
+ ( `id("manufacturers_combo_box"),
+ // Header for a ComboBox to optionally select the printer manufacturer.
+ // Do not change or translate "raw", it is a technical term
+ // when no driver is used for a print queue.
+ _("You may select a printer &manufacturer if no 'raw queue' should be set up"),
+ manufacturers_for_raw_queue
+ )
+ );
switch(selected)
{ // directly connected
case(`parallel):
@@ -213,7 +281,7 @@
"9100"
]
);
- content = `VBox( connection_content, model_content );
+ content = `VBox( connection_content, model_for_using_driver_content );
break;
case(`lpd):
connection_content = getNetworkContent( [ // TRANSLATORS: List of input field labels,
@@ -224,7 +292,7 @@
"LPT1"
]
);
- content = `VBox( connection_content, model_content );
+ content = `VBox( connection_content, model_for_using_driver_content );
break;
case(`ipp):
content = `VBox
@@ -236,125 +304,246 @@
"ipp://ip-address:port-number/resource"
)
),
- model_content
+ model_for_using_driver_content
);
break;
- // print via
- case(`smb):
- content=`VBox(
- `HBox(
- // TRANSLATORS: Text entry for remote server name
- `ComboBox(`id(`hostname), `opt(`editable), _("Server (NetBIOS Host Name)")),
- // TRANSLATORS: Label for menu to search for remote servers
- `MenuButton(_("Look Up"),
- [
- `item(`id(`scan), _("Scan for samba printers")),
- // TRANSLATORS: Buttonto search for remote servers
- `item(`id(`scan_all), _("Look Up for All Hosts"))
- ])
- ),
- // TRANSLATORS: Text entry for printer name
- `InputField(`id(`printer), _("Printer (Share Name)")),
-// `HBox(
- // TRANSLATORS: Text entry for samba domain
- `ComboBox(`id(`domain), `opt(`editable), _("Workgroup (Domain Name)")),
-// PushButton(`id(`scan_domain), _("Scan for Windows Share Domains"))
-// )
- // TRANSLATORS: Frame label for authentication
- `Frame(_("Authenticate As"), `VBox(
- // TRANSLATORS: Text entry for username (authentication)
- `InputField(`id(`user), _("User")),
- // TRANSLATORS: Text entry for password (authentication)
- `Password(`id(`pass), _("&Password"))
- )),
- // TRANSLATORS: Button to test remote printer machine
- `PushButton(`id(`test), _("&Test Connection"))
- );
- break;
- case(`lpr):
- // TRANSLATORS: List of input field labels, first for network scan button, second for name of printer queue
- content = getNetworkContent([_("Scan for LPD Servers"), _("Queue Name"), ""]);
- break;
- case(`cups):
- content = `VBox
- ( `Left
- ( `HBox
- ( `ComboBox
+ // print via
+ case(`smb):
+ content = `VBox
+ ( `Left
+ ( `HBox
+ ( `ComboBox
+ ( `id(`hostname),
+ `opt(`editable),
+ // TRANSLATORS: Text entry for remote server name
+ _("Server (NetBIOS Host Name)")
+ //),
+ //`MenuButton
+ //( // TRANSLATORS: Label for menu to search for remote servers
+ // _("Look Up"),
+ // [ `item( `id(`scan), _("Scan for samba printers") ),
+ // // TRANSLATORS: Buttonto search for remote servers
+ // `item( `id(`scan_all), _("Look Up for All Hosts") )
+ // ]
+ )
+ )
+ ),
+ `Left
+ ( `InputField
+ ( `id(`printer),
+ // TRANSLATORS: Text entry for printer name
+ _("Printer (Share Name)")
+ )
+ ),
+ `Left
+ ( `HBox
+ ( `ComboBox
+ ( `id(`domain),
+ `opt(`editable),
+ // TRANSLATORS: Text entry for samba domain
+ _("Workgroup (Domain Name)")
+ //),
+ //PushButton
+ //( `id(`scan_domain),
+ // _("Scan for Windows Share Domains")
+ //)
+ )
+ )
+ ),
+ `Left
+ ( `Frame
+ ( // TRANSLATORS: Frame label for authentication
+ _("Authenticate As"),
+ `VBox
+ ( `InputField
+ ( `id(`user),
+ // TRANSLATORS: Text entry for username (authentication)
+ _("User")
+ ),
+ `Password
+ ( `id(`pass),
+ // TRANSLATORS: Text entry for password (authentication)
+ _("&Password")
+ )
+ )
+ )
+ ),
+ `Left
+ ( `PushButton
+ ( `id(`test),
+ // TRANSLATORS: Button to test remote printer machine
+ _("&Test Connection")
+ )
+ ),
+ model_for_using_driver_content
+ );
+ break;
+ case(`lpr):
+ connection_content = getNetworkContent( [ // TRANSLATORS: List of input field labels,
+ // first for network scan button,
+ // second for name of printer queue
+ _("Scan for LPD Servers"),
+ _("Queue Name"),
+ ""
+ ]
+ );
+ content = `VBox( connection_content, model_for_raw_queue_content );
+ break;
+ case(`cups):
+ content = `VBox
+ ( `Left
+ ( `HBox
+ ( `ComboBox
+ ( `id(`hostname),
+ `opt(`editable),
+ // TRANSLATORS: Text entry for IP or hostname of remote server
+ _("IP Address or Host Name")
+ ),
+ `MenuButton
+ ( // TRANSLATORS: Label for menu to search for remote servers
+ _("Look Up"),
+ [ `item( `id(`scan), _("Scan for IPP Servers") ),
+ `item( `id(`scan_broadcast), _("Scan for IPP Broadcasts") ),
+ `item( `id(`scan_all), _("Look Up for All Hosts") )
+ ]
+ )
+ )
+ ),
+ `Left
+ ( `InputField( `id(`queue), _("Queue Name") )
+ ),
+ `Left
+ ( `PushButton
+ ( `id(`test),
+ // TRANSLATORS: Button to test remote printer machine
+ _("&Test Connection")
+ )
+ ),
+ model_for_raw_queue_content
+ );
+ break;
+ case(`ipx):
+ content = `VBox
+ ( `Left
+ ( `InputField
( `id(`hostname),
- `opt(`editable),
// TRANSLATORS: Text entry for IP or hostname of remote server
_("IP Address or Host Name")
- ),
- `MenuButton
- ( // TRANSLATORS: Label for menu to search for remote servers
- _("Look Up"),
- [ `item( `id(`scan), _("Scan for IPP Servers") ),
- `item( `id(`scan_broadcast), _("Scan for IPP Broadcasts") ),
- `item( `id(`scan_all), _("Look Up for All Hosts") )
- ]
)
+ ),
+ `Left
+ ( `InputField
+ ( `id(`queue),
+ // TRANSLATORS: Text entry for name of remote printer queue
+ _("Queue Name")
+ )
+ ),
+ `Left
+ ( `Frame
+ ( // TRANSLATORS: Frame label for authentication
+ _("Authenticate As"),
+ `VBox
+ ( `InputField
+ ( `id(`user),
+ // TRANSLATORS: Text entry for username (authentication)
+ _("User")
+ ),
+ `Password
+ ( `id(`pass),
+ // TRANSLATORS: Text entry for password (authentication)
+ _("&Password")
+ )
+ )
+ )
+ ),
+ `Left
+ ( `PushButton
+ ( `id(`test),
+ // TRANSLATORS: Button to test remote printer machine
+ _("&Test Connection")
+ )
+ ),
+ model_for_using_driver_content
+ );
+ break;
+ // special
+ case(`uri):
+ model_content = getContentFromCurrentModel();
+ content = `VBox
+ ( `Left
+ ( `InputField
+ ( `id(`uri),
+ // TRANSLATORS: Text entry for URI (Uniform Resource Identifier)
+ _("URI (Uniform Resource Identifier)"),
+ getCurrentDeviceURI()
+ )
+ ),
+ model_content
+ );
+ break;
+ case(`pipe):
+ content = `VBox
+ ( `Left
+ ( `InputField
+ ( `id(`program),
+ // TRANSLATORS: Text entry for program name that will be called via pipe
+ _("Program Name")
+ )
+ ),
+ model_for_raw_queue_content
+ );
+ break;
+ case(`beh):
+ model_content = getContentFromCurrentModel();
+ content = `VBox
+ ( `Left
+ ( `InputField
+ ( `id(`queue),
+ // TRANSLATORS: Text entry for device URI (Uniform Resource Identifier)
+ _("Device URI (for which 'beh' should be applied)"),
+ getCurrentDeviceURI()
+ )
+ ),
+ `Left
+ ( `CheckBox
+ ( `id(`beh_do_not_disable),
+ // TRANSLATORS: Check box
+ _("Never Disable the Queue"),
+ true
+ )
+ ),
+ `Left
+ ( `InputField
+ ( `id(`beh_attempts),
+ // TRANSLATORS: Text entry
+ _("Number of Retries ('0' means infinite retries)"),
+ "0"
+ )
+ ),
+ `Left
+ ( `InputField
+ ( `id(`beh_delay),
+ // TRANSLATORS: Text entry
+ _("Delay in Seconds Between Two Retries"),
+ "30"
+ )
+ ),
+ model_content
+ );
+ break;
+ case(`directly):
+ case(`network):
+ case(`server):
+ case(`special):
+ content = `VBox
+ ( `Left
+ ( `Label
+ ( _("Select a specific connection type.") )
)
- ),
- `Left
- ( `InputField( `id(`queue), _("Queue Name") )
- ),
- `PushButton
- ( `id(`test),
- // TRANSLATORS: Button to test remote printer machine
- _("&Test Connection")
- )
- );
- break;
- case(`ipx):
- content=`VBox(
- // TRANSLATORS: Text entry for IP or hostname of remote server
- `InputField(`id(`hostname), _("IP Address or Host Name")),
- // TRANSLATORS: Text entry for name of remote printer queue
- `InputField(`id(`queue), _("Queue Name")),
- // TRANSLATORS: Frame label for authentication
- `Frame(_("Authenticate As"), `VBox(
- // TRANSLATORS: Text entry for username (authentication)
- `InputField(`id(`user), _("User")),
- // TRANSLATORS: Text entry for password (authentication)
- `Password(`id(`pass), _("&Password"))
- )),
- // TRANSLATORS: Button to test remote printer machine
- `PushButton(`id(`test), _("&Test Connection"))
- );
- break;
- // special
- case(`uri):
- content=`VBox(
- // TRANSLATORS: Text entry for URI (Uniform Resource Identifier)
- `InputField(`id(`uri), _("URI (Uniform Resource Identifier)"))
- );
- break;
- case(`pipe):
- content=`VBox(
- // TRANSLATORS: Text entry for program name that will be called via pipe
- `InputField(`id(`program), _("Program Name"))
- );
- break;
- case(`beh):
- content=`VBox(
- // TRANSLATORS: Text entry for device URI (Uniform Resource Identifier)
- `InputField(`id(`queue), _("Device URI (for which 'beh' should be applied)"), Printer::queues[Printer::selected_queues_index,"uri"]:""),
- // TRANSLATORS: Check box
- `CheckBox(`id(`beh_do_not_disable), _("Never Disable the Queue"), true),
- // TRANSLATORS: Text entry
- `InputField(`id(`beh_attempts), _("Number of Retries ('0' means infinite retries)"), "0"),
- // TRANSLATORS: Text entry
- `InputField(`id(`beh_delay), _("Delay in Seconds Between Two Retries"), "30")
- );
- break;
- case(`directly):
- case(`network):
- case(`server):
- case(`special):
- content = `Empty();
- break;
- default:
- y2error("Unknown selected item %1", selected);
+ );
+ break;
+ default:
+ y2error( "Unknown selected item %1", selected );
}
UI::ReplaceWidget( `rp, content );
}
@@ -441,7 +630,14 @@
`Frame
( // TRANSLATORS: Connection details widget
_("Connection Settings"),
- `ReplacePoint( `id(`rp), `Empty() )
+ `ReplacePoint( `id(`rp),
+ `VBox
+ ( `Left
+ ( `Label
+ ( _("Select a specific connection type.") )
+ )
+ )
+ )
),
`VStretch()
)
@@ -470,193 +666,300 @@
);
Wizard::HideAbortButton();
-boolean validateSettingsDialog(symbol type){
- boolean valid=false;
- connection_uri="";
- connection_model="";
- switch(type){
- case(`parallel):
- case(`usb):
- case(`serial):
- case(`infra):
- case(`bluetooth):
- case(`scsi):
- case(`hplip):
- 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.")
- );
- break;
- }
- connection_uri = Printer::connections[selected_connection_index,"uri"]:"";
- connection_model = Printer::connections[selected_connection_index,"model"]:"Unknown";
- if( "" != connection_uri ) valid = true;
- break;
- case(`uri):
- case(`ipp):
- connection_uri=(string) UI::QueryWidget(`uri, `Value);
- if (size(connection_uri)>0) valid=true;
- else Popup::Error(_("URI couldn't be empty!"));
- if( valid )
- { connection_model = (string)UI::QueryWidget( `id("known_manufacturers_combo_box"), `Value );
- if( "" == connection_model )
- { valid=false;
- Popup::Error( _("Select a manufacturer!") );
+boolean validateSettingsDialog( symbol type )
+{ boolean valid=false;
+ connection_uri="";
+ connection_model="";
+ switch(type)
+ { case(`parallel):
+ case(`usb):
+ case(`serial):
+ case(`infra):
+ case(`bluetooth):
+ case(`scsi):
+ case(`hplip):
+ 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.")
+ );
+ break;
}
- }
- break;
- case(`smb):
- map