ERT and Box insets: simplify dialog creation and don't hide the dialogs upon destruction anymore

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33356 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2010-02-07 21:46:40 +00:00
parent c0c1e1fd2b
commit 1eed486fc4
5 changed files with 49 additions and 64 deletions

View File

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>ERTUi</class>
<widget class="QDialog" name="ERTUi">
<property name="geometry">
@ -19,24 +17,24 @@
<bool>true</bool>
</property>
<layout class="QVBoxLayout">
<property name="margin" >
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>11</number>
</property>
<item>
<widget class="QGroupBox" name="ertBG">
<property name="title">
<string>Display</string>
</property>
<layout class="QVBoxLayout">
<property name="margin" >
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>11</number>
</property>
<item>
<widget class="QRadioButton" name="collapsedRB">
<property name="toolTip">
@ -62,12 +60,12 @@
</item>
<item>
<layout class="QHBoxLayout">
<property name="margin" >
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation">
@ -76,7 +74,7 @@
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
@ -85,9 +83,15 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="okPB" >
<widget class="QPushButton" name="newPB">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>&amp;OK</string>
<string>&amp;New</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>false</bool>
@ -108,7 +112,6 @@
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
<includes>
<include location="local">qt_i18n.h</include>
</includes>

View File

@ -102,12 +102,6 @@ InsetBox::InsetBox(Buffer * buffer, string const & label)
{}
InsetBox::~InsetBox()
{
hideDialogs("box", this);
}
docstring InsetBox::name() const
{
// FIXME: UNICODE
@ -192,8 +186,7 @@ bool InsetBox::forcePlainLayout(idx_type) const
bool InsetBox::showInsetDialog(BufferView * bv) const
{
bv->showDialog("box", params2string(params_),
const_cast<InsetBox *>(this));
bv->showDialog("box");
return true;
}

View File

@ -78,8 +78,6 @@ public:
///
InsetBox(Buffer *, std::string const &);
///
~InsetBox();
///
static std::string params2string(InsetBoxParams const &);
///
static void string2params(std::string const &, InsetBoxParams &);

View File

@ -51,12 +51,6 @@ InsetERT::InsetERT(Buffer * buf, CollapseStatus status)
}
InsetERT::~InsetERT()
{
hideDialogs("ert", this);
}
void InsetERT::write(ostream & os) const
{
os << "ERT" << "\n";
@ -155,8 +149,7 @@ docstring const InsetERT::buttonLabel(BufferView const & bv) const
bool InsetERT::showInsetDialog(BufferView * bv) const
{
bv->showDialog("ert", params2string(status(*bv)),
const_cast<InsetERT *>(this));
bv->showDialog("ert");
return true;
}

View File

@ -34,8 +34,6 @@ public:
///
InsetERT(Buffer *, CollapseStatus status = Open);
///
~InsetERT();
///
static CollapseStatus string2params(std::string const &);
///
static std::string params2string(CollapseStatus);