Author: mzugec
Date: Wed Apr 23 15:24:29 2008
New Revision: 46986
URL: http://svn.opensuse.org/viewcvs/yast?rev=46986&view=rev
Log:
fixed "add" printer (bnc#382074)
Modified:
trunk/printer/VERSION
trunk/printer/package/yast2-printer.changes
trunk/printer/src/common/dialogs-connection.ycp
trunk/printer/src/common/dialogs.ycp
trunk/printer/src/common/wizards.ycp
trunk/printer/src/modules/Printer.ycp
Modified: trunk/printer/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/VERSION?rev=46986&r1=46985&r2=46986&view=diff
==============================================================================
--- trunk/printer/VERSION (original)
+++ trunk/printer/VERSION Wed Apr 23 15:24:29 2008
@@ -1 +1 @@
-2.16.16
+2.16.17
Modified: trunk/printer/package/yast2-printer.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/package/yast2-printer.changes?rev=46986&r1=46985&r2=46986&view=diff
==============================================================================
--- trunk/printer/package/yast2-printer.changes (original)
+++ trunk/printer/package/yast2-printer.changes Wed Apr 23 15:24:29 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Apr 23 14:50:59 CEST 2008 - mzugec@suse.cz
+
+- fixed "add" printer (bnc#382074)
+- 2.16.17
+
+-------------------------------------------------------------------
Wed Apr 23 10:42:22 CEST 2008 - mzugec@suse.cz
- improved "global" settings layout (bnc#381353)
Modified: trunk/printer/src/common/dialogs-connection.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/common/dialogs-connection.ycp?rev=46986&r1=46985&r2=46986&view=diff
==============================================================================
--- trunk/printer/src/common/dialogs-connection.ycp (original)
+++ trunk/printer/src/common/dialogs-connection.ycp Wed Apr 23 15:24:29 2008
@@ -309,7 +309,7 @@
* Dialog for create queue for existing printer
* @return symbol wizard sequencer symbol
*/
-define symbol runNewQueueDialog() ``{
+define symbol runNewQueueDialog(symbol retval) ``{
list<term> printers = [];
integer current = 0;
term contents = `VBox();
@@ -381,12 +381,15 @@
});
map tmp_map = Printer::printcap[from_detect]:$[];
-tmp_map["name"] = Printer::generateQueueName(nil, tmp_map["uri"]:"",
+ tmp_map["name"] = Printer::generateQueueName(nil, tmp_map["uri"]:"",
tmp_map["vendor_db"]:"", tmp_map["device_db"]:"", Printer::getForbiddenNames());
Printer::editDetected(tmp_map);
y2milestone("Configuring detected, non-configured printer");
-return nil;
+ return retval;
+/*
+ return nil;
return `edit_button;
+*/
}
return nil;
return `next;
@@ -398,6 +401,7 @@
* @return symbol wizard sequencer symbol
*/
define symbol runConnectionTypeDialog (boolean local) ``{
+y2internal("runConnectionTypeDialog");
symbol selected = Printer::connection_type_selected;
boolean add_queue = false;
if (size (getConfiguredPrinters ()) != 0 && Printer::confmode == `adm) add_queue = true;
@@ -462,8 +466,7 @@
// frame label
"", //_("Printer Type"),
getConnectionTypeHelp (add_queue), `connection_type);
- if (ret == `lpd)
- Printer::printer["proposed_raw"] = true;
+ if (ret == `lpd) Printer::printer["proposed_raw"] = true;
return (symbol)ret;
}
Modified: trunk/printer/src/common/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/common/dialogs.ycp?rev=46986&r1=46985&r2=46986&view=diff
==============================================================================
--- trunk/printer/src/common/dialogs.ycp (original)
+++ trunk/printer/src/common/dialogs.ycp Wed Apr 23 15:24:29 2008
@@ -2089,7 +2089,7 @@
// TODO handle all events here
case `add :
Printer::selectPrinter(-1);
- ret = `configure_button;
+ ret = `add_button;
break;
case `edit :
if (new_spooler == "cups")
@@ -2123,9 +2123,6 @@
else ret = `edit_button;
} else ret=`connection_cups;
break;
- case `redetect:
- ret = `restart_button;
- break;
case `test :
// error report
/*
@@ -2140,6 +2137,7 @@
ret = nil;
}
}
+y2internal("ret %1", ret);
return ret; // FIXME
}
@@ -2642,7 +2640,7 @@
`PushButton(`id(`next), Label::OKButton()))
);
UI::OpenDialog(contents);
- runNewQueueDialog();
+ runNewQueueDialog(nil);
UI::CloseDialog();
initBasic("");
}
Modified: trunk/printer/src/common/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/common/wizards.ycp?rev=46986&r1=46985&r2=46986&view=diff
==============================================================================
--- trunk/printer/src/common/wizards.ycp (original)
+++ trunk/printer/src/common/wizards.ycp Wed Apr 23 15:24:29 2008
@@ -99,7 +99,7 @@
"printer_type" : ``(runPrinterTypeDialog()),
"add_local_printer":``(runConnectionTypeDialog(true)),
"add_remote_printer":``(runConnectionTypeDialog(false)),
- "add_new_queue" : ``(runNewQueueDialog()),
+ "add_new_queue" : ``(runNewQueueDialog(`edit_button)),
// "advanced" : ``(runAdvancedDialog ()),
// "cupsd" : ``(runCupsServerDialog ("")),
"cupsaclroot" : ``(runCupsAclDialog (`root)),
@@ -138,7 +138,7 @@
];
Printer::default_queue = "lp";
Printer::selectPrinter (3);
- list<string> seq = [ "main", "configdetected", "quick", "complex", "connection_local", "usb", "name", "model", "filter", "featues", "edit", ];
+ list<string> seq = [ "main", "configdetected", "quick", "complex", "connection_local", "usb", "name", /*"model",*/ "filter", "featues", "edit", ];
foreach (string i, seq, ``{
eval (getAliases ()[i]:nil);
});
@@ -261,7 +261,14 @@
"edit2" : $[
`next : `next,
`abort: `abort
+// `add : "add_printer_sub_wz"
]
+/*
+ "add_printer_sub_wz" : $[
+ `next : `next,
+ `abort: `abort
+ ]
+*/
];
// if (configured == false) sequence["ws_start"] = "model";
aliases = (map)filter (string k, any v, aliases, ``(haskey (sequence, k)));
@@ -375,10 +382,16 @@
"name_auto" : $[
`abort : `abort,
- `next : "model",
+// `next : "model",
+ `next : "edit2",
`raw : "storeprinter",
`class : "members",
],
+ "edit2" : $[
+ `next : `next,
+ `abort : `abort
+ ],
+/*
"model" : $[
`abort : `abort,
`next : `edit,
@@ -387,18 +400,19 @@
`downloadppd : "downloadppd",
`select_ppd : "ppdselect_all",
],
+*/
"ppdselect_all" : $[
`abort : `abort,
`next : `edit,
- `select_model : "model",
+// `select_model : "model",
],
"useppd" : $[
`abort : `abort,
- `next : "model",
+// `next : "model",
],
"downloadppd" : $[
`abort : `abort,
- `next: "model",
+// `next: "model",
],
"members" : $[
`abort : `abort,
@@ -470,6 +484,7 @@
`abort : `abort,
`configure_button : "add_printer_wz",
// `restart_button : "redetect",
+ `add_button : "add_printer_wz",
`edit_button : "edit2",
`edit_unconf : "edit_printer_unconf",
// `change_ipp_listen : "listen_ipp_bcast",
Modified: trunk/printer/src/modules/Printer.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/modules/Printer.ycp?rev=46986&r1=46985&r2=46986&view=diff
==============================================================================
--- trunk/printer/src/modules/Printer.ycp (original)
+++ trunk/printer/src/modules/Printer.ycp Wed Apr 23 15:24:29 2008
@@ -2107,20 +2107,28 @@
global define void editDetected (map det) ``{
// (FaTE#120083) Avoid the Automated Setup For "Non-Recommended" Printers
boolean problematic = false;
- map cmd = (map)SCR::Execute(.target.bash_output, sformat("grep '%1' %2|tr -d '\n'", det["device"]:"",
- "/usr/share/YaST2/data/printer/printers_support"));
-y2internal("%1", cmd);
- if (cmd["exit"]:-1==0) {
- string status = splitstring(cmd["stdout"]:"", "|")[2]:"";
- if (status!="full"){
+ string model = String::CutBlanks(det["device"]: det["ppd_info", "model"]:"");
+ if (size(model)==0) y2warning("Couldn't detect model from %1", det);
+ else {
+ string command = sformat("grep '%1' %2|tr -d '\n'", model, "/usr/share/YaST2/data/printer/printers_support");
+ y2internal("executing command %1", command);
+ map cmd = (map)SCR::Execute(.target.bash_output, command);
+ y2internal("%1", cmd);
+ if (cmd["exit"]:-1==0) {
+ string status = splitstring(cmd["stdout"]:"", "|")[2]:"";
+ if (status!="full" && size(status)>0){
problematic=true;
Popup::Warning(sformat("%1 %2 %3 '%4'", _("Selected printer"), splitstring(cmd["stdout"]:"", "|")[1]:"", _("will not be autoconfigured\n because it's not fully supported. Supported status is"), status));
+ }
}
}
Printerdb::InstallDrivers ();
index = -1;
y2debug ("Editing printer %1", det);
- string filename = (problematic) ? "" : Printerdb::getAutoPpdFile ( det["vendor_db"]:"", det["device_db"]:"" );
+y2internal ("Editing printer %1", det);
+string vendor = det["vendor_db"]: det["ppd_info", "manufacturer_db"]:"";
+string device = det["device_db"]: det["ppd_info", "model_db"]:"";
+ string filename = (problematic) ? "" : Printerdb::getAutoPpdFile ( vendor, device );
y2debug ("Filename: %1", filename);
printer = $[
"detected" : det,
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org