moved 3rd party code
This commit is contained in:
parent
6acbac4421
commit
edfb956cd9
@ -30,7 +30,7 @@
|
||||
<url type="donation">https://martinrotter.github.io/donate/</url>
|
||||
<content_rating type="oars-1.1" />
|
||||
<releases>
|
||||
<release version="3.9.0" date="2021-03-22"/>
|
||||
<release version="3.9.0" date="2021-03-23"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.0">
|
||||
<content_attribute id="violence-cartoon">none</content_attribute>
|
||||
|
@ -25,7 +25,7 @@
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "miscellaneous/simplecrypt/simplecrypt.h"
|
||||
#include "3rd-party/sc/simplecrypt.h"
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QCryptographicHash>
|
@ -58,7 +58,7 @@ FeedsModel::~FeedsModel() {
|
||||
QMimeData* FeedsModel::mimeData(const QModelIndexList& indexes) const {
|
||||
auto* mime_data = new QMimeData();
|
||||
QByteArray encoded_data;
|
||||
QDataStream stream(&encoded_data, QIODevice::WriteOnly);
|
||||
QDataStream stream(&encoded_data, QIODevice::OpenModeFlag::WriteOnly);
|
||||
|
||||
for (const QModelIndex& index : indexes) {
|
||||
if (index.column() != 0) {
|
||||
@ -99,7 +99,7 @@ bool FeedsModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
QDataStream stream(&dragged_items_data, QIODevice::ReadOnly);
|
||||
QDataStream stream(&dragged_items_data, QIODevice::OpenModeFlag::ReadOnly);
|
||||
|
||||
while (!stream.atEnd()) {
|
||||
quintptr pointer_to_item; stream >> pointer_to_item;
|
||||
|
@ -13,11 +13,11 @@
|
||||
FeedsProxyModel::FeedsProxyModel(FeedsModel* source_model, QObject* parent)
|
||||
: QSortFilterProxyModel(parent), m_sourceModel(source_model), m_selectedItem(nullptr), m_showUnreadOnly(false) {
|
||||
setObjectName(QSL("FeedsProxyModel"));
|
||||
setSortRole(Qt::EditRole);
|
||||
setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||
setSortRole(Qt::ItemDataRole::EditRole);
|
||||
setSortCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive);
|
||||
setFilterCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive);
|
||||
setFilterKeyColumn(-1);
|
||||
setFilterRole(Qt::EditRole);
|
||||
setFilterRole(Qt::ItemDataRole::EditRole);
|
||||
setDynamicSortFilter(true);
|
||||
setSourceModel(m_sourceModel);
|
||||
|
||||
@ -41,9 +41,9 @@ FeedsProxyModel::~FeedsProxyModel() {
|
||||
QModelIndexList FeedsProxyModel::match(const QModelIndex& start, int role, const QVariant& value, int hits, Qt::MatchFlags flags) const {
|
||||
QModelIndexList result;
|
||||
const int match_type = flags & 0x0F;
|
||||
const Qt::CaseSensitivity cs = Qt::CaseInsensitive;
|
||||
const bool recurse = (flags& Qt::MatchRecursive) > 0;
|
||||
const bool wrap = (flags& Qt::MatchWrap) > 0;
|
||||
const Qt::CaseSensitivity cs = Qt::CaseSensitivity::CaseInsensitive;
|
||||
const bool recurse = (flags& Qt::MatchFlag::MatchRecursive) > 0;
|
||||
const bool wrap = (flags& Qt::MatchFlag::MatchWrap) > 0;
|
||||
const bool all_hits = (hits == -1);
|
||||
QString entered_text;
|
||||
const QModelIndex p = parent(start);
|
||||
|
@ -342,19 +342,19 @@ QVariant MessagesModel::data(const QModelIndex& idx, int role) const {
|
||||
|
||||
case Qt::ItemDataRole::FontRole: {
|
||||
QModelIndex idx_read = index(idx.row(), MSG_DB_READ_INDEX);
|
||||
QVariant data_read = data(idx_read, Qt::EditRole);
|
||||
QVariant data_read = data(idx_read, Qt::ItemDataRole::EditRole);
|
||||
const bool is_bin = qobject_cast<RecycleBin*>(loadedItem()) != nullptr;
|
||||
bool is_deleted;
|
||||
|
||||
if (is_bin) {
|
||||
QModelIndex idx_del = index(idx.row(), MSG_DB_PDELETED_INDEX);
|
||||
|
||||
is_deleted = data(idx_del, Qt::EditRole).toBool();
|
||||
is_deleted = data(idx_del, Qt::ItemDataRole::EditRole).toBool();
|
||||
}
|
||||
else {
|
||||
QModelIndex idx_del = index(idx.row(), MSG_DB_DELETED_INDEX);
|
||||
|
||||
is_deleted = data(idx_del, Qt::EditRole).toBool();
|
||||
is_deleted = data(idx_del, Qt::ItemDataRole::EditRole).toBool();
|
||||
}
|
||||
|
||||
const bool striked = is_deleted;
|
||||
|
@ -14,12 +14,12 @@ MessagesProxyModel::MessagesProxyModel(MessagesModel* source_model, QObject* par
|
||||
: QSortFilterProxyModel(parent), m_sourceModel(source_model), m_showUnreadOnly(false) {
|
||||
setObjectName(QSL("MessagesProxyModel"));
|
||||
|
||||
setSortRole(Qt::EditRole);
|
||||
setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
setSortRole(Qt::ItemDataRole::EditRole);
|
||||
setSortCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive);
|
||||
|
||||
setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||
setFilterCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive);
|
||||
setFilterKeyColumn(-1);
|
||||
setFilterRole(Qt::EditRole);
|
||||
setFilterRole(Qt::ItemDataRole::EditRole);
|
||||
|
||||
setDynamicSortFilter(false);
|
||||
setSourceModel(m_sourceModel);
|
||||
@ -110,8 +110,8 @@ QModelIndexList MessagesProxyModel::match(const QModelIndex& start, int role,
|
||||
const QVariant& entered_value, int hits, Qt::MatchFlags flags) const {
|
||||
QModelIndexList result;
|
||||
const int match_type = flags & 0x0F;
|
||||
const Qt::CaseSensitivity case_sensitivity = Qt::CaseInsensitive;
|
||||
const bool wrap = (flags& Qt::MatchWrap) > 0;
|
||||
const Qt::CaseSensitivity case_sensitivity = Qt::CaseSensitivity::CaseInsensitive;
|
||||
const bool wrap = (flags& Qt::MatchFlag::MatchWrap) > 0;
|
||||
const bool all_hits = (hits == -1);
|
||||
QString entered_text;
|
||||
int from = start.row();
|
||||
|
@ -19,18 +19,18 @@ ShortcutCatcher::ShortcutCatcher(QWidget* parent)
|
||||
// Create reset button.
|
||||
m_btnReset = new PlainToolButton(this);
|
||||
m_btnReset->setIcon(qApp->icons()->fromTheme(QSL("document-revert")));
|
||||
m_btnReset->setFocusPolicy(Qt::NoFocus);
|
||||
m_btnReset->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
||||
m_btnReset->setToolTip(tr("Reset to original shortcut."));
|
||||
|
||||
// Create clear button.
|
||||
m_btnClear = new PlainToolButton(this);
|
||||
m_btnClear->setIcon(qApp->icons()->fromTheme(QSL("list-remove")));
|
||||
m_btnClear->setFocusPolicy(Qt::NoFocus);
|
||||
m_btnClear->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
||||
m_btnClear->setToolTip(tr("Clear current shortcut."));
|
||||
|
||||
// Clear main shortcut catching button.
|
||||
m_shortcutBox = new QKeySequenceEdit(this);
|
||||
m_shortcutBox->setFocusPolicy(Qt::StrongFocus);
|
||||
m_shortcutBox->setFocusPolicy(Qt::FocusPolicy::StrongFocus);
|
||||
m_shortcutBox->setMinimumWidth(170);
|
||||
m_shortcutBox->setToolTip(tr("Click and hit new shortcut."));
|
||||
|
||||
|
@ -587,7 +587,7 @@ void FormMain::loadSize() {
|
||||
move(settings->value(GROUP(GUI), GUI::MainWindowInitialPosition, screen.center() - rect().center()).toPoint());
|
||||
|
||||
if (settings->value(GROUP(GUI), SETTING(GUI::MainWindowStartsMaximized)).toBool()) {
|
||||
setWindowState(windowState() | Qt::WindowMaximized);
|
||||
setWindowState(windowState() | Qt::WindowState::WindowMaximized);
|
||||
|
||||
// We process events so that window is really maximized fast.
|
||||
qApp->processEvents();
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "exceptions/applicationexception.h"
|
||||
#include "gui/dialogs/formmain.h"
|
||||
#include "gui/guiutilities.h"
|
||||
#include "gui/messagebox.h"
|
||||
#include "miscellaneous/iconfactory.h"
|
||||
|
||||
@ -12,10 +13,11 @@
|
||||
FormRestoreDatabaseSettings::FormRestoreDatabaseSettings(QWidget& parent) : QDialog(&parent),
|
||||
m_shouldRestart(false) {
|
||||
m_ui.setupUi(this);
|
||||
m_btnRestart = m_ui.m_buttonBox->addButton(tr("Restart"), QDialogButtonBox::ActionRole);
|
||||
m_btnRestart = m_ui.m_buttonBox->addButton(tr("Restart"), QDialogButtonBox::ButtonRole::ActionRole);
|
||||
m_ui.m_lblResult->setStatus(WidgetWithStatus::StatusType::Warning, tr("No operation executed yet."), tr("No operation executed yet."));
|
||||
setWindowIcon(qApp->icons()->fromTheme(QSL("document-import")));
|
||||
setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog | Qt::WindowSystemMenuHint);
|
||||
|
||||
GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("document-import")));
|
||||
|
||||
connect(m_btnRestart, &QPushButton::clicked, this, [=]() {
|
||||
m_shouldRestart = true;
|
||||
close();
|
||||
@ -57,10 +59,10 @@ void FormRestoreDatabaseSettings::performRestoration() {
|
||||
void FormRestoreDatabaseSettings::checkOkButton() {
|
||||
m_btnRestart->setEnabled(false);
|
||||
m_ui.m_buttonBox->button(QDialogButtonBox::StandardButton::Ok)->setEnabled(!m_ui.m_lblSelectFolder->label()->text().isEmpty() &&
|
||||
((m_ui.m_groupDatabase->isChecked() &&
|
||||
m_ui.m_listDatabase->currentRow() >= 0) ||
|
||||
(m_ui.m_groupSettings->isChecked() &&
|
||||
m_ui.m_listSettings->currentRow() >= 0)));
|
||||
((m_ui.m_groupDatabase->isChecked() &&
|
||||
m_ui.m_listDatabase->currentRow() >= 0) ||
|
||||
(m_ui.m_groupSettings->isChecked() &&
|
||||
m_ui.m_listSettings->currentRow() >= 0)));
|
||||
}
|
||||
|
||||
void FormRestoreDatabaseSettings::selectFolderWithGui() {
|
||||
@ -81,14 +83,20 @@ void FormRestoreDatabaseSettings::selectFolder(QString folder) {
|
||||
}
|
||||
|
||||
const QDir selected_folder(folder);
|
||||
const QFileInfoList available_databases = selected_folder.entryInfoList(QStringList() << QString(
|
||||
"*") + BACKUP_SUFFIX_DATABASE,
|
||||
QDir::Files | QDir::NoDotAndDotDot | QDir::Readable | QDir::CaseSensitive | QDir::NoSymLinks,
|
||||
QDir::Name);
|
||||
const QFileInfoList available_settings = selected_folder.entryInfoList(QStringList() << QString(
|
||||
"*") + BACKUP_SUFFIX_SETTINGS,
|
||||
QDir::Files | QDir::NoDotAndDotDot | QDir::Readable | QDir::CaseSensitive | QDir::NoSymLinks,
|
||||
QDir::Name);
|
||||
const QFileInfoList available_databases = selected_folder.entryInfoList(QStringList() << QSL("*") + BACKUP_SUFFIX_DATABASE,
|
||||
QDir::Filter::Files |
|
||||
QDir::Filter::NoDotAndDotDot |
|
||||
QDir::Filter::Readable |
|
||||
QDir::Filter::CaseSensitive |
|
||||
QDir::Filter::NoSymLinks,
|
||||
QDir::SortFlag::Name);
|
||||
const QFileInfoList available_settings = selected_folder.entryInfoList(QStringList() << QSL("*") + BACKUP_SUFFIX_SETTINGS,
|
||||
QDir::Filter::Files |
|
||||
QDir::Filter::NoDotAndDotDot |
|
||||
QDir::Filter::Readable |
|
||||
QDir::Filter::CaseSensitive |
|
||||
QDir::Filter::NoSymLinks,
|
||||
QDir::SortFlag::Name);
|
||||
|
||||
m_ui.m_listDatabase->clear();
|
||||
m_ui.m_listSettings->clear();
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "miscellaneous/iconfactory.h"
|
||||
#include "miscellaneous/settings.h"
|
||||
|
||||
#include "gui/guiutilities.h"
|
||||
#include "gui/settings/settingsbrowsermail.h"
|
||||
#include "gui/settings/settingsdatabase.h"
|
||||
#include "gui/settings/settingsdownloads.h"
|
||||
@ -22,9 +23,10 @@ FormSettings::FormSettings(QWidget& parent)
|
||||
m_ui.setupUi(this);
|
||||
|
||||
// Set flags and attributes.
|
||||
setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowTitleHint);
|
||||
setWindowIcon(qApp->icons()->fromTheme(QSL("emblem-system")));
|
||||
m_btnApply = m_ui.m_buttonBox->button(QDialogButtonBox::Apply);
|
||||
GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("emblem-system")));
|
||||
|
||||
m_btnApply = m_ui.m_buttonBox->button(QDialogButtonBox::StandardButton::Apply);
|
||||
|
||||
m_btnApply->setEnabled(false);
|
||||
|
||||
// Establish needed connections.
|
||||
|
@ -26,15 +26,16 @@ FormUpdate::FormUpdate(QWidget* parent)
|
||||
|
||||
// Set flags and attributes.
|
||||
GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("help-about")));
|
||||
|
||||
connect(&m_downloader, &Downloader::progress, this, &FormUpdate::updateProgress);
|
||||
connect(&m_downloader, &Downloader::completed, this, &FormUpdate::updateCompleted);
|
||||
|
||||
if (isSelfUpdateSupported()) {
|
||||
m_btnUpdate = m_ui.m_buttonBox->addButton(tr("Download selected update"), QDialogButtonBox::ActionRole);
|
||||
m_btnUpdate = m_ui.m_buttonBox->addButton(tr("Download selected update"), QDialogButtonBox::ButtonRole::ActionRole);
|
||||
m_btnUpdate->setToolTip(tr("Download new installation files."));
|
||||
}
|
||||
else {
|
||||
m_btnUpdate = m_ui.m_buttonBox->addButton(tr("Go to application website"), QDialogButtonBox::ActionRole);
|
||||
m_btnUpdate = m_ui.m_buttonBox->addButton(tr("Go to application website"), QDialogButtonBox::ButtonRole::ActionRole);
|
||||
m_btnUpdate->setToolTip(tr("Go to application website to get update packages manually."));
|
||||
}
|
||||
|
||||
@ -152,7 +153,7 @@ void FormUpdate::loadAvailableFiles() {
|
||||
if (SystemFactory::supportedUpdateFiles().match(url.m_name).hasMatch()) {
|
||||
QListWidgetItem* item = new QListWidgetItem(url.m_name + tr(" (size ") + url.m_size + QSL(")"));
|
||||
|
||||
item->setData(Qt::UserRole, url.m_fileUrl);
|
||||
item->setData(Qt::ItemDataRole::UserRole, url.m_fileUrl);
|
||||
item->setToolTip(url.m_fileUrl);
|
||||
m_ui.m_listFiles->addItem(item);
|
||||
}
|
||||
@ -221,7 +222,7 @@ void FormUpdate::startUpdate() {
|
||||
qDebugNN << LOGSEC_GUI << "External updater was not launched due to error.";
|
||||
qApp->showGuiMessage(tr("Cannot update application"),
|
||||
tr("Cannot launch external updater. Update application manually."),
|
||||
QSystemTrayIcon::Warning, this);
|
||||
QSystemTrayIcon::MessageIcon::Warning, this);
|
||||
}
|
||||
else {
|
||||
qApp->quit();
|
||||
|
@ -17,13 +17,13 @@
|
||||
DiscoverFeedsButton::DiscoverFeedsButton(QWidget* parent) : QToolButton(parent), m_addresses(QStringList()) {
|
||||
setEnabled(false);
|
||||
setIcon(qApp->icons()->fromTheme(QSL("application-rss+xml")));
|
||||
setPopupMode(QToolButton::InstantPopup);
|
||||
setPopupMode(QToolButton::ToolButtonPopupMode::InstantPopup);
|
||||
}
|
||||
|
||||
DiscoverFeedsButton::~DiscoverFeedsButton() {}
|
||||
|
||||
void DiscoverFeedsButton::clearFeedAddresses() {
|
||||
setFeedAddresses(QStringList());
|
||||
setFeedAddresses({});
|
||||
}
|
||||
|
||||
void DiscoverFeedsButton::setFeedAddresses(const QStringList& addresses) {
|
||||
|
@ -128,11 +128,11 @@ bool FeedMessageViewer::areListHeadersEnabled() const {
|
||||
}
|
||||
|
||||
void FeedMessageViewer::switchMessageSplitterOrientation() {
|
||||
if (m_messageSplitter->orientation() == Qt::Vertical) {
|
||||
m_messageSplitter->setOrientation(Qt::Horizontal);
|
||||
if (m_messageSplitter->orientation() == Qt::Orientation::Vertical) {
|
||||
m_messageSplitter->setOrientation(Qt::Orientation::Horizontal);
|
||||
}
|
||||
else {
|
||||
m_messageSplitter->setOrientation(Qt::Vertical);
|
||||
m_messageSplitter->setOrientation(Qt::Orientation::Vertical);
|
||||
}
|
||||
}
|
||||
|
||||
@ -241,10 +241,10 @@ void FeedMessageViewer::initialize() {
|
||||
// Initialize/populate toolbars.
|
||||
m_toolBarFeeds->setFloatable(false);
|
||||
m_toolBarFeeds->setMovable(false);
|
||||
m_toolBarFeeds->setAllowedAreas(Qt::TopToolBarArea);
|
||||
m_toolBarFeeds->setAllowedAreas(Qt::ToolBarArea::TopToolBarArea);
|
||||
m_toolBarMessages->setFloatable(false);
|
||||
m_toolBarMessages->setMovable(false);
|
||||
m_toolBarMessages->setAllowedAreas(Qt::TopToolBarArea);
|
||||
m_toolBarMessages->setAllowedAreas(Qt::ToolBarArea::TopToolBarArea);
|
||||
m_messagesBrowser->clear();
|
||||
|
||||
// Now refresh visual setup.
|
||||
@ -254,8 +254,8 @@ void FeedMessageViewer::initialize() {
|
||||
void FeedMessageViewer::initializeViews() {
|
||||
m_feedsWidget = new QWidget(this);
|
||||
m_messagesWidget = new QWidget(this);
|
||||
m_feedSplitter = new QSplitter(Qt::Horizontal, this);
|
||||
m_messageSplitter = new QSplitter(Qt::Vertical, this);
|
||||
m_feedSplitter = new QSplitter(Qt::Orientation::Horizontal, this);
|
||||
m_messageSplitter = new QSplitter(Qt::Orientation::Vertical, this);
|
||||
|
||||
// Instantiate needed components.
|
||||
auto* central_layout = new QVBoxLayout(this);
|
||||
@ -272,8 +272,8 @@ void FeedMessageViewer::initializeViews() {
|
||||
message_layout->setSpacing(0);
|
||||
|
||||
// Set views.
|
||||
m_feedsView->setFrameStyle(QFrame::NoFrame);
|
||||
m_messagesView->setFrameStyle(QFrame::NoFrame);
|
||||
m_feedsView->setFrameStyle(QFrame::Shape::NoFrame);
|
||||
m_messagesView->setFrameStyle(QFrame::Shape::NoFrame);
|
||||
|
||||
// Setup message splitter.
|
||||
m_messageSplitter->setObjectName(QSL("MessageSplitter"));
|
||||
|
@ -687,8 +687,8 @@ QMenu* FeedsView::initializeContextMenuLabel(RootItem* clicked_item) {
|
||||
|
||||
void FeedsView::setupAppearance() {
|
||||
// Setup column resize strategies.
|
||||
header()->setSectionResizeMode(FDS_MODEL_TITLE_INDEX, QHeaderView::Stretch);
|
||||
header()->setSectionResizeMode(FDS_MODEL_COUNTS_INDEX, QHeaderView::ResizeToContents);
|
||||
header()->setSectionResizeMode(FDS_MODEL_TITLE_INDEX, QHeaderView::ResizeMode::Stretch);
|
||||
header()->setSectionResizeMode(FDS_MODEL_COUNTS_INDEX, QHeaderView::ResizeMode::ResizeToContents);
|
||||
header()->setStretchLastSection(false);
|
||||
|
||||
setUniformRowHeights(true);
|
||||
@ -697,15 +697,15 @@ void FeedsView::setupAppearance() {
|
||||
setItemsExpandable(true);
|
||||
setAutoExpandDelay(0);
|
||||
setExpandsOnDoubleClick(true);
|
||||
setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
setEditTriggers(QAbstractItemView::EditTrigger::NoEditTriggers);
|
||||
setIndentation(FEEDS_VIEW_INDENTATION);
|
||||
setAcceptDrops(false);
|
||||
setDragEnabled(true);
|
||||
setDropIndicatorShown(true);
|
||||
setDragDropMode(QAbstractItemView::InternalMove);
|
||||
setDragDropMode(QAbstractItemView::DragDropMode::InternalMove);
|
||||
setAllColumnsShowFocus(false);
|
||||
setRootIsDecorated(false);
|
||||
setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
setSelectionMode(QAbstractItemView::SelectionMode::SingleSelection);
|
||||
setItemDelegate(new StyledItemDelegateWithoutFocus(this));
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ MessageBox::MessageBox(QWidget* parent) : QMessageBox(parent) {}
|
||||
|
||||
void MessageBox::setIcon(QMessageBox::Icon icon) {
|
||||
// Determine correct status icon size.
|
||||
const int icon_size = qApp->style()->pixelMetric(QStyle::PM_MessageBoxIconSize, nullptr, this);
|
||||
const int icon_size = qApp->style()->pixelMetric(QStyle::PixelMetric::PM_MessageBoxIconSize, nullptr, this);
|
||||
|
||||
// Setup status icon.
|
||||
setIconPixmap(iconForStatus(icon).pixmap(icon_size, icon_size));
|
||||
|
@ -61,16 +61,16 @@ MessageBrowser::MessageBrowser(bool should_resize_to_fit, QWidget* parent)
|
||||
box.setInformativeText(tr("What action do you want to take?"));
|
||||
box.setDetailedText(url.toString());
|
||||
|
||||
QAbstractButton* btn_open = box.addButton(tr("Open in external browser"), QMessageBox::ActionRole);
|
||||
QAbstractButton* btn_download = box.addButton(tr("Download"), QMessageBox::ActionRole);
|
||||
QAbstractButton* btn_cancel = box.addButton(QMessageBox::Cancel);
|
||||
QAbstractButton* btn_open = box.addButton(tr("Open in external browser"), QMessageBox::ButtonRole::ActionRole);
|
||||
QAbstractButton* btn_download = box.addButton(tr("Download"), QMessageBox::ButtonRole::ActionRole);
|
||||
QAbstractButton* btn_cancel = box.addButton(QMessageBox::StandardButton::Cancel);
|
||||
bool always;
|
||||
MessageBox::setCheckBox(&box, tr("Always open links in external browser."), &always);
|
||||
|
||||
box.setDefaultButton(QMessageBox::Cancel);
|
||||
box.setDefaultButton(QMessageBox::StandardButton::Cancel);
|
||||
box.exec();
|
||||
|
||||
if (box.clickedButton() != box.button(QMessageBox::Cancel)) {
|
||||
if (box.clickedButton() != box.button(QMessageBox::StandardButton::Cancel)) {
|
||||
// Store selected checkbox value.
|
||||
qApp->settings()->setValue(GROUP(Browser), Browser::OpenLinksInExternalBrowserRightAway, always);
|
||||
}
|
||||
@ -203,7 +203,7 @@ void MessageBrowser::loadMessage(const Message& message, RootItem* root) {
|
||||
auto html = prepareHtmlForMessage(message);
|
||||
|
||||
m_txtBrowser->setHtml(html);
|
||||
m_txtBrowser->verticalScrollBar()->triggerAction(QScrollBar::SliderToMinimum);
|
||||
m_txtBrowser->verticalScrollBar()->triggerAction(QScrollBar::SliderAction::SliderToMinimum);
|
||||
m_searchWidget->hide();
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ void MessagesToolBar::initializeHighlighter() {
|
||||
m_btnMessageHighlighter = new QToolButton(this);
|
||||
m_btnMessageHighlighter->setToolTip(tr("Display all messages"));
|
||||
m_btnMessageHighlighter->setMenu(m_menuMessageHighlighter);
|
||||
m_btnMessageHighlighter->setPopupMode(QToolButton::MenuButtonPopup);
|
||||
m_btnMessageHighlighter->setPopupMode(QToolButton::ToolButtonPopupMode::MenuButtonPopup);
|
||||
m_btnMessageHighlighter->setIcon(qApp->icons()->fromTheme(QSL("mail-mark-read")));
|
||||
m_actionMessageHighlighter = new QWidgetAction(this);
|
||||
m_actionMessageHighlighter->setDefaultWidget(m_btnMessageHighlighter);
|
||||
|
@ -79,9 +79,9 @@ void MessagesView::createConnections() {
|
||||
void MessagesView::keyboardSearch(const QString& search) {
|
||||
// WARNING: This is quite hacky way how to force selection of next item even
|
||||
// with extended selection enabled.
|
||||
setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
setSelectionMode(QAbstractItemView::SelectionMode::SingleSelection);
|
||||
QTreeView::keyboardSearch(search);
|
||||
setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection);
|
||||
}
|
||||
|
||||
void MessagesView::reloadSelections() {
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
MessageTextBrowser::MessageTextBrowser(QWidget* parent) : QTextBrowser(parent) {
|
||||
setAutoFillBackground(true);
|
||||
setFrameShape(QFrame::StyledPanel);
|
||||
setFrameShadow(QFrame::Plain);
|
||||
setFrameShape(QFrame::Shape::StyledPanel);
|
||||
setFrameShadow(QFrame::Shadow::Plain);
|
||||
setTabChangesFocus(true);
|
||||
setOpenLinks(false);
|
||||
viewport()->setAutoFillBackground(true);
|
||||
@ -26,7 +26,8 @@ QVariant MessageTextBrowser::loadResource(int type, const QUrl& name) {
|
||||
case QTextDocument::ResourceType::ImageResource: {
|
||||
if (qApp->settings()->value(GROUP(Messages), SETTING(Messages::DisplayImagePlaceholders)).toBool()) {
|
||||
if (m_imagePlaceholder.isNull()) {
|
||||
m_imagePlaceholder = qApp->icons()->miscPixmap(QSL("image-placeholder")).scaledToWidth(20, Qt::FastTransformation);
|
||||
m_imagePlaceholder = qApp->icons()->miscPixmap(QSL("image-placeholder")).scaledToWidth(20,
|
||||
Qt::TransformationMode::FastTransformation);
|
||||
}
|
||||
|
||||
return m_imagePlaceholder;
|
||||
|
@ -36,7 +36,7 @@ SettingsBrowserMail::SettingsBrowserMail(Settings* settings, QWidget* parent)
|
||||
#endif
|
||||
|
||||
m_ui->m_listTools->setHeaderLabels(QStringList() << tr("Executable") << tr("Parameters"));
|
||||
m_ui->m_listTools->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||
m_ui->m_listTools->header()->setSectionResizeMode(0, QHeaderView::ResizeMode::ResizeToContents);
|
||||
|
||||
connect(m_proxyDetails, &NetworkProxyDetails::changed, this, &SettingsBrowserMail::dirtifySettings);
|
||||
connect(m_ui->m_grpCustomExternalBrowser, &QGroupBox::toggled, this, &SettingsBrowserMail::dirtifySettings);
|
||||
|
@ -97,9 +97,9 @@ void SettingsFeedsMessages::initializeMessageDateFormats() {
|
||||
for (const Language& lang : qAsConst(installed_languages)) {
|
||||
QLocale locale(lang.m_code);
|
||||
|
||||
best_formats << locale.dateTimeFormat(QLocale::LongFormat)
|
||||
<< locale.dateTimeFormat(QLocale::ShortFormat)
|
||||
<< locale.dateTimeFormat(QLocale::NarrowFormat);
|
||||
best_formats << locale.dateTimeFormat(QLocale::FormatType::LongFormat)
|
||||
<< locale.dateTimeFormat(QLocale::FormatType::ShortFormat)
|
||||
<< locale.dateTimeFormat(QLocale::FormatType::NarrowFormat);
|
||||
}
|
||||
|
||||
best_formats.removeDuplicates();
|
||||
|
@ -32,10 +32,10 @@ SettingsGui::SettingsGui(Settings* settings, QWidget* parent) : SettingsPanel(se
|
||||
<< tr("E-mail"));
|
||||
|
||||
// Setup skins.
|
||||
m_ui->m_treeSkins->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||
m_ui->m_treeSkins->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
|
||||
m_ui->m_treeSkins->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
|
||||
m_ui->m_treeSkins->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
|
||||
m_ui->m_treeSkins->header()->setSectionResizeMode(0, QHeaderView::ResizeMode::ResizeToContents);
|
||||
m_ui->m_treeSkins->header()->setSectionResizeMode(1, QHeaderView::ResizeMode::ResizeToContents);
|
||||
m_ui->m_treeSkins->header()->setSectionResizeMode(2, QHeaderView::ResizeMode::ResizeToContents);
|
||||
m_ui->m_treeSkins->header()->setSectionResizeMode(3, QHeaderView::ResizeMode::ResizeToContents);
|
||||
connect(m_ui->m_cmbIconTheme, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &SettingsGui::requireRestart);
|
||||
connect(m_ui->m_cmbIconTheme, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||
&SettingsGui::dirtifySettings);
|
||||
@ -72,8 +72,8 @@ bool SettingsGui::eventFilter(QObject* obj, QEvent* e) {
|
||||
if (e->type() == QEvent::Type::Drop) {
|
||||
auto* drop_event = static_cast<QDropEvent*>(e);
|
||||
|
||||
if (drop_event->keyboardModifiers() != Qt::NoModifier) {
|
||||
drop_event->setDropAction(Qt::MoveAction);
|
||||
if (drop_event->keyboardModifiers() != Qt::KeyboardModifier::NoModifier) {
|
||||
drop_event->setDropAction(Qt::DropAction::MoveAction);
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,11 +177,11 @@ void SettingsGui::loadSettings() {
|
||||
m_ui->m_checkHideTabBarIfOneTabVisible->setChecked(settings()->value(GROUP(GUI), SETTING(GUI::HideTabBarIfOnlyOneTab)).toBool());
|
||||
|
||||
// Load toolbar button style.
|
||||
m_ui->m_cmbToolbarButtonStyle->addItem(tr("Icon only"), Qt::ToolButtonIconOnly);
|
||||
m_ui->m_cmbToolbarButtonStyle->addItem(tr("Text only"), Qt::ToolButtonTextOnly);
|
||||
m_ui->m_cmbToolbarButtonStyle->addItem(tr("Text beside icon"), Qt::ToolButtonTextBesideIcon);
|
||||
m_ui->m_cmbToolbarButtonStyle->addItem(tr("Text under icon"), Qt::ToolButtonTextUnderIcon);
|
||||
m_ui->m_cmbToolbarButtonStyle->addItem(tr("Follow OS style"), Qt::ToolButtonFollowStyle);
|
||||
m_ui->m_cmbToolbarButtonStyle->addItem(tr("Icon only"), Qt::ToolButtonStyle::ToolButtonIconOnly);
|
||||
m_ui->m_cmbToolbarButtonStyle->addItem(tr("Text only"), Qt::ToolButtonStyle::ToolButtonTextOnly);
|
||||
m_ui->m_cmbToolbarButtonStyle->addItem(tr("Text beside icon"), Qt::ToolButtonStyle::ToolButtonTextBesideIcon);
|
||||
m_ui->m_cmbToolbarButtonStyle->addItem(tr("Text under icon"), Qt::ToolButtonStyle::ToolButtonTextUnderIcon);
|
||||
m_ui->m_cmbToolbarButtonStyle->addItem(tr("Follow OS style"), Qt::ToolButtonStyle::ToolButtonFollowStyle);
|
||||
m_ui->m_cmbToolbarButtonStyle->setCurrentIndex(m_ui->m_cmbToolbarButtonStyle->findData(settings()->value(GROUP(GUI),
|
||||
SETTING(
|
||||
GUI::ToolbarStyle)).toInt()));
|
||||
|
@ -18,9 +18,9 @@ SettingsLocalization::SettingsLocalization(Settings* settings, QWidget* parent)
|
||||
<< tr("Author"));
|
||||
|
||||
// Setup languages.
|
||||
m_ui->m_treeLanguages->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||
m_ui->m_treeLanguages->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
|
||||
m_ui->m_treeLanguages->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
|
||||
m_ui->m_treeLanguages->header()->setSectionResizeMode(0, QHeaderView::ResizeMode::ResizeToContents);
|
||||
m_ui->m_treeLanguages->header()->setSectionResizeMode(1, QHeaderView::ResizeMode::ResizeToContents);
|
||||
m_ui->m_treeLanguages->header()->setSectionResizeMode(2, QHeaderView::ResizeMode::ResizeToContents);
|
||||
connect(m_ui->m_treeLanguages, &QTreeWidget::currentItemChanged, this, &SettingsLocalization::requireRestart);
|
||||
connect(m_ui->m_treeLanguages, &QTreeWidget::currentItemChanged, this, &SettingsLocalization::dirtifySettings);
|
||||
}
|
||||
@ -43,8 +43,10 @@ void SettingsLocalization::loadSettings() {
|
||||
item->setIcon(0, qApp->icons()->miscIcon(QString(FLAG_ICON_SUBFOLDER) + QDir::separator() + language.m_code));
|
||||
}
|
||||
|
||||
m_ui->m_treeLanguages->sortByColumn(0, Qt::AscendingOrder);
|
||||
QList<QTreeWidgetItem*> matching_items = m_ui->m_treeLanguages->findItems(qApp->localization()->loadedLanguage(), Qt::MatchContains, 1);
|
||||
m_ui->m_treeLanguages->sortByColumn(0, Qt::SortOrder::AscendingOrder);
|
||||
QList<QTreeWidgetItem*> matching_items = m_ui->m_treeLanguages->findItems(qApp->localization()->loadedLanguage(),
|
||||
Qt::MatchFlag::MatchContains,
|
||||
1);
|
||||
|
||||
if (!matching_items.isEmpty()) {
|
||||
m_ui->m_treeLanguages->setCurrentItem(matching_items[0]);
|
||||
|
@ -13,7 +13,7 @@
|
||||
TabBar::TabBar(QWidget* parent) : QTabBar(parent) {
|
||||
setDocumentMode(false);
|
||||
setUsesScrollButtons(true);
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
|
||||
}
|
||||
|
||||
TabBar::~TabBar() {
|
||||
|
@ -40,7 +40,7 @@ void TabWidget::setupMainMenuButton() {
|
||||
m_btnMainMenu->setPadding(3);
|
||||
m_btnMainMenu->setToolTip(tr("Displays main menu."));
|
||||
m_btnMainMenu->setIcon(qApp->icons()->fromTheme(QSL("go-home")));
|
||||
m_btnMainMenu->setPopupMode(QToolButton::InstantPopup);
|
||||
m_btnMainMenu->setPopupMode(QToolButton::ToolButtonPopupMode::InstantPopup);
|
||||
connect(m_btnMainMenu, &PlainToolButton::clicked, this, &TabWidget::openMainMenu);
|
||||
}
|
||||
|
||||
@ -83,15 +83,16 @@ void TabWidget::showDownloadManager() {
|
||||
}
|
||||
|
||||
void TabWidget::checkTabBarVisibility() {
|
||||
const bool should_be_visible = count() > 1 || !qApp->settings()->value(GROUP(GUI), SETTING(GUI::HideTabBarIfOnlyOneTab)).toBool();
|
||||
const bool should_be_visible = count() > 1 ||
|
||||
!qApp->settings()->value(GROUP(GUI), SETTING(GUI::HideTabBarIfOnlyOneTab)).toBool();
|
||||
|
||||
if (should_be_visible) {
|
||||
setCornerWidget(m_btnMainMenu, Qt::TopLeftCorner);
|
||||
setCornerWidget(m_btnMainMenu, Qt::Corner::TopLeftCorner);
|
||||
m_btnMainMenu->setVisible(true);
|
||||
}
|
||||
else {
|
||||
setCornerWidget(nullptr, Qt::TopLeftCorner);
|
||||
setCornerWidget(nullptr, Qt::TopRightCorner);
|
||||
setCornerWidget(nullptr, Qt::Corner::TopLeftCorner);
|
||||
setCornerWidget(nullptr, Qt::Corner::TopRightCorner);
|
||||
m_btnMainMenu->setVisible(false);
|
||||
}
|
||||
|
||||
@ -252,7 +253,7 @@ int TabWidget::addBrowser(bool move_after_current, bool make_active, const QUrl&
|
||||
// Make new web browser active if desired.
|
||||
if (make_active) {
|
||||
setCurrentIndex(final_index);
|
||||
browser->setFocus(Qt::OtherFocusReason);
|
||||
browser->setFocus(Qt::FocusReason::OtherFocusReason);
|
||||
}
|
||||
|
||||
return final_index;
|
||||
|
@ -69,18 +69,18 @@ void ToolBarEditor::loadEditor(const QList<QAction*> activated_actions, const QL
|
||||
QListWidgetItem* action_item = new QListWidgetItem(action->icon(), action->text().replace('&', ""), m_ui->m_listActivatedActions);
|
||||
|
||||
if (action->isSeparator()) {
|
||||
action_item->setData(Qt::UserRole, SEPARATOR_ACTION_NAME);
|
||||
action_item->setData(Qt::ItemDataRole::UserRole, SEPARATOR_ACTION_NAME);
|
||||
action_item->setIcon(qApp->icons()->fromTheme(QSL("insert-object")));
|
||||
action_item->setText(tr("Separator"));
|
||||
action_item->setToolTip(tr("Separator"));
|
||||
}
|
||||
else if (action->property("type").isValid()) {
|
||||
action_item->setData(Qt::UserRole, action->property("type").toString());
|
||||
action_item->setData(Qt::ItemDataRole::UserRole, action->property("type").toString());
|
||||
action_item->setText(action->property("name").toString());
|
||||
action_item->setToolTip(action_item->text());
|
||||
}
|
||||
else {
|
||||
action_item->setData(Qt::UserRole, action->objectName());
|
||||
action_item->setData(Qt::ItemDataRole::UserRole, action->objectName());
|
||||
action_item->setToolTip(action->toolTip());
|
||||
}
|
||||
}
|
||||
@ -107,7 +107,7 @@ void ToolBarEditor::loadEditor(const QList<QAction*> activated_actions, const QL
|
||||
}
|
||||
}
|
||||
|
||||
m_ui->m_listAvailableActions->sortItems(Qt::AscendingOrder);
|
||||
m_ui->m_listAvailableActions->sortItems(Qt::SortOrder::AscendingOrder);
|
||||
m_ui->m_listAvailableActions->setCurrentRow(m_ui->m_listAvailableActions->count() >= 0 ? 0 : -1);
|
||||
m_ui->m_listActivatedActions->setCurrentRow(m_ui->m_listActivatedActions->count() >= 0 ? 0 : -1);
|
||||
}
|
||||
@ -117,15 +117,17 @@ bool ToolBarEditor::eventFilter(QObject* object, QEvent* event) {
|
||||
if (event->type() == QEvent::Type::KeyPress) {
|
||||
const auto* key_event = static_cast<QKeyEvent*>(event);
|
||||
|
||||
if (key_event->key() == Qt::Key_Delete) {
|
||||
if (key_event->key() == Qt::Key::Key_Delete) {
|
||||
deleteSelectedAction();
|
||||
return true;
|
||||
}
|
||||
else if (key_event->key() == Qt::Key_Down && (key_event->modifiers() & Qt::ControlModifier) == Qt::ControlModifier) {
|
||||
else if (key_event->key() == Qt::Key::Key_Down &&
|
||||
(key_event->modifiers() & Qt::KeyboardModifier::ControlModifier) == Qt::KeyboardModifier::ControlModifier) {
|
||||
moveActionDown();
|
||||
return true;
|
||||
}
|
||||
else if (key_event->key() == Qt::Key_Up && (key_event->modifiers() & Qt::ControlModifier) == Qt::ControlModifier) {
|
||||
else if (key_event->key() == Qt::Key::Key_Up &&
|
||||
(key_event->modifiers() & Qt::KeyboardModifier::ControlModifier) == Qt::KeyboardModifier::ControlModifier) {
|
||||
moveActionUp();
|
||||
return true;
|
||||
}
|
||||
@ -150,7 +152,7 @@ void ToolBarEditor::insertSpacer() {
|
||||
auto* item = new QListWidgetItem(tr("Toolbar spacer"));
|
||||
|
||||
item->setIcon(qApp->icons()->fromTheme(QSL("go-jump")));
|
||||
item->setData(Qt::UserRole, SPACER_ACTION_NAME);
|
||||
item->setData(Qt::ItemDataRole::UserRole, SPACER_ACTION_NAME);
|
||||
m_ui->m_listActivatedActions->insertItem(current_row + 1, item);
|
||||
m_ui->m_listActivatedActions->setCurrentRow(current_row + 1);
|
||||
emit setupChanged();
|
||||
@ -160,7 +162,7 @@ void ToolBarEditor::insertSeparator() {
|
||||
const int current_row = m_ui->m_listActivatedActions->currentRow();
|
||||
QListWidgetItem* item = new QListWidgetItem(tr("Separator"));
|
||||
|
||||
item->setData(Qt::UserRole, SEPARATOR_ACTION_NAME);
|
||||
item->setData(Qt::ItemDataRole::UserRole, SEPARATOR_ACTION_NAME);
|
||||
item->setToolTip(tr("Separator"));
|
||||
item->setIcon(qApp->icons()->fromTheme(QSL("insert-object")));
|
||||
m_ui->m_listActivatedActions->insertItem(current_row + 1, item);
|
||||
@ -215,7 +217,7 @@ void ToolBarEditor::deleteSelectedAction() {
|
||||
|
||||
if (items.size() == 1) {
|
||||
QListWidgetItem* selected_item = items.at(0);
|
||||
const QString data_item = selected_item->data(Qt::UserRole).toString();
|
||||
const QString data_item = selected_item->data(Qt::ItemDataRole::UserRole).toString();
|
||||
|
||||
if (data_item == SEPARATOR_ACTION_NAME || data_item == SPACER_ACTION_NAME) {
|
||||
m_ui->m_listActivatedActions->takeItem(m_ui->m_listActivatedActions->row(selected_item));
|
||||
@ -225,7 +227,7 @@ void ToolBarEditor::deleteSelectedAction() {
|
||||
m_ui->m_listAvailableActions->insertItem(
|
||||
m_ui->m_listAvailableActions->currentRow() + 1,
|
||||
m_ui->m_listActivatedActions->takeItem(m_ui->m_listActivatedActions->row(selected_item)));
|
||||
m_ui->m_listAvailableActions->sortItems(Qt::AscendingOrder);
|
||||
m_ui->m_listAvailableActions->sortItems(Qt::SortOrder::AscendingOrder);
|
||||
m_ui->m_listAvailableActions->setCurrentRow(m_ui->m_listAvailableActions->currentRow() + 1);
|
||||
}
|
||||
|
||||
@ -238,14 +240,14 @@ void ToolBarEditor::deleteAllActions() {
|
||||
QString data_item;
|
||||
|
||||
while ((taken_item = m_ui->m_listActivatedActions->takeItem(0)) != nullptr) {
|
||||
data_item = taken_item->data(Qt::UserRole).toString();
|
||||
data_item = taken_item->data(Qt::ItemDataRole::UserRole).toString();
|
||||
|
||||
if (data_item != SEPARATOR_ACTION_NAME && data_item != SPACER_ACTION_NAME) {
|
||||
m_ui->m_listAvailableActions->insertItem(m_ui->m_listAvailableActions->currentRow() + 1, taken_item);
|
||||
}
|
||||
}
|
||||
|
||||
m_ui->m_listAvailableActions->sortItems(Qt::AscendingOrder);
|
||||
m_ui->m_listAvailableActions->sortItems(Qt::SortOrder::AscendingOrder);
|
||||
updateActionsAvailability();
|
||||
emit setupChanged();
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ void TreeWidget::filterString(const QString& string) {
|
||||
bool stringIsEmpty = string.isEmpty();
|
||||
|
||||
for (QTreeWidgetItem* item : _allItems) {
|
||||
bool containsString = stringIsEmpty || item->text(0).contains(string, Qt::CaseInsensitive);
|
||||
bool containsString = stringIsEmpty || item->text(0).contains(string, Qt::CaseSensitivity::CaseInsensitive);
|
||||
|
||||
if (containsString) {
|
||||
item->setHidden(false);
|
||||
@ -136,7 +136,7 @@ void TreeWidget::filterString(const QString& string) {
|
||||
}
|
||||
|
||||
bool TreeWidget::appendToParentItem(const QString& parentText, QTreeWidgetItem* item) {
|
||||
QList<QTreeWidgetItem*> list = findItems(parentText, Qt::MatchExactly);
|
||||
QList<QTreeWidgetItem*> list = findItems(parentText, Qt::MatchFlag::MatchExactly);
|
||||
|
||||
if (list.count() == 0) {
|
||||
return false;
|
||||
@ -164,7 +164,7 @@ bool TreeWidget::appendToParentItem(QTreeWidgetItem* parent, QTreeWidgetItem* it
|
||||
}
|
||||
|
||||
bool TreeWidget::prependToParentItem(const QString& parentText, QTreeWidgetItem* item) {
|
||||
QList<QTreeWidgetItem*> list = findItems(parentText, Qt::MatchExactly);
|
||||
QList<QTreeWidgetItem*> list = findItems(parentText, Qt::MatchFlag::MatchExactly);
|
||||
|
||||
if (list.count() == 0) {
|
||||
return false;
|
||||
|
@ -29,10 +29,10 @@ WebBrowser::WebBrowser(QWidget* parent) : TabContent(parent),
|
||||
m_searchWidget(new SearchTextWidget(this)),
|
||||
m_txtLocation(new LocationLineEdit(this)),
|
||||
m_btnDiscoverFeeds(new DiscoverFeedsButton(this)),
|
||||
m_actionBack(m_webView->pageAction(QWebEnginePage::Back)),
|
||||
m_actionForward(m_webView->pageAction(QWebEnginePage::Forward)),
|
||||
m_actionReload(m_webView->pageAction(QWebEnginePage::Reload)),
|
||||
m_actionStop(m_webView->pageAction(QWebEnginePage::Stop)),
|
||||
m_actionBack(m_webView->pageAction(QWebEnginePage::WebAction::Back)),
|
||||
m_actionForward(m_webView->pageAction(QWebEnginePage::WebAction::Forward)),
|
||||
m_actionReload(m_webView->pageAction(QWebEnginePage::WebAction::Reload)),
|
||||
m_actionStop(m_webView->pageAction(QWebEnginePage::WebAction::Stop)),
|
||||
m_actionOpenInSystemBrowser(new QAction(qApp->icons()->fromTheme(QSL("document-open")),
|
||||
tr("Open this website in system web browser"),
|
||||
this)) {
|
||||
@ -53,7 +53,7 @@ void WebBrowser::createConnections() {
|
||||
});
|
||||
connect(m_searchWidget, &SearchTextWidget::searchForText, this, [this](const QString& text, bool backwards) {
|
||||
if (backwards) {
|
||||
m_webView->findText(text, QWebEnginePage::FindBackward);
|
||||
m_webView->findText(text, QWebEnginePage::FindFlag::FindBackward);
|
||||
}
|
||||
else {
|
||||
m_webView->findText(text);
|
||||
@ -230,7 +230,7 @@ void WebBrowser::initializeLayout() {
|
||||
m_loadingProgress->setMinimum(0);
|
||||
m_loadingProgress->setTextVisible(false);
|
||||
m_loadingProgress->setMaximum(100);
|
||||
m_loadingProgress->setAttribute(Qt::WA_TranslucentBackground);
|
||||
m_loadingProgress->setAttribute(Qt::WidgetAttribute::WA_TranslucentBackground);
|
||||
|
||||
// Setup layout.
|
||||
m_layout->addWidget(m_toolBar);
|
||||
|
@ -11,7 +11,7 @@ WidgetWithStatus::WidgetWithStatus(QWidget* parent)
|
||||
: QWidget(parent), m_wdgInput(nullptr) {
|
||||
m_layout = new QHBoxLayout(this);
|
||||
m_btnStatus = new PlainToolButton(this);
|
||||
m_btnStatus->setFocusPolicy(Qt::NoFocus);
|
||||
m_btnStatus->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
||||
m_iconProgress = qApp->icons()->fromTheme(QSL("view-refresh"));
|
||||
m_iconInformation = qApp->icons()->fromTheme(QSL("dialog-information"));
|
||||
m_iconWarning = qApp->icons()->fromTheme(QSL("dialog-warning"));
|
||||
|
@ -123,7 +123,6 @@ HEADERS += core/feeddownloader.h \
|
||||
miscellaneous/regexfactory.h \
|
||||
miscellaneous/settings.h \
|
||||
miscellaneous/settingsproperties.h \
|
||||
miscellaneous/simplecrypt/simplecrypt.h \
|
||||
miscellaneous/skinfactory.h \
|
||||
miscellaneous/systemfactory.h \
|
||||
miscellaneous/templates.h \
|
||||
@ -137,10 +136,6 @@ HEADERS += core/feeddownloader.h \
|
||||
network-web/oauthhttphandler.h \
|
||||
network-web/silentnetworkaccessmanager.h \
|
||||
network-web/webfactory.h \
|
||||
qtsingleapplication/qtlocalpeer.h \
|
||||
qtsingleapplication/qtlockedfile.h \
|
||||
qtsingleapplication/qtsingleapplication.h \
|
||||
qtsingleapplication/qtsinglecoreapplication.h \
|
||||
services/abstract/accountcheckmodel.h \
|
||||
services/abstract/cacheforserviceroot.h \
|
||||
services/abstract/category.h \
|
||||
@ -303,7 +298,6 @@ SOURCES += core/feeddownloader.cpp \
|
||||
miscellaneous/mutex.cpp \
|
||||
miscellaneous/regexfactory.cpp \
|
||||
miscellaneous/settings.cpp \
|
||||
miscellaneous/simplecrypt/simplecrypt.cpp \
|
||||
miscellaneous/skinfactory.cpp \
|
||||
miscellaneous/systemfactory.cpp \
|
||||
miscellaneous/textfactory.cpp \
|
||||
@ -316,10 +310,6 @@ SOURCES += core/feeddownloader.cpp \
|
||||
network-web/oauthhttphandler.cpp \
|
||||
network-web/silentnetworkaccessmanager.cpp \
|
||||
network-web/webfactory.cpp \
|
||||
qtsingleapplication/qtlocalpeer.cpp \
|
||||
qtsingleapplication/qtlockedfile.cpp \
|
||||
qtsingleapplication/qtsingleapplication.cpp \
|
||||
qtsingleapplication/qtsinglecoreapplication.cpp \
|
||||
services/abstract/accountcheckmodel.cpp \
|
||||
services/abstract/cacheforserviceroot.cpp \
|
||||
services/abstract/category.cpp \
|
||||
@ -493,6 +483,18 @@ HEADERS += $$files(3rd-party/mimesis/*.hpp, false)
|
||||
# Add boolinq.
|
||||
HEADERS += $$files(3rd-party/boolinq/*.h, false)
|
||||
|
||||
# Add QtSingleApplication.
|
||||
SOURCES += 3rd-party/qts/qtlocalpeer.cpp \
|
||||
3rd-party/qts/qtlockedfile.cpp \
|
||||
3rd-party/qts/qtsingleapplication.cpp \
|
||||
3rd-party/qts/qtsinglecoreapplication.cpp
|
||||
HEADERS += $$files(3rd-party/qts/*.h , false)
|
||||
|
||||
# Add SimpleCrypt.
|
||||
SOURCES += $$files(3rd-party/sc/*.cpp, false)
|
||||
HEADERS += $$files(3rd-party/sc/*.h, false)
|
||||
|
||||
|
||||
INCLUDEPATH += $$PWD/. \
|
||||
$$PWD/gui \
|
||||
$$PWD/gui/dialogs \
|
||||
|
@ -361,7 +361,7 @@ void Application::processExecutionMessage(const QString& message) {
|
||||
else {
|
||||
for (const QString& msg : messages) {
|
||||
if (msg == APP_IS_RUNNING) {
|
||||
showGuiMessage(APP_NAME, tr("Application is already running."), QSystemTrayIcon::Information);
|
||||
showGuiMessage(APP_NAME, tr("Application is already running."), QSystemTrayIcon::MessageIcon::Information);
|
||||
mainForm()->display();
|
||||
}
|
||||
else if (msg.startsWith(QL1S(URI_SCHEME_FEED_SHORT))) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
#ifndef APPLICATION_H
|
||||
#define APPLICATION_H
|
||||
|
||||
#include "qtsingleapplication/qtsingleapplication.h"
|
||||
#include "3rd-party/qts/qtsingleapplication.h"
|
||||
|
||||
#include "core/feeddownloader.h"
|
||||
#include "database/databasefactory.h"
|
||||
|
@ -46,7 +46,7 @@ SystemFactory::AutoStartStatus SystemFactory::autoStartStatus() const {
|
||||
// User registry way to auto-start the application on Windows.
|
||||
#if defined(Q_OS_WIN)
|
||||
QSettings registry_key(QSL("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run"),
|
||||
QSettings::NativeFormat);
|
||||
QSettings::Format::NativeFormat);
|
||||
const bool autostart_enabled = registry_key.value(QSL(APP_LOW_NAME),
|
||||
QString()).toString().replace(QL1C('\\'),
|
||||
QL1C('/')) ==
|
||||
@ -177,7 +177,7 @@ bool SystemFactory::removeTrolltechJunkRegistryKeys() {
|
||||
|
||||
registry_key.remove(QString());
|
||||
registry_key.sync();
|
||||
return registry_key.status() == QSettings::NoError;
|
||||
return registry_key.status() == QSettings::Status::NoError;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
@ -224,7 +224,7 @@ void SystemFactory::checkForUpdatesOnStartup() {
|
||||
this, [&](QPair<QList<UpdateInfo>, QNetworkReply::NetworkError> updates) {
|
||||
QObject::disconnect(qApp->system(), &SystemFactory::updatesChecked, this, nullptr);
|
||||
|
||||
if (!updates.first.isEmpty() && updates.second == QNetworkReply::NoError &&
|
||||
if (!updates.first.isEmpty() && updates.second == QNetworkReply::NetworkError::NoError &&
|
||||
SystemFactory::isVersionNewer(updates.first.at(0).m_availableVersion, APP_VERSION)) {
|
||||
qApp->showGuiMessage(QObject::tr("New version available"),
|
||||
QObject::tr("Click the bubble for more information."),
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
#include "miscellaneous/textfactory.h"
|
||||
|
||||
#include "3rd-party/sc/simplecrypt.h"
|
||||
#include "definitions/definitions.h"
|
||||
#include "exceptions/applicationexception.h"
|
||||
#include "miscellaneous/application.h"
|
||||
#include "miscellaneous/iofactory.h"
|
||||
#include "miscellaneous/simplecrypt/simplecrypt.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QLocale>
|
||||
@ -71,7 +71,7 @@ QDateTime TextFactory::parseDateTime(const QString& date_time) {
|
||||
const QString input_date = date_time.simplified();
|
||||
QDateTime dt;
|
||||
QTime time_zone_offset;
|
||||
const QLocale locale(QLocale::C);
|
||||
const QLocale locale(QLocale::Language::C);
|
||||
bool positive_time_zone_offset = false;
|
||||
QStringList date_patterns;
|
||||
|
||||
@ -91,7 +91,7 @@ QDateTime TextFactory::parseDateTime(const QString& date_time) {
|
||||
|
||||
if (dt.isValid()) {
|
||||
// Make sure that this date/time is considered UTC.
|
||||
dt.setTimeSpec(Qt::UTC);
|
||||
dt.setTimeSpec(Qt::TimeSpec::UTC);
|
||||
|
||||
// We find offset from UTC.
|
||||
if (input_date.size() >= TIMEZONE_OFFSET_LIMIT) {
|
||||
|
@ -29,11 +29,11 @@
|
||||
|
||||
AdBlockTreeWidget::AdBlockTreeWidget(AdBlockSubscription* subscription, QWidget* parent)
|
||||
: TreeWidget(parent), m_subscription(subscription), m_topItem(nullptr), m_itemChangingBlock(false) {
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
|
||||
setDefaultItemShowMode(TreeWidget::ItemShowMode::ItemsExpanded);
|
||||
setHeaderHidden(true);
|
||||
setAlternatingRowColors(true);
|
||||
setLayoutDirection(Qt::LeftToRight);
|
||||
setLayoutDirection(Qt::LayoutDirection::LeftToRight);
|
||||
setIndentation(5);
|
||||
|
||||
connect(this, &QWidget::customContextMenuRequested, this, &AdBlockTreeWidget::contextMenuRequested);
|
||||
@ -51,13 +51,13 @@ void AdBlockTreeWidget::showRule(const AdBlockRule* rule) {
|
||||
m_ruleToBeSelected = rule->filter();
|
||||
}
|
||||
else if (!m_ruleToBeSelected.isEmpty()) {
|
||||
QList<QTreeWidgetItem*> items = findItems(m_ruleToBeSelected, Qt::MatchRecursive);
|
||||
QList<QTreeWidgetItem*> items = findItems(m_ruleToBeSelected, Qt::MatchFlag::MatchRecursive);
|
||||
|
||||
if (!items.isEmpty()) {
|
||||
QTreeWidgetItem* item = items.at(0);
|
||||
|
||||
setCurrentItem(item);
|
||||
scrollToItem(item, QAbstractItemView::PositionAtCenter);
|
||||
scrollToItem(item, QAbstractItemView::ScrollHint::PositionAtCenter);
|
||||
}
|
||||
|
||||
m_ruleToBeSelected.clear();
|
||||
@ -146,8 +146,8 @@ void AdBlockTreeWidget::addRule() {
|
||||
auto* item = new QTreeWidgetItem();
|
||||
|
||||
item->setText(0, newRule);
|
||||
item->setData(0, Qt::UserRole + 10, offset);
|
||||
item->setFlags(item->flags() | Qt::ItemIsEditable);
|
||||
item->setData(0, Qt::ItemDataRole::UserRole + 10, offset);
|
||||
item->setFlags(item->flags() | Qt::ItemFlag::ItemIsEditable);
|
||||
m_itemChangingBlock = true;
|
||||
m_topItem->addChild(item);
|
||||
m_itemChangingBlock = false;
|
||||
@ -161,7 +161,7 @@ void AdBlockTreeWidget::removeRule() {
|
||||
return;
|
||||
}
|
||||
|
||||
int offset = item->data(0, Qt::UserRole + 10).toInt();
|
||||
int offset = item->data(0, Qt::ItemDataRole::UserRole + 10).toInt();
|
||||
|
||||
m_subscription->removeRule(offset);
|
||||
deleteItem(item);
|
||||
@ -186,39 +186,39 @@ void AdBlockTreeWidget::adjustItemFeatures(QTreeWidgetItem* item, const AdBlockR
|
||||
QFont font;
|
||||
|
||||
font.setItalic(true);
|
||||
item->setForeground(0, QColor(Qt::gray));
|
||||
item->setForeground(0, QColor(Qt::GlobalColor::gray));
|
||||
|
||||
if (!rule->isComment()) {
|
||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||
item->setCheckState(0, Qt::Unchecked);
|
||||
item->setFlags(item->flags() | Qt::ItemFlag::ItemIsUserCheckable);
|
||||
item->setCheckState(0, Qt::CheckState::Unchecked);
|
||||
item->setFont(0, font);
|
||||
}
|
||||
}
|
||||
else {
|
||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||
item->setCheckState(0, Qt::Checked);
|
||||
item->setFlags(item->flags() | Qt::ItemFlag::ItemIsUserCheckable);
|
||||
item->setCheckState(0, Qt::CheckState::Checked);
|
||||
|
||||
if (rule->isException()) {
|
||||
item->setForeground(0, QColor(Qt::darkGreen));
|
||||
item->setForeground(0, QColor(Qt::GlobalColor::darkGreen));
|
||||
item->setFont(0, QFont());
|
||||
}
|
||||
else if (rule->isCssRule()) {
|
||||
item->setForeground(0, QColor(Qt::darkBlue));
|
||||
item->setForeground(0, QColor(Qt::GlobalColor::darkBlue));
|
||||
item->setFont(0, QFont());
|
||||
}
|
||||
else {
|
||||
item->setForeground(0, QColor(Qt::black));
|
||||
item->setForeground(0, QColor(Qt::GlobalColor::black));
|
||||
item->setFont(0, QFont());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AdBlockTreeWidget::keyPressEvent(QKeyEvent* event) {
|
||||
if (event->key() == Qt::Key_C && (event->modifiers() & Qt::ControlModifier) != 0) {
|
||||
if (event->key() == Qt::Key::Key_C && (event->modifiers() & Qt::KeyboardModifier::ControlModifier) != 0) {
|
||||
copyFilter();
|
||||
}
|
||||
|
||||
if (event->key() == Qt::Key_Delete) {
|
||||
if (event->key() == Qt::Key::Key_Delete) {
|
||||
removeRule();
|
||||
}
|
||||
|
||||
@ -243,10 +243,10 @@ void AdBlockTreeWidget::refresh() {
|
||||
auto* item = new QTreeWidgetItem(m_topItem);
|
||||
|
||||
item->setText(0, rule->filter());
|
||||
item->setData(0, Qt::UserRole + 10, index);
|
||||
item->setData(0, Qt::ItemDataRole::UserRole + 10, index);
|
||||
|
||||
if (m_subscription->canEditRules()) {
|
||||
item->setFlags(item->flags() | Qt::ItemIsEditable);
|
||||
item->setFlags(item->flags() | Qt::ItemFlag::ItemIsEditable);
|
||||
}
|
||||
|
||||
adjustItemFeatures(item, rule);
|
||||
|
@ -113,7 +113,7 @@ void Downloader::finished() {
|
||||
m_lastOutputMultipartData = decodeMultipartAnswer(reply);
|
||||
}
|
||||
|
||||
m_lastContentType = reply->header(QNetworkRequest::ContentTypeHeader);
|
||||
m_lastContentType = reply->header(QNetworkRequest::KnownHeaders::ContentTypeHeader);
|
||||
m_lastOutputError = reply->error();
|
||||
m_activeReply->deleteLater();
|
||||
m_activeReply = nullptr;
|
||||
|
@ -281,7 +281,7 @@ void DownloadItem::error(QNetworkReply::NetworkError code) {
|
||||
}
|
||||
|
||||
void DownloadItem::metaDataChanged() {
|
||||
QVariant locationHeader = m_reply->header(QNetworkRequest::LocationHeader);
|
||||
QVariant locationHeader = m_reply->header(QNetworkRequest::KnownHeaders::LocationHeader);
|
||||
|
||||
if (locationHeader.isValid()) {
|
||||
m_url = locationHeader.toUrl();
|
||||
@ -497,7 +497,7 @@ void DownloadManager::handleUnsupportedContent(QNetworkReply* reply) {
|
||||
return;
|
||||
}
|
||||
|
||||
const QVariant header = reply->header(QNetworkRequest::ContentLengthHeader);
|
||||
const QVariant header = reply->header(QNetworkRequest::KnownHeaders::ContentLengthHeader);
|
||||
bool ok;
|
||||
const int size = header.toInt(&ok);
|
||||
|
||||
@ -526,7 +526,7 @@ void DownloadManager::addItem(DownloadItem* item) {
|
||||
m_downloads.append(item);
|
||||
m_model->endInsertRows();
|
||||
m_ui->m_viewDownloads->setIndexWidget(m_model->index(row, 0), item);
|
||||
QIcon icon = style()->standardIcon(QStyle::SP_FileIcon);
|
||||
QIcon icon = style()->standardIcon(QStyle::StandardPixmap::SP_FileIcon);
|
||||
|
||||
item->m_ui->m_lblFileIcon->setPixmap(icon.pixmap(DOWNLOADER_ICON_SIZE, DOWNLOADER_ICON_SIZE));
|
||||
m_ui->m_viewDownloads->setRowHeight(row, item->sizeHint().height());
|
||||
@ -578,7 +578,7 @@ void DownloadManager::updateRow(DownloadItem* item) {
|
||||
QIcon icon = m_iconProvider->icon(item->m_output.fileName());
|
||||
|
||||
if (icon.isNull()) {
|
||||
icon = style()->standardIcon(QStyle::SP_FileIcon);
|
||||
icon = style()->standardIcon(QStyle::StandardPixmap::SP_FileIcon);
|
||||
}
|
||||
|
||||
item->m_ui->m_lblFileIcon->setPixmap(icon.pixmap(DOWNLOADER_ICON_SIZE, DOWNLOADER_ICON_SIZE));
|
||||
|
@ -45,13 +45,13 @@
|
||||
|
||||
GoogleSuggest::GoogleSuggest(LocationLineEdit* editor, QObject* parent)
|
||||
: QObject(parent), editor(editor), m_downloader(new Downloader(this)), popup(new QListWidget()), m_enteredText(QString()) {
|
||||
popup->setWindowFlags(Qt::Popup);
|
||||
popup->setFocusPolicy(Qt::NoFocus);
|
||||
popup->setWindowFlags(Qt::WindowType::Popup);
|
||||
popup->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
||||
popup->setFocusProxy(editor);
|
||||
popup->setMouseTracking(true);
|
||||
popup->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
popup->setFrameStyle(QFrame::Box | QFrame::Plain);
|
||||
popup->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
popup->setSelectionBehavior(QAbstractItemView::SelectionBehavior::SelectRows);
|
||||
popup->setFrameStyle(QFrame::Shape::Box | QFrame::Shadow::Plain);
|
||||
popup->setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAlwaysOff);
|
||||
popup->installEventFilter(this);
|
||||
timer = new QTimer(this);
|
||||
timer->setSingleShot(true);
|
||||
|
@ -157,7 +157,7 @@ void OAuth2Service::retrieveAccessToken(const QString& auth_code) {
|
||||
QNetworkRequest networkRequest;
|
||||
|
||||
networkRequest.setUrl(m_tokenUrl);
|
||||
networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
||||
networkRequest.setHeader(QNetworkRequest::KnownHeaders::ContentTypeHeader, "application/x-www-form-urlencoded");
|
||||
|
||||
QString content = QString("client_id=%1&"
|
||||
"client_secret=%2&"
|
||||
@ -178,7 +178,7 @@ void OAuth2Service::refreshAccessToken(const QString& refresh_token) {
|
||||
QNetworkRequest networkRequest;
|
||||
|
||||
networkRequest.setUrl(m_tokenUrl);
|
||||
networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
||||
networkRequest.setHeader(QNetworkRequest::KnownHeaders::ContentTypeHeader, "application/x-www-form-urlencoded");
|
||||
|
||||
QString content = QString("client_id=%1&"
|
||||
"client_secret=%2&"
|
||||
|
@ -256,29 +256,29 @@ void WebFactory::createMenu(QMenu* menu) {
|
||||
menu->clear();
|
||||
QList<QAction*> actions;
|
||||
|
||||
actions << createEngineSettingsAction(tr("Auto-load images"), QWebEngineSettings::AutoLoadImages);
|
||||
actions << createEngineSettingsAction(tr("JS enabled"), QWebEngineSettings::JavascriptEnabled);
|
||||
actions << createEngineSettingsAction(tr("JS can open popup windows"), QWebEngineSettings::JavascriptCanOpenWindows);
|
||||
actions << createEngineSettingsAction(tr("JS can access clipboard"), QWebEngineSettings::JavascriptCanAccessClipboard);
|
||||
actions << createEngineSettingsAction(tr("Hyperlinks can get focus"), QWebEngineSettings::LinksIncludedInFocusChain);
|
||||
actions << createEngineSettingsAction(tr("Local storage enabled"), QWebEngineSettings::LocalStorageEnabled);
|
||||
actions << createEngineSettingsAction(tr("Local content can access remote URLs"), QWebEngineSettings::LocalContentCanAccessRemoteUrls);
|
||||
actions << createEngineSettingsAction(tr("XSS auditing enabled"), QWebEngineSettings::XSSAuditingEnabled);
|
||||
actions << createEngineSettingsAction(tr("Spatial navigation enabled"), QWebEngineSettings::SpatialNavigationEnabled);
|
||||
actions << createEngineSettingsAction(tr("Local content can access local files"), QWebEngineSettings::LocalContentCanAccessFileUrls);
|
||||
actions << createEngineSettingsAction(tr("Hyperlink auditing enabled"), QWebEngineSettings::HyperlinkAuditingEnabled);
|
||||
actions << createEngineSettingsAction(tr("Animate scrolling"), QWebEngineSettings::ScrollAnimatorEnabled);
|
||||
actions << createEngineSettingsAction(tr("Error pages enabled"), QWebEngineSettings::ErrorPageEnabled);
|
||||
actions << createEngineSettingsAction(tr("Plugins enabled"), QWebEngineSettings::PluginsEnabled);
|
||||
actions << createEngineSettingsAction(tr("Fullscreen enabled"), QWebEngineSettings::FullScreenSupportEnabled);
|
||||
actions << createEngineSettingsAction(tr("Auto-load images"), QWebEngineSettings::WebAttribute::AutoLoadImages);
|
||||
actions << createEngineSettingsAction(tr("JS enabled"), QWebEngineSettings::WebAttribute::JavascriptEnabled);
|
||||
actions << createEngineSettingsAction(tr("JS can open popup windows"), QWebEngineSettings::WebAttribute::JavascriptCanOpenWindows);
|
||||
actions << createEngineSettingsAction(tr("JS can access clipboard"), QWebEngineSettings::WebAttribute::JavascriptCanAccessClipboard);
|
||||
actions << createEngineSettingsAction(tr("Hyperlinks can get focus"), QWebEngineSettings::WebAttribute::LinksIncludedInFocusChain);
|
||||
actions << createEngineSettingsAction(tr("Local storage enabled"), QWebEngineSettings::WebAttribute::LocalStorageEnabled);
|
||||
actions << createEngineSettingsAction(tr("Local content can access remote URLs"), QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls);
|
||||
actions << createEngineSettingsAction(tr("XSS auditing enabled"), QWebEngineSettings::WebAttribute::XSSAuditingEnabled);
|
||||
actions << createEngineSettingsAction(tr("Spatial navigation enabled"), QWebEngineSettings::WebAttribute::SpatialNavigationEnabled);
|
||||
actions << createEngineSettingsAction(tr("Local content can access local files"), QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls);
|
||||
actions << createEngineSettingsAction(tr("Hyperlink auditing enabled"), QWebEngineSettings::WebAttribute::HyperlinkAuditingEnabled);
|
||||
actions << createEngineSettingsAction(tr("Animate scrolling"), QWebEngineSettings::WebAttribute::ScrollAnimatorEnabled);
|
||||
actions << createEngineSettingsAction(tr("Error pages enabled"), QWebEngineSettings::WebAttribute::ErrorPageEnabled);
|
||||
actions << createEngineSettingsAction(tr("Plugins enabled"), QWebEngineSettings::WebAttribute::PluginsEnabled);
|
||||
actions << createEngineSettingsAction(tr("Fullscreen enabled"), QWebEngineSettings::WebAttribute::FullScreenSupportEnabled);
|
||||
|
||||
#if !defined(Q_OS_LINUX)
|
||||
actions << createEngineSettingsAction(tr("Screen capture enabled"), QWebEngineSettings::ScreenCaptureEnabled);
|
||||
actions << createEngineSettingsAction(tr("WebGL enabled"), QWebEngineSettings::WebGLEnabled);
|
||||
actions << createEngineSettingsAction(tr("Accelerate 2D canvas"), QWebEngineSettings::Accelerated2dCanvasEnabled);
|
||||
actions << createEngineSettingsAction(tr("Print element backgrounds"), QWebEngineSettings::PrintElementBackgrounds);
|
||||
actions << createEngineSettingsAction(tr("Allow running insecure content"), QWebEngineSettings::AllowRunningInsecureContent);
|
||||
actions << createEngineSettingsAction(tr("Allow geolocation on insecure origins"), QWebEngineSettings::AllowGeolocationOnInsecureOrigins);
|
||||
actions << createEngineSettingsAction(tr("Screen capture enabled"), QWebEngineSettings::WebAttribute::ScreenCaptureEnabled);
|
||||
actions << createEngineSettingsAction(tr("WebGL enabled"), QWebEngineSettings::WebAttribute::WebGLEnabled);
|
||||
actions << createEngineSettingsAction(tr("Accelerate 2D canvas"), QWebEngineSettings::WebAttribute::Accelerated2dCanvasEnabled);
|
||||
actions << createEngineSettingsAction(tr("Print element backgrounds"), QWebEngineSettings::WebAttribute::PrintElementBackgrounds);
|
||||
actions << createEngineSettingsAction(tr("Allow running insecure content"), QWebEngineSettings::WebAttribute::AllowRunningInsecureContent);
|
||||
actions << createEngineSettingsAction(tr("Allow geolocation on insecure origins"), QWebEngineSettings::WebAttribute::AllowGeolocationOnInsecureOrigins);
|
||||
#endif
|
||||
|
||||
menu->addActions(actions);
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <QWebEngineScript>
|
||||
|
||||
WebPage::WebPage(QObject* parent) : QWebEnginePage(parent) {
|
||||
setBackgroundColor(Qt::transparent);
|
||||
setBackgroundColor(Qt::GlobalColor::transparent);
|
||||
|
||||
connect(this, &QWebEnginePage::loadFinished, this, &WebPage::hideUnwantedElements);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ void AccountCheckModel::checkAllItems() {
|
||||
|
||||
for (RootItem* root_child : qAsConst(chi)) {
|
||||
if (root_child->kind() == RootItem::Kind::Feed || root_child->kind() == RootItem::Kind::Category) {
|
||||
setItemChecked(root_child, Qt::Checked);
|
||||
setItemChecked(root_child, Qt::CheckState::Checked);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -58,7 +58,7 @@ void AccountCheckModel::uncheckAllItems() {
|
||||
|
||||
for (RootItem* root_child : qAsConst(chi)) {
|
||||
if (root_child->kind() == RootItem::Kind::Feed || root_child->kind() == RootItem::Kind::Category) {
|
||||
setData(indexForItem(root_child), Qt::Unchecked, Qt::CheckStateRole);
|
||||
setData(indexForItem(root_child), Qt::CheckState::Unchecked, Qt::ItemDataRole::CheckStateRole);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -293,7 +293,7 @@ bool AccountCheckModel::isItemChecked(RootItem* item) const {
|
||||
}
|
||||
|
||||
bool AccountCheckModel::setItemChecked(RootItem* item, Qt::CheckState check) {
|
||||
return setData(indexForItem(item), check, Qt::CheckStateRole);
|
||||
return setData(indexForItem(item), check, Qt::ItemDataRole::CheckStateRole);
|
||||
}
|
||||
|
||||
AccountCheckSortedModel::AccountCheckSortedModel(QObject* parent)
|
||||
|
@ -130,19 +130,19 @@ void FormCategoryDetails::onLoadIconFromFile() {
|
||||
QFileDialog dialog(this, tr("Select icon file for the category"),
|
||||
qApp->homeFolder(), tr("Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga)"));
|
||||
|
||||
dialog.setFileMode(QFileDialog::ExistingFile);
|
||||
dialog.setFileMode(QFileDialog::FileMode::ExistingFile);
|
||||
dialog.setWindowIcon(qApp->icons()->fromTheme(QSL("image-x-generic")));
|
||||
dialog.setOptions(QFileDialog::DontUseNativeDialog | QFileDialog::ReadOnly);
|
||||
dialog.setViewMode(QFileDialog::Detail);
|
||||
dialog.setLabelText(QFileDialog::Accept, tr("Select icon"));
|
||||
dialog.setLabelText(QFileDialog::Reject, tr("Cancel"));
|
||||
dialog.setOptions(QFileDialog::Option::DontUseNativeDialog | QFileDialog::Option::ReadOnly);
|
||||
dialog.setViewMode(QFileDialog::ViewMode::Detail);
|
||||
dialog.setLabelText(QFileDialog::DialogLabel::Accept, tr("Select icon"));
|
||||
dialog.setLabelText(QFileDialog::DialogLabel::Reject, tr("Cancel"));
|
||||
|
||||
//: Label to describe the folder for icon file selection dialog.
|
||||
dialog.setLabelText(QFileDialog::LookIn, tr("Look in:"));
|
||||
dialog.setLabelText(QFileDialog::FileName, tr("Icon name:"));
|
||||
dialog.setLabelText(QFileDialog::FileType, tr("Icon type:"));
|
||||
dialog.setLabelText(QFileDialog::DialogLabel::LookIn, tr("Look in:"));
|
||||
dialog.setLabelText(QFileDialog::DialogLabel::FileName, tr("Icon name:"));
|
||||
dialog.setLabelText(QFileDialog::DialogLabel::FileType, tr("Icon type:"));
|
||||
|
||||
if (dialog.exec() == QDialog::Accepted) {
|
||||
if (dialog.exec() == QDialog::DialogCode::Accepted) {
|
||||
m_ui->m_btnIcon->setIcon(QIcon(dialog.selectedFiles().value(0)));
|
||||
}
|
||||
}
|
||||
@ -185,7 +185,7 @@ void FormCategoryDetails::initialize() {
|
||||
setTabOrder(m_ui->m_txtTitle->lineEdit(), m_ui->m_txtDescription->lineEdit());
|
||||
setTabOrder(m_ui->m_txtDescription->lineEdit(), m_ui->m_btnIcon);
|
||||
setTabOrder(m_ui->m_btnIcon, m_ui->m_buttonBox);
|
||||
m_ui->m_txtTitle->lineEdit()->setFocus(Qt::TabFocusReason);
|
||||
m_ui->m_txtTitle->lineEdit()->setFocus(Qt::FocusReason::TabFocusReason);
|
||||
}
|
||||
|
||||
void FormCategoryDetails::loadCategories(const QList<Category*>& categories,
|
||||
|
@ -252,7 +252,7 @@ bool OwnCloudNetworkFactory::renameFeed(const QString& new_name,
|
||||
qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::UpdateTimeout)).toInt(),
|
||||
QJsonDocument(json).toJson(QJsonDocument::JsonFormat::Compact),
|
||||
result_raw,
|
||||
QNetworkAccessManager::PutOperation,
|
||||
QNetworkAccessManager::Operation::PutOperation,
|
||||
headers,
|
||||
false,
|
||||
{},
|
||||
@ -523,7 +523,7 @@ RootItem* OwnCloudGetFeedsCategoriesResponse::feedsCategories(bool obtain_icons)
|
||||
|
||||
if (NetworkFactory::performNetworkOperation(icon_path, DOWNLOAD_TIMEOUT,
|
||||
QByteArray(), icon_data,
|
||||
QNetworkAccessManager::GetOperation).first ==
|
||||
QNetworkAccessManager::Operation::GetOperation).first ==
|
||||
QNetworkReply::NetworkError::NoError) {
|
||||
// Icon downloaded, set it up.
|
||||
QPixmap icon_pixmap;
|
||||
|
@ -175,7 +175,8 @@ void StandardFeedDetails::guessFeed(StandardFeed::SourceType source_type, const
|
||||
m_ui.m_cmbEncoding->setCurrentIndex(encoding_index);
|
||||
}
|
||||
else {
|
||||
m_ui.m_cmbEncoding->setCurrentIndex(m_ui.m_cmbEncoding->findText(DEFAULT_FEED_ENCODING, Qt::MatchFixedString));
|
||||
m_ui.m_cmbEncoding->setCurrentIndex(m_ui.m_cmbEncoding->findText(DEFAULT_FEED_ENCODING,
|
||||
Qt::MatchFlag::MatchFixedString));
|
||||
}
|
||||
|
||||
m_ui.m_lblFetchMetadata->setStatus(WidgetWithStatus::StatusType::Ok,
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "gui/feedsview.h"
|
||||
#include "miscellaneous/iconfactory.h"
|
||||
#include "miscellaneous/settings.h"
|
||||
#include "miscellaneous/simplecrypt/simplecrypt.h"
|
||||
#include "3rd-party/sc/simplecrypt.h"
|
||||
#include "miscellaneous/textfactory.h"
|
||||
#include "network-web/networkfactory.h"
|
||||
#include "services/abstract/recyclebin.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user