Fix more warnings and remove dead code
This commit is contained in:
parent
409ff22d80
commit
bb290f9fec
50 changed files with 276 additions and 695 deletions
|
|
@ -85,7 +85,7 @@ CreateRoom::CreateRoom(QWidget *parent)
|
|||
|
||||
auto directLabel_ = new QLabel(tr("Direct Chat"), this);
|
||||
directToggle_ = new Toggle(this);
|
||||
directToggle_->setActiveColor(QColor("#38A3D8"));
|
||||
directToggle_->setActiveColor(QColor(0x38, 0xA3, 0xD8));
|
||||
directToggle_->setInactiveColor(QColor("gray"));
|
||||
directToggle_->setState(false);
|
||||
|
||||
|
|
@ -120,6 +120,7 @@ CreateRoom::CreateRoom(QWidget *parent)
|
|||
|
||||
connect(visibilityCombo_,
|
||||
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentTextChanged),
|
||||
this,
|
||||
[this](const QString &text) {
|
||||
if (text == "Private") {
|
||||
request_.visibility = mtx::common::RoomVisibility::Private;
|
||||
|
|
@ -130,6 +131,7 @@ CreateRoom::CreateRoom(QWidget *parent)
|
|||
|
||||
connect(presetCombo_,
|
||||
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentTextChanged),
|
||||
this,
|
||||
[this](const QString &text) {
|
||||
if (text == "Private Chat") {
|
||||
request_.preset = mtx::requests::Preset::PrivateChat;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ FallbackAuth::FallbackAuth(const QString &authType, const QString &session, QWid
|
|||
|
||||
auto buttonLayout = new QHBoxLayout();
|
||||
buttonLayout->setSpacing(8);
|
||||
buttonLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
openBtn_ = new QPushButton(tr("Open Fallback in Browser"), this);
|
||||
cancelBtn_ = new QPushButton(tr("Cancel"), this);
|
||||
|
|
@ -58,8 +59,7 @@ FallbackAuth::FallbackAuth(const QString &authType, const QString &session, QWid
|
|||
"fallback/web?session=%3")
|
||||
.arg(QString::fromStdString(http::client()->server()))
|
||||
.arg(http::client()->port())
|
||||
.arg(session)
|
||||
.arg(authType);
|
||||
.arg(session, authType);
|
||||
|
||||
QDesktopServices::openUrl(url);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,56 +0,0 @@
|
|||
// SPDX-FileCopyrightText: 2017 Konstantinos Sideris <siderisk@auth.gr>
|
||||
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "Config.h"
|
||||
#include "dialogs/Logout.h"
|
||||
|
||||
using namespace dialogs;
|
||||
|
||||
Logout::Logout(QWidget *parent)
|
||||
: QFrame(parent)
|
||||
{
|
||||
setAutoFillBackground(true);
|
||||
setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint);
|
||||
setWindowModality(Qt::WindowModal);
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
|
||||
setMinimumWidth(conf::modals::MIN_WIDGET_WIDTH);
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->setSpacing(conf::modals::WIDGET_SPACING);
|
||||
layout->setContentsMargins(conf::modals::WIDGET_MARGIN,
|
||||
conf::modals::WIDGET_MARGIN,
|
||||
conf::modals::WIDGET_MARGIN,
|
||||
conf::modals::WIDGET_MARGIN);
|
||||
|
||||
auto buttonLayout = new QHBoxLayout();
|
||||
buttonLayout->setSpacing(0);
|
||||
|
||||
confirmBtn_ = new QPushButton("Logout", this);
|
||||
cancelBtn_ = new QPushButton(tr("Cancel"), this);
|
||||
cancelBtn_->setDefault(true);
|
||||
|
||||
buttonLayout->addStretch(1);
|
||||
buttonLayout->setSpacing(15);
|
||||
buttonLayout->addWidget(cancelBtn_);
|
||||
buttonLayout->addWidget(confirmBtn_);
|
||||
|
||||
auto label = new QLabel(tr("Logout. Are you sure?"), this);
|
||||
|
||||
layout->addWidget(label);
|
||||
layout->addLayout(buttonLayout);
|
||||
layout->addStretch(1);
|
||||
|
||||
connect(confirmBtn_, &QPushButton::clicked, this, [this]() {
|
||||
emit loggingOut();
|
||||
emit close();
|
||||
});
|
||||
connect(cancelBtn_, &QPushButton::clicked, this, &Logout::close);
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
// SPDX-FileCopyrightText: 2017 Konstantinos Sideris <siderisk@auth.gr>
|
||||
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QFrame>
|
||||
|
||||
class QPushButton;
|
||||
|
||||
namespace dialogs {
|
||||
|
||||
class Logout : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Logout(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void loggingOut();
|
||||
|
||||
private:
|
||||
QPushButton *confirmBtn_;
|
||||
QPushButton *cancelBtn_;
|
||||
};
|
||||
} // dialogs
|
||||
|
|
@ -30,6 +30,7 @@ PreviewUploadOverlay::PreviewUploadOverlay(QWidget *parent)
|
|||
, cancel_{tr("Cancel"), this}
|
||||
{
|
||||
auto hlayout = new QHBoxLayout;
|
||||
hlayout->setContentsMargins(0, 0, 0, 0);
|
||||
hlayout->addStretch(1);
|
||||
hlayout->addWidget(&cancel_);
|
||||
hlayout->addWidget(&upload_);
|
||||
|
|
@ -46,7 +47,7 @@ PreviewUploadOverlay::PreviewUploadOverlay(QWidget *parent)
|
|||
conf::modals::WIDGET_MARGIN);
|
||||
|
||||
upload_.setDefault(true);
|
||||
connect(&upload_, &QPushButton::clicked, [this]() {
|
||||
connect(&upload_, &QPushButton::clicked, this, [this]() {
|
||||
emit confirmUpload(data_, mediaType_, fileName_.text());
|
||||
close();
|
||||
});
|
||||
|
|
@ -124,8 +125,7 @@ PreviewUploadOverlay::setLabels(const QString &type, const QString &mime, uint64
|
|||
} else {
|
||||
auto const info = QString{tr("Media type: %1\n"
|
||||
"Media size: %2\n")}
|
||||
.arg(mime)
|
||||
.arg(utils::humanReadableFileSize(upload_size));
|
||||
.arg(mime, utils::humanReadableFileSize(upload_size));
|
||||
|
||||
titleLabel_.setText(QString{tr(DEFAULT)}.arg("file"));
|
||||
infoLabel_.setText(info);
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ ReCaptcha::ReCaptcha(const QString &session, QWidget *parent)
|
|||
conf::modals::WIDGET_MARGIN);
|
||||
|
||||
auto buttonLayout = new QHBoxLayout();
|
||||
buttonLayout->setContentsMargins(0, 0, 0, 0);
|
||||
buttonLayout->setSpacing(8);
|
||||
|
||||
openCaptchaBtn_ = new QPushButton("Open reCAPTCHA", this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue