]> git.lyx.org Git - features.git/commitdiff
Create new Module panel in document settings and decrease vertical
authorPavel Sanda <sanda@lyx.org>
Sun, 19 Oct 2008 01:21:59 +0000 (01:21 +0000)
committerPavel Sanda <sanda@lyx.org>
Sun, 19 Oct 2008 01:21:59 +0000 (01:21 +0000)
size of the dialog.

http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg145035.html

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26953 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiDocument.h
src/frontends/qt4/Makefile.am
src/frontends/qt4/ui/LaTeXUi.ui
src/frontends/qt4/ui/compile_uic.sh

index a2f2e4337873a543b64f78bc992490d4ecf9f727..912f98a31aa6f3c3b9b7ff694e9e71aff4819265 100644 (file)
@@ -906,17 +906,6 @@ GuiDocument::GuiDocument(GuiView & lv)
        connect(latexModule->childDocPB, SIGNAL(clicked()),
                this, SLOT(browseMaster()));
        
-       selectionManager =
-               new ModuleSelectionManager(latexModule->availableLV,
-                       latexModule->selectedLV, 
-                       latexModule->addPB, latexModule->deletePB, 
-                       latexModule->upPB, latexModule->downPB, 
-                       availableModel(), selectedModel());
-       connect(selectionManager, SIGNAL(updateHook()),
-               this, SLOT(updateModuleInfo()));
-       connect(selectionManager, SIGNAL(updateHook()),
-               this, SLOT(change_adaptor()));
-       
        // postscript drivers
        for (int n = 0; tex_graphics[n][0]; ++n) {
                QString enc = qt_(tex_graphics_gui[n]);
@@ -953,6 +942,21 @@ GuiDocument::GuiDocument(GuiView & lv)
        connect(bulletsModule, SIGNAL(changed()),
                this, SLOT(change_adaptor()));
 
+       // Modules
+       modulesModule = new UiWidget<Ui::ModulesUi>;
+
+       selectionManager =
+               new ModuleSelectionManager(modulesModule->availableLV,
+                       modulesModule->selectedLV,
+                       modulesModule->addPB, modulesModule->deletePB,
+                       modulesModule->upPB, modulesModule->downPB,
+                       availableModel(), selectedModel());
+       connect(selectionManager, SIGNAL(updateHook()),
+               this, SLOT(updateModuleInfo()));
+       connect(selectionManager, SIGNAL(updateHook()),
+               this, SLOT(change_adaptor()));
+
+
        // PDF support
        pdfSupportModule = new UiWidget<Ui::PDFSupportUi>;
 
@@ -998,6 +1002,7 @@ GuiDocument::GuiDocument(GuiView & lv)
                this, SLOT(change_adaptor()));
 
        docPS->addPanel(latexModule, qt_("Document Class"));
+       docPS->addPanel(modulesModule, qt_("Modules"));
        docPS->addPanel(fontModule, qt_("Fonts"));
        docPS->addPanel(textLayoutModule, qt_("Text Layout"));
        docPS->addPanel(pageLayoutModule, qt_("Page Layout"));
@@ -1426,9 +1431,9 @@ void GuiDocument::updateModuleInfo()
        //Module description
        bool const focusOnSelected = selectionManager->selectedFocused();
        QListView const * const lv = 
-                       focusOnSelected ? latexModule->selectedLV : latexModule->availableLV;
+                       focusOnSelected ? modulesModule->selectedLV : modulesModule->availableLV;
        if (lv->selectionModel()->selectedIndexes().isEmpty()) {
-               latexModule->infoML->document()->clear();
+               modulesModule->infoML->document()->clear();
                return;
        }
        QModelIndex const & idx = lv->selectionModel()->currentIndex();
@@ -1469,7 +1474,7 @@ void GuiDocument::updateModuleInfo()
                desc += _("WARNING: Some required packages are unavailable!");
        }
 
-       latexModule->infoML->document()->setPlainText(toqstr(desc));
+       modulesModule->infoML->document()->setPlainText(toqstr(desc));
 }
 
 
index 71808b7cafef0542765e9d777369a7a7b9865d28..2f3dfc4396fad8d81073c3e982fa3e9f54e13785 100644 (file)
@@ -32,6 +32,7 @@
 #include "ui_MarginsUi.h"
 #include "ui_PreambleUi.h"
 #include "ui_PDFSupportUi.h"
+#include "ui_ModulesUi.h"
 
 #include <list>
 #include <map>
@@ -109,6 +110,7 @@ private:
        UiWidget<Ui::MathsUi> *mathsModule;
        UiWidget<Ui::LaTeXUi> *latexModule;
        UiWidget<Ui::PDFSupportUi> *pdfSupportModule;
+       UiWidget<Ui::ModulesUi> *modulesModule;
        PreambleModule *preambleModule;
        
        GuiBranches *branchesModule;
index b20fc223f229eba07e5d84953bc0845f6a9ecb0e..5b1919c10aead3f5b00ed3a3f206120bbb6dbf84 100644 (file)
@@ -260,6 +260,7 @@ UIFILES = \
        MarginsUi.ui \
        MathMatrixUi.ui \
        MathsUi.ui \
