From 7a5b6b8efcda31e5812f519263cdf60d3ee475aa Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Fri, 22 Oct 2021 15:02:54 +0800 Subject: [PATCH] - implement: files view --- NEWS.md | 1 + RedPandaIDE/RedPandaIDE_zh_CN.qm | Bin 97880 -> 98763 bytes RedPandaIDE/RedPandaIDE_zh_CN.ts | 702 +++++++++++--------- RedPandaIDE/editor.cpp | 2 +- RedPandaIDE/editorlist.cpp | 4 + RedPandaIDE/images/newlook24/046-Locate.png | Bin 300 -> 285 bytes RedPandaIDE/mainwindow.cpp | 213 +++++- RedPandaIDE/mainwindow.h | 11 +- RedPandaIDE/mainwindow.ui | 43 +- RedPandaIDE/settings.cpp | 3 + RedPandaIDE/utils.cpp | 2 +- 11 files changed, 626 insertions(+), 355 deletions(-) diff --git a/NEWS.md b/NEWS.md index 57cf32f6..605cdb47 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,7 @@ Version 0.7.0 - enhancement: autosave/load bookmarks - enhancement: autosave/load breakpoints - enhancement: autosave/load watches + - implement: files view Version 0.6.8 - enhancement: add link to cppreference in the help menu diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm index 2c684e08c9eadad74aff959c330ec354e6988421..688a619c9186ffdc6d69ba8c0e804baceb73009f 100644 GIT binary patch delta 9706 zcmZ{qd0b6f`2U}E&ffb>`<#PDQbHLn${3MK6cvS{Q8b}6P~zh1AoCQCF>_=p88Qzc z^AssF=^8R*CetO~Pv_j4{Ev z1DArsz-8bJa5=aGTmfDKSAw6xRYYg%gL{cJjt4&yv%5pY*CW=fGl;Rq`5DMuPl5jU z{v;Si$i!horXwPJ3#FR`;A8SR~h;I98vGhM0S`^EyFVmWWKA3yxob4PJ=zb zD$oNHGa>Q`C)$*5M14CEt=dD>Z!ghmo+$7zmf6(UXMyLUMJZYsH5qabM2ho-!ZaU zZ{!!Ot@it`{|@kdhw=Is)`sty#N0?e%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qcVl diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts index b6f68db0..af623a65 100644 --- a/RedPandaIDE/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts @@ -2801,40 +2801,40 @@ Are you really want to continue? 小熊猫C++ - - + + Issues 编译器 - + Compile Log 编译日志 - + File 文件 - + Tools 工具 - - + + Run 运行 - + Edit 编辑 - + Project 项目 @@ -2849,90 +2849,91 @@ Are you really want to continue? 结构 + Files - 文件 + 文件 Resource 资源 - - - - + + + + Debug 调试 - + Evaluate: 求值 - + Debug Console 调试主控台 - + Call Stack 调用栈 - + Breakpoints 断点 - + Locals 本地变量 - - + + Search 查找 - + History: 历史: - + Search Again 重新查找 - + Replace with: 替换为: - + Replace 替换 - + Close 关闭 - + Execute 运行 - - + + Code 代码 - + Window 窗口 @@ -2945,721 +2946,732 @@ Are you really want to continue? 工具栏2 - + New 新建 - + Ctrl+N Ctrl+N - + Open... 打开... - + Ctrl+O Ctrl+O - + Save 保存 - + Ctrl+S Ctrl+S - + Save As... 另存为... - + Save As 另存为 - + Save All 全部保存 - + Ctrl+Shift+S Ctrl+Shift+S - + Options 选项 - - - - - - - + + + + + + + Compile 编译 - + F9 F9 - + F10 F10 - + Undo 恢复 - + Ctrl+Z Ctrl+Z - + Redo 重做 - + Ctrl+Y Ctrl+Y - + Cut 剪切 - + Ctrl+X Ctrl+X - - + + Copy 复制 - + Ctrl+C Ctrl+C - - + + Paste 粘贴 - + Ctrl+V Ctrl+V - - + + Select All 选择全部 - + Ctrl+A Ctrl+A - + Indent 缩进 - + UnIndent 取消缩进 - + Toggle Comment 切换注释 - + Ctrl+/ Ctrl+/ - + Collapse All 全部收起 - + Uncollapse All 全部展开 - + Encode in ANSI 使用ANSI编码 - + Encode in UTF-8 使用UTF-8编码 - + Auto Detect 自动检测 - + Convert to ANSI 转换为ANSI编码 - + Convert to UTF-8 转换为UTF-8编码 - - + + Compile & Run 编译运行 - + F11 F11 - - + + Rebuild All 全部重编译 - + F12 F12 - + Stop Execution 停止执行 - + F6 F6 - + F5 F5 - + Step Over 单步跳过 - + F7 F7 - + Step Into 单步进入 - + Memory 内存 - + Address Expression: Address: 地址表达式: - + Cancel 取消 - + TODO TODO - + Bookmark 书签 - + Help 帮助 - + Refactor 重构 - + Main 主工具栏 - + Compiler Set 编译器配置集 - - + + New Source File 新建源代码文件 - + Tab Tab - + Shift+Tab Shift+Tab - + F8 F8 - + Step Out 单步跳出 - + Ctrl+F8 Ctrl+F8 - + Run To Cursor 执行到光标处 - + Ctrl+F5 Ctrl+F5 - + Continue 继续执行 - + F4 F4 - + Add Watch... 添加监视 - + View CPU Window... 打开CPU信息窗口... - + Exit 退出 - + Find... 查找... - + Ctrl+F Ctrl+F - + Find in Files... 在文件中查找... - + Ctrl+Shift+F Ctrl+Shift+F - + Replace... 替换 - + Ctrl+R Ctrl+R - + Find Next 查找下一个 - + F3 F3 - + Find Previous 查找前一个 - + Shift+F3 Shift+F3 - + Remove Watch 删除监视 - - + + Remove All 清除全部监视 - + Modify Watch... 修改监视值 - + Reformat Code 对代码重新排版 - + Ctrl+Shift+A Ctrl+Shift+A - + Go back 前一次编辑位置 - + Ctrl+Alt+Left Ctrl+Alt+Left - + Forward 后一次编辑位置 - + Ctrl+Alt+Right Ctrl+Alt+Right - + Ctrl+W Ctrl+W - + Close All 全部关闭 - + Ctrl+Shift+W Ctrl+Shift+W - + Maximize Editor 最大化编辑器 - + Ctrl+F11 Ctrl+F11 - + Next 下一窗口 - + Ctrl+Tab Ctrl+Tab - + Previous 前一窗口 - + Ctrl+Shift+Tab Ctrl+Shift+Tab - + Toggle breakpoint 切换断点 - + Ctrl+F4 Ctrl+F4 - - + + Clear all breakpoints 删除所有断点 - + Breakpoint property... 设置断点条件... - + Goto Declaration 跳转到声明处 - + Goto Definition 跳转到定义处 - + Find references 查找符号的引用 - + Open containing folder 打开所在的文件夹 - + Ctrl+B Ctrl+B - + Open a terminal here 打开命令行窗口 - + File Properties... 文件属性... - + Close Project 关闭项目 - + Project options 项目属性 - + New Project... 新建项目... - + New File 新建项目文件 - + Add to project... 添加到项目... - + Remove from project 从项目删除 - + View Makefile 查看Makefile - + Clean 清理构建文件 - + Open Folder in Explorer 在浏览器中打开 - + Open In Terminal 在终端中打开 - + About 关于 - - + + Rename Symbol 重命名符号 - + Shift+F6 Shift+F6 - + Print... 打印... - + Ctrl+P Ctrl+P - - + + Export As RTF 导出为RTF - - + + Export As HTML 导出为HTML - + Move To Other View 移动到其他视图 - + Ctrl+M Ctrl+M - + C/C++ Reference C/C++参考 - + EGE Manual EGE图形库手册 - + Add Bookmark 添加书签 - + Remove Bookmark 删除书签 - + Modify Bookmark Description 修改书签说明 - + + Locate in Files View + 在文件视图中定位 + + + + + Open Folder + 打开文件夹 + + + File Encoding 文件编码 - + Recent Files 文件历史 - - - - - - + + + + + + Debugging 正在调试 - - - - - - + + + + + + Running 正在运行 - - - - - - + + + + + + Compiling 正在编译 @@ -3668,510 +3680,543 @@ Are you really want to continue? 行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5 - + Line:%1 Col:%2 Selected:%3 Lines:%4 Length:%5 Line: %1 Col: %2 Selected: %3 Lines: %4 Length: %5 行: %1 列: %2 已选择 :%3 总行数: %4 总长度: %5 - + Read Only 只读 - + Insert 插入 - + Overwrite 覆写 - + Close project 关闭项目 - + Are you sure you want to close %1? 你确定要关闭'%1'吗? - - + + Confirm 确认 - - - + + + Source file is not compiled. 源文件尚未编译。 - - + + Compile now? 现在编译? - - - + + + Source file is more recent than executable. 源文件比可执行程序新。 - + Recompile now? 重新编译? - + No compiler set 无编译器设置 - + No compiler set is configured. 没有配置编译器设置。 - + Can't start debugging. 无法启动调试器 - - + + Enable debugging 启用调试参数 - - + + You have not enabled debugging info (-g3) and/or stripped it from the executable (-s) in Compiler Options.<BR /><BR />Do you want to correct this now? 当前编译设置中未启用调试选项(-g3),或启用了信息剥除选项(-s)<br /><br/>是否纠正这一问题? - + Project not built 项目尚未构建 - + Project hasn't been built. Build it now? 项目尚未构建。是否构建? - + Host applcation missing 宿主程序不存在 - + DLL project needs a host application to run. 动态链接库(DLL)需要一个宿主程序来运行。 - + But it's missing. 但它不存在。 - + Host application not exists 宿主程序不存在 - + Host application file '%1' doesn't exist. 宿主程序'%1'不存在。 - + Recompile? 重新编译? - - + + Save last open info error 保存上次打开信息失败 - + Can't remove old last open information file '%1' 无法删除旧上次打开信息文件'%1' - + Can't save last open info file '%1' 无法保存上次打开信息文件'%1' - + Load last open info error 载入上次打开信息失败 - + Can't load last open info file '%1' 无法载入上次打开信息文件'%1' - + Copy all 全部复制 - - + + Clear 清除 - + Export 导出 - + Insert Snippet 插入代码段 - + Remove 删除 - + Modify Description 修改描述 - - - + + + Bookmark Description 书签描述 - - - + + + Description: 描述: - + Show debug logs in the debug console 在调试主控台中显示调试器输出 - + Remove this search 清除这次搜索 - + Clear all searches 删除所有搜索 - + Breakpoint condition... 断点条件... - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Remove all breakpoints 清除所有断点 - + Rename File 重命名文件 - - + + Add Folder 添加文件夹 - + New folder 新文件夹 - + Folder name: 文件夹: - + Rename Folder 重命名 - + Remove Folder 删除文件夹 - + Sort By Type 按类型排序 - + Sort alphabetically 按名称排序 - + Show inherited members 显示继承的成员 - + Goto declaration 跳转到声明处 - + Goto definition 跳转到定义处 - + + Open in Editor + 在编辑器中打开 + + + + Open in External Program + 使用外部程序打开 + + + + Open in Terminal + 在终端中打开 + + + + Open in Windows Explorer + 在Windows浏览器中打开 + + + Character sets 字符集 - + %1 files autosaved 已自动保存%1个文件 - + Save project 保存项目 - + The project '%1' has modifications. 项目'%1'有改动。 - + Do you want to save it? 需要保存吗? - + + + + Save Error + 保存失败 + + + Do you really want to clear all breakpoints in this file? 您真的要清除该文件的所有断点吗? - + New project 新建项目 - + Close %1 and start new project? 关闭'%1'以打开新项目? - + Folder not exist 文件夹不存在 - + Folder '%1' doesn't exist. Create it now? 文件夹'%1'不存在。是否创建? - + Can't create folder 无法创建文件夹 - + Failed to create folder '%1'. 创建文件夹'%1'失败。 - + Save new project as - + Red panda Dev-C++ project file (*.dev) 小熊猫Dev-C++项目文件 (*.dev) - + New project fail 新建项目失败 - + Can't assign project template 无法使用模板创建项目 - + Add to project 添加到项目 - + Rename Error 重命名出错 - + Symbol '%1' is defined in system header. 符号'%1'在系统头文件中定义,无法修改。 - + New Name 新名称 - - + + Replace Error 替换出错 - + Can't open file '%1' for replace! 无法打开文件'%1'进行替换! - + Contents has changed since last search! 内容和上次查找时不一致。 - + Rich Text Format Files (*.rtf) RTF格式文件 (*.rtf) - + HTML Files (*.html) HTML文件 (*.html) - - - - - - - - - + + + + + + + + + + + + + + + Error 错误 - + Recent Projects 项目历史 - + File '%1' was changed. 磁盘文件'%1'已被修改。 - + Reload its content from disk? 是否重新读取它的内容? - + File '%1' was removed. 磁盘文件'%1'已被删除。 - + Keep it open? 是否保持它在小熊猫C++中打开的编辑窗口? - + Open 打开 - + Compile Failed 编译失败 - + Run Failed 运行失败 - - + + Confirm Convertion 确认转换 - - + + The editing file will be saved using %1 encoding. <br />This operation can't be reverted. <br />Are you sure to continue? 当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗? - + New Watch Expression 新监视表达式 - + Enter Watch Expression (it is recommended to use 'this->' for class members): 输入监视表达式 - + Parsing file %1 of %2: "%3" (%1/%2)正在解析文件"%3" - - + + Done parsing %1 files in %2 seconds 完成%1个文件的解析,用时%2秒 - + (%1 files per second) (每秒%1个文件) @@ -6129,6 +6174,19 @@ Are you really want to continue? 本页中有尚未保存的设置修改,是否保存后再切换到其他页? + + SettingsWidget + + + Load Error + 载入失败 + + + + Save Error + 保存失败 + + ShortcutManager diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index c9b50505..16840631 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -495,6 +495,7 @@ void Editor::focusInEvent(QFocusEvent *event) this, &SynEdit::invalidate); } + pMainWindow->updateAppTitle(); pMainWindow->updateEditorActions(); pMainWindow->updateStatusbarForLineCol(); pMainWindow->updateForStatusbarModeInfo(); @@ -511,7 +512,6 @@ void Editor::focusOutEvent(QFocusEvent *event) &SynEdit::invalidate); } //pMainWindow->updateClassBrowserForEditor(nullptr); - pMainWindow->updateEditorActions(); pMainWindow->updateStatusbarForLineCol(); pMainWindow->updateForStatusbarModeInfo(); pMainWindow->functionTip()->hide(); diff --git a/RedPandaIDE/editorlist.cpp b/RedPandaIDE/editorlist.cpp index abccd915..f3bdb504 100644 --- a/RedPandaIDE/editorlist.cpp +++ b/RedPandaIDE/editorlist.cpp @@ -153,6 +153,9 @@ bool EditorList::closeEditor(Editor* editor, bool transferFocus, bool force) { editor = getEditor(); pMainWindow->updateClassBrowserForEditor(editor); } + if (pageCount()==0) { + pMainWindow->updateAppTitle(); + } return true; } @@ -283,6 +286,7 @@ bool EditorList::closeAll(bool force) { return false; } } + pMainWindow->updateAppTitle(); return true; } diff --git a/RedPandaIDE/images/newlook24/046-Locate.png b/RedPandaIDE/images/newlook24/046-Locate.png index 06f161b441e51ac45a95f6a4a75b90c90ba44fc0..f09ed6a1ba3e2a759260b20c2450faf4d627c8ae 100644 GIT binary patch delta 257 zcmV+c0sj810-XYoB!3BTNLh0L01m?d01m?e$8V@)0002bNkl4HYtJ!m7$U{4)ww;^KYee=hHV;^z)O@_PoNJ-cSWV|`(X#ecCj&K zvg}s&w~|EXl!2#hs)y-xl-o14U;a&(67Adv|Gm*FiQaEt&cnW?BdKGF00000NkvXX Hu0mjf>^F1D delta 273 zcmV+s0q*{t0;~d%B!2;OQb$4nuFf3k00004XF*Lt006O%3;baP00009a7bBm000XS z000XS0e@s)kpKVy!AV3xR7gwRl35PJAP_@o?|searchView,&QTreeView::expandAll); ui->replacePanel->setVisible(false); - + //files view ui->treeFiles->setModel(&mFileSystemModel); - mFileSystemModel.setRootPath(pSettings->environment().currentFolder()); - ui->treeFiles->setRootIndex(mFileSystemModel.index(pSettings->environment().currentFolder())); + mFileSystemModel.setReadOnly(true); + setFilesViewRoot(pSettings->environment().currentFolder()); + for (int i=1;itreeFiles->hideColumn(i); + } + //class browser ui->classBrowser->setModel(&mClassBrowserModel); @@ -322,6 +326,8 @@ void MainWindow::updateEditorActions() ui->actionAdd_bookmark->setEnabled(false); ui->actionRemove_Bookmark->setEnabled(false); ui->actionModify_Bookmark_Description->setEnabled(false); + + ui->actionLocate_in_Files_View->setEnabled(false); } else { ui->actionAuto_Detect->setEnabled(true); ui->actionEncode_in_ANSI->setEnabled(true); @@ -362,6 +368,8 @@ void MainWindow::updateEditorActions() ui->actionAdd_bookmark->setEnabled(e->lines()->count()>0 && !e->hasBookmark(line)); ui->actionRemove_Bookmark->setEnabled(e->hasBookmark(line)); ui->actionModify_Bookmark_Description->setEnabled(e->hasBookmark(line)); + + ui->actionLocate_in_Files_View->setEnabled(!e->isNew()); } updateCompileActions(); @@ -2047,33 +2055,113 @@ void MainWindow::buildContextMenus() //toolbar for class browser mClassBrowserToolbar = new QWidget(); - QVBoxLayout* layout = dynamic_cast( ui->tabStructure->layout()); - layout->insertWidget(0,mClassBrowserToolbar); - QHBoxLayout* hlayout = new QHBoxLayout(); - hlayout->setContentsMargins(2,2,2,2); - mClassBrowserToolbar->setLayout(hlayout); - QToolButton * toolButton; - toolButton = new QToolButton; - toolButton->setDefaultAction(mClassBrowser_Sort_By_Type); - hlayout->addWidget(toolButton); - toolButton = new QToolButton; - toolButton->setDefaultAction(mClassBrowser_Sort_By_Name); - hlayout->addWidget(toolButton); - QFrame * vLine = new QFrame(); - vLine->setFrameShape(QFrame::VLine); - vLine->setFrameShadow(QFrame::Sunken); - hlayout->addWidget(vLine); - toolButton = new QToolButton; - toolButton->setDefaultAction(mClassBrowser_Show_Inherited); - hlayout->addWidget(toolButton); - hlayout->addStretch(); + { + QVBoxLayout* layout = dynamic_cast( ui->tabStructure->layout()); + layout->insertWidget(0,mClassBrowserToolbar); + QHBoxLayout* hlayout = new QHBoxLayout(); + hlayout->setContentsMargins(2,2,2,2); + mClassBrowserToolbar->setLayout(hlayout); + QToolButton * toolButton; + toolButton = new QToolButton; + toolButton->setDefaultAction(mClassBrowser_Sort_By_Type); + hlayout->addWidget(toolButton); + toolButton = new QToolButton; + toolButton->setDefaultAction(mClassBrowser_Sort_By_Name); + hlayout->addWidget(toolButton); + QFrame * vLine = new QFrame(); + vLine->setFrameShape(QFrame::VLine); + vLine->setFrameShadow(QFrame::Sunken); + hlayout->addWidget(vLine); + toolButton = new QToolButton; + toolButton->setDefaultAction(mClassBrowser_Show_Inherited); + hlayout->addWidget(toolButton); + hlayout->addStretch(); + } //menu for statusbar mFileEncodingStatus->setContextMenuPolicy(Qt::CustomContextMenu); connect(mFileEncodingStatus,&QWidget::customContextMenuRequested, this, &MainWindow::onFileEncodingContextMenu); - // + //menu for files view + ui->treeFiles->setContextMenuPolicy(Qt::CustomContextMenu); + connect(ui->treeFiles,&QWidget::customContextMenuRequested, + this, &MainWindow::onFilesViewContextMenu); + mFilesView_Open = createActionFor( + tr("Open in Editor"), + ui->treeFiles); + connect(mFilesView_Open, &QAction::triggered, + [this]() { + QString path = mFileSystemModel.filePath(ui->treeFiles->currentIndex()); + if (!path.isEmpty() && QFileInfo(path).isFile()) { + Editor *editor=mEditorList->getEditorByFilename(path); + if (editor) + editor->activate(); + } + }); + mFilesView_OpenWithExternal = createActionFor( + tr("Open in External Program"), + ui->treeFiles); + connect(mFilesView_OpenWithExternal, &QAction::triggered, + [this]() { + QString path = mFileSystemModel.filePath(ui->treeFiles->currentIndex()); + if (!path.isEmpty() && QFileInfo(path).isFile()) { + QDesktopServices::openUrl(QUrl::fromLocalFile(path)); + } + }); + mFilesView_OpenInTerminal = createActionFor( + tr("Open in Terminal"), + ui->treeFiles); + mFilesView_OpenInTerminal->setIcon(ui->actionOpen_Terminal->icon()); + connect(mFilesView_OpenInTerminal, &QAction::triggered, + [this]() { + QString path = mFileSystemModel.filePath(ui->treeFiles->currentIndex()); + if (!path.isEmpty()) { + QFileInfo fileInfo(path); + openShell(fileInfo.path(),"cmd.exe"); + } + }); + mFilesView_OpenInExplorer = createActionFor( + tr("Open in Windows Explorer"), + ui->treeFiles); + mFilesView_OpenInExplorer->setIcon(ui->actionOpen_Containing_Folder->icon()); + connect(mFilesView_OpenInExplorer, &QAction::triggered, + [this]() { + QString path = mFileSystemModel.filePath(ui->treeFiles->currentIndex()); + if (!path.isEmpty()) { + QFileInfo info(path); + if (info.isFile()){ + QDesktopServices::openUrl( + QUrl("file:///"+ + includeTrailingPathDelimiter(info.path()),QUrl::TolerantMode)); + } else if (info.isDir()){ + QDesktopServices::openUrl( + QUrl("file:///"+ + includeTrailingPathDelimiter(path),QUrl::TolerantMode)); + } + } + }); + + //toolbar for files view + mFilesViewToolbar = new QWidget(); + { + QVBoxLayout* layout = dynamic_cast( ui->tabFiles->layout()); + layout->insertWidget(0,mFilesViewToolbar); + QHBoxLayout* hlayout = new QHBoxLayout(); + hlayout->setContentsMargins(2,2,2,2); + mFilesViewToolbar->setLayout(hlayout); + QToolButton * toolButton; + toolButton = new QToolButton; + toolButton->setDefaultAction(ui->actionOpen_Folder); + toolButton->setFixedSize(32,32); + hlayout->addWidget(toolButton); + toolButton = new QToolButton; + toolButton->setDefaultAction(ui->actionLocate_in_Files_View); + toolButton->setFixedSize(32,32); + hlayout->addWidget(toolButton); + hlayout->addStretch(); + } + } void MainWindow::buildEncodingMenu() @@ -2345,6 +2433,26 @@ void MainWindow::onFileEncodingContextMenu(const QPoint &pos) mMenuEncoding->exec(mFileEncodingStatus->mapToGlobal(pos)); } +void MainWindow::onFilesViewContextMenu(const QPoint &pos) +{ + + QMenu menu(this); + menu.addAction(ui->actionOpen_Folder); + menu.addSeparator(); + menu.addAction(mFilesView_Open); + menu.addAction(mFilesView_OpenWithExternal); + menu.addSeparator(); + menu.addAction(mFilesView_OpenInTerminal); + menu.addAction(mFilesView_OpenInExplorer); + QString path = mFileSystemModel.filePath(ui->treeFiles->currentIndex()); + QFileInfo info(path); + mFilesView_Open->setEnabled(info.isFile()); + mFilesView_OpenWithExternal->setEnabled(info.isFile()); + mFilesView_OpenInTerminal->setEnabled(!path.isEmpty()); + mFilesView_OpenInExplorer->setEnabled(!path.isEmpty()); + menu.exec(ui->treeFiles->mapToGlobal(pos)); +} + void MainWindow::onShowInsertCodeSnippetMenu() { mMenuInsertCodeSnippet->clear(); @@ -2407,7 +2515,7 @@ void MainWindow::onEditorContextMenu(const QPoint &pos) menu.addSeparator(); menu.addAction(ui->actionOpen_Containing_Folder); menu.addAction(ui->actionOpen_Terminal); - + menu.addAction(ui->actionLocate_in_Files_View); menu.addSeparator(); menu.addAction(ui->actionReformat_Code); menu.addSeparator(); @@ -2443,6 +2551,7 @@ void MainWindow::onEditorContextMenu(const QPoint &pos) menu.addAction(ui->actionRemove_Bookmark); menu.addAction(ui->actionModify_Bookmark_Description); } + ui->actionLocate_in_Files_View->setEnabled(!editor->isNew()); ui->actionBreakpoint_property->setEnabled(editor->hasBreakpoint(line)); ui->actionAdd_bookmark->setEnabled( line>=0 && editor->lines()->count()>0 @@ -2477,6 +2586,7 @@ void MainWindow::onEditorTabContextMenu(QTabWidget* tabWidget, const QPoint &pos menu.addSeparator(); menu.addAction(ui->actionOpen_Containing_Folder); menu.addAction(ui->actionOpen_Terminal); + menu.addAction(ui->actionLocate_in_Files_View); menu.addSeparator(); menu.addAction(ui->actionMove_To_Other_View); menu.addSeparator(); @@ -2485,7 +2595,10 @@ void MainWindow::onEditorTabContextMenu(QTabWidget* tabWidget, const QPoint &pos tabWidget==ui->EditorTabsRight || tabWidget->count()>1 ); - + Editor * editor = dynamic_cast(tabWidget->widget(index)); + if (editor ) { + ui->actionLocate_in_Files_View->setEnabled(!editor->isNew()); + } menu.exec(tabBar->mapToGlobal(pos)); } @@ -2754,6 +2867,9 @@ void MainWindow::closeEvent(QCloseEvent *event) { settings.setLeftPanelIndex(ui->tabInfos->currentIndex()); settings.setLeftPanelOpenned(mLeftPanelOpenned); settings.save(); + + //save current folder ( for files view ) + pSettings->environment().save(); try { mBookmarkModel->save(includeTrailingPathDelimiter(pSettings->dirs().config()) +DEV_BOOKMARK_FILE); @@ -4343,6 +4459,15 @@ void MainWindow::showSearchReplacePanel(bool show) mSearchResultTreeModel->setSelectable(show); } +void MainWindow::setFilesViewRoot(const QString &path) +{ + mFileSystemModel.setRootPath(path); + ui->treeFiles->setRootIndex(mFileSystemModel.index(path)); + pSettings->environment().setCurrentFolder(path); + ui->txtFilesPath->setText(path); + ui->txtFilesPath->setCursorPosition(1); +} + Ui::MainWindow *MainWindow::mainWidget() const { return ui; @@ -4546,3 +4671,39 @@ void MainWindow::on_actionModify_Bookmark_Description_triggered() } } + +void MainWindow::on_actionLocate_in_Files_View_triggered() +{ + Editor * editor = mEditorList->getEditor(); + if (editor) { + QString fileDir = extractFileDir(editor->filename()); + if (!fileDir.isEmpty()) { + setFilesViewRoot(fileDir); + ui->treeFiles->setCurrentIndex(mFileSystemModel.index(editor->filename())); + } + } +} + + +void MainWindow::on_treeFiles_doubleClicked(const QModelIndex &index) +{ + QString filepath = mFileSystemModel.filePath(index); + QFileInfo file(filepath); + if (file.isFile()) { + Editor * editor = mEditorList->getEditorByFilename(filepath); + if (editor) { + editor->activate(); + } + } +} + + +void MainWindow::on_actionOpen_Folder_triggered() +{ + QString folder = QFileDialog::getExistingDirectory(this,tr("Open Folder"), + pSettings->environment().currentFolder()); + if (!folder.isEmpty()) { + setFilesViewRoot(folder); + } +} + diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h index 44eb95ce..b34e34e3 100644 --- a/RedPandaIDE/mainwindow.h +++ b/RedPandaIDE/mainwindow.h @@ -192,6 +192,7 @@ private: void scanActiveProject(bool parse=false); void includeOrSkipDirs(const QStringList& dirs, bool skip); void showSearchReplacePanel(bool show); + void setFilesViewRoot(const QString& path); private slots: void onAutoSaveTimeout(); @@ -206,6 +207,7 @@ private slots: void onClassBrowserContextMenu(const QPoint& pos); void onDebugConsoleContextMenu(const QPoint& pos); void onFileEncodingContextMenu(const QPoint& pos); + void onFilesViewContextMenu(const QPoint& pos); void onShowInsertCodeSnippetMenu(); @@ -420,6 +422,12 @@ private slots: void on_actionModify_Bookmark_Description_triggered(); + void on_actionLocate_in_Files_View_triggered(); + + void on_treeFiles_doubleClicked(const QModelIndex &index); + + void on_actionOpen_Folder_triggered(); + private: Ui::MainWindow *ui; EditorList *mEditorList; @@ -511,9 +519,6 @@ private: QAction * mFilesView_OpenWithExternal; QAction * mFilesView_OpenInTerminal; QAction * mFilesView_OpenInExplorer; - QAction * mFilesView_OnlyShowDevFiles; - QAction * mFilesView_LocateCurrent; - QWidget * mFilesViewToolbar; //action for debug console diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui index 1666e1fa..5474c461 100644 --- a/RedPandaIDE/mainwindow.ui +++ b/RedPandaIDE/mainwindow.ui @@ -85,7 +85,7 @@ QTabWidget::West - 2 + 3 true @@ -213,6 +213,9 @@ Files + + 0 + 0 @@ -226,7 +229,24 @@ 0 - + + + true + + + true + + + + + + + QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked + + + QAbstractItemView::DragOnly + + @@ -931,6 +951,7 @@ File + @@ -1965,6 +1986,24 @@ Modify Bookmark Description + + + + :/icons/images/newlook24/046-Locate.png:/icons/images/newlook24/046-Locate.png + + + Locate in Files View + + + + + + :/icons/images/newlook24/053-open.png:/icons/images/newlook24/053-open.png + + + Open Folder + + diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index a43075e0..a9741e88 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -2619,6 +2619,9 @@ void Settings::Environment::doLoad() mInterfaceFontSize = intValue("interface font size",10); mLanguage = stringValue("language", QLocale::system().name()); mCurrentFolder = stringValue("current_folder",QDir::currentPath()); + if (!fileExists(mCurrentFolder)) { + mCurrentFolder = QDir::currentPath(); + } } int Settings::Environment::interfaceFontSize() const diff --git a/RedPandaIDE/utils.cpp b/RedPandaIDE/utils.cpp index 7c0b4238..5518f23c 100644 --- a/RedPandaIDE/utils.cpp +++ b/RedPandaIDE/utils.cpp @@ -748,7 +748,7 @@ QString parseMacros(const QString &s) QString result = s; Editor *e = pMainWindow->editorList()->getEditor(); - result.replace("", QDir().absolutePath()); + result.replace("", QDir::currentPath()); result.replace("", pSettings->dirs().executable()); result.replace("", DEVCPP_VERSION); result.replace("", pSettings->dirs().app());