projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Properly clean up after disconnecting
[quassel.git]
/
src
/
uisupport
/
graphicalui.cpp
diff --git
a/src/uisupport/graphicalui.cpp
b/src/uisupport/graphicalui.cpp
index
5d9a419
..
c2422b3
100644
(file)
--- a/
src/uisupport/graphicalui.cpp
+++ b/
src/uisupport/graphicalui.cpp
@@
-25,6
+25,7
@@
#include "actioncollection.h"
#include "contextmenuactionprovider.h"
#include "actioncollection.h"
#include "contextmenuactionprovider.h"
+#include "toolbaractionprovider.h"
#ifdef Q_WS_X11
# include <QX11Info>
#ifdef Q_WS_X11
# include <QX11Info>
@@
-48,14
+49,12
@@
GraphicalUi::GraphicalUi(QObject *parent) : AbstractUi(parent) {
#ifdef Q_WS_WIN
_dwTickCount = 0;
#ifdef Q_WS_WIN
_dwTickCount = 0;
- mainWidget()->installEventFilter(this);
#endif
#endif
-
}
}
-
GraphicalUi::~GraphicalUi
() {
+
void GraphicalUi::init
() {
#ifdef Q_WS_WIN
#ifdef Q_WS_WIN
- mainWidget()->
remove
EventFilter(this);
+ mainWidget()->
install
EventFilter(this);
#endif
}
#endif
}
@@
-85,6
+84,12
@@
void GraphicalUi::setUiStyle(UiStyle *style) {
_uiStyle = style;
}
_uiStyle = style;
}
+void GraphicalUi::disconnectedFromCore() {
+ _contextMenuActionProvider->disconnectedFromCore();
+ _toolBarActionProvider->disconnectedFromCore();
+ AbstractUi::disconnectedFromCore();
+}
+
bool GraphicalUi::eventFilter(QObject *obj, QEvent *event) {
#ifdef Q_WS_WIN
if(obj == mainWidget() && event->type() == QEvent::ActivationChange) {
bool GraphicalUi::eventFilter(QObject *obj, QEvent *event) {
#ifdef Q_WS_WIN
if(obj == mainWidget() && event->type() == QEvent::ActivationChange) {
@@
-103,9
+108,13
@@
bool GraphicalUi::checkMainWidgetVisibility(bool perform) {
// therefore we watch for activation event and use our stopwatch :)
if(GetTickCount() - _dwTickCount < 300) {
// we were active in the last 300ms -> hide it
// therefore we watch for activation event and use our stopwatch :)
if(GetTickCount() - _dwTickCount < 300) {
// we were active in the last 300ms -> hide it
- minimizeRestore(false);
+ if(perform)
+ minimizeRestore(false);
+ return false;
} else {
} else {
- minimizeRestore(true);
+ if(perform)
+ minimizeRestore(true);
+ return true;
}
#elif defined(HAVE_KDE) && defined(Q_WS_X11)
}
#elif defined(HAVE_KDE) && defined(Q_WS_X11)
@@
-184,6
+193,10
@@
bool GraphicalUi::checkMainWidgetVisibility(bool perform) {
return true;
}
return true;
}
+bool GraphicalUi::isMainWidgetVisible() {
+ return !instance()->checkMainWidgetVisibility(false);
+}
+
void GraphicalUi::minimizeRestore(bool show) {
if(show)
activateMainWidget();
void GraphicalUi::minimizeRestore(bool show) {
if(show)
activateMainWidget();