2021-12-26 23:18:28 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2020-2022 Roy Qu (royqh1979@gmail.com)
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2021-04-06 23:10:57 +08:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2021-08-31 14:40:41 +08:00
|
|
|
#include <QFileSystemWatcher>
|
2021-04-06 23:10:57 +08:00
|
|
|
#include <QMainWindow>
|
2021-08-30 22:05:45 +08:00
|
|
|
#include <QTimer>
|
2021-10-22 07:42:51 +08:00
|
|
|
#include <QFileSystemModel>
|
2021-11-02 09:29:35 +08:00
|
|
|
#include <QTcpServer>
|
2022-01-04 16:50:54 +08:00
|
|
|
#include <QElapsedTimer>
|
2022-01-07 19:20:42 +08:00
|
|
|
#include <QSortFilterProxyModel>
|
2021-04-24 15:57:45 +08:00
|
|
|
#include "common.h"
|
2021-08-05 12:31:53 +08:00
|
|
|
#include "widgets/searchresultview.h"
|
2021-08-23 17:27:17 +08:00
|
|
|
#include "widgets/classbrowser.h"
|
2021-08-29 10:29:56 +08:00
|
|
|
#include "widgets/codecompletionpopup.h"
|
|
|
|
#include "widgets/headercompletionpopup.h"
|
2021-09-24 11:41:14 +08:00
|
|
|
#include "widgets/functiontooltipwidget.h"
|
2021-09-02 12:14:02 +08:00
|
|
|
#include "caretlist.h"
|
2021-09-30 11:20:43 +08:00
|
|
|
#include "symbolusagemanager.h"
|
2021-09-30 12:52:22 +08:00
|
|
|
#include "codesnippetsmanager.h"
|
2021-10-03 17:18:43 +08:00
|
|
|
#include "todoparser.h"
|
2021-10-08 00:06:41 +08:00
|
|
|
#include "toolsmanager.h"
|
2021-10-15 10:23:46 +08:00
|
|
|
#include "widgets/labelwithmenu.h"
|
2021-10-21 17:31:25 +08:00
|
|
|
#include "widgets/bookmarkmodel.h"
|
2021-11-01 00:40:11 +08:00
|
|
|
#include "widgets/ojproblemsetmodel.h"
|
2022-02-15 00:01:50 +08:00
|
|
|
#include "widgets/customfilesystemmodel.h"
|
2022-02-13 20:08:18 +08:00
|
|
|
#include "customfileiconprovider.h"
|
2021-10-08 00:06:41 +08:00
|
|
|
|
2021-04-06 23:10:57 +08:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
namespace Ui { class MainWindow; }
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2021-07-20 15:16:52 +08:00
|
|
|
enum class CompileTarget {
|
|
|
|
Invalid, None, File, Project, SyntaxCheck
|
|
|
|
};
|
|
|
|
|
2021-11-01 20:44:08 +08:00
|
|
|
enum class RunType {
|
|
|
|
Normal,
|
|
|
|
CurrentProblemCase,
|
|
|
|
ProblemCases
|
|
|
|
};
|
|
|
|
|
2022-06-16 21:34:31 +08:00
|
|
|
|
2021-04-07 21:13:15 +08:00
|
|
|
class EditorList;
|
2021-04-08 10:29:21 +08:00
|
|
|
class QLabel;
|
2021-04-18 11:41:41 +08:00
|
|
|
class QComboBox;
|
2021-04-20 22:24:33 +08:00
|
|
|
class CompilerManager;
|
2021-06-24 20:43:09 +08:00
|
|
|
class Editor;
|
2021-07-23 13:22:05 +08:00
|
|
|
class Debugger;
|
2021-07-26 11:47:54 +08:00
|
|
|
class CPUDialog;
|
2021-08-01 10:00:27 +08:00
|
|
|
class QPlainTextEdit;
|
2022-11-11 21:20:57 +08:00
|
|
|
class SearchInFileDialog;
|
2021-08-03 23:55:57 +08:00
|
|
|
class SearchDialog;
|
2021-09-11 11:42:20 +08:00
|
|
|
class Project;
|
2022-10-28 16:34:26 +08:00
|
|
|
struct ProjectModelNode;
|
2022-10-02 17:23:27 +08:00
|
|
|
class ProjectUnit;
|
2021-10-10 21:23:25 +08:00
|
|
|
class ColorSchemeItem;
|
2022-10-17 23:23:05 +08:00
|
|
|
class VisitHistoryManager;
|
2021-04-07 21:13:15 +08:00
|
|
|
|
2022-02-20 22:36:12 +08:00
|
|
|
#define DPI_CHANGED_EVENT ((QEvent::Type)(QEvent::User+1))
|
|
|
|
|
2021-04-06 23:10:57 +08:00
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2023-02-24 12:17:30 +08:00
|
|
|
|
|
|
|
enum class CompileIssuesState{
|
|
|
|
CompilationResultFilled,
|
|
|
|
Compiling,
|
|
|
|
ProjectCompilationResultFilled,
|
|
|
|
ProjectCompiling,
|
|
|
|
SyntaxChecking,
|
|
|
|
SyntaxCheckResultFilled,
|
|
|
|
None
|
|
|
|
};
|
|
|
|
|
2021-06-25 12:40:11 +08:00
|
|
|
enum class CompileSuccessionTaskType {
|
|
|
|
None,
|
2021-11-01 23:14:17 +08:00
|
|
|
RunNormal,
|
|
|
|
RunProblemCases,
|
|
|
|
RunCurrentProblemCase,
|
2021-06-25 12:40:11 +08:00
|
|
|
Debug,
|
|
|
|
Profile
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CompileSuccessionTask {
|
|
|
|
CompileSuccessionTaskType type;
|
2022-06-16 21:34:31 +08:00
|
|
|
QString execName;
|
|
|
|
QStringList binDirs;
|
2022-10-12 19:48:35 +08:00
|
|
|
bool isExecutable;
|
2021-06-25 12:40:11 +08:00
|
|
|
};
|
2022-06-16 21:34:31 +08:00
|
|
|
|
2021-06-25 12:40:11 +08:00
|
|
|
using PCompileSuccessionTask = std::shared_ptr<CompileSuccessionTask>;
|
|
|
|
|
2021-11-09 21:22:50 +08:00
|
|
|
struct TabWidgetInfo {
|
|
|
|
int order;
|
|
|
|
QString text;
|
|
|
|
QIcon icon;
|
|
|
|
};
|
|
|
|
using PTabWidgetInfo = std::shared_ptr<TabWidgetInfo>;
|
|
|
|
|
2021-04-06 23:10:57 +08:00
|
|
|
public:
|
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
~MainWindow();
|
|
|
|
|
2022-03-12 17:37:53 +08:00
|
|
|
void updateForEncodingInfo(bool clear=false);
|
2022-10-24 10:58:30 +08:00
|
|
|
void updateForEncodingInfo(const Editor* editor, bool clear=false);
|
2022-03-12 17:37:53 +08:00
|
|
|
void updateStatusbarForLineCol(bool clear=false);
|
2022-10-24 10:58:30 +08:00
|
|
|
void updateStatusbarForLineCol(const Editor* editor, bool clear=false);
|
2022-03-12 17:37:53 +08:00
|
|
|
void updateForStatusbarModeInfo(bool clear=false);
|
2022-10-24 10:58:30 +08:00
|
|
|
void updateForStatusbarModeInfo(const Editor* editor, bool clear=false);
|
2021-08-30 22:05:45 +08:00
|
|
|
void updateStatusbarMessage(const QString& s);
|
2022-10-24 20:01:46 +08:00
|
|
|
void setProjectCurrentFile(const QString& filename);
|
2021-06-07 11:02:03 +08:00
|
|
|
void updateEditorSettings();
|
2022-10-11 21:51:33 +08:00
|
|
|
void updateEditorBookmarks();
|
2022-10-17 23:23:05 +08:00
|
|
|
void updateEditorBreakpoints();
|
2021-06-12 22:36:23 +08:00
|
|
|
void updateEditorActions();
|
2022-10-24 10:58:30 +08:00
|
|
|
void updateEditorActions(const Editor *e);
|
2021-09-17 09:56:52 +08:00
|
|
|
void updateProjectActions();
|
2021-07-01 19:44:38 +08:00
|
|
|
void updateCompileActions();
|
2022-12-17 17:20:33 +08:00
|
|
|
void updateCompileActions(const Editor* e);
|
2021-06-20 14:30:47 +08:00
|
|
|
void updateEditorColorSchemes();
|
2021-06-24 20:43:09 +08:00
|
|
|
void updateCompilerSet();
|
2022-12-17 17:20:33 +08:00
|
|
|
void updateCompilerSet(const Editor* e);
|
2021-08-01 23:24:37 +08:00
|
|
|
void updateDebuggerSettings();
|
2021-12-21 11:57:23 +08:00
|
|
|
void updateActionIcons();
|
2021-06-24 20:43:09 +08:00
|
|
|
void checkSyntaxInBack(Editor* e);
|
2023-01-03 21:43:45 +08:00
|
|
|
bool parsing();
|
2022-12-01 22:10:44 +08:00
|
|
|
bool compile(bool rebuild=false, CppCompileType compileType=CppCompileType::Normal);
|
2022-06-16 21:34:31 +08:00
|
|
|
void runExecutable(
|
|
|
|
const QString& exeName,
|
|
|
|
const QString& filename,
|
|
|
|
RunType runType,
|
|
|
|
const QStringList& binDirs);
|
2021-11-01 20:44:08 +08:00
|
|
|
void runExecutable(RunType runType = RunType::Normal);
|
2021-07-23 13:22:05 +08:00
|
|
|
void debug();
|
2021-10-04 12:49:55 +08:00
|
|
|
void showSearchPanel(bool showReplace = false);
|
2021-11-25 09:05:45 +08:00
|
|
|
void showCPUInfoDialog();
|
2021-04-08 10:29:21 +08:00
|
|
|
|
2022-03-11 20:51:33 +08:00
|
|
|
void setFilesViewRoot(const QString& path, bool setOpenFolder=false);
|
|
|
|
|
2021-06-18 21:48:40 +08:00
|
|
|
void applySettings();
|
2021-09-02 16:35:28 +08:00
|
|
|
void applyUISettings();
|
2021-08-31 14:40:41 +08:00
|
|
|
QFileSystemWatcher* fileSystemWatcher();
|
2022-05-22 14:31:13 +08:00
|
|
|
void initDocks();
|
2021-06-18 21:48:40 +08:00
|
|
|
|
2021-07-26 00:22:08 +08:00
|
|
|
void removeActiveBreakpoints();
|
|
|
|
void updateAppTitle();
|
2022-10-24 10:58:30 +08:00
|
|
|
void updateAppTitle(const Editor* e);
|
2021-07-26 11:47:54 +08:00
|
|
|
void addDebugOutput(const QString& text);
|
2021-07-30 23:28:58 +08:00
|
|
|
void changeDebugOutputLastline(const QString& text);
|
2021-08-01 23:24:37 +08:00
|
|
|
void updateDebugEval(const QString& value);
|
2021-08-02 10:08:25 +08:00
|
|
|
void rebuildOpenedFileHisotryMenu();
|
2021-08-23 17:27:17 +08:00
|
|
|
void updateClassBrowserForEditor(Editor* editor);
|
2021-08-30 22:05:45 +08:00
|
|
|
void resetAutoSaveTimer();
|
2021-10-06 23:19:18 +08:00
|
|
|
void updateShortcuts();
|
2023-02-12 22:33:34 +08:00
|
|
|
bool saveLastOpens();
|
2021-09-27 20:17:24 +08:00
|
|
|
void loadLastOpens();
|
2021-10-08 00:06:41 +08:00
|
|
|
void updateTools();
|
2021-09-27 20:17:24 +08:00
|
|
|
|
2021-10-04 20:05:24 +08:00
|
|
|
void openFiles(const QStringList& files);
|
|
|
|
|
2023-02-12 22:33:34 +08:00
|
|
|
void newEditor(const QString& suffix="");
|
2021-10-03 09:57:19 +08:00
|
|
|
|
2021-08-01 10:00:27 +08:00
|
|
|
QPlainTextEdit* txtLocals();
|
|
|
|
|
2021-12-24 23:18:20 +08:00
|
|
|
QMenuBar* menuBar() const;
|
2021-10-06 12:19:46 +08:00
|
|
|
|
2021-07-26 18:22:09 +08:00
|
|
|
CPUDialog *cpuDialog() const;
|
2021-07-26 00:22:08 +08:00
|
|
|
|
2021-08-01 09:13:38 +08:00
|
|
|
Debugger *debugger() const;
|
|
|
|
|
2021-08-03 23:55:57 +08:00
|
|
|
EditorList *editorList() const;
|
|
|
|
|
2022-11-11 21:20:57 +08:00
|
|
|
SearchInFileDialog *searchInFilesDialog() const;
|
|
|
|
|
2021-08-03 23:55:57 +08:00
|
|
|
SearchDialog *searchDialog() const;
|
|
|
|
|
2021-08-05 12:31:53 +08:00
|
|
|
SearchResultModel* searchResultModel();
|
|
|
|
|
2021-08-29 10:29:56 +08:00
|
|
|
const std::shared_ptr<CodeCompletionPopup> &completionPopup() const;
|
|
|
|
|
|
|
|
const std::shared_ptr<HeaderCompletionPopup> &headerCompletionPopup() const;
|
2021-09-24 11:41:14 +08:00
|
|
|
|
|
|
|
const std::shared_ptr<FunctionTooltipWidget> &functionTip() const;
|
|
|
|
|
2021-09-02 12:14:02 +08:00
|
|
|
CaretList &caretList();
|
|
|
|
void updateCaretActions();
|
|
|
|
|
2021-09-11 18:42:49 +08:00
|
|
|
std::shared_ptr<Project> project();
|
|
|
|
|
2021-10-10 21:23:25 +08:00
|
|
|
const std::shared_ptr<QHash<StatementKind, std::shared_ptr<ColorSchemeItem> > > &statementColors() const;
|
2021-09-25 23:12:36 +08:00
|
|
|
|
2021-09-30 11:20:43 +08:00
|
|
|
PSymbolUsageManager &symbolUsageManager();
|
|
|
|
|
2021-09-30 12:52:22 +08:00
|
|
|
PCodeSnippetManager &codeSnippetManager();
|
|
|
|
|
2021-10-03 17:18:43 +08:00
|
|
|
const PTodoParser &todoParser() const;
|
|
|
|
|
2021-10-08 00:06:41 +08:00
|
|
|
const PToolsManager &toolsManager() const;
|
|
|
|
|
2021-10-08 20:01:29 +08:00
|
|
|
bool shouldRemoveAllSettings() const;
|
|
|
|
|
2021-10-21 17:31:25 +08:00
|
|
|
const PBookmarkModel &bookmarkModel() const;
|
|
|
|
|
2022-10-22 23:29:12 +08:00
|
|
|
TodoModel* todoModel();
|
|
|
|
|
2022-10-17 23:23:05 +08:00
|
|
|
Editor* openFile(const QString& filename, bool activate=true, QTabWidget* page=nullptr);
|
2022-01-13 16:47:48 +08:00
|
|
|
void openProject(const QString& filename, bool openFiles = true);
|
2021-10-24 17:31:20 +08:00
|
|
|
void changeOptions(const QString& widgetName=QString(), const QString& groupName=QString());
|
2021-10-23 23:10:34 +08:00
|
|
|
|
2021-11-08 21:19:48 +08:00
|
|
|
bool openningFiles() const;
|
|
|
|
|
2022-06-13 09:38:32 +08:00
|
|
|
QList<QAction*> listShortCutableActions();
|
|
|
|
|
2023-03-03 17:20:33 +08:00
|
|
|
void switchCurrentStackTrace(int idx);
|
|
|
|
|
2021-08-30 22:05:45 +08:00
|
|
|
public slots:
|
2022-02-10 12:03:56 +08:00
|
|
|
void logToolsOutput(const QString& msg);
|
2021-08-30 22:05:45 +08:00
|
|
|
void onCompileIssue(PCompileIssue issue);
|
2022-02-10 12:03:56 +08:00
|
|
|
void clearToolsOutput();
|
2022-10-21 12:43:02 +08:00
|
|
|
void clearTodos();
|
2021-09-19 14:28:30 +08:00
|
|
|
void onCompileStarted();
|
2023-02-24 12:17:30 +08:00
|
|
|
void onProjectCompileStarted();
|
|
|
|
void onSyntaxCheckStarted();
|
2022-12-25 12:00:09 +08:00
|
|
|
void onCompileFinished(QString filename, bool isCheckSyntax);
|
2021-08-30 22:05:45 +08:00
|
|
|
void onCompileErrorOccured(const QString& reason);
|
|
|
|
void onRunErrorOccured(const QString& reason);
|
|
|
|
void onRunFinished();
|
2021-12-23 17:07:27 +08:00
|
|
|
void onRunPausingForFinish();
|
2021-11-01 20:44:08 +08:00
|
|
|
void onRunProblemFinished();
|
|
|
|
void onOJProblemCaseStarted(const QString& id, int current, int total);
|
|
|
|
void onOJProblemCaseFinished(const QString& id, int current, int total);
|
2022-01-28 00:31:11 +08:00
|
|
|
void onOJProblemCaseNewOutputGetted(const QString& id, const QString& line);
|
2022-03-27 11:44:52 +08:00
|
|
|
void onOJProblemCaseResetOutput(const QString& id, const QString& line);
|
2021-08-30 22:05:45 +08:00
|
|
|
void cleanUpCPUDialog();
|
|
|
|
void onDebugCommandInput(const QString& command);
|
|
|
|
void onDebugEvaluateInput();
|
2021-09-29 22:55:53 +08:00
|
|
|
void onDebugMemoryAddressInput();
|
2021-08-30 22:05:45 +08:00
|
|
|
void onParserProgress(const QString& fileName, int total, int current);
|
|
|
|
void onStartParsing();
|
|
|
|
void onEndParsing(int total, int updateView);
|
|
|
|
void onEvalValueReady(const QString& value);
|
2021-09-29 22:55:53 +08:00
|
|
|
void onLocalsReady(const QStringList& value);
|
2021-09-03 00:26:49 +08:00
|
|
|
void onEditorContextMenu(const QPoint& pos);
|
2021-10-13 11:32:59 +08:00
|
|
|
void onEditorRightTabContextMenu(const QPoint& pos);
|
|
|
|
void onEditorLeftTabContextMenu(const QPoint& pos);
|
|
|
|
void onEditorTabContextMenu(QTabWidget* tabWidget, const QPoint& pos);
|
2021-09-19 14:28:30 +08:00
|
|
|
void disableDebugActions();
|
|
|
|
void enableDebugActions();
|
2023-02-18 12:08:03 +08:00
|
|
|
void stopDebugForNoSymbolTable();
|
2022-10-22 23:29:12 +08:00
|
|
|
void onTodoParsingFile(const QString& filename);
|
|
|
|
void onTodoParseStarted();
|
|
|
|
void onTodoFound(const QString& filename, int lineNo, int ch, const QString& line);
|
2021-10-03 17:18:43 +08:00
|
|
|
void onTodoParseFinished();
|
2023-03-03 17:20:33 +08:00
|
|
|
void onWatchpointHitted(const QString& var, const QString& oldVal, const QString& newVal);
|
2021-11-24 17:53:25 +08:00
|
|
|
void setActiveBreakpoint(QString FileName, int Line, bool setFocus);
|
2022-02-20 22:36:12 +08:00
|
|
|
void updateDPI(int oldDPI, int newDPI);
|
2022-02-15 17:22:44 +08:00
|
|
|
void onFileSaved(const QString& path, bool inProject);
|
2021-08-29 10:29:56 +08:00
|
|
|
|
2021-09-02 20:12:16 +08:00
|
|
|
private:
|
2022-12-20 11:01:04 +08:00
|
|
|
int calIconSize(const QString &fontName, int fontPointSize);
|
2023-02-26 08:31:13 +08:00
|
|
|
void hideAllSearchDialogs();
|
2022-11-11 21:20:57 +08:00
|
|
|
void prepareSearchDialog();
|
2023-02-26 08:31:13 +08:00
|
|
|
void prepareSearchInFilesDialog();
|
2021-09-17 21:33:19 +08:00
|
|
|
void prepareProjectForCompile();
|
2021-09-11 18:42:49 +08:00
|
|
|
void closeProject(bool refreshEditor);
|
2021-09-17 09:56:52 +08:00
|
|
|
void updateProjectView();
|
2021-08-30 22:05:45 +08:00
|
|
|
CompileTarget getCompileTarget();
|
|
|
|
bool debugInferiorhasBreakpoint();
|
2022-05-23 22:36:22 +08:00
|
|
|
void stretchMessagesPanel(bool open);
|
|
|
|
void stretchExplorerPanel(bool open);
|
2021-08-30 22:05:45 +08:00
|
|
|
void prepareDebugger();
|
|
|
|
void doAutoSave(Editor *e);
|
2022-12-17 11:37:33 +08:00
|
|
|
void createCustomActions();
|
|
|
|
void initToolButtons();
|
2021-08-31 11:13:12 +08:00
|
|
|
void buildContextMenus();
|
2021-09-28 22:26:12 +08:00
|
|
|
void buildEncodingMenu();
|
2023-01-04 11:01:34 +08:00
|
|
|
void buildNewlineMenu();
|
2021-09-02 20:12:16 +08:00
|
|
|
void maximizeEditor();
|
2022-06-16 21:34:31 +08:00
|
|
|
QStringList getBinDirsForCurrentEditor();
|
|
|
|
QStringList getDefaultCompilerSetBinDirs();
|
|
|
|
void openShell(const QString& folder, const QString& shellCommand, const QStringList& binDirs);
|
2022-12-17 13:34:11 +08:00
|
|
|
QAction* createAction(const QString& text,
|
2021-09-05 13:51:07 +08:00
|
|
|
QWidget* parent,
|
|
|
|
QKeySequence shortcut=QKeySequence());
|
2022-12-17 13:34:11 +08:00
|
|
|
QAction* createShortcutCustomableAction(
|
|
|
|
const QString& text,
|
|
|
|
const QString& objectName,
|
|
|
|
QKeySequence shortcut=QKeySequence());
|
2021-09-11 18:42:49 +08:00
|
|
|
void scanActiveProject(bool parse=false);
|
2021-09-28 14:18:51 +08:00
|
|
|
void includeOrSkipDirs(const QStringList& dirs, bool skip);
|
2021-10-04 12:49:55 +08:00
|
|
|
void showSearchReplacePanel(bool show);
|
2021-10-25 09:31:58 +08:00
|
|
|
void clearIssues();
|
2021-11-01 23:14:17 +08:00
|
|
|
void doCompileRun(RunType runType);
|
2022-12-01 22:10:44 +08:00
|
|
|
void doGenerateAssembly();
|
2021-11-02 19:26:11 +08:00
|
|
|
void updateProblemCaseOutput(POJProblemCase problemCase);
|
|
|
|
void applyCurrentProblemCaseChanges();
|
2021-11-09 21:22:50 +08:00
|
|
|
void showHideInfosTab(QWidget *widget, bool show);
|
|
|
|
void showHideMessagesTab(QWidget *widget, bool show);
|
|
|
|
void prepareTabInfosData();
|
|
|
|
void prepareTabMessagesData();
|
2023-02-12 22:33:34 +08:00
|
|
|
void newProjectUnitFile(const QString& suffix="");
|
2022-03-29 18:06:24 +08:00
|
|
|
void fillProblemCaseInputAndExpected(const POJProblemCase &problemCase);
|
2021-10-04 12:49:55 +08:00
|
|
|
|
2022-02-08 16:48:50 +08:00
|
|
|
void doFilesViewRemoveFile(const QModelIndex& index);
|
|
|
|
|
2022-10-02 23:32:33 +08:00
|
|
|
void setProjectViewCurrentNode(std::shared_ptr<ProjectModelNode> node);
|
2022-10-02 17:23:27 +08:00
|
|
|
void setProjectViewCurrentUnit(std::shared_ptr<ProjectUnit> unit);
|
|
|
|
|
2022-10-18 12:24:59 +08:00
|
|
|
void reparseNonProjectEditors();
|
2022-11-05 19:39:33 +08:00
|
|
|
QString switchHeaderSourceTarget(Editor *editor);
|
2022-10-18 12:24:59 +08:00
|
|
|
|
2021-04-07 21:13:15 +08:00
|
|
|
private slots:
|
2022-11-07 21:44:12 +08:00
|
|
|
void setupSlotsForProject();
|
|
|
|
void onProjectUnitAdded(const QString &filename);
|
|
|
|
void onProjectUnitRemoved(const QString &filename);
|
|
|
|
void onProjectUnitRenamed(const QString &oldFilename, const QString& newFilename);
|
2022-10-08 23:30:30 +08:00
|
|
|
void onProjectViewNodeRenamed();
|
2022-05-22 14:31:13 +08:00
|
|
|
void setDockExplorerToArea(const Qt::DockWidgetArea &area);
|
|
|
|
void setDockMessagesToArea(const Qt::DockWidgetArea &area);
|
2022-02-15 00:01:50 +08:00
|
|
|
void updateVCSActions();
|
2022-01-08 08:52:50 +08:00
|
|
|
void invalidateProjectProxyModel();
|
2022-11-07 21:44:12 +08:00
|
|
|
void onEditorRenamed(const QString &oldFilename, const QString &newFilename, bool firstSave);
|
2021-08-30 22:05:45 +08:00
|
|
|
void onAutoSaveTimeout();
|
2022-11-07 21:44:12 +08:00
|
|
|
void onFileChanged(const QString &path);
|
2022-02-11 20:19:48 +08:00
|
|
|
void onFilesViewPathChanged();
|
2021-09-05 13:51:07 +08:00
|
|
|
void onWatchViewContextMenu(const QPoint& pos);
|
2021-10-21 17:31:25 +08:00
|
|
|
void onBookmarkContextMenu(const QPoint& pos);
|
2021-09-05 13:51:07 +08:00
|
|
|
void onTableIssuesContextMenu(const QPoint& pos);
|
2021-09-05 21:05:38 +08:00
|
|
|
void onSearchViewContextMenu(const QPoint& pos);
|
2021-09-05 22:16:54 +08:00
|
|
|
void onBreakpointsViewContextMenu(const QPoint& pos);
|
2021-09-17 22:58:58 +08:00
|
|
|
void onProjectViewContextMenu(const QPoint& pos);
|
2021-09-26 16:25:17 +08:00
|
|
|
void onClassBrowserContextMenu(const QPoint& pos);
|
2021-10-02 17:01:08 +08:00
|
|
|
void onDebugConsoleContextMenu(const QPoint& pos);
|
2021-10-15 10:23:46 +08:00
|
|
|
void onFileEncodingContextMenu(const QPoint& pos);
|
2021-10-22 15:02:54 +08:00
|
|
|
void onFilesViewContextMenu(const QPoint& pos);
|
2021-11-04 09:07:06 +08:00
|
|
|
void onLstProblemSetContextMenu(const QPoint& pos);
|
2022-03-30 19:28:46 +08:00
|
|
|
void onTableProblemCasesContextMenu(const QPoint& pos);
|
2022-02-10 12:03:56 +08:00
|
|
|
void onToolsOutputContextMenu(const QPoint&pos);
|
|
|
|
|
2021-11-01 00:40:11 +08:00
|
|
|
void onProblemSetIndexChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
|
|
|
void onProblemCaseIndexChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
2021-11-02 01:07:37 +08:00
|
|
|
void onProblemNameChanged(int index);
|
2022-03-30 19:50:55 +08:00
|
|
|
void onProblemRunCurrentCase();
|
2022-04-16 20:39:09 +08:00
|
|
|
void onProblemBatchSetCases();
|
2021-11-02 09:29:35 +08:00
|
|
|
void onNewProblemConnection();
|
2022-01-01 17:24:18 +08:00
|
|
|
void updateProblemTitle();
|
2021-11-02 23:47:51 +08:00
|
|
|
void onEditorClosed();
|
2022-02-10 12:03:56 +08:00
|
|
|
void onToolsOutputClear();
|
|
|
|
void onToolsOutputCopy();
|
|
|
|
void onToolsOutputSelectAll();
|
2021-09-05 13:51:07 +08:00
|
|
|
|
2021-10-03 09:57:19 +08:00
|
|
|
void onShowInsertCodeSnippetMenu();
|
|
|
|
|
2022-10-25 22:10:38 +08:00
|
|
|
void onFilesViewCreateFolderFolderLoaded(const QString& path);
|
2022-02-08 16:36:20 +08:00
|
|
|
void onFilesViewCreateFolder();
|
2022-03-17 10:46:24 +08:00
|
|
|
void onFilesViewCreateFile();
|
2022-02-08 16:48:50 +08:00
|
|
|
void onFilesViewRemoveFiles();
|
2022-06-12 15:48:19 +08:00
|
|
|
void onFilesViewRename();
|
2022-12-17 11:37:33 +08:00
|
|
|
|
|
|
|
void onNewProblemSet();
|
|
|
|
|
2022-03-27 16:07:51 +08:00
|
|
|
void onProblemProperties();
|
|
|
|
void onProblemOpenSource();
|
2022-12-13 08:49:20 +08:00
|
|
|
void onProblemRename();
|
|
|
|
void onProblemGotoUrl();
|
|
|
|
|
2022-12-17 11:37:33 +08:00
|
|
|
void onRenameProblemSet();
|
2022-03-27 16:07:51 +08:00
|
|
|
void onBookmarkRemove();
|
|
|
|
void onBookmarkRemoveAll();
|
|
|
|
void onBookmarkModify();
|
|
|
|
void onDebugConsoleShowDetailLog();
|
|
|
|
void onDebugConsolePaste();
|
|
|
|
void onDebugConsoleSelectAll();
|
|
|
|
void onDebugConsoleCopy();
|
|
|
|
void onDebugConsoleClear();
|
|
|
|
void onFilesViewOpenInExplorer();
|
|
|
|
void onFilesViewOpenInTerminal();
|
|
|
|
void onFilesViewOpenWithExternal();
|
|
|
|
void onFilesViewOpen();
|
|
|
|
void onClassBrowserGotoDeclaration();
|
|
|
|
void onClassBrowserGotoDefinition();
|
|
|
|
void onClassBrowserShowInherited();
|
|
|
|
void onClassBrowserSortByType();
|
|
|
|
void onClassBrowserSortByName();
|
2022-10-23 15:22:26 +08:00
|
|
|
void onClassBrowserChangeScope();
|
2022-10-23 16:31:05 +08:00
|
|
|
void onClassBrowserRefreshStart();
|
|
|
|
void onClassBrowserRefreshEnd();
|
2022-10-23 15:22:26 +08:00
|
|
|
|
2022-03-27 16:07:51 +08:00
|
|
|
void onProjectSwitchCustomViewMode();
|
|
|
|
void onProjectSwitchFileSystemViewMode();
|
|
|
|
void onProjectRemoveFolder();
|
|
|
|
void onProjectRenameFolder();
|
|
|
|
void onProjectAddFolder();
|
|
|
|
void onProjectRenameUnit();
|
|
|
|
void onBreakpointRemove();
|
|
|
|
void onBreakpointViewRemoveAll();
|
|
|
|
void onBreakpointViewProperty();
|
|
|
|
void onSearchViewClearAll();
|
|
|
|
void onSearchViewClear();
|
|
|
|
void onTableIssuesClear();
|
|
|
|
void onTableIssuesCopyAll();
|
|
|
|
void onTableIssuesCopy();
|
2022-02-08 16:36:20 +08:00
|
|
|
|
2021-04-07 21:13:15 +08:00
|
|
|
void on_actionNew_triggered();
|
|
|
|
|
2021-04-07 22:44:08 +08:00
|
|
|
void on_EditorTabsLeft_tabCloseRequested(int index);
|
2021-10-13 11:32:59 +08:00
|
|
|
void on_EditorTabsRight_tabCloseRequested(int index);
|
2021-04-07 22:44:08 +08:00
|
|
|
|
2022-07-06 19:44:44 +08:00
|
|
|
void onFileSystemModelLayoutChanged();
|
|
|
|
|
2021-04-08 10:29:21 +08:00
|
|
|
void on_actionOpen_triggered();
|
|
|
|
|
2021-04-11 12:39:22 +08:00
|
|
|
void on_actionSave_triggered();
|
|
|
|
|
|
|
|
void on_actionSaveAs_triggered();
|
|
|
|
|
2021-04-16 22:04:48 +08:00
|
|
|
void on_actionOptions_triggered();
|
|
|
|
|
2021-04-18 11:41:41 +08:00
|
|
|
// qt will auto bind slots with the prefix "on_"
|
|
|
|
void onCompilerSetChanged(int index);
|
|
|
|
|
2021-04-20 22:24:33 +08:00
|
|
|
void on_actionCompile_triggered();
|
|
|
|
|
2021-04-21 18:58:35 +08:00
|
|
|
void on_actionRun_triggered();
|
|
|
|
|
2021-04-21 23:06:55 +08:00
|
|
|
void on_actionUndo_triggered();
|
|
|
|
|
|
|
|
void on_actionRedo_triggered();
|
|
|
|
|
|
|
|
void on_actionCut_triggered();
|
|
|
|
|
|
|
|
void on_actionSelectAll_triggered();
|
|
|
|
|
|
|
|
void on_actionCopy_triggered();
|
|
|
|
|
|
|
|
void on_actionPaste_triggered();
|
|
|
|
|
|
|
|
void on_actionIndent_triggered();
|
|
|
|
|
|
|
|
void on_actionUnIndent_triggered();
|
|
|
|
|
2021-04-24 15:57:45 +08:00
|
|
|
void on_actionToggleComment_triggered();
|
|
|
|
|
|
|
|
void on_actionUnfoldAll_triggered();
|
|
|
|
|
|
|
|
void on_actionFoldAll_triggered();
|
|
|
|
|
2021-04-29 20:54:44 +08:00
|
|
|
void on_tableIssues_doubleClicked(const QModelIndex &index);
|
|
|
|
|
2021-06-12 22:36:23 +08:00
|
|
|
void on_actionEncode_in_ANSI_triggered();
|
|
|
|
|
|
|
|
void on_actionEncode_in_UTF_8_triggered();
|
|
|
|
|
|
|
|
void on_actionAuto_Detect_triggered();
|
|
|
|
|
|
|
|
void on_actionConvert_to_ANSI_triggered();
|
|
|
|
|
|
|
|
void on_actionConvert_to_UTF_8_triggered();
|
|
|
|
|
2021-06-23 22:38:02 +08:00
|
|
|
void on_tabMessages_tabBarClicked(int index);
|
|
|
|
|
2021-06-25 12:40:11 +08:00
|
|
|
void on_actionRebuild_triggered();
|
|
|
|
|
|
|
|
void on_actionStop_Execution_triggered();
|
|
|
|
|
2021-07-20 15:16:52 +08:00
|
|
|
void on_actionDebug_triggered();
|
|
|
|
|
2021-07-31 14:04:43 +08:00
|
|
|
void on_actionStep_Over_triggered();
|
|
|
|
|
|
|
|
void on_actionStep_Into_triggered();
|
|
|
|
|
|
|
|
void on_actionStep_Out_triggered();
|
|
|
|
|
|
|
|
void on_actionRun_To_Cursor_triggered();
|
|
|
|
|
|
|
|
void on_actionContinue_triggered();
|
|
|
|
|
2021-08-01 01:06:43 +08:00
|
|
|
void on_actionAdd_Watch_triggered();
|
|
|
|
|
2021-08-01 23:24:37 +08:00
|
|
|
void on_actionView_CPU_Window_triggered();
|
|
|
|
|
2021-08-02 10:08:25 +08:00
|
|
|
void on_actionExit_triggered();
|
|
|
|
|
2021-08-03 23:55:57 +08:00
|
|
|
void on_actionFind_triggered();
|
|
|
|
|
|
|
|
void on_actionFind_in_files_triggered();
|
|
|
|
|
|
|
|
void on_actionReplace_triggered();
|
|
|
|
|
|
|
|
void on_actionFind_Next_triggered();
|
|
|
|
|
|
|
|
void on_actionFind_Previous_triggered();
|
|
|
|
|
2021-08-05 19:58:32 +08:00
|
|
|
void on_cbSearchHistory_currentIndexChanged(int index);
|
|
|
|
|
2021-11-05 10:44:23 +08:00
|
|
|
void on_btnSearchAgain_clicked();
|
2021-08-31 11:13:12 +08:00
|
|
|
void on_actionRemove_Watch_triggered();
|
|
|
|
|
|
|
|
void on_actionRemove_All_Watches_triggered();
|
|
|
|
|
|
|
|
void on_actionModify_Watch_triggered();
|
|
|
|
|
2021-09-02 12:14:02 +08:00
|
|
|
void on_actionReformat_Code_triggered();
|
|
|
|
|
|
|
|
void on_actionBack_triggered();
|
|
|
|
|
|
|
|
void on_actionForward_triggered();
|
|
|
|
|
2022-05-22 14:31:13 +08:00
|
|
|
void on_tabExplorer_tabBarClicked(int index);
|
2021-09-02 19:36:16 +08:00
|
|
|
|
|
|
|
void on_EditorTabsLeft_tabBarDoubleClicked(int index);
|
2021-10-13 11:32:59 +08:00
|
|
|
void on_EditorTabsRight_tabBarDoubleClicked(int index);
|
2021-09-02 19:36:16 +08:00
|
|
|
|
|
|
|
void on_actionClose_triggered();
|
|
|
|
|
2021-09-02 20:12:16 +08:00
|
|
|
void on_actionClose_All_triggered();
|
|
|
|
|
|
|
|
void on_actionMaximize_Editor_triggered();
|
|
|
|
|
2021-09-03 00:26:49 +08:00
|
|
|
void on_actionNext_Editor_triggered();
|
|
|
|
|
|
|
|
void on_actionPrevious_Editor_triggered();
|
|
|
|
|
2021-09-03 10:30:08 +08:00
|
|
|
void on_actionToggle_Breakpoint_triggered();
|
|
|
|
|
|
|
|
void on_actionClear_all_breakpoints_triggered();
|
|
|
|
|
|
|
|
void on_actionBreakpoint_property_triggered();
|
|
|
|
|
2021-09-03 11:50:04 +08:00
|
|
|
void on_actionGoto_Declaration_triggered();
|
|
|
|
|
|
|
|
void on_actionGoto_Definition_triggered();
|
|
|
|
|
2021-09-03 16:39:20 +08:00
|
|
|
void on_actionFind_references_triggered();
|
|
|
|
|
|
|
|
void on_actionOpen_Containing_Folder_triggered();
|
|
|
|
|
|
|
|
void on_actionOpen_Terminal_triggered();
|
|
|
|
|
2021-09-04 00:13:42 +08:00
|
|
|
void on_actionFile_Properties_triggered();
|
|
|
|
|
2021-09-05 21:05:38 +08:00
|
|
|
void on_searchView_doubleClicked(const QModelIndex &index);
|
|
|
|
|
|
|
|
void on_tblStackTrace_doubleClicked(const QModelIndex &index);
|
|
|
|
|
|
|
|
void on_tblBreakpoints_doubleClicked(const QModelIndex &index);
|
2021-09-12 00:17:15 +08:00
|
|
|
|
|
|
|
void on_projectView_doubleClicked(const QModelIndex &index);
|
2021-09-05 21:05:38 +08:00
|
|
|
|
2021-09-12 01:01:34 +08:00
|
|
|
void on_actionClose_Project_triggered();
|
|
|
|
|
2021-09-14 17:33:47 +08:00
|
|
|
void on_actionProject_options_triggered();
|
|
|
|
|
2021-09-16 23:51:05 +08:00
|
|
|
void on_actionNew_Project_triggered();
|
|
|
|
|
2021-09-17 09:56:52 +08:00
|
|
|
void on_actionSaveAll_triggered();
|
|
|
|
|
2021-09-17 13:35:50 +08:00
|
|
|
void on_actionProject_New_File_triggered();
|
|
|
|
|
|
|
|
void on_actionAdd_to_project_triggered();
|
|
|
|
|
2021-09-17 17:15:35 +08:00
|
|
|
void on_actionRemove_from_project_triggered();
|
|
|
|
|
2021-09-17 19:58:37 +08:00
|
|
|
void on_actionView_Makefile_triggered();
|
|
|
|
|
2021-09-17 21:33:19 +08:00
|
|
|
void on_actionMakeClean_triggered();
|
|
|
|
|
2021-09-18 10:47:35 +08:00
|
|
|
void on_actionProject_Open_Folder_In_Explorer_triggered();
|
|
|
|
|
|
|
|
void on_actionProject_Open_In_Terminal_triggered();
|
|
|
|
|
2021-09-26 12:19:46 +08:00
|
|
|
void on_classBrowser_doubleClicked(const QModelIndex &index);
|
|
|
|
|
2021-10-03 17:18:43 +08:00
|
|
|
void on_EditorTabsLeft_currentChanged(int index);
|
|
|
|
void on_EditorTabsRight_currentChanged(int index);
|
|
|
|
|
|
|
|
void on_tableTODO_doubleClicked(const QModelIndex &index);
|
|
|
|
|
2021-10-03 23:12:20 +08:00
|
|
|
void on_actionAbout_triggered();
|
|
|
|
|
2021-10-04 11:07:35 +08:00
|
|
|
void on_actionRename_Symbol_triggered();
|
|
|
|
|
2021-10-04 12:49:55 +08:00
|
|
|
void on_btnReplace_clicked();
|
|
|
|
|
2021-10-04 19:23:52 +08:00
|
|
|
void on_btnCancelReplace_clicked();
|
|
|
|
|
2021-10-07 07:52:20 +08:00
|
|
|
void on_actionPrint_triggered();
|
|
|
|
|
2021-10-12 09:47:58 +08:00
|
|
|
void on_actionExport_As_RTF_triggered();
|
|
|
|
|
|
|
|
void on_actionExport_As_HTML_triggered();
|
|
|
|
|
2021-10-13 11:32:59 +08:00
|
|
|
void on_actionMove_To_Other_View_triggered();
|
|
|
|
|
2021-10-15 12:17:14 +08:00
|
|
|
void on_actionC_C_Reference_triggered();
|
|
|
|
|
2021-10-18 23:44:02 +08:00
|
|
|
void on_actionEGE_Manual_triggered();
|
|
|
|
|
2021-10-21 17:31:25 +08:00
|
|
|
void on_actionAdd_bookmark_triggered();
|
|
|
|
|
|
|
|
void on_actionRemove_Bookmark_triggered();
|
|
|
|
|
|
|
|
void on_tableBookmark_doubleClicked(const QModelIndex &index);
|
|
|
|
|
|
|
|
void on_actionModify_Bookmark_Description_triggered();
|
|
|
|
|
2021-10-22 15:02:54 +08:00
|
|
|
void on_actionLocate_in_Files_View_triggered();
|
|
|
|
|
|
|
|
void on_treeFiles_doubleClicked(const QModelIndex &index);
|
|
|
|
|
|
|
|
void on_actionOpen_Folder_triggered();
|
|
|
|
|
2021-10-24 17:31:20 +08:00
|
|
|
void on_actionRun_Parameters_triggered();
|
|
|
|
|
2022-12-17 11:37:33 +08:00
|
|
|
void onAddProblem();
|
2021-11-01 00:40:11 +08:00
|
|
|
|
2022-12-17 11:37:33 +08:00
|
|
|
void onRemoveProblem();
|
2021-11-01 00:40:11 +08:00
|
|
|
|
2022-12-17 11:37:33 +08:00
|
|
|
void onSaveProblemSet();
|
2021-11-01 00:40:11 +08:00
|
|
|
|
2022-12-17 11:37:33 +08:00
|
|
|
void onLoadProblemSet();
|
2021-11-01 00:40:11 +08:00
|
|
|
|
2022-12-17 13:34:11 +08:00
|
|
|
void onAddProblemCase();
|
2021-11-01 00:40:11 +08:00
|
|
|
|
2022-12-31 09:36:50 +08:00
|
|
|
void onProblemRunAllCases();
|
2021-11-01 20:44:08 +08:00
|
|
|
|
2021-11-02 23:47:51 +08:00
|
|
|
void on_actionC_Reference_triggered();
|
|
|
|
|
2022-12-17 13:34:11 +08:00
|
|
|
void onRemoveProblemCases();
|
2021-11-02 23:47:51 +08:00
|
|
|
|
2022-12-17 13:34:11 +08:00
|
|
|
void onOpenProblemAnswerFile();
|
2021-11-06 14:49:11 +08:00
|
|
|
|
2021-11-09 21:22:50 +08:00
|
|
|
void on_actionTool_Window_Bars_triggered();
|
|
|
|
|
|
|
|
void on_actionStatus_Bar_triggered();
|
|
|
|
|
|
|
|
void on_actionProject_triggered();
|
|
|
|
|
|
|
|
void on_actionWatch_triggered();
|
|
|
|
|
|
|
|
void on_actionStructure_triggered();
|
|
|
|
|
|
|
|
void on_actionFiles_triggered();
|
|
|
|
|
|
|
|
void on_actionProblem_Set_triggered();
|
|
|
|
|
|
|
|
void on_actionIssues_triggered();
|
|
|
|
|
2022-02-10 12:03:56 +08:00
|
|
|
void on_actionTools_Output_triggered();
|
2021-11-09 21:22:50 +08:00
|
|
|
|
|
|
|
void on_actionDebug_Window_triggered();
|
|
|
|
|
|
|
|
void on_actionSearch_triggered();
|
|
|
|
|
|
|
|
void on_actionTODO_triggered();
|
|
|
|
|
|
|
|
void on_actionBookmark_triggered();
|
|
|
|
|
|
|
|
void on_actionProblem_triggered();
|
|
|
|
|
2021-11-22 16:16:58 +08:00
|
|
|
void on_actionDelete_Line_triggered();
|
|
|
|
|
|
|
|
void on_actionDuplicate_Line_triggered();
|
|
|
|
|
|
|
|
void on_actionDelete_Word_triggered();
|
|
|
|
|
|
|
|
void on_actionDelete_to_EOL_triggered();
|
|
|
|
|
|
|
|
void on_actionDelete_to_BOL_triggered();
|
|
|
|
|
2022-12-17 13:34:11 +08:00
|
|
|
void onOpenCaseValidationOptions();
|
2021-11-27 15:43:47 +08:00
|
|
|
|
2021-12-27 10:59:04 +08:00
|
|
|
void on_actionInterrupt_triggered();
|
|
|
|
|
2022-01-24 11:23:30 +08:00
|
|
|
void on_actionDelete_Last_Word_triggered();
|
|
|
|
|
|
|
|
void on_actionDelete_to_Word_End_triggered();
|
|
|
|
|
2022-01-27 18:46:37 +08:00
|
|
|
void on_actionNew_Class_triggered();
|
2022-01-27 18:34:18 +08:00
|
|
|
|
2022-02-01 16:17:28 +08:00
|
|
|
void on_actionNew_Header_triggered();
|
|
|
|
|
2022-02-15 00:01:50 +08:00
|
|
|
void on_actionGit_Create_Repository_triggered();
|
|
|
|
|
|
|
|
void on_actionGit_Add_Files_triggered();
|
|
|
|
|
2022-02-15 17:22:44 +08:00
|
|
|
void on_actionGit_Commit_triggered();
|
|
|
|
|
2022-02-15 21:39:17 +08:00
|
|
|
void on_actionGit_Restore_triggered();
|
|
|
|
|
2022-02-16 16:27:09 +08:00
|
|
|
void on_actionWebsite_triggered();
|
|
|
|
|
2022-02-19 20:38:08 +08:00
|
|
|
void on_actionGit_Branch_triggered();
|
|
|
|
|
2022-02-20 21:47:57 +08:00
|
|
|
void on_actionGit_Merge_triggered();
|
|
|
|
|
2022-02-21 23:35:28 +08:00
|
|
|
void on_actionGit_Log_triggered();
|
|
|
|
|
2022-02-24 11:07:37 +08:00
|
|
|
void on_actionGit_Remotes_triggered();
|
|
|
|
|
2022-02-24 23:31:48 +08:00
|
|
|
void on_actionGit_Fetch_triggered();
|
|
|
|
|
|
|
|
void on_actionGit_Pull_triggered();
|
|
|
|
|
|
|
|
void on_actionGit_Push_triggered();
|
|
|
|
|
2022-02-28 22:40:09 +08:00
|
|
|
void on_actionFilesView_Hide_Non_Support_Files_toggled(bool arg1);
|
|
|
|
|
2022-03-12 18:03:52 +08:00
|
|
|
void on_actionToggle_Block_Comment_triggered();
|
|
|
|
|
2022-03-13 18:45:48 +08:00
|
|
|
void on_actionMatch_Bracket_triggered();
|
|
|
|
|
2022-03-29 18:06:24 +08:00
|
|
|
void on_btnProblemCaseInputFileName_clicked();
|
|
|
|
|
|
|
|
void on_btnProblemCaseClearExpectedOutputFileName_clicked();
|
|
|
|
|
|
|
|
void on_btnProblemCaseClearInputFileName_clicked();
|
|
|
|
|
|
|
|
void on_btnProblemCaseExpectedOutputFileName_clicked();
|
|
|
|
|
|
|
|
void on_txtProblemCaseOutput_cursorPositionChanged();
|
|
|
|
|
2022-03-29 21:41:02 +08:00
|
|
|
void on_txtProblemCaseExpected_cursorPositionChanged();
|
|
|
|
|
|
|
|
void on_txtProblemCaseInput_cursorPositionChanged();
|
|
|
|
|
2022-04-01 23:10:38 +08:00
|
|
|
void on_actionMove_Selection_Up_triggered();
|
|
|
|
|
|
|
|
void on_actionMove_Selection_Down_triggered();
|
|
|
|
|
2022-05-06 15:23:41 +08:00
|
|
|
void on_actionConvert_to_UTF_8_BOM_triggered();
|
|
|
|
|
|
|
|
void on_actionEncode_in_UTF_8_BOM_triggered();
|
|
|
|
|
2022-05-06 15:48:17 +08:00
|
|
|
void on_actionCompiler_Options_triggered();
|
|
|
|
|
2022-05-22 14:31:13 +08:00
|
|
|
void on_dockExplorer_dockLocationChanged(const Qt::DockWidgetArea &area);
|
2022-05-20 18:43:01 +08:00
|
|
|
|
|
|
|
void on_dockMessages_dockLocationChanged(const Qt::DockWidgetArea &area);
|
|
|
|
|
2022-05-25 10:04:36 +08:00
|
|
|
void on_actionToggle_Explorer_Panel_triggered();
|
|
|
|
|
|
|
|
void on_actionToggle_Messages_Panel_triggered();
|
|
|
|
|
2022-06-15 14:13:11 +08:00
|
|
|
void on_chkIgnoreSpaces_stateChanged(int arg1);
|
|
|
|
|
2022-07-01 17:15:20 +08:00
|
|
|
void on_actionRaylib_Manual_triggered();
|
|
|
|
|
2022-07-21 15:28:07 +08:00
|
|
|
void on_actionSelect_Word_triggered();
|
|
|
|
|
|
|
|
void on_actionGo_to_Line_triggered();
|
|
|
|
|
2022-08-07 21:41:57 +08:00
|
|
|
void on_actionNew_Template_triggered();
|
|
|
|
|
2022-10-27 15:18:57 +08:00
|
|
|
void on_actionGoto_block_start_triggered();
|
|
|
|
|
|
|
|
void on_actionGoto_block_end_triggered();
|
|
|
|
|
2022-11-05 19:39:33 +08:00
|
|
|
void on_actionSwitchHeaderSource_triggered();
|
|
|
|
|
2022-12-01 22:10:44 +08:00
|
|
|
void on_actionGenerate_Assembly_triggered();
|
|
|
|
|
2022-12-17 11:37:33 +08:00
|
|
|
void onImportFPSProblemSet();
|
2022-12-11 19:47:43 +08:00
|
|
|
|
2022-12-16 11:10:46 +08:00
|
|
|
void on_actionTrim_trailing_spaces_triggered();
|
|
|
|
|
2022-12-17 11:37:33 +08:00
|
|
|
void onExportFPSProblemSet();
|
2022-12-16 15:54:02 +08:00
|
|
|
|
2023-01-02 16:50:30 +08:00
|
|
|
void on_actionToggle_Readonly_triggered();
|
|
|
|
|
2023-01-16 15:42:03 +08:00
|
|
|
void on_actionSubmit_Issues_triggered();
|
|
|
|
|
|
|
|
void on_actionDocument_triggered();
|
|
|
|
|
2023-02-12 22:33:34 +08:00
|
|
|
void on_actionNew_GAS_File_triggered();
|
|
|
|
|
2023-02-15 16:24:24 +08:00
|
|
|
void on_actionGNU_Assembler_Manual_triggered();
|
|
|
|
|
2023-03-05 08:56:11 +08:00
|
|
|
#ifdef ARCH_X86_64
|
2023-02-26 17:50:03 +08:00
|
|
|
void on_actionx86_Assembly_Language_Reference_Manual_triggered();
|
2023-03-05 08:56:11 +08:00
|
|
|
#endif
|
|
|
|
#ifdef ARCH_X86
|
2023-02-26 17:50:03 +08:00
|
|
|
void on_actionIA_32_Assembly_Language_Reference_Manual_triggered();
|
2023-03-05 08:56:11 +08:00
|
|
|
#endif
|
2023-02-26 17:50:03 +08:00
|
|
|
|
2023-03-03 17:20:33 +08:00
|
|
|
void on_actionAdd_Watchpoint_triggered();
|
|
|
|
|
2023-03-04 12:47:49 +08:00
|
|
|
void on_actionNew_Text_File_triggered();
|
|
|
|
|
2021-04-06 23:10:57 +08:00
|
|
|
private:
|
|
|
|
Ui::MainWindow *ui;
|
2023-01-04 09:08:58 +08:00
|
|
|
bool mFullInitialized;
|
2021-08-01 09:13:38 +08:00
|
|
|
EditorList *mEditorList;
|
|
|
|
QLabel *mFileInfoStatus;
|
2021-10-15 10:23:46 +08:00
|
|
|
LabelWithMenu *mFileEncodingStatus;
|
2021-08-01 09:13:38 +08:00
|
|
|
QLabel *mFileModeStatus;
|
|
|
|
QMenu *mMenuEncoding;
|
2023-01-04 11:01:34 +08:00
|
|
|
QMenu *mMenuNewline;
|
2021-10-12 09:47:58 +08:00
|
|
|
QMenu *mMenuExport;
|
2021-08-01 09:13:38 +08:00
|
|
|
QMenu *mMenuEncodingList;
|
2021-08-02 10:08:25 +08:00
|
|
|
QMenu *mMenuRecentFiles;
|
2021-09-17 21:33:19 +08:00
|
|
|
QMenu *mMenuRecentProjects;
|
2021-09-16 23:51:05 +08:00
|
|
|
QMenu *mMenuNew;
|
2021-10-03 09:57:19 +08:00
|
|
|
QMenu *mMenuInsertCodeSnippet;
|
2021-08-01 09:13:38 +08:00
|
|
|
QComboBox *mCompilerSet;
|
2022-10-10 18:05:18 +08:00
|
|
|
std::shared_ptr<CompilerManager> mCompilerManager;
|
|
|
|
std::shared_ptr<Debugger> mDebugger;
|
2021-08-01 09:13:38 +08:00
|
|
|
CPUDialog *mCPUDialog;
|
2022-11-11 21:20:57 +08:00
|
|
|
SearchInFileDialog *mSearchInFilesDialog;
|
2021-08-03 23:55:57 +08:00
|
|
|
SearchDialog *mSearchDialog;
|
2021-08-23 17:27:17 +08:00
|
|
|
bool mQuitting;
|
2022-10-24 22:53:46 +08:00
|
|
|
bool mClosingProject;
|
2021-08-27 16:38:55 +08:00
|
|
|
QElapsedTimer mParserTimer;
|
2021-08-31 14:40:41 +08:00
|
|
|
QFileSystemWatcher mFileSystemWatcher;
|
2021-09-11 18:42:49 +08:00
|
|
|
std::shared_ptr<Project> mProject;
|
2022-06-17 12:12:12 +08:00
|
|
|
Qt::DockWidgetArea mMessagesDockLocation;
|
2021-07-23 13:22:05 +08:00
|
|
|
|
2021-08-29 10:29:56 +08:00
|
|
|
std::shared_ptr<CodeCompletionPopup> mCompletionPopup;
|
|
|
|
std::shared_ptr<HeaderCompletionPopup> mHeaderCompletionPopup;
|
2021-09-24 11:41:14 +08:00
|
|
|
std::shared_ptr<FunctionTooltipWidget> mFunctionTip;
|
2021-08-29 10:29:56 +08:00
|
|
|
|
2022-10-17 23:23:05 +08:00
|
|
|
std::shared_ptr<VisitHistoryManager> mVisitHistoryManager;
|
|
|
|
|
2021-10-03 17:18:43 +08:00
|
|
|
TodoModel mTodoModel;
|
2021-08-05 12:31:53 +08:00
|
|
|
SearchResultModel mSearchResultModel;
|
2021-10-21 17:31:25 +08:00
|
|
|
PBookmarkModel mBookmarkModel;
|
2021-08-05 12:31:53 +08:00
|
|
|
PSearchResultListModel mSearchResultListModel;
|
|
|
|
PSearchResultTreeModel mSearchResultTreeModel;
|
|
|
|
PSearchResultTreeViewDelegate mSearchViewDelegate;
|
2021-08-23 17:27:17 +08:00
|
|
|
ClassBrowserModel mClassBrowserModel;
|
2021-10-10 21:23:25 +08:00
|
|
|
std::shared_ptr<QHash<StatementKind, std::shared_ptr<ColorSchemeItem> > > mStatementColors;
|
2021-09-30 11:20:43 +08:00
|
|
|
PSymbolUsageManager mSymbolUsageManager;
|
2021-09-30 12:52:22 +08:00
|
|
|
PCodeSnippetManager mCodeSnippetManager;
|
2021-10-03 17:18:43 +08:00
|
|
|
PTodoParser mTodoParser;
|
2021-10-08 00:06:41 +08:00
|
|
|
PToolsManager mToolsManager;
|
2022-02-15 00:01:50 +08:00
|
|
|
CustomFileSystemModel mFileSystemModel;
|
|
|
|
CustomFileIconProvider mFileSystemModelIconProvider;
|
2021-11-01 00:40:11 +08:00
|
|
|
OJProblemSetModel mOJProblemSetModel;
|
|
|
|
OJProblemModel mOJProblemModel;
|
|
|
|
int mOJProblemSetNameCounter;
|
2021-08-05 12:31:53 +08:00
|
|
|
|
2022-10-23 16:31:05 +08:00
|
|
|
QString mClassBrowserCurrentStatement;
|
2022-10-25 22:10:38 +08:00
|
|
|
QString mFilesViewNewCreatedFolder;
|
2022-10-23 16:31:05 +08:00
|
|
|
|
2021-06-23 22:38:02 +08:00
|
|
|
bool mCheckSyntaxInBack;
|
2021-10-08 20:01:29 +08:00
|
|
|
bool mShouldRemoveAllSettings;
|
2021-06-25 12:40:11 +08:00
|
|
|
PCompileSuccessionTask mCompileSuccessionTask;
|
2021-04-20 22:24:33 +08:00
|
|
|
|
2021-11-09 21:22:50 +08:00
|
|
|
QMap<QWidget*, PTabWidgetInfo> mTabInfosData;
|
|
|
|
QMap<QWidget*, PTabWidgetInfo> mTabMessagesData;
|
|
|
|
|
2021-08-30 22:05:45 +08:00
|
|
|
QTimer mAutoSaveTimer;
|
|
|
|
|
2021-09-02 12:14:02 +08:00
|
|
|
CaretList mCaretList;
|
|
|
|
|
2021-09-02 20:12:16 +08:00
|
|
|
bool mClosing;
|
2022-08-24 17:05:16 +08:00
|
|
|
bool mClosingAll;
|
2021-11-08 21:19:48 +08:00
|
|
|
bool mOpenningFiles;
|
2021-09-02 20:12:16 +08:00
|
|
|
bool mSystemTurnedOff;
|
2021-09-05 05:01:31 +08:00
|
|
|
QPoint mEditorContextMenuPos;
|
2021-11-02 09:29:35 +08:00
|
|
|
QTcpServer mTcpServer;
|
2021-11-02 19:26:11 +08:00
|
|
|
QColor mErrorColor;
|
2023-02-24 12:17:30 +08:00
|
|
|
CompileIssuesState mCompileIssuesState;
|
2021-08-29 10:29:56 +08:00
|
|
|
|
2022-06-08 16:18:06 +08:00
|
|
|
QSet<QString> mFilesChangedNotifying;
|
|
|
|
|
2021-09-05 19:10:54 +08:00
|
|
|
//actions for compile issue table
|
2021-09-05 13:51:07 +08:00
|
|
|
QAction * mTableIssuesCopyAction;
|
|
|
|
QAction * mTableIssuesCopyAllAction;
|
|
|
|
QAction * mTableIssuesClearAction;
|
|
|
|
|
2021-09-05 21:05:38 +08:00
|
|
|
//actions for search result view
|
|
|
|
QAction * mSearchViewClearAction;
|
|
|
|
QAction * mSearchViewClearAllAction;
|
|
|
|
|
2021-09-05 22:16:54 +08:00
|
|
|
//actions for breakpoint view
|
|
|
|
QAction * mBreakpointViewPropertyAction;
|
|
|
|
QAction * mBreakpointViewRemoveAllAction;
|
2021-10-27 16:58:30 +08:00
|
|
|
QAction * mBreakpointViewRemoveAction;
|
2021-09-05 22:16:54 +08:00
|
|
|
|
2021-09-17 22:58:58 +08:00
|
|
|
//actions for project view
|
|
|
|
QAction * mProject_Add_Folder;
|
|
|
|
QAction * mProject_Rename_Unit;
|
|
|
|
QAction * mProject_Rename_Folder;
|
|
|
|
QAction * mProject_Remove_Folder;
|
2022-02-08 12:33:10 +08:00
|
|
|
QAction * mProject_SwitchFileSystemViewMode;
|
|
|
|
QAction * mProject_SwitchCustomViewMode;
|
2021-09-17 22:58:58 +08:00
|
|
|
|
2021-09-26 12:19:46 +08:00
|
|
|
//actions for class browser
|
|
|
|
QAction * mClassBrowser_Sort_By_Type;
|
|
|
|
QAction * mClassBrowser_Sort_By_Name;
|
2021-09-26 16:25:17 +08:00
|
|
|
QAction * mClassBrowser_Show_Inherited;
|
2021-09-26 12:19:46 +08:00
|
|
|
QAction * mClassBrowser_goto_declaration;
|
|
|
|
QAction * mClassBrowser_goto_definition;
|
2022-10-23 15:22:26 +08:00
|
|
|
QAction * mClassBrowser_Show_CurrentFile;
|
|
|
|
QAction * mClassBrowser_Show_WholeProject;
|
2021-09-26 16:25:17 +08:00
|
|
|
QWidget * mClassBrowserToolbar;
|
2021-09-17 22:58:58 +08:00
|
|
|
|
2021-10-22 07:42:51 +08:00
|
|
|
//actions for files view
|
|
|
|
QAction * mFilesView_Open;
|
|
|
|
QAction * mFilesView_OpenWithExternal;
|
|
|
|
QAction * mFilesView_OpenInTerminal;
|
|
|
|
QAction * mFilesView_OpenInExplorer;
|
2022-02-08 16:36:20 +08:00
|
|
|
QAction * mFilesView_CreateFolder;
|
2022-03-17 10:46:24 +08:00
|
|
|
QAction * mFilesView_CreateFile;
|
2022-02-08 16:36:20 +08:00
|
|
|
QAction * mFilesView_RemoveFile;
|
2022-06-12 15:48:19 +08:00
|
|
|
QAction * mFilesView_Rename;
|
2021-10-22 07:42:51 +08:00
|
|
|
|
2021-10-02 17:01:08 +08:00
|
|
|
//action for debug console
|
2021-11-25 10:18:21 +08:00
|
|
|
QAction * mDebugConsole_ShowDetailLog;
|
2021-10-02 17:01:08 +08:00
|
|
|
QAction * mDebugConsole_Clear;
|
|
|
|
QAction * mDebugConsole_Copy;
|
|
|
|
QAction * mDebugConsole_Paste;
|
|
|
|
QAction * mDebugConsole_SelectAll;
|
2021-10-21 17:31:25 +08:00
|
|
|
//action for bookmarks
|
|
|
|
QAction * mBookmark_Remove;
|
|
|
|
QAction * mBookmark_RemoveAll;
|
|
|
|
QAction * mBookmark_Modify;
|
2021-10-02 17:01:08 +08:00
|
|
|
|
2021-11-04 09:07:06 +08:00
|
|
|
//action for problem set
|
2022-12-17 11:37:33 +08:00
|
|
|
QAction * mProblemSet_New;
|
|
|
|
QAction * mProblemSet_Rename;
|
|
|
|
QAction * mProblemSet_Save;
|
|
|
|
QAction * mProblemSet_Load;
|
|
|
|
QAction * mProblemSet_ImportFPS;
|
|
|
|
QAction * mProblemSet_ExportFPS;
|
2022-12-17 13:34:11 +08:00
|
|
|
QAction * mProblemSet_AddProblem;
|
|
|
|
QAction * mProblemSet_RemoveProblem;
|
2022-12-17 11:37:33 +08:00
|
|
|
|
|
|
|
//action for problem
|
2022-01-01 21:04:17 +08:00
|
|
|
QAction * mProblem_OpenSource;
|
2021-11-04 09:07:06 +08:00
|
|
|
QAction * mProblem_Properties;
|
2022-12-13 08:49:20 +08:00
|
|
|
QAction * mProblem_Rename;
|
|
|
|
QAction * mProblem_GotoUrl;
|
|
|
|
|
2021-11-04 09:07:06 +08:00
|
|
|
|
2022-12-17 11:37:33 +08:00
|
|
|
//action for problem cases
|
|
|
|
QAction * mProblem_AddCase;
|
|
|
|
QAction * mProblem_RemoveCases;
|
|
|
|
QAction * mProblem_OpenAnswer;
|
|
|
|
QAction * mProblem_CaseValidationOptions;
|
|
|
|
|
2022-03-30 19:28:46 +08:00
|
|
|
QAction * mProblem_RunCurrentCase;
|
|
|
|
QAction * mProblem_RunAllCases;
|
2022-04-16 20:39:09 +08:00
|
|
|
QAction * mProblem_batchSetCases;
|
2022-03-30 19:28:46 +08:00
|
|
|
|
2022-02-10 12:03:56 +08:00
|
|
|
//action for tools output
|
|
|
|
QAction * mToolsOutput_Clear;
|
|
|
|
QAction * mToolsOutput_SelectAll;
|
|
|
|
QAction * mToolsOutput_Copy;
|
|
|
|
|
2022-10-10 18:05:18 +08:00
|
|
|
QSortFilterProxyModel *mProjectProxyModel;
|
2022-01-07 19:20:42 +08:00
|
|
|
|
2021-04-09 17:48:25 +08:00
|
|
|
// QWidget interface
|
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent *event) override;
|
2021-09-02 19:36:16 +08:00
|
|
|
void showEvent(QShowEvent* event) override;
|
2021-10-31 09:39:31 +08:00
|
|
|
void hideEvent(QHideEvent *event) override;
|
2022-01-26 21:36:31 +08:00
|
|
|
|
2022-02-20 22:36:12 +08:00
|
|
|
|
|
|
|
// QObject interface
|
|
|
|
public:
|
|
|
|
bool event(QEvent *event) override;
|
2022-08-24 17:05:16 +08:00
|
|
|
bool isClosingAll() const;
|
|
|
|
bool isQuitting() const;
|
2022-10-17 23:23:05 +08:00
|
|
|
const std::shared_ptr<VisitHistoryManager> &visitHistoryManager() const;
|
2022-10-24 22:53:46 +08:00
|
|
|
bool closingProject() const;
|
2021-04-06 23:10:57 +08:00
|
|
|
};
|
2021-04-08 10:29:21 +08:00
|
|
|
|
|
|
|
extern MainWindow* pMainWindow;
|
2021-04-06 23:10:57 +08:00
|
|
|
#endif // MAINWINDOW_H
|