VirtualBox

Changeset 3805 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 24, 2007 10:30:02 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
23148
Message:

2124: VirtualBox LogViewer search mechanism:

LogViewer search mechanism improvements done:

  1. [Help]...[Find][Save][Refresh][Close] dialog button's configuration.
  2. Standard Help button.
  3. Find button for toggling search-panel visibility on/off.
  4. Name filter for log files added (*.log *.log.*).
  5. Search mechanism starts by any alpha-numeric key (w/o modifiers).
Location:
trunk/src/VBox/Frontends/VirtualBox/ui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMLogViewer.ui

    r3610 r3805  
    6363                    <cstring>unnamed</cstring>
    6464                </property>
     65                <widget class="QPushButton">
     66                    <property name="name">
     67                        <cstring>mHelpButton</cstring>
     68                    </property>
     69                    <property name="text">
     70                        <string>&amp;Help</string>
     71                    </property>
     72                    <property name="accel">
     73                        <string>Alt+H</string>
     74                    </property>
     75                </widget>
    6576                <spacer>
    6677                    <property name="name">
     
    8091                    </property>
    8192                </spacer>
     93                <widget class="QPushButton">
     94                    <property name="name">
     95                        <cstring>mFindButton</cstring>
     96                    </property>
     97                    <property name="text">
     98                        <string>&amp;Find</string>
     99                    </property>
     100                    <property name="accel">
     101                        <string>Alt+F</string>
     102                    </property>
     103                </widget>
    82104                <widget class="QPushButton">
    83105                    <property name="name">
     
    127149<connections>
    128150    <connection>
     151        <sender>mHelpButton</sender>
     152        <signal>clicked()</signal>
     153        <receiver>&amp;vboxProblem()</receiver>
     154        <slot>showHelpHelpDialog()</slot>
     155    </connection>
     156    <connection>
     157        <sender>mFindButton</sender>
     158        <signal>clicked()</signal>
     159        <receiver>VBoxVMLogViewer</receiver>
     160        <slot>search()</slot>
     161    </connection>
     162    <connection>
     163        <sender>mSaveButton</sender>
     164        <signal>clicked()</signal>
     165        <receiver>VBoxVMLogViewer</receiver>
     166        <slot>save()</slot>
     167    </connection>
     168    <connection>
     169        <sender>mRefreshButton</sender>
     170        <signal>clicked()</signal>
     171        <receiver>VBoxVMLogViewer</receiver>
     172        <slot>refresh()</slot>
     173    </connection>
     174    <connection>
    129175        <sender>mCloseButton</sender>
    130176        <signal>clicked()</signal>
    131177        <receiver>VBoxVMLogViewer</receiver>
    132178        <slot>close()</slot>
    133     </connection>
    134     <connection>
    135         <sender>mSaveButton</sender>
    136         <signal>clicked()</signal>
    137         <receiver>VBoxVMLogViewer</receiver>
    138         <slot>save()</slot>
    139     </connection>
    140     <connection>
    141         <sender>mRefreshButton</sender>
    142         <signal>clicked()</signal>
    143         <receiver>VBoxVMLogViewer</receiver>
    144         <slot>refresh()</slot>
    145179    </connection>
    146180</connections>
    147181<includes>
    148182    <include location="local" impldecl="in declaration">VBoxGlobal.h</include>
     183    <include location="local" impldecl="in implementation">VBoxProblemReporter.h</include>
    149184    <include location="global" impldecl="in implementation">qsizegrip.h</include>
    150185    <include location="global" impldecl="in implementation">qstatusbar.h</include>
     
    183218    <slot access="pritave">refresh()</slot>
    184219    <slot access="private">save()</slot>
     220    <slot access="private">search()</slot>
    185221</slots>
    186222<functions>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMLogViewer.ui.h

    r3797 r3805  
    138138            tr ("Perform case sensitive search (when checked)"));
    139139        mWarningString->setText (tr ("String not found"));
     140    }
     141
     142    void setText (const QString &aText)
     143    {
     144        mSearchString->setText (aText);
    140145    }
    141146
     
    248253        qApp->installEventFilter (this);
    249254        mSearchString->setFocus();
     255        mSearchString->selectAll();
    250256    }
    251257
     
    334340
    335341    /* fix the tab order to ensure the dialog keys are always the last */
    336     setTabOrder (mSearchPanel->focusProxy(), mSaveButton);
     342    setTabOrder (mSearchPanel->focusProxy(), mHelpButton);
     343    setTabOrder (mHelpButton, mFindButton);
     344    setTabOrder (mFindButton, mSaveButton);
    337345    setTabOrder (mSaveButton, mRefreshButton);
    338346    setTabOrder (mRefreshButton, mCloseButton);
     
    470478            }
    471479        }
     480        if (aEvent->key() >= Qt::Key_Exclam &&
     481            aEvent->key() <= Qt::Key_AsciiTilde &&
     482            mLogList->isEnabled())
     483        {
     484            mSearchPanel->show();
     485            mSearchPanel->setText (aEvent->text());
     486        }
    472487    }
    473488    else if (aEvent->state() == Qt::ControlButton &&
     
    529544    {
    530545        /* reading log files folder */
     546        logFilesDir.setNameFilter ("*.log *.log.*");
    531547        QStringList logList = logFilesDir.entryList (QDir::Files);
    532548        if (!logList.empty()) isAnyLogPresent = true;
     
    556572
    557573    /* enable/disable save button & tab widget according log presence */
     574    mFindButton->setEnabled (isAnyLogPresent);
    558575    mSaveButton->setEnabled (isAnyLogPresent);
    559576    mLogList->setEnabled (isAnyLogPresent);
     
    639656}
    640657
     658void VBoxVMLogViewer::search()
     659{
     660    mSearchPanel->isHidden() ? mSearchPanel->show() : mSearchPanel->hide();
     661}
     662
    641663#include "VBoxVMLogViewer.ui.moc"
    642664
Note: See TracChangeset for help on using the changeset viewer.

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