Ticket #7907: AboutSystem_hypertext_MIT_and_LGPL.patch

File AboutSystem_hypertext_MIT_and_LGPL.patch, 2.6 KB (added by taos, 13 years ago)

Adds hypertext functionality for LGPL license.

  • src/apps/aboutsystem/AboutSystem.cpp

     
    12251225
    12261226    BPath mitPath;
    12271227    _GetLicensePath("MIT", mitPath);
     1228    BPath lgplPath;
     1229    _GetLicensePath("GNU LGPL v2.1", lgplPath); //TODO: Choose "the" LGPL license
    12281230
    12291231    font.SetSize(be_bold_font->Size() + 4);
    12301232    font.SetFace(B_BOLD_FACE);
     
    12361238        "respective license.]\n\n"));
    12371239
    12381240    // Haiku license
    1239     BString haikuLicense = B_TRANSLATE_COMMENT("The code that is unique to Haiku, "
    1240         "especially the kernel and all code that applications may link "
    1241         "against, is distributed under the terms of the %MIT license%. "
     1241    BString haikuLicense = B_TRANSLATE_COMMENT("The code that is unique to "
     1242        "Haiku, especially the kernel and all code that applications may link "
     1243        "against, is distributed under the terms of the <MIT license>. "
    12421244        "Some system libraries contain third party code distributed under the "
    1243         "LGPL license. You can find the copyrights to third party code below.\n"
    1244         "\n", "%MIT license% isn't a variable and has to be translated.");
    1245     int32 licensePart1 = haikuLicense.FindFirst("%");
    1246     int32 licensePart2 = haikuLicense.FindLast("%");
     1245        "<LGPL license>. You can find the copyrights to third party code below."
     1246        "\n\n", "<MIT license> and <LGPL license> aren't variables and can be "
     1247        "translated. However, please, don't remove < and > as they're needed "
     1248        "as placeholders for proper hypertext functionality.");
     1249    int32 licensePart1 = haikuLicense.FindFirst("<");
     1250    int32 licensePart2 = haikuLicense.FindFirst(">");
     1251    int32 licensePart3 = haikuLicense.FindLast("<");
     1252    int32 licensePart4 = haikuLicense.FindLast(">");
    12471253    BString part;
    12481254    haikuLicense.CopyInto(part, 0, licensePart1);
    12491255    fCreditsView->Insert(part);
     
    12541260    fCreditsView->InsertHyperText(part, new OpenFileAction(mitPath.Path()));
    12551261
    12561262    part.Truncate(0);
    1257     haikuLicense.CopyInto(part, licensePart2 + 1, haikuLicense.Length() - 1
     1263    haikuLicense.CopyInto(part, licensePart2 + 1, licensePart3 - 1
    12581264        - licensePart2);
    12591265    fCreditsView->Insert(part);
     1266   
     1267    part.Truncate(0);
     1268    haikuLicense.CopyInto(part, licensePart3 + 1, licensePart4 - 1
     1269        - licensePart3);
     1270    fCreditsView->InsertHyperText(part, new OpenFileAction(lgplPath.Path()));
    12601271
     1272    part.Truncate(0);
     1273    haikuLicense.CopyInto(part, licensePart4 + 1, haikuLicense.Length() - 1
     1274        - licensePart4);
     1275    fCreditsView->Insert(part);
     1276
    12611277    // GNU copyrights
    12621278    AddCopyrightEntry("The GNU Project",
    12631279        B_TRANSLATE("Contains software from the GNU Project, "