mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Bookmarks: Warn when trying to open multiple bookmarks in tabs
Closes #2340
This commit is contained in:
parent
6f08f94e0f
commit
b05986bac3
|
@ -1,6 +1,6 @@
|
|||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2014 David Rosca <nowrep@gmail.com>
|
||||
* QupZilla - Qt web browser
|
||||
* Copyright (C) 2014-2017 David Rosca <nowrep@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
|
||||
|
@ -35,6 +35,7 @@
|
|||
#include <QPlainTextEdit>
|
||||
#include <QStyle>
|
||||
#include <QDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
// BookmarksFoldersMenu
|
||||
BookmarksFoldersMenu::BookmarksFoldersMenu(QWidget* parent)
|
||||
|
@ -325,6 +326,25 @@ void BookmarksTools::openFolderInTabs(BrowserWindow* window, BookmarkItem* folde
|
|||
Q_ASSERT(window);
|
||||
Q_ASSERT(folder->isFolder());
|
||||
|
||||
bool showWarning = folder->children().size() > 10;
|
||||
if (!showWarning) {
|
||||
foreach (BookmarkItem* child, folder->children()) {
|
||||
if (child->isFolder()) {
|
||||
showWarning = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (showWarning) {
|
||||
const auto button = QMessageBox::warning(window, Bookmarks::tr("Confirmation"),
|
||||
Bookmarks::tr("Are you sure you want to open all bookmarks from '%1' folder in tabs?").arg(folder->title()),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if (button != QMessageBox::Yes) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (BookmarkItem* child, folder->children()) {
|
||||
if (child->isUrl()) {
|
||||
openBookmarkInNewTab(window, child);
|
||||
|
|
Loading…
Reference in New Issue
Block a user