Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
3ab05f5
run wizard introduction changes
memurats Mar 4, 2025
20365f0
update custom code
memurats Apr 4, 2025
62c96a8
fix errors
memurats Apr 4, 2025
bd5a211
update setup page
memurats May 12, 2025
1de3d8c
fix error
memurats May 12, 2025
ef3b5a3
solve client crash issue by using standard class
memurats May 13, 2025
a1a4abf
fix error
memurats May 13, 2025
af89b88
fixed layout issues
memurats May 13, 2025
4e78085
use standard setup page test
memurats May 14, 2025
9e4fe46
restore original code
memurats May 14, 2025
d0c868f
restored flow 2 auth
memurats May 14, 2025
4d12793
add paint event
memurats May 14, 2025
6c2f2d4
fix error
memurats May 14, 2025
9aa7397
removed progressindicator
memurats May 14, 2025
46057f1
fix error
memurats May 14, 2025
f3685c8
added paintevent
memurats May 14, 2025
2335bb7
fix layout
memurats May 15, 2025
06be0ac
clean old class
memurats May 15, 2025
5d773e8
fix error
memurats May 15, 2025
dd4c057
layout test
memurats May 15, 2025
a0d149b
move status label
memurats May 15, 2025
724b20b
fix error
memurats May 15, 2025
04d60e3
hide status label
memurats May 15, 2025
8010ac0
fix error
memurats May 15, 2025
6d28b08
disable status slot
memurats May 16, 2025
328d637
fix embed class
memurats May 19, 2025
00524b3
took back changes
memurats May 19, 2025
3f7ada9
add translations
memurats May 19, 2025
f5b9099
test new layout code
memurats May 19, 2025
82d53e6
update code
memurats May 19, 2025
0eafce1
layout fix
memurats May 19, 2025
36001ca
layout fix
memurats May 20, 2025
bb674d0
fix error
memurats May 20, 2025
0a28dde
layout test
memurats May 20, 2025
8838389
another try
memurats May 20, 2025
c285cdc
another test
memurats May 20, 2025
e9494a2
new fix
memurats May 20, 2025
916b211
new structure
memurats May 20, 2025
1ba5bdf
took back changes
memurats May 21, 2025
17ca278
remove unused widgets
memurats May 22, 2025
e66a02f
Test
memurats May 22, 2025
5db8588
layout test
memurats May 22, 2025
60ef18b
Bestehendes Layout rekursiv entfernen
memurats May 22, 2025
28a048b
custom logo color
memurats May 22, 2025
c303091
fixed error
memurats May 22, 2025
7d1dfa9
revert change
memurats May 22, 2025
398db1d
another layout fix
memurats May 22, 2025
dead88c
fix error
memurats May 22, 2025
b16a5c8
layout fix
memurats May 22, 2025
2c060a3
status change override
memurats Jun 2, 2025
15b89db
fix error
memurats Jun 2, 2025
c2c163c
fix error
memurats Jun 2, 2025
73184eb
fix error
memurats Jun 2, 2025
ec3431f
fix crash
memurats Jun 3, 2025
962284a
fixed crash
memurats Jun 3, 2025
3ef0a75
fixed widget
memurats Jun 3, 2025
c644b80
fix layout
memurats Jun 4, 2025
9db96ed
more fixes
memurats Jun 4, 2025
8587c19
removed white fill
memurats Jun 4, 2025
3a742d3
removed paint event
memurats Jun 4, 2025
1c7df7b
fixed color
memurats Jun 5, 2025
5b0a20a
added nmcicons to theme
memurats Jun 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Widgets Svg Qml Quick Qui
find_package(KF6Archive REQUIRED)
find_package(KF6GuiAddons)

#NMC customization: needed to find the ui file in a different location than the header file
set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui")

if (NOT TARGET Qt::GuiPrivate)
message(FATAL_ERROR "Could not find GuiPrivate component of Qt. It might be shipped as a separate package, please check that.")
endif()
Expand Down Expand Up @@ -255,6 +258,10 @@ set(client_SRCS
wizard/linklabel.cpp
)

file(GLOB NMC_FILES "nmcgui/*")
set(NMC_SRCS ${NMC_FILES})
list(APPEND client_SRCS ${NMC_SRCS})

