diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6e2bf512bf657d152c53837241188229677ea46a --- /dev/null +++ b/src/plugins/debugger/debuggeractions.cpp @@ -0,0 +1,103 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#include "debuggeractions.h" + +#include <QtGui/QAction> +#include <QtGui/QApplication> + +namespace Debugger { +namespace Internal { + + +////////////////////////////////////////////////////////////////////////// +// +// Debugger specific stuff +// +////////////////////////////////////////////////////////////////////////// + +struct ActionData +{ + ActionCode code; + const char *text; + bool checkable; +}; + +static ActionData data[] = +{ + // + // General + // + { AdjustColumnWidths, + QT_TR_NOOP("Adjust column widths to contents"), false }, + { AlwaysAdjustColumnWidths, + QT_TR_NOOP("Adjust column widths to contents"), true }, + + // + // Locals & Watchers + // + { WatchExpression, + QT_TR_NOOP("Watch expression '%1'"), false }, + { WatchExpression, + QT_TR_NOOP("Watch expression '%1'"), false }, + { SettingsDialog, + QT_TR_NOOP("Debugger properties..."), false }, + { UseDumpers, + QT_TR_NOOP("Use custom dumpers"), true }, + { DebugDumpers, + QT_TR_NOOP("Debug custom dumpers"), true }, + { RecheckDumpers, + QT_TR_NOOP("Recheck custom dumper availability"), true }, + + // + // Breakpoints + // + { SynchronizeBreakpoints, + QT_TR_NOOP("Syncronize breakpoints"), false }, +}; + +QAction *action(ActionCode code) +{ + static QHash<ActionCode, QAction *> actions; + + if (actions.isEmpty()) { + for (int i = 0; i != sizeof(data)/sizeof(data[0]); ++i) { + const ActionData &d = data[i]; + QAction *act = new QAction(QObject::tr(d.text), 0); + act->setCheckable(d.checkable); + actions[d.code] = act; + } + } + + return actions.value(code); +} + +} // namespace Internal +} // namespace Debugger + diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h new file mode 100644 index 0000000000000000000000000000000000000000..8520b5cd20b129987f994c2d45576dc64de24634 --- /dev/null +++ b/src/plugins/debugger/debuggeractions.h @@ -0,0 +1,83 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#ifndef DEBUGGER_ACTIONS_H +#define DEBUGGER_ACTIONS_H + +#include <QtGui/QAction> + +namespace Debugger { +namespace Internal { + +enum ActionCode +{ + // General + SettingsDialog, + AdjustColumnWidths, + AlwaysAdjustColumnWidths, + + LockView, + + // Gdb + GdbLocation, + GdbEnvironment, + GdbScriptFile, + GdbAutoRun, + GdbAutoQuit, + + // Watchers & Locals + WatchExpression, + RemoveWatchExpression, + WatchModelUpdate, + RecheckDumpers, + UseDumpers, + DebugDumpers, + UseToolTips, + + // Source List + ListSourceFiles, + + // Running + SkipKnowFrames, + + // Breakpoints + SynchronizeBreakpoints, + AllPluginBreakpoints, + SelectedPluginBreakpoints, + NoPluginBreakpoints, + SelectedPluginBreakpointsPattern, +}; + +QAction *action(ActionCode code); + + +} // namespace Internal +} // namespace Debugger + +#endif // DEBUGGER_WATCHWINDOW_H