diff --git a/src/lib/bookmarks/bookmarkstools.cpp b/src/lib/bookmarks/bookmarkstools.cpp index f5f9c5e88..fc8d1b56d 100644 --- a/src/lib/bookmarks/bookmarkstools.cpp +++ b/src/lib/bookmarks/bookmarkstools.cpp @@ -1,6 +1,6 @@ /* ============================================================ -* QupZilla - WebKit based browser -* Copyright (C) 2014 David Rosca +* QupZilla - Qt web browser +* Copyright (C) 2014-2017 David Rosca * * 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 #include #include +#include // 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);