Exemple #1
0
QString ResourceCalendar::infoText() const
{
  QString txt;

  txt += "<b>" + resourceName() + "</b>";
  txt += "<br>";

  KRES::Factory *factory = KRES::Factory::self( "calendar" );
  QString t = factory->typeName( type() );
  txt += i18n("Type: %1").arg( t );

  addInfoText( txt );

  return txt;
}
QString AlarmResource::infoText() const
{
	KRES::Factory* factory = KRES::Factory::self("alarms");
	QString atype;
	switch (mType)
	{
		case ACTIVE:    atype = i18nc("@info/plain", "Active alarms");  break;
		case ARCHIVED:  atype = i18nc("@info/plain", "Archived alarms");  break;
		case TEMPLATE:  atype = i18nc("@info/plain", "Alarm templates");  break;
		default:        break;
	}
	QString perms = readOnly() ? i18nc("@info/plain", "Read-only") : i18nc("@info/plain", "Read-write");
	QString enabled = isEnabled() ? i18nc("@info/plain", "Enabled") : mWrongAlarmType ? i18nc("@info/plain", "Disabled (wrong alarm type)") : i18nc("@info/plain", "Disabled");
	QString std = (AlarmResources::instance()->getStandardResource(mType) == this) ? i18nc("@info/plain Parameter in 'Default calendar: Yes/No'", "Yes") : i18nc("@info/plain Parameter in 'Default calendar: Yes/No'", "No");
	return i18nc("@info",
	    "<title>%1</title>"
	    "<para>Calendar type: %2<nl/>"
	    "Contents: %3<nl/>"
	    "%4: <filename>%5</filename><nl/>"
	    "Permissions: %6<nl/>"
	    "Status: %7<nl/>"
	    "Default calendar: %8</para>",
	    resourceName(), factory->typeName(type()), atype, displayType(), displayLocation(), perms, enabled, std);
}