- enhancement: rename in files view's context menu
- enhancement: delete in files view's context menu - change: drag&drop in files view default to move
This commit is contained in:
parent
ef715b2c34
commit
73fda980bc
3
NEWS.md
3
NEWS.md
|
@ -4,6 +4,9 @@ Red Panda C++ Version 1.1.0
|
||||||
- enhancement: When the editing files is changed by other applications, only show one notification dialog for each file.
|
- enhancement: When the editing files is changed by other applications, only show one notification dialog for each file.
|
||||||
- fix: c files added to a project will be compiled as c++ file.
|
- fix: c files added to a project will be compiled as c++ file.
|
||||||
- enhancement: restore caret position after batch replace
|
- enhancement: restore caret position after batch replace
|
||||||
|
- enhancement: rename in files view's context menu
|
||||||
|
- enhancement: delete in files view's context menu
|
||||||
|
- change: drag&drop in files view default to move
|
||||||
|
|
||||||
Red Panda C++ Version 1.0.10
|
Red Panda C++ Version 1.0.10
|
||||||
- fix: modify watch doesn't work
|
- fix: modify watch doesn't work
|
||||||
|
|
|
@ -2533,6 +2533,12 @@ void MainWindow::buildContextMenus()
|
||||||
connect(mFilesView_CreateFile, &QAction::triggered,
|
connect(mFilesView_CreateFile, &QAction::triggered,
|
||||||
this, &MainWindow::onFilesViewCreateFile);
|
this, &MainWindow::onFilesViewCreateFile);
|
||||||
|
|
||||||
|
mFilesView_Rename = createActionFor(
|
||||||
|
tr("Rename"),
|
||||||
|
ui->treeFiles);
|
||||||
|
connect(mFilesView_Rename, &QAction::triggered,
|
||||||
|
this, &MainWindow::onFilesViewRename);
|
||||||
|
|
||||||
mFilesView_RemoveFile = createActionFor(
|
mFilesView_RemoveFile = createActionFor(
|
||||||
tr("Delete"),
|
tr("Delete"),
|
||||||
ui->treeFiles);
|
ui->treeFiles);
|
||||||
|
@ -2994,6 +3000,8 @@ void MainWindow::onFilesViewContextMenu(const QPoint &pos)
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
menu.addAction(mFilesView_CreateFolder);
|
menu.addAction(mFilesView_CreateFolder);
|
||||||
menu.addAction(mFilesView_CreateFile);
|
menu.addAction(mFilesView_CreateFile);
|
||||||
|
menu.addAction(mFilesView_RemoveFile);
|
||||||
|
menu.addAction(mFilesView_Rename);
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
if (pSettings->vcs().gitOk()) {
|
if (pSettings->vcs().gitOk()) {
|
||||||
if (hasRepository) {
|
if (hasRepository) {
|
||||||
|
@ -3017,6 +3025,8 @@ void MainWindow::onFilesViewContextMenu(const QPoint &pos)
|
||||||
mFilesView_OpenWithExternal->setEnabled(info.isFile());
|
mFilesView_OpenWithExternal->setEnabled(info.isFile());
|
||||||
mFilesView_OpenInTerminal->setEnabled(!path.isEmpty());
|
mFilesView_OpenInTerminal->setEnabled(!path.isEmpty());
|
||||||
mFilesView_OpenInExplorer->setEnabled(!path.isEmpty());
|
mFilesView_OpenInExplorer->setEnabled(!path.isEmpty());
|
||||||
|
mFilesView_Rename->setEnabled(!path.isEmpty());
|
||||||
|
mFilesView_RemoveFile->setEnabled(!path.isEmpty() || !ui->treeFiles->selectionModel()->selectedRows().isEmpty());
|
||||||
|
|
||||||
if (pSettings->vcs().gitOk() && hasRepository) {
|
if (pSettings->vcs().gitOk() && hasRepository) {
|
||||||
mFileSystemModelIconProvider.update();
|
mFileSystemModelIconProvider.update();
|
||||||
|
@ -3497,6 +3507,13 @@ void MainWindow::onFilesViewRemoveFiles()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::onFilesViewRename() {
|
||||||
|
QModelIndex index = ui->treeFiles->currentIndex();
|
||||||
|
if (!index.isValid())
|
||||||
|
return ;
|
||||||
|
ui->treeFiles->edit(index);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::onProblemProperties()
|
void MainWindow::onProblemProperties()
|
||||||
{
|
{
|
||||||
QModelIndex idx = ui->lstProblemSet->currentIndex();
|
QModelIndex idx = ui->lstProblemSet->currentIndex();
|
||||||
|
@ -3657,9 +3674,11 @@ void MainWindow::onFilesViewOpen()
|
||||||
{
|
{
|
||||||
QString path = mFileSystemModel.filePath(ui->treeFiles->currentIndex());
|
QString path = mFileSystemModel.filePath(ui->treeFiles->currentIndex());
|
||||||
if (!path.isEmpty() && QFileInfo(path).isFile()) {
|
if (!path.isEmpty() && QFileInfo(path).isFile()) {
|
||||||
Editor *editor=mEditorList->getEditorByFilename(path);
|
if (getFileType(path)==FileType::Project) {
|
||||||
if (editor)
|
openProject(path);
|
||||||
editor->activate();
|
} else {
|
||||||
|
openFile(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6703,6 +6722,8 @@ void MainWindow::on_actionLocate_in_Files_View_triggered()
|
||||||
|
|
||||||
void MainWindow::on_treeFiles_doubleClicked(const QModelIndex &index)
|
void MainWindow::on_treeFiles_doubleClicked(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
|
if (index!=ui->treeFiles->currentIndex())
|
||||||
|
return;
|
||||||
QString filepath = mFileSystemModel.filePath(index);
|
QString filepath = mFileSystemModel.filePath(index);
|
||||||
QFileInfo file(filepath);
|
QFileInfo file(filepath);
|
||||||
if (file.isFile()) {
|
if (file.isFile()) {
|
||||||
|
|
|
@ -299,6 +299,7 @@ private slots:
|
||||||
void onFilesViewCreateFolder();
|
void onFilesViewCreateFolder();
|
||||||
void onFilesViewCreateFile();
|
void onFilesViewCreateFile();
|
||||||
void onFilesViewRemoveFiles();
|
void onFilesViewRemoveFiles();
|
||||||
|
void onFilesViewRename();
|
||||||
void onProblemProperties();
|
void onProblemProperties();
|
||||||
void onProblemOpenSource();
|
void onProblemOpenSource();
|
||||||
void onLableProblemSetContextMenuRequested();
|
void onLableProblemSetContextMenuRequested();
|
||||||
|
@ -780,6 +781,7 @@ private:
|
||||||
QAction * mFilesView_CreateFolder;
|
QAction * mFilesView_CreateFolder;
|
||||||
QAction * mFilesView_CreateFile;
|
QAction * mFilesView_CreateFile;
|
||||||
QAction * mFilesView_RemoveFile;
|
QAction * mFilesView_RemoveFile;
|
||||||
|
QAction * mFilesView_Rename;
|
||||||
|
|
||||||
//action for debug console
|
//action for debug console
|
||||||
QAction * mDebugConsole_ShowDetailLog;
|
QAction * mDebugConsole_ShowDetailLog;
|
||||||
|
|
|
@ -463,7 +463,7 @@
|
||||||
<enum>QTabWidget::West</enum>
|
<enum>QTabWidget::West</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="usesScrollButtons">
|
<property name="usesScrollButtons">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
@ -535,7 +535,7 @@
|
||||||
<enum>QAbstractItemView::DragDrop</enum>
|
<enum>QAbstractItemView::DragDrop</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="defaultDropAction">
|
<property name="defaultDropAction">
|
||||||
<enum>Qt::CopyAction</enum>
|
<enum>Qt::MoveAction</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="selectionMode">
|
<property name="selectionMode">
|
||||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||||
|
|
|
@ -74,6 +74,9 @@ SystemConsts::SystemConsts(): mDefaultFileFilters()
|
||||||
mDefaultFileNameFilters.append("*.vs");
|
mDefaultFileNameFilters.append("*.vs");
|
||||||
mDefaultFileNameFilters.append("*.fs");
|
mDefaultFileNameFilters.append("*.fs");
|
||||||
mDefaultFileNameFilters.append("*.txt");
|
mDefaultFileNameFilters.append("*.txt");
|
||||||
|
mDefaultFileNameFilters.append("*.in");
|
||||||
|
mDefaultFileNameFilters.append("*.out");
|
||||||
|
mDefaultFileNameFilters.append("*.dat");
|
||||||
mDefaultFileNameFilters.append("*.md");
|
mDefaultFileNameFilters.append("*.md");
|
||||||
mDefaultFileNameFilters.append("*.dev");
|
mDefaultFileNameFilters.append("*.dev");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue