]> git.lyx.org Git - lyx.git/commitdiff
ERT and Box insets: simplify dialog creation and don't hide the dialogs upon destruct...
authorAbdelrazak Younes <younes@lyx.org>
Sun, 7 Feb 2010 21:46:40 +0000 (21:46 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 7 Feb 2010 21:46:40 +0000 (21:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33356 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/ui/ERTUi.ui
src/insets/InsetBox.cpp
src/insets/InsetBox.h
src/insets/InsetERT.cpp
src/insets/InsetERT.h

index 26e9d8d4b71aec30e712291c8194b973f75648f1..0f855dfd0e489c796bdc95c76fcd138d47d4f537 100644 (file)
@@ -1,10 +1,8 @@
-<ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>ERTUi</class>
- <widget class="QDialog" name="ERTUi" >
-  <property name="geometry" >
+ <widget class="QDialog" name="ERTUi">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <height>135</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string/>
   </property>
-  <property name="sizeGripEnabled" >
+  <property name="sizeGripEnabled">
    <bool>true</bool>
   </property>
-  <layout class="QVBoxLayout" >
-   <property name="margin" >
-    <number>11</number>
-   </property>
-   <property name="spacing" >
+  <layout class="QVBoxLayout">
+   <property name="spacing">
     <number>6</number>
    </property>
+   <property name="margin">
+    <number>11</number>
+   </property>
    <item>
-    <widget class="QGroupBox" name="ertBG" >
-     <property name="title" >
+    <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" >
+     <layout class="QVBoxLayout">
+      <property name="spacing">
        <number>6</number>
       </property>
-     <item>
-       <widget class="QRadioButton" name="collapsedRB" >
-        <property name="toolTip" >
+      <property name="margin">
+       <number>11</number>
+      </property>
+      <item>
+       <widget class="QRadioButton" name="collapsedRB">
+        <property name="toolTip">
          <string>Show ERT button only</string>
         </property>
-        <property name="text" >
+        <property name="text">
          <string>&amp;Collapsed</string>
         </property>
        </widget>
       </item>
       <item>
-       <widget class="QRadioButton" name="openRB" >
-        <property name="toolTip" >
+       <widget class="QRadioButton" name="openRB">
+        <property name="toolTip">
          <string>Show ERT contents</string>
         </property>
-        <property name="text" >
+        <property name="text">
          <string>O&amp;pen</string>
         </property>
        </widget>
     </widget>
    </item>
    <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
+    <layout class="QHBoxLayout">
+     <property name="spacing">
       <number>6</number>
      </property>
+     <property name="margin">
+      <number>0</number>
+     </property>
      <item>
       <spacer>
-       <property name="orientation" >
+       <property name="orientation">
         <enum>Qt::Horizontal</enum>
        </property>
-       <property name="sizeType" >
+       <property name="sizeType">
         <enum>QSizePolicy::Expanding</enum>
        </property>
-       <property name="sizeHint" >
+       <property name="sizeHint" stdset="0">
         <size>
          <width>20</width>
          <height>20</height>
       </spacer>
      </item>
      <item>
-      <widget class="QPushButton" name="okPB" >
-       <property name="text" >
-        <string>&amp;OK</string>
+      <widget class="QPushButton" name="newPB">
+       <property name="toolTip">
+        <string/>
+       </property>
+       <property name="text">
+        <string>&amp;New</string>
+       </property>
+       <property name="autoDefault">
+        <bool>false</bool>
        </property>
-       <property name="default" >
+       <property name="default">
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
-      <widget class="QPushButton" name="closePB" >
-       <property name="text" >
+      <widget class="QPushButton" name="closePB">
+       <property name="text">
         <string>Close</string>
        </property>
-       <property name="default" >
+       <property name="default">
         <bool>true</bool>
        </property>
       </widget>
    </item>
   </layout>
  </widget>
- <pixmapfunction></pixmapfunction>
  <includes>
-  <include location="local" >qt_i18n.h</include>
+  <include location="local">qt_i18n.h</include>
  </includes>
  <resources/>
  <connections/>
index 77e6a5b396915a07ba04a8814c247cf62e0551b0..fe4f44b2ccc00bb4eee051d482218e5014eeb568 100644 (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;
 }
 
index 60ecfbda649fe8ba4ca07bc20e7b55492a68807b..b838cc8e47e00e3488e84f40af93e1e26d50f462 100644 (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 &);
index d1e15bae8b806ddf27e1a9a8203a66d24a2baa09..10452d7cf11f33a7b52aaf9917211387e908a426 100644 (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;
 }
 
index 3f38f0e70eb9fc2d08f1fa602bcc44603faece33..b530e05f3fa01a8173d92427241036b94f57f02f 100644 (file)
@@ -34,8 +34,6 @@ public:
        ///
        InsetERT(Buffer *, CollapseStatus status = Open);
        ///
-       ~InsetERT();
-       ///
        static CollapseStatus string2params(std::string const &);
        ///
        static std::string params2string(CollapseStatus);