ui: removed auto refresh

This commit is contained in:
Eberhard Graether
2016-08-24 13:28:28 +02:00
parent 994a749b80
commit 01f740276b
10 changed files with 4 additions and 98 deletions
-22
View File
@@ -3,7 +3,6 @@
#include <QHBoxLayout>
#include <QPushButton>
#include "utility/messaging/type/MessageAutoRefreshChanged.h"
#include "utility/messaging/type/MessageRefresh.h"
#include "utility/ResourcePaths.h"
@@ -29,21 +28,12 @@ QtRefreshBar::QtRefreshBar()
m_refreshButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
layout->addWidget(m_refreshButton);
m_autoRefreshButton = new QPushButton(this);
m_autoRefreshButton->setObjectName("auto_refresh_button");
m_autoRefreshButton->setCheckable(true);
m_autoRefreshButton->setToolTip("automatic refresh on window focus");
m_autoRefreshButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
layout->addWidget(m_autoRefreshButton);
if (isTrial())
{
m_refreshButton->setEnabled(false);
m_autoRefreshButton->setEnabled(false);
}
connect(m_refreshButton, SIGNAL(clicked()), this, SLOT(refreshClicked()));
connect(m_autoRefreshButton, SIGNAL(clicked()), this, SLOT(autoRefreshClicked()));
refreshStyle();
}
@@ -57,27 +47,15 @@ void QtRefreshBar::refreshClicked()
MessageRefresh().dispatch();
}
void QtRefreshBar::autoRefreshClicked()
{
MessageAutoRefreshChanged(m_autoRefreshButton->isChecked()).dispatch();
}
void QtRefreshBar::refreshStyle()
{
float height = std::max(ApplicationSettings::getInstance()->getFontSize() + 16, 30);
m_refreshButton->setFixedHeight(height);
m_autoRefreshButton->setFixedHeight(height);
std::string map = ResourcePaths::getGuiPath() + "refresh_view/images/refresh.png";
m_refreshButton->setIcon(utility::colorizePixmap(
QPixmap(map.c_str()),
ColorScheme::getInstance()->getColor("search/button/icon").c_str()
));
map = ResourcePaths::getGuiPath() + "refresh_view/images/auto_refresh.png";
m_autoRefreshButton->setIcon(utility::colorizePixmap(
QPixmap(map.c_str()),
ColorScheme::getInstance()->getColor("search/button/icon").c_str()
));
}
-2
View File
@@ -18,11 +18,9 @@ public:
private slots:
void refreshClicked();
void autoRefreshClicked();
private:
QPushButton* m_refreshButton;
QPushButton* m_autoRefreshButton;
};
#endif // QT_REFRESH_BAR_H
@@ -303,6 +303,7 @@ void QtIndexingDialog::addMessageLabel(QBoxLayout* layout)
m_messageLabel = new QLabel();
m_messageLabel->setObjectName("message");
m_messageLabel->setAlignment(Qt::AlignRight);
m_messageLabel->setWordWrap(true);
layout->addWidget(m_messageLabel, 0, Qt::AlignRight);
}