X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Finputline.cpp;h=05f97554cc6b7fff43191b3c4810b6cab4f7cbf0;hb=d1c517f3be0e4457f363f74a474a8a47bdd4a5cf;hp=341905af05dbc07a0281f80f6cb44c5d00d00268;hpb=d6b056e936ec441258d291b7a8af7b83f9f53016;p=quassel.git diff --git a/src/uisupport/inputline.cpp b/src/uisupport/inputline.cpp index 341905af..05f97554 100644 --- a/src/uisupport/inputline.cpp +++ b/src/uisupport/inputline.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005/06 by the Quassel IRC Team * + * Copyright (C) 2005/06 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -22,23 +22,37 @@ #include "tabcompleter.h" -InputLine::InputLine(QWidget *parent) : QLineEdit(parent) { - idx = 0; +InputLine::InputLine(QWidget *parent) + : QLineEdit(parent), + idx(0) +{ connect(this, SIGNAL(returnPressed()), this, SLOT(enter())); tabComplete = new TabCompleter(this); - connect(this, SIGNAL(nickListUpdated(QStringList)), tabComplete, SLOT(updateNickList(QStringList))); + +#ifdef Q_WS_MAC + bindModifier = Qt::ControlModifier | Qt::AltModifier; + jumpModifier = Qt::ControlModifier; +#else + bindModifier = Qt::ControlModifier; + jumpModifier = Qt::AltModifier; +#endif } InputLine::~InputLine() { - delete tabComplete; } void InputLine::keyPressEvent(QKeyEvent * event) { + if((event->modifiers() == jumpModifier || event->modifiers() == bindModifier) && + (Qt::Key_0 <= event->key() && event->key() <= Qt::Key_9)) { + event->ignore(); + return; + } + if(event->key() == Qt::Key_Tab) { // Tabcomplete tabComplete->complete(); event->accept(); } else { - tabComplete->disable(); + tabComplete->reset(); if(event->key() == Qt::Key_Up) { if(idx > 0) { idx--; setText(history[idx]); } event->accept();