VirtualBox

Changeset 5732 in vbox for trunk/src/VBox/Debugger


Ignore:
Timestamp:
Nov 13, 2007 11:15:57 PM (17 years ago)
Author:
vboxsync
Message:

Fixed annoying history crap.

Location:
trunk/src/VBox/Debugger
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Debugger/VBoxDbgConsole.cpp

    r4071 r5732  
    124124
    125125VBoxDbgConsoleInput::VBoxDbgConsoleInput(QWidget *pParent/* = NULL*/, const char *pszName/* = NULL*/)
    126     : QComboBox(true, pParent, pszName)
    127 {
    128     insertItem("", 0);
    129     setInsertionPolicy(AfterCurrent);
     126    : QComboBox(true, pParent, pszName), m_iBlankItem(0)
     127{
     128    insertItem("", m_iBlankItem);
     129    //setInsertionPolicy(AfterCurrent);
     130    setInsertionPolicy(NoInsertion);
    130131    setMaxCount(50);
    131132    const QLineEdit *pEdit = lineEdit();
     
    147148void VBoxDbgConsoleInput::returnPressed()
    148149{
     150    /* deal with the current command. */
    149151    QString Str = currentText();
    150152    emit commandSubmitted(Str);
     153
     154    /* update the history and clear the entry field */
     155    if (text(m_iBlankItem - 1) != Str)
     156    {
     157        changeItem(Str, m_iBlankItem);
     158        removeItem(m_iBlankItem - maxCount() - 1);
     159        insertItem("", ++m_iBlankItem);
     160    }
     161
    151162    clearEdit();
    152     setCurrentItem(0);
     163    setCurrentItem(m_iBlankItem);
    153164}
    154165
  • trunk/src/VBox/Debugger/VBoxDbgConsole.h

    r4071 r5732  
    110110     */
    111111    void returnPressed();
     112
     113protected:
     114    /** The current blank entry. */
     115    int m_iBlankItem;
    112116};
    113117
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette