KDE 5.0 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

KAboutData Class Reference

from PyKDE5.kcoreaddons import *

Detailed Description

This class is used to store information about a program or plugin. It can store such values as version number, program name, home page, email address for bug reporting, multiple authors and contributors (using KAboutPerson), license and copyright information.

Currently, the values set here are shown by the "About" box (see KAboutDialog), used by the bug report dialog (see KBugReport), and by the help shown on command line (see KAboutData.setupCommandLine()).

Porting Notes: Since KDE Frameworks 5.0, the translation catalog mechanism must provided by your translation framework to load the correct catalog instead (eg: KLocalizedString.setApplicationDomain() for KI18n, or QCoreApplication.installTranslator() for Qt's translation system). This applies to the old setCatalogName() and catalogName() members. But see also K4AboutData in kde4support as a compatibility class.

Holds information needed by the "About" box and other classes.

Author:
Espen Sand (espen@kde.org), David Faure (faure@kde.org)


Methods

 __init__ (self, KAboutData other)
 __init__ (self, QString componentName, QString displayName, QString version, QString shortDescription, KAboutLicense::LicenseKey licenseType, QString copyrightStatement=QString(), QString otherText=QString(), QString homePageAddress=QString(), QString bugsEmailAddress=QLatin1String("submit@bugs.kde.org"))
 __init__ (self, QString componentName, QString displayName, QString version)
KAboutData addAuthor (self, QString name, QString task=QString(), QString emailAddress=QString(), QString webAddress=QString(), QString ocsUsername=QString())
KAboutData addCredit (self, QString name, QString task=QString(), QString emailAddress=QString(), QString webAddress=QString(), QString ocsUserName=QString())
KAboutData addLicense (self, KAboutLicense::LicenseKey licenseKey)
KAboutData addLicenseText (self, QString license)
KAboutData addLicenseTextFile (self, QString file)
[KAboutPerson] authors (self)
QString bugAddress (self)
QString componentName (self)
QString copyrightStatement (self)
[KAboutPerson] credits (self)
QString customAuthorPlainText (self)
QString customAuthorRichText (self)
bool customAuthorTextEnabled (self)
QString displayName (self)
QString homepage (self)
QString internalBugAddress (self)
QString internalProgramName (self)
QString internalVersion (self)
[KAboutLicense] licenses (self)
QString ocsProviderUrl (self)
QString organizationDomain (self)
QString otherText (self)
QString productName (self)
QString programIconName (self)
QVariant programLogo (self)
KAboutData setBugAddress (self, QByteArray bugAddress)
KAboutData setComponentName (self, QString componentName)
KAboutData setCopyrightStatement (self, QString copyrightStatement)
KAboutData setCustomAuthorText (self, QString plainText, QString richText)
KAboutData setDisplayName (self, QString displayName)
KAboutData setHomepage (self, QString homepage)
KAboutData setLicense (self, KAboutLicense::LicenseKey licenseKey)
KAboutData setLicenseText (self, QString license)
KAboutData setLicenseTextFile (self, QString file)
KAboutData setOcsProvider (self, QString providerUrl)
KAboutData setOrganizationDomain (self, QByteArray domain)
KAboutData setOtherText (self, QString otherText)
KAboutData setProductName (self, QByteArray name)
KAboutData setProgramIconName (self, QString iconName)
KAboutData setProgramLogo (self, QVariant image)
KAboutData setShortDescription (self, QString shortDescription)
KAboutData setTranslator (self, QString name, QString emailAddress)
KAboutData setVersion (self, QByteArray version)
QString shortDescription (self)
[KAboutPerson] translators (self)
KAboutData unsetCustomAuthorText (self)
QString version (self)

Static Methods

QString aboutTranslationTeam ()
KAboutData applicationData ()
KAboutData pluginData (QString componentName)
 registerPluginData (KAboutData aboutData)
 setApplicationData (KAboutData aboutData)

Method Documentation

__init__ (  self,
KAboutData  other
)

Copy constructor. Performs a deep copy.

Parameters:
other  object to copy

__init__ (  self,
QString  componentName,
QString  displayName,
QString  version,
QString  shortDescription,
KAboutLicense::LicenseKey  licenseType,
QString  copyrightStatement=QString(),
QString  otherText=QString(),
QString  homePageAddress=QString(),
QString  bugsEmailAddress=QLatin1String("submit@bugs.kde.org")
)

Constructor.

Porting Note: The catalogName parameter present in KDE4 was deprecated and removed. See also K4AboutData in kde4support if this feature is needed for compatibility purposes, or consider using componentName() instead.

Parameters:
componentName  The program name or plugin name used internally. Example: "kwrite".
displayName  A displayable name for the program or plugin. This string should be translated. Example: i18n("KWrite")
version  The component version string.
shortDescription  A short description of what the component does. This string should be translated. Example: i18n("A simple text editor.")
licenseType  The license identifier. Use setLicenseText or setLicenseTextFile if you use a license not predefined here.
copyrightStatement  A copyright statement, that can look like this: i18n("Copyright (C) 1999-2000 Name"). The string specified here is taken verbatim; the author information from addAuthor is not used.
otherText  Some free form text, that can contain any kind of information. The text can contain newlines. This string should be translated.
homePageAddress  The component's homepage string. Start the address with "http://". "http://some.domain" is is correct, "some.domain" is not. IMPORTANT: if you set a home page address, this will change the "organization domain" of the application, which is used for automatic D-Bus registration.

See also:
setOrganizationDomain

Parameters:
bugsEmailAddress  The bug report email address string. This defaults to the kde.org bug system.

__init__ (  self,
QString  componentName,
QString  displayName,
QString  version
)

Constructor.

Parameters:
componentName  The program name or plugin name used internally. Example: "kwrite".
displayName  A displayable name for the program or plugin. This string should be translated. Example: i18n("KWrite")
version  The component version string.

KAboutData addAuthor (  self,
QString  name,
QString  task=QString(),
QString  emailAddress=QString(),
QString  webAddress=QString(),
QString  ocsUsername=QString()
)

Defines an author.

You can call this function as many times as you need. Each entry is appended to a list. The person in the first entry is assumed to be the leader of the project.

Parameters:
name  The developer's name. It should be translated.
task  What the person is responsible for. This text can contain newlines. It should be translated. Can be left empty.
emailAddress  An Email address where the person can be reached. Can be left empty.
webAddress  The person's homepage or a relevant link. Start the address with "http://". "http://some.domain" is correct, "some.domain" is not. Can be left empty.
ocsUsername  The person's Open Collaboration Services username. The provider can be optionally specified with
See also:
setOcsProvider.

KAboutData addCredit (  self,
QString  name,
QString  task=QString(),
QString  emailAddress=QString(),
QString  webAddress=QString(),
QString  ocsUserName=QString()
)

Defines a person that deserves credit.

You can call this function as many times as you need. Each entry is appended to a list.

Parameters:
name  The person's name. It should be translated.
task  What the person has done to deserve the honor. The text can contain newlines. It should be translated. Can be left empty.
emailAddress  An email address when the person can be reached. Can be left empty.
webAddress  The person's homepage or a relevant link. Start the address with "http://". "http://some.domain" is is correct, "some.domain" is not. Can be left empty.
ocsUsername  The person's Open Collaboration Services username. The provider can be optionally specified with
See also:
setOcsProvider.

KAboutData addLicense (  self,
KAboutLicense::LicenseKey  licenseKey
)

Adds a license identifier.

If there is only one unknown license set, e.g. by using the default parameter in the constructor, that one is replaced.

Parameters:
licenseKey  The license identifier.

See also:
setLicenseText, addLicenseText, addLicenseTextFile

KAboutData addLicenseText (  self,
QString  license
)

Adds a license text, which is translated.

If there is only one unknown license set, e.g. by using the default parameter in the constructor, that one is replaced.

Example:

 addLicenseText( i18n("This is my license") );

Parameters:
license  The license text.

See also:
setLicenseText, addLicense, addLicenseTextFile

KAboutData addLicenseTextFile (  self,
QString  file
)

Adds a license text by pointing to a file where it resides. The file format has to be plain text in an encoding compatible to the locale.

If there is only one unknown license set, e.g. by using the default parameter in the constructor, that one is replaced.

Parameters:
file  Path to the file in the local filesystem containing the license text.

See also:
addLicenseText, addLicense, setLicenseTextFile

[KAboutPerson] authors (   self )

Returns a list of authors.

Returns:
author information (list of persons).

QString bugAddress (   self )

Returns the email address for bugs.

Returns:
the email address where to report bugs.

QString componentName (   self )

Returns the application's internal name.

Returns:
the internal program name.

QString copyrightStatement (   self )

Returns the copyright statement.

Returns:
the copyright statement. Can be QString() if not set.

[KAboutPerson] credits (   self )

Returns a list of persons who contributed.

Returns:
credit information (list of persons).

QString customAuthorPlainText (   self )

Returns the plain text displayed around the list of authors instead of the default message telling users to send bug reports to bugAddress().

Returns:
the plain text displayed around the list of authors instead of the default message. Can be QString().

QString customAuthorRichText (   self )

Returns the rich text displayed around the list of authors instead of the default message telling users to send bug reports to bugAddress().

Returns:
the rich text displayed around the list of authors instead of the default message. Can be QString().

bool customAuthorTextEnabled (   self )

Returns whether custom text should be displayed around the list of authors.

Returns:
whether custom text should be displayed around the list of authors.

QString displayName (   self )

Returns the translated program name.

Returns:
the program name (translated).

QString homepage (   self )

Returns the application homepage.

Returns:
the application homepage URL. Can be QString() if not set.

QString internalBugAddress (   self )

Internal:
Provided for use by KCrash

QString internalProgramName (   self )

Internal:
Provided for use by KCrash

QString internalVersion (   self )

Internal:
Provided for use by KCrash

[KAboutLicense] licenses (   self )

Returns a list of licenses.

Returns:
licenses information (list of licenses)

QString ocsProviderUrl (   self )

Returns the chosen Open Collaboration Services provider URL.

Returns:
the provider URL.

QString organizationDomain (   self )

Returns the domain name of the organization that wrote this application.

Used by the automatic registration to D-Bus done by KApplication and KUniqueApplication.

QString otherText (   self )

Returns a translated, free form text.

Returns:
the free form text (translated). Can be QString() if not set.

QString productName (   self )

Returns the application's product name, which will be used in KBugReport dialog. By default it returns componentName(), otherwise the one which is set with setProductName()

Returns:
the product name.

QString programIconName (   self )

Returns the program's icon name.

The default value is componentName(). Use setProgramIconName() if you need to have an icon whose name is different from the internal application name.

Returns:
the program's icon name.
See also:
setProgramIconName()

QVariant programLogo (   self )

Returns the program logo image.

Because KAboutData is a core class it cannot use QImage directly, so this is a QVariant containing a QImage.

Returns:
the program logo data, or a null image if there is no custom application logo defined.

KAboutData setBugAddress (  self,
QByteArray  bugAddress
)

Defines the address where bug reports should be sent.

Parameters:
bugAddress  The bug report email address string. This defaults to the kde.org bug system.

KAboutData setComponentName (  self,
QString  componentName
)

Defines the component name used internally.

Parameters:
componentName  The application or plugin name. Example: "kate".

KAboutData setCopyrightStatement (  self,
QString  copyrightStatement
)

Defines the copyright statement to show when displaying the license.

Parameters:
copyrightStatement  A copyright statement, that can look like this: i18n("Copyright (C) 1999-2000 Name"). The string specified here is taken verbatim; the author information from addAuthor is not used.

KAboutData setCustomAuthorText (  self,
QString  plainText,
QString  richText
)

Sets the custom text displayed around the list of authors instead of the default message telling users to send bug reports to bugAddress().

Parameters:
plainText  The plain text.
richText  The rich text.

Setting both to parameters to QString() will cause no message to be displayed at all. Call unsetCustomAuthorText() to revert to the default message.

KAboutData setDisplayName (  self,
QString  displayName
)

Defines the displayable component name string.

Parameters:
displayName  The display name. This string should be translated. Example: i18n("Advanced Text Editor").

KAboutData setHomepage (  self,
QString  homepage
)

Defines the program homepage.

Parameters:
homepage  The program homepage string. Start the address with "http://". "http://kate.kde.org" is correct but "kate.kde.org" is not.

KAboutData setLicense (  self,
KAboutLicense::LicenseKey  licenseKey
)

Defines the license identifier.

Parameters:
licenseKey  The license identifier.

See also:
addLicenseText, setLicenseText, setLicenseTextFile

KAboutData setLicenseText (  self,
QString  license
)

Defines a license text, which is translated.

Example:

 setLicenseText( i18n("This is my license") );

Parameters:
license  The license text.

KAboutData setLicenseTextFile (  self,
QString  file
)

Defines a license text by pointing to a file where it resides. The file format has to be plain text in an encoding compatible to the locale.

Parameters:
file  Path to the file in the local filesystem containing the license text.

KAboutData setOcsProvider (  self,
QString  providerUrl
)

Specifies an Open Collaboration Services provider by URL. A provider file must be available for the chosen provider.

Use this if you need to override the default provider.

If this method is not used, all the KAboutPerson OCS usernames will be used with the openDesktop.org entry from the default provider file.

Parameters:
providerUrl  The provider URL as defined in the provider file.

KAboutData setOrganizationDomain (  self,
QByteArray  domain
)

Defines the Internet domain of the organization that wrote this application. The domain is set to kde.org by default, or the domain of the homePageAddress constructor argument, if set.

Make sure to call setOrganizationDomain if your product is developed out of the kde.org version-control system.

Used by the automatic registration to D-Bus done by KApplication and KUniqueApplication.

IMPORTANT: if the organization domain is set, the .desktop file that describes your application should have an entry like X-DBUS-ServiceName=reversed_domain.kmyapp For instance kwrite passes "http://www.kate-editor.org" as the homePageAddress so it needs X-DBUS-ServiceName=org.kate-editor.kwrite in its kwrite.desktop file.

Parameters:
domain  the domain name, for instance kde.org, koffice.org, kdevelop.org, etc.

KAboutData setOtherText (  self,
QString  otherText
)

Defines the additional text to show in the about dialog.

Parameters:
otherText  Some free form text, that can contain any kind of information. The text can contain newlines. This string should be translated.

KAboutData setProductName (  self,
QByteArray  name
)

Defines the product name which will be used in the KBugReport dialog. By default it's the componentName, but you can overwrite it here to provide support for special components e.g. in the form 'product/component', such as 'kontact/summary'.

Parameters:
name  The name of product

KAboutData setProgramIconName (  self,
QString  iconName
)

Defines the program icon.

Use this if you need to have an application icon whose name is different than the application name.

Parameters:
iconName  name of the icon. Example: "accessories-text-editor"

See also:
programIconName()

KAboutData setProgramLogo (  self,
QVariant  image
)

Defines the program logo.

Use this if you need to have an application logo in AboutData other than the application icon.

Because KAboutData is a core class it cannot use QImage directly, so this is a QVariant that should contain a QImage.

Parameters:
image  logo image.

See also:
programLogo()

KAboutData setShortDescription (  self,
QString  shortDescription
)

Defines a short description of what the program does.

Parameters:
shortDescription  The program description. This string should be translated. Example: i18n("An advanced text editor with syntax highlighting support.").

KAboutData setTranslator (  self,
QString  name,
QString  emailAddress
)

Sets the name(s) of the translator(s) of the GUI.

Since this depends on the language, just use a dummy text marked for translation.

The canonical use is:

 setTranslator(ki18nc("NAME OF TRANSLATORS", "Your names"),
               ki18nc("EMAIL OF TRANSLATORS", "Your emails"));

The translator can then translate this dummy text with his name or with a list of names separated with ",". If there is no translation or the application is used with the default language, this function call is ignored.

Parameters:
name  the name(s) of the translator(s)
emailAddress  the email address(es) of the translator(s)

See also:
KAboutTranslator

KAboutData setVersion (  self,
QByteArray  version
)

Defines the program version string.

Parameters:
version  The program version.

QString shortDescription (   self )

Returns a short, translated description.

Returns:
the short description (translated). Can be QString() if not set.

[KAboutPerson] translators (   self )

Returns a list of translators.

Returns:
translators information (list of persons)

KAboutData unsetCustomAuthorText (   self )

Clears any custom text displayed around the list of authors and falls back to the default message telling users to send bug reports to bugAddress().

QString version (   self )

Returns the program's version.

Returns:
the version string.


Static Method Documentation

QString aboutTranslationTeam (   )

Returns a message about the translation team.

Returns:
a message about the translation team

KAboutData applicationData (   )

Returns the KAboutData for the application. This contains information such as authors, license, etc. provided that the main() called setApplicationData.

KAboutData pluginData ( QString  componentName
)

Return the KAboutData for the given plugin identified by componentName.

registerPluginData ( KAboutData  aboutData
)

Register the KAboutData information for a plugin. Call this from the constructor of the plugin. This will register the plugin's aboutData under the component name that was set in aboutData.

setApplicationData ( KAboutData  aboutData
)

Sets the application data for this application.

In addition to changing the result of applicationData(), this initializes the relevant properties of QCoreApplication (and its subclasses) with information from aboutData.

  • Full Index

Modules

  • karchive
  • kcoreaddons
  • kguiaddons
  • kitemmodels
  • kitemviews
  • kplotting
  • kwidgetsaddons
  • solid
  • sonnet
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal