Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/scripttools/debugging/qscriptdebugger.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtSCriptTools module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    7676#include "qscriptxmlparser_p.h"
    7777
    78 #include "qscriptenginedebuggerfrontend_p.h"
    79 #include "qscriptdebuggerbackend_p.h"
    80 #include <QtScript/qscriptengine.h>
    81 
    8278#include "private/qobject_p.h"
    8379
     
    9591#include <QtGui/qicon.h>
    9692#include <QtGui/qinputdialog.h>
     93#include <QtGui/qmenu.h>
     94#include <QtGui/qtoolbar.h>
     95#include <QtGui/qtooltip.h>
    9796
    9897QT_BEGIN_NAMESPACE
     
    138137  \brief The QScriptDebugger class provides a Qt Script debugger.
    139138
    140   \ingroup scripttools
    141   \mainclass
     139  \ingroup script
     140
    142141*/
    143142
     
    172171        const QString &contents, int cursorPosition, int frameIndex, int options);
    173172
    174     QString toolTip(int frameIndex, int lineNumber,
    175                     const QStringList &path);
     173    void showToolTip(const QPoint &pos, int frameIndex,
     174                     int lineNumber, const QStringList &path);
    176175
    177176    static QPixmap pixmap(const QString &path);
     
    634633}
    635634
     635class QScriptToolTipJob : public QScriptDebuggerCommandSchedulerJob
     636{
     637public:
     638    QScriptToolTipJob(const QPoint &pos, int frameIndex,
     639                      int lineNumber, const QStringList &path,
     640                      QScriptDebuggerCommandSchedulerInterface *scheduler)
     641        : QScriptDebuggerCommandSchedulerJob(scheduler), m_pos(pos),
     642          m_frameIndex(frameIndex), m_lineNumber(lineNumber), m_path(path)
     643        {}
     644
     645    void start()
     646    {
     647        QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this);
     648        frontend.scheduleGetPropertyExpressionValue(m_frameIndex, m_lineNumber, m_path);
     649    }
     650    void handleResponse(const QScriptDebuggerResponse &response, int /*commandId*/)
     651    {
     652        QString tip = response.result().toString();
     653        if (tip.indexOf(QLatin1Char('\n')) != -1) {
     654            QStringList lines = tip.split(QLatin1Char('\n'));
     655            int lineCount = lines.size();
     656            if (lineCount > 5) {
     657                lines = lines.mid(0, 5);
     658                lines.append(QString::fromLatin1("(... %0 more lines ...)").arg(lineCount - 5));
     659            }
     660            tip = lines.join(QLatin1String("\n"));
     661        }
     662        QToolTip::showText(m_pos, tip);
     663        finish();
     664    }
     665
     666private:
     667    QPoint m_pos;
     668    int m_frameIndex;
     669    int m_lineNumber;
     670    QStringList m_path;
     671};
     672
    636673/*!
    637674  \reimp
    638675*/
    639 QString QScriptDebuggerPrivate::toolTip(int frameIndex, int lineNumber,
    640                                         const QStringList &path)
     676void QScriptDebuggerPrivate::showToolTip(const QPoint &pos, int frameIndex,
     677                                         int lineNumber, const QStringList &path)
    641678{
    642679    if (frameIndex == -1) {
     
    646683            frameIndex = console->currentFrameIndex();
    647684    }
    648     // ### cheating for now, need to use async API
    649     QScriptEngineDebuggerFrontend *edf = static_cast<QScriptEngineDebuggerFrontend*>(frontend);
    650     QScriptDebuggerBackend *backend = edf->backend();
    651     QScriptContext *ctx = backend->context(frameIndex);
    652     if (!ctx || path.isEmpty())
    653         return QString();
    654     QScriptContextInfo ctxInfo(ctx);
    655     if (ctx->callee().isValid()
    656         && ((lineNumber < ctxInfo.functionStartLineNumber())
    657             || (lineNumber > ctxInfo.functionEndLineNumber()))) {
    658         return QString();
    659     }
    660     QScriptValueList objects;
    661     int pathIndex = 0;
    662     if (path.at(0) == QLatin1String("this")) {
    663         objects.append(ctx->thisObject());
    664         ++pathIndex;
    665     } else {
    666 #if QT_VERSION >= 0x040500
    667         objects << ctx->scopeChain();
    668 #else
    669         objects.append(ctx->activationObject());
    670 #endif
    671     }
    672     for (int i = 0; i < objects.size(); ++i) {
    673         QScriptValue val = objects.at(i);
    674         for (int j = pathIndex; val.isValid() && (j < path.size()); ++j) {
    675             val = val.property(path.at(j));
    676         }
    677         if (val.isValid()) {
    678             bool hadException = (ctx->state() == QScriptContext::ExceptionState);
    679             QString str = val.toString();
    680             if (!hadException && backend->engine()->hasUncaughtException())
    681                 backend->engine()->clearExceptions();
    682             return str;
    683         }
    684     }
    685     return QString();
     685    QScriptDebuggerJob *job = new QScriptToolTipJob(pos, frameIndex, lineNumber, path, this);
     686    scheduleJob(job);
    686687}
    687688
     
    693694{
    694695    return new QScriptCompletionTask(
    695         contents, cursorPosition, frameIndex, frontend,
     696        contents, cursorPosition, frameIndex, this, this,
    696697        (options & QScriptCompletionProviderInterface::ConsoleCommandCompletion) ? console : 0);
    697698}
     
    882883        return;
    883884    bool ok = false;
    884     int lineNumber = QInputDialog::getInteger(0, QObject::tr("Go to Line"),
    885                                               QObject::tr("Line:"),
     885    int lineNumber = QInputDialog::getInteger(0, QScriptDebugger::tr("Go to Line"),
     886                                              QScriptDebugger::tr("Line:"),
    886887                                              view->cursorLineNumber(),
    887888                                              1, INT_MAX, 1, &ok);
     
    992993            m_debugger->scriptsModel->addScript(scriptId, data);
    993994
    994 #if QT_VERSION >= 0x040500
    995995            // ### could be slow, might want to do this in a separate thread
    996             QString xml = qt_scriptToXml(data.contents(), data.baseLineNumber());
     996//            Q_ASSERT_X(false, Q_FUNC_INFO, "implement me");
     997            QString xml; // = qt_scriptToXml(data.contents(), data.baseLineNumber());
    997998            QScriptXmlParser::Result extraInfo = QScriptXmlParser::parse(xml);
    998999            m_debugger->scriptsModel->addExtraScriptInfo(
    9991000                scriptId, extraInfo.functionsInfo, extraInfo.executableLineNumbers);
    1000 #endif
    10011001
    10021002            if (++m_index < m_added.size())
     
    10201020    SyncBreakpointsJob(QScriptDebuggerPrivate *debugger)
    10211021        : QScriptDebuggerCommandSchedulerJob(debugger),
    1022           m_debugger(debugger) {}
     1022          m_debugger(debugger), m_index(-1) {}
    10231023    void start()
    10241024    {
     
    10791079    LoadLocalsJob(QScriptDebuggerPrivate *debugger, int frameIndex)
    10801080        : QScriptDebuggerCommandSchedulerJob(debugger),
    1081           m_debugger(debugger), m_frameIndex(frameIndex), m_state(0) {}
     1081          m_debugger(debugger), m_frameIndex(frameIndex) {}
    10821082
    10831083    void start()
     
    11111111    QScriptDebuggerPrivate *m_debugger;
    11121112    int m_frameIndex;
    1113     int m_state;
    11141113};
    11151114
     
    13381337}
    13391338
     1339QAction *QScriptDebugger::action(DebuggerAction action, QObject *parent)
     1340{
     1341    switch (action) {
     1342    case InterruptAction:
     1343        return interruptAction(parent);
     1344    case ContinueAction:
     1345        return continueAction(parent);
     1346    case StepIntoAction:
     1347        return stepIntoAction(parent);
     1348    case StepOverAction:
     1349        return stepOverAction(parent);
     1350    case StepOutAction:
     1351        return stepOutAction(parent);
     1352    case RunToCursorAction:
     1353        return runToCursorAction(parent);
     1354    case RunToNewScriptAction:
     1355        return runToNewScriptAction(parent);
     1356    case ToggleBreakpointAction:
     1357        return toggleBreakpointAction(parent);
     1358    case ClearDebugOutputAction:
     1359        return clearDebugOutputAction(parent);
     1360    case ClearErrorLogAction:
     1361        return clearErrorLogAction(parent);
     1362    case ClearConsoleAction:
     1363        return clearConsoleAction(parent);
     1364    case FindInScriptAction:
     1365        return findInScriptAction(parent);
     1366    case FindNextInScriptAction:
     1367        return findNextInScriptAction(parent);
     1368    case FindPreviousInScriptAction:
     1369        return findPreviousInScriptAction(parent);
     1370    case GoToLineAction:
     1371        return goToLineAction(parent);
     1372    }
     1373    return 0;
     1374}
     1375
     1376QWidget *QScriptDebugger::widget(DebuggerWidget widget)
     1377{
     1378    switch (widget) {
     1379    case ConsoleWidget: {
     1380        QScriptDebuggerConsoleWidgetInterface *w = consoleWidget();
     1381        if (!w && widgetFactory()) {
     1382            w = widgetFactory()->createConsoleWidget();
     1383            setConsoleWidget(w);
     1384        }
     1385        return w;
     1386    }
     1387    case StackWidget: {
     1388        QScriptDebuggerStackWidgetInterface *w = stackWidget();
     1389        if (!w && widgetFactory()) {
     1390            w = widgetFactory()->createStackWidget();
     1391            setStackWidget(w);
     1392        }
     1393        return w;
     1394    }
     1395    case ScriptsWidget: {
     1396        QScriptDebuggerScriptsWidgetInterface *w = scriptsWidget();
     1397        if (!w && widgetFactory()) {
     1398            w = widgetFactory()->createScriptsWidget();
     1399            setScriptsWidget(w);
     1400        }
     1401        return w;
     1402    }
     1403    case LocalsWidget: {
     1404        QScriptDebuggerLocalsWidgetInterface *w = localsWidget();
     1405        if (!w && widgetFactory()) {
     1406            w = widgetFactory()->createLocalsWidget();
     1407            setLocalsWidget(w);
     1408        }
     1409        return w;
     1410    }
     1411    case CodeWidget: {
     1412        QScriptDebuggerCodeWidgetInterface *w = codeWidget();
     1413        if (!w && widgetFactory()) {
     1414            w = widgetFactory()->createCodeWidget();
     1415            setCodeWidget(w);
     1416        }
     1417        return w;
     1418    }
     1419    case CodeFinderWidget: {
     1420        QScriptDebuggerCodeFinderWidgetInterface *w = codeFinderWidget();
     1421        if (!w && widgetFactory()) {
     1422            w = widgetFactory()->createCodeFinderWidget();
     1423            setCodeFinderWidget(w);
     1424        }
     1425        return w;
     1426    }
     1427    case BreakpointsWidget: {
     1428        QScriptBreakpointsWidgetInterface *w = breakpointsWidget();
     1429        if (!w && widgetFactory()) {
     1430            w = widgetFactory()->createBreakpointsWidget();
     1431            setBreakpointsWidget(w);
     1432        }
     1433        return w;
     1434    }
     1435    case DebugOutputWidget: {
     1436        QScriptDebugOutputWidgetInterface *w = debugOutputWidget();
     1437        if (!w && widgetFactory()) {
     1438            w = widgetFactory()->createDebugOutputWidget();
     1439            setDebugOutputWidget(w);
     1440        }
     1441        return w;
     1442    }
     1443    case ErrorLogWidget: {
     1444        QScriptErrorLogWidgetInterface *w = errorLogWidget();
     1445        if (!w && widgetFactory()) {
     1446            w = widgetFactory()->createErrorLogWidget();
     1447            setErrorLogWidget(w);
     1448        }
     1449        return w;
     1450    }
     1451    }
     1452    return 0;
     1453}
     1454
    13401455QScriptDebuggerConsoleWidgetInterface *QScriptDebugger::consoleWidget() const
    13411456{
     
    15601675        interruptIcon.addPixmap(d->pixmap(QString::fromLatin1("d_interrupt.png")), QIcon::Disabled);
    15611676        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1562         that->d_func()->interruptAction = new QAction(interruptIcon, QObject::tr("Interrupt"), parent);
     1677        that->d_func()->interruptAction = new QAction(interruptIcon, QScriptDebugger::tr("Interrupt"), parent);
    15631678        d->interruptAction->setEnabled(!d->interactive);
    1564         d->interruptAction->setShortcut(QObject::tr("Shift+F5"));
     1679        d->interruptAction->setShortcut(QScriptDebugger::tr("Shift+F5"));
    15651680        QObject::connect(d->interruptAction, SIGNAL(triggered()),
    15661681                         that, SLOT(_q_interrupt()));
     
    15771692        continueIcon.addPixmap(d->pixmap(QString::fromLatin1("d_play.png")), QIcon::Disabled);
    15781693        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1579         that->d_func()->continueAction = new QAction(continueIcon, QObject::tr("Continue"), parent);
     1694        that->d_func()->continueAction = new QAction(continueIcon, QScriptDebugger::tr("Continue"), parent);
    15801695        d->continueAction->setEnabled(d->interactive);
    1581         d->continueAction->setShortcut(QObject::tr("F5"));
     1696        d->continueAction->setShortcut(QScriptDebugger::tr("F5"));
    15821697        QObject::connect(d->continueAction, SIGNAL(triggered()),
    15831698                         that, SLOT(_q_continue()));
     
    15941709        stepIntoIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepinto.png")), QIcon::Disabled);
    15951710        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1596         that->d_func()->stepIntoAction = new QAction(stepIntoIcon, QObject::tr("Step Into"), parent);
     1711        that->d_func()->stepIntoAction = new QAction(stepIntoIcon, QScriptDebugger::tr("Step Into"), parent);
    15971712        d->stepIntoAction->setEnabled(d->interactive);
    1598         d->stepIntoAction->setShortcut(QObject::tr("F11"));
     1713        d->stepIntoAction->setShortcut(QScriptDebugger::tr("F11"));
    15991714        QObject::connect(d->stepIntoAction, SIGNAL(triggered()),
    16001715                         that, SLOT(_q_stepInto()));
     
    16111726        stepOverIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepover.png")), QIcon::Disabled);
    16121727        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1613         that->d_func()->stepOverAction = new QAction(stepOverIcon, QObject::tr("Step Over"), parent);
     1728        that->d_func()->stepOverAction = new QAction(stepOverIcon, QScriptDebugger::tr("Step Over"), parent);
    16141729        d->stepOverAction->setEnabled(d->interactive);
    1615         d->stepOverAction->setShortcut(QObject::tr("F10"));
     1730        d->stepOverAction->setShortcut(QScriptDebugger::tr("F10"));
    16161731        QObject::connect(d->stepOverAction, SIGNAL(triggered()),
    16171732                         that, SLOT(_q_stepOver()));
     
    16281743        stepOutIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepout.png")), QIcon::Disabled);
    16291744        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1630         that->d_func()->stepOutAction = new QAction(stepOutIcon, QObject::tr("Step Out"), parent);
     1745        that->d_func()->stepOutAction = new QAction(stepOutIcon, QScriptDebugger::tr("Step Out"), parent);
    16311746        d->stepOutAction->setEnabled(d->interactive);
    1632         d->stepOutAction->setShortcut(QObject::tr("Shift+F11"));
     1747        d->stepOutAction->setShortcut(QScriptDebugger::tr("Shift+F11"));
    16331748        QObject::connect(d->stepOutAction, SIGNAL(triggered()),
    16341749                         that, SLOT(_q_stepOut()));
     
    16451760        runToCursorIcon.addPixmap(d->pixmap(QString::fromLatin1("d_runtocursor.png")), QIcon::Disabled);
    16461761        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1647         that->d_func()->runToCursorAction = new QAction(runToCursorIcon, QObject::tr("Run to Cursor"), parent);
     1762        that->d_func()->runToCursorAction = new QAction(runToCursorIcon, QScriptDebugger::tr("Run to Cursor"), parent);
    16481763        d->runToCursorAction->setEnabled(d->interactive);
    1649         d->runToCursorAction->setShortcut(QObject::tr("Ctrl+F10"));
     1764        d->runToCursorAction->setShortcut(QScriptDebugger::tr("Ctrl+F10"));
    16501765        QObject::connect(d->runToCursorAction, SIGNAL(triggered()),
    16511766                         that, SLOT(_q_runToCursor()));
     
    16631778        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    16641779        that->d_func()->runToNewScriptAction = new QAction(runToNewScriptIcon,
    1665                                                            QObject::tr("Run to New Script"), parent);
     1780                                                           QScriptDebugger::tr("Run to New Script"), parent);
    16661781        d->runToNewScriptAction->setEnabled(d->interactive);
    16671782        QObject::connect(d->runToNewScriptAction, SIGNAL(triggered()),
     
    16781793        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    16791794        that->d_func()->toggleBreakpointAction = new QAction(toggleBreakpointIcon,
    1680                                                              QObject::tr("Toggle Breakpoint"), parent);
    1681         d->toggleBreakpointAction->setShortcut(QObject::tr("F9"));
     1795                                                             QScriptDebugger::tr("Toggle Breakpoint"), parent);
     1796        d->toggleBreakpointAction->setShortcut(QScriptDebugger::tr("F9"));
    16821797        d->toggleBreakpointAction->setEnabled((d->codeWidget != 0) && (d->codeWidget->currentView() != 0));
    16831798        QObject::connect(d->toggleBreakpointAction, SIGNAL(triggered()),
     
    16931808        QIcon clearDebugOutputIcon;
    16941809        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1695         that->d_func()->clearDebugOutputAction = new QAction(clearDebugOutputIcon, QObject::tr("Clear Debug Output"), parent);
     1810        that->d_func()->clearDebugOutputAction = new QAction(clearDebugOutputIcon, QScriptDebugger::tr("Clear Debug Output"), parent);
    16961811        QObject::connect(d->clearDebugOutputAction, SIGNAL(triggered()),
    16971812                         that, SLOT(_q_clearDebugOutput()));
     
    17061821        QIcon clearErrorLogIcon;
    17071822        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1708         that->d_func()->clearErrorLogAction = new QAction(clearErrorLogIcon, QObject::tr("Clear Error Log"), parent);
     1823        that->d_func()->clearErrorLogAction = new QAction(clearErrorLogIcon, QScriptDebugger::tr("Clear Error Log"), parent);
    17091824        QObject::connect(d->clearErrorLogAction, SIGNAL(triggered()),
    17101825                         that, SLOT(_q_clearErrorLog()));
     
    17191834        QIcon clearConsoleIcon;
    17201835        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1721         that->d_func()->clearConsoleAction = new QAction(clearConsoleIcon, QObject::tr("Clear Console"), parent);
     1836        that->d_func()->clearConsoleAction = new QAction(clearConsoleIcon, QScriptDebugger::tr("Clear Console"), parent);
    17221837        QObject::connect(d->clearConsoleAction, SIGNAL(triggered()),
    17231838                         that, SLOT(_q_clearConsole()));
     
    17331848        findInScriptIcon.addPixmap(d->pixmap(QString::fromLatin1("find.png")), QIcon::Normal);
    17341849        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1735         that->d_func()->findInScriptAction = new QAction(findInScriptIcon, QObject::tr("&Find in Script..."), parent);
    1736         d->findInScriptAction->setShortcut(QObject::tr("Ctrl+F"));
     1850        that->d_func()->findInScriptAction = new QAction(findInScriptIcon, QScriptDebugger::tr("&Find in Script..."), parent);
     1851        d->findInScriptAction->setShortcut(QScriptDebugger::tr("Ctrl+F"));
    17371852        d->findInScriptAction->setEnabled(
    17381853            (d->codeFinderWidget != 0)
     
    17511866        QIcon findNextInScriptIcon;
    17521867        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1753         that->d_func()->findNextInScriptAction = new QAction(findNextInScriptIcon, QObject::tr("Find &Next"), parent);
     1868        that->d_func()->findNextInScriptAction = new QAction(findNextInScriptIcon, QScriptDebugger::tr("Find &Next"), parent);
    17541869        d->findNextInScriptAction->setEnabled(d->codeFinderWidget && !d->codeFinderWidget->text().isEmpty());
    1755         d->findNextInScriptAction->setShortcut(QObject::tr("F3"));
     1870        d->findNextInScriptAction->setShortcut(QScriptDebugger::tr("F3"));
    17561871        QObject::connect(d->findNextInScriptAction, SIGNAL(triggered()),
    17571872                         that, SLOT(_q_findNextInScript()));
     
    17661881        QIcon findPreviousInScriptIcon;
    17671882        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1768         that->d_func()->findPreviousInScriptAction = new QAction(findPreviousInScriptIcon, QObject::tr("Find &Previous"), parent);
     1883        that->d_func()->findPreviousInScriptAction = new QAction(findPreviousInScriptIcon, QScriptDebugger::tr("Find &Previous"), parent);
    17691884        d->findPreviousInScriptAction->setEnabled(d->codeFinderWidget && !d->codeFinderWidget->text().isEmpty());
    1770         d->findPreviousInScriptAction->setShortcut(QObject::tr("Shift+F3"));
     1885        d->findPreviousInScriptAction->setShortcut(QScriptDebugger::tr("Shift+F3"));
    17711886        QObject::connect(d->findPreviousInScriptAction, SIGNAL(triggered()),
    17721887                         that, SLOT(_q_findPreviousInScript()));
     
    17811896        QIcon goToLineIcon;
    17821897        QScriptDebugger *that = const_cast<QScriptDebugger*>(this);
    1783         that->d_func()->goToLineAction = new QAction(goToLineIcon, QObject::tr("Go to Line"), parent);
    1784         d->goToLineAction->setShortcut(QObject::tr("Ctrl+G"));
     1898        that->d_func()->goToLineAction = new QAction(goToLineIcon, QScriptDebugger::tr("Go to Line"), parent);
     1899        d->goToLineAction->setShortcut(QScriptDebugger::tr("Ctrl+G"));
    17851900        d->goToLineAction->setEnabled((d->codeWidget != 0) && (d->codeWidget->currentView() != 0));
    17861901        QObject::connect(d->goToLineAction, SIGNAL(triggered()),
     
    17881903    }
    17891904    return d->goToLineAction;
     1905}
     1906
     1907QMenu *QScriptDebugger::createStandardMenu(QWidget *widgetParent, QObject *actionParent)
     1908{
     1909    QMenu *menu = new QMenu(widgetParent);
     1910    menu->setTitle(QScriptDebugger::tr("Debug"));
     1911    menu->addAction(action(ContinueAction, actionParent));
     1912    menu->addAction(action(InterruptAction, actionParent));
     1913    menu->addAction(action(StepIntoAction, actionParent));
     1914    menu->addAction(action(StepOverAction, actionParent));
     1915    menu->addAction(action(StepOutAction, actionParent));
     1916    menu->addAction(action(RunToCursorAction, actionParent));
     1917    menu->addAction(action(RunToNewScriptAction, actionParent));
     1918
     1919    menu->addSeparator();
     1920    menu->addAction(action(ToggleBreakpointAction, actionParent));
     1921
     1922    menu->addSeparator();
     1923    menu->addAction(action(ClearDebugOutputAction, actionParent));
     1924    menu->addAction(action(ClearErrorLogAction, actionParent));
     1925    menu->addAction(action(ClearConsoleAction, actionParent));
     1926
     1927    return menu;
     1928}
     1929
     1930#ifndef QT_NO_TOOLBAR
     1931QToolBar *QScriptDebugger::createStandardToolBar(QWidget *widgetParent, QObject *actionParent)
     1932{
     1933    QToolBar *tb = new QToolBar(widgetParent);
     1934    tb->setObjectName(QLatin1String("qtscriptdebugger_standardToolBar"));
     1935    tb->addAction(action(ContinueAction, actionParent));
     1936    tb->addAction(action(InterruptAction, actionParent));
     1937    tb->addAction(action(StepIntoAction, actionParent));
     1938    tb->addAction(action(StepOverAction, actionParent));
     1939    tb->addAction(action(StepOutAction, actionParent));
     1940    tb->addAction(action(RunToCursorAction, actionParent));
     1941    tb->addAction(action(RunToNewScriptAction, actionParent));
     1942    tb->addSeparator();
     1943    tb->addAction(action(FindInScriptAction, actionParent));
     1944    return tb;
     1945}
     1946#endif
     1947
     1948bool QScriptDebugger::isInteractive() const
     1949{
     1950    Q_D(const QScriptDebugger);
     1951    return d->interactive;
    17901952}
    17911953
Note: See TracChangeset for help on using the changeset viewer.