Commit 5aa78d68 authored by AlmAck's avatar AlmAck

Merge branch 'replace'

parents 37b839a6 97d4416d
......@@ -92,6 +92,6 @@ enum OperationName {
PrintFiles
};
typedef enum OperationName OperationName;
};
}
#endif
\ No newline at end of file
#endif
......@@ -377,13 +377,14 @@ int main(int argc, char **argv)
QByteArray("0.0.1"),
QObject::tr("Chakra's CLI package manager"),
AkabeiLicense::License_GPL_V2,
QObject::tr("(C) 2011 - 2015 The Akabei Developers"),
QObject::tr("<a href=\"mailto:boom1992@chakra-project.org\">boom1992@chakra-project.org</a>"),
"http://chakraos.org",
"http://chakraos.org/bugtracker/"
QObject::tr("(C) 2011 - 2016 The Akabei Developers"),
QObject::tr("<a href=\"mailto:boom1992@chakraos.org\">boom1992@chakraos.org</a>"),
"https://chakraos.org",
"https://chakraos.org/bugtracker/"
);
aboutData.addAuthor("Lukas Appelhans", QObject::tr("Maintainer"), "boom1992@chakra-project.org");
aboutData.addAuthor("Lisa Vitolo", QObject::tr("Maintainer"), "shainer@chakra-project.org");
aboutData.addAuthor("Lukas Appelhans", QObject::tr("Maintainer"), "boom1992@chakraos.org");
aboutData.addAuthor("Luca Giambonini", QObject::tr("Maintainer"), "almack@chakraos.org");
aboutData.addAuthor("Lisa Vitolo", QObject::tr("Contributor"), "");
CommandLineParser *parser = NULL;
QTextStream err(stderr);
......
......@@ -366,13 +366,15 @@ void QueryOperation::showOwner(const QStringList &queries)
foreach (const QString& query, queries) {
QString cleaned = QFileInfo(query).canonicalFilePath();
if (cleaned.isEmpty()) {
err << Akabei::errorPrefix << QObject::tr("File does not exists: %1").arg(query) << endl;
err << Akabei::errorPrefix << QObject::tr("File does not exist: %1").arg(query) << endl;
err.flush();
nextOperation();
return;
}
cleaned.remove(Akabei::Config::instance()->root());
// remove the first "/" (current root)
cleaned.remove(0,1);
//TODO: bash completition
qDebug() << "Cleaned is" << cleaned;
Akabei::Package::List result =
......
......@@ -179,7 +179,7 @@ void QueueOperation::transactionCreated(AkabeiClient::Transaction* t)
}
if (t->isValid()) {
out << QObject::tr("Validating transaction...") << "\r";
out << QObject::tr("Validating transaction...") << "\n";
AkabeiClient::Backend::instance()->transactionHandler()->validate();
} else {
err << Akabei::errorPrefix << QObject::tr("Invalid transaction, quitting...") << endl;
......@@ -270,7 +270,7 @@ void QueueOperation::validationFinished(bool valid)
installSize -= i->installedSize();
}
if (!m_transaction->toBeRemoved().isEmpty()) {
out << QObject::tr("The following packages are going to be removed: ");
out << '\n' << QObject::tr("The following packages are going to be removed:") << '\n';
foreach (Akabei::Package * pkg, m_transaction->toBeRemoved()) {
if (pkg != *(m_transaction->toBeRemoved().begin()))
out << QObject::tr(", ");
......@@ -279,7 +279,7 @@ void QueueOperation::validationFinished(bool valid)
out << endl;
}
if (!m_transaction->toBeInstalled().isEmpty()) {
out << QObject::tr("The following packages are going to be installed: ");
out << '\n' << QObject::tr("The following packages are going to be installed:") << '\n';
foreach (Akabei::Package * pkg, m_transaction->toBeInstalled()) {
if (pkg != *(m_transaction->toBeInstalled().begin()))
out << QObject::tr(", ");
......@@ -288,7 +288,7 @@ void QueueOperation::validationFinished(bool valid)
out << endl;
}
if (!m_transaction->toBeUpgraded().isEmpty()) {
out << QObject::tr("The following packages are going to be upgraded: ");
out << '\n' << QObject::tr("The following packages are going to be upgraded:") << '\n';
foreach (Akabei::Package* old, m_transaction->toBeUpgraded().keys()) {
if (old != *(m_transaction->toBeUpgraded().keys().begin()))
out << QObject::tr(", ");
......@@ -298,7 +298,7 @@ void QueueOperation::validationFinished(bool valid)
out << endl;
}
if (!m_transaction->toBeReinstalled().isEmpty()) {
out << QObject::tr("The following packages are going to be reinstalled: ");
out << '\n' << QObject::tr("The following packages are going to be reinstalled:") << '\n';
foreach (Akabei::Package * pkg, m_transaction->toBeReinstalled()) {
if (pkg != *(m_transaction->toBeReinstalled().begin()))
out << QObject::tr(", ");
......@@ -306,6 +306,19 @@ void QueueOperation::validationFinished(bool valid)
}
out << endl;
}
if (!m_transaction->toBeReplaced().isEmpty()) {
out << '\n' << QObject::tr("The following packages are going to be replaced:") << '\n';
foreach (Akabei::Package* pkg, m_transaction->toBeReplaced().keys()) {
QList<Akabei::Package*> older = m_transaction->toBeReplaced().value(pkg);
out << pkg->name() << " -> (";
foreach(Akabei::Package* replaced, older){
out << replaced->name();
out << QObject::tr(", ");
}
out << ")";
}
out << endl;
}
out << endl;
if (downloadSize > 0) {
out << QObject::tr("Download size: %1").arg(Akabei::Helpers::formatByteSize(downloadSize)) << endl;
......@@ -316,7 +329,7 @@ void QueueOperation::validationFinished(bool valid)
out << QObject::tr("Freed size after transaction: %1").arg(Akabei::Helpers::formatByteSize(installSize * (-1))) << endl;
}
out << QObject::tr("Continue with processing?[Y/n]");
out << QObject::tr("Continue with processing? [Y/n]");
out.flush();
if (!m_options.contains(APM::NoConfirm)) {
std::string input;
......
FILE(GLOB_RECURSE PO_FILES *.po)
FIND_PROGRAM(PO2TS_EXECUTABLE
NAMES po2ts
)
IF(NOT PO2TS_EXECUTABLE)
MESSAGE(FATAL_ERROR "Unable to find the ‘po2ts’ executable, from the Translation Toolkit project.")
ENDIF(NOT PO2TS_EXECUTABLE)
add_translations(akabei ${PO_FILES})
FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
NAMES lrelease
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
IF(NOT QT_LRELEASE_EXECUTABLE)
MESSAGE(FATAL_ERROR "Qt4 lrelease not found. Make sure that it has been built and installed by the Qt4 package.")
ENDIF(NOT QT_LRELEASE_EXECUTABLE)
MACRO(GENERATE_TS_FILES_FROM_PO_FILES TS_FILES)
FOREACH(CURRENT_FILE ${ARGN})
GET_FILENAME_COMPONENT(PO_FILE ${CURRENT_FILE} ABSOLUTE)
GET_FILENAME_COMPONENT(PO_FILE_NAME ${CURRENT_FILE} NAME_WE)
SET(TS_FILE ${CMAKE_CURRENT_BINARY_DIR}/akabei_${PO_FILE_NAME}.ts)
ADD_CUSTOM_COMMAND(
OUTPUT ${TS_FILE}
COMMAND ${PO2TS_EXECUTABLE}
ARGS ${PO_FILE} ${TS_FILE}
DEPENDS ${PO_FILE}
)
SET(${TS_FILES} ${${TS_FILES}} ${TS_FILE})
ENDFOREACH(CURRENT_FILE)
ENDMACRO(GENERATE_TS_FILES_FROM_PO_FILES)
MACRO(GENERATE_QM_FILES_FROM_TS_FILES _sources)
FOREACH(_current_FILE ${ARGN})
GET_FILENAME_COMPONENT(_in ${_current_FILE} ABSOLUTE)
GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME_WE)
SET(_out ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.qm)
ADD_CUSTOM_COMMAND(
OUTPUT ${_out}
COMMAND ${QT_LRELEASE_EXECUTABLE}
ARGS -verbose ${_in} -qm ${_out}
DEPENDS ${_in}
)
SET(${_sources} ${${_sources}} ${_out})
ENDFOREACH(_current_FILE)
ENDMACRO(GENERATE_QM_FILES_FROM_TS_FILES)
FILE(GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
GENERATE_TS_FILES_FROM_PO_FILES(TS_FILES ${PO_FILES})
GENERATE_QM_FILES_FROM_TS_FILES(QM_FILES ${TS_FILES})
ADD_CUSTOM_TARGET(translations ALL DEPENDS ${QM_FILES})
INSTALL(CODE "MESSAGE(\"Installing Akabei i18n files...\")")
INSTALL(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/akabe/translations)
This diff is collapsed.
......@@ -2,7 +2,7 @@
#
# Execute this script whenever you change, add or remove translatable strings in your code.
#
# For help, see http://chakra-linux.org/wiki/index.php?title=Transifex
# For help, see https://chakraos.org/wiki/index.php?title=Transifex
translationsFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
rootDir=$translationsFolder/..
......
......@@ -65,8 +65,8 @@ void printPackageInformation(Akabei::Package * p, QTextStream &out, bool showLes
if (!showLess) {
out << "\t" << qSetFieldWidth(n) << fields["Description:"] << qSetFieldWidth(0) << p->description() << endl;
out << "\t" << qSetFieldWidth(n) << fields["Installation size:"] << qSetFieldWidth(0) << Akabei::Helpers::formatByteSize(p->size());
out << "\t" << qSetFieldWidth(0) << fields["Architecture:"] << " " << p->arch() << endl;
out << "\t" << qSetFieldWidth(n) << fields["Installation size:"] << qSetFieldWidth(0) << Akabei::Helpers::formatByteSize(p->size()) << endl;
out << "\t" << qSetFieldWidth(n) << fields["Architecture:"] << qSetFieldWidth(0) << p->arch() << endl;
out << "\t" << qSetFieldWidth(n) << fields["Homepage:"] << qSetFieldWidth(0) << p->url().toString() << endl;
out << "\t" << qSetFieldWidth(n) << fields["Licenses:"] << qSetFieldWidth(0) << (p->licenses().isEmpty() ? QObject::tr("None") : p->licenses().join(" ")) << endl;
out << "\t" << qSetFieldWidth(n) << fields["Depends on:"] << qSetFieldWidth(0) << (p->dependencies().isEmpty() ? QObject::tr("None") : p->dependencies().join(" ")) << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment