mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
The QNote dialog
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7280 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
69572ae035
commit
dc85736c7f
@ -229,7 +229,7 @@
|
||||
vertical spaces
|
||||
@bJürgen Spitzmüller
|
||||
@iE-mail: j.spitzmueller@gmx.de
|
||||
Many improvements to xforms dialogs
|
||||
Qt frontend, bugfixes
|
||||
@bBen Stanley
|
||||
@iE-mail: bds02@uow.edu.au
|
||||
fix bugs with error insets placement
|
||||
|
@ -1,3 +1,7 @@
|
||||
2003-07-09 Juergen Spitzmueller <j.spitzmueller@gmx.de>
|
||||
|
||||
* CREDITS: update.
|
||||
|
||||
2003-07-10 John Levon <levon@movementarian.org>
|
||||
|
||||
* ui/classic.ui: fix toolbars to new scheme, fix space inserts
|
||||
|
@ -60,6 +60,7 @@ src/frontends/qt2/QMath.C
|
||||
src/frontends/qt2/QMathDialog.C
|
||||
src/frontends/qt2/QMathMatrixDialog.C
|
||||
src/frontends/qt2/QMinipage.C
|
||||
src/frontends/qt2/QNote.C
|
||||
src/frontends/qt2/QParagraph.C
|
||||
src/frontends/qt2/QPrefs.C
|
||||
src/frontends/qt2/QPrefsDialog.C
|
||||
|
@ -4,6 +4,15 @@
|
||||
sure that it is initialized to some reasonable value, so that the
|
||||
(ugly) Qt/Mac code can do its magic (conditionally on Q_WS_MAC).
|
||||
|
||||
2003-07-09 Juergen Spitzmueller <j.spitzmueller@gmx.de>
|
||||
|
||||
* ui/QNoteDialog.ui:
|
||||
* QNoteDialog.[Ch]:
|
||||
* QNote.[Ch]:
|
||||
* Makefile.dialogs:
|
||||
* Dialogs.C:
|
||||
* Dialogs2.C: New Annotation (Note) dialog
|
||||
|
||||
2003-07-11 André Pönitz <poenitz@lyx.org>
|
||||
|
||||
* Alert_pimpl.C:
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "ControlLog.h"
|
||||
#include "ControlMath.h"
|
||||
#include "ControlMinipage.h"
|
||||
#include "ControlNote.h"
|
||||
#include "ControlParagraph.h"
|
||||
#include "ControlRef.h"
|
||||
#include "ControlShowFile.h"
|
||||
@ -57,6 +58,7 @@
|
||||
#include "QLog.h"
|
||||
#include "QMath.h"
|
||||
#include "QMinipage.h"
|
||||
#include "QNote.h"
|
||||
#include "QParagraph.h"
|
||||
#include "QRef.h"
|
||||
#include "QShowFile.h"
|
||||
@ -84,7 +86,7 @@ char const * const dialognames[] = { "aboutlyx", "bibitem", "bibtex", "changes",
|
||||
"character", "citation", "error", "errorlist", "ert", "external", "file",
|
||||
"float", "graphics", "include", "index", "label", "latexlog",
|
||||
"mathpanel", "mathdelimiter", "mathmatrix",
|
||||
"minipage", "paragraph", "ref", "tabular", "tabularcreate", "texinfo",
|
||||
"minipage", "note", "paragraph", "ref", "tabular", "tabularcreate", "texinfo",
|
||||
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
"thesaurus",
|
||||
@ -207,6 +209,10 @@ Dialog * Dialogs::build(string const & name)
|
||||
dialog->setController(new ControlMinipage(*dialog));
|
||||
dialog->setView(new QMinipage(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "note") {
|
||||
dialog->setController(new ControlNote(*dialog));
|
||||
dialog->setView(new QNote(*dialog));
|
||||
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
|
||||
} else if (name == "paragraph") {
|
||||
dialog->setController(new ControlParagraph(*dialog));
|
||||
dialog->setView(new QParagraph(*dialog));
|
||||
|
@ -47,6 +47,7 @@ libqt2_la_SOURCES = \
|
||||
QLyXKeySym.C QLyXKeySym.h \
|
||||
QMath.C QMath.h \
|
||||
QMinipage.C QMinipage.h \
|
||||
QNote.C QNote.h \
|
||||
QParagraph.C QParagraph.h \
|
||||
QPrefs.C QPrefs.h \
|
||||
QPrint.C QPrint.h \
|
||||
|
@ -33,6 +33,7 @@ UIFILES = \
|
||||
QMathDialogBase.ui \
|
||||
QMathMatrixDialogBase.ui \
|
||||
QMinipageDialogBase.ui \
|
||||
QNoteDialogBase.ui \
|
||||
QParagraphDialogBase.ui \
|
||||
QPrefAsciiModule.ui \
|
||||
QPrefColorsModule.ui \
|
||||
@ -100,6 +101,7 @@ MOCFILES = \
|
||||
QMathDialog.C QMathDialog.h \
|
||||
QMathMatrixDialog.C QMathMatrixDialog.h \
|
||||
QMinipageDialog.C QMinipageDialog.h \
|
||||
QNoteDialog.C QNoteDialog.h \
|
||||
QParagraphDialog.C QParagraphDialog.h \
|
||||
QPrefsDialog.C QPrefsDialog.h \
|
||||
QRefDialog.C QRefDialog.h \
|
||||
|
71
src/frontends/qt2/QNote.C
Normal file
71
src/frontends/qt2/QNote.C
Normal file
@ -0,0 +1,71 @@
|
||||
/**
|
||||
* \file QNote.C
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author Juergen Spitzmueller
|
||||
*
|
||||
* Full author contact details are available in file CREDITS
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "ControlNote.h"
|
||||
#include "qt_helpers.h"
|
||||
#include "insets/insetnote.h"
|
||||
|
||||
#include <qradiobutton.h>
|
||||
#include <qpushbutton.h>
|
||||
|
||||
#include "QNoteDialog.h"
|
||||
#include "QNote.h"
|
||||
#include "Qt2BC.h"
|
||||
|
||||
|
||||
typedef QController<ControlNote, QView<QNoteDialog> > base_class;
|
||||
|
||||
|
||||
QNote::QNote(Dialog & parent)
|
||||
: base_class(parent, _("LyX: Annotation Settings"))
|
||||
{}
|
||||
|
||||
|
||||
void QNote::build_dialog()
|
||||
{
|
||||
dialog_.reset(new QNoteDialog(this));
|
||||
|
||||
bcview().setOK(dialog_->okPB);
|
||||
bcview().setCancel(dialog_->closePB);
|
||||
}
|
||||
|
||||
|
||||
void QNote::update_contents()
|
||||
{
|
||||
QRadioButton * rb = 0;
|
||||
string type(controller().params().type);
|
||||
|
||||
if (type == "Note")
|
||||
rb = dialog_->noteRB;
|
||||
else if (type == "Comment")
|
||||
rb = dialog_->commentRB;
|
||||
else if (type == "Greyedout")
|
||||
rb = dialog_->greyedoutRB;
|
||||
|
||||
rb->setChecked(true);
|
||||
}
|
||||
|
||||
|
||||
void QNote::apply()
|
||||
{
|
||||
string type;
|
||||
|
||||
if (dialog_->greyedoutRB->isChecked())
|
||||
type = "Greyedout";
|
||||
else if (dialog_->commentRB->isChecked())
|
||||
type = "Comment";
|
||||
else
|
||||
type = "Note";
|
||||
|
||||
controller().params().type = type;
|
||||
}
|
||||
|
39
src/frontends/qt2/QNote.h
Normal file
39
src/frontends/qt2/QNote.h
Normal file
@ -0,0 +1,39 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* \file QNote.h
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author Juergen Spitzmueller
|
||||
*
|
||||
* Full author contact details are available in file CREDITS
|
||||
*/
|
||||
|
||||
#ifndef QNOTE_H
|
||||
#define QNOTE_H
|
||||
|
||||
#include "QDialogView.h"
|
||||
|
||||
|
||||
class ControlNote;
|
||||
class QNoteDialog;
|
||||
|
||||
/** This class provides a QT implementation of the Note Dialog.
|
||||
*/
|
||||
class QNote : public QController<ControlNote, QView<QNoteDialog> >
|
||||
{
|
||||
public:
|
||||
friend class QNoteDialog;
|
||||
|
||||
/// Constructor
|
||||
QNote(Dialog &);
|
||||
private:
|
||||
/// Apply changes
|
||||
virtual void apply();
|
||||
/// Build the dialog
|
||||
virtual void build_dialog();
|
||||
/// Update dialog before showing it
|
||||
virtual void update_contents();
|
||||
};
|
||||
|
||||
#endif // QNOTE_H
|
41
src/frontends/qt2/QNoteDialog.C
Normal file
41
src/frontends/qt2/QNoteDialog.C
Normal file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* \file QNoteDialog.C
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author Juergen Spitzmueller
|
||||
*
|
||||
* Full author contact details are available in file CREDITS
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
#include "QNote.h"
|
||||
#include "QNoteDialog.h"
|
||||
|
||||
#include <qpushbutton.h>
|
||||
|
||||
|
||||
QNoteDialog::QNoteDialog(QNote * form)
|
||||
: QNoteDialogBase(0, 0, false, 0),
|
||||
form_(form)
|
||||
{
|
||||
connect(okPB, SIGNAL(clicked()),
|
||||
form, SLOT(slotOK()));
|
||||
connect(closePB, SIGNAL(clicked()),
|
||||
form, SLOT(slotClose()));
|
||||
}
|
||||
|
||||
|
||||
void QNoteDialog::closeEvent(QCloseEvent * e)
|
||||
{
|
||||
form_->slotWMHide();
|
||||
e->accept();
|
||||
}
|
||||
|
||||
|
||||
void QNoteDialog::change_adaptor()
|
||||
{
|
||||
form_->changed();
|
||||
}
|
32
src/frontends/qt2/QNoteDialog.h
Normal file
32
src/frontends/qt2/QNoteDialog.h
Normal file
@ -0,0 +1,32 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* \file QNoteDialog.h
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author Juergen Spitzmueller
|
||||
*
|
||||
* Full author contact details are available in file CREDITS
|
||||
*/
|
||||
|
||||
#ifndef QNOTEDIALOG_H
|
||||
#define QNOTEDIALOG_H
|
||||
|
||||
#include "ui/QNoteDialogBase.h"
|
||||
|
||||
|
||||
class QNote;
|
||||
|
||||
class QNoteDialog : public QNoteDialogBase {
|
||||
Q_OBJECT
|
||||
public:
|
||||
QNoteDialog(QNote * form);
|
||||
protected slots:
|
||||
virtual void change_adaptor();
|
||||
protected:
|
||||
virtual void closeEvent(QCloseEvent * e);
|
||||
private:
|
||||
QNote * form_;
|
||||
};
|
||||
|
||||
#endif // QNOTEDIALOG_H
|
156
src/frontends/qt2/ui/QNoteDialogBase.ui
Normal file
156
src/frontends/qt2/ui/QNoteDialogBase.ui
Normal file
@ -0,0 +1,156 @@
|
||||
<!DOCTYPE UI><UI>
|
||||
<class>QNoteDialogBase</class>
|
||||
<include location="global">config.h</include>
|
||||
<include location="local">qt_helpers.h</include>
|
||||
<widget>
|
||||
<class>QDialog</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>QNoteDialogBase</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>geometry</name>
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>188</width>
|
||||
<height>146</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>caption</name>
|
||||
<string>Annotation Settings</string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>sizeGripEnabled</name>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<grid>
|
||||
<property stdset="1">
|
||||
<name>margin</name>
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>spacing</name>
|
||||
<number>6</number>
|
||||
</property>
|
||||
<widget row="1" column="0" >
|
||||
<class>QPushButton</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>okPB</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>OK</string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>default</name>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="1" column="1" >
|
||||
<class>QPushButton</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>closePB</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>&Close</string>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>default</name>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget row="0" column="0" rowspan="1" colspan="2" >
|
||||
<class>QButtonGroup</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>NoteBG</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>title</name>
|
||||
<string>Type</string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property stdset="1">
|
||||
<name>margin</name>
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>spacing</name>
|
||||
<number>6</number>
|
||||
</property>
|
||||
<widget>
|
||||
<class>QRadioButton</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>noteRB</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>&Note</string>
|
||||
</property>
|
||||
<property>
|
||||
<name>toolTip</name>
|
||||
<string>LyX internal only</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QRadioButton</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>commentRB</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>C&omment</string>
|
||||
</property>
|
||||
<property>
|
||||
<name>toolTip</name>
|
||||
<string>Export to LaTeX but don't print</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget>
|
||||
<class>QRadioButton</class>
|
||||
<property stdset="1">
|
||||
<name>name</name>
|
||||
<cstring>greyedoutRB</cstring>
|
||||
</property>
|
||||
<property stdset="1">
|
||||
<name>text</name>
|
||||
<string>&Greyed out</string>
|
||||
</property>
|
||||
<property>
|
||||
<name>toolTip</name>
|
||||
<string>Print as grey text</string>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>noteRB</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>QNoteDialogBase</receiver>
|
||||
<slot>change_adaptor()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>greyedoutRB</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>QNoteDialogBase</receiver>
|
||||
<slot>change_adaptor()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>commentRB</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>QNoteDialogBase</receiver>
|
||||
<slot>change_adaptor()</slot>
|
||||
</connection>
|
||||
<slot access="public">change_adaptor()</slot>
|
||||
</connections>
|
||||
</UI>
|
Loading…
Reference in New Issue
Block a user