mirror of
https://github.com/Ximi1970/systray-x.git
synced 2026-07-05 23:58:38 +02:00
Add default icon preferences
This commit is contained in:
@@ -34,6 +34,10 @@ Preferences::Preferences( QObject *parent ) : QObject( parent )
|
||||
*/
|
||||
m_app_pref_changed = false;
|
||||
|
||||
m_default_icon_type = PREF_DEFAULT_ICON_DEFAULT;
|
||||
m_default_icon_mime = "image/png";
|
||||
m_default_icon_data = QByteArray();
|
||||
|
||||
m_icon_type = PREF_BLANK_ICON;
|
||||
m_icon_mime = "image/png";
|
||||
m_icon_data = QByteArray();
|
||||
@@ -142,6 +146,77 @@ void Preferences::setBrowserBuildID( const QString buildID )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the default icon type.
|
||||
*/
|
||||
Preferences::DefaultIconType Preferences::getDefaultIconType() const
|
||||
{
|
||||
return m_default_icon_type;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the default icon type.
|
||||
*/
|
||||
void Preferences::setDefaultIconType( DefaultIconType icon_type )
|
||||
{
|
||||
if( m_default_icon_type != icon_type)
|
||||
{
|
||||
m_default_icon_type = icon_type;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalDefaultIconTypeChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the default icon mime.
|
||||
*/
|
||||
const QString& Preferences::getDefaultIconMime() const
|
||||
{
|
||||
return m_icon_mime;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the default icon mime.
|
||||
*/
|
||||
void Preferences::setDefaultIconMime( const QString& icon_mime )
|
||||
{
|
||||
m_default_icon_mime = icon_mime;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the default icon data.
|
||||
*/
|
||||
const QByteArray& Preferences::getDefaultIconData() const
|
||||
{
|
||||
return m_default_icon_data;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the icon data.
|
||||
*/
|
||||
void Preferences::setDefaultIconData( const QByteArray& icon_data )
|
||||
{
|
||||
|
||||
if( m_default_icon_data != icon_data )
|
||||
{
|
||||
m_default_icon_data = icon_data;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalDefaultIconDataChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the icon type.
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,12 @@ class Preferences : public QObject
|
||||
PREF_MINIMIZE_METHOD_2
|
||||
};
|
||||
|
||||
enum DefaultIconType {
|
||||
PREF_DEFAULT_ICON_DEFAULT = 0,
|
||||
PREF_DEFAULT_ICON_HIDE,
|
||||
PREF_DEFAULT_ICON_CUSTOM
|
||||
};
|
||||
|
||||
/*
|
||||
* Icon types
|
||||
*/
|
||||
@@ -135,6 +141,48 @@ class Preferences : public QObject
|
||||
*/
|
||||
void setBrowserBuildID( const QString buildID );
|
||||
|
||||
/**
|
||||
* @brief getDefaultIconType. Get the default icon type.
|
||||
*
|
||||
* @return The icon type.
|
||||
*/
|
||||
DefaultIconType getDefaultIconType() const;
|
||||
|
||||
/**
|
||||
* @brief setDefaultIconType. Set the default icon type.
|
||||
*
|
||||
* @param The icon type.
|
||||
*/
|
||||
void setDefaultIconType( DefaultIconType icon_type );
|
||||
|
||||
/**
|
||||
* @brief getDefaultIconMime. Get the default icon mime.
|
||||
*
|
||||
* @return The icon mime.
|
||||
*/
|
||||
const QString& getDefaultIconMime() const;
|
||||
|
||||
/**
|
||||
* @brief setDefaultIconMime. Set the default icon mime.
|
||||
*
|
||||
* @param The icon mime.
|
||||
*/
|
||||
void setDefaultIconMime( const QString& icon_mime );
|
||||
|
||||
/**
|
||||
* @brief getDefaultIconData. Get the default icon data.
|
||||
*
|
||||
* @return The icon data.
|
||||
*/
|
||||
const QByteArray& getDefaultIconData() const;
|
||||
|
||||
/**
|
||||
* @brief setDefaultIconData. Set the default icon data.
|
||||
*
|
||||
* @param The icon data.
|
||||
*/
|
||||
void setDefaultIconData( const QByteArray& icon_data );
|
||||
|
||||
/**
|
||||
* @brief getIconType. Get the icon type.
|
||||
*
|
||||
@@ -312,6 +360,16 @@ class Preferences : public QObject
|
||||
*/
|
||||
void signalConsole( QString message );
|
||||
|
||||
/**
|
||||
* @brief signalDefaultIconTypeChange. Signal a default icon type change.
|
||||
*/
|
||||
void signalDefaultIconTypeChange();
|
||||
|
||||
/**
|
||||
* @brief signalDefaultIconDataChange. Signal a default icon data change.
|
||||
*/
|
||||
void signalDefaultIconDataChange();
|
||||
|
||||
/**
|
||||
* @brief signalIconTypeChange. Signal a icon type change.
|
||||
*/
|
||||
@@ -379,6 +437,21 @@ class Preferences : public QObject
|
||||
QString m_browser_version;
|
||||
QString m_browser_buildID;
|
||||
|
||||
/**
|
||||
* @brief m_default_icon_type. Selected icon type.
|
||||
*/
|
||||
DefaultIconType m_default_icon_type;
|
||||
|
||||
/**
|
||||
* @brief m_default_icon_mime. Selected icon mime.
|
||||
*/
|
||||
QString m_default_icon_mime;
|
||||
|
||||
/**
|
||||
* @brief m_default_icon_data. Binary data icon image.
|
||||
*/
|
||||
QByteArray m_default_icon_data;
|
||||
|
||||
/**
|
||||
* @brief m_icon_type. Selected icon type.
|
||||
*/
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>484</width>
|
||||
<height>416</height>
|
||||
<width>495</width>
|
||||
<height>505</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -18,218 +18,74 @@
|
||||
<normaloff>:/files/icons/SysTray-X.png</normaloff>:/files/icons/SysTray-X.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" rowspan="3">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="iconTypeGroupBox">
|
||||
<property name="title">
|
||||
<string>Mail notification icon</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Default icon</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="defaultIconRadioButton">
|
||||
<property name="text">
|
||||
<string>Default Thunderbird</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">defaultIconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="hideDefaultIconRadioButton">
|
||||
<property name="text">
|
||||
<string>Hide icon</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">defaultIconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="blankRadioButton">
|
||||
<property name="text">
|
||||
<string>Blank icon</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">iconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="newMailButton">
|
||||
<property name="text">
|
||||
<string>New mail icon</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">iconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="customRadioButton">
|
||||
<property name="text">
|
||||
<string>Custom icon</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">iconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="chooseCustomButton">
|
||||
<property name="text">
|
||||
<string>Choose</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QRadioButton" name="customDefaultIconRadioButton">
|
||||
<property name="text">
|
||||
<string>Custom icon</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">defaultIconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="defaultImageLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="chooseCustomDefaultIconButton">
|
||||
<property name="text">
|
||||
<string>Choose</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>Number properties</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="showNumberCheckBox">
|
||||
<property name="text">
|
||||
<string>Display unread message count</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Text color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="numberColorPushButton">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="countTypeGroupBox">
|
||||
<property name="title">
|
||||
<string>Count type</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="unreadRadioButton">
|
||||
<property name="text">
|
||||
<string>Unread</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">countTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="newRadioButton">
|
||||
<property name="text">
|
||||
<string>New</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">countTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="0" column="1" rowspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Windows</string>
|
||||
@@ -312,7 +168,197 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="1" column="0" rowspan="2">
|
||||
<widget class="QGroupBox" name="iconTypeGroupBox">
|
||||
<property name="title">
|
||||
<string>Mail notification icon</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="blankRadioButton">
|
||||
<property name="text">
|
||||
<string>Blank icon</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">iconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="newMailButton">
|
||||
<property name="text">
|
||||
<string>New mail icon</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">iconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="customRadioButton">
|
||||
<property name="text">
|
||||
<string>Custom icon</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">iconTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="chooseCustomButton">
|
||||
<property name="text">
|
||||
<string>Choose</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" rowspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>Number properties</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="showNumberCheckBox">
|
||||
<property name="text">
|
||||
<string>Display unread message count</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Text color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="numberColorPushButton">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="countTypeGroupBox">
|
||||
<property name="title">
|
||||
<string>Count type</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="unreadRadioButton">
|
||||
<property name="text">
|
||||
<string>Unread</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">countTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="newRadioButton">
|
||||
<property name="text">
|
||||
<string>New</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">countTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" rowspan="2">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -320,12 +366,32 @@
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>95</height>
|
||||
<height>113</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>6</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="debugWindowCheckBox">
|
||||
<property name="text">
|
||||
<string>Display debug window</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -335,13 +401,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="debugWindowCheckBox">
|
||||
<property name="text">
|
||||
<string>Display debug window</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
@@ -366,8 +425,9 @@
|
||||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="defaultIconTypeGroup"/>
|
||||
<buttongroup name="minimizeTypeGroup"/>
|
||||
<buttongroup name="countTypeGroup"/>
|
||||
<buttongroup name="iconTypeGroup"/>
|
||||
<buttongroup name="countTypeGroup"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
||||
@@ -62,17 +62,31 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi
|
||||
*/
|
||||
m_ui->countTypeGroupBox->setVisible(false);
|
||||
// m_ui->unreadRadioButton->setVisible(false);
|
||||
// m_ui->newRadioButton->setVisible(false);
|
||||
// m_ui->newRadioButton->setVisible(false);
|
||||
|
||||
/*
|
||||
* Set defaults
|
||||
* Set icon type defaults
|
||||
*/
|
||||
m_tmp_icon_data = QByteArray();
|
||||
m_tmp_icon_mime = QString();
|
||||
|
||||
/*
|
||||
* Set default icon type button Ids
|
||||
*/
|
||||
m_ui->defaultIconTypeGroup->setId( m_ui->defaultIconRadioButton, Preferences::PREF_DEFAULT_ICON_DEFAULT );
|
||||
m_ui->defaultIconTypeGroup->setId( m_ui->hideDefaultIconRadioButton, Preferences::PREF_DEFAULT_ICON_HIDE );
|
||||
m_ui->defaultIconTypeGroup->setId( m_ui->customDefaultIconRadioButton, Preferences::PREF_DEFAULT_ICON_CUSTOM );
|
||||
|
||||
/*
|
||||
* Set icon type defaults
|
||||
*/
|
||||
m_tmp_default_icon_data = QByteArray();
|
||||
m_tmp_default_icon_mime = QString();
|
||||
|
||||
/*
|
||||
* Signals and slots
|
||||
*/
|
||||
connect( m_ui->chooseCustomDefaultIconButton, &QPushButton::clicked, this, &PreferencesDialog::slotDefaultFileSelect );
|
||||
connect( m_ui->chooseCustomButton, &QPushButton::clicked, this, &PreferencesDialog::slotFileSelect );
|
||||
connect( m_ui->buttonBox, &QDialogButtonBox::accepted, this, &PreferencesDialog::slotAccept );
|
||||
connect( m_ui->buttonBox, &QDialogButtonBox::rejected, this, &PreferencesDialog::slotReject );
|
||||
@@ -129,6 +143,16 @@ void PreferencesDialog::setIconType( Preferences::IconType icon_type )
|
||||
( m_ui->iconTypeGroup->button( icon_type ) )->setChecked( true );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the default icon type
|
||||
*/
|
||||
void PreferencesDialog::setDefaultIconType( Preferences::DefaultIconType icon_type )
|
||||
{
|
||||
( m_ui->defaultIconTypeGroup->button( icon_type ) )->setChecked( true );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the icon
|
||||
*/
|
||||
@@ -165,6 +189,41 @@ void PreferencesDialog::setIcon()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the default icon
|
||||
*/
|
||||
void PreferencesDialog::setDefaultIcon( const QString& icon_mime, const QByteArray& icon )
|
||||
{
|
||||
/*
|
||||
* Store the new icon
|
||||
*/
|
||||
m_tmp_default_icon_mime = icon_mime;
|
||||
m_tmp_default_icon_data = icon;
|
||||
|
||||
/*
|
||||
* Display the new icon
|
||||
*/
|
||||
setDefaultIcon();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the default icon
|
||||
*/
|
||||
void PreferencesDialog::setDefaultIcon()
|
||||
{
|
||||
/*
|
||||
* Convert data to pixmap
|
||||
*/
|
||||
QPixmap pixmap;
|
||||
pixmap.loadFromData( m_tmp_default_icon_data );
|
||||
|
||||
/*
|
||||
* Display the icon
|
||||
*/
|
||||
m_ui->defaultImageLabel->setPixmap( pixmap.scaledToHeight( m_ui->chooseCustomButton->size().height() ) );
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the enable number state
|
||||
*/
|
||||
@@ -210,6 +269,10 @@ void PreferencesDialog::slotAccept()
|
||||
/*
|
||||
* Get all the selected values and store them in the preferences
|
||||
*/
|
||||
m_pref->setDefaultIconType( static_cast< Preferences::DefaultIconType >( m_ui->defaultIconTypeGroup->checkedId() ) );
|
||||
m_pref->setDefaultIconMime( m_tmp_default_icon_mime );
|
||||
m_pref->setDefaultIconData( m_tmp_default_icon_data );
|
||||
|
||||
m_pref->setIconType( static_cast< Preferences::IconType >( m_ui->iconTypeGroup->checkedId() ) );
|
||||
m_pref->setIconMime( m_tmp_icon_mime );
|
||||
m_pref->setIconData( m_tmp_icon_data );
|
||||
@@ -274,9 +337,33 @@ void PreferencesDialog::slotFileSelect()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle the default choose button
|
||||
*/
|
||||
void PreferencesDialog::slotDefaultFileSelect()
|
||||
{
|
||||
QFileDialog file_dialog( this, tr( "Open Image" ), "", tr( "Image Files (*.png *.jpg *.bmp)" ) );
|
||||
|
||||
if( file_dialog.exec() )
|
||||
{
|
||||
QFile file( file_dialog.selectedFiles()[ 0 ] );
|
||||
file.open( QIODevice::ReadOnly );
|
||||
m_tmp_default_icon_data = file.readAll();
|
||||
file.close();
|
||||
|
||||
QMimeType type = QMimeDatabase().mimeTypeForData( m_tmp_default_icon_data );
|
||||
m_tmp_default_icon_mime = type.name();
|
||||
|
||||
/*
|
||||
* Display the default icon
|
||||
*/
|
||||
setDefaultIcon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the choose button
|
||||
* Handle the colro select button
|
||||
*/
|
||||
void PreferencesDialog::slotColorSelect()
|
||||
{
|
||||
@@ -335,6 +422,15 @@ void PreferencesDialog::slotIconTypeChange()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the default icon type change signal
|
||||
*/
|
||||
void PreferencesDialog::slotDefaultIconTypeChange()
|
||||
{
|
||||
setDefaultIconType( m_pref->getDefaultIconType() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the icon data change signal
|
||||
*/
|
||||
@@ -350,6 +446,21 @@ void PreferencesDialog::slotIconDataChange()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the default icon data change signal
|
||||
*/
|
||||
void PreferencesDialog::slotDefaultIconDataChange()
|
||||
{
|
||||
m_tmp_default_icon_mime = m_pref->getDefaultIconMime();
|
||||
m_tmp_default_icon_data = m_pref->getDefaultIconData();
|
||||
|
||||
/*
|
||||
* Display the icon
|
||||
*/
|
||||
setDefaultIcon();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the enable number state change
|
||||
*/
|
||||
|
||||
@@ -76,6 +76,13 @@ class PreferencesDialog : public QDialog
|
||||
*/
|
||||
void setIconType( Preferences::IconType icon_type );
|
||||
|
||||
/**
|
||||
* @brief setDefaultIconType. Set the default icon type.
|
||||
*
|
||||
* @param icon_type The icon type.
|
||||
*/
|
||||
void setDefaultIconType( Preferences::DefaultIconType icon_type );
|
||||
|
||||
/**
|
||||
* @brief setIcon. Set the icon.
|
||||
*
|
||||
@@ -89,6 +96,19 @@ class PreferencesDialog : public QDialog
|
||||
*/
|
||||
void setIcon();
|
||||
|
||||
/**
|
||||
* @brief setDefaultIcon. Set the default icon.
|
||||
*
|
||||
* @param icon The icon mime.
|
||||
* @param icon The icon data.
|
||||
*/
|
||||
void setDefaultIcon( const QString& icon_mime, const QByteArray& icon );
|
||||
|
||||
/**
|
||||
* @brief setDefaultIcon. Set the default icon.
|
||||
*/
|
||||
void setDefaultIcon();
|
||||
|
||||
/**
|
||||
* @brief setShowNumber. Set the show number state.
|
||||
*
|
||||
@@ -151,11 +171,21 @@ class PreferencesDialog : public QDialog
|
||||
*/
|
||||
void slotIconTypeChange();
|
||||
|
||||
/**
|
||||
* @brief slotDefaultIconTypeChange. Slot for handling default icon type change signals.
|
||||
*/
|
||||
void slotDefaultIconTypeChange();
|
||||
|
||||
/**
|
||||
* @brief slotIconDataChange. Slot for handling icon data change signals.
|
||||
*/
|
||||
void slotIconDataChange();
|
||||
|
||||
/**
|
||||
* @brief slotDefaultIconDataChange. Slot for handling default icon data change signals.
|
||||
*/
|
||||
void slotDefaultIconDataChange();
|
||||
|
||||
/**
|
||||
* @brief slotShowNumberChange. Slot for handling show number state change.
|
||||
*/
|
||||
@@ -188,6 +218,11 @@ class PreferencesDialog : public QDialog
|
||||
*/
|
||||
void slotFileSelect();
|
||||
|
||||
/**
|
||||
* @brief slotDefaultFileSelect. Handle the choose default custom button click.
|
||||
*/
|
||||
void slotDefaultFileSelect();
|
||||
|
||||
/**
|
||||
* @brief slotColorSelect. Handle the choose color button click.
|
||||
*/
|
||||
@@ -220,6 +255,16 @@ class PreferencesDialog : public QDialog
|
||||
*/
|
||||
QByteArray m_tmp_icon_data;
|
||||
|
||||
/**
|
||||
* @brief m_tmp_default_icon_mime. Temporary storage for default icon mime.
|
||||
*/
|
||||
QString m_tmp_default_icon_mime;
|
||||
|
||||
/**
|
||||
* @brief m_tmp_default_icon_data. Temporary storage for default icon data.
|
||||
*/
|
||||
QByteArray m_tmp_default_icon_data;
|
||||
|
||||
/**
|
||||
* @brief m_number_color. Temporary storage for the number color.
|
||||
*/
|
||||
|
||||
@@ -38,6 +38,8 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
|
||||
*/
|
||||
m_win_ctrl = new WindowCtrl( m_preferences );
|
||||
|
||||
#ifdef QT_NO_DEBUG
|
||||
|
||||
if( !m_win_ctrl->thunderbirdStart() )
|
||||
{
|
||||
/*
|
||||
@@ -46,6 +48,8 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
|
||||
exit(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Setup the link
|
||||
*/
|
||||
@@ -88,6 +92,8 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
|
||||
/*
|
||||
* Connect preferences signals
|
||||
*/
|
||||
connect( m_preferences, &Preferences::signalDefaultIconTypeChange, m_tray_icon, &SysTrayXIcon::slotDefaultIconTypeChange );
|
||||
connect( m_preferences, &Preferences::signalDefaultIconDataChange, m_tray_icon, &SysTrayXIcon::slotDefaultIconDataChange );
|
||||
connect( m_preferences, &Preferences::signalIconTypeChange, m_tray_icon, &SysTrayXIcon::slotIconTypeChange );
|
||||
connect( m_preferences, &Preferences::signalIconDataChange, m_tray_icon, &SysTrayXIcon::slotIconDataChange );
|
||||
connect( m_preferences, &Preferences::signalShowNumberChange, m_tray_icon, &SysTrayXIcon::slotShowNumberChange );
|
||||
@@ -96,6 +102,8 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
|
||||
connect( m_preferences, &Preferences::signalMinimizeTypeChange, m_win_ctrl, &WindowCtrl::slotMinimizeTypeChange );
|
||||
connect( m_preferences, &Preferences::signalStartMinimizedChange, m_win_ctrl, &WindowCtrl::slotStartMinimizedChange );
|
||||
|
||||
connect( m_preferences, &Preferences::signalDefaultIconTypeChange, m_pref_dialog, &PreferencesDialog::slotDefaultIconTypeChange );
|
||||
connect( m_preferences, &Preferences::signalDefaultIconDataChange, m_pref_dialog, &PreferencesDialog::slotDefaultIconDataChange );
|
||||
connect( m_preferences, &Preferences::signalIconTypeChange, m_pref_dialog, &PreferencesDialog::slotIconTypeChange );
|
||||
connect( m_preferences, &Preferences::signalIconDataChange, m_pref_dialog, &PreferencesDialog::slotIconDataChange );
|
||||
connect( m_preferences, &Preferences::signalShowNumberChange, m_pref_dialog, &PreferencesDialog::slotShowNumberChange );
|
||||
@@ -106,6 +114,8 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
|
||||
connect( m_preferences, &Preferences::signalMinimizeOnCloseChange, m_pref_dialog, &PreferencesDialog::slotMinimizeOnCloseChange );
|
||||
connect( m_preferences, &Preferences::signalDebugChange, m_pref_dialog, &PreferencesDialog::slotDebugChange );
|
||||
|
||||
connect( m_preferences, &Preferences::signalDefaultIconTypeChange, m_link, &SysTrayXLink::slotDefaultIconTypeChange );
|
||||
connect( m_preferences, &Preferences::signalDefaultIconDataChange, m_link, &SysTrayXLink::slotDefaultIconDataChange );
|
||||
connect( m_preferences, &Preferences::signalIconTypeChange, m_link, &SysTrayXLink::slotIconTypeChange );
|
||||
connect( m_preferences, &Preferences::signalIconDataChange, m_link, &SysTrayXLink::slotIconDataChange );
|
||||
connect( m_preferences, &Preferences::signalShowNumberChange, m_link, &SysTrayXLink::slotShowNumberChange );
|
||||
@@ -208,6 +218,13 @@ void SysTrayX::createTrayIcon()
|
||||
m_tray_icon = new SysTrayXIcon( m_link, m_preferences );
|
||||
m_tray_icon->setContextMenu( m_tray_icon_menu );
|
||||
|
||||
/*
|
||||
* Set default icon
|
||||
*/
|
||||
m_tray_icon->setDefaultIconMime( m_preferences->getDefaultIconMime() );
|
||||
m_tray_icon->setDefaultIconData( m_preferences->getDefaultIconData() );
|
||||
m_tray_icon->setDefaultIconType( m_preferences->getDefaultIconType() );
|
||||
|
||||
/*
|
||||
* Set icon
|
||||
*/
|
||||
|
||||
@@ -37,6 +37,61 @@ SysTrayXIcon::SysTrayXIcon( SysTrayXLink* link, Preferences* pref, QObject* pare
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the default icon type
|
||||
*/
|
||||
void SysTrayXIcon::setDefaultIconType( Preferences::DefaultIconType icon_type )
|
||||
{
|
||||
if( m_default_icon_type != icon_type )
|
||||
{
|
||||
/*
|
||||
* Store the new value
|
||||
*/
|
||||
m_default_icon_type = icon_type;
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
renderIcon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the default icon mime
|
||||
*/
|
||||
void SysTrayXIcon::setDefaultIconMime( const QString& icon_mime )
|
||||
{
|
||||
if( m_default_icon_mime != icon_mime )
|
||||
{
|
||||
/*
|
||||
* Store the new value
|
||||
*/
|
||||
m_default_icon_mime = icon_mime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the default icon data
|
||||
*/
|
||||
void SysTrayXIcon::setDefaultIconData( const QByteArray& icon_data )
|
||||
{
|
||||
if( m_default_icon_data != icon_data )
|
||||
{
|
||||
/*
|
||||
* Store the new value
|
||||
*/
|
||||
m_default_icon_data = icon_data;
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
renderIcon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the icon type
|
||||
*/
|
||||
@@ -73,7 +128,7 @@ void SysTrayXIcon::setIconMime( const QString& icon_mime )
|
||||
|
||||
|
||||
/*
|
||||
* Set the icon type
|
||||
* Set the icon data
|
||||
*/
|
||||
void SysTrayXIcon::setIconData( const QByteArray& icon_data )
|
||||
{
|
||||
@@ -228,6 +283,25 @@ void SysTrayXIcon::slotSetUnreadMail( int unread_mail )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the default icon type change signal
|
||||
*/
|
||||
void SysTrayXIcon::slotDefaultIconTypeChange()
|
||||
{
|
||||
setDefaultIconType( m_pref->getDefaultIconType() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the default icon data change signal
|
||||
*/
|
||||
void SysTrayXIcon::slotDefaultIconDataChange()
|
||||
{
|
||||
setDefaultIconMime( m_pref->getDefaultIconMime() );
|
||||
setDefaultIconData( m_pref->getDefaultIconData() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the icon type change signal
|
||||
*/
|
||||
|
||||
@@ -33,6 +33,27 @@ class SysTrayXIcon : public QSystemTrayIcon
|
||||
*/
|
||||
SysTrayXIcon( SysTrayXLink* link, Preferences* pref, QObject* parent = nullptr );
|
||||
|
||||
/**
|
||||
* @brief setDefaultIconType. Set the sytem tray default icon type.
|
||||
*
|
||||
* @param icon_type The icon type
|
||||
*/
|
||||
void setDefaultIconType( Preferences::DefaultIconType icon_type );
|
||||
|
||||
/**
|
||||
* @brief setDefaultIconMime. Set the sytem tray icon mime.
|
||||
*
|
||||
* @param icon_mime The icon mime
|
||||
*/
|
||||
void setDefaultIconMime( const QString& icon_mime );
|
||||
|
||||
/**
|
||||
* @brief setDefaultIconData. Set the custom icon data.
|
||||
*
|
||||
* @param icon_data The icon data.
|
||||
*/
|
||||
void setDefaultIconData( const QByteArray& icon_data );
|
||||
|
||||
/**
|
||||
* @brief setIconType. Set the sytem tray icon type.
|
||||
*
|
||||
@@ -98,6 +119,16 @@ class SysTrayXIcon : public QSystemTrayIcon
|
||||
*/
|
||||
void slotSetUnreadMail( int unread_mail );
|
||||
|
||||
/**
|
||||
* @brief slotDefaultIconTypeChange. Slot for handling default icon type change signals.
|
||||
*/
|
||||
void slotDefaultIconTypeChange();
|
||||
|
||||
/**
|
||||
* @brief slotDefaultIconDataChange. Slot for handling default icon data change signals.
|
||||
*/
|
||||
void slotDefaultIconDataChange();
|
||||
|
||||
/**
|
||||
* @brief slotIconTypeChange. Slot for handling icon type change signals.
|
||||
*/
|
||||
@@ -139,6 +170,21 @@ class SysTrayXIcon : public QSystemTrayIcon
|
||||
*/
|
||||
Preferences* m_pref;
|
||||
|
||||
/**
|
||||
* @brief m_default_icon_type. Storage for the default icon type.
|
||||
*/
|
||||
Preferences::DefaultIconType m_default_icon_type;
|
||||
|
||||
/**
|
||||
* @brief m_default_icon_mime. Storage for the default icon mime.
|
||||
*/
|
||||
QString m_default_icon_mime;
|
||||
|
||||
/**
|
||||
* @brief m_default_icon_data. Storage for the default icon.
|
||||
*/
|
||||
QByteArray m_default_icon_data;
|
||||
|
||||
/**
|
||||
* @brief m_icon_type. Storage for the icon type.
|
||||
*/
|
||||
|
||||
@@ -447,6 +447,36 @@ void SysTrayXLink::DecodePreferences( const QJsonObject& pref )
|
||||
/*
|
||||
* Check the received object
|
||||
*/
|
||||
if( pref.contains( "defaultIconType" ) && pref[ "defaultIconType" ].isString() )
|
||||
{
|
||||
Preferences::DefaultIconType icon_type = static_cast< Preferences::DefaultIconType >( pref[ "defaultIconType" ].toString().toInt() );
|
||||
|
||||
/*
|
||||
* Store the new default icon type
|
||||
*/
|
||||
m_pref->setDefaultIconType( icon_type );
|
||||
}
|
||||
|
||||
if( pref.contains( "defaultIconMime" ) && pref[ "defaultIconMime" ].isString() )
|
||||
{
|
||||
QString icon_mime = pref[ "defaultIconMime" ].toString();
|
||||
|
||||
/*
|
||||
* Store the new icon mime
|
||||
*/
|
||||
m_pref->setDefaultIconMime( icon_mime );
|
||||
}
|
||||
|
||||
if( pref.contains( "defaultIcon" ) && pref[ "defaultIcon" ].isString() )
|
||||
{
|
||||
QString icon_base64 = pref[ "defaultIcon" ].toString();
|
||||
|
||||
/*
|
||||
* Store the new default icon data
|
||||
*/
|
||||
m_pref->setDefaultIconData( QByteArray::fromBase64( icon_base64.toUtf8() ) );
|
||||
}
|
||||
|
||||
if( pref.contains( "iconType" ) && pref[ "iconType" ].isString() )
|
||||
{
|
||||
Preferences::IconType icon_type = static_cast< Preferences::IconType >( pref[ "iconType" ].toString().toInt() );
|
||||
@@ -476,7 +506,6 @@ void SysTrayXLink::DecodePreferences( const QJsonObject& pref )
|
||||
*/
|
||||
m_pref->setIconData( QByteArray::fromBase64( icon_base64.toUtf8() ) );
|
||||
}
|
||||
|
||||
if( pref.contains( "showNumber" ) && pref[ "showNumber" ].isString() )
|
||||
{
|
||||
bool show_number = pref[ "showNumber" ].toString() == "true";
|
||||
@@ -502,7 +531,7 @@ void SysTrayXLink::DecodePreferences( const QJsonObject& pref )
|
||||
Preferences::CountType count_type = static_cast< Preferences::CountType >( pref[ "countType" ].toString().toInt() );
|
||||
|
||||
/*
|
||||
* Store the new icon type
|
||||
* Store the new count type
|
||||
*/
|
||||
m_pref->setCountType( count_type );
|
||||
}
|
||||
@@ -512,7 +541,7 @@ void SysTrayXLink::DecodePreferences( const QJsonObject& pref )
|
||||
Preferences::MinimizeType minimize_type = static_cast< Preferences::MinimizeType >( pref[ "minimizeType" ].toString().toInt() );
|
||||
|
||||
/*
|
||||
* Store the new icon type
|
||||
* Store the new minimize type
|
||||
*/
|
||||
m_pref->setMinimizeType( minimize_type );
|
||||
}
|
||||
@@ -562,6 +591,9 @@ void SysTrayXLink::EncodePreferences( const Preferences& pref )
|
||||
prefObject.insert("minimizeType", QJsonValue::fromVariant( QString::number( pref.getMinimizeType() ) ) );
|
||||
prefObject.insert("startMinimized", QJsonValue::fromVariant( QString( pref.getStartMinimized() ? "true" : "false" ) ) );
|
||||
prefObject.insert("minimizeOnClose", QJsonValue::fromVariant( QString( pref.getMinimizeOnClose() ? "true" : "false" ) ) );
|
||||
prefObject.insert("defaultIconType", QJsonValue::fromVariant( QString::number( pref.getDefaultIconType() ) ) );
|
||||
prefObject.insert("defaultIconMime", QJsonValue::fromVariant( pref.getDefaultIconMime() ) );
|
||||
prefObject.insert("defaultIcon", QJsonValue::fromVariant( QString( pref.getDefaultIconData().toBase64() ) ) );
|
||||
prefObject.insert("iconType", QJsonValue::fromVariant( QString::number( pref.getIconType() ) ) );
|
||||
prefObject.insert("iconMime", QJsonValue::fromVariant( pref.getIconMime() ) );
|
||||
prefObject.insert("icon", QJsonValue::fromVariant( QString( pref.getIconData().toBase64() ) ) );
|
||||
@@ -647,6 +679,31 @@ void SysTrayXLink::slotMinimizeOnCloseChange()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the default icon type change signal
|
||||
*/
|
||||
void SysTrayXLink::slotDefaultIconTypeChange()
|
||||
{
|
||||
if( m_pref->getAppPrefChanged() )
|
||||
{
|
||||
sendPreferences();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the default icon data change signal
|
||||
*/
|
||||
void SysTrayXLink::slotDefaultIconDataChange()
|
||||
{
|
||||
if( m_pref->getAppPrefChanged() )
|
||||
{
|
||||
sendPreferences();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the icon type change signal
|
||||
*/
|
||||
|
||||
@@ -210,6 +210,16 @@ class SysTrayXLink : public QObject
|
||||
*/
|
||||
void slotMinimizeOnCloseChange();
|
||||
|
||||
/**
|
||||
* @brief slotDefaultIconTypeChange. Slot for handling default icon type change signals.
|
||||
*/
|
||||
void slotDefaultIconTypeChange();
|
||||
|
||||
/**
|
||||
* @brief slotDefaultIconDataChange. Slot for handling default icon data change signals.
|
||||
*/
|
||||
void slotDefaultIconDataChange();
|
||||
|
||||
/**
|
||||
* @brief slotIconTypeChange. Slot for handling icon type change signals.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user