mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
* Dialog.cpp: whitespace
* DialogView: remove cruft. * GuiDialog: add cruft and don't depend on DialogView as GuiDialog is meant for extinction eventually. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22783 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2f1699747a
commit
8c27d557b9
@ -48,6 +48,7 @@ string const & Dialog::name() const
|
||||
return name_;
|
||||
}
|
||||
|
||||
|
||||
bool Dialog::canApply() const
|
||||
{
|
||||
FuncRequest const fr(getLfun(), from_ascii(name_));
|
||||
|
@ -27,12 +27,6 @@ DialogView::DialogView(GuiView & lv, string const & name)
|
||||
: QDialog(&lv), Dialog(lv, name)
|
||||
{}
|
||||
|
||||
|
||||
void DialogView::setViewTitle(docstring const & title)
|
||||
{
|
||||
setWindowTitle("LyX: " + toqstr(title));
|
||||
}
|
||||
|
||||
} // namespace frontend
|
||||
} // namespace lyx
|
||||
|
||||
|
@ -16,9 +16,6 @@
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class QCloseEvent;
|
||||
class QShowEvent;
|
||||
|
||||
namespace lyx {
|
||||
namespace frontend {
|
||||
|
||||
@ -40,9 +37,6 @@ public:
|
||||
virtual QWidget const * asQWidget() const { return this; }
|
||||
|
||||
protected:
|
||||
///
|
||||
void setViewTitle(docstring const & title);
|
||||
|
||||
/// Dialog inherited methods
|
||||
//@{
|
||||
void applyView() {}
|
||||
|
@ -27,10 +27,16 @@ namespace lyx {
|
||||
namespace frontend {
|
||||
|
||||
GuiDialog::GuiDialog(GuiView & lv, string const & name)
|
||||
: DialogView(lv, name), is_closing_(false)
|
||||
: QDialog(&lv), Dialog(lv, name), is_closing_(false)
|
||||
{}
|
||||
|
||||
|
||||
void GuiDialog::setViewTitle(docstring const & title)
|
||||
{
|
||||
setWindowTitle("LyX: " + toqstr(title));
|
||||
}
|
||||
|
||||
|
||||
void GuiDialog::setButtonsValid(bool valid)
|
||||
{
|
||||
bc().setValid(valid);
|
||||
@ -83,7 +89,7 @@ void GuiDialog::enableView(bool enable)
|
||||
{
|
||||
bc().setReadOnly(!enable);
|
||||
bc().setValid(enable);
|
||||
DialogView::enableView(enable);
|
||||
Dialog::enableView(enable);
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,18 +12,26 @@
|
||||
#ifndef GUIDIALOG_H
|
||||
#define GUIDIALOG_H
|
||||
|
||||
#include "DialogView.h"
|
||||
#include "Dialog.h"
|
||||
#include "ButtonController.h"
|
||||
|
||||
#include "insets/InsetCommandParams.h"
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class QCloseEvent;
|
||||
class QShowEvent;
|
||||
|
||||
namespace lyx {
|
||||
namespace frontend {
|
||||
|
||||
/** \c Dialog collects the different parts of a Model-Controller-View
|
||||
* split of a generic dialog together.
|
||||
*/
|
||||
class GuiDialog : public DialogView
|
||||
/// Base class for historical LyX dialogs.
|
||||
/**
|
||||
* \warning New dialogs should use the leaner classes \c DialogView or
|
||||
* \c DockView depending on the intent. Eventally, old dialog should be
|
||||
* converted to \c DialogView too.
|
||||
*/
|
||||
class GuiDialog : public QDialog, public Dialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -33,6 +41,9 @@ public:
|
||||
/// container.
|
||||
explicit GuiDialog(GuiView & lv, std::string const & name);
|
||||
|
||||
virtual QWidget * asQWidget() { return this; }
|
||||
virtual QWidget const * asQWidget() const { return this; }
|
||||
|
||||
public Q_SLOTS:
|
||||
/** \name Buttons
|
||||
* These methods are publicly accessible because they are invoked
|
||||
@ -48,6 +59,9 @@ public Q_SLOTS:
|
||||
void slotClose();
|
||||
|
||||
public:
|
||||
///
|
||||
void setViewTitle(docstring const & title);
|
||||
|
||||
/** Check whether we may apply our data.
|
||||
*
|
||||
* The buttons are disabled if not and (re-)enabled if yes.
|
||||
|
Loading…
Reference in New Issue
Block a user