...
 
Commits (3)
......@@ -55,6 +55,10 @@ You can also enable birdtray to start Thunderbird when you start Birdtray, or en
Once you change settings, often you need to restart birdtray for the new settings to take effect.
## Troubleshooting
If you have lots of unread messages shown, and you are using global search database to look for unread messages, it may be because the database is corrupt or too old. You may delete the file global-messages-db.sqlite and restart Thunderbird which would rebuild this file. This will also help if "search" function in Thunderbird finds emails which no longer exist.
## Submitting bugs and feature requests
Please use Github issue tracker.
......
......@@ -62,6 +62,7 @@ DialogSettings::DialogSettings( QWidget *parent)
boxEnableNewEmail->setChecked( pSettings->mNewEmailMenuEnabled );
boxBlinkingUsesAlpha->setChecked( pSettings->mBlinkingUseAlphaTransition );
boxAllowSuppression->setChecked( pSettings->mAllowSuppressingUnreads );
spinUnreadOpacityLevel->setValue( pSettings->mUnreadOpacityLevel * 100 );
if ( pSettings->mLaunchThunderbird )
boxStopThunderbirdOnExit->setChecked( pSettings->mExitThunderbirdWhenQuit );
......@@ -161,6 +162,7 @@ void DialogSettings::accept()
pSettings->mNewEmailMenuEnabled = boxEnableNewEmail->isChecked();
pSettings->mBlinkingUseAlphaTransition = boxBlinkingUsesAlpha->isChecked();
pSettings->mUseMorkParser = isMorkParserSelected();
pSettings->mUnreadOpacityLevel = (double) spinUnreadOpacityLevel->value() / 100.0;
pSettings->mNotificationIcon = btnNotificationIcon->icon().pixmap( pSettings->mIconSize );
......
This diff is collapsed.
......@@ -6,9 +6,12 @@
ModelAccountTree::ModelAccountTree( QObject *parent )
: QAbstractItemModel( parent )
{
// Get the current settings
mAccounts = pSettings->mFolderNotificationColors.keys();
mColors = pSettings->mFolderNotificationColors.values();
// Get the current settings in proper(stored) order
for ( QString uri : pSettings->mFolderNotificationList )
{
mAccounts.push_back( uri );
mColors.push_back( pSettings->mFolderNotificationColors[uri] );
}
}
int ModelAccountTree::columnCount(const QModelIndex &) const
......@@ -118,9 +121,11 @@ void ModelAccountTree::clear()
void ModelAccountTree::applySettings()
{
pSettings->mFolderNotificationColors.clear();
pSettings->mFolderNotificationList.clear();
for ( int i = 0; i < mAccounts.size(); i++ )
{
pSettings->mFolderNotificationList.push_back( mAccounts[i] );
pSettings->mFolderNotificationColors[ mAccounts[i] ] = mColors[i];
}
}
......@@ -37,12 +37,13 @@ void Settings::save()
settings.setValue("advanced/notificationfontmaxsize", mNotificationMaximumFontSize );
settings.setValue("advanced/watchfiletimeout", mWatchFileTimeout );
settings.setValue("advanced/blinkingusealpha", mBlinkingUseAlphaTransition );
settings.setValue("advanced/unreadopacitylevel", mUnreadOpacityLevel );
// Convert the map into settings
settings.setValue("accounts/count", mFolderNotificationColors.size() );
int index = 0;
for ( QString uri : mFolderNotificationColors.keys() )
for ( QString uri : mFolderNotificationList )
{
QString entry = "accounts/account" + QString::number( index );
settings.setValue( entry + "Color", mFolderNotificationColors[uri].name() );
......@@ -106,6 +107,7 @@ void Settings::load()
mUseMorkParser = settings.value("advanced/unreadmorkparser", true ).toBool();
mWatchFileTimeout = settings.value("advanced/watchfiletimeout", 150 ).toUInt();
mBlinkingUseAlphaTransition = settings.value("advanced/blinkingusealpha", false ).toBool();
mUnreadOpacityLevel = settings.value("advanced/unreadopacitylevel", 0.75 ).toDouble();
mFolderNotificationColors.clear();
......@@ -115,7 +117,9 @@ void Settings::load()
for ( int index = 0; index < total; index++ )
{
QString entry = "accounts/account" + QString::number( index );
mFolderNotificationColors[ settings.value( entry + "URI", "" ).toString() ] = QColor( settings.value( entry + "Color", "" ).toString() );
QString key = settings.value( entry + "URI", "" ).toString();
mFolderNotificationColors[ key ] = QColor( settings.value( entry + "Color", "" ).toString() );
mFolderNotificationList.push_back( key );
}
// Load new email data from settings
......
......@@ -37,6 +37,9 @@ class Settings
// Blinking speed
unsigned int mBlinkSpeed;
// Opacity level for the tray icon when unread email is present (0.0-1.0)
double mUnreadOpacityLevel;
// Path to Thunderbird folder
QString mThunderbirdFolderPath;
......@@ -90,8 +93,10 @@ class Settings
bool mNewEmailMenuEnabled;
QList< Setting_NewEmail > mNewEmailData;
// Maps the folder URI or full path (for Mork) to the notification color
// Maps the folder URI or full path (for Mork) to the notification color.
// The original order of strings is stored in mFolderNotificationList (to show in UI)
QMap< QString, QColor > mFolderNotificationColors;
QStringList mFolderNotificationList;
// Load and save them
void save();
......
......@@ -316,13 +316,13 @@ void TrayIcon::blinkTimeout()
if ( pSettings->mBlinkSpeed != 0 )
{
// Flip the opacity
if ( mBlinkingIconOpacity == 0.75 )
mBlinkingIconOpacity = 0.15;
if ( mBlinkingIconOpacity == pSettings->mUnreadOpacityLevel )
mBlinkingIconOpacity = 1.0 - pSettings->mUnreadOpacityLevel;
else
mBlinkingIconOpacity = 0.75;
mBlinkingIconOpacity = pSettings->mUnreadOpacityLevel;
}
else
mBlinkingIconOpacity = 0.75;
mBlinkingIconOpacity = pSettings->mUnreadOpacityLevel;
}
updateIcon();
......