17 #include <QDesktopServices>
18 #include <QDialogButtonBox>
21 #include <QHBoxLayout>
23 #include <QPushButton>
24 #include <QSizePolicy>
25 #include <QTextBrowser>
26 #include <QVBoxLayout>
28 #include "../../backend/config/btconfig.h"
29 #include "../../util/btconnect.h"
30 #include "../../util/bticons.h"
31 #include "../../util/cresmgr.h"
32 #include "../messagedialog.h"
40 return QStringLiteral(
41 "<table height=\"100%\"><tr>"
42 "<td style=\"vertical-align:middle\" height=\"100%\">%1</td>"
43 "</tr></table>").arg(text);
47 auto const & p = widget->palette();
48 return QStringLiteral(
49 "<style type=\"text/css\">"
51 "background-color:%1;"
54 "h3{font-weight:bold;text-align:center}"
55 "a{text-decoration:underline}"
59 .arg(p.color(QPalette::Base).name(),
61 p.color(QPalette::Link).name(),
62 p.color(QPalette::LinkVisited).name());
66 return QStringLiteral(
"<html><head>%1</head><body>%2</body></html>")
78 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
79 setWindowTitle(tr(
"Tip Of The Day"));
80 setWindowIcon(CResMgr::mainMenu::help::tipOfTheDay::icon());
83 QVBoxLayout *mainLayout =
new QVBoxLayout;
86 m_tipView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
89 QStringLiteral(
"QTextEdit{background-color:rgb(255,255,255)}"));
91 font.setPointSize(font.pointSize()+2);
95 QHBoxLayout* hLayout =
new QHBoxLayout;
100 btConfig().value<bool>(QStringLiteral(
"GUI/showTipAtStartup"),
104 m_buttonBox =
new QDialogButtonBox(QDialogButtonBox::Close,
109 QPushButton *nextButton;
110 nextButton =
m_buttonBox->addButton(tr(
"Next Tip"),
111 QDialogButtonBox::ActionRole);
114 mainLayout->addLayout(hLayout);
115 setLayout(mainLayout);
120 this, &BtTipDialog::reject);
128 [](QUrl
const & url) { QDesktopServices::openUrl(url); });
137 m_tips << tr(
"The currently active window can be auto scrolled up or down."
138 " Start scrolling by pressing Shift+Down. You can increase the"
139 " scrolling speed by pressing Shift+Down multiple times. To"
140 " pause scrolling press Space. To start scrolling again at the"
141 " previous speed press Space again. To slow down scrolling or scroll"
142 " the other direction press Shift+Up one or more times. Pressing"
143 " any other key or changing the active window will stop the scrolling.");
145 m_tips << tr(
"To add multiple Bible works in parallel in your active Bible or commentary window"
146 " select this icon and choose another Bible or commentary work.")
147 +
"<br><center>" +
iconToHtml(CResMgr::modules::bible::icon_add()) +
"</center>";
149 m_tips << tr(
"To add multiple commentary works in parallel in your active commentary window"
150 " select this icon and choose another commentary work.")
151 +
"<br><center>" +
iconToHtml(CResMgr::modules::commentary::icon_add()) +
"</center>";
153 m_tips << tr(
"To learn more about the BibleTime project please go to our web site.")
154 +
"<br><center><a href=\"https://bibletime.info\">bibletime.info</a></center>";
156 m_tips << tr(
"To synchronize a commentary window with the active Bible window, activate the"
157 " commentary window and select this icon.") +
"<br><center>"
158 +
iconToHtml(CResMgr::displaywindows::commentaryWindow::syncWindow::icon())
159 +
"</center><br>" + tr(
"Select the icon again to stop the synchronization.");
161 m_tips << tr(
"To create a bookmark drag any verse reference from a Bible or commentary work"
162 " into the Bookmarks window. An arrow will indicate the position that the bookmark will"
163 " go when you release the cursor. Other works will have a reference in the upper left"
164 " corner that can be used to create a bookmark.");
166 m_tips << tr(
"To change a bookmark title or description, right click on the bookmark"
167 " and select the Edit Bookmark menu. After finishing the edit the description can be"
168 " seen by hovering over the bookmark.");
170 m_tips << tr(
"To find more information about a work, go the the Bookshelf window, right"
171 " click on the work, and select the About menu.");
173 m_tips << tr(
"The Bookshelf, Bookmark, and Mag windows can be moved to new locations by"
174 " dragging them from the title at the top of each window. They can be placed to the left,"
175 " right, above, or below the works windows. They can be placed on top of each other and"
176 " tabs will appear so each window can be selected. They can be resized by dragging the"
177 " border between the window and another window.");
179 m_tips << tr(
"You can search for Strong's numbers in a work. Start with a work that has Strong's"
180 " numbers and hover over a word. Right click the word and use the Strong's Search"
181 " menu. A search dialog will appear that allows you to see the use of the same"
182 " Strong's number in other locations of the work.");
184 m_tips << tr(
"You can save personal notes for specific verse references. You must install"
185 " the Personal commentary. Open the Bookshelf Manager, choose Crosswire as the"
186 " source, English as the language, and look under Commentary. Once installed, open it"
187 " like any other window, or in parallel with a bible. Click a verse to edit it.");
189 m_tips << tr(
"You can view Strong's number information in the MAG window by hovering over"
190 " a word in a Bible work that has Strong's numbers. You should have the StrongsGreek"
191 " and StrongsHebrew lexicons from Crosswire installed.");
193 m_tips << tr(
"You can save your open windows in a session. Such a session can easily be restored"
194 " later on. You can save as many sessions as you like. The session feature can be"
195 " accessed under the Window menu entry.");
BtConfig & btConfig()
This is a shortchand for BtConfig::getInstance().
QString iconToHtml(QIcon const &icon, int const extent)
T value(QString const &key, T const &defaultValue=T()) const
Returns the settings value for the given global key.
void setValue(QString const &key, T const &value)
Sets a value for a key.
QDialogButtonBox * m_buttonBox
BtTipDialog(QWidget *parent=nullptr, Qt::WindowFlags wflags=Qt::Dialog)
QCheckBox * m_showTipsCheckBox
auto const LastTipNumberKey
QString vertical_align(const QString &text)
QString make_html(QWidget *widget, const QString &text)
QString make_style(QWidget *widget)
void prepareDialogBox(QDialogButtonBox *box)