Credits in Options --> About are now read directly from the CREDITS file,

eliminating duplication
This commit is contained in:
fgerlits 2007-02-14 19:52:51 +00:00
parent 2dbb3b8d9e
commit b8629bf171
5 changed files with 60 additions and 21 deletions

View File

@ -3,7 +3,12 @@ CREDITS
=======
For Campcaster, see http://campcaster.campware.org
The original Campcaster (LiveSupport) concept was drafted by Micz Flor. It was fully developed by Robert Klajn, Douglas Arellanes, Ákos Maróy, and Sava Tatić. The user interface has been designed by Charles Truett, based on the initial work done by a team of his then-fellow Parsons School of Design students Turi McKinley, Catalin Lazia and Sangita Shah. The team was led by then-head of the school's Department of Digital Design Colleen Macklin, assisted by Kunal Jain.
The original Campcaster (LiveSupport) concept was drafted by Micz Flor. It was
fully developed by Robert Klajn, Douglas Arellanes, Ákos Maróy, and Sava Tatić.
The user interface has been designed by Charles Truett, based on the initial work
done by a team of his then-fellow Parsons School of Design students Turi McKinley,
Catalin Lazia and Sangita Shah. The team was led by then-head of the school's
Department of Digital Design Colleen Macklin, assisted by Kunal Jain.
Version 1.2.0 - "Kotor"
-----------------------

View File

@ -456,6 +456,21 @@ class LocalizedObject
{
return unicodeStringToUstring(getResourceString(bundle, key) );
}
/**
* Get some binary data as a string.
* Reads the binary data either from a <code>binary</code> or from
* an <code>import</code> key, and returns it as a Glib::ustring.
* The binary data is assumed to be in UTF-8 encoding.
*
* @param key the key identifying the requested binary data.
* @return the requested binary data as a string.
* @exception std::invalid_argument if there is no such key, or the
* value is not of binary type, or it isn't valid UTF-8.
*/
Ptr<Glib::ustring>::Ref
getBinaryResourceAsUstring(const char * key)
throw (std::invalid_argument);
};
/* ================================================= external data structures */

View File

@ -304,3 +304,38 @@ LocalizedObject :: ustringToUnicodeString(const Glib::ustring & gString)
return uString;
}
/*------------------------------------------------------------------------------
* Get a string from a resource bundle in the ICU string format
*----------------------------------------------------------------------------*/
Ptr<Glib::ustring>::Ref
LocalizedObject :: getBinaryResourceAsUstring(const char * key)
throw (std::invalid_argument)
{
Ptr<ResourceBundle>::Ref rb = getBundle(key);
if (rb->getType() == URES_BINARY) {
int32_t length;
UErrorCode status = U_ZERO_ERROR;
const uint8_t * data = rb->getBinary(length, status);
if (!U_SUCCESS(status)) {
throw std::invalid_argument("could not get requested "
"binary resource");
}
char * strBuf = new char[length + 1];
std::memcpy(strBuf, data, length);
strBuf[length] = 0;
Ptr<Glib::ustring>::Ref string(new Glib::ustring(strBuf));
if (string->validate()) {
return string;
} else {
std::string errorMessage = "invalid UTF-8 sequence found ";
errorMessage += "in resource '";
errorMessage += key;
errorMessage += "'";
throw std::invalid_argument(errorMessage);
}
} else {
throw std::invalid_argument("requested resource is not a binary value");
}
}

View File

@ -843,17 +843,16 @@ OptionsWindow :: constructAboutSection(void) throw ()
{
Glib::ustring aboutLabelContents;
aboutLabelContents.append("\n");
aboutLabelContents.append(PACKAGE_NAME);
aboutLabelContents.append(" ");
aboutLabelContents.append(PACKAGE_VERSION);
try {
aboutLabelContents.append(" (");
aboutLabelContents.append(*getResourceUstring("webSiteUrlText"));
aboutLabelContents.append(")\n\n");
aboutLabelContents.append("\n\n");
aboutLabelContents.append(*formatMessage("reportBugsToText",
PACKAGE_BUGREPORT ));
aboutLabelContents.append("\n\n");
aboutLabelContents.append(*getResourceUstring("creditsText"));
aboutLabelContents.append(*getBinaryResourceAsUstring("creditsText"));
} catch (std::invalid_argument &e) {
// TODO: signal error

View File

@ -311,23 +311,8 @@ root:table
schedulerStartButtonLabel:string { "Start" }
schedulerStopButtonLabel:string { "Stop" }
webSiteUrlText:string { "http://campcaster.campware.org" }
reportBugsToText:string { "Report bugs to: {0}" }
creditsText:string { "Credits:\n"
"Ferenc Gerlits (fgerlits@campware.org)\n"
" - Studio GUI, scheduler, packaging\n"
"Mark Kretschmann (markey@web.de)\n"
" - Audio player\n"
"Paul Baranowski (paul@paulbaranowski.org)\n"
" - Project manager, HTML UI, storage server, scheduler\n"
"Douglas Arellanes (Douglas.Arellanes@mdlf.org)\n"
" - Tester and user feedback\n"
"Tomáš Hlava (th@red2head.com)\n"
" - Scheduler, storage server\n"
"János Csikós (retired)\n"
" - HTML UI\n"
"Ákos Maróy (retired)\n"
" - Architecture design, scheduler, audio player" }
creditsText:import { "../../../../CREDITS" }
}
backupView:table