* The gui change for the mouse wheel speed setting. This includes the

renaming of the keyboard preferences pane into a input preferences pane.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22718 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stefan Schimanski 2008-01-30 21:20:56 +00:00
parent dd3842505b
commit fe348eb8b7
4 changed files with 31 additions and 16 deletions

View File

@ -924,7 +924,7 @@ src_frontends_qt4_ui_files = Split('''
PrefDisplayUi.ui
PrefFileformatsUi.ui
PrefIdentityUi.ui
PrefKeyboardUi.ui
PrefInputUi.ui
PrefLanguageUi.ui
PrefLatexUi.ui
PrefPathsUi.ui

View File

@ -246,12 +246,12 @@ void PrefDate::update(LyXRC const & rc)
/////////////////////////////////////////////////////////////////////
//
// PrefKeyboard
// PrefInput
//
/////////////////////////////////////////////////////////////////////
PrefKeyboard::PrefKeyboard(GuiPreferences * form, QWidget * parent)
: PrefModule(_("Keyboard"), form, parent)
PrefInput::PrefInput(GuiPreferences * form, QWidget * parent)
: PrefModule(_("Keyboard/Mouse"), form, parent)
{
setupUi(this);
@ -261,34 +261,38 @@ PrefKeyboard::PrefKeyboard(GuiPreferences * form, QWidget * parent)
this, SIGNAL(changed()));
connect(secondKeymapED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
connect(mouseWheelSpeedSB, SIGNAL(valueChanged(double)),
this, SIGNAL(changed()));
}
void PrefKeyboard::apply(LyXRC & rc) const
void PrefInput::apply(LyXRC & rc) const
{
// FIXME: can derive CB from the two EDs
rc.use_kbmap = keymapCB->isChecked();
rc.primary_kbmap = internal_path(fromqstr(firstKeymapED->text()));
rc.secondary_kbmap = internal_path(fromqstr(secondKeymapED->text()));
rc.mouse_wheel_speed = mouseWheelSpeedSB->value();
}
void PrefKeyboard::update(LyXRC const & rc)
void PrefInput::update(LyXRC const & rc)
{
// FIXME: can derive CB from the two EDs
keymapCB->setChecked(rc.use_kbmap);
firstKeymapED->setText(toqstr(external_path(rc.primary_kbmap)));
secondKeymapED->setText(toqstr(external_path(rc.secondary_kbmap)));
mouseWheelSpeedSB->setValue(rc.mouse_wheel_speed);
}
QString PrefKeyboard::testKeymap(QString keymap)
QString PrefInput::testKeymap(QString keymap)
{
return toqstr(form_->browsekbmap(from_utf8(internal_path(fromqstr(keymap)))));
}
void PrefKeyboard::on_firstKeymapPB_clicked(bool)
void PrefInput::on_firstKeymapPB_clicked(bool)
{
QString const file = testKeymap(firstKeymapED->text());
if (!file.isEmpty())
@ -296,7 +300,7 @@ void PrefKeyboard::on_firstKeymapPB_clicked(bool)
}
void PrefKeyboard::on_secondKeymapPB_clicked(bool)
void PrefInput::on_secondKeymapPB_clicked(bool)
{
QString const file = testKeymap(secondKeymapED->text());
if (!file.isEmpty())
@ -304,7 +308,7 @@ void PrefKeyboard::on_secondKeymapPB_clicked(bool)
}
void PrefKeyboard::on_keymapCB_toggled(bool keymap)
void PrefInput::on_keymapCB_toggled(bool keymap)
{
firstKeymapLA->setEnabled(keymap);
secondKeymapLA->setEnabled(keymap);
@ -2154,7 +2158,7 @@ GuiPreferences::GuiPreferences(GuiView & lv)
add(new PrefScreenFonts(this));
add(new PrefColors(this));
add(new PrefDisplay);
add(new PrefKeyboard(this));
add(new PrefInput(this));
add(new PrefPaths(this));

View File

@ -28,7 +28,7 @@
#include "ui_PrefPlaintextUi.h"
#include "ui_PrefDateUi.h"
#include "ui_PrefKeyboardUi.h"
#include "ui_PrefInputUi.h"
#include "ui_PrefLatexUi.h"
#include "ui_PrefScreenFontsUi.h"
#include "ui_PrefColorsUi.h"
@ -106,11 +106,11 @@ public:
};
class PrefKeyboard : public PrefModule, public Ui::PrefKeyboardUi
class PrefInput : public PrefModule, public Ui::PrefInputUi
{
Q_OBJECT
public:
PrefKeyboard(GuiPreferences * form, QWidget * parent = 0);
PrefInput(GuiPreferences * form, QWidget * parent = 0);
virtual void apply(LyXRC & rc) const;
virtual void update(LyXRC const & rc);

View File

@ -1,6 +1,6 @@
<ui version="4.0" >
<class>PrefKeyboardUi</class>
<widget class="QWidget" name="PrefKeyboardUi" >
<class>PrefInputUi</class>
<widget class="QWidget" name="PrefInputUi" >
<property name="geometry" >
<rect>
<x>0</x>
@ -121,6 +121,9 @@
<property name="text" >
<string>Wheel scrolling speed:</string>
</property>
<property name="buddy" >
<cstring>mouseWheelSpeedSB</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
@ -179,6 +182,14 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>keymapCB</tabstop>
<tabstop>firstKeymapED</tabstop>
<tabstop>firstKeymapPB</tabstop>
<tabstop>secondKeymapED</tabstop>
<tabstop>secondKeymapPB</tabstop>
<tabstop>mouseWheelSpeedSB</tabstop>
</tabstops>
<includes>
<include location="local" >qt_helpers.h</include>
</includes>