~ubuntu-branches/debian/stretch/apper/stretch

« back to all changes in this revision

Viewing changes to libapper/PkStrings.cpp

  • Committer: Package Import Robot
  • Author(s): Matthias Klumpp
  • Date: 2013-07-30 12:34:46 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130730123446-cgzujaj03pc61drn
Tags: 0.8.1-1
* New upstream release: 0.8.1
* Depend on software-properties-kde instead of suggesting it (Closes: #696583)
* Add patch to make AppStream loading more failsafe

Show diffs side-by-side

added added

removed removed

Lines of Context:
180
180
    }
181
181
}
182
182
 
183
 
QString PkStrings::action(int role)
 
183
QString PkStrings::action(int role, Transaction::TransactionFlags flags)
184
184
{
185
185
    Transaction::Role roleEnum = static_cast<Transaction::Role>(role);
186
186
    switch (roleEnum) {
205
205
    case Transaction::RoleSearchName :
206
206
        return i18nc("The role of the transaction, in present tense", "Searching by package name");
207
207
    case Transaction::RoleRemovePackages :
 
208
        if (flags & Transaction::TransactionFlagSimulate) {
 
209
            return i18nc("The role of the transaction, in present tense", "Simulating removal");
 
210
        } else if (flags & Transaction::TransactionFlagOnlyDownload) {
 
211
            return i18nc("The role of the transaction, in present tense", "Downloading packages");
 
212
        }
208
213
        return i18nc("The role of the transaction, in present tense", "Removing");
209
214
    case Transaction::RoleInstallPackages :
 
215
        if (flags & Transaction::TransactionFlagSimulate) {
 
216
            return i18nc("The role of the transaction, in present tense", "Simulating install");
 
217
        } else if (flags & Transaction::TransactionFlagOnlyDownload) {
 
218
            return i18nc("The role of the transaction, in present tense", "Downloading packages");
 
219
        }
210
220
        return i18nc("The role of the transaction, in present tense", "Installing");
211
221
    case Transaction::RoleInstallFiles :
 
222
        if (flags & Transaction::TransactionFlagSimulate) {
 
223
            return i18nc("The role of the transaction, in present tense", "Simulating file install");
 
224
        } else if (flags & Transaction::TransactionFlagOnlyDownload) {
 
225
            return i18nc("The role of the transaction, in present tense", "Downloading required packages");
 
226
        }
212
227
        return i18nc("The role of the transaction, in present tense", "Installing file");
213
228
    case Transaction::RoleRefreshCache :
214
229
        return i18nc("The role of the transaction, in present tense", "Refreshing package cache");
215
230
    case Transaction::RoleUpdatePackages :
 
231
        if (flags & Transaction::TransactionFlagSimulate) {
 
232
            return i18nc("The role of the transaction, in present tense", "Simulating update");
 
233
        } else if (flags & Transaction::TransactionFlagOnlyDownload) {
 
234
            return i18nc("The role of the transaction, in present tense", "Downloading updates");
 
235
        }
216
236
        return i18nc("The role of the transaction, in present tense", "Updating packages");
217
237
    case Transaction::RoleCancel :
218
238
        return i18nc("The role of the transaction, in present tense", "Canceling");
961
981
    return QString();
962
982
}
963
983
 
964
 
QString PkStrings::daemonError(Transaction::InternalError value)
 
984
QString PkStrings::daemonError(int value)
965
985
{
966
 
    switch (value) {
 
986
    Transaction::InternalError statusEnum = static_cast<Transaction::InternalError>(value);
 
987
    switch (statusEnum) {
967
988
    case Transaction::InternalErrorFailedAuth :
968
989
        return i18n("You do not have the necessary privileges to perform this action.");
969
990
    case Transaction::InternalErrorNoTid :
982
1003
        return i18n("This function is not yet supported.");
983
1004
    case Transaction::InternalErrorDaemonUnreachable :
984
1005
        return i18n("Could not talk to packagekitd.");
 
1006
    case Transaction::InternalErrorFailed:
 
1007
        return i18n("Error talking to packagekitd.");
985
1008
    case Transaction::InternalErrorNone:
986
 
    case Transaction::InternalErrorFailed :
987
1009
    case Transaction::InternalErrorUnkown :
988
1010
        return i18n("An unknown error happened.");
989
1011
    }