if (WITH_WEBENGINE)
list(APPEND client_SRCS
wizard/webviewpage.h
Expand Down
162 changes: 162 additions & 0 deletions src/gui/nmcgui/nmcflow2authwidget.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/*
* Copyright (C) by Eugen Fischer
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/

#include "nmcflow2authwidget.h"

#include <QCoreApplication>
#include <QDesktopServices>
#include <QIcon>
#include <QLabel>
#include <QPainter>
#include <QPushButton>
#include <QHBoxLayout>
#include <QVBoxLayout>

#include "QProgressIndicator.h"
#include "theme.h"

namespace OCC {

NMCFlow2AuthWidget::NMCFlow2AuthWidget(QWidget *parent)
: Flow2AuthWidget(parent)
{
// Bestehende UI-Elemente ausblenden
if (getUi().logoLabel) {
getUi().logoLabel->hide();
getUi().logoLabel->setFixedSize(0, 0);
}
if (getUi().label) {
getUi().label->hide();
getUi().label->setFixedSize(0, 0);
}
if (getUi().copyLinkButton) {
getUi().copyLinkButton->hide();
}
if (getUi().openLinkButton) {
getUi().openLinkButton->hide();
}
if (auto *progressInd = getProgressIndicator()) {
progressInd->setVisible(false);
progressInd->setFixedSize(0, 0);
}
if (getUi().statusLabel) {
getUi().statusLabel->setVisible(false);
getUi().statusLabel->setFixedSize(0, 0);
}

// Bestehendes Layout und Child-Widgets entfernen
if (auto *oldLayout = layout()) {
QLayoutItem *item;
while ((item = oldLayout->takeAt(0)) != nullptr) {
if (auto *widget = item->widget()) {
widget->setParent(nullptr);
}
delete item;
}
delete oldLayout;
}

// Login-Button
auto loginButton = new QPushButton(QCoreApplication::translate("", "LOGIN"));
loginButton->setFocusPolicy(Qt::NoFocus);
loginButton->setFixedSize(130, 32);
loginButton->setStyleSheet(
"QPushButton { font-size: 15px; border: none; border-radius: 4px; background-color: #E20074; color: white; }"
"QPushButton:hover { background-color: #c00063; }"
);
connect(loginButton, &QPushButton::clicked, this, &NMCFlow2AuthWidget::slotOpenBrowser);

// Logo + Titel
auto logoLabel = new QLabel(this);
logoLabel->setPixmap(QIcon(":/client/theme/NMCIcons/tlogocarrier.svg").pixmap(36, 36));
logoLabel->setFixedSize(36, 36);

auto titleLabel = new QLabel(tr("MagentaCLOUD"), this);
titleLabel->setStyleSheet("font-weight: bold; font-size: 15px;");

auto logoTitleLayout = new QHBoxLayout;
logoTitleLayout->setSpacing(8);
logoTitleLayout->addWidget(logoLabel);
logoTitleLayout->addWidget(titleLabel);
logoTitleLayout->addStretch();

// Überschrift
auto headerLabel = new QLabel(QCoreApplication::translate("", "SETUP_HEADER_TEXT_1"));
headerLabel->setStyleSheet("font-size: 24px; font-weight: normal;");
headerLabel->setWordWrap(true);
headerLabel->setFixedWidth(282);

// Anweisungs-Label
auto label = new QLabel(tr("Wechseln Sie bitte zu Ihrem Browser und melden Sie sich dort an, um Ihr Konto zu verbinden."), this);
label->setStyleSheet("font-size: 14px;");
label->setWordWrap(true);
label->setFixedWidth(282);

// Linke Seite
auto leftLayout = new QVBoxLayout;
leftLayout->addLayout(logoTitleLayout);
leftLayout->addSpacing(24);
leftLayout->addWidget(headerLabel);
leftLayout->addSpacing(16);
leftLayout->addWidget(label);
leftLayout->addSpacing(24);
leftLayout->addWidget(loginButton);
leftLayout->addStretch();

// Rechtes Logo
auto bigLogoLabel = new QLabel(this);
bigLogoLabel->setPixmap(QIcon(":/client/theme/NMCIcons/applicationLogo.svg").pixmap(175, 175));
bigLogoLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
bigLogoLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

auto rightLayout = new QVBoxLayout;
rightLayout->addStretch();
rightLayout->addWidget(bigLogoLabel);
rightLayout->addStretch();

// Hauptlayout
auto mainLayout = new QHBoxLayout;
mainLayout->setContentsMargins(16, 16, 16, 16);
mainLayout->setSpacing(24);
mainLayout->addLayout(leftLayout);
mainLayout->addStretch();
mainLayout->addLayout(rightLayout);

// Fehlerlabel wieder einfügen
if (getUi().errorLabel) {
mainLayout->addWidget(getUi().errorLabel);
}
setLayout(mainLayout);
}

// Styling bewusst ignorieren
void NMCFlow2AuthWidget::customizeStyle() {}

// Spinner einblenden / ungenutzt
void NMCFlow2AuthWidget::startSpinner() {}

// Spinner ausblenden / ungenutzt
void NMCFlow2AuthWidget::stopSpinner(bool showStatusLabel)
{
Q_UNUSED(showStatusLabel);
}

// Statusänderung unterdrücken
void NMCFlow2AuthWidget::slotStatusChanged(Flow2Auth::PollStatus status, int secondsLeft)
{
Q_UNUSED(status);
Q_UNUSED(secondsLeft);
}

} // namespace OCC
77 changes: 77 additions & 0 deletions src/gui/nmcgui/nmcflow2authwidget.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* Copyright (C) by Eugen Fischer
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/

/*
* Copyright (C) by Eugen Fischer
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/

#ifndef NMCFLOW2AUTHWIDGET_H
#define NMCFLOW2AUTHWIDGET_H

#include "wizard/flow2authwidget.h"

namespace OCC {

class NMCFlow2AuthWidget : public Flow2AuthWidget
{
Q_OBJECT

public:
/**
* @brief Constructs an NMCFlow2AuthWidget object.
* @param parent The parent widget (default is nullptr).
*/
explicit NMCFlow2AuthWidget(QWidget *parent = nullptr);

/**
* @brief Destructor for NMCFlow2AuthWidget.
*/
~NMCFlow2AuthWidget() override = default;

protected:
/**
* @brief Reimplemented from Flow2AuthWidget.
* Customizes the style of the widget.
*/
void customizeStyle() override;

/**
* @brief Optionally reimplemented: controls spinner visibility/start.
*/
void startSpinner() override;

/**
* @brief Optionally reimplemented: stops spinner and optionally shows label.
*/
void stopSpinner(bool showStatusLabel) override;

/**
* @brief Optionally reimplemented: handles status updates during auth.
*/
void slotStatusChanged(Flow2Auth::PollStatus status, int secondsLeft) override;
};

} // namespace OCC

#endif // NMCFLOW2AUTHWIDGET_H
Loading