Fixed #73.
This commit is contained in:
parent
653b18f6fa
commit
ee9e2bcf2a
@ -9,6 +9,8 @@ Changed:
|
|||||||
|
|
||||||
Fixed:
|
Fixed:
|
||||||
▪ Fixed problem with strings in core being rendered untranslated. (bug #60)
|
▪ Fixed problem with strings in core being rendered untranslated. (bug #60)
|
||||||
|
▪ Fixed problem with feed updates progress bar flickering. (bug #73)
|
||||||
|
▪ Partially fixed problem with incorrect number of downloaded messages being reported. (bug #70)
|
||||||
|
|
||||||
3.3.5
|
3.3.5
|
||||||
—————
|
—————
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "gui/dialogs/formmain.h"
|
#include "gui/dialogs/formmain.h"
|
||||||
#include "gui/tabwidget.h"
|
#include "gui/tabwidget.h"
|
||||||
#include "gui/plaintoolbutton.h"
|
#include "gui/plaintoolbutton.h"
|
||||||
|
#include "miscellaneous/mutex.h"
|
||||||
#include "miscellaneous/iconfactory.h"
|
#include "miscellaneous/iconfactory.h"
|
||||||
|
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
@ -28,7 +29,7 @@
|
|||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|
||||||
|
|
||||||
StatusBar::StatusBar(QWidget *parent) : QStatusBar(parent) {
|
StatusBar::StatusBar(QWidget *parent) : QStatusBar(parent), m_mutex(new Mutex(QMutex::NonRecursive, this)) {
|
||||||
setSizeGripEnabled(false);
|
setSizeGripEnabled(false);
|
||||||
setContentsMargins(2, 0, 2, 2);
|
setContentsMargins(2, 0, 2, 2);
|
||||||
|
|
||||||
@ -72,11 +73,11 @@ StatusBar::StatusBar(QWidget *parent) : QStatusBar(parent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StatusBar::~StatusBar() {
|
StatusBar::~StatusBar() {
|
||||||
clear();
|
clear();
|
||||||
qDebug("Destroying StatusBar instance.");
|
qDebug("Destroying StatusBar instance.");
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QAction*> StatusBar::availableActions() const {
|
QList<QAction*> StatusBar::availableActions() const {
|
||||||
QList<QAction*> actions = qApp->userActions();
|
QList<QAction*> actions = qApp->userActions();
|
||||||
|
|
||||||
// Now, add placeholder actions for custom stuff.
|
// Now, add placeholder actions for custom stuff.
|
||||||
@ -91,11 +92,15 @@ QList<QAction*> StatusBar::changeableActions() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void StatusBar::saveChangeableActions(const QStringList &actions) {
|
void StatusBar::saveChangeableActions(const QStringList &actions) {
|
||||||
|
QMutexLocker locker(*m_mutex);
|
||||||
|
|
||||||
qApp->settings()->setValue(GROUP(GUI), GUI::StatusbarActions, actions.join(QSL(",")));
|
qApp->settings()->setValue(GROUP(GUI), GUI::StatusbarActions, actions.join(QSL(",")));
|
||||||
loadChangeableActions(actions);
|
loadChangeableActions(actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatusBar::loadChangeableActions() {
|
void StatusBar::loadChangeableActions() {
|
||||||
|
QMutexLocker locker(*m_mutex);
|
||||||
|
|
||||||
QStringList action_names = qApp->settings()->value(GROUP(GUI), SETTING(GUI::StatusbarActions)).toString().split(',',
|
QStringList action_names = qApp->settings()->value(GROUP(GUI), SETTING(GUI::StatusbarActions)).toString().split(',',
|
||||||
QString::SkipEmptyParts);
|
QString::SkipEmptyParts);
|
||||||
|
|
||||||
@ -105,6 +110,9 @@ void StatusBar::loadChangeableActions() {
|
|||||||
void StatusBar::loadChangeableActions(const QStringList &action_names) {
|
void StatusBar::loadChangeableActions(const QStringList &action_names) {
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
|
bool progress_visible = actions().contains(m_barProgressFeedsAction) &&
|
||||||
|
m_lblProgressFeeds->isVisible() &&
|
||||||
|
m_barProgressFeeds->isVisible();
|
||||||
QList<QAction*> available_actions = availableActions();
|
QList<QAction*> available_actions = availableActions();
|
||||||
|
|
||||||
// Iterate action names and add respectable actions into the toolbar.
|
// Iterate action names and add respectable actions into the toolbar.
|
||||||
@ -123,7 +131,7 @@ void StatusBar::loadChangeableActions(const QStringList &action_names) {
|
|||||||
widget_to_add = m_barProgressFeeds;
|
widget_to_add = m_barProgressFeeds;
|
||||||
action_to_add = m_barProgressFeedsAction;
|
action_to_add = m_barProgressFeedsAction;
|
||||||
|
|
||||||
widget_to_add->setVisible(false);
|
widget_to_add->setVisible(progress_visible);
|
||||||
}
|
}
|
||||||
else if (matching_action == m_lblProgressDownloadAction) {
|
else if (matching_action == m_lblProgressDownloadAction) {
|
||||||
widget_to_add = m_lblProgressDownload;
|
widget_to_add = m_lblProgressDownload;
|
||||||
@ -135,7 +143,7 @@ void StatusBar::loadChangeableActions(const QStringList &action_names) {
|
|||||||
widget_to_add = m_lblProgressFeeds;
|
widget_to_add = m_lblProgressFeeds;
|
||||||
action_to_add = m_lblProgressFeedsAction;
|
action_to_add = m_lblProgressFeedsAction;
|
||||||
|
|
||||||
widget_to_add->setVisible(false);
|
widget_to_add->setVisible(progress_visible);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (action_name == SEPARATOR_ACTION_NAME) {
|
if (action_name == SEPARATOR_ACTION_NAME) {
|
||||||
|
@ -22,9 +22,11 @@
|
|||||||
|
|
||||||
#include "gui/basetoolbar.h"
|
#include "gui/basetoolbar.h"
|
||||||
|
|
||||||
|
|
||||||
class QProgressBar;
|
class QProgressBar;
|
||||||
class PlainToolButton;
|
class PlainToolButton;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
|
class Mutex;
|
||||||
|
|
||||||
class StatusBar : public QStatusBar, public BaseBar {
|
class StatusBar : public QStatusBar, public BaseBar {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -54,6 +56,8 @@ class StatusBar : public QStatusBar, public BaseBar {
|
|||||||
void clear();
|
void clear();
|
||||||
void loadChangeableActions(const QStringList &action_names);
|
void loadChangeableActions(const QStringList &action_names);
|
||||||
|
|
||||||
|
Mutex *m_mutex;
|
||||||
|
|
||||||
QProgressBar *m_barProgressFeeds;
|
QProgressBar *m_barProgressFeeds;
|
||||||
QAction *m_barProgressFeedsAction;
|
QAction *m_barProgressFeedsAction;
|
||||||
|
|
||||||
|
@ -68,3 +68,7 @@ void Mutex::setUnlocked() {
|
|||||||
bool Mutex::isLocked() const {
|
bool Mutex::isLocked() const {
|
||||||
return m_isLocked;
|
return m_isLocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Mutex::operator QMutex*() const {
|
||||||
|
return m_mutex.data();
|
||||||
|
}
|
||||||
|
@ -37,6 +37,8 @@ class Mutex : public QObject {
|
|||||||
// Identifies if mutes is locked or not.
|
// Identifies if mutes is locked or not.
|
||||||
bool isLocked() const;
|
bool isLocked() const;
|
||||||
|
|
||||||
|
operator QMutex*() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void lock();
|
void lock();
|
||||||
void unlock();
|
void unlock();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user