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
-4
View File
@@ -3,7 +3,3 @@ QToolTip {
color: black;
font-size: <setting:font_size>pt;
}
* {
font-family: "Roboto";
}
@@ -22,12 +22,7 @@ QPushButton:pressed {
}
#refresh_button {
border-bottom-left-radius: 12px;
border-top-left-radius: 12px;
margin-right: 2px;
}
#auto_refresh_button {
border-bottom-right-radius: 12px;
border-top-right-radius: 12px;
/*border-bottom-left-radius: 12px;*/
/*border-top-left-radius: 12px;*/
border-radius: 12px;
}
-1
View File
@@ -1,6 +1,5 @@
* {
font-size: 12pt;
font-family: "Roboto";
}
#title {
-1
View File
@@ -250,7 +250,6 @@ add_files(
utility/messaging/type/MessageActivateTokenIds.h
utility/messaging/type/MessageActivateTokens.h
utility/messaging/type/MessageActivateWindow.h
utility/messaging/type/MessageAutoRefreshChanged.h
utility/messaging/type/MessageChangeFileView.h
utility/messaging/type/MessageClearErrorCount.h
utility/messaging/type/MessageCodeReference.h
@@ -1,11 +1,8 @@
#include "component/controller/RefreshController.h"
#include "utility/messaging/type/MessageRefresh.h"
#include "component/view/RefreshView.h"
RefreshController::RefreshController()
: m_autoRefreshEnabled(false)
{
}
@@ -17,19 +14,6 @@ void RefreshController::clear()
{
}
void RefreshController::handleMessage(MessageAutoRefreshChanged* message)
{
m_autoRefreshEnabled = message->enabled;
}
void RefreshController::handleMessage(MessageWindowFocus* message)
{
if (m_autoRefreshEnabled)
{
MessageRefresh().dispatch();
}
}
RefreshView* RefreshController::getView()
{
return Controller::getView<RefreshView>();
@@ -2,16 +2,11 @@
#define REFRESH_CONTROLLER_H
#include "component/controller/Controller.h"
#include "utility/messaging/MessageListener.h"
#include "utility/messaging/type/MessageAutoRefreshChanged.h"
#include "utility/messaging/type/MessageWindowFocus.h"
class RefreshView;
class RefreshController
: public Controller
, public MessageListener<MessageAutoRefreshChanged>
, public MessageListener<MessageWindowFocus>
{
public:
RefreshController();
@@ -20,12 +15,7 @@ public:
virtual void clear();
private:
virtual void handleMessage(MessageAutoRefreshChanged* message);
virtual void handleMessage(MessageWindowFocus* message);
RefreshView* getView();
bool m_autoRefreshEnabled;
};
#endif // REFRESH_CONTROLLER_H
@@ -1,34 +0,0 @@
#ifndef MESSAGE_AUTO_REFRESH_CHANGED_H
#define MESSAGE_AUTO_REFRESH_CHANGED_H
#include "utility/messaging/Message.h"
class MessageAutoRefreshChanged: public Message<MessageAutoRefreshChanged>
{
public:
MessageAutoRefreshChanged(bool enabled)
: enabled(enabled)
{
}
static const std::string getStaticType()
{
return "MessageAutoRefreshChanged";
}
virtual void print(std::ostream& os) const
{
if (enabled)
{
os << "enabled";
}
else
{
os << "disabled";
}
}
bool enabled;
};
#endif // MESSAGE_AUTO_REFRESH_CHANGED_H
-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);
}