various small fixes

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4746 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-07-22 18:22:35 +00:00
parent 3f52b62838
commit e7ae3ca91b
7 changed files with 27 additions and 20 deletions

View File

@ -1,3 +1,13 @@
2002-07-22 John Levon <moz@compsoc.man.ac.uk>
* QCommandEdit.C: complete if right at end of line
* QLyXKeySym.C: cleanup comments
* QtView.C: prefer const int
* qlkey.h: fix some transliteration errors...
2002-07-22 John Levon <moz@compsoc.man.ac.uk>
* Toolbar_pimpl.h:

View File

@ -30,7 +30,7 @@ void QCommandEdit::keyPressEvent(QKeyEvent * e)
break;
case Key_Right:
if (e->state() & ControlButton)
if (cursorPosition() == text().length())
emit rightPressed();
else
QLineEdit::keyPressEvent(e);

View File

@ -14,8 +14,6 @@
#endif
#include "QLyXKeySym.h"
#include "qevent.h"
#include "qlkey.h"
QLyXKeySym::QLyXKeySym()
@ -33,7 +31,6 @@ void QLyXKeySym::set(int key, QString const & text)
void QLyXKeySym::init(string const & symbolname)
{
// FIXME: ARGHH !
key_ = string_to_qkey(symbolname);
}
@ -53,7 +50,6 @@ bool QLyXKeySym::isModifier() const
string QLyXKeySym::getSymbolName() const
{
// FIXME
return qkey_to_string(key_);
}
@ -68,7 +64,5 @@ char QLyXKeySym::getISOEncoded() const
bool QLyXKeySym::operator==(LyXKeySym const & k) const
{
QLyXKeySym const & o = static_cast<QLyXKeySym const &>(k);
// FIXME: UGHGHGHGGH
return o.key_ == key_ /*&& o.text_ == text_*/;
return o.key_ == key_;
}

View File

@ -56,6 +56,7 @@ public:
private:
/// the Qt sym value
int key_;
/**
* The generated text from the symbol. This will only be
* filled when the QLyXKeySym is used to pass a key press

View File

@ -41,6 +41,10 @@
using std::endl;
namespace {
int const idle_timer_value = 3000;
}
// FIXME: this has to go away
BufferView * current_view;
@ -69,7 +73,7 @@ QtView::QtView(unsigned int width, unsigned int height)
view_state_changed.connect(boost::bind(&QtView::update_view_state, this));
connect(&idle_timer_, SIGNAL(timeout()), this, SLOT(update_view_state_qt()));
idle_timer_.start(3000);
idle_timer_.start(idle_timer_value);
focus_command_buffer.connect(boost::bind(&QtView::focus_command_widget, this));
@ -79,7 +83,6 @@ QtView::QtView(unsigned int width, unsigned int height)
// assign an icon to main form
string const iconname = LibFileSearch("images", "lyx", "xpm");
if (!iconname.empty())
setIcon(QPixmap(iconname.c_str()));
@ -97,7 +100,7 @@ void QtView::message(string const & str)
{
statusBar()->message(str.c_str());
idle_timer_.stop();
idle_timer_.start(3000);
idle_timer_.start(idle_timer_value);
}

View File

@ -1,5 +1,6 @@
This file is intended to be a list of stuff that must be done before
we can say the first iteration of the Qt frontend is "finished".
we can say the first iteration of the Qt frontend is "finished". It
is incomplete.
Those with asterisks are what I perceive as being "big jobs"
@ -21,6 +22,7 @@ Menubar_pimpl
- import/export/view/update
- navigate
- implement openByName
- why is note disabled, index enabled with no doc etc. ?
QAbout
@ -103,8 +105,6 @@ QTexinfo
QtView
- decide what to do about prohibit/allowInput
- add autosave timeout
Toolbar_pimpl

View File

@ -38,7 +38,7 @@ int string_to_qkey(string const & str)
if (str == "Tab") return Qt::Key_Tab;
if (str == "BackSpace") return Qt::Key_BackSpace;
if (str == "Return") return Qt::Key_Return;
if (str == "KP_Enter") // correct ?? return Qt::Key_Enter;
if (str == "KP_Enter") return Qt::Key_Enter; // correct ?
if (str == "Insert") return Qt::Key_Insert;
if (str == "Delete") return Qt::Key_Delete;
if (str == "Pause") return Qt::Key_Pause;
@ -54,7 +54,7 @@ int string_to_qkey(string const & str)
if (str == "Next") return Qt::Key_Next;
if (str == "Shift_L") return Qt::Key_Shift;
if (str == "Control_L") return Qt::Key_Control;
if (str == "Alt_L") // correct ? return Qt::Key_Meta;
if (str == "Alt_L") return Qt::Key_Meta; // correct ?
if (str == "Alt_L") return Qt::Key_Alt;
if (str == "Caps_Lock") return Qt::Key_CapsLock;
if (str == "Num_Lock") return Qt::Key_NumLock;
@ -161,7 +161,7 @@ int string_to_qkey(string const & str)
if (str == "asciitilde") return Qt::Key_AsciiTilde;
if (str == "braceleft") return Qt::Key_BraceLeft;
if (str == "braceright") return Qt::Key_BraceRight;
if (str == "grave") // ??? return Qt::Key_QuoteLeft;
if (str == "grave") return Qt::Key_QuoteLeft; // ???
if (str == "notsign") return Qt::Key_notsign;
if (str == "nobreakspace") return Qt::Key_nobreakspace;
if (str == "exclamdown") return Qt::Key_exclamdown;
@ -259,8 +259,7 @@ int string_to_qkey(string const & str)
if (str == "thorn") return Qt::Key_thorn;
if (str == "ydiaeresis") return Qt::Key_ydiaeresis;
// FIXME: these ones I don't know the names of ... help !
// what's here is basically guesses ...
// FIXME, correct for all these ?
if (str == "Super_L") return Qt::Key_Super_L;
if (str == "Super_R") return Qt::Key_Super_R;
if (str == "Menu") return Qt::Key_Menu;
@ -282,7 +281,7 @@ int string_to_qkey(string const & str)
*/
string const qkey_to_string(int lkey)
{
switch(lkey) {
switch (lkey) {
case Qt::Key_Escape: return "Escape";
case Qt::Key_Tab: return "Tab";
case Qt::Key_BackSpace: return "BackSpace";