diff --git a/NEWS.md b/NEWS.md
index 927f5596..17c7a632 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,7 @@
Red Panda C++ Version 0.14.5
- fix: the "gnu c++ 20" option in compiler set options is wrong
+ - enhancement: option "open files in the same red panda C++ instance", in options->environment->file associations
+ - enhancement: hide unsupported files in files view
Red Panda C++ Version 0.14.4
diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro
index 54bde0ca..14b64c97 100644
--- a/RedPandaIDE/RedPandaIDE.pro
+++ b/RedPandaIDE/RedPandaIDE.pro
@@ -10,7 +10,7 @@ isEmpty(APP_NAME) {
}
isEmpty(APP_VERSION) {
- APP_VERSION=0.14.4
+ APP_VERSION=0.14.5
}
isEmpty(PREFIX) {
diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts
index 3c675f8b..e512d01d 100644
--- a/RedPandaIDE/RedPandaIDE_zh_CN.ts
+++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts
@@ -2089,11 +2089,26 @@ Are you really want to continue?
+
+ 在...中打开每一个文件:
+
+
+
+
+ 独立的小熊猫C++程序进程
+
+
+
+
+ 同一个小熊猫C++程序进程
+
+
+
文件类型:
-
+
Just check or uncheck for which file types RedPand C++ wil be registered as the default application to open them ...
选择想要使用小熊猫C++打开的文件类型(可能需要管理员权限)
@@ -2383,18 +2398,18 @@ Are you really want to continue?
FileAssociationModel
-
+
注册文件类型关联失败
-
-
+
+
没有权限进行文件类型注册!
-
+
注册文件类型失败
@@ -3740,18 +3755,18 @@ Are you really want to continue?
MainWindow
-
+
小熊猫C++
-
-
-
-
-
+
+
+
+
+
编译器
@@ -3825,7 +3840,7 @@ Are you really want to continue?
-
+
调试主控台
@@ -3959,8 +3974,8 @@ Are you really want to continue?
-
-
+
+
编译
@@ -4022,9 +4037,9 @@ Are you really want to continue?
-
-
-
+
+
+
复制
@@ -4035,7 +4050,7 @@ Are you really want to continue?
-
+
粘贴
@@ -4046,8 +4061,8 @@ Are you really want to continue?
-
-
+
+
选择全部
@@ -4167,14 +4182,14 @@ Are you really want to continue?
-
+
试题集
-
+
新建试题集
@@ -4193,14 +4208,14 @@ Are you really want to continue?
-
+
保存试题集
-
+
载入试题集
@@ -4236,7 +4251,7 @@ Are you really want to continue?
-
+
试题
@@ -4539,7 +4554,7 @@ Are you really want to continue?
-
+
删除所有断点
@@ -4640,7 +4655,7 @@ Are you really want to continue?
-
+
重命名符号
@@ -4661,13 +4676,13 @@ Are you really want to continue?
-
+
导出为RTF
-
+
导出为HTML
@@ -4770,6 +4785,11 @@ Are you really want to continue?
推送(Push)
+
+
+
+ 隐藏不支持的文件
+
工具窗口栏
@@ -4911,7 +4931,7 @@ Are you really want to continue?
运行参数...
-
+
文件编码
@@ -4921,32 +4941,32 @@ Are you really want to continue?
文件历史
-
-
-
-
-
-
+
+
+
+
+
+
正在调试
-
-
-
-
-
-
+
+
+
+
+
+
正在运行
-
-
-
-
-
-
+
+
+
+
+
+
正在编译
@@ -4955,178 +4975,178 @@ Are you really want to continue?
行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5
-
+
Line: %1 Col: %2 Selected: %3 Lines: %4 Length: %5
行: %1 列: %2 已选择 :%3 总行数: %4 总长度: %5
-
+
只读
-
+
插入
-
+
覆写
-
+
关闭项目
-
+
你确定要关闭'%1'吗?
-
-
+
+
确认
-
-
-
+
+
+
源文件尚未编译。
-
-
+
+
现在编译?
-
-
+
+
源文件比可执行程序新。
-
+
重新编译?
-
+
无编译器设置
-
+
没有配置编译器设置。
-
+
无法启动调试器
-
-
+
+
启用调试参数
-
-
+
+
当前编译设置中未启用调试选项(-g3),或启用了信息剥除选项(-s)<br /><br/>是否纠正这一问题?
-
+
项目尚未构建
-
+
项目尚未构建。是否构建?
-
+
宿主程序不存在
-
+
动态链接库(DLL)需要一个宿主程序来运行。
-
+
但它不存在。
-
+
宿主程序不存在
-
+
宿主程序'%1'不存在。
-
+
重新编译?
-
-
+
+
保存上次打开信息失败
-
+
无法删除旧上次打开信息文件'%1'
-
+
无法保存上次打开信息文件'%1'
-
+
载入上次打开信息失败
-
+
无法载入上次打开信息文件'%1'
-
+
打开源代码文件
-
+
显示详细调试器日志
-
+
全部复制
-
-
-
+
+
+
清除
@@ -5142,7 +5162,7 @@ Are you really want to continue?
-
+
试题集%1
@@ -5163,68 +5183,68 @@ Are you really want to continue?
或者选择使用其他的网络端口。
-
-
+
+
重新构建项目
-
-
+
+
项目已经被修改过,是否需要重新构建?
-
+
自动保存出错
-
+
自动保存"%1"到"%2"失败:%3
-
+
试题属性...
-
+
设置试题集名称
-
+
试题集名称:
-
+
删除
-
+
删除全部书签
-
+
修改描述
-
-
-
+
+
+
书签描述
-
-
-
+
+
+
描述:
@@ -5233,354 +5253,354 @@ Are you really want to continue?
在调试主控台中显示调试器输出
-
+
清除这次搜索
-
+
删除所有搜索
-
+
断点条件...
-
+
断点条件
-
+
输入当前断点的生效条件:
-
+
Remove all breakpoints
删除所有断点
-
+
删除当前断点
-
+
重命名文件
-
-
+
+
添加文件夹
-
+
新文件夹
-
+
文件夹:
-
+
重命名
-
+
删除文件夹
-
+
切换为普通视图
-
+
切换为自定义视图
-
+
按类型排序
-
+
按名称排序
-
+
显示继承的成员
-
+
跳转到声明处
-
+
跳转到定义处
-
-
-
+
+
+
新建文件夹
-
-
-
-
+
+
+
+
删除
-
+
在编辑器中打开
-
+
使用外部程序打开
-
+
在终端中打开
-
+
在Windows浏览器中打开
-
+
字符集
-
+
已自动保存%1个文件
-
+
设置答案源代码...
-
+
选择其他文件...
-
+
选择答案源代码文件
-
+
C/C++Source Files (*.c *.cpp *.cc *.cxx
C/C++源代码文件 (*.c *.cpp *.cc *.cxx)
-
+
你真的要删除%1吗?
-
+
你真的要删除%1个文件吗?
-
+
保存项目
-
+
项目'%1'有改动。
-
-
+
+
需要保存吗?
-
-
+
+
文件已发生变化
-
+
新建项目文件?
-
+
您是否要将新建的文件加入项目?
-
-
-
-
+
+
+
+
保存失败
-
+
改变项目编译器配置集
-
+
改变项目的编译器配置集会导致所有的自定义编译器选项被重置。
-
+
你真的想要做那些吗?
-
+
您真的要清除该文件的所有断点吗?
-
+
新建项目
-
+
关闭'%1'以打开新项目?
-
+
文件夹不存在
-
+
文件夹'%1'不存在。是否创建?
-
+
无法创建文件夹
-
+
创建文件夹'%1'失败。
-
+
-
+
文件夹%1不是空的。
-
+
你真的要删除它吗?
-
+
无法提交
-
+
Git需要用信息进行提交。
-
+
选择工作文件夹
-
-
+
+
头文件已存在
-
-
+
+
头文件"%1"已存在!
-
+
源文件已存在!
-
+
源文件"%1"已存在!
-
+
无法提交!
-
+
下列文件处于冲突状态,请解决后重新添加和提交:
-
+
提交信息
-
+
提交信息:
-
+
提交失败
-
+
提交信息不能为空!
@@ -5589,125 +5609,125 @@ Are you really want to continue?
小熊猫Dev-C++项目文件 (*.dev)
-
+
新建项目失败
-
+
无法使用模板创建项目
-
+
删除文件
-
+
同时从硬盘上删除文件?
-
+
无标题
-
+
新的项目文件名
-
+
文件名:
-
+
文件已存在!
-
+
文件'%1'已经存在!
-
+
添加到项目
-
+
小熊猫C++项目文件(*.dev)
-
+
重命名出错
-
+
符号'%1'在系统头文件中定义,无法修改。
-
+
新名称
-
-
+
+
替换出错
-
+
无法打开文件'%1'进行替换!
-
+
内容和上次查找时不一致。
-
+
RTF格式文件 (*.rtf)
-
+
HTML文件 (*.html)
-
+
当前的试题集不是空的。
-
+
试题%1
-
-
+
+
试题集文件 (*.pbs)
-
+
载入失败
-
-
+
+
试题案例%1
@@ -5718,15 +5738,15 @@ Are you really want to continue?
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
错误
@@ -5736,92 +5756,92 @@ Are you really want to continue?
项目历史
-
+
载入主题失败
-
-
+
+
清除历史
-
-
+
+
版本控制
-
+
磁盘文件'%1'已被修改。
-
+
是否重新读取它的内容?
-
+
磁盘文件'%1'已被删除。
-
+
是否保持它在小熊猫C++中打开的编辑窗口?
-
+
打开
-
+
编译失败
-
+
运行失败
-
-
+
+
确认转换
-
-
+
+
当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗?
-
+
新监视表达式
-
+
输入监视表达式
-
+
(%1/%2)正在解析文件"%3"
-
-
+
+
完成%1个文件的解析,用时%2秒
-
+
(每秒%1个文件)
@@ -6792,7 +6812,7 @@ Are you really want to continue?
QApplication
-
+
错误
@@ -6846,23 +6866,23 @@ Are you really want to continue?
-
-
+
+
错误
-
+
无法创建配置文件夹"%1"
-
+
无法写入配置文件夹"%1"
-
+
无法载入自动链接设置
@@ -7956,7 +7976,7 @@ Are you really want to continue?
自动链接
-
+
@@ -8032,15 +8052,15 @@ Are you really want to continue?
杂项
-
-
+
+
程序运行
-
+
试题集
diff --git a/RedPandaIDE/iconsmanager.cpp b/RedPandaIDE/iconsmanager.cpp
index 3a1911c7..a802d7c4 100644
--- a/RedPandaIDE/iconsmanager.cpp
+++ b/RedPandaIDE/iconsmanager.cpp
@@ -95,6 +95,7 @@ void IconsManager::updateActionIcons(const QString& iconSet, int size)
mIconPixmaps.insert(ACTION_MISC_VALIDATE, createSVGIcon(iconFolder+"00Misc-10Check.svg",size,size));
mIconPixmaps.insert(ACTION_MISC_RENAME, createSVGIcon(iconFolder+"00Misc-11Rename.svg",size,size));
mIconPixmaps.insert(ACTION_MISC_HELP, createSVGIcon(iconFolder+"00Misc-12Help.svg",size,size));
+ mIconPixmaps.insert(ACTION_MISC_FILTER, createSVGIcon(iconFolder+"00Misc-13Filter.svg",size,size));
mIconPixmaps.insert(ACTION_FILE_NEW, createSVGIcon(iconFolder+"01File-01New.svg",size,size));
mIconPixmaps.insert(ACTION_FILE_OPEN, createSVGIcon(iconFolder+"01File-02Open.svg",size,size));
diff --git a/RedPandaIDE/iconsmanager.h b/RedPandaIDE/iconsmanager.h
index 797983da..fad575b3 100644
--- a/RedPandaIDE/iconsmanager.h
+++ b/RedPandaIDE/iconsmanager.h
@@ -112,6 +112,7 @@ public:
ACTION_MISC_VALIDATE,
ACTION_MISC_RENAME,
ACTION_MISC_HELP,
+ ACTION_MISC_FILTER,
ACTION_FILE_NEW,
ACTION_FILE_OPEN,
diff --git a/RedPandaIDE/main.cpp b/RedPandaIDE/main.cpp
index 39a01037..8def0b91 100644
--- a/RedPandaIDE/main.cpp
+++ b/RedPandaIDE/main.cpp
@@ -38,9 +38,14 @@
#include "widgets/choosethemedialog.h"
#include "thememanager.h"
#ifdef Q_OS_WIN
+#include
#include
+#include
+#include
+#include
#endif
+QString getSettingFilename(const QString& filepath, bool& firstRun);
#ifdef Q_OS_WIN
class WindowLogoutEventFilter : public QAbstractNativeEventFilter {
@@ -48,6 +53,61 @@ class WindowLogoutEventFilter : public QAbstractNativeEventFilter {
public:
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
};
+#define WM_USER_OPEN_FILE (WM_USER+1)
+HWND prevAppInstance = NULL;
+BOOL CALLBACK GetPreviousInstanceCallback(HWND hwnd, LPARAM param){
+ BOOL result = TRUE;
+ WCHAR buffer[4098];
+ HINSTANCE hWindowModule = (HINSTANCE)GetWindowLongPtr(hwnd,GWLP_HINSTANCE);
+
+ if (hWindowModule==0)
+ return result;
+
+ DWORD processID;
+
+ // Get the ID of the process that created this window
+ GetWindowThreadProcessId(hwnd,&processID);
+ if (processID==0)
+ return result;
+
+ // Get the process associated with the ID
+ HANDLE hWindowProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID);
+ if (hWindowProcess == 0)
+ return result;
+
+ // Get its module filename
+ if (GetModuleFileNameExW(hWindowProcess, hWindowModule, buffer, sizeof(buffer)) == 0)
+ return TRUE;
+
+ CloseHandle(hWindowProcess); // not needed anymore
+ WCHAR * compareFilename=(WCHAR*)param;
+ QString s1=QString::fromWCharArray(compareFilename);
+ QString s2=QString::fromWCharArray(buffer);
+
+ //Is from the "same" application?
+ if (QString::compare(s1,s2,PATH_SENSITIVITY)==0) {
+ //found, stop EnumWindows loop
+ prevAppInstance = hwnd;
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+HWND getPreviousInstance() {
+ WCHAR buffer[4098];
+ //ShowMessage('ERROR_ALREADY_EXISTS');
+ // Store our own module filename
+ if (GetModuleFileNameW(GetModuleHandle(NULL), buffer, sizeof(buffer)) == 0)
+ return NULL;
+
+ // If that's the case, walk all top level windows and find the previous instance
+ // At this point, the program that created the mutex might not have created its MainForm yet
+ if (EnumWindows(GetPreviousInstanceCallback, LPARAM(buffer))==0) {
+ return prevAppInstance;
+ } else
+ return NULL;
+}
bool WindowLogoutEventFilter::nativeEventFilter(const QByteArray & /*eventType*/, void *message, long *result){
MSG * pMsg = static_cast(message);
@@ -72,6 +132,46 @@ bool WindowLogoutEventFilter::nativeEventFilter(const QByteArray & /*eventType*/
pMainWindow->updateDPI(oldDPI,newDPI);
break;
}
+ case WM_USER_OPEN_FILE: {
+ QSharedMemory sharedMemory("RedPandaCpp/openfiles");
+ if (sharedMemory.attach()) {
+ QBuffer buffer;
+ QDataStream in(&buffer);
+ QStringList files;
+ sharedMemory.lock();
+ buffer.setData((char*)sharedMemory.constData(), sharedMemory.size());
+ buffer.open(QBuffer::ReadOnly);
+ in >> files;
+ sharedMemory.unlock();
+ pMainWindow->openFiles(files);
+ sharedMemory.detach();
+ }
+ return true;
+ }
+ }
+ return false;
+}
+
+bool sendFilesToInstance() {
+ HWND prevInstance = getPreviousInstance();
+ if (prevInstance != NULL) {
+ QSharedMemory sharedMemory("RedPandaCpp/openfiles");
+ QBuffer buffer;
+ buffer.open(QBuffer::ReadWrite);
+ QDataStream out(&buffer);
+ QStringList filesToOpen = qApp->arguments();
+ filesToOpen.pop_front();
+ out<=2) {
+#ifdef Q_OS_WIN
+ if (sendFilesToInstance()) {
+ tempFile.remove();
+ return 0;
+ }
+#endif
+ }
+ }
+ }
//Translation must be loaded first
QTranslator trans,transQt;
@@ -138,8 +267,10 @@ int main(int argc, char *argv[])
if (!isGreenEdition()) {
QDir::setCurrent(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0]);
}
- if (settingFilename.isEmpty())
+ if (settingFilename.isEmpty()) {
+ tempFile.remove();
return -1;
+ }
{
QSettings languageSetting(settingFilename,QSettings::IniFormat);
@@ -230,6 +361,7 @@ int main(int argc, char *argv[])
WindowLogoutEventFilter filter;
app.installNativeEventFilter(&filter);
#endif
+ tempFile.remove();
int retCode = app.exec();
QString configDir = pSettings->dirs().config();
// save settings
@@ -242,6 +374,7 @@ int main(int argc, char *argv[])
}
return retCode;
} catch (BaseError e) {
+ tempFile.remove();
QMessageBox::critical(nullptr,QApplication::tr("Error"),e.reason());
return -1;
}
diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp
index 4b09bad5..63e260e6 100644
--- a/RedPandaIDE/mainwindow.cpp
+++ b/RedPandaIDE/mainwindow.cpp
@@ -296,6 +296,9 @@ MainWindow::MainWindow(QWidget *parent)
ui->treeFiles->setModel(&mFileSystemModel);
mFileSystemModel.setReadOnly(false);
mFileSystemModel.setIconProvider(&mFileSystemModelIconProvider);
+
+ mFileSystemModel.setNameFilters(pSystemConsts->defaultFileNameFilters());
+ mFileSystemModel.setNameFilterDisables(false);
setFilesViewRoot(pSettings->environment().currentFolder());
for (int i=1;itreeFiles->hideColumn(i);
@@ -1366,6 +1369,7 @@ void MainWindow::updateActionIcons()
mFilesView_Open->setIcon(pIconsManager->getIcon(IconsManager::ACTION_FILE_OPEN));
mFilesView_OpenInTerminal->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_TERM));
mFilesView_OpenInExplorer->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_FOLDER));
+ ui->actionFilesView_Hide_Non_Support_Files->setIcon(pIconsManager->getIcon(IconsManager::ACTION_MISC_FILTER));
//problem view
pIconsManager->setIcon(ui->btnNewProblemSet, IconsManager::ACTION_PROBLEM_SET);
@@ -2796,7 +2800,7 @@ void MainWindow::buildContextMenus()
//toolbar for files view
{
- QHBoxLayout* hlayout = dynamic_cast( ui->panelFiles->layout());
+ QHBoxLayout* hlayout = dynamic_cast(ui->panelFiles->layout());
QToolButton * toolButton;
int size = pointToPixel(pSettings->environment().interfaceFontSize());
QSize iconSize(size,size);
@@ -2808,6 +2812,15 @@ void MainWindow::buildContextMenus()
toolButton->setIconSize(iconSize);
toolButton->setDefaultAction(ui->actionLocate_in_Files_View);
hlayout->addWidget(toolButton);
+ QFrame * vLine = new QFrame();
+ vLine->setFrameShape(QFrame::VLine);
+ vLine->setFrameShadow(QFrame::Sunken);
+ hlayout->addWidget(vLine);
+ toolButton = new QToolButton;
+ toolButton->setIconSize(iconSize);
+ toolButton->setDefaultAction(ui->actionFilesView_Hide_Non_Support_Files);
+ ui->actionFilesView_Hide_Non_Support_Files->setChecked(pSettings->environment().hideNonSupportFilesInFileView());
+ hlayout->addWidget(toolButton);
}
//context menu signal for class browser
@@ -3207,6 +3220,8 @@ void MainWindow::onFilesViewContextMenu(const QPoint &pos)
menu.addSeparator();
menu.addAction(mFilesView_OpenInTerminal);
menu.addAction(mFilesView_OpenInExplorer);
+ menu.addSeparator();
+ menu.addAction(ui->actionFilesView_Hide_Non_Support_Files);
QString path = mFileSystemModel.filePath(ui->treeFiles->currentIndex());
QFileInfo info(path);
mFilesView_Open->setEnabled(info.isFile());
@@ -7062,3 +7077,14 @@ void MainWindow::on_actionGit_Push_triggered()
}
}
+
+void MainWindow::on_actionFilesView_Hide_Non_Support_Files_toggled(bool /* arg1 */)
+{
+ mFileSystemModel.setNameFilterDisables(!ui->actionFilesView_Hide_Non_Support_Files->isChecked());
+ if (pSettings->environment().hideNonSupportFilesInFileView()
+ != ui->actionFilesView_Hide_Non_Support_Files->isChecked()) {
+ pSettings->environment().setHideNonSupportFilesInFileView(ui->actionFilesView_Hide_Non_Support_Files->isChecked());
+ pSettings->environment().save();
+ }
+}
+
diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h
index fb20b1f7..deb30024 100644
--- a/RedPandaIDE/mainwindow.h
+++ b/RedPandaIDE/mainwindow.h
@@ -604,6 +604,8 @@ private slots:
void on_actionGit_Push_triggered();
+ void on_actionFilesView_Hide_Non_Support_Files_toggled(bool arg1);
+
private:
Ui::MainWindow *ui;
EditorList *mEditorList;
diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui
index 5ad7ef02..f0c99c98 100644
--- a/RedPandaIDE/mainwindow.ui
+++ b/RedPandaIDE/mainwindow.ui
@@ -1422,7 +1422,7 @@
0
0
1114
- 25
+ 26
diff --git a/RedPandaIDE/resources/iconsets/bluesky/actions/00Misc-13Filter.svg b/RedPandaIDE/resources/iconsets/bluesky/actions/00Misc-13Filter.svg
new file mode 100644
index 00000000..d4d1286f
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/bluesky/actions/00Misc-13Filter.svg
@@ -0,0 +1,73 @@
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/contrast/actions/00Misc-13Filter.svg b/RedPandaIDE/resources/iconsets/contrast/actions/00Misc-13Filter.svg
new file mode 100644
index 00000000..0e336b6a
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/contrast/actions/00Misc-13Filter.svg
@@ -0,0 +1,73 @@
+
+
+
+
diff --git a/RedPandaIDE/resources/iconsets/newlook/actions/00Misc-13Filter.svg b/RedPandaIDE/resources/iconsets/newlook/actions/00Misc-13Filter.svg
new file mode 100644
index 00000000..06ffb958
--- /dev/null
+++ b/RedPandaIDE/resources/iconsets/newlook/actions/00Misc-13Filter.svg
@@ -0,0 +1,73 @@
+
+
+
+
diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp
index d89b376d..4c6364e3 100644
--- a/RedPandaIDE/settings.cpp
+++ b/RedPandaIDE/settings.cpp
@@ -2937,6 +2937,8 @@ void Settings::Environment::doLoad()
mTerminalPath = stringValue("terminal_path","/usr/bin/x-terminal-emulator");
mAStylePath = includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"astyle";
#endif
+ mHideNonSupportFilesInFileView=boolValue("hide_non_support_files_file_view",true);
+ mOpenFilesInSingleInstance = boolValue("open_files_in_single_instance",false);
}
int Settings::Environment::interfaceFontSize() const
@@ -3029,6 +3031,26 @@ void Settings::Environment::setUseCustomTheme(bool newUseCustomTheme)
mUseCustomTheme = newUseCustomTheme;
}
+bool Settings::Environment::hideNonSupportFilesInFileView() const
+{
+ return mHideNonSupportFilesInFileView;
+}
+
+void Settings::Environment::setHideNonSupportFilesInFileView(bool newHideNonSupportFilesInFileView)
+{
+ mHideNonSupportFilesInFileView = newHideNonSupportFilesInFileView;
+}
+
+bool Settings::Environment::openFilesInSingleInstance() const
+{
+ return mOpenFilesInSingleInstance;
+}
+
+void Settings::Environment::setOpenFilesInSingleInstance(bool newOpenFilesInSingleInstance)
+{
+ mOpenFilesInSingleInstance = newOpenFilesInSingleInstance;
+}
+
void Settings::Environment::doSave()
{
//Appearence
@@ -3046,6 +3068,9 @@ void Settings::Environment::doSave()
saveValue("terminal_path",mTerminalPath);
saveValue("asyle_path",mAStylePath);
#endif
+
+ saveValue("hide_non_support_files_file_view",mHideNonSupportFilesInFileView);
+ saveValue("open_files_in_single_instance",mOpenFilesInSingleInstance);
}
QString Settings::Environment::interfaceFont() const
diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h
index 5ad71a1a..11a4ad1a 100644
--- a/RedPandaIDE/settings.h
+++ b/RedPandaIDE/settings.h
@@ -528,6 +528,12 @@ public:
bool useCustomTheme() const;
void setUseCustomTheme(bool newUseCustomTheme);
+ bool hideNonSupportFilesInFileView() const;
+ void setHideNonSupportFilesInFileView(bool newHideNonSupportFilesInFileView);
+
+ bool openFilesInSingleInstance() const;
+ void setOpenFilesInSingleInstance(bool newOpenFilesInSingleInstance);
+
private:
//Appearence
@@ -543,6 +549,8 @@ public:
QString mDefaultOpenFolder;
QString mTerminalPath;
QString mAStylePath;
+ bool mHideNonSupportFilesInFileView;
+ bool mOpenFilesInSingleInstance;
// _Base interface
protected:
void doSave() override;
diff --git a/RedPandaIDE/settingsdialog/environmentfileassociationwidget.cpp b/RedPandaIDE/settingsdialog/environmentfileassociationwidget.cpp
index 7d9deb14..a7f84182 100644
--- a/RedPandaIDE/settingsdialog/environmentfileassociationwidget.cpp
+++ b/RedPandaIDE/settingsdialog/environmentfileassociationwidget.cpp
@@ -49,6 +49,10 @@ EnvironmentFileAssociationWidget::~EnvironmentFileAssociationWidget()
void EnvironmentFileAssociationWidget::doLoad()
{
+ if (pSettings->environment().openFilesInSingleInstance())
+ ui->rbOpenInSingleApplication->setChecked(true);
+ else
+ ui->rbOpenInMultiApplication->setChecked(true);
mModel.updateAssociationStates();
}
@@ -56,6 +60,8 @@ void EnvironmentFileAssociationWidget::doSave()
{
mModel.saveAssociations();
mModel.updateAssociationStates();
+ pSettings->environment().setOpenFilesInSingleInstance(ui->rbOpenInSingleApplication->isChecked());
+ pSettings->environment().save();
}
FileAssociationModel::FileAssociationModel(QObject *parent) : QAbstractListModel(parent)
diff --git a/RedPandaIDE/settingsdialog/environmentfileassociationwidget.ui b/RedPandaIDE/settingsdialog/environmentfileassociationwidget.ui
index 6ec76ee1..a46ab780 100644
--- a/RedPandaIDE/settingsdialog/environmentfileassociationwidget.ui
+++ b/RedPandaIDE/settingsdialog/environmentfileassociationwidget.ui
@@ -7,13 +7,36 @@
0
0
708
- 350
+ 459
Form
+ -
+
+
+ Open Each File In
+
+
+
-
+
+
+ Independant Red Panda C++ applications
+
+
+
+ -
+
+
+ The same Red Panda C++ application
+
+
+
+
+
+
-
diff --git a/RedPandaIDE/systemconsts.cpp b/RedPandaIDE/systemconsts.cpp
index 769c3c08..2322aaa8 100644
--- a/RedPandaIDE/systemconsts.cpp
+++ b/RedPandaIDE/systemconsts.cpp
@@ -59,6 +59,22 @@ SystemConsts::SystemConsts(): mDefaultFileFilters()
}
std::sort(codecNames.begin(),codecNames.end());
mCodecNames.append(codecNames);
+
+ mDefaultFileNameFilters.append("*.c");
+ mDefaultFileNameFilters.append("*.cpp");
+ mDefaultFileNameFilters.append("*.cc");
+ mDefaultFileNameFilters.append("*.C");
+ mDefaultFileNameFilters.append("*.cxx");
+ mDefaultFileNameFilters.append("*.cxx");
+ mDefaultFileNameFilters.append("*.h");
+ mDefaultFileNameFilters.append("*.hpp");
+ mDefaultFileNameFilters.append("*.hxx");
+ mDefaultFileNameFilters.append(".gitignore");
+ mDefaultFileNameFilters.append("*.vs");
+ mDefaultFileNameFilters.append("*.fs");
+ mDefaultFileNameFilters.append("*.txt");
+ mDefaultFileNameFilters.append("*.md");
+ mDefaultFileNameFilters.append("*.dev");
}
const QStringList &SystemConsts::defaultFileFilters() const noexcept
@@ -91,6 +107,11 @@ void SystemConsts::addFileFilter(QStringList& filters, const QString &name, cons
filters.append(name+ " (" + fileExtensions+")");
}
+const QStringList &SystemConsts::defaultFileNameFilters() const
+{
+ return mDefaultFileNameFilters;
+}
+
const QStringList &SystemConsts::codecNames() const
{
return mCodecNames;
diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h
index 498821d6..8f9e75fb 100644
--- a/RedPandaIDE/systemconsts.h
+++ b/RedPandaIDE/systemconsts.h
@@ -109,10 +109,13 @@ public:
const QStringList &codecNames() const;
+ const QStringList &defaultFileNameFilters() const;
+
private:
void addFileFilter(QStringList& filters, const QString& name, const QString& fileExtensions);
QStringList mDefaultFileFilters;
QStringList mIconFileFilters;
+ QStringList mDefaultFileNameFilters;
QStringList mCodecNames;
};
diff --git a/Red_Panda_CPP.pro b/Red_Panda_CPP.pro
index 015775a5..ee170624 100644
--- a/Red_Panda_CPP.pro
+++ b/Red_Panda_CPP.pro
@@ -17,7 +17,7 @@ SUBDIRS += \
APP_NAME = RedPandaCPP
-APP_VERSION = 0.14.4
+APP_VERSION = 0.14.5
linux: {