Skip to content

Commit

Permalink
Show Info message
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma committed Nov 27, 2024
1 parent ecdc4d9 commit 0bb3f15
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,10 @@
<source>%1 already exists.&lt;br /&gt;Do you want replace it?</source>
<translation>%1 already exists.&lt;br /&gt;Do you want replace it?</translation>
</message>
<message>
<source>To view container content please decrypt encrypted container!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FirstRun</name>
Expand Down
4 changes: 4 additions & 0 deletions client/translations/et.ts
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,10 @@
<source>%1 already exists.&lt;br /&gt;Do you want replace it?</source>
<translation>%1 on juba olemas.&lt;br /&gt;Soovid asendada?</translation>
</message>
<message>
<source>To view container content please decrypt encrypted container!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FirstRun</name>
Expand Down
4 changes: 4 additions & 0 deletions client/translations/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,10 @@
<source>%1 already exists.&lt;br /&gt;Do you want replace it?</source>
<translation>%1 уже существует.&lt;br /&gt;Заменить?</translation>
</message>
<message>
<source>To view container content please decrypt encrypted container!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FirstRun</name>
Expand Down
2 changes: 2 additions & 0 deletions client/widgets/FileList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ void FileList::setModel(DocumentModel *documentModel)
auto count = documentModel->rowCount();
for(int i = 0; i < count; i++)
addFile(documentModel->data(i));
if(state == EncryptedContainer && count == 0)
addWidget(new LabelItem(tr("To view container content please decrypt encrypted container!")));
}

void FileList::stateChange(ria::qdigidoc4::ContainerState state)
Expand Down
31 changes: 31 additions & 0 deletions client/widgets/Item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,37 @@

#include "Item.h"

#include <QtWidgets/QLabel>
#include <QtWidgets/QVBoxLayout>

void Item::idChanged(const SslCertificate & /* cert */) {}
void Item::initTabOrder(QWidget * /* item */) {}
QWidget* Item::lastTabWidget() { return this; }

LabelItem::LabelItem(const QString &text, QWidget *parent)
: Item(parent)
{
setObjectName(QStringLiteral("LabelItem"));
setStyleSheet(QStringLiteral(R"(
QWidget {
font-family: Roboto, Helvetica;
font-size: 14px;
}
#LabelItem {
border-bottom: 1px solid rgba(217, 217, 216, 0.45);
}
#label {
color: #07142A;
}
)"));
setLayout(new QVBoxLayout);
layout()->setContentsMargins(8, 16, 8, 16);
layout()->addWidget(label = new QLabel(text, this));
label->setObjectName("label");
}

void LabelItem::initTabOrder(QWidget *item)
{
setTabOrder(item, label);
setTabOrder(label, lastTabWidget());
}
14 changes: 14 additions & 0 deletions client/widgets/Item.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "widgets/StyledWidget.h"

class QLabel;
class SslCertificate;

class Item : public StyledWidget
Expand All @@ -38,3 +39,16 @@ class Item : public StyledWidget
void add(Item* item);
void remove(Item* item);
};


class LabelItem : public Item
{
Q_OBJECT

public:
LabelItem(const QString &text, QWidget *parent = nullptr);
void initTabOrder(QWidget *item) override;

private:
QLabel *label;
};

0 comments on commit 0bb3f15

Please sign in to comment.