mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 17:18:23 -04:00
YACReader/viewer: Convert a bunch of loosely related signals to new syntax
This commit is contained in:
parent
d9ca26faf0
commit
5b66153390
@ -213,7 +213,7 @@ void MainWindowViewer::createActions()
|
|||||||
openAction->setToolTip(tr("Open a comic"));
|
openAction->setToolTip(tr("Open a comic"));
|
||||||
openAction->setData(OPEN_ACTION_Y);
|
openAction->setData(OPEN_ACTION_Y);
|
||||||
openAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_ACTION_Y));
|
openAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPEN_ACTION_Y));
|
||||||
connect(openAction, SIGNAL(triggered()), this, SLOT(open()));
|
connect(openAction, &QAction::triggered, this, QOverload<>::of(&MainWindowViewer::open));
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
newInstanceAction = new QAction(tr("New instance"), this);
|
newInstanceAction = new QAction(tr("New instance"), this);
|
||||||
@ -438,7 +438,7 @@ void MainWindowViewer::createActions()
|
|||||||
optionsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPTIONS_ACTION_Y));
|
optionsAction->setShortcut(ShortcutsManager::getShortcutsManager().getShortcut(OPTIONS_ACTION_Y));
|
||||||
optionsAction->setIcon(QIcon(":/images/viewer_toolbar/options.png"));
|
optionsAction->setIcon(QIcon(":/images/viewer_toolbar/options.png"));
|
||||||
|
|
||||||
connect(optionsAction, SIGNAL(triggered()), optionsDialog, SLOT(show()));
|
connect(optionsAction, &QAction::triggered, optionsDialog, &OptionsDialog::show);
|
||||||
|
|
||||||
helpAboutAction = new QAction(tr("Help"), this);
|
helpAboutAction = new QAction(tr("Help"), this);
|
||||||
helpAboutAction->setToolTip(tr("Help, About YACReader"));
|
helpAboutAction->setToolTip(tr("Help, About YACReader"));
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include "translator.h"
|
#include "translator.h"
|
||||||
|
#include "viewer.h"
|
||||||
|
|
||||||
#include "yacreader_busy_widget.h"
|
#include "yacreader_busy_widget.h"
|
||||||
|
|
||||||
@ -33,7 +34,7 @@
|
|||||||
|
|
||||||
#define APPID "417CEAD93449502CC3C9B69FED26C54118E62BCC"
|
#define APPID "417CEAD93449502CC3C9B69FED26C54118E62BCC"
|
||||||
|
|
||||||
YACReaderTranslator::YACReaderTranslator(QWidget *parent)
|
YACReaderTranslator::YACReaderTranslator(Viewer *parent)
|
||||||
: QWidget(parent), drag(false)
|
: QWidget(parent), drag(false)
|
||||||
{
|
{
|
||||||
QString scrollBarStyle = "QScrollBar:vertical { border: none; background: #404040; width: 7px; margin: 0 3px 0 0; }"
|
QString scrollBarStyle = "QScrollBar:vertical { border: none; background: #404040; width: 7px; margin: 0 3px 0 0; }"
|
||||||
@ -68,7 +69,7 @@ YACReaderTranslator::YACReaderTranslator(QWidget *parent)
|
|||||||
titleBar->addWidget(close);
|
titleBar->addWidget(close);
|
||||||
titleBar->setContentsMargins(0, 0, 0, 0);
|
titleBar->setContentsMargins(0, 0, 0, 0);
|
||||||
titleBar->setSpacing(0);
|
titleBar->setSpacing(0);
|
||||||
connect(close, SIGNAL(clicked()), this->parent(), SLOT(animateHideTranslator()));
|
connect(close, &QAbstractButton::clicked, parent, &Viewer::animateHideTranslator);
|
||||||
|
|
||||||
layout->addLayout(titleBar);
|
layout->addLayout(titleBar);
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ class YACReaderBusyWidget;
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include "viewer.h"
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
#if QT_VERSION >= 0x050000
|
||||||
class QMediaPlayer;
|
class QMediaPlayer;
|
||||||
@ -25,7 +26,7 @@ class YACReaderTranslator : public QWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
YACReaderTranslator(QWidget *parent = nullptr);
|
YACReaderTranslator(Viewer *parent = nullptr);
|
||||||
~YACReaderTranslator() override;
|
~YACReaderTranslator() override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -152,7 +152,7 @@ Viewer::~Viewer()
|
|||||||
void Viewer::createConnections()
|
void Viewer::createConnections()
|
||||||
{
|
{
|
||||||
//magnifyingGlass (update mg after a background change
|
//magnifyingGlass (update mg after a background change
|
||||||
connect(this, SIGNAL(backgroundChanges()), mglass, SLOT(updateImage()));
|
connect(this, &Viewer::backgroundChanges, mglass, QOverload<>::of(&MagnifyingGlass::updateImage));
|
||||||
|
|
||||||
//goToDialog
|
//goToDialog
|
||||||
connect(goToDialog, &GoToDialog::goToPage, this, &Viewer::goTo);
|
connect(goToDialog, &GoToDialog::goToPage, this, &Viewer::goTo);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user