Author: mzugec
Date: Tue May 20 23:47:11 2008
New Revision: 47727
URL: http://svn.opensuse.org/viewcvs/yast?rev=47727&view=rev
Log:
improved add/edit usb queues
Removed:
trunk/printer/agents/proc_parport_devices.scr
trunk/printer/agents/proc_usblp_devices.scr
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/Printerlib.ycp
Modified: trunk/printer/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/VERSION?rev=47727&r1=47726&r2=47727&view=diff
==============================================================================
--- trunk/printer/VERSION (original)
+++ trunk/printer/VERSION Tue May 20 23:47:11 2008
@@ -1 +1 @@
-2.16.29
+2.16.30
Modified: trunk/printer/package/yast2-printer.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/package/yast2-printer.changes?rev=47727&r1=47726&r2=47727&view=diff
==============================================================================
--- trunk/printer/package/yast2-printer.changes (original)
+++ trunk/printer/package/yast2-printer.changes Tue May 20 23:47:11 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue May 20 23:48:20 CEST 2008 - mzugec@suse.cz
+
+- improved add/edit usb queues
+- 2.16.30
+
+-------------------------------------------------------------------
Tue May 20 17:53:55 CEST 2008 - mzugec@suse.cz
- fixed lpd network queue (bnc#391848)
Modified: trunk/printer/src/common/dialogs-connection.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/common/dialogs-connection.ycp?rev=47727&r1=47726&r2=47727&view=diff
==============================================================================
--- trunk/printer/src/common/dialogs-connection.ycp (original)
+++ trunk/printer/src/common/dialogs-connection.ycp Tue May 20 23:47:11 2008
@@ -625,28 +625,26 @@
if ("" == uri) uri = Printer::printer["uri"]:"parallel";
if ("" == type) type = URL::Parse(uri)["scheme"]:"";
string device = "";
- if (type !="hp") Printerlib::getUriDevice (uri);
+ if (type !="hp") uri = Printerlib::getUriDevice (uri);
list<string> devices = [];
- path read_devs = "usb" == type
- ? .proc.usblp.devices
- : ("irda" == type ? .proc.irlpt.devices : .proc.serial.devices
- ) ;
+ path read_devs = "irda" == type ? .proc.irlpt.devices : .proc.serial.devices ;
integer baudrate = Printerlib::getUriBaudrate (uri);
string ser_settings = Printerlib::getUriValue (uri, "ty");
if (0 == baudrate && -1 == Printer::index) baudrate = 9600;
integer i = search (device, "?");
if (nil != i) device = substring (device, 0, i);
- if (!contains([ "irda", "bluetooth", "hp", "parallel"], type)) devices = (list<string>)SCR::Read (read_devs);
+ if (!contains([ "irda", "bluetooth", "hp", "parallel", "usb"], type)) devices = (list<string>)SCR::Read (read_devs);
// for parallel use CUPS backend (bnc#391324)
- else if (type=="parallel"){
- string cmd_output = ((map)SCR::Execute(.target.bash_output, "lpinfo -v|grep direct|cut -d'=' -f2-|grep parallel|cut -d':' -f2-"))["stdout"]:"";
- y2milestone("parallel detection command output: %1", cmd_output);
+ else if (contains([ "parallel", "usb" ], type)){
+ string cmd_output = ((map)SCR::Execute(.target.bash_output,
+ sformat("lpinfo -v|grep direct|cut -d' ' -f2-|grep \"^%1:\"|cut -d':' -f2-", type)))["stdout"]:"";
+ y2milestone("%1 detection command output: %2", type, cmd_output);
devices = filter(string s, splitstring(cmd_output, "\n"), { return (size(s)>0);});
}
else devices = [];
map cups_devices_mapping = $[];
-
+/*
if (type == "usb" && Spooler::Get () == "cups")
{
CUPS::DetectCupsUsbDevicesInfo ();
@@ -667,7 +665,7 @@
});
}
}
-
+*/
if (size (devices) == 0)
{
if (type == "parallel")
@@ -815,6 +813,7 @@
ret = (symbol)UI::UserInput ();
switch(ret){
device = (string)UI::QueryWidget (`id (`devicesel), `CurrentItem);
+y2internal("device %1", device);
case `bt_detect :
map devs = Printerlib::GetBluetoothDevices ();
devices = maplist (string k, string v, devs, { return k; });
@@ -879,10 +878,10 @@
}
if (`next == ret)
{
+ device = (string)UI::QueryWidget (`id (`devicesel), `CurrentItem);
uri = type + ":" + device;
if ("serial" == type) uri = uri + sformat ("?baudrate=%1+ty=%2", baudrate, ser_settings);
else if (type == "bluetooth") uri = type + "://" + filterchars (device, "0123456789aAbBcCdDeEfF");
-y2internal("bt uri %1, type %2, device %3", uri, type, device);
Printer::printer["uri"] = uri;
}
return ret;
Modified: trunk/printer/src/common/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/common/dialogs.ycp?rev=47727&r1=47726&r2=47727&view=diff
==============================================================================
--- trunk/printer/src/common/dialogs.ycp (original)
+++ trunk/printer/src/common/dialogs.ycp Tue May 20 23:47:11 2008
@@ -1962,14 +1962,14 @@
{
boolean finded=false;
foreach(map row, items, {
- if (row["ID"]:nil == Printerlib::getReplacedString(Printerlib::getUriDevice (i["uri"]:""), false))
+ if (row["ID"]:nil == Printerlib::getReplacedString( i["uri"]:"", false))//Printerlib::getUriDevice (i["uri"]:""), false))
{
finded=true;
y2milestone("Printer %1 without ppd file already configured", row["ID"]:nil);
}
});
if (finded==false) return $[
- "ID":Printerlib::getReplacedString(Printerlib::getUriDevice (i["uri"]:""), false),
+ "ID" : Printerlib::getReplacedString(Printerlib::getUriDevice (i["uri"]:""), false),
"MODEL":i["info"]:"unknown",
"SPOOL":i["name"]:"not configured",
"DESCR": "<b>" + i["info"]:"none" + "</b><br>"
@@ -1979,6 +1979,7 @@
}));
items = (list < map >) filter (any i, items, ``(i != nil));
+y2internal("items %1", items);
Printer::conf_unconf_printers = items;
maplist(map s, items, {
o_items = add(o_items, $[
Modified: trunk/printer/src/common/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/common/wizards.ycp?rev=47727&r1=47726&r2=47727&view=diff
==============================================================================
--- trunk/printer/src/common/wizards.ycp (original)
+++ trunk/printer/src/common/wizards.ycp Tue May 20 23:47:11 2008
@@ -30,7 +30,7 @@
define symbol MainSequence();
define symbol AddPrinterSubSequence ();
- define symbol EditPrinterSequence (boolean configured);
+// define symbol EditPrinterSequence (boolean configured);
define symbol AddPrinterSequence ();
/**
@@ -46,8 +46,8 @@
// sequences
"main_wz" : ``(MainSequence ()),
"add_printer_wz" : ``(AddPrinterSequence ()),
- "edit_printer_wz" : ``(EditPrinterSequence (true)),
- "edit_printer_unconf" : ``(EditPrinterSequence (false)),
+// "edit_printer_wz" : ``(EditPrinterSequence (true)),
+// "edit_printer_unconf" : ``(EditPrinterSequence (false)),
"add_printer_sub_wz":``(AddPrinterSubSequence ()),
// real dialogs
@@ -156,9 +156,9 @@
* @param configured boolean printer already configured
* @return sequence result
*/
+/*
define symbol EditPrinterSequence (boolean configured) ``{
map aliases = getAliases ();
-/*
map sequence = $[
"ws_start" : "edit",
"edit" : $[
@@ -255,7 +255,6 @@
"members" : $[ `abort : `abort, `next : "edit", ],
"storeprinter" : $[`next : `next, ],
];
-*/
map sequence = $[
"ws_start" : "edit2",
"edit2" : $[
@@ -267,7 +266,7 @@
aliases = (map)filter (string k, any v, aliases, ``(haskey (sequence, k)));
return Sequencer::Run (aliases, sequence);
}
-
+*/
/**
* Get the sub-sequence of adding new queue
* @return a map the sub sequence for WS
@@ -293,7 +292,7 @@
`abort : `abort,
`back : "printer_type",
`next : `next,
- `edit_button : "edit_printer_wz"
+ `edit_button : "edit2"
],
"add_local_printer" : $[
`abort : `abort,
@@ -314,7 +313,7 @@
`queue : "inst_printer",
`other : "connection_other",
],
- "edit_printer_wz": $[
+ "edit2": $[
`next: `next,
`abort : `abort,
],
@@ -439,15 +438,14 @@
define symbol AddPrinterSequence () ``{
map aliases = getAliases ();
map sequence = $[
- "edit_printer_wz" : $[ `abort : `abort, `next : `next ],
+ "edit2" : $[ `abort : `abort, `next : `next ],
];
map add_seq = getAddPrinterSubSequence ();
add_seq = mapmap (string k, any v, add_seq, ``{
if (is (v, map))
{
v = mapmap (symbol event, any vv, (map)v, ``{
- if (vv == `edit)
- vv = "edit_printer_wz";
+ if (vv == `edit) vv = "edit2";
return $[ event : vv ];
});
}
@@ -480,7 +478,7 @@
// `restart_button : "redetect",
`add_button : "add_printer_wz",
`edit_button : "edit2",
- `edit_unconf : "edit_printer_unconf",
+ `edit_unconf : "edit2",
// `change_ipp_listen : "listen_ipp_bcast",
// `cups_expert : "cups_expert",
`change_remote_access : "remote_access",
@@ -570,10 +568,12 @@
`next: "main",
`abort : `abort,
],
+/*
"edit_printer_unconf": $[
`next: "main",
`abort : `abort,
],
+*/
/*
"cups_client_main" : $[
`next : `next,
Modified: trunk/printer/src/modules/Printerlib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/modules/Printerlib.ycp?rev=47727&r1=47726&r2=47727&view=diff
==============================================================================
--- trunk/printer/src/modules/Printerlib.ycp (original)
+++ trunk/printer/src/modules/Printerlib.ycp Tue May 20 23:47:11 2008
@@ -654,14 +654,15 @@
{
string replaced = "";
map tokens = URL::Parse(device);
-
if (show_pass){
replaced = sformat("%1://", tokens["scheme"]:"");
if (size(tokens["user"]:"")>0 || size(tokens["pass"]:"")>0) replaced=sformat("%1****@", replaced);
}
if (size(tokens["domain"]:"")>0) replaced=sformat("%1%2", replaced, tokens["domain"]:"");
if (size(tokens["host"]:"")>0) replaced=sformat("%1%2%3", replaced, (size(tokens["domain"]:"")>0)?"/":"", tokens["host"]:"");
+y2internal("replaced %1", replaced);
replaced = sformat("%1%2%3", replaced,(substring(tokens["path"]:"",0,1)=="/")?"":"/", tokens["path"]:"");
+y2internal("replaced %1", replaced);
return replaced;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org