mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
renamed UpdatePromptDialog to UpdateDialog
This commit is contained in:
parent
9c7c99928f
commit
6059f98c21
8 changed files with 21 additions and 21 deletions
|
@ -227,8 +227,8 @@ SOURCES += \
|
||||||
src/controllers/moderationactions/ModerationActionModel.cpp \
|
src/controllers/moderationactions/ModerationActionModel.cpp \
|
||||||
src/widgets/settingspages/LookPage.cpp \
|
src/widgets/settingspages/LookPage.cpp \
|
||||||
src/widgets/settingspages/FeelPage.cpp \
|
src/widgets/settingspages/FeelPage.cpp \
|
||||||
src/widgets/dialogs/UpdatePromptDialog.cpp \
|
src/util/InitUpdateButton.cpp \
|
||||||
src/util/InitUpdateButton.cpp
|
src/widgets/dialogs/UpdateDialog.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
src/Application.hpp \
|
src/Application.hpp \
|
||||||
|
@ -403,8 +403,8 @@ HEADERS += \
|
||||||
src/controllers/moderationactions/ModerationActionModel.hpp \
|
src/controllers/moderationactions/ModerationActionModel.hpp \
|
||||||
src/widgets/settingspages/LookPage.hpp \
|
src/widgets/settingspages/LookPage.hpp \
|
||||||
src/widgets/settingspages/FeelPage.hpp \
|
src/widgets/settingspages/FeelPage.hpp \
|
||||||
src/widgets/dialogs/UpdatePromptDialog.hpp \
|
src/util/InitUpdateButton.hpp \
|
||||||
src/util/InitUpdateButton.hpp
|
src/widgets/dialogs/UpdateDialog.hpp
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
resources/resources.qrc \
|
resources/resources.qrc \
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#include "InitUpdateButton.hpp"
|
#include "InitUpdateButton.hpp"
|
||||||
|
|
||||||
#include "widgets/dialogs/UpdatePromptDialog.hpp"
|
#include "widgets/dialogs/UpdateDialog.hpp"
|
||||||
#include "widgets/helper/RippleEffectButton.hpp"
|
#include "widgets/helper/RippleEffectButton.hpp"
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
void initUpdateButton(RippleEffectButton &button, std::unique_ptr<UpdatePromptDialog> &handle,
|
void initUpdateButton(RippleEffectButton &button, std::unique_ptr<UpdateDialog> &handle,
|
||||||
pajlada::Signals::SignalHolder &signalHolder)
|
pajlada::Signals::SignalHolder &signalHolder)
|
||||||
{
|
{
|
||||||
button.hide();
|
button.hide();
|
||||||
|
@ -14,7 +14,7 @@ void initUpdateButton(RippleEffectButton &button, std::unique_ptr<UpdatePromptDi
|
||||||
QObject::connect(&button, &RippleEffectButton::clicked, [&button, &handle] {
|
QObject::connect(&button, &RippleEffectButton::clicked, [&button, &handle] {
|
||||||
(void)(handle);
|
(void)(handle);
|
||||||
|
|
||||||
auto dialog = new UpdatePromptDialog();
|
auto dialog = new UpdateDialog();
|
||||||
dialog->setActionOnFocusLoss(BaseWindow::Delete);
|
dialog->setActionOnFocusLoss(BaseWindow::Delete);
|
||||||
dialog->move(button.mapToGlobal(QPoint(int(-100 * button.getScale()), button.height())));
|
dialog->move(button.mapToGlobal(QPoint(int(-100 * button.getScale()), button.height())));
|
||||||
dialog->show();
|
dialog->show();
|
||||||
|
@ -22,7 +22,7 @@ void initUpdateButton(RippleEffectButton &button, std::unique_ptr<UpdatePromptDi
|
||||||
|
|
||||||
dialog->buttonClicked.connect([&button](auto buttonType) {
|
dialog->buttonClicked.connect([&button](auto buttonType) {
|
||||||
switch (buttonType) {
|
switch (buttonType) {
|
||||||
case UpdatePromptDialog::Dismiss: {
|
case UpdateDialog::Dismiss: {
|
||||||
button.hide();
|
button.hide();
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,9 @@ class SignalHolder;
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
class RippleEffectButton;
|
class RippleEffectButton;
|
||||||
class UpdatePromptDialog;
|
class UpdateDialog;
|
||||||
|
|
||||||
void initUpdateButton(RippleEffectButton &button, std::unique_ptr<UpdatePromptDialog> &handle,
|
void initUpdateButton(RippleEffectButton &button, std::unique_ptr<UpdateDialog> &handle,
|
||||||
pajlada::Signals::SignalHolder &signalHolder);
|
pajlada::Signals::SignalHolder &signalHolder);
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "pajlada/signals/signal.hpp"
|
#include "pajlada/signals/signal.hpp"
|
||||||
#include "widgets/BaseWidget.hpp"
|
#include "widgets/BaseWidget.hpp"
|
||||||
#include "widgets/dialogs/UpdatePromptDialog.hpp"
|
#include "widgets/dialogs/UpdateDialog.hpp"
|
||||||
#include "widgets/helper/NotebookButton.hpp"
|
#include "widgets/helper/NotebookButton.hpp"
|
||||||
#include "widgets/helper/NotebookTab.hpp"
|
#include "widgets/helper/NotebookTab.hpp"
|
||||||
#include "widgets/splits/SplitContainer.hpp"
|
#include "widgets/splits/SplitContainer.hpp"
|
||||||
|
@ -94,7 +94,7 @@ private:
|
||||||
void addCustomButtons();
|
void addCustomButtons();
|
||||||
|
|
||||||
pajlada::Signals::SignalHolder signalHolder_;
|
pajlada::Signals::SignalHolder signalHolder_;
|
||||||
std::unique_ptr<UpdatePromptDialog> updateDialogHandle_;
|
std::unique_ptr<UpdateDialog> updateDialogHandle_;
|
||||||
|
|
||||||
std::vector<pajlada::Signals::ScopedConnection> uniqueConnections;
|
std::vector<pajlada::Signals::ScopedConnection> uniqueConnections;
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "widgets/AccountSwitchPopupWidget.hpp"
|
#include "widgets/AccountSwitchPopupWidget.hpp"
|
||||||
#include "widgets/Notebook.hpp"
|
#include "widgets/Notebook.hpp"
|
||||||
#include "widgets/dialogs/SettingsDialog.hpp"
|
#include "widgets/dialogs/SettingsDialog.hpp"
|
||||||
#include "widgets/dialogs/UpdatePromptDialog.hpp"
|
#include "widgets/dialogs/UpdateDialog.hpp"
|
||||||
#include "widgets/dialogs/WelcomeDialog.hpp"
|
#include "widgets/dialogs/WelcomeDialog.hpp"
|
||||||
#include "widgets/helper/Shortcut.hpp"
|
#include "widgets/helper/Shortcut.hpp"
|
||||||
#include "widgets/splits/Split.hpp"
|
#include "widgets/splits/Split.hpp"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "util/Helpers.hpp"
|
#include "util/Helpers.hpp"
|
||||||
#include "widgets/BaseWindow.hpp"
|
#include "widgets/BaseWindow.hpp"
|
||||||
#include "widgets/Notebook.hpp"
|
#include "widgets/Notebook.hpp"
|
||||||
#include "widgets/dialogs/UpdatePromptDialog.hpp"
|
#include "widgets/dialogs/UpdateDialog.hpp"
|
||||||
|
|
||||||
//#ifdef USEWINSDK
|
//#ifdef USEWINSDK
|
||||||
//#include <platform/borderless/qwinwidget.h>
|
//#include <platform/borderless/qwinwidget.h>
|
||||||
|
@ -46,7 +46,7 @@ private:
|
||||||
void loadGeometry();
|
void loadGeometry();
|
||||||
|
|
||||||
RippleEffectLabel *userLabel = nullptr;
|
RippleEffectLabel *userLabel = nullptr;
|
||||||
std::unique_ptr<UpdatePromptDialog> updateDialogHandle_;
|
std::unique_ptr<UpdateDialog> updateDialogHandle_;
|
||||||
|
|
||||||
WindowType type;
|
WindowType type;
|
||||||
float dpi;
|
float dpi;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "UpdatePromptDialog.hpp"
|
#include "UpdateDialog.hpp"
|
||||||
|
|
||||||
#include "singletons/Updates.hpp"
|
#include "singletons/Updates.hpp"
|
||||||
#include "util/LayoutCreator.hpp"
|
#include "util/LayoutCreator.hpp"
|
||||||
|
@ -10,11 +10,11 @@
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
UpdatePromptDialog::UpdatePromptDialog()
|
UpdateDialog::UpdateDialog()
|
||||||
: BaseWindow(nullptr, BaseWindow::Flags(BaseWindow::Frameless | BaseWindow::TopMost |
|
: BaseWindow(nullptr, BaseWindow::Flags(BaseWindow::Frameless | BaseWindow::TopMost |
|
||||||
BaseWindow::EnableCustomFrame))
|
BaseWindow::EnableCustomFrame))
|
||||||
{
|
{
|
||||||
auto layout = LayoutCreator<UpdatePromptDialog>(this).setLayoutType<QVBoxLayout>();
|
auto layout = LayoutCreator<UpdateDialog>(this).setLayoutType<QVBoxLayout>();
|
||||||
|
|
||||||
layout.emplace<Label>("You shouldn't be seeing this dialog.").assign(&this->ui_.label);
|
layout.emplace<Label>("You shouldn't be seeing this dialog.").assign(&this->ui_.label);
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ UpdatePromptDialog::UpdatePromptDialog()
|
||||||
[this](auto status) { this->updateStatusChanged(status); });
|
[this](auto status) { this->updateStatusChanged(status); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdatePromptDialog::updateStatusChanged(Updates::Status status)
|
void UpdateDialog::updateStatusChanged(Updates::Status status)
|
||||||
{
|
{
|
||||||
this->ui_.installButton->setVisible(status == Updates::UpdateAvailable);
|
this->ui_.installButton->setVisible(status == Updates::UpdateAvailable);
|
||||||
|
|
|
@ -9,12 +9,12 @@ class QPushButton;
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
class UpdatePromptDialog : public BaseWindow
|
class UpdateDialog : public BaseWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Button { Dismiss };
|
enum Button { Dismiss };
|
||||||
|
|
||||||
UpdatePromptDialog();
|
UpdateDialog();
|
||||||
|
|
||||||
pajlada::Signals::Signal<Button> buttonClicked;
|
pajlada::Signals::Signal<Button> buttonClicked;
|
||||||
|
|
Loading…
Reference in a new issue