Skip to content

Commit

Permalink
add tips for online help and elems disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
Chunosov committed Nov 17, 2021
1 parent add761b commit 4da67c0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/StartWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "widgets/OriLabels.h"

#include <QApplication>
#include <QDesktopServices>
#include <QFileInfo>
#include <QInputDialog>
#include <QJsonDocument>
Expand Down Expand Up @@ -229,6 +230,9 @@ TipsStartPanel::TipsStartPanel(QLabel *tipImage) : StartPanel("panel_tips")
_tipText = new QLabel;
_tipText->setObjectName("tip_text");
_tipText->setWordWrap(true);
connect(_tipText, &QLabel::linkActivated, [](const QString& link){
QDesktopServices::openUrl(link);
});

_tipImage = tipImage;
_tipImage->setVisible(false);
Expand Down Expand Up @@ -271,8 +275,10 @@ TipsStartPanel::TipsStartPanel(QLabel *tipImage) : StartPanel("panel_tips")

buttonsLayout->addStretch();

_enlargeTip = new QLabel(tr("Click to enlarge →"));
_enlargeTip = new Ori::Widgets::Label(tr("Click to enlarge →"));
_enlargeTip->setCursor(Qt::PointingHandCursor);
buttonsLayout->addWidget(_enlargeTip);
connect(_enlargeTip, &Ori::Widgets::Label::clicked, this, &TipsStartPanel::enlargePreview);

LayoutH({
LayoutV({
Expand Down
9 changes: 8 additions & 1 deletion src/StartWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ class QMovie;
class QToolButton;
QT_END_NAMESPACE

namespace Ori {
namespace Widgets {
class Label;
} // namespace Widget
} // namespace Ori

class CustomCssWidget : public QWidget
{
protected:
Expand Down Expand Up @@ -84,7 +90,8 @@ class TipsStartPanel : public StartPanel
private:
QMovie* _movie = nullptr;
QJsonObject _tips;
QLabel *_tipText, *_tipPreview, *_tipImage, *_enlargeTip;
QLabel *_tipText, *_tipPreview, *_tipImage;
Ori::Widgets::Label *_enlargeTip;
QString _imagePath;
QStringList _ids;
int _index = -1;
Expand Down
2 changes: 2 additions & 0 deletions src/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -289,5 +289,7 @@
<file alias="several_pumps.gif">../tips/several_pumps.gif</file>
<file alias="link_elem_param_to_global.gif">../tips/link_elem_param_to_global.gif</file>
<file alias="add_global_param.gif">../tips/add_global_param.gif</file>
<file alias="online_help.png">../tips/online_help.png</file>
<file alias="disable_elem.png">../tips/disable_elem.png</file>
</qresource>
</RCC>
Binary file added tips/disable_elem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tips/online_help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions tips/tips.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"online_help": {
"text": "If you can not see the offline documentation, you always can read it online: <a href='http://rezonator.orion-project.org/help/'>rezonator.orion-project.org/help</a>",
"image": "online_help.png"
},
"disable_elem": {
"text": "You can temporary <b>disable an element</b> instead of to delete it permanently. This way it's possible to quickly replace one element with another and back, all functions and plots will be recalculated automatically.",
"image": "disable_elem.png"
},
"memo": {
"text": "<b>Memo window</b> is a rich text editor where you can take work notes, keep some pieces of useful information, even paste images into that and all these data will be stored in your schema project file.",
"image": "memo.png"
Expand Down

0 comments on commit 4da67c0

Please sign in to comment.