Skip to content

Commit

Permalink
Remove photo widgets (#1176)
Browse files Browse the repository at this point in the history
IB-7691

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored Mar 29, 2023
1 parent 5bd100f commit 530265e
Show file tree
Hide file tree
Showing 21 changed files with 352 additions and 1,112 deletions.
1 change: 0 additions & 1 deletion client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE
QPKCS11.cpp
QSigner.cpp
QSmartCard.cpp
sslConnect.cpp
Styles.cpp
PrintSheet.cpp
Settings.cpp
Expand Down
36 changes: 2 additions & 34 deletions client/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "QSigner.h"
#include "Settings.h"
#include "Styles.h"
#include "sslConnect.h"
#include "TokenData.h"
#include "effects/ButtonHoverFilter.h"
#include "effects/FadeInNotification.h"
Expand Down Expand Up @@ -165,19 +164,7 @@ MainWindow::MainWindow( QWidget *parent )
connect(ui->accordion, &Accordion::changePin1Clicked, this, &MainWindow::changePin1Clicked);
connect(ui->accordion, &Accordion::changePin2Clicked, this, &MainWindow::changePin2Clicked);
connect(ui->accordion, &Accordion::changePukClicked, this, &MainWindow::changePukClicked);
connect(ui->infoStack, &InfoStack::photoClicked, this, &MainWindow::photoClicked);
connect(ui->cardInfo, &CardWidget::photoClicked, this, &MainWindow::photoClicked); // To load photo
connect(ui->cardInfo, &CardWidget::selected, ui->selector->selector, &DropdownButton::press);
connect(SSLConnect::instance(), &SSLConnect::error, this, [this](const QString &error) {
qWarning() << error;
showNotification(tr("Loading picture failed."));
});
connect(SSLConnect::instance(), &SSLConnect::image, this, [this] (const QImage &image) {
ui->infoStack->setProperty("PICTURE", image);
QPixmap pixmap = QPixmap::fromImage(image);
ui->cardInfo->showPicture(pixmap);
ui->infoStack->showPicture(pixmap);
});

updateSelectorData(qApp->signer()->tokensign());
updateMyEID(qApp->signer()->tokensign());
Expand Down Expand Up @@ -853,6 +840,8 @@ void MainWindow::showCardMenu(bool show)
{
if(show)
{
if(ui->selector->list.isEmpty())
return;
auto *cardPopup = new CardPopup(ui->selector->list, this);
connect(cardPopup, &CardPopup::activated, qApp->signer(), &QSigner::selectCard, Qt::QueuedConnection);
connect(cardPopup, &CardPopup::activated, this, [this] { showCardMenu(false); }); // .. and hide card popup menu
Expand Down Expand Up @@ -944,27 +933,6 @@ void MainWindow::sign(F &&sign)
adjustDrops();
}

void MainWindow::photoClicked()
{
if(!ui->infoStack->property("PICTURE").isValid())
{
SSLConnect::instance()->fetch();
return;
}
QString fileName = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
fileName += "/" + qApp->signer()->tokenauth().card();
fileName = QFileDialog::getSaveFileName(this,tr("Save photo"), fileName,
tr("Photo (*.jpg *.jpeg);;All Files (*)"));
if(fileName.isEmpty())
return;
static const QStringList exts{QStringLiteral("jpg"), QStringLiteral("jpeg")};
if(!exts.contains(QFileInfo(fileName).suffix(), Qt::CaseInsensitive))
fileName.append(QStringLiteral(".jpg"));
auto pix = ui->infoStack->property("PICTURE").value<QImage>();
if(!pix.save(fileName))
warnings->showWarning(DocumentModel::tr("Failed to save file '%1'").arg(fileName));
}

void MainWindow::removeAddress(int index)
{
if(cryptoDoc)
Expand Down
1 change: 0 additions & 1 deletion client/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ private Q_SLOTS:
void changePukClicked();
void open(const QStringList &params, bool crypto, bool sign);
void pageSelected(PageIcon *page);
void photoClicked();
void warningClicked(const QString &link);

protected:
Expand Down
1 change: 0 additions & 1 deletion client/MainWindow_MyEID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ void MainWindow::updateMyEID(const TokenData &t)
}
else
{
ui->infoStack->setProperty("PICTURE", QVariant());
ui->infoStack->clearData();
ui->accordion->clear();
ui->myEid->invalidIcon(false);
Expand Down
2 changes: 0 additions & 2 deletions client/common_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ enum ContainerState {
enum Actions {
AddressAdd,

CardPhoto,

ContainerCancel,
ContainerConvert,
ContainerEncrypt,
Expand Down
16 changes: 0 additions & 16 deletions client/images/icon_person_blue.svg

This file was deleted.

1 change: 0 additions & 1 deletion client/images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
<file>icon_Krypto.svg</file>
<file>icon_Minu_eID_hover.svg</file>
<file>icon_Minu_eID.svg</file>
<file>icon_person_blue.svg</file>
<file>icon_radio.png</file>
<file>icon_radio_checked.png</file>
<file>icon_remove_hover.svg</file>
Expand Down
143 changes: 0 additions & 143 deletions client/sslConnect.cpp

This file was deleted.

43 changes: 0 additions & 43 deletions client/sslConnect.h

This file was deleted.

Loading

0 comments on commit 530265e

Please sign in to comment.