forked from nextcloud/desktop
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eugen Fischer
authored and
Eugen Fischer
committed
Jan 6, 2024
1 parent
344fc08
commit 5991c50
Showing
13 changed files
with
242 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* 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 "QPushButton" | ||
#include "QDesktopServices" | ||
#include "QtGui/qpainter.h" | ||
#include "theme.h" | ||
#include "QString" | ||
#include <MacTypes.h> | ||
|
||
namespace OCC { | ||
|
||
|
||
NMCFlow2AuthWidget::NMCFlow2AuthWidget(QWidget *parent) | ||
: Flow2AuthWidget(parent) | ||
{ | ||
_ui.copyLinkLabel->setVisible(false); | ||
_ui.openLinkLabel->setVisible(false); | ||
|
||
//Create and connect the push buttons to base slots | ||
auto copyLinkButton = new QPushButton(tr("Copy Link")); | ||
connect(copyLinkButton, &QPushButton::clicked, this, [this](){ | ||
slotCopyLinkToClipboard(); | ||
}); | ||
auto reopenBrowserButton = new QPushButton(tr("Reopen Browser")); | ||
connect(reopenBrowserButton, &QPushButton::clicked, this, [this](){ | ||
slotOpenBrowser(); | ||
}); | ||
|
||
//Create a layout where we put our new buttons. | ||
auto hLayout = new QHBoxLayout(this); | ||
auto spacerLeft = new QSpacerItem(1,1, QSizePolicy::Expanding, QSizePolicy::Fixed); | ||
auto spacerRight = new QSpacerItem(1,1, QSizePolicy::Expanding, QSizePolicy::Fixed); | ||
hLayout->addSpacerItem(spacerLeft); | ||
hLayout->addWidget(copyLinkButton); | ||
hLayout->addWidget(reopenBrowserButton); | ||
hLayout->addSpacerItem(spacerRight); | ||
|
||
hLayout->setSpacing(10); //its not defined in jira ticket https://jira.telekom.de/browse/NMC-2380 | ||
|
||
//According to Jira ticket https://jira.telekom.de/browse/NMC-2380 | ||
QSize buttonSize(176,32); | ||
copyLinkButton->setFixedSize(buttonSize); | ||
reopenBrowserButton->setFixedSize(buttonSize); | ||
|
||
//Now add the layout to base layout | ||
_ui.verticalLayout_3->addLayout(hLayout); | ||
|
||
//Make sure the first button wont get focus. It will be assigned to second button (reopenBrowserButton) | ||
copyLinkButton->setFocusPolicy(Qt::NoFocus); | ||
|
||
//Apply custom Pushbutton ui modifications, colors are set globaly in style.qml or theme? | ||
const QString styleSheet("QPushButton{font-size: 14px;font-family: Segoe; border: %1px solid; border-color: black; border-radius: 10px; background-color: %2; color: %3}"); | ||
copyLinkButton->setStyleSheet(styleSheet.arg("1","white","black")); | ||
reopenBrowserButton->setStyleSheet(styleSheet.arg("0","#E20074","white")); | ||
} | ||
|
||
void NMCFlow2AuthWidget::paintEvent(QPaintEvent *event) | ||
{ | ||
QPainter painter; | ||
painter.begin(this); | ||
painter.fillRect(rect(), Qt::white); | ||
painter.end(); | ||
Flow2AuthWidget::paintEvent(event); | ||
} | ||
|
||
|
||
} // namespace OCC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (C) by Michael Schuster <[email protected]> | ||
* | ||
* 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: | ||
NMCFlow2AuthWidget(QWidget *parent = nullptr); | ||
~NMCFlow2AuthWidget() = default; | ||
|
||
protected: | ||
void paintEvent(QPaintEvent *event) override; | ||
}; | ||
|
||
} // namespace OCC | ||
|
||
#endif // NMCFLOW2AUTHWIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* 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 "nmcgui/nmcowncloudadvancedsetuppage.h" | ||
#include "QtGui/qpainter.h" | ||
|
||
namespace OCC { | ||
|
||
NMCOwncloudAdvancedSetupPage::NMCOwncloudAdvancedSetupPage(OwncloudWizard *wizard) | ||
: OwncloudAdvancedSetupPage(wizard) | ||
|
||
{ | ||
_ui.confCheckBoxSize->setVisible(false); | ||
_ui.confSpinBox->setVisible(false); | ||
_ui.confTraillingSizeLabel->setVisible(false); | ||
_ui.confCheckBoxSize->setFixedSize(0,0); | ||
_ui.confSpinBox->setFixedSize(0,0); | ||
_ui.confTraillingSizeLabel->setFixedSize(0,0); | ||
_ui.wSyncStrategy->removeItem(_ui.horizontalLayout_6); | ||
|
||
_ui.confCheckBoxExternal->setVisible(false); | ||
_ui.confCheckBoxExternal->setFixedSize(0,0); | ||
_ui.wSyncStrategy->removeItem(_ui.horizontalLayout_8); | ||
|
||
_ui.verticalLayout->removeWidget(_ui.errorLabel); | ||
_ui.wSyncStrategy->insertWidget(0, _ui.errorLabel); | ||
|
||
_ui.lServerIcon->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); | ||
} | ||
|
||
} // namespace OCC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* 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 MIRALL_NMCOWNCLOUD_ADVANCED_SETUP_PAGE_H | ||
#define MIRALL_NMCOWNCLOUD_ADVANCED_SETUP_PAGE_H | ||
|
||
#include "wizard/owncloudadvancedsetuppage.h" | ||
|
||
|
||
namespace OCC { | ||
|
||
/** | ||
* @brief The NMCOwncloudAdvancedSetupPage class | ||
* @ingroup gui | ||
*/ | ||
|
||
class NMCOwncloudAdvancedSetupPage : public OwncloudAdvancedSetupPage | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
NMCOwncloudAdvancedSetupPage(OwncloudWizard *wizard); | ||
~NMCOwncloudAdvancedSetupPage() = default; | ||
}; | ||
|
||
} // namespace OCC | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.