Skip to content

Commit

Permalink
feat: Custom Task Turn to Main Line: dde-file-manager Clears Search H…
Browse files Browse the repository at this point in the history
…istory

Custom Task Turn to Main Line: dde-file-manager Clears Search History

Log: Custom Task Turn to Main Line: dde-file-manager Clears Search History
Task: https://pms.uniontech.com/bug-view-252515.html
  • Loading branch information
liyigang1 committed May 7, 2024
1 parent afeaf5a commit 6c376e6
Show file tree
Hide file tree
Showing 18 changed files with 2,527 additions and 213 deletions.
11 changes: 11 additions & 0 deletions assets/configs/org.deepin.dde.file-manager.search.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
"description":"Used to determine whether to enable full-text search",
"permissions":"readwrite",
"visibility":"private"
},
"displaySearchHistory": {
"value":true,
"serial":0,
"flags":[],
"name":"Display search history",
"name[zh_CN]":"显示搜索记录",
"description[zh_CN]":"用于判断是否显示搜索记录",
"description":"Used to determine whether to enable display search history",
"permissions":"readwrite",
"visibility":"private"
}
}
}
Expand Down
23 changes: 23 additions & 0 deletions src/dfm-base/utils/dialogmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,29 @@ int DialogManager::showUnableToVistDir(const QString &dir)
return code;
}

int DialogManager::showClearSearchHistories()
{
QString clearSearch = tr("Are you sure clear search histories?");
QStringList buttonTexts;
buttonTexts.append(tr("Cancel","button"));
buttonTexts.append(tr("Confirm","button"));

DDialog d;

if (!d.parentWidget()) {
d.setWindowFlags(d.windowFlags() | Qt::WindowStaysOnTopHint);
}
d.setIcon(QIcon::fromTheme("dialog-warning"));
d.setTitle(clearSearch);
d.addButton(buttonTexts[0], true, DDialog::ButtonNormal);
d.addButton(buttonTexts[1], false, DDialog::ButtonWarning);
d.setDefaultButton(1);
d.getButton(1)->setFocus();
d.moveToCenter();
int code = d.exec();
return code;
}

DFMBASE_NAMESPACE::GlobalEventType DialogManager::showBreakSymlinkDialog(const QString &targetName, const QUrl &linkfile)
{
DDialog d(qApp->activeWindow());
Expand Down
1 change: 1 addition & 0 deletions src/dfm-base/utils/dialogmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class DialogManager : public QObject
void showRenameBusyErrDialog();
int showRenameNameDotBeginDialog();
int showUnableToVistDir(const QString &dir);
int showClearSearchHistories();

// link file not exist
DFMBASE_NAMESPACE::GlobalEventType showBreakSymlinkDialog(const QString &targetName, const QUrl &linkfile);
Expand Down
Loading

0 comments on commit 6c376e6

Please sign in to comment.