2007-03-12 14:23:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file DockView.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Abdelrazak Younes
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DOCK_VIEW_H
|
|
|
|
#define DOCK_VIEW_H
|
|
|
|
|
2007-10-07 08:55:20 +00:00
|
|
|
#include "Dialog.h"
|
2007-09-08 16:04:25 +00:00
|
|
|
#include "GuiView.h"
|
|
|
|
|
|
|
|
#include <QDockWidget>
|
2010-04-26 10:03:09 +00:00
|
|
|
#include <QKeyEvent>
|
2007-03-12 14:23:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
/// Dock Widget container for LyX dialogs.
|
2007-12-10 13:05:00 +00:00
|
|
|
/**
|
|
|
|
* This template class that encapsulates a given Widget inside a
|
|
|
|
* QDockWidget and presents a Dialog interface
|
|
|
|
* FIXME: create a DockView.cpp file
|
|
|
|
**/
|
2007-10-09 21:21:01 +00:00
|
|
|
class DockView : public QDockWidget, public Dialog
|
2007-03-12 14:23:44 +00:00
|
|
|
{
|
2016-09-28 19:33:44 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
public:
|
2016-09-28 19:33:44 +00:00
|
|
|
DockView(GuiView & parent, ///< the main window where to dock.
|
|
|
|
QString const & name, ///< dialog identifier.
|
|
|
|
QString const & title, ///< dialog title.
|
|
|
|
Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of
|
|
|
|
///the dock (and
|
|
|
|
///also drawer)
|
|
|
|
Qt::WindowFlags flags = 0);
|
2007-10-08 20:14:58 +00:00
|
|
|
|
|
|
|
virtual ~DockView() {}
|
2007-03-12 14:23:44 +00:00
|
|
|
|
2007-12-09 22:35:04 +00:00
|
|
|
virtual QWidget * asQWidget() { return this; }
|
|
|
|
virtual QWidget const * asQWidget() const { return this; }
|
|
|
|
|
2008-10-03 13:34:10 +00:00
|
|
|
/// We don't want to restore geometry session for dock widgets.
|
|
|
|
void restoreSession() {}
|
|
|
|
|
2016-09-28 19:33:44 +00:00
|
|
|
void keyPressEvent(QKeyEvent * ev);
|
|
|
|
|
2007-09-08 16:04:25 +00:00
|
|
|
/// Dialog inherited methods
|
2007-03-12 14:23:44 +00:00
|
|
|
//@{
|
2007-09-03 20:28:26 +00:00
|
|
|
void applyView() {}
|
2007-09-10 22:32:59 +00:00
|
|
|
bool isClosing() const { return false; }
|
Fix bug #6451 (last part): Crash when interacting with buffer-dependent dialog with no buffer open.
- First, the comment for isBufferDependent is corrected. It seems that the actual use of this function differs from the comment. As the comment said, I decided to close all dialogs that were buffer dependent, but this didn't seem to be correct for the view source pan, the outliner, and find-and-replace.
- Second, the dialogs that are buffer dependent are now closed, but dockviews are not, except for the spellchecker pane, which really depends on an open buffer, but I can't test that.
So, please test whether the spellchecker dockviewed window behaves as one expects.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34291 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-26 02:12:10 +00:00
|
|
|
bool needBufferOpen() const { return false; }
|
2007-03-12 14:23:44 +00:00
|
|
|
//@}
|
2016-09-28 19:33:44 +00:00
|
|
|
|
|
|
|
protected Q_SLOTS:
|
|
|
|
void on_bufferViewChanged() {} //override
|
2007-03-12 14:23:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // frontend
|
|
|
|
} // lyx
|
|
|
|
|
2007-09-08 16:04:25 +00:00
|
|
|
#endif // DOCK_VIEW_H
|