TextLabel1, SLOT(setEnabled(bool)));
connect(uiFilePB, SIGNAL(clicked()),
this, SLOT(select_ui()));
- connect(bindFilePB, SIGNAL(clicked()),
- this, SLOT(select_bind()));
connect(uiFileED, SIGNAL(textChanged(const QString &)),
this, SIGNAL(changed()));
- connect(bindFileED, SIGNAL(textChanged(const QString &)),
- this, SIGNAL(changed()));
connect(restoreCursorCB, SIGNAL(clicked()),
this, SIGNAL(changed()));
connect(loadSessionCB, SIGNAL(clicked()),
void PrefUserInterface::apply(LyXRC & rc) const
{
rc.ui_file = internal_path(fromqstr(uiFileED->text()));
- rc.bind_file = internal_path(fromqstr(bindFileED->text()));
rc.use_lastfilepos = restoreCursorCB->isChecked();
rc.load_session = loadSessionCB->isChecked();
if (loadWindowSizeCB->isChecked()) {
void PrefUserInterface::update(LyXRC const & rc)
{
uiFileED->setText(toqstr(external_path(rc.ui_file)));
- bindFileED->setText(toqstr(external_path(rc.bind_file)));
restoreCursorCB->setChecked(rc.use_lastfilepos);
loadSessionCB->setChecked(rc.load_session);
bool loadWindowSize = rc.geometry_width == 0 && rc.geometry_height == 0;
}
-void PrefUserInterface::select_bind()
-{
- docstring const name =
- from_utf8(internal_path(fromqstr(bindFileED->text())));
- docstring file = form_->browsebind(name);
- if (!file.empty())
- bindFileED->setText(toqstr(file));
-}
-
-
void PrefUserInterface::on_loadWindowSizeCB_toggled(bool loadwindowsize)
{
windowWidthLA->setDisabled(loadwindowsize);
}
+/////////////////////////////////////////////////////////////////////
+//
+// PrefShortcuts
+//
+/////////////////////////////////////////////////////////////////////
+
+PrefShortcuts::PrefShortcuts(GuiPreferences * form, QWidget * parent)
+ : PrefModule(_("Shortcuts"), form, parent)
+{
+ setupUi(this);
+
+ connect(bindFilePB, SIGNAL(clicked()),
+ this, SLOT(select_bind()));
+ connect(bindFileED, SIGNAL(textChanged(const QString &)),
+ this, SIGNAL(changed()));
+}
+
+
+void PrefShortcuts::apply(LyXRC & rc) const
+{
+ rc.bind_file = internal_path(fromqstr(bindFileED->text()));
+}
+
+
+void PrefShortcuts::update(LyXRC const & rc)
+{
+ bindFileED->setText(toqstr(external_path(rc.bind_file)));
+}
+
+
+void PrefShortcuts::select_bind()
+{
+ docstring const name =
+ from_utf8(internal_path(fromqstr(bindFileED->text())));
+ docstring file = form_->browsebind(name);
+ if (!file.empty())
+ bindFileED->setText(toqstr(file));
+}
+
+
PrefIdentity::PrefIdentity(QWidget * parent)
: PrefModule(_("Identity"), 0, parent)
{
connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
add(new PrefUserInterface(this));
+ add(new PrefShortcuts(this));
add(new PrefScreenFonts(this));
add(new PrefColors(this));
add(new PrefDisplay);
#include "ui_PrefColorsUi.h"
#include "ui_PrefDisplayUi.h"
#include "ui_PrefPathsUi.h"
+#include "ui_PrefShortcutsUi.h"
#include "ui_PrefSpellcheckerUi.h"
#include "ui_PrefConvertersUi.h"
#include "ui_PrefFileformatsUi.h"
public Q_SLOTS:
void select_ui();
- void select_bind();
void on_loadWindowSizeCB_toggled(bool);
};
+class PrefShortcuts : public PrefModule, public Ui::PrefShortcuts
+{
+ Q_OBJECT
+public:
+ PrefShortcuts(GuiPreferences * form, QWidget * parent = 0);
+
+ void apply(LyXRC & rc) const;
+ void update(LyXRC const & rc);
+
+public Q_SLOTS:
+ void select_bind();
+
+};
+
+
class PrefIdentity : public PrefModule, public Ui::PrefIdentityUi
{
Q_OBJECT
--- /dev/null
+<ui version="4.0" >
+ <class>PrefShortcuts</class>
+ <widget class="QWidget" name="PrefShortcuts" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>398</width>
+ <height>418</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/>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="1" column="2" >
+ <widget class="QPushButton" name="bindFilePB" >
+ <property name="text" >
+ <string>B&rowse...</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="bindFileLA" >
+ <property name="text" >
+ <string>&Bind file:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>bindFileED</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLineEdit" name="bindFileED" />
+ </item>
+ <item row="5" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <tabstops>
+ <tabstop>bindFileED</tabstop>
+ <tabstop>bindFilePB</tabstop>
+ </tabstops>
+ <includes>
+ <include location="local" >qt_helpers.h</include>
+ </includes>
+ <resources/>
+ <connections/>
+</ui>
</layout>
</widget>
</item>
- <item row="1" column="2" >
- <widget class="QPushButton" name="bindFilePB" >
- <property name="text" >
- <string>B&rowse...</string>
- </property>
- </widget>
- </item>
<item row="0" column="0" >
<widget class="QLabel" name="uiFileLA" >
<property name="text" >
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="bindFileLA" >
- <property name="text" >
- <string>&Bind file:</string>
- </property>
- <property name="buddy" >
- <cstring>bindFileED</cstring>
- </property>
- </widget>
- </item>
<item row="0" column="1" >
<widget class="QLineEdit" name="uiFileED" />
</item>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="QLineEdit" name="bindFileED" />
- </item>
<item row="2" column="0" colspan="3" >
<widget class="QGroupBox" name="GeometryGB" >
<property name="sizePolicy" >
<tabstops>
<tabstop>uiFileED</tabstop>
<tabstop>uiFilePB</tabstop>
- <tabstop>bindFileED</tabstop>
- <tabstop>bindFilePB</tabstop>
<tabstop>loadWindowSizeCB</tabstop>
<tabstop>windowWidthSB</tabstop>
<tabstop>windowHeightSB</tabstop>