]> git.lyx.org Git - features.git/commitdiff
PrefShortcuts: add a simple shortcut dialog (does nothing now), adjust prefShortcuts...
authorBo Peng <bpeng@lyx.org>
Thu, 18 Oct 2007 16:47:31 +0000 (16:47 +0000)
committerBo Peng <bpeng@lyx.org>
Thu, 18 Oct 2007 16:47:31 +0000 (16:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21037 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/PrefShortcutsUi.ui
src/frontends/qt4/ui/ShortcutUi.ui [new file with mode: 0644]

index 19c06f6e3650803224fcad45f6f91990ead41a7e..20a49975c1d723d84b1f10949aa6b097546a95af 100644 (file)
@@ -982,6 +982,7 @@ src_frontends_qt4_ui_files = Split('''
     RefUi.ui
     SearchUi.ui
     SendtoUi.ui
+    ShortcutUi.ui
     ShowFileUi.ui
     SpellcheckerUi.ui
     TabularCreateUi.ui
index eeb370c6bfe1c04e306e8387a5b239b011bf3f12..60a22363a96976141dcc86ba5452d89ef1c8b13f 100644 (file)
@@ -1698,6 +1698,8 @@ PrefShortcuts::PrefShortcuts(GuiPreferences * form, QWidget * parent)
                this, SLOT(select_bind()));
        connect(bindFileED, SIGNAL(textChanged(const QString &)),
                this, SIGNAL(changed()));
+       
+       shortcut_ = new GuiShortcutDialog(this);
 }
 
 
@@ -1793,6 +1795,32 @@ void PrefShortcuts::select_bind()
 }
 
 
+void PrefShortcuts::on_newPB_pressed()
+{
+       // FIXME
+       shortcut_->exec();
+}
+
+
+void PrefShortcuts::on_modifyPB_pressed()
+{
+       // FIXME
+       shortcut_->exec();
+}
+
+
+void PrefShortcuts::on_removePB_pressed()
+{
+       //
+}
+
+
+void PrefShortcuts::on_searchPB_pressed()
+{
+       //
+}
+
+
 PrefIdentity::PrefIdentity(QWidget * parent)
        : PrefModule(_("Identity"), 0, parent)
 {
index d4ca92472d68bb37b9b0ee1794c8839f9666eb9d..b5bf6ff381c4dad5466da350823e74b2eed8b21b 100644 (file)
@@ -38,6 +38,7 @@
 #include "ui_PrefPrinterUi.h"
 #include "ui_PrefUi.h"
 #include "ui_PrefIdentityUi.h"
+#include "ui_ShortcutUi.h"
 
 #include <QDialog>
 #include <QValidator>
@@ -344,6 +345,17 @@ public Q_SLOTS:
 };
 
 
+class GuiShortcutDialog : public QDialog, public Ui::ShortcutUi
+{
+public:
+       GuiShortcutDialog(QWidget * parent) : QDialog(parent)
+       {
+               Ui::ShortcutUi::setupUi(this);
+               QDialog::setModal(true);
+       }
+};
+
+
 class PrefShortcuts : public PrefModule, public Ui::PrefShortcuts
 {
        Q_OBJECT
@@ -355,7 +367,12 @@ public:
 
 public Q_SLOTS:
        void select_bind();
-
+       void on_newPB_pressed();
+       void on_modifyPB_pressed();
+       void on_removePB_pressed();
+       void on_searchPB_pressed();
+private:
+       GuiShortcutDialog * shortcut_;
 };
 
 
index 0cb90ec9d0193852e1e8504c99ffa7022a388bdb..e9327e99be41cfb10aeaaeb064f345da1f01bfd3 100644 (file)
@@ -284,6 +284,7 @@ UIFILES = \
        RefUi.ui \
        SearchUi.ui \
        SendtoUi.ui \
+       ShortcutUi.ui \
        ShowFileUi.ui \
        SpellcheckerUi.ui \
        TabularCreateUi.ui \
index 3e75055c308e44a04b877abe0293f8eace869ce9..f5b937398935b3db23bab6c11ed2c1fd82e1fae7 100644 (file)
    <property name="spacing" >
     <number>6</number>
    </property>
-   <item row="0" column="1" >
-    <widget class="QLineEdit" name="bindFileED" />
-   </item>
-   <item rowspan="7" row="2" column="0" colspan="2" >
-    <widget class="QTreeWidget" name="shortcutsTW" />
-   </item>
    <item row="8" column="2" >
     <spacer>
      <property name="orientation" >
      </property>
     </spacer>
    </item>
-   <item row="7" column="2" >
-    <widget class="QPushButton" name="modifyPB" >
-     <property name="text" >
-      <string>Modify</string>
-     </property>
-    </widget>
-   </item>
-   <item row="6" column="2" >
-    <widget class="QPushButton" name="removePB" >
-     <property name="text" >
-      <string>Remove</string>
-     </property>
-    </widget>
-   </item>
    <item row="5" column="2" >
-    <widget class="QPushButton" name="editNew" >
-     <property name="text" >
-      <string>New</string>
-     </property>
-    </widget>
-   </item>
-   <item row="4" column="2" >
     <spacer>
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" >
       <size>
-       <width>21</width>
+       <width>51</width>
        <height>83</height>
       </size>
      </property>
     </spacer>
    </item>
-   <item row="3" column="2" >
-    <widget class="QPushButton" name="editSearch" >
-     <property name="text" >
-      <string>Search</string>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="2" >
-    <widget class="QLineEdit" name="lineEdit" >
+   <item row="6" column="2" >
+    <widget class="QLineEdit" name="searchLE" >
      <property name="sizePolicy" >
       <sizepolicy>
        <hsizetype>1</hsizetype>
      </property>
     </widget>
    </item>
+   <item row="0" column="1" >
+    <widget class="QLineEdit" name="bindFileED" />
+   </item>
+   <item rowspan="7" row="2" column="0" colspan="2" >
+    <widget class="QTreeWidget" name="shortcutsTW" />
+   </item>
+   <item row="3" column="2" >
+    <widget class="QPushButton" name="removePB" >
+     <property name="text" >
+      <string>Remove</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2" >
+    <widget class="QPushButton" name="newPB" >
+     <property name="text" >
+      <string>New</string>
+     </property>
+    </widget>
+   </item>
    <item row="0" column="2" >
     <widget class="QPushButton" name="bindFilePB" >
      <property name="text" >
      </property>
     </widget>
    </item>
+   <item row="7" column="2" >
+    <widget class="QPushButton" name="searchPB" >
+     <property name="text" >
+      <string>Search</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="2" >
+    <widget class="QPushButton" name="modifyPB" >
+     <property name="text" >
+      <string>Modify</string>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <tabstops>
diff --git a/src/frontends/qt4/ui/ShortcutUi.ui b/src/frontends/qt4/ui/ShortcutUi.ui
new file mode 100644 (file)
index 0000000..066c96e
--- /dev/null
@@ -0,0 +1,138 @@
+<ui version="4.0" >
+ <class>ShortcutUi</class>
+ <widget class="QDialog" name="shortcutUi" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>221</width>
+    <height>147</height>
+   </rect>
+  </property>
+  <property name="sizePolicy" >
+   <sizepolicy>
+    <hsizetype>1</hsizetype>
+    <vsizetype>1</vsizetype>
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle" >
+   <string>Edit shortcut</string>
+  </property>
+  <property name="sizeGripEnabled" >
+   <bool>true</bool>
+  </property>
+  <layout class="QGridLayout" >
+   <property name="margin" >
+    <number>9</number>
+   </property>
+   <property name="spacing" >
+    <number>6</number>
+   </property>
+   <item row="2" column="0" colspan="2" >
+    <layout class="QHBoxLayout" >
+     <property name="margin" >
+      <number>0</number>
+     </property>
+     <property name="spacing" >
+      <number>6</number>
+     </property>
+     <item>
+      <spacer>
+       <property name="orientation" >
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeType" >
+        <enum>QSizePolicy::Expanding</enum>
+       </property>
+       <property name="sizeHint" >
+        <size>
+         <width>20</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="okPB" >
+       <property name="text" >
+        <string>&amp;OK</string>
+       </property>
+       <property name="autoDefault" >
+        <bool>false</bool>
+       </property>
+       <property name="default" >
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="cancelPB" >
+       <property name="text" >
+        <string>Cancel</string>
+       </property>
+       <property name="autoDefault" >
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="0" column="0" >
+    <widget class="QLabel" name="lfunLBL" >
+     <property name="text" >
+      <string>Function:</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" >
+    <widget class="QLabel" name="shortcutLBL" >
+     <property name="text" >
+      <string>Shortcut</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1" >
+    <widget class="QLineEdit" name="shortcutED" >
+     <property name="sizePolicy" >
+      <sizepolicy>
+       <hsizetype>7</hsizetype>
+       <vsizetype>0</vsizetype>
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="toolTip" >
+      <string>Enter BibTeX database name</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1" >
+    <widget class="QLineEdit" name="lfunED" >
+     <property name="sizePolicy" >
+      <sizepolicy>
+       <hsizetype>7</hsizetype>
+       <vsizetype>0</vsizetype>
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="toolTip" >
+      <string>Enter BibTeX database name</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <tabstops>
+  <tabstop>lfunED</tabstop>
+  <tabstop>okPB</tabstop>
+  <tabstop>cancelPB</tabstop>
+ </tabstops>
+ <includes>
+  <include location="local" >qt_helpers.h</include>
+ </includes>
+ <resources/>
+ <connections/>
+</ui>