YaST Commits
Threads by month
- ----- 2024 -----
- 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
December 2009
- 24 participants
- 488 discussions
02 Dec '09
Author: aschnell
Date: Wed Dec 2 10:30:41 2009
New Revision: 59889
URL: http://svn.opensuse.org/viewcvs/yast?rev=59889&view=rev
Log:
Created tag branch-Code-11-SP1-2_17_85
Added:
tags/branch-Code-11-SP1-2_17_85/
--
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] r59888 - in /branches/SuSE-Code-11-SP1-Branch/storage: VERSION package/yast2-storage.changes
by aschnell@svn.opensuse.org 02 Dec '09
by aschnell@svn.opensuse.org 02 Dec '09
02 Dec '09
Author: aschnell
Date: Wed Dec 2 10:30:05 2009
New Revision: 59888
URL: http://svn.opensuse.org/viewcvs/yast?rev=59888&view=rev
Log:
- bump version
Modified:
branches/SuSE-Code-11-SP1-Branch/storage/VERSION
branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes
Modified: branches/SuSE-Code-11-SP1-Branch/storage/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/VERSION Wed Dec 2 10:30:05 2009
@@ -1 +1 @@
-2.17.84
+2.17.85
Modified: branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes Wed Dec 2 10:30:05 2009
@@ -2,6 +2,7 @@
Fri Nov 27 17:08:15 CET 2009 - aschnell(a)suse.de
- enable boot.crypt-early along with boot.crypto (bnc #558888)
+- 2.17.85
-------------------------------------------------------------------
Fri Nov 27 15:46:26 CET 2009 - aschnell(a)suse.de
--
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] r59887 - in /trunk/gtk: ChangeLog src/YGUtils.cc src/YGUtils.h src/pkg/YGPackageSelector.cc src/pkg/ygtkpackageview.cc src/pkg/yzyppwrapper.cc src/test.cc
by rpmcruz@svn.opensuse.org 02 Dec '09
by rpmcruz@svn.opensuse.org 02 Dec '09
02 Dec '09
Author: rpmcruz
Date: Wed Dec 2 01:49:25 2009
New Revision: 59887
URL: http://svn.opensuse.org/viewcvs/yast?rev=59887&view=rev
Log:
* src/YGUtils.cc: bug fix 549943: HTML to XHTML
conversor was tripping in the breakline.
Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/YGUtils.cc
trunk/gtk/src/YGUtils.h
trunk/gtk/src/pkg/YGPackageSelector.cc
trunk/gtk/src/pkg/ygtkpackageview.cc
trunk/gtk/src/pkg/yzyppwrapper.cc
trunk/gtk/src/test.cc
Modified: trunk/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=59887&r1=59886…
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Wed Dec 2 01:49:25 2009
@@ -1,3 +1,8 @@
+2009-12-02 Ricardo Cruz <rpmcruz(a)alunos.dcc.fc.up.pt>
+
+ * src/YGUtils.cc: bug fix 549943: HTML to XHTML
+ conversor was tripping in the breakline.
+
2009-12-01 Ricardo Cruz <rpmcruz(a)alunos.dcc.fc.up.pt>
* src/YGUtils.cc: bug fix 559226: Allow '&' to be escaped.
Modified: trunk/gtk/src/YGUtils.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUtils.cc?rev=59887&r1=…
==============================================================================
--- trunk/gtk/src/YGUtils.cc (original)
+++ trunk/gtk/src/YGUtils.cc Wed Dec 2 01:49:25 2009
@@ -268,9 +268,12 @@
else { // Normal text
if (!pre_mode && g_ascii_isspace (instr[i])) {
- if (!was_space)
- g_string_append_c (outp, ' ');
- was_space = TRUE;
+ // completely ignore breaklines unlike other whitespace
+ if (instr[i] != '\n') {
+ if (!was_space)
+ g_string_append_c (outp, ' ');
+ was_space = TRUE;
+ }
}
else {
was_space = FALSE;
@@ -419,42 +422,27 @@
void ygutils_scrollAdj (GtkAdjustment *vadj, gboolean top)
{ YGUtils::scrollWidget (vadj, top); }
-void YGUtils::escapeMarkup (std::string &str)
+std::string YGUtils::escapeMarkup (const std::string &ori)
{
- bool modify = false;
- std::string::size_type i;
- for (i = 0; i < str.length() && !modify; i++) {
- switch (str[i]) {
+ std::string::size_type length = ori.length(), i;
+ std::string ret;
+ ret.reserve (length * 1.5);
+ for (i = 0; i < length; i++)
+ switch (ori[i]) {
case '<':
+ ret += "<";
+ break;
case '>':
+ ret += ">";
+ break;
case '&':
- modify = true;
+ ret += "&";
break;
default:
+ ret += ori[i];
break;
}
- }
- if (modify) {
- std::string ori (str);
- str.clear();
- str.reserve (ori.length()+50);
- for (i = 0; i < ori.length(); i++) {
- switch (ori[i]) {
- case '<':
- str += "<";
- break;
- case '>':
- str += ">";
- break;
- case '&':
- str += "&";
- break;
- default:
- str += ori[i];
- break;
- }
- }
- }
+ return ret;
}
int YGUtils::getCharsWidth (GtkWidget *widget, int chars_nb)
Modified: trunk/gtk/src/YGUtils.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUtils.h?rev=59887&r1=5…
==============================================================================
--- trunk/gtk/src/YGUtils.h (original)
+++ trunk/gtk/src/YGUtils.h Wed Dec 2 01:49:25 2009
@@ -29,7 +29,7 @@
std::string truncate (const std::string &str, int length, int pos);
/* Escapes markup text (eg. changes '<' by '\<'). */
- void escapeMarkup (std::string &str);
+ std::string escapeMarkup (const std::string &str);
/* Adds functionality to scroll widgets to top or bottom. */
void scrollWidget (GtkAdjustment *vadj, bool top);
Modified: trunk/gtk/src/pkg/YGPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/YGPackageSelector.cc…
==============================================================================
--- trunk/gtk/src/pkg/YGPackageSelector.cc (original)
+++ trunk/gtk/src/pkg/YGPackageSelector.cc Wed Dec 2 01:49:25 2009
@@ -482,7 +482,7 @@
const Ypp::Repository *repo = Ypp::get()->getRepository (i);
gtk_tree_store_append (store, &iter, NULL);
std::string text = repo->name, url (repo->url);
- YGUtils::escapeMarkup (url);
+ url = YGUtils::escapeMarkup (url);
text += "\n<small>" + url + "</small>";
const gchar *icon;
if (repo->url.empty())
Modified: trunk/gtk/src/pkg/ygtkpackageview.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/ygtkpackageview.cc?r…
==============================================================================
--- trunk/gtk/src/pkg/ygtkpackageview.cc (original)
+++ trunk/gtk/src/pkg/ygtkpackageview.cc Wed Dec 2 01:49:25 2009
@@ -458,7 +458,7 @@
std::string str = package->name();
std::string summary = package->summary();
if (!summary.empty()) {
- YGUtils::escapeMarkup (summary);
+ summary = YGUtils::escapeMarkup (summary);
str += "\n<small>" + summary + "</small>";
}
g_value_set_string (value, g_strdup (str.c_str()));
Modified: trunk/gtk/src/pkg/yzyppwrapper.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg/yzyppwrapper.cc?rev=…
==============================================================================
--- trunk/gtk/src/pkg/yzyppwrapper.cc (original)
+++ trunk/gtk/src/pkg/yzyppwrapper.cc Wed Dec 2 01:49:25 2009
@@ -558,7 +558,7 @@
ZyppObject object = m_sel->theObj();
std::string text = object->description(), br = "<br>";
if (markup == GTK_MARKUP && type == Ypp::Package::PACKAGE_TYPE) {
- YGUtils::escapeMarkup (text);
+ text = YGUtils::escapeMarkup (text);
text += "\n";
const Ypp::Package::Version *version;
version = getInstalledVersion();
@@ -592,7 +592,7 @@
while (text.length() > 0 && text [text.length()-1] == '\n')
text.erase (text.length()-1);
- YGUtils::escapeMarkup (text);
+ text = YGUtils::escapeMarkup (text);
YGUtils::replace (text, "\n\n", 2, "<br>"); // break every double line
text += br;
}
@@ -772,8 +772,8 @@
it != changelogList.end(); it++) {
std::string date (it->date().form ("%d %B %Y")), author (it->author()),
changes (it->text());
- YGUtils::escapeMarkup (author);
- YGUtils::escapeMarkup (changes);
+ author = YGUtils::escapeMarkup (author);
+ changes = YGUtils::escapeMarkup (changes);
YGUtils::replace (changes, "\n", 1, "<br>");
if (author.compare (0, 2, "- ", 2) == 0) // zypp returns a lot of author strings as
author.erase (0, 2); // "- author". wtf?
@@ -790,14 +790,14 @@
ZyppPackage package = tryCastToZyppPkg (object);
if (package) {
std::string packager = package->packager(), vendor = package->vendor(), authors;
- YGUtils::escapeMarkup (packager);
- YGUtils::escapeMarkup (vendor);
+ packager = YGUtils::escapeMarkup (packager);
+ vendor = YGUtils::escapeMarkup (vendor);
const std::list <std::string> &authorsList = package->authors();
for (std::list <std::string>::const_iterator it = authorsList.begin();
it != authorsList.end(); it++) {
std::string author (*it);
if (markup != NO_MARKUP)
- YGUtils::escapeMarkup (author);
+ author = YGUtils::escapeMarkup (author);
if (!authors.empty()) {
if (markup == HTML_MARKUP)
authors += "<br>";
@@ -828,7 +828,7 @@
if (i != std::string::npos) {
std::string str = description.substr (i);
if (markup != NO_MARKUP)
- YGUtils::escapeMarkup (str);
+ str = YGUtils::escapeMarkup (str);
if (markup == HTML_MARKUP)
YGUtils::replace (str, "\n", 1, "<br>");
authors += str;
@@ -870,7 +870,7 @@
zypp::VendorSupportOption opt = package->vendorSupport();
std::string str (zypp::asUserStringDescription (opt));
if (markup != HTML_MARKUP)
- YGUtils::escapeMarkup (str);
+ return YGUtils::escapeMarkup (str);
return str;
}
return "";
@@ -975,7 +975,7 @@
text += it->asString();
}
if (markup != HTML_MARKUP)
- YGUtils::escapeMarkup (text);
+ return YGUtils::escapeMarkup (text);
return text;
}
@@ -991,7 +991,7 @@
text += it->asString();
}
if (markup != NO_MARKUP)
- YGUtils::escapeMarkup (text);
+ return YGUtils::escapeMarkup (text);
return text;
}
Modified: trunk/gtk/src/test.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/test.cc?rev=59887&r1=598…
==============================================================================
--- trunk/gtk/src/test.cc (original)
+++ trunk/gtk/src/test.cc Wed Dec 2 01:49:25 2009
@@ -131,8 +131,7 @@
{ NULL, NULL }
};
for (int i = 0; aTests[i].in; i++) {
- string out (aTests[i].in);
- YGUtils::escapeMarkup (out);
+ string out (YGUtils::escapeMarkup (aTests[i].in));
if (out != aTests[i].out) {
fprintf (stderr, "Mis-converted entry %d XML '%s' should be '%s'\n",
i, out.c_str(), aTests[i].out);
--
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] r59886 - /tags/branch-Code-11-SP1-2_17_7/fingerprint-reader/
by jsuchome@svn.opensuse.org 01 Dec '09
by jsuchome@svn.opensuse.org 01 Dec '09
01 Dec '09
Author: jsuchome
Date: Tue Dec 1 16:47:19 2009
New Revision: 59886
URL: http://svn.opensuse.org/viewcvs/yast?rev=59886&view=rev
Log:
Created tag branch-Code-11-SP1-2_17_7 for fingerprint-reader
Added:
tags/branch-Code-11-SP1-2_17_7/fingerprint-reader/ (props changed)
- copied from r59885, branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/
--
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] r59885 - /tags/branch-Code-11-SP1-2_17_3/irda/
by jsuchome@svn.opensuse.org 01 Dec '09
by jsuchome@svn.opensuse.org 01 Dec '09
01 Dec '09
Author: jsuchome
Date: Tue Dec 1 16:47:17 2009
New Revision: 59885
URL: http://svn.opensuse.org/viewcvs/yast?rev=59885&view=rev
Log:
Created tag branch-Code-11-SP1-2_17_3 for irda
Added:
tags/branch-Code-11-SP1-2_17_3/irda/ (props changed)
- copied from r59884, branches/SuSE-Code-11-SP1-Branch/irda/
--
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] r59884 - in /branches/SuSE-Code-11-SP1-Branch/fingerprint-reader: VERSION package/yast2-fingerprint-reader.changes src/fingerprint-reader.desktop
by jsuchome@svn.opensuse.org 01 Dec '09
by jsuchome@svn.opensuse.org 01 Dec '09
01 Dec '09
Author: jsuchome
Date: Tue Dec 1 16:47:13 2009
New Revision: 59884
URL: http://svn.opensuse.org/viewcvs/yast?rev=59884&view=rev
Log:
- fixed desktop file category (bnc#559343)
- 2.17.7
Modified:
branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/VERSION
branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/package/yast2-fingerprint-reader.changes
branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/src/fingerprint-reader.desktop
Modified: branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/finge…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/VERSION Tue Dec 1 16:47:13 2009
@@ -1 +1 @@
-2.17.6
+2.17.7
Modified: branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/package/yast2-fingerprint-reader.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/finge…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/package/yast2-fingerprint-reader.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/package/yast2-fingerprint-reader.changes Tue Dec 1 16:47:13 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Dec 1 16:25:27 CET 2009 - jsuchome(a)suse.cz
+
+- fixed desktop file category (bnc#559343)
+- 2.17.7
+
+-------------------------------------------------------------------
Mon Oct 13 08:24:26 CEST 2008 - jsuchome(a)suse.cz
- better help text
Modified: branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/src/fingerprint-reader.desktop
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/finge…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/src/fingerprint-reader.desktop (original)
+++ branches/SuSE-Code-11-SP1-Branch/fingerprint-reader/src/fingerprint-reader.desktop Tue Dec 1 16:47:13 2009
@@ -1,6 +1,6 @@
[Desktop Entry]
Type=Application
-Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;
+Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Hardware;
X-KDE-ModuleType=Library
X-KDE-RootOnly=true
--
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] r59883 - in /branches/SuSE-Code-11-SP1-Branch/irda: VERSION package/yast2-irda.changes src/Irda.ycp src/ui.ycp testsuite/.cvsignore testsuite/tests/Write.out
by jsuchome@svn.opensuse.org 01 Dec '09
by jsuchome@svn.opensuse.org 01 Dec '09
01 Dec '09
Author: jsuchome
Date: Tue Dec 1 16:47:03 2009
New Revision: 59883
URL: http://svn.opensuse.org/viewcvs/yast?rev=59883&view=rev
Log:
- save baud rate (bnc#558525)
- check for `ok dialog return value (bnc#558525)
- 2.17.3
Modified:
branches/SuSE-Code-11-SP1-Branch/irda/VERSION
branches/SuSE-Code-11-SP1-Branch/irda/package/yast2-irda.changes
branches/SuSE-Code-11-SP1-Branch/irda/src/Irda.ycp
branches/SuSE-Code-11-SP1-Branch/irda/src/ui.ycp
branches/SuSE-Code-11-SP1-Branch/irda/testsuite/.cvsignore
branches/SuSE-Code-11-SP1-Branch/irda/testsuite/tests/Write.out
Modified: branches/SuSE-Code-11-SP1-Branch/irda/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/irda/…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/irda/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/irda/VERSION Tue Dec 1 16:47:03 2009
@@ -1 +1 @@
-2.17.2
+2.17.3
Modified: branches/SuSE-Code-11-SP1-Branch/irda/package/yast2-irda.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/irda/…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/irda/package/yast2-irda.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/irda/package/yast2-irda.changes Tue Dec 1 16:47:03 2009
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Tue Dec 1 16:30:55 CET 2009 - jsuchome(a)suse.cz
+
+- save baud rate (bnc#558525)
+- check for `ok dialog return value (bnc#558525)
+- 2.17.3
+
+-------------------------------------------------------------------
Thu Oct 16 13:00:41 CEST 2008 - jsuchome(a)suse.cz
- removed obsolete code for /dev/pilot (bnc#435993)
Modified: branches/SuSE-Code-11-SP1-Branch/irda/src/Irda.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/irda/…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/irda/src/Irda.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/irda/src/Irda.ycp Tue Dec 1 16:47:03 2009
@@ -107,8 +107,12 @@
if (port != "")
{
SCR::Write (.sysconfig.irda.IRDA_PORT, port);
- SCR::Write (.sysconfig.irda, nil);
}
+ if (max_baud_rate != nil)
+ {
+ SCR::Write (.sysconfig.irda.IRDA_MAX_BAUD_RATE, max_baud_rate);
+ }
+ SCR::Write (.sysconfig.irda, nil);
Progress::NextStage ();
Modified: branches/SuSE-Code-11-SP1-Branch/irda/src/ui.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/irda/…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/irda/src/ui.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/irda/src/ui.ycp Tue Dec 1 16:47:03 2009
@@ -25,9 +25,9 @@
* @param port the serial port use for IrDA
* (to see if it was changed and service needs to be restarted)
*/
-define boolean TestPopup (string port) {
+define boolean TestPopup (string port, string baud_rate) {
- boolean modified = port != Irda::port;
+ boolean modified = port != Irda::port || baud_rate != Irda::max_baud_rate;
// if service was originaly started
boolean orig_start = false;
@@ -44,15 +44,16 @@
{
// 1. save new configuration
SCR::Write (.sysconfig.irda.IRDA_PORT, port);
+ SCR::Write (.sysconfig.irda.IRDA_MAX_BAUD_RATE, baud_rate);
SCR::Write (.sysconfig.irda, nil);
}
// 2. start/restart the service
// when module cannot be loaded, Runlevel returns 0 -> use target.bash
if (!orig_start)
- out = (map) SCR::Execute (.target.bash_output, "rcirda start");
+ out = Service::RunInitScriptOutput ("irda", "start");
else if (modified)
- out = (map) SCR::Execute (.target.bash_output, "rcirda restart");
+ out = Service::RunInitScriptOutput ("irda", "restart");
return out["stderr"]:"";
}
@@ -66,6 +67,7 @@
if (modified)
{
SCR::Write (.sysconfig.irda.IRDA_PORT, Irda::port);
+ SCR::Write (.sysconfig.irda.IRDA_MAX_BAUD_RATE, Irda::max_baud_rate);
SCR::Write (.sysconfig.irda, nil);
}
@@ -308,12 +310,12 @@
}
if (ret == `test)
{
- TestPopup (port);
+ TestPopup (port, baud_rate);
}
} while (!contains ([`back, `abort, `cancel, `next, `ok], ret));
- if (ret == `next &&
+ if ((ret == `next || ret == `ok) &&
(start != Irda::start || port != Irda::port ||
baud_rate != Irda::max_baud_rate))
{
@@ -336,7 +338,7 @@
Irda::Read ();
symbol ret = IrDADialog ();
- if (ret == `next || ret == `finish)
+ if (ret == `next || ret == `finish || ret == `ok)
{
Irda::Write ();
}
Modified: branches/SuSE-Code-11-SP1-Branch/irda/testsuite/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/irda/…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/irda/testsuite/.cvsignore (original)
+++ branches/SuSE-Code-11-SP1-Branch/irda/testsuite/.cvsignore Tue Dec 1 16:47:03 2009
@@ -9,4 +9,3 @@
config
run
*.test
-tests
Modified: branches/SuSE-Code-11-SP1-Branch/irda/testsuite/tests/Write.out
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/irda/…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/irda/testsuite/tests/Write.out (original)
+++ branches/SuSE-Code-11-SP1-Branch/irda/testsuite/tests/Write.out Tue Dec 1 16:47:03 2009
@@ -1,6 +1,8 @@
Dump ==== nothing modified: =====================
Return true
Dump ==== stop irda: ============================
+Write .sysconfig.irda.IRDA_MAX_BAUD_RATE "0" true
+Write .sysconfig.irda nil true
Read .init.scripts.exists "irda" true
Execute .target.bash_output "/etc/init.d/irda stop" $["TERM":"raw"] $["exit":0]
Read .init.scripts.exists "irda" true
@@ -12,6 +14,7 @@
Return true
Dump ==== start irda, create link: ==============
Write .sysconfig.irda.IRDA_PORT "new_port" true
+Write .sysconfig.irda.IRDA_MAX_BAUD_RATE "0" true
Write .sysconfig.irda nil true
Read .init.scripts.exists "irda" true
Execute .target.bash_output "/etc/init.d/irda stop" $["TERM":"raw"] $["exit":0]
--
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] r59882 - in /trunk/pkg-bindings: package/yast2-pkg-bindings.changes src/Resolvable_Properties.cc
by lslezak@svn.opensuse.org 01 Dec '09
by lslezak@svn.opensuse.org 01 Dec '09
01 Dec '09
Author: lslezak
Date: Tue Dec 1 16:41:19 2009
New Revision: 59882
URL: http://svn.opensuse.org/viewcvs/yast?rev=59882&view=rev
Log:
- Pkg::ResolvableProperties() - return product file and it's
upgrades section for `product resolvables (bnc#559554)
Modified:
trunk/pkg-bindings/package/yast2-pkg-bindings.changes
trunk/pkg-bindings/src/Resolvable_Properties.cc
Modified: trunk/pkg-bindings/package/yast2-pkg-bindings.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/package/yast2-pkg-b…
==============================================================================
--- trunk/pkg-bindings/package/yast2-pkg-bindings.changes (original)
+++ trunk/pkg-bindings/package/yast2-pkg-bindings.changes Tue Dec 1 16:41:19 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Dec 1 15:28:04 UTC 2009 - lslezak(a)suse.cz
+
+- Pkg::ResolvableProperties() - return product file and it's
+ upgrades section for `product resolvables (bnc#559554)
+
+-------------------------------------------------------------------
Tue Nov 24 09:40:12 UTC 2009 - lslezak(a)suse.cz
- use zypp::Url::schemeIsRemote() instead of the hardcoded protocol
Modified: trunk/pkg-bindings/src/Resolvable_Properties.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Resolvable_Prop…
==============================================================================
--- trunk/pkg-bindings/src/Resolvable_Properties.cc (original)
+++ trunk/pkg-bindings/src/Resolvable_Properties.cc Tue Dec 1 16:41:19 2009
@@ -45,6 +45,8 @@
#include <zypp/Dep.h>
#include <zypp/sat/LocaleSupport.h>
+#include <zypp/parser/ProductFileReader.h>
+#include <zypp/base/Regex.h>
/**
@builtin ResolvableProperties
@@ -89,6 +91,13 @@
+ "description"
+ "display_name"
+ "short_name"
+ + "product_file" -> string : product file (full file name with target root prefix)
+ + "upgrades" -> list<map> : parsed data from the product file (upgrades section)
+ + "name" -> string
+ + "summary" -> string
+ + "repository" -> string : URL path
+ + "notify" -> boolean
+ + "status" -> string
`patch keys:
+ "interactive"
+ "reboot_needed"
@@ -370,6 +379,75 @@
info->add(YCPString("replaces"), rep_prods);
}
+
+ std::string product_file;
+
+ // add reference file in /etc/products.d
+ if (status.isInstalled())
+ {
+ product_file = (_target_root + "/etc/products.d/" + product->referenceFilename()).asString();
+ y2milestone("Parsing product file %s", product_file.c_str());
+ const zypp::parser::ProductFileData productFileData = zypp::parser::ProductFileReader::scanFile(product_file);
+
+ YCPList upgrade_list;
+
+ for_( upit, productFileData.upgrades().begin(), productFileData.upgrades().end() )
+ {
+ const zypp::parser::ProductFileData::Upgrade & upgrade( *upit );
+
+ YCPMap upgrades;
+ upgrades->add(YCPString("name"), YCPString(upgrade.name()));
+ upgrades->add(YCPString("summary"), YCPString(upgrade.summary()));
+ upgrades->add(YCPString("repository"), YCPString(upgrade.repository()));
+ upgrades->add(YCPString("notify"), YCPBoolean(upgrade.notify()));
+ upgrades->add(YCPString("status"), YCPString(upgrade.status()));
+
+ upgrade_list->add(upgrades);
+ }
+
+ info->add(YCPString("upgrades"), upgrade_list);
+ }
+ else
+ {
+ // get the package
+ zypp::sat::Solvable refsolvable = product->referencePackage();
+
+ if (refsolvable != zypp::sat::Solvable::noSolvable)
+ {
+ // create a package pointer from the SAT solvable
+ zypp::Package::Ptr refpkg(zypp::make<zypp::Package>(refsolvable));
+
+ if (refpkg)
+ {
+ // get the package files
+ zypp::Package::FileList files( refpkg->filelist() );
+ y2milestone("The reference package has %d files", files.size());
+
+ zypp::str::smatch what;
+ const zypp::str::regex product_file_regex("^/etc/products\\.d/(.*\\.prod)$");
+
+ // find the product file
+ for_(iter, files.begin(), files.end())
+ {
+ if (zypp::str::regex_match(*iter, what, product_file_regex))
+ {
+ product_file = what[1];
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ if (product_file.empty())
+ {
+ y2warning("The product file has not been found");
+ }
+ else
+ {
+ y2milestone("Found product file %s", product_file.c_str());
+ info->add(YCPString("product_file"), YCPString(product_file));
+ }
}
// pattern specific info
else if ( req_kind == "pattern" ) {
--
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] r59881 - /trunk/printer/src/connectionwizard.ycp
by jsmeix@svn.opensuse.org 01 Dec '09
by jsmeix@svn.opensuse.org 01 Dec '09
01 Dec '09
Author: jsmeix
Date: Tue Dec 1 16:28:44 2009
New Revision: 59881
URL: http://svn.opensuse.org/viewcvs/yast?rev=59881&view=rev
Log:
Moved most of the functionality which implements
that connections created by the "Connection Wizard"
can be modified by it (see bnc #553871)
from the ConnectionWizardDialog() main function
where it is only called onye during dialog init
to the changeSettingsDialog function which is called
each time when the user selects a connection type.
Therefore now the user can switch between various
connection types and always when the connection type
matches to the currently used connection (which is
usually the connection of a currently modified queue)
the current values for this connection type are filled in
and/or preselected in the sub-dialog according to the
currently used connection.
Added "bug-free-support" for username and password
in ipp/http and for username in lpd URIs (bnc #512549).
With "bug-free-support" I mean that there is no support
to set up URIs with those stuff because Michael R Sweet
really really don't want to encourage its use
but when it is already in an existing URI, it is shown
correctly. Usually the username and password stuff
is shown as is in the hostname field in the form
username:password@ip-address-or-hostname
or
username@ip-address-or-hostname
Modified:
trunk/printer/src/connectionwizard.ycp
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 Tue Dec 1 16:28:44 2009
@@ -101,9 +101,11 @@
{ // 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.
+ // because I also do not want to show the password needlessly in any dialog
+ // (and/or needlessly in /var/log/YaST2/y2log via "Autodetected queues").
// But the URI may be not in /etc/cups/printers.conf
// because there was no queue set up with this device URI
+ // (e.g. because the URI is right now created by the connection wizard)
// 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
@@ -121,13 +123,15 @@
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( "lpd" == scheme )
+ { // The CUPS lpd backend supports a fixed username (there is no authentication via LPD protocol)
+ // to describe who requested a print job in the form lpd://username@ip-address-or-hostname/...
+ // (i.e. grep only for "username@" instead of the usual "username:password@"):
+ 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:]'" );
@@ -264,24 +268,21 @@
return content;
}
-term getNetworkContent( list<string>text )
-{ if( size(text) != 3 )
- { y2error( "To create content for Network dialog it needs 3 strings : %1", text );
- return nil;
- }
- term content = `VBox
+term getNetworkContent( string hostname, string scan_hosts_label, string port_or_queue_label, string port_or_queue, string uri_options )
+{ term content = `VBox
( `Left
( `HBox
( `ComboBox
( `id(`hostname),
`opt(`editable),
// TRANSLATORS: Text entry to fill IP or hostname of remote server
- _("&IP Address or Host Name")
+ _("&IP Address or Host Name"),
+ [ hostname ]
),
`MenuButton
( // TRANSLATORS: Label for menu to search for remote servers
_("Look Up"),
- [ `item( `id(`scan), text[0]:"" ),
+ [ `item( `id(`scan), scan_hosts_label ),
// TRANSLATORS: Button to search for remote servers
`item( `id(`scan_all), _("Look Up for All Hosts") )
]
@@ -289,7 +290,7 @@
)
),
`Left
- ( `InputField( `id(`port_or_queue), text[1]:"", text[2]:"" )
+ ( `InputField( `id(`port_or_queue), port_or_queue_label, port_or_queue )
),
`Left
( `InputField( `id(`uri_options),
@@ -298,7 +299,7 @@
`opt(`hstretch),
// TRANSLATORS: InputField for optional Device URI parameters:
_("Optional 'option=value' parameter (usually empty)"),
- ""
+ uri_options
)
),
`Left
@@ -314,6 +315,19 @@
term connection_content = nil;
term model_content = nil;
string current_device_uri = "";
+ list<string> uri_parts = [];
+ string hostname = "";
+ string port_or_queue = "";
+ string uri_options = "";
+ string uri = "";
+ string queue = "";
+ string domain = "";
+ string printer = "";
+ string user = "";
+ string pass = "";
+ boolean beh_do_not_disable = true;
+ string beh_attempts = "0";
+ string beh_delay = "30";
switch(selected)
{ // directly connected
case(`parallel):
@@ -536,9 +550,26 @@
}
Popup::ClearFeedback();
y2milestone( "bluetooth_device_list '%1'", bluetooth_device_list );
- // Have an empty string preselected to be on the safe side because
- // the bluetooth backend may blindly write to the device:
- list <term> bluetooth_device_id_items = [ `item( `id(""), "", true ) ];
+ current_device_uri = getCurrentDeviceURI();
+ string current_bluetooth_device_id = "";
+ list <term> bluetooth_device_id_items = [];
+ if( "bluetooth:/" == substring( current_device_uri, 0, size( "bluetooth:/" ) ) )
+ { // The Device URI has the form:
+ // bluetooth://deviceID
+ uri_parts = splitstring( current_device_uri, "/" );
+ // Remove empty parts (e.g. bluetooth://deviceID results ["bluetooth:","","deviceID"]):
+ uri_parts = filter( string part, uri_parts, { return ( "" != part ); } );
+ y2milestone( "ConnectionWizardDialog uri_parts = '%1'", uri_parts );
+ // Note that uri_parts[0] = "bluetooth:".
+ if( "" != uri_parts[1]:"" )
+ { current_bluetooth_device_id = uri_parts[1]:"";
+ }
+ }
+ if( "" == current_bluetooth_device_id )
+ { // Have an empty string preselected to be on the safe side because
+ // the bluetooth backend may blindly write to the bluetooth device:
+ bluetooth_device_id_items = [ `item( `id(""), "", true ) ];
+ }
foreach( string word,
splitstring( bluetooth_device_list, " " ),
{ if( regexpmatch( word, "..:..:..:..:..:..") )
@@ -547,7 +578,17 @@
// in its DeviceURI which has the form bluetooth://1A2B3C4D5E6F
string hexnumber = filterchars( word, "0123456789ABCDEFabcdef" );
if( "" != hexnumber )
- { bluetooth_device_id_items = add( bluetooth_device_id_items, `item( `id( hexnumber ), hexnumber ) );
+ { if( current_bluetooth_device_id == hexnumber )
+ { // Have the current bluetooth device id preselected:
+ bluetooth_device_id_items = add( bluetooth_device_id_items,
+ `item( `id( hexnumber ), hexnumber, true )
+ );
+ }
+ else
+ { bluetooth_device_id_items = add( bluetooth_device_id_items,
+ `item( `id( hexnumber ), hexnumber )
+ );
+ }
}
}
}
@@ -594,6 +635,37 @@
}
}
y2milestone( "scsi_device_list '%1'", scsi_device_list );
+ current_device_uri = getCurrentDeviceURI();
+ string current_scsi_device_node = "";
+ list <term> scsi_device_node_items = [];
+ if( "scsi:/" == substring( current_device_uri, 0, size( "scsi:/" ) ) )
+ { // The Device URI has the form:
+ // scsi:/dev/sg...
+ // remove the scheme 'scsi:' so that only the '/dev/sg...' is left:
+ current_scsi_device_node = mergestring( sublist( splitstring( current_device_uri, ":" ), 1 ), "" );
+
+ }
+ if( "" == current_scsi_device_node )
+ { // Have an empty string preselected to be on the safe side because
+ // the CUPS scsi backend may blindly write to the device,
+ // (see backend/scsi-linux.c in the CUPS 1.3.9 sources):
+ scsi_device_node_items = [ `item( `id(""), "", true ) ];
+ }
+ foreach( string device_node,
+ [ "/dev/sg0", "/dev/sg1", "/dev/sg2", "/dev/sg3", "/dev/sg4", "/dev/sg5", "/dev/sg6", "/dev/sg7" ],
+ { if( current_scsi_device_node == device_node )
+ { // Have the current scsi device node preselected:
+ scsi_device_node_items = add( scsi_device_node_items,
+ `item( `id( device_node ), device_node, true )
+ );
+ }
+ else
+ { scsi_device_node_items = add( scsi_device_node_items,
+ `item( `id( device_node ), device_node )
+ );
+ }
+ }
+ );
model_content = getContentFromCurrentModel( true );
content = `VBox
( `Left
@@ -604,19 +676,7 @@
// a SCSI generic device node (e.g. /dev/sg0 or /dev/sg1)
// can be selected or entered:
_("&SCSI generic device"),
- [ // Have nothing preselected to be on the safe side because
- // the CUPS scsi backend may blindly write to the device,
- // (see backend/scsi-linux.c in the CUPS 1.3.9 sources):
- `item( `id(""), "", true ),
- `item( `id("/dev/sg0"), "/dev/sg0" ),
- `item( `id("/dev/sg1"), "/dev/sg1" ),
- `item( `id("/dev/sg2"), "/dev/sg2" ),
- `item( `id("/dev/sg3"), "/dev/sg3" ),
- `item( `id("/dev/sg4"), "/dev/sg4" ),
- `item( `id("/dev/sg5"), "/dev/sg5" ),
- `item( `id("/dev/sg6"), "/dev/sg6" ),
- `item( `id("/dev/sg7"), "/dev/sg7" )
- ]
+ scsi_device_node_items
)
),
`Left
@@ -633,30 +693,125 @@
break;
// network printer
case(`tcp):
- connection_content = getNetworkContent( [ // TRANSLATORS: List of input field labels,
- // first for network scan button,
- // second for the TCP port number:
- _("Scan for Direct Socket Servers"),
- _("TCP Port Number"),
- "9100"
- ]
+ hostname = "";
+ port_or_queue = "9100";
+ uri_options = "";
+ current_device_uri = getCurrentDeviceURI();
+ if( "socket:/" == substring( current_device_uri, 0, size( "socket:/" ) ) )
+ { // The Device URI has the form ([...] is an optional part):
+ // socket://ip-address-or-hostname[:port-number][?waiteof=false]
+ uri_parts = splitstring( current_device_uri, ":/?" );
+ // Remove empty parts (e.g. socket://server results ["socket","","","server"]):
+ uri_parts = filter( string part, uri_parts, { return ( "" != part ); } );
+ y2milestone( "ConnectionWizardDialog uri_parts = '%1'", uri_parts );
+ // Note that uri_parts[0] = "socket".
+ if( "" != uri_parts[1]:"" )
+ { hostname = uri_parts[1]:"";
+ if( "" != uri_parts[2]:"" )
+ { if( issubstring( uri_parts[2]:"", "=" ) )
+ { uri_options = uri_parts[2]:"";
+ }
+ else
+ { port_or_queue = uri_parts[2]:"";
+ if( issubstring( uri_parts[3]:"", "=" ) )
+ { uri_options = uri_parts[3]:"";
+ }
+ }
+ }
+ }
+ }
+ connection_content = getNetworkContent( hostname,
+ // TRANSLATORS: List of input field labels,
+ // first for network scan button,
+ // second for the TCP port number:
+ _("Scan for Direct Socket Servers"),
+ _("TCP Port Number"),
+ port_or_queue,
+ uri_options
);
model_content = getContentFromCurrentModel( true );
content = `VBox( connection_content, model_content );
break;
case(`lpd):
- 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 (see the printer's manual)"),
- "LPT1"
- ]
+ hostname = "";
+ port_or_queue = "LPT1";
+ uri_options = "";
+ current_device_uri = getCurrentDeviceURI();
+ if( "lpd:/" == substring( current_device_uri, 0, size( "lpd:/" ) ) )
+ { // Even the DeviceURI for lpd can contain a fixed username
+ // (there is no authentication via LPD protocol)
+ // to describe who requested a print job in the form
+ // lpd://username@ip-address-or-hostname/...
+ // but usage of this is really really not encouraged, see
+ // https://bugzilla.novell.com/show_bug.cgi?id=512549
+ // so that its setup not supported here but when
+ // such an URI already exists, it should be shown correctly:
+ // 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, "lpd" );
+ // The Device URI has the form ([...[...]...] are optional parts):
+ // lpd://ip-address-or-hostname/queue[?option1=value1[&option2=value2...[&optionN=valueN]...]]
+ uri_parts = splitstring( current_device_uri, ":/?" );
+ // Remove empty parts (e.g. lpd://server results ["lpd","","","server"]):
+ uri_parts = filter( string part, uri_parts, { return ( "" != part ); } );
+ y2milestone( "ConnectionWizardDialog uri_parts = '%1'", uri_parts );
+ // Note that uri_parts[0] = "lpd".
+ if( "" != uri_parts[1]:"" )
+ { hostname = uri_parts[1]:"";
+ if( "" != uri_parts[2]:"" )
+ { port_or_queue = uri_parts[2]:"";
+ if( "" != uri_parts[3]:"" )
+ { uri_options = uri_parts[3]:"";
+ }
+ }
+ }
+ }
+ connection_content = getNetworkContent( hostname,
+ // TRANSLATORS: List of input field labels,
+ // first for network scan button,
+ // second for name of printer queue
+ _("Scan for LPD Servers"),
+ _("Queue Name (see the printer's manual)"),
+ port_or_queue,
+ uri_options
);
model_content = getContentFromCurrentModel( true );
content = `VBox( connection_content, model_content );
break;
case(`ipp):
+ uri = "";
+ current_device_uri = getCurrentDeviceURI();
+ if( "ipp:/" == substring( current_device_uri, 0, size( "ipp:/" ) )
+ || "http:/" == substring( current_device_uri, 0, size( "http:/" ) )
+ )
+ { // Even the DeviceURI for ipp/http can contain
+ // fixed username and password for authentication in the form
+ // ipp://username:password@ip-address-or-hostname/...
+ // http://username:password@ip-address-or-hostname/...
+ // but usage of this is really really not encouraged, see
+ // https://bugzilla.novell.com/show_bug.cgi?id=512549
+ // so that its setup not supported here but when
+ // such an URI already exists, it should be shown correctly:
+ if( "ipp:/" == substring( current_device_uri, 0, size( "ipp:/" ) ) )
+ { // 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, "ipp" );
+ }
+ if( "http:/" == substring( current_device_uri, 0, size( "http:/" ) ) )
+ { // 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, "http" );
+ }
+ // A Device URI to print via CUPS server has the form "ipp://server/printers/queue"
+ // while a Device URI to access a network printer via IPP
+ // does probably not contain "/printers/" so that this is used here
+ // as a best effort attempt to distinguish both cases:
+ if( ! issubstring( current_device_uri, "/printers/" ) )
+ { // The Device URI has the form ({either|or} and [...[...]...] are optional parts):
+ // {ipp|http}://ip-address-or-hostname[:port-number]/resource[?option1=value1...[&optionN=valueN]...]
+ uri = current_device_uri;
+ }
+ }
model_content = getContentFromCurrentModel( true );
content = `VBox
( `Left
@@ -667,7 +822,7 @@
`opt(`hstretch),
// TRANSLATORS: Input field label
_("URI (see the printer's manual)"),
- "ipp://ip-address:port-number/resource"
+ uri
)
),
model_content
@@ -692,6 +847,68 @@
break;
}
}
+ hostname = "";
+ domain = "";
+ printer = "";
+ user = "";
+ pass = "";
+ current_device_uri = getCurrentDeviceURI();
+ if( "smb:/" == substring( current_device_uri, 0, size( "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):
+ 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]:"", ":@" );
+ user = user_pass_domain[0]:"";
+ pass = user_pass_domain[1]:"";
+ domain = user_pass_domain[2]:"";
+ hostname = uri_parts[2]:"";
+ printer = uri_parts[3]:"";
+ }
+ else
+ { // smb://username:password@server[:port]/share
+ list<string> user_pass_hostname = splitstring( uri_parts[1]:"", ":@" );
+ user = user_pass_hostname[0]:"";
+ pass = user_pass_hostname[1]:"";
+ hostname = user_pass_hostname[2]:"";
+ printer = uri_parts[2]:"";
+ }
+ }
+ else
+ { // smb://server[:port]/share
+ // or
+ // smb://workgroup/server[:port]/share
+ if( "" != uri_parts[3]:"" )
+ { // smb://workgroup/server[:port]/share
+ domain = uri_parts[1]:"";
+ hostname = uri_parts[2]:"";
+ printer = uri_parts[3]:"";
+ }
+ else
+ { // smb://server[:port]/share
+ hostname = uri_parts[1]:"";
+ printer = uri_parts[2]:"";
+ }
+ }
+ }
+ }
model_content = getContentFromCurrentModel( true );
content = `VBox
( `Left
@@ -700,7 +917,8 @@
( `id(`hostname),
`opt(`editable),
// TRANSLATORS: Text entry for remote server name
- _("Server (NetBIOS Host Name)")
+ _("Server (NetBIOS Host Name)"),
+ [ hostname ]
//),
//`MenuButton
//( // TRANSLATORS: Label for menu to search for remote servers
@@ -716,7 +934,8 @@
( `InputField
( `id(`printer),
// TRANSLATORS: Text entry for printer name
- _("Printer (Share Name)")
+ _("Printer (Share Name)"),
+ printer
)
),
`Left
@@ -725,7 +944,8 @@
( `id(`domain),
`opt(`editable),
// TRANSLATORS: Text entry for samba domain
- _("Workgroup (Domain Name)")
+ _("Workgroup (Domain Name)"),
+ [ domain ]
//),
//PushButton
//( `id(`scan_domain),
@@ -742,12 +962,14 @@
( `InputField
( `id(`user),
// TRANSLATORS: Text entry for username (authentication)
- _("User")
+ _("User"),
+ user
),
`Password
( `id(`pass),
// TRANSLATORS: Text entry for password (authentication)
- _("&Password")
+ _("&Password"),
+ pass
)
)
)
@@ -763,18 +985,104 @@
);
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"),
- ""
- ]
+ hostname = "";
+ port_or_queue = "";
+ uri_options = "";
+ current_device_uri = getCurrentDeviceURI();
+ if( "lpd:/" == substring( current_device_uri, 0, size( "lpd:/" ) ) )
+ { // Even the DeviceURI for lpd can contain a fixed username
+ // (there is no authentication via LPD protocol)
+ // to describe who requested a print job in the form
+ // lpd://username@ip-address-or-hostname/...
+ // but usage of this is really really not encouraged, see
+ // https://bugzilla.novell.com/show_bug.cgi?id=512549
+ // so that its setup not supported here but when
+ // such an URI already exists, it should be shown correctly:
+ // 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, "lpd" );
+ // The Device URI has the form ([...[...]...] are optional parts):
+ // lpd://ip-address-or-hostname/queue[?option1=value1[&option2=value2...[&optionN=valueN]...]]
+ uri_parts = splitstring( current_device_uri, ":/?" );
+ // Remove empty parts (e.g. lpd://server results ["lpd","","","server"]):
+ uri_parts = filter( string part, uri_parts, { return ( "" != part ); } );
+ y2milestone( "ConnectionWizardDialog uri_parts = '%1'", uri_parts );
+ // Note that uri_parts[0] = "lpd".
+ if( "" != uri_parts[1]:"" )
+ { hostname = uri_parts[1]:"";
+ if( "" != uri_parts[2]:"" )
+ { port_or_queue = uri_parts[2]:"";
+ if( "" != uri_parts[3]:"" )
+ { uri_options = uri_parts[3]:"";
+ }
+ }
+ }
+ }
+ connection_content = getNetworkContent( hostname,
+ // TRANSLATORS: List of input field labels,
+ // first for network scan button,
+ // second for name of printer queue
+ _("Scan for LPD Servers"),
+ _("Queue Name"),
+ port_or_queue,
+ uri_options
);
model_content = getContentFromCurrentModel( false );
content = `VBox( connection_content, model_content );
break;
case(`cups):
+ hostname = "";
+ queue = "";
+ uri_options = "";
+ current_device_uri = getCurrentDeviceURI();
+ if( "ipp:/" == substring( current_device_uri, 0, size( "ipp:/" ) )
+ || "http:/" == substring( current_device_uri, 0, size( "http:/" ) )
+ )
+ { // Even the DeviceURI for ipp/http can contain
+ // fixed username and password for authentication in the form
+ // ipp://username:password@ip-address-or-hostname/...
+ // http://username:password@ip-address-or-hostname/...
+ // but usage of this is really really not encouraged, see
+ // https://bugzilla.novell.com/show_bug.cgi?id=512549
+ // so that its setup not supported here but when
+ // such an URI already exists, it should be shown correctly:
+ if( "ipp:/" == substring( current_device_uri, 0, size( "ipp:/" ) ) )
+ { // 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, "ipp" );
+ }
+ if( "http:/" == substring( current_device_uri, 0, size( "http:/" ) ) )
+ { // 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, "http" );
+ }
+ // A Device URI to print via CUPS server has the form "ipp://server/printers/queue"
+ // while a Device URI to access a network printer via IPP
+ // does probably not contain "/printers/" so that this is used here
+ // as a best effort attempt to distinguish both cases:
+ if( issubstring( current_device_uri, "/printers/" ) )
+ { // The Device URI has the form ({either|or} and [...[...]...] are optional parts):
+ // {ipp|http}://ip-address-or-hostname[:port-number]/resource[?option1=value1...[&optionN=valueN]...]
+ // where resource is something like /printers/queue on a CUPS server.
+ // Here ':' is no delimiter so that ip-address-or-hostname:port-number is one part
+ uri_parts = splitstring( current_device_uri, "/?" );
+ // Remove empty parts (e.g. ipp://server results ["ipp:","","server"]):
+ uri_parts = filter( string part, uri_parts, { return ( "" != part ); } );
+ y2milestone( "ConnectionWizardDialog uri_parts = '%1'", uri_parts );
+ // Note that uri_parts[0] = "{ipp:|http:}".
+ if( "" != uri_parts[1]:"" )
+ { hostname = uri_parts[1]:"";
+ if( "printers" == uri_parts[2]:"" )
+ { if( "" != uri_parts[3]:"" )
+ { queue = uri_parts[3]:"";
+ if( issubstring( uri_parts[4]:"", "=" ) )
+ { uri_options = uri_parts[4]:"";
+ }
+ }
+ }
+ }
+ }
+ }
model_content = getContentFromCurrentModel( false );
content = `VBox
( `Left
@@ -783,7 +1091,8 @@
( `id(`hostname),
`opt(`editable),
// TRANSLATORS: Text entry for IP or hostname of remote server
- _("IP Address or Host Name")
+ _("IP Address or Host Name"),
+ [ hostname ]
),
`MenuButton
( // TRANSLATORS: Label for menu to search for remote servers
@@ -797,7 +1106,7 @@
),
`Left
( // TRANSLATORS: InputField for a print queue name:
- `InputField( `id(`queue), _("Queue Name") )
+ `InputField( `id(`queue), _("Queue Name"), queue )
),
`Left
( `InputField( `id(`uri_options),
@@ -806,7 +1115,7 @@
`opt(`hstretch),
// TRANSLATORS: InputField for optional Device URI parameters:
_("Optional 'option=value' parameter (usually empty)"),
- ""
+ uri_options
)
),
`Left
@@ -837,20 +1146,58 @@
break;
}
}
+ hostname = "";
+ queue = "";
+ user = "";
+ pass = "";
+ current_device_uri = getCurrentDeviceURI();
+ if( "novell:/" == substring( current_device_uri, 0, size( "novell:/" ) ) )
+ { // 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):
+ 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]:"", ":@" );
+ user = user_pass_hostname[0]:"";
+ pass = user_pass_hostname[1]:"";
+ hostname = user_pass_hostname[2]:"";
+ queue = uri_parts[2]:"";
+ }
+ else
+ { // novell://server/queue
+ hostname = uri_parts[1]:"";
+ queue = uri_parts[2]:"";
+ }
+ }
+ }
model_content = getContentFromCurrentModel( true );
content = `VBox
( `Left
( `InputField
( `id(`hostname),
// TRANSLATORS: Text entry for IP or hostname of remote server
- _("IP Address or Host Name")
+ _("IP Address or Host Name"),
+ hostname
)
),
`Left
( `InputField
( `id(`queue),
// TRANSLATORS: Text entry for name of remote printer queue
- _("Queue Name")
+ _("Queue Name"),
+ queue
)
),
`Left
@@ -861,12 +1208,14 @@
( `InputField
( `id(`user),
// TRANSLATORS: Text entry for username (authentication)
- _("User")
+ _("User"),
+ user
),
`Password
( `id(`pass),
// TRANSLATORS: Text entry for password (authentication)
- _("&Password")
+ _("&Password"),
+ pass
)
)
)
@@ -883,7 +1232,6 @@
break;
// 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)
@@ -895,6 +1243,38 @@
// so that it may have to be retrieved form /etc/cups/printers.conf:
current_device_uri = getUriWithUsernameAndPassword( current_device_uri, "novell" );
}
+ // Even the DeviceURI for ipp/http can contain
+ // fixed username and password for authentication in the form
+ // ipp://username:password@ip-address-or-hostname/...
+ // http://username:password@ip-address-or-hostname/...
+ // but usage of this is really really not encouraged, see
+ // https://bugzilla.novell.com/show_bug.cgi?id=512549
+ // so that its setup not supported here but when
+ // such an URI already exists, it should be shown correctly:
+ if( "ipp:/" == substring( current_device_uri, 0, size( "ipp:/" ) ) )
+ { // 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, "ipp" );
+ }
+ if( "http:/" == substring( current_device_uri, 0, size( "http:/" ) ) )
+ { // 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, "http" );
+ }
+ // Even the DeviceURI for lpd can contain a fixed username
+ // (there is no authentication via LPD protocol)
+ // to describe who requested a print job in the form
+ // lpd://username@ip-address-or-hostname/...
+ // but usage of this is really really not encouraged, see
+ // https://bugzilla.novell.com/show_bug.cgi?id=512549
+ // so that its setup not supported here but when
+ // such an URI already exists, it should be shown correctly:
+ if( "lpd:/" == substring( current_device_uri, 0, size( "lpd:/" ) ) )
+ { // 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, "lpd" );
+ }
+ model_content = getContentFromCurrentModel( true );
content = `VBox
( `Left
( `InputField
@@ -928,6 +1308,14 @@
break;
}
}
+ uri = "";
+ current_device_uri = getCurrentDeviceURI();
+ if( "pipe:/" == substring( current_device_uri, 0, size( "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:
+ uri = mergestring( sublist( splitstring( current_device_uri, ":" ), 1 ), "" );
+ }
model_content = getContentFromCurrentModel( false );
content = `VBox
( `Left
@@ -937,21 +1325,19 @@
// 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"),
- "path/to/command?option1=value1&option2=value2"
+ _("Program (/path/to/command?option1=value1&option2=value2)"),
+ uri
)
),
model_content
);
break;
case(`beh):
- model_content = getContentFromCurrentModel( true );
+ uri = "";
+ beh_do_not_disable = true;
+ beh_attempts = "0";
+ beh_delay = "30";
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:
@@ -962,6 +1348,55 @@
// so that it may have to be retrieved form /etc/cups/printers.conf:
current_device_uri = getUriWithUsernameAndPassword( current_device_uri, "novell" );
}
+ // Even the DeviceURI for ipp/http can contain
+ // fixed username and password for authentication in the form
+ // ipp://username:password@ip-address-or-hostname/...
+ // http://username:password@ip-address-or-hostname/...
+ // but usage of this is really really not encouraged, see
+ // https://bugzilla.novell.com/show_bug.cgi?id=512549
+ // so that its setup not supported here but when
+ // such an URI already exists, it should be shown correctly:
+ if( "ipp:/" == substring( current_device_uri, 0, size( "ipp:/" ) ) )
+ { // 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, "ipp" );
+ }
+ if( "http:/" == substring( current_device_uri, 0, size( "http:/" ) ) )
+ { // 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, "http" );
+ }
+ // Even the DeviceURI for lpd can contain a fixed username
+ // (there is no authentication via LPD protocol)
+ // to describe who requested a print job in the form
+ // lpd://username@ip-address-or-hostname/...
+ // but usage of this is really really not encouraged, see
+ // https://bugzilla.novell.com/show_bug.cgi?id=512549
+ // so that its setup not supported here but when
+ // such an URI already exists, it should be shown correctly:
+ if( "lpd:/" == substring( current_device_uri, 0, size( "lpd:/" ) ) )
+ { // 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, "lpd" );
+ }
+ uri = current_device_uri;
+ 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:
+ uri = mergestring( sublist( splitstring( current_device_uri, "/" ), 4 ), "/" );
+ uri_parts = splitstring( current_device_uri, "/" );
+ // Remove possibly empty parts:
+ 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[3]:"" )
+ { if( "0" == uri_parts[1]:"" )
+ { beh_do_not_disable = false;
+ }
+ beh_attempts = uri_parts[2]:"";
+ beh_delay = uri_parts[3]:"";
+ }
+ }
+ model_content = getContentFromCurrentModel( true );
content = `VBox
( `Left
( `InputField
@@ -971,7 +1406,7 @@
`opt(`hstretch),
// TRANSLATORS: Text entry for device URI (Uniform Resource Identifier)
_("Device URI (for which 'beh' should be applied)"),
- current_device_uri
+ uri
)
),
`Left
@@ -979,7 +1414,7 @@
( `id(`beh_do_not_disable),
// TRANSLATORS: Check box
_("Never Disable the Queue"),
- true
+ beh_do_not_disable
)
),
`Left
@@ -987,7 +1422,7 @@
( `id(`beh_attempts),
// TRANSLATORS: Text entry
_("Number of Retries ('0' means infinite retries)"),
- "0"
+ beh_attempts
)
),
`Left
@@ -995,7 +1430,7 @@
( `id(`beh_delay),
// TRANSLATORS: Text entry
_("Delay in Seconds Between Two Retries"),
- "30"
+ beh_delay
)
),
model_content
@@ -1068,10 +1503,10 @@
[ // TRANSLATORS: Tree widget item
`item( `id(`smb), _("Microsoft Windows/SAMBA (SMB/CIFS)") ),
// TRANSLATORS: Tree widget item
- `item( `id(`lpr), _("Traditional UNIX Server (LPR)") ),
+ `item( `id(`lpr), _("Traditional UNIX Server (LPR/LPD)") ),
// `item( `id(`iprint), _("iPrint (Novell OES)") ),
// TRANSLATORS: Tree widget item
- `item( `id(`cups), _("CUPS Server") ),
+ `item( `id(`cups), _("CUPS Server (IPP)") ),
// TRANSLATORS: Tree widget item
`item( `id(`ipx), _("Novell Netware Print Server (IPX)") )
]
@@ -1168,28 +1603,6 @@
else if( "socket:/" == substring( current_device_uri, 0, size( "socket:/" ) ) )
{ UI::ChangeWidget( `tree_selection, `CurrentItem, `tcp );
changeSettingsDialog( `tcp );
- // The Device URI has the form ([...] is an optional part):
- // socket://ip-address-or-hostname[:port-number][?waiteof=false]
- list<string> uri_parts = splitstring( current_device_uri, ":/?" );
- // Remove empty parts (e.g. socket://server results ["socket","","","server"]):
- uri_parts = filter( string part, uri_parts, { return ( "" != part ); } );
- y2milestone( "ConnectionWizardDialog uri_parts = '%1'", uri_parts );
- // Note that uri_parts[0] = "socket".
- if( "" != uri_parts[1]:"" )
- { UI::ChangeWidget( `hostname, `Value, uri_parts[1]:"" );
- if( "" != uri_parts[2]:"" )
- { if( issubstring( uri_parts[2]:"", "=" ) )
- { UI::ChangeWidget( `port_or_queue, `Value, "" );
- UI::ChangeWidget( `uri_options, `Value, uri_parts[2]:"" );
- }
- else
- { UI::ChangeWidget( `port_or_queue, `Value, uri_parts[2]:"" );
- if( issubstring( uri_parts[3]:"", "=" ) )
- { UI::ChangeWidget( `uri_options, `Value, uri_parts[3]:"" );
- }
- }
- }
- }
}
else if( "lpd:/" == substring( current_device_uri, 0, size( "lpd:/" ) ) )
{ // It is not possible to distinguish if a current_device_uri
@@ -1210,22 +1623,6 @@
{ UI::ChangeWidget( `tree_selection, `CurrentItem, `lpd );
changeSettingsDialog( `lpd );
}
- // The Device URI has the form ([...[...]...] are optional parts):
- // lpd://ip-address-or-hostname/queue[?option1=value1[&option2=value2...[&optionN=valueN]...]]
- list<string> uri_parts = splitstring( current_device_uri, ":/?" );
- // Remove empty parts (e.g. lpd://server results ["lpd","","","server"]):
- uri_parts = filter( string part, uri_parts, { return ( "" != part ); } );
- y2milestone( "ConnectionWizardDialog uri_parts = '%1'", uri_parts );
- // Note that uri_parts[0] = "lpd".
- if( "" != uri_parts[1]:"" )
- { UI::ChangeWidget( `hostname, `Value, uri_parts[1]:"" );
- if( "" != uri_parts[2]:"" )
- { UI::ChangeWidget( `port_or_queue, `Value, uri_parts[2]:"" );
- if( "" != uri_parts[3]:"" )
- { UI::ChangeWidget( `uri_options, `Value, uri_parts[3]:"" );
- }
- }
- }
}
else if( "ipp:/" == substring( current_device_uri, 0, size( "ipp:/" ) )
|| "http:/" == substring( current_device_uri, 0, size( "http:/" ) )
@@ -1237,142 +1634,27 @@
if( issubstring( current_device_uri, "/printers/" ) )
{ UI::ChangeWidget( `tree_selection, `CurrentItem, `cups );
changeSettingsDialog( `cups );
- // The Device URI has the form ({either|or} and [...[...]...] are optional parts):
- // {ipp|http}://ip-address-or-hostname[:port-number]/resource[?option1=value1...[&optionN=valueN]...]
- // where resource is something like /printers/queue on a CUPS server (see above).
- // Here ':' is no delimiter so that ip-address-or-hostname:port-number is one part
- list<string> uri_parts = splitstring( current_device_uri, "/?" );
- // Remove empty parts (e.g. ipp://server results ["ipp:","","server"]):
- uri_parts = filter( string part, uri_parts, { return ( "" != part ); } );
- y2milestone( "ConnectionWizardDialog uri_parts = '%1'", uri_parts );
- // Note that uri_parts[0] = "{ipp:|http:}".
- if( "" != uri_parts[1]:"" )
- { UI::ChangeWidget( `hostname, `Value, uri_parts[1]:"" );
- if( "printers" == uri_parts[2]:"" )
- { if( "" != uri_parts[3]:"" )
- { UI::ChangeWidget( `queue, `Value, uri_parts[3]:"" );
- if( issubstring( uri_parts[4]:"", "=" ) )
- { UI::ChangeWidget( `uri_options, `Value, uri_parts[4]:"" );
- }
- }
- }
- }
}
else
{ UI::ChangeWidget( `tree_selection, `CurrentItem, `ipp );
changeSettingsDialog( `ipp );
- // The Device URI has the form ({either|or} and [...[...]...] are optional parts):
- // {ipp|http}://ip-address-or-hostname[:port-number]/resource[?option1=value1...[&optionN=valueN]...]
- UI::ChangeWidget( `uri, `Value, current_device_uri );
}
}
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.
@@ -1423,19 +1705,18 @@
{ Popup::Error( _("The 'mark' parity checking is only supported with 7 data bits and 1 stop bit.") );
}
else
- { connection_uri = "serial:" + URIpercentEncoding( serial_device_node )
- + "?baud=" + URIpercentEncoding( serial_baud_rate );
+ { connection_uri = "serial:" + serial_device_node + "?baud=" + serial_baud_rate;
if( size( serial_data_bits ) > 0 )
- { connection_uri = connection_uri + "+bits=" + URIpercentEncoding( serial_data_bits );
+ { connection_uri = connection_uri + "+bits=" + serial_data_bits;
}
if( size( serial_parity ) > 0 )
- { connection_uri = connection_uri + "+parity=" + URIpercentEncoding( serial_parity );
+ { connection_uri = connection_uri + "+parity=" + serial_parity;
}
if( size( serial_flow_control ) > 0 )
- { connection_uri = connection_uri + "+flow=" + URIpercentEncoding( serial_flow_control );
+ { connection_uri = connection_uri + "+flow=" + serial_flow_control;
}
if( size( serial_stop_bits ) > 0 )
- { connection_uri = connection_uri + "+stop=" + URIpercentEncoding( serial_stop_bits );
+ { connection_uri = connection_uri + "+stop=" + serial_stop_bits;
}
valid = true;
}
@@ -1448,7 +1729,7 @@
{ Popup::Error( _("Bluetooth device ID could not be empty.") );
}
else
- { connection_uri = "bluetooth://" + URIpercentEncoding( bluetooth_device_id );
+ { connection_uri = "bluetooth://" + bluetooth_device_id;
valid = true;
}
break;
@@ -1458,7 +1739,10 @@
{ Popup::Error( _("SCSI generic device could not be empty.") );
}
else
- { connection_uri = "scsi:" + URIpercentEncoding( scsi_device_node );
+ { // It would be wrong to do URIpercentEncoding(scsi_device_node)
+ // because scsi_device_node is e.g. '/dev/sg1' which must stay as is
+ // to result a valid 'scsi' URI like 'scsi:/dev/sg1':
+ connection_uri = "scsi:" + scsi_device_node;
valid = true;
}
break;
@@ -1722,6 +2006,7 @@
void scanForServers( symbol selected, boolean all )
{ list<string> hosts = [];
+ string current_host = (string)UI::QueryWidget( `hostname, `Value );
if( all )
{ y2milestone( "scanForServers 'all'" );
Popup::ShowFeedback( // Title for a Popup::ShowFeedback:
@@ -1809,9 +2094,13 @@
{ Popup::Message( // Popup::Message when scanning for hosts in the network did not find any host.
_("Scanning in the network did not find any host.\n(Network issue or firewall active?)")
);
- UI::ChangeWidget( `hostname, `Value, "" );
+ hosts = [ current_host ];
+ }
+ if( ! contains( hosts, current_host ) )
+ { hosts = prepend( hosts, current_host );
}
UI::ChangeWidget( `hostname, `Items, hosts );
+ UI::ChangeWidget( `hostname, `Value, current_host );
}
boolean testQueue( symbol selected )
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
Author: mzugec
Date: Tue Dec 1 14:10:42 2009
New Revision: 59880
URL: http://svn.opensuse.org/viewcvs/yast?rev=59880&view=rev
Log:
Created tag stable-2_19_1 for s390
Added:
tags/stable-2_19_1/s390/
- copied from r59879, trunk/s390/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0