|
|
|
@ -80,14 +80,14 @@ static TQString open_html_head(const TQString& title, bool links, AptProtocol co
|
|
|
|
|
if (links) rowspan = "rowspan=\"2\"";
|
|
|
|
|
TQString ret =
|
|
|
|
|
html_head
|
|
|
|
|
.tqarg(config.stylesheet())
|
|
|
|
|
.tqarg(title)
|
|
|
|
|
.arg(config.stylesheet())
|
|
|
|
|
.arg(title)
|
|
|
|
|
+ html_head_table
|
|
|
|
|
.tqarg(config.header_background())
|
|
|
|
|
.tqarg(rowspan)
|
|
|
|
|
.tqarg(config.logo())
|
|
|
|
|
.tqarg(config.logo_alt())
|
|
|
|
|
.tqarg(title);
|
|
|
|
|
.arg(config.header_background())
|
|
|
|
|
.arg(rowspan)
|
|
|
|
|
.arg(config.logo())
|
|
|
|
|
.arg(config.logo_alt())
|
|
|
|
|
.arg(title);
|
|
|
|
|
|
|
|
|
|
if (links)
|
|
|
|
|
{
|
|
|
|
@ -106,7 +106,7 @@ static TQString open_html_head(const TQString& title, bool links, AptProtocol co
|
|
|
|
|
static TQString add_html_head_link(const TQString& url, const TQString& name, const TQString& long_desc)
|
|
|
|
|
{
|
|
|
|
|
static const TQString format("\t\t<td><a href=\"%1\" title=\"%2\">%3</a></td>\n");
|
|
|
|
|
return format.tqarg(url).tqarg(long_desc).tqarg(name);
|
|
|
|
|
return format.arg(url).arg(long_desc).arg(name);
|
|
|
|
|
}
|
|
|
|
|
static TQString close_html_head()
|
|
|
|
|
{
|
|
|
|
@ -132,8 +132,8 @@ TQString AptProtocol::make_html_tail(const TQString& note, bool with_form)
|
|
|
|
|
ret = "<hr>\n" + make_html_form();
|
|
|
|
|
|
|
|
|
|
if (!note.isEmpty())
|
|
|
|
|
ret += html_tail.tqarg(note + ". " + i18n("Page generated by kio_apt."));
|
|
|
|
|
else ret += html_tail.tqarg(i18n("Page generated by kio_apt."));
|
|
|
|
|
ret += html_tail.arg(note + ". " + i18n("Page generated by kio_apt."));
|
|
|
|
|
else ret += html_tail.arg(i18n("Page generated by kio_apt."));
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
@ -159,7 +159,7 @@ static const TQString
|
|
|
|
|
"</tr>\n");
|
|
|
|
|
|
|
|
|
|
static TQString make_html_form_line(const TQString& type, const TQString& label)
|
|
|
|
|
{ return html_form_line.tqarg(type).tqarg(label).tqarg(type).tqarg(type); }
|
|
|
|
|
{ return html_form_line.arg(type).arg(label).arg(type).arg(type); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static TQString make_extform_cmd(bool ext_form, const KURL& query)
|
|
|
|
@ -206,7 +206,7 @@ TQString AptProtocol::make_html_form() const
|
|
|
|
|
stream << make_html_form_line("fsearch", i18n("File search"));
|
|
|
|
|
stream << make_html_form_line("show", i18n("Package info"));
|
|
|
|
|
}
|
|
|
|
|
stream << html_form_end.tqarg( i18n("Search") );
|
|
|
|
|
stream << html_form_end.arg( i18n("Search") );
|
|
|
|
|
|
|
|
|
|
if (online)
|
|
|
|
|
{
|
|
|
|
@ -293,7 +293,7 @@ bool AptProtocol::check_validpackage(const TQString& query)
|
|
|
|
|
static TQRegExp rx_pkgname(rxs_pkgname);
|
|
|
|
|
if (!rx_pkgname.exactMatch(query))
|
|
|
|
|
{
|
|
|
|
|
error( ERR_SLAVE_DEFINED, i18n("\"%1\" is not a valid package name").tqarg(query) );
|
|
|
|
|
error( ERR_SLAVE_DEFINED, i18n("\"%1\" is not a valid package name").arg(query) );
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
@ -487,18 +487,18 @@ void AptProtocol::search( const TQString& query, const QueryOptions& /*options*/
|
|
|
|
|
{
|
|
|
|
|
mimeType("text/html");
|
|
|
|
|
|
|
|
|
|
data(open_html_head(i18n("Package search result for \"%1\"").tqarg(query), false, *this));
|
|
|
|
|
data(open_html_head(i18n("Package search result for \"%1\"").arg(query), false, *this));
|
|
|
|
|
|
|
|
|
|
m_parser.reset(new Parsers::Search);
|
|
|
|
|
(*m_parser)(this, "begin", query);
|
|
|
|
|
if (!m_process.search( query ))
|
|
|
|
|
{
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Error launching the search").tqarg(query));
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Error launching the search").arg(query));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
(*m_parser)(this, "end", TQString());
|
|
|
|
|
|
|
|
|
|
data(make_html_tail( i18n("%1 results").tqarg(m_parser -> result_count())) );
|
|
|
|
|
data(make_html_tail( i18n("%1 results").arg(m_parser -> result_count())) );
|
|
|
|
|
data(TQByteArray());
|
|
|
|
|
finished();
|
|
|
|
|
}
|
|
|
|
@ -554,7 +554,7 @@ void AptProtocol::show(const TQString& package, const QueryOptions& options)
|
|
|
|
|
{
|
|
|
|
|
if (!m_process.policy( package ))
|
|
|
|
|
{
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache policy %1\"").tqarg(package));
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache policy %1\"").arg(package));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -565,13 +565,13 @@ void AptProtocol::show(const TQString& package, const QueryOptions& options)
|
|
|
|
|
if (can_list)
|
|
|
|
|
{
|
|
|
|
|
KURL url = buildURL("list", package);
|
|
|
|
|
s << open_html_head(i18n("Package description for \"%1\"").tqarg(package), true, *this)
|
|
|
|
|
s << open_html_head(i18n("Package description for \"%1\"").arg(package), true, *this)
|
|
|
|
|
<< add_html_head_link(url.htmlURL(), i18n("List package files"), "")
|
|
|
|
|
<< close_html_head();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
s << open_html_head(i18n("Package description for \"%1\"").tqarg(package), false, *this);
|
|
|
|
|
s << open_html_head(i18n("Package description for \"%1\"").arg(package), false, *this);
|
|
|
|
|
}
|
|
|
|
|
data(buffer);
|
|
|
|
|
}
|
|
|
|
@ -584,12 +584,12 @@ void AptProtocol::show(const TQString& package, const QueryOptions& options)
|
|
|
|
|
{
|
|
|
|
|
if (!m_process.show(package))
|
|
|
|
|
{
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache show %1\"").tqarg(package));
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache show %1\"").arg(package));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!m_parser -> result_count())
|
|
|
|
|
{
|
|
|
|
|
data("<div class=\"error\">" + i18n("No package found named \"%1\"").tqarg(package) + "</div>\n");
|
|
|
|
|
data("<div class=\"error\">" + i18n("No package found named \"%1\"").arg(package) + "</div>\n");
|
|
|
|
|
data(make_html_tail());
|
|
|
|
|
data(TQByteArray());
|
|
|
|
|
finished();
|
|
|
|
@ -615,7 +615,7 @@ void AptProtocol::show(const TQString& package, const QueryOptions& options)
|
|
|
|
|
(*m_parser)(this, "begin", TQString());
|
|
|
|
|
if (!m_adept_batch -> list(package))
|
|
|
|
|
{
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Error listing files of %1").tqarg(package));
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Error listing files of %1").arg(package));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
(*m_parser)(this, "end", TQString());
|
|
|
|
@ -654,13 +654,13 @@ void AptProtocol::policy( const TQString& query, const QueryOptions& /*options*/
|
|
|
|
|
|
|
|
|
|
mimeType("text/html");
|
|
|
|
|
|
|
|
|
|
data( open_html_head(i18n("Apt policy for \"%1\"").tqarg(query), false, *this) );
|
|
|
|
|
data( open_html_head(i18n("Apt policy for \"%1\"").arg(query), false, *this) );
|
|
|
|
|
|
|
|
|
|
m_parser.reset(new Parsers::Policy(query, m_act));
|
|
|
|
|
(*m_parser)(this, "begin", TQString());
|
|
|
|
|
if (!m_process.policy( query ))
|
|
|
|
|
{
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Can't launch the policy for %1").tqarg(query));
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Can't launch the policy for %1").arg(query));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
(*m_parser)(this, "end", TQString());
|
|
|
|
@ -693,18 +693,18 @@ void AptProtocol::searchfile(const TQString& query, const QueryOptions& /*option
|
|
|
|
|
if (!can_searchfile(true)) return;
|
|
|
|
|
|
|
|
|
|
mimeType("text/html");
|
|
|
|
|
data( open_html_head(i18n("File search for \"%1\"").tqarg(query), false, *this) + html_dpkgs_begin );
|
|
|
|
|
data( open_html_head(i18n("File search for \"%1\"").arg(query), false, *this) + html_dpkgs_begin );
|
|
|
|
|
|
|
|
|
|
m_parser.reset(new Parsers::FileSearch);
|
|
|
|
|
(*m_parser)(this, "begin", TQString());
|
|
|
|
|
if (!m_adept_batch -> search( query ))
|
|
|
|
|
{
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Can't launch the package manager").tqarg(query));
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Can't launch the package manager").arg(query));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
(*m_parser)(this, "end", TQString());
|
|
|
|
|
|
|
|
|
|
data( html_dpkgs_end + make_html_tail(i18n("%1 files found").tqarg(m_parser -> result_count())) );
|
|
|
|
|
data( html_dpkgs_end + make_html_tail(i18n("%1 files found").arg(m_parser -> result_count())) );
|
|
|
|
|
data(TQByteArray());
|
|
|
|
|
finished();
|
|
|
|
|
}
|
|
|
|
@ -736,7 +736,7 @@ void AptProtocol::listfiles(const TQString& query, const QueryOptions& /*options
|
|
|
|
|
TQString buffer;
|
|
|
|
|
TQTextOStream stream(&buffer);
|
|
|
|
|
stream
|
|
|
|
|
<< open_html_head(i18n("Files in \"%1\"").tqarg(query), true, *this)
|
|
|
|
|
<< open_html_head(i18n("Files in \"%1\"").arg(query), true, *this)
|
|
|
|
|
<< add_html_head_link(ret_url.htmlURL(), i18n("Show package info"), "")
|
|
|
|
|
<< close_html_head()
|
|
|
|
|
<< endl;
|
|
|
|
@ -746,7 +746,7 @@ void AptProtocol::listfiles(const TQString& query, const QueryOptions& /*options
|
|
|
|
|
(*m_parser)(this, "begin", TQString());
|
|
|
|
|
if (!m_adept_batch -> list( query ))
|
|
|
|
|
{
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Can't launch the package manager").tqarg(query));
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Can't launch the package manager").arg(query));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
(*m_parser)(this, "end", TQString());
|
|
|
|
@ -818,16 +818,16 @@ void AptProtocol::adept_batch(const TQString& query, const QueryOptions& options
|
|
|
|
|
if (pcount == 1)
|
|
|
|
|
{
|
|
|
|
|
if (query == "install")
|
|
|
|
|
ip = SlaveBase::messageBox(QuestionYesNo, i18n("Do you want to install %1 ?").tqarg(plist[0]), i18n("Package Installation"));
|
|
|
|
|
ip = SlaveBase::messageBox(QuestionYesNo, i18n("Do you want to install %1 ?").arg(plist[0]), i18n("Package Installation"));
|
|
|
|
|
else
|
|
|
|
|
ip = SlaveBase::messageBox(QuestionYesNo, i18n("Do you want to remove %1 ?").tqarg(plist[0]), i18n("Package Removal"));
|
|
|
|
|
ip = SlaveBase::messageBox(QuestionYesNo, i18n("Do you want to remove %1 ?").arg(plist[0]), i18n("Package Removal"));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (query == "install")
|
|
|
|
|
ip = SlaveBase::messageBox(QuestionYesNo,i18n("Do you want to install the following %1 packages ?\n%2").tqarg(pcount).tqarg(options["package"]));
|
|
|
|
|
ip = SlaveBase::messageBox(QuestionYesNo,i18n("Do you want to install the following %1 packages ?\n%2").arg(pcount).arg(options["package"]));
|
|
|
|
|
else
|
|
|
|
|
ip = SlaveBase::messageBox(QuestionYesNo,i18n("Do you want to remove the following %1 packages ?\n").tqarg(pcount).tqarg(options["package"]));
|
|
|
|
|
ip = SlaveBase::messageBox(QuestionYesNo,i18n("Do you want to remove the following %1 packages ?\n").arg(pcount).arg(options["package"]));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
kdDebug(DEBUG_ZONE) << command << endl;
|
|
|
|
@ -849,7 +849,7 @@ void AptProtocol::adept_batch(const TQString& query, const QueryOptions& options
|
|
|
|
|
{
|
|
|
|
|
if (!m_process.policy( plist[i] ))
|
|
|
|
|
{
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache policy %1\"").tqarg(plist[i]));
|
|
|
|
|
error(ERR_SLAVE_DEFINED, i18n("Can't launch \"apt-cache policy %1\"").arg(plist[i]));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -874,7 +874,7 @@ void AptProtocol::adept_batch(const TQString& query, const QueryOptions& options
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
TQString toto = puninst.join(" ");
|
|
|
|
|
messageBox(Information,i18n("There was a problem installing %1.").tqarg(toto));
|
|
|
|
|
messageBox(Information,i18n("There was a problem installing %1.").arg(toto));
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|