PrefShortcuts: add a simple shortcut dialog (does nothing now), adjust prefShortcuts panel

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21037 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2007-10-18 16:47:31 +00:00
parent 94776982b2
commit 0780a505eb
6 changed files with 223 additions and 38 deletions

View 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

View 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)
{

View 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_;
};

View File

@ -284,6 +284,7 @@ UIFILES = \
RefUi.ui \
SearchUi.ui \
SendtoUi.ui \
ShortcutUi.ui \
ShowFileUi.ui \
SpellcheckerUi.ui \
TabularCreateUi.ui \

View File

@ -27,12 +27,6 @@
<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" >
@ -49,28 +43,7 @@
</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>
@ -80,21 +53,14 @@
</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>
@ -105,6 +71,26 @@
</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" >
@ -129,6 +115,20 @@
</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>

View File

@ -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>