+       ModulesUi.ui \
        NomenclUi.ui \
        NoteUi.ui \
        NumberingUi.ui \
index 2c65719637602664fb03d98901a4ca9c09aca57b..dd73558ad3fa965a03a5e59aa6d993cb050d3d1b 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>381</width>
-    <height>449</height>
+    <width>379</width>
+    <height>255</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <property name="spacing" >
     <number>6</number>
    </property>
-   <item row="4" column="0" colspan="4" >
-    <widget class="QGroupBox" name="modulesGB" >
-     <property name="title" >
-      <string>Modules</string>
-     </property>
-     <layout class="QGridLayout" >
-      <property name="margin" >
-       <number>9</number>
-      </property>
-      <property name="spacing" >
-       <number>6</number>
-      </property>
-      <item row="6" column="0" colspan="3" >
-       <widget class="QTextBrowser" name="infoML" />
-      </item>
-      <item row="5" column="1" >
-       <spacer>
-        <property name="orientation" >
-         <enum>Qt::Vertical</enum>
-        </property>
-        <property name="sizeHint" >
-         <size>
-          <width>80</width>
-          <height>16</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item row="4" column="1" >
-       <widget class="QPushButton" name="downPB" >
-        <property name="text" >
-         <string>Do&amp;wn</string>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="1" >
-       <widget class="QPushButton" name="upPB" >
-        <property name="text" >
-         <string>&amp;Up</string>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="1" >
-       <widget class="QPushButton" name="deletePB" >
-        <property name="text" >
-         <string>De&amp;lete</string>
-        </property>
-       </widget>
-      </item>
-      <item rowspan="5" row="1" column="2" >
-       <widget class="QListView" name="selectedLV" >
-        <property name="editTriggers" >
-         <set>QAbstractItemView::NoEditTriggers</set>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1" >
-       <widget class="QPushButton" name="addPB" >
-        <property name="text" >
-         <string>A&amp;dd</string>
-        </property>
-       </widget>
-      </item>
-      <item rowspan="5" row="1" column="0" >
-       <widget class="QListView" name="availableLV" >
-        <property name="editTriggers" >
-         <set>QAbstractItemView::NoEditTriggers</set>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="2" >
-       <widget class="QLabel" name="selmodL" >
-        <property name="text" >
-         <string>S&amp;elected:</string>
-        </property>
-        <property name="buddy" >
-         <cstring>selectedLV</cstring>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="0" >
-       <widget class="QLabel" name="availmodL" >
-        <property name="text" >
-         <string>A&amp;vailable:</string>
-        </property>
-        <property name="buddy" >
-         <cstring>availableLV</cstring>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
    <item row="3" column="0" colspan="4" >
     <widget class="QGroupBox" name="childDocGB" >
      <property name="toolTip" >
      <property name="orientation" >
       <enum>Qt::Horizontal</enum>
      </property>
-     <property name="sizeHint" >
+     <property name="sizeHint" stdset="0" >
       <size>
        <width>261</width>
        <height>22</height>
    <item row="0" column="3" >
     <widget class="QPushButton" name="layoutPB" >
      <property name="sizePolicy" >
-      <sizepolicy>
-       <hsizetype>1</hsizetype>
-       <vsizetype>0</vsizetype>
+      <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
       </property>
       <item rowspan="2" row="0" column="1" >
        <layout class="QVBoxLayout" >
-        <property name="margin" >
-         <number>0</number>
-        </property>
         <property name="spacing" >
          <number>6</number>
         </property>
+        <property name="margin" >
+         <number>0</number>
+        </property>
         <item>
          <widget class="QLineEdit" name="defaultOptionsLE" >
           <property name="toolTip" >
   <tabstop>classCO</tabstop>
   <tabstop>optionsLE</tabstop>
   <tabstop>psdriverCO</tabstop>
-  <tabstop>availableLV</tabstop>
-  <tabstop>addPB</tabstop>
-  <tabstop>deletePB</tabstop>
-  <tabstop>upPB</tabstop>
-  <tabstop>downPB</tabstop>
-  <tabstop>selectedLV</tabstop>
-  <tabstop>infoML</tabstop>
  </tabstops>
  <includes>
   <include location="local" >qt_i18n.h</include>
index 2c455129af1c99ccf3b556cad601e80ec9ee8781..b8f2763ce3042b86bd70c461e8d8c76fd28b1a78 100644 (file)
@@ -26,6 +26,7 @@ uic LogUi.ui -o LogUi.h
 uic MarginsUi.ui -o MarginsUi.h
 uic MathMatrixUi.ui -o MathMatrixUi.h
 uic MathsUi.ui -o MathsUi.h
+uic ModulesUi.ui -o ModulesUi.h
 uic NoteUi.ui -o NoteUi.h
 uic NumberingUi.ui -o NumberingUi.h
 uic PageLayoutUi.ui -o PageLayoutUi.h