KVIrc
4.9.2
DeveloperAPIs
|
A set of information about a KVIrc theme. More...
#include <KviTheme.h>
Public Types | |
enum | Location { Builtin = 0, User = 1, External = 3, Auto = 4 } |
Public Member Functions | |
const QString & | application () |
const QString & | author () |
const QString & | date () |
const QString & | description () |
const QString & | directory () const |
bool | isBuiltin () |
KviThemeInfo () | |
const QPixmap & | largeScreenshot () |
const QString & | lastError () |
bool | load (const QString &szDirectory, Location eLocation) |
Location | location () const |
const QPixmap & | mediumScreenshot () |
const QString & | name () |
bool | save (const QString &szThemeFileName) |
void | setApplication (const QString &szApplication) |
void | setAuthor (const QString &szAuthor) |
void | setDate (const QString &szDate) |
void | setDescription (const QString &szDescription) |
void | setDirectoryAndLocation (const QString &szDirectory, Location eLocation) |
void | setLastError (const QString &szLastError) |
void | setName (const QString &szName) |
void | setThemeEngineVersion (const QString &szThemeEngineVersion) |
void | setVersion (const QString &szVersion) |
const QPixmap & | smallScreenshot () |
QString | smallScreenshotPath () |
const QString & | subdirectory () const |
const QString & | themeEngineVersion () |
const QString & | version () |
~KviThemeInfo () | |
Protected Attributes | |
Location | m_eLocation |
QPixmap | m_pixScreenshotLarge |
QPixmap | m_pixScreenshotMedium |
QPixmap | m_pixScreenshotSmall |
QString | m_szApplication |
QString | m_szAuthor |
QString | m_szDate |
QString | m_szDescription |
QString | m_szDirectory |
QString | m_szLastError |
QString | m_szName |
QString | m_szSubdirectory |
QString | m_szThemeEngineVersion |
QString | m_szVersion |
A set of information about a KVIrc theme.
This object contains a set of information about a theme that can be read and stored to a standard KVIrc configuration file (which is usually named themeinfo.kvc but this is not strictly necessary).
KviThemeInfo::KviThemeInfo | ( | ) |
|
default |
|
inline |
Referenced by PackThemeDataWidget::parseThemes().
|
inline |
|
inline |
Referenced by PackThemeDataWidget::parseThemes().
|
inline |
|
inline |
|
inline |
References Builtin.
Referenced by ThemeManagementDialog::contextMenuRequested(), ThemeManagementDialog::deleteTheme(), and ThemeManagementDialog::enableDisableButtons().
const QPixmap & KviThemeInfo::largeScreenshot | ( | ) |
Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png This function will work only if the absoluteDirectory() of the theme has been set, otherwise the returned pixmap will be null.
References KVI_THEME_LARGE_SCREENSHOT_NAME, m_pixScreenshotLarge, and m_szDirectory.
Referenced by mediumScreenshot().
|
inline |
bool KviThemeInfo::load | ( | const QString & | szDirectory, |
Location | eLocation | ||
) |
Load theme data from the specified location. If eLocation is Builtin then szThemeDirectory is assumed to be a subdirectory of the kvirc global theme directory. If eLocation is User then szThemeDirectory is assumed to be a subdirectory of the kvirc local theme directory. If eLocation is External the szThemeDirectory is assumed to be a full path to a theme directory.
References __tr2qs, KviMiscUtils::compareVersions(), KviFileUtils::fileExists(), KVI_CURRENT_THEME_ENGINE_VERSION, KVI_THEMEDATA_FILE_NAME, KVI_THEMEINFO_CONFIG_GROUP, KVI_THEMEINFO_FILE_NAME, m_szApplication, m_szAuthor, m_szDate, m_szDescription, m_szDirectory, m_szLastError, m_szName, m_szThemeEngineVersion, m_szVersion, KviConfigurationFile::Read, KviConfigurationFile::readEntry(), setDirectoryAndLocation(), and KviConfigurationFile::setGroup().
Referenced by KviTheme::apply(), ThemeManagementDialog::fillThemeBox(), SaveThemeDialog::SaveThemeDialog(), theme_kvs_cmd_pack(), and theme_kvs_fnc_info().
|
inline |
Referenced by ThemeManagementDialog::applyCurrentTheme().
const QPixmap & KviThemeInfo::mediumScreenshot | ( | ) |
Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png This function will work only if the absoluteDirectory() of the theme has been set, otherwise the returned pixmap will be null.
References KVI_THEME_MEDIUM_SCREENSHOT_NAME, largeScreenshot(), m_pixScreenshotMedium, m_szDirectory, and QIMAGE_SCALE_MIN.
Referenced by smallScreenshot().
|
inline |
bool KviThemeInfo::save | ( | const QString & | szThemeFileName | ) |
save the currently defined theme configuration in the specified file
References KviConfigurationFile::clear(), KVI_CURRENT_THEME_ENGINE_VERSION, KVI_SOURCES_DATE, KVI_THEMEINFO_CONFIG_GROUP, KVI_VERSION, m_szAuthor, m_szDate, m_szDescription, m_szName, m_szVersion, KviConfigurationFile::setGroup(), KviConfigurationFile::Write, and KviConfigurationFile::writeEntry().
Referenced by KviTheme::save().
|
inline |
Referenced by SaveThemeDialog::saveTheme().
|
inline |
Referenced by SaveThemeDialog::saveTheme().
|
inline |
Referenced by SaveThemeDialog::saveTheme().
|
inline |
Referenced by SaveThemeDialog::saveTheme().
void KviThemeInfo::setDirectoryAndLocation | ( | const QString & | szDirectory, |
Location | eLocation | ||
) |
References Auto, Builtin, KviFileUtils::directoryExists(), KviQString::ensureLastCharIs(), External, KviFileUtils::extractFileName(), g_pApp, KviApplication::getGlobalKvircDirectory(), KviApplication::getLocalKvircDirectory(), KVI_PATH_SEPARATOR_CHAR, m_eLocation, m_szDirectory, m_szSubdirectory, KviApplication::Themes, and User.
Referenced by load(), and SaveThemeDialog::saveTheme().
|
inline |
Referenced by KviTheme::save(), and KviTheme::saveScreenshots().
|
inline |
Referenced by SaveThemeDialog::saveTheme().
|
inline |
|
inline |
Referenced by SaveThemeDialog::saveTheme().
const QPixmap & KviThemeInfo::smallScreenshot | ( | ) |
Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png This function will work only if the absoluteDirectory() of the theme has been set, otherwise the returned pixmap will be null.
References KVI_THEME_SMALL_SCREENSHOT_NAME, m_pixScreenshotSmall, m_szDirectory, mediumScreenshot(), and QIMAGE_SCALE_MIN.
Referenced by ThemeManagementDialog::fillThemeBox(), and PackThemeDataWidget::parseThemes().
QString KviThemeInfo::smallScreenshotPath | ( | ) |
Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png This function will work only if the absoluteDirectory() of the theme has been set, otherwise the returned pixmap will be null.
References KVI_THEME_SMALL_SCREENSHOT_NAME, and m_szDirectory.
Referenced by PackThemeDataWidget::parseThemes().
|
inline |
Referenced by ThemeManagementDialog::applyCurrentTheme(), PackThemeDataWidget::parseThemes(), and KviTheme::save().
|
inline |
Referenced by PackThemeDataWidget::parseThemes().
|
inline |
|
protected |
Referenced by setDirectoryAndLocation().
|
protected |
Referenced by largeScreenshot().
|
protected |
Referenced by mediumScreenshot().
|
protected |
Referenced by smallScreenshot().
|
protected |
Referenced by load().
|
protected |
Referenced by largeScreenshot(), load(), mediumScreenshot(), setDirectoryAndLocation(), smallScreenshot(), and smallScreenshotPath().
|
protected |
Referenced by load().
|
protected |
Referenced by setDirectoryAndLocation().
|
protected |
Referenced by load().