Commit 3ce5023b authored by Boudewijn Rempt's avatar Boudewijn Rempt

Don't show the zoom on-canvas message while loading the image

Twice...
parent 63eff1df
......@@ -114,6 +114,7 @@ public:
, mirrorAxis(0)
, actionCollection(0)
, paintingAssistantsDecoration(0)
, shown(false)
{
tempActiveWidget = 0;
documentDeleted = false;
......@@ -154,6 +155,7 @@ public:
KisMirrorAxis* mirrorAxis;
KActionCollection* actionCollection;
KisPaintingAssistantsDecoration *paintingAssistantsDecoration;
bool shown;
// Hmm sorry for polluting the private class with such a big inner class.
// At the beginning it was a little struct :)
......@@ -291,6 +293,9 @@ KisView::~KisView()
delete d;
}
void KisView::setShown() { d->shown = true; }
bool KisView::shown() const { return d->shown; }
void KisView::setViewManager(KisViewManager *view)
{
d->viewManager = view;
......@@ -761,6 +766,12 @@ void KisView::closeEvent(QCloseEvent *event)
}
void KisView::showEvent(QShowEvent *event)
{
QWidget::showEvent(event);
QTimer::singleShot(10000, this, SLOT(setShown()));
}
bool KisView::queryClose()
{
if (!document())
......
......@@ -72,7 +72,9 @@ public:
* Creates a new view for the document.
*/
KisView(KisDocument *document, KoCanvasResourceManager *resourceManager, KActionCollection *actionCollection, QWidget *parent = 0);
~KisView();
~KisView();
bool shown() const;
KAction *undoAction() const;
KAction *redoAction() const;
......@@ -148,7 +150,7 @@ public:
/**
* Return the zoomController for this view.
*/
KoZoomController *zoomController() const;
KoZoomController *zoomController() const;
/// create a list of actions that when activated will change the unit on the document.
QList<QAction*> createChangeUnitActions(bool addPixelUnit = false);
......@@ -227,11 +229,11 @@ Q_SIGNALS:
protected:
// QWidget overrides
void dragEnterEvent(QDragEnterEvent * event);
void dropEvent(QDropEvent * event);
bool event( QEvent* event );
void closeEvent(QCloseEvent *event);
void dragEnterEvent(QDragEnterEvent * event);
void dropEvent(QDropEvent * event);
bool event( QEvent* event );
void closeEvent(QCloseEvent *event);
void showEvent(QShowEvent *event);
/**
* Generate a name for this view.
*/
......@@ -243,6 +245,10 @@ public Q_SLOTS:
void slotImageResolutionChanged();
void slotImageSizeChanged(const QPointF &oldStillPoint, const QPointF &newStillPoint);
private Q_SLOTS:
void setShown();
private:
class Private;
......
......@@ -227,7 +227,7 @@ void KisZoomManager::slotZoomChanged(KoZoomMode::Mode mode, qreal zoom)
qreal humanZoom = zoom * 100.0;
// XXX: KOMVC -- this is very irritating in MDI mode
if (m_view->viewManager()) {
if (m_view->shown() && m_view->viewManager()) {
m_view->viewManager()->
showFloatingMessage(
i18nc("floating message about zoom", "Zoom: %1 \%",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment