Fixed #73.
This commit is contained in:
parent
653b18f6fa
commit
ee9e2bcf2a
@ -9,6 +9,8 @@ Changed:
|
||||
|
||||
Fixed:
|
||||
▪ 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
|
||||
—————
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "gui/dialogs/formmain.h"
|
||||
#include "gui/tabwidget.h"
|
||||
#include "gui/plaintoolbutton.h"
|
||||
#include "miscellaneous/mutex.h"
|
||||
#include "miscellaneous/iconfactory.h"
|
||||
|
||||
#include <QToolButton>
|
||||
@ -28,7 +29,7 @@
|
||||
#include <QThread>
|
||||
|
||||
|
||||
StatusBar::StatusBar(QWidget *parent) : QStatusBar(parent) {
|
||||
StatusBar::StatusBar(QWidget *parent) : QStatusBar(parent), m_mutex(new Mutex(QMutex::NonRecursive, this)) {
|
||||
setSizeGripEnabled(false);
|
||||
setContentsMargins(2, 0, 2, 2);
|
||||
|
||||
@ -91,11 +92,15 @@ QList<QAction*> StatusBar::changeableActions() const {
|
||||
}
|
||||
|
||||
void StatusBar::saveChangeableActions(const QStringList &actions) {
|
||||
QMutexLocker locker(*m_mutex);
|
||||
|
||||
qApp->settings()->setValue(GROUP(GUI), GUI::StatusbarActions, actions.join(QSL(",")));
|
||||
loadChangeableActions(actions);
|
||||
}
|
||||
|
||||
void StatusBar::loadChangeableActions() {
|
||||
QMutexLocker locker(*m_mutex);
|
||||
|
||||
QStringList action_names = qApp->settings()->value(GROUP(GUI), SETTING(GUI::StatusbarActions)).toString().split(',',
|
||||
QString::SkipEmptyParts);
|
||||
|
||||
@ -105,6 +110,9 @@ void StatusBar::loadChangeableActions() {
|
||||
void StatusBar::loadChangeableActions(const QStringList &action_names) {
|
||||
clear();
|
||||
|
||||
bool progress_visible = actions().contains(m_barProgressFeedsAction) &&
|
||||
m_lblProgressFeeds->isVisible() &&
|
||||
m_barProgressFeeds->isVisible();
|
||||
QList<QAction*> available_actions = availableActions();
|
||||
|
||||
// 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;
|
||||
action_to_add = m_barProgressFeedsAction;
|
||||
|
||||
widget_to_add->setVisible(false);
|
||||
widget_to_add->setVisible(progress_visible);
|
||||
}
|
||||
else if (matching_action == m_lblProgressDownloadAction) {
|
||||
widget_to_add = m_lblProgressDownload;
|
||||
@ -135,7 +143,7 @@ void StatusBar::loadChangeableActions(const QStringList &action_names) {
|
||||
widget_to_add = m_lblProgressFeeds;
|
||||
action_to_add = m_lblProgressFeedsAction;
|
||||
|
||||
widget_to_add->setVisible(false);
|
||||
widget_to_add->setVisible(progress_visible);
|
||||
}
|
||||
else {
|
||||
if (action_name == SEPARATOR_ACTION_NAME) {
|
||||
|
@ -22,9 +22,11 @@
|
||||
|
||||
#include "gui/basetoolbar.h"
|
||||
|
||||
|
||||
class QProgressBar;
|
||||
class PlainToolButton;
|
||||
class QLabel;
|
||||
class Mutex;
|
||||
|
||||
class StatusBar : public QStatusBar, public BaseBar {
|
||||
Q_OBJECT
|
||||
@ -54,6 +56,8 @@ class StatusBar : public QStatusBar, public BaseBar {
|
||||
void clear();
|
||||
void loadChangeableActions(const QStringList &action_names);
|
||||
|
||||
Mutex *m_mutex;
|
||||
|
||||
QProgressBar *m_barProgressFeeds;
|
||||
QAction *m_barProgressFeedsAction;
|
||||
|
||||
|
@ -68,3 +68,7 @@ void Mutex::setUnlocked() {
|
||||
bool Mutex::isLocked() const {
|
||||
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.
|
||||
bool isLocked() const;
|
||||
|
||||
operator QMutex*() const;
|
||||
|
||||
public slots:
|
||||
void lock();
|
||||
void unlock();
|
||||
|
Loading…
x
Reference in New Issue
Block a user