]> git.lyx.org Git - features.git/commitdiff
Tools->Preference: move editing and fullscreen from user interface to a new panel...
authorBo Peng <bpeng@lyx.org>
Sat, 15 Mar 2008 22:12:19 +0000 (22:12 +0000)
committerBo Peng <bpeng@lyx.org>
Sat, 15 Mar 2008 22:12:19 +0000 (22:12 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23767 a592a061-630c-0410-9148-cb99ea01b6c8

development/scons/scons_manifest.py
src/frontends/qt4/GuiPrefs.cpp
src/frontends/qt4/GuiPrefs.h
src/frontends/qt4/Makefile.am
src/frontends/qt4/ui/PrefEditUi.ui [new file with mode: 0644]
src/frontends/qt4/ui/PrefUi.ui

index 269dd0fddece72e8c317a992549fd725e7efcd07..b322c868a0899914cd3f7daf44b72d7e83ea7c99 100644 (file)
@@ -926,6 +926,7 @@ src_frontends_qt4_ui_files = Split('''
     PrefConvertersUi.ui
     PrefDateUi.ui
     PrefDisplayUi.ui
+    PrefEditUi.ui
     PrefFileformatsUi.ui
     PrefIdentityUi.ui
     PrefInputUi.ui
index c00fdec5268fbbb3ab5eed0a12faf5a7d6f6f713..23eb5a44cc9b6a63388a1fe62af48628cb6f5066 100644 (file)
@@ -1795,14 +1795,6 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form, QWidget * parent)
                this, SIGNAL(changed()));
        connect(allowGeometrySessionCB, SIGNAL(clicked()),
                this, SIGNAL(changed()));
-       connect(cursorFollowsCB, SIGNAL(clicked()),
-               this, SIGNAL(changed()));
-       connect(sortEnvironmentsCB, SIGNAL(clicked()),
-               this, SIGNAL(changed()));
-       connect(groupEnvironmentsCB, SIGNAL(clicked()),
-               this, SIGNAL(changed()));
-       connect(macroEditStyleCO, SIGNAL(activated(int)),
-               this, SIGNAL(changed()));
        connect(autoSaveSB, SIGNAL(valueChanged(int)),
                this, SIGNAL(changed()));
        connect(autoSaveCB, SIGNAL(clicked()),
@@ -1811,16 +1803,6 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form, QWidget * parent)
                this, SIGNAL(changed()));
        connect(tooltipCB, SIGNAL(toggled(bool)),
                this, SIGNAL(changed()));
-       connect(fullscreenLimitGB, SIGNAL(clicked()),
-               this, SIGNAL(changed()));
-       connect(fullscreenWidthSB, SIGNAL(valueChanged(int)),
-               this, SIGNAL(changed()));
-       connect(toggleTabbarCB, SIGNAL(toggled(bool)),
-               this, SIGNAL(changed()));
-       connect(toggleScrollbarCB, SIGNAL(toggled(bool)),
-               this, SIGNAL(changed()));
-       connect(toggleToolbarsCB, SIGNAL(toggled(bool)),
-               this, SIGNAL(changed()));
        lastfilesSB->setMaximum(maxlastfiles);
 }
 
@@ -1831,23 +1813,10 @@ void PrefUserInterface::apply(LyXRC & rc) const
        rc.use_lastfilepos = restoreCursorCB->isChecked();
        rc.load_session = loadSessionCB->isChecked();
        rc.allow_geometry_session = allowGeometrySessionCB->isChecked();
-       rc.cursor_follows_scrollbar = cursorFollowsCB->isChecked();
-       rc.sort_layouts = sortEnvironmentsCB->isChecked();
-       rc.group_layouts = groupEnvironmentsCB->isChecked();
-       switch (macroEditStyleCO->currentIndex()) {
-               case 0: rc.macro_edit_style = LyXRC::MACRO_EDIT_INLINE_BOX; break;
-               case 1: rc.macro_edit_style = LyXRC::MACRO_EDIT_INLINE; break;
-               case 2: rc.macro_edit_style = LyXRC::MACRO_EDIT_LIST;   break;
-       }
        rc.autosave = autoSaveSB->value() * 60;
        rc.make_backup = autoSaveCB->isChecked();
        rc.num_lastfiles = lastfilesSB->value();
        rc.use_tooltip = tooltipCB->isChecked();
-       rc.full_screen_toolbars = toggleToolbarsCB->isChecked();
-       rc.full_screen_scrollbar = toggleScrollbarCB->isChecked();
-       rc.full_screen_tabbar = toggleTabbarCB->isChecked();
-       rc.full_screen_width = fullscreenWidthSB->value();
-       rc.full_screen_limit = fullscreenLimitGB->isChecked();
        rc.open_buffers_in_tabs = openDocumentsInTabsCB->isChecked();
 }
 
@@ -1858,10 +1827,6 @@ void PrefUserInterface::update(LyXRC const & rc)
        restoreCursorCB->setChecked(rc.use_lastfilepos);
        loadSessionCB->setChecked(rc.load_session);
        allowGeometrySessionCB->setChecked(rc.allow_geometry_session);
-       cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
-       sortEnvironmentsCB->setChecked(rc.sort_layouts);
-       groupEnvironmentsCB->setChecked(rc.group_layouts);
-       macroEditStyleCO->setCurrentIndex(rc.macro_edit_style);
        // convert to minutes
        int mins(rc.autosave / 60);
        if (rc.autosave && !mins)
@@ -1870,11 +1835,6 @@ void PrefUserInterface::update(LyXRC const & rc)
        autoSaveCB->setChecked(rc.make_backup);
        lastfilesSB->setValue(rc.num_lastfiles);
        tooltipCB->setChecked(rc.use_tooltip);
-       toggleScrollbarCB->setChecked(rc.full_screen_scrollbar);
-       toggleToolbarsCB->setChecked(rc.full_screen_toolbars);
-       toggleTabbarCB->setChecked(rc.full_screen_tabbar);
-       fullscreenWidthSB->setValue(rc.full_screen_width);
-       fullscreenLimitGB->setChecked(rc.full_screen_limit);
        openDocumentsInTabsCB->setChecked(rc.open_buffers_in_tabs);
 }
 
@@ -1886,6 +1846,69 @@ void PrefUserInterface::select_ui()
                uiFileED->setText(file);
 }
 
+/////////////////////////////////////////////////////////////////////
+//
+// PrefEdit
+//
+/////////////////////////////////////////////////////////////////////
+
+PrefEdit::PrefEdit(GuiPreferences * form, QWidget * parent)
+       : PrefModule(qt_("Editing"), form, parent)
+{
+       setupUi(this);
+
+       connect(cursorFollowsCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
+       connect(sortEnvironmentsCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
+       connect(groupEnvironmentsCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
+       connect(macroEditStyleCO, SIGNAL(activated(int)),
+               this, SIGNAL(changed()));
+       connect(fullscreenLimitGB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
+       connect(fullscreenWidthSB, SIGNAL(valueChanged(int)),
+               this, SIGNAL(changed()));
+       connect(toggleTabbarCB, SIGNAL(toggled(bool)),
+               this, SIGNAL(changed()));
+       connect(toggleScrollbarCB, SIGNAL(toggled(bool)),
+               this, SIGNAL(changed()));
+       connect(toggleToolbarsCB, SIGNAL(toggled(bool)),
+               this, SIGNAL(changed()));
+}
+
+
+void PrefEdit::apply(LyXRC & rc) const
+{
+       rc.cursor_follows_scrollbar = cursorFollowsCB->isChecked();
+       rc.sort_layouts = sortEnvironmentsCB->isChecked();
+       rc.group_layouts = groupEnvironmentsCB->isChecked();
+       switch (macroEditStyleCO->currentIndex()) {
+               case 0: rc.macro_edit_style = LyXRC::MACRO_EDIT_INLINE_BOX; break;
+               case 1: rc.macro_edit_style = LyXRC::MACRO_EDIT_INLINE; break;
+               case 2: rc.macro_edit_style = LyXRC::MACRO_EDIT_LIST;   break;
+       }
+       rc.full_screen_toolbars = toggleToolbarsCB->isChecked();
+       rc.full_screen_scrollbar = toggleScrollbarCB->isChecked();
+       rc.full_screen_tabbar = toggleTabbarCB->isChecked();
+       rc.full_screen_width = fullscreenWidthSB->value();
+       rc.full_screen_limit = fullscreenLimitGB->isChecked();
+}
+
+
+void PrefEdit::update(LyXRC const & rc)
+{
+       cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
+       sortEnvironmentsCB->setChecked(rc.sort_layouts);
+       groupEnvironmentsCB->setChecked(rc.group_layouts);
+       macroEditStyleCO->setCurrentIndex(rc.macro_edit_style);
+       toggleScrollbarCB->setChecked(rc.full_screen_scrollbar);
+       toggleToolbarsCB->setChecked(rc.full_screen_toolbars);
+       toggleTabbarCB->setChecked(rc.full_screen_tabbar);
+       fullscreenWidthSB->setValue(rc.full_screen_width);
+       fullscreenLimitGB->setChecked(rc.full_screen_limit);
+}
+
 
 /////////////////////////////////////////////////////////////////////
 //
@@ -2340,6 +2363,7 @@ GuiPreferences::GuiPreferences(GuiView & lv)
        connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
 
        add(new PrefUserInterface(this));
+       add(new PrefEdit(this));
        add(new PrefShortcuts(this));
        add(new PrefScreenFonts(this));
        add(new PrefColors(this));
index 515fee03c7d81d7d3599b0e799e922121799c219..77a5382fe3f7a7998a88d44feecd102c0cb3cf82 100644 (file)
@@ -33,6 +33,7 @@
 #include "ui_PrefScreenFontsUi.h"
 #include "ui_PrefColorsUi.h"
 #include "ui_PrefDisplayUi.h"
+#include "ui_PrefEditUi.h"
 #include "ui_PrefPathsUi.h"
 #include "ui_PrefShortcutsUi.h"
 #include "ui_PrefSpellcheckerUi.h"
@@ -347,6 +348,18 @@ public Q_SLOTS:
 };
 
 
+class PrefEdit : public PrefModule, public Ui::PrefEditUi
+{
+       Q_OBJECT
+public:
+       PrefEdit(GuiPreferences * form, QWidget * parent = 0);
+
+       void apply(LyXRC & rc) const;
+       void update(LyXRC const & rc);
+};
+
+
+
 class GuiShortcutDialog : public QDialog, public Ui::shortcutUi
 {
 public:
index 32f85df5995be2e2aeaa2c2be0aca65b9ee7251b..f6b6fcde2e804dbe832f2859d4b24199eed47332 100644 (file)
@@ -265,6 +265,7 @@ UIFILES = \
        PrefConvertersUi.ui \
        PrefDateUi.ui \
        PrefDisplayUi.ui \
+       PrefEditUi.ui \
        PrefFileformatsUi.ui \
        PrefIdentityUi.ui \
        PrefInputUi.ui \
diff --git a/src/frontends/qt4/ui/PrefEditUi.ui b/src/frontends/qt4/ui/PrefEditUi.ui
new file mode 100644 (file)
index 0000000..a242940
--- /dev/null
@@ -0,0 +1,225 @@
+<ui version="4.0" >
+ <class>PrefEditUi</class>
+ <widget class="QWidget" name="PrefEditUi" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>459</width>
+    <height>406</height>
+   </rect>
+  </property>
+  <property name="sizePolicy" >
+   <sizepolicy>
+    <hsizetype>0</hsizetype>
+    <vsizetype>0</vsizetype>
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle" >
+   <string/>
+  </property>
+  <layout class="QVBoxLayout" >
+   <property name="margin" >
+    <number>9</number>
+   </property>
+   <property name="spacing" >
+    <number>6</number>
+   </property>
+   <item>
+    <widget class="QGroupBox" name="scrollGB" >
+     <property name="title" >
+      <string>Editing</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+     </property>
+     <property name="flat" >
+      <bool>true</bool>
+     </property>
+     <layout class="QVBoxLayout" >
+      <property name="margin" >
+       <number>9</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item>
+       <widget class="QCheckBox" name="cursorFollowsCB" >
+        <property name="text" >
+         <string>Cursor follows &amp;scrollbar</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="sortEnvironmentsCB" >
+        <property name="text" >
+         <string>Sort &amp;environments alphabetically</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="groupEnvironmentsCB" >
+        <property name="text" >
+         <string>&amp;Group environments by their category</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="macroEditStyleCO" >
+        <item>
+         <property name="text" >
+          <string>Edit Math Macros inline with a box around</string>
+         </property>
+        </item>
+        <item>
+         <property name="text" >
+          <string>Edit Math Macros inline with the name in the status bar</string>
+         </property>
+        </item>
+        <item>
+         <property name="text" >
+          <string>Edit Math Macros with a parameter list (like in LyX &lt; 1.6)</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="fullscreenGB" >
+     <property name="title" >
+      <string>Fullscreen</string>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+     </property>
+     <property name="flat" >
+      <bool>true</bool>
+     </property>
+     <layout class="QGridLayout" >
+      <property name="margin" >
+       <number>9</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item rowspan="3" row="0" column="2" >
+       <widget class="QGroupBox" name="fullscreenLimitGB" >
+        <property name="title" >
+         <string>&amp;Limit text width</string>
+        </property>
+        <property name="checkable" >
+         <bool>true</bool>
+        </property>
+        <layout class="QGridLayout" >
+         <property name="margin" >
+          <number>9</number>
+         </property>
+         <property name="spacing" >
+          <number>6</number>
+         </property>
+         <item row="0" column="1" >
+          <widget class="QSpinBox" name="fullscreenWidthSB" >
+           <property name="maximum" >
+            <number>10000</number>
+           </property>
+           <property name="minimum" >
+            <number>0</number>
+           </property>
+           <property name="singleStep" >
+            <number>10</number>
+           </property>
+           <property name="value" >
+            <number>700</number>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="0" >
+          <widget class="QLabel" name="label_2" >
+           <property name="text" >
+            <string>Screen us&amp;ed (pixels):</string>
+           </property>
+           <property name="buddy" >
+            <cstring>fullscreenWidthSB</cstring>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+      <item row="1" column="1" >
+       <spacer>
+        <property name="orientation" >
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" >
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item row="2" column="0" >
+       <widget class="QCheckBox" name="toggleTabbarCB" >
+        <property name="text" >
+         <string>Toggle tabba&amp;r</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0" >
+       <widget class="QCheckBox" name="toggleScrollbarCB" >
+        <property name="text" >
+         <string>To&amp;ggle scrollbar</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="0" >
+       <widget class="QCheckBox" name="toggleToolbarsCB" >
+        <property name="sizePolicy" >
+         <sizepolicy>
+          <hsizetype>0</hsizetype>
+          <vsizetype>0</vsizetype>
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="text" >
+         <string>T&amp;oggle toolbars</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>395</width>
+       <height>16</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <layoutdefault spacing="4" margin="9" />
+ <tabstops>
+  <tabstop>cursorFollowsCB</tabstop>
+  <tabstop>sortEnvironmentsCB</tabstop>
+  <tabstop>groupEnvironmentsCB</tabstop>
+  <tabstop>macroEditStyleCO</tabstop>
+ </tabstops>
+ <includes>
+  <include location="local" >qt_helpers.h</include>
+ </includes>
+ <resources/>
+ <connections/>
+</ui>
index 8645dc0016e14189025057bb007f1f00b1d8c51e..eacc49668551412e421d9cb7ec915754e306982c 100644 (file)
@@ -6,7 +6,7 @@
     <x>0</x>
     <y>0</y>
     <width>459</width>
-    <height>596</height>
+    <height>459</height>
    </rect>
   </property>
   <property name="sizePolicy" >
      </layout>
     </widget>
    </item>
-   <item row="5" column="0" colspan="3" >
-    <widget class="QGroupBox" name="fullscreenGB" >
-     <property name="title" >
-      <string>Fullscreen</string>
-     </property>
-     <property name="alignment" >
-      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-     </property>
-     <property name="flat" >
-      <bool>true</bool>
-     </property>
-     <layout class="QGridLayout" >
-      <property name="margin" >
-       <number>9</number>
-      </property>
-      <property name="spacing" >
-       <number>6</number>
-      </property>
-      <item rowspan="3" row="0" column="2" >
-       <widget class="QGroupBox" name="fullscreenLimitGB" >
-        <property name="title" >
-         <string>&amp;Limit text width</string>
-        </property>
-        <property name="checkable" >
-         <bool>true</bool>
-        </property>
-        <layout class="QGridLayout" >
-         <property name="margin" >
-          <number>9</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item row="0" column="1" >
-          <widget class="QSpinBox" name="fullscreenWidthSB" >
-           <property name="maximum" >
-            <number>10000</number>
-           </property>
-           <property name="minimum" >
-            <number>0</number>
-           </property>
-           <property name="singleStep" >
-            <number>10</number>
-           </property>
-           <property name="value" >
-            <number>700</number>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="0" >
-          <widget class="QLabel" name="label_2" >
-           <property name="text" >
-            <string>Screen us&amp;ed (pixels):</string>
-           </property>
-           <property name="buddy" >
-            <cstring>fullscreenWidthSB</cstring>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-      </item>
-      <item row="1" column="1" >
-       <spacer>
-        <property name="orientation" >
-         <enum>Qt::Horizontal</enum>
-        </property>
-        <property name="sizeHint" >
-         <size>
-          <width>40</width>
-          <height>20</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item row="2" column="0" >
-       <widget class="QCheckBox" name="toggleTabbarCB" >
-        <property name="text" >
-         <string>Toggle tabba&amp;r</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0" >
-       <widget class="QCheckBox" name="toggleScrollbarCB" >
-        <property name="text" >
-         <string>To&amp;ggle scrollbar</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="0" >
-       <widget class="QCheckBox" name="toggleToolbarsCB" >
-        <property name="sizePolicy" >
-         <sizepolicy>
-          <hsizetype>0</hsizetype>
-          <vsizetype>0</vsizetype>
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="text" >
-         <string>T&amp;oggle toolbars</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="4" column="0" colspan="3" >
-    <widget class="QGroupBox" name="scrollGB" >
-     <property name="title" >
-      <string>Editing</string>
-     </property>
-     <property name="alignment" >
-      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
-     </property>
-     <property name="flat" >
-      <bool>true</bool>
-     </property>
-     <layout class="QGridLayout" >
-      <property name="margin" >
-       <number>9</number>
-      </property>
-      <property name="spacing" >
-       <number>4</number>
-      </property>
-      <item row="0" column="0" >
-       <widget class="QCheckBox" name="cursorFollowsCB" >
-        <property name="text" >
-         <string>Cursor follows &amp;scrollbar</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0" >
-       <widget class="QCheckBox" name="sortEnvironmentsCB" >
-        <property name="text" >
-         <string>Sort &amp;environments alphabetically</string>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="0" >
-       <widget class="QComboBox" name="macroEditStyleCO" >
-        <item>
-         <property name="text" >
-          <string>Edit Math Macros inline with a box around</string>
-         </property>
-        </item>
-        <item>
-         <property name="text" >
-          <string>Edit Math Macros inline with the name in the status bar</string>
-         </property>
-        </item>
-        <item>
-         <property name="text" >
-          <string>Edit Math Macros with a parameter list (like in LyX &lt; 1.6)</string>
-         </property>
-        </item>
-       </widget>
-      </item>
-      <item row="2" column="0" >
-       <widget class="QCheckBox" name="groupEnvironmentsCB" >
-        <property name="text" >
-         <string>&amp;Group environments by their category</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
    <item row="3" column="0" colspan="3" >
     <widget class="QGroupBox" name="documentsGB" >
      <property name="title" >
         </property>
        </widget>
       </item>
-      <item row="2" column="0" colspan="4">
+      <item row="2" column="0" colspan="4" >
        <widget class="QCheckBox" name="openDocumentsInTabsCB" >
         <property name="text" >
          <string>Open documents in &amp;tabs</string>
   <tabstop>autoSaveSB</tabstop>
   <tabstop>lastfilesSB</tabstop>
   <tabstop>openDocumentsInTabsCB</tabstop>
-  <tabstop>cursorFollowsCB</tabstop>
-  <tabstop>sortEnvironmentsCB</tabstop>
-  <tabstop>groupEnvironmentsCB</tabstop>
-  <tabstop>macroEditStyleCO</tabstop>
  </tabstops>
  <includes>
   <include location="local" >qt_helpers.h</include>