X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fuisupport%2Finputline.cpp;h=1d23faa070a054507b8d321fe9cf211a047aadea;hb=a643fb463875bb3e516bcf6d61948f764bcb48f3;hp=341905af05dbc07a0281f80f6cb44c5d00d00268;hpb=d6b056e936ec441258d291b7a8af7b83f9f53016;p=quassel.git diff --git a/src/uisupport/inputline.cpp b/src/uisupport/inputline.cpp index 341905af..1d23faa0 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,36 @@ #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) { + 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();