23 #include <QMouseEvent>
25 #include <QPaintEvent>
27 #include <QSvgRenderer>
30 #include <Phonon/MediaObject>
33 #include <KActionCollection>
34 #include <KConfigDialog>
36 #include <KGlobalSettings>
39 #include <KMessageBox>
40 #include <KShortcutsEditor>
41 #include <KStandardAction>
42 #include <KStandardDirs>
44 #include <sharedkvtmlfiles.h>
54 static const char*
m_nextText = I18N_NOOP(
"Next Anagram");
78 :
KMainWindow(), m_game(NULL), m_overNext(false), m_overConfig(false),
79 m_overHelp(false), m_overQuit(false), m_overReveal(false), m_overHint(false),m_overPicHint(false),
80 m_overUp(false), m_overAboutKDE(false), m_overAboutApp(false),
81 m_overHandbook(false), m_overSwitcher(false), m_overLogo(false),
82 m_overHintBox(false), m_showHint(false), m_showPicHint(false), m_player(NULL), m_wordRevealed(false),
83 m_actionCollection(NULL)
85 setAttribute(Qt::WA_StaticContents);
86 m_renderer =
new QSvgRenderer(KStandardDirs::locate(
"appdata",
"images/kanagram.svg"));
88 m_helpMenu =
new KHelpMenu(
this, KGlobal::mainComponent().aboutData());
95 if (!m_game->
picHint().isEmpty())
97 m_pictureHint.load(m_game->
picHint().pathOrUrl());
100 setMouseTracking(
true);
101 m_chalkColor = QColor(155, 155, 155);
102 m_chalkHighlightColor = QColor(255, 255, 255);
103 m_fillColor = QColor(45, 45, 45);
104 m_fontColor = QColor(55, 55, 55);
105 m_fontHighlightColor = QColor(99, 99, 99);
107 m_hintTimer =
new QTimer(
this);
108 m_hintTimer->setSingleShot(
true);
110 m_resolveTimer =
new QTimer(
this);
111 m_resolveTimer->setSingleShot(
true);
113 m_inputBox =
new KLineEdit(
this);
114 m_inputBox->setFrame(
false);
116 connect(m_inputBox, SIGNAL(returnPressed()), SLOT(checkWord()));
117 connect(m_hintTimer, SIGNAL(timeout()), SLOT(hideHint()));
118 connect(m_resolveTimer, SIGNAL(timeout()), SLOT(slotRevealWord()));
119 connect(m_inputBox, SIGNAL(textChanged(QString)), SLOT(update()));
120 connect(m_game, SIGNAL(fileError(QString)), SLOT(slotFileError(QString)));
124 m_inputBox->setFont(f);
127 setAutoSaveSettings();
129 setMinimumSize(650, 471);
131 if (m_resolveTime != 0)
133 m_resolveTimer->start(m_resolveTime * 1000);
151 return QSize(650, 471);
154 void Kanagram::loadSettings()
158 if (hideTime.at(0).isDigit())
161 m_hintHideTime = (hideTime.at(0).digitValue() * 2) + 1;
164 if (m_hintHideTime == 1)
176 if (resolveTime.at(0).isDigit())
179 m_resolveTime = (resolveTime.at(0).digitValue()) * 15;
188 QStringList userLanguagesCode = KGlobal::locale()->languageList();
190 QStringList sharedKvtmlFilesLanguages = SharedKvtmlFiles::languages();
191 QString foundLanguage;
192 foreach (
const QString &userLanguageCode, userLanguagesCode)
194 if (sharedKvtmlFilesLanguages.contains(userLanguageCode))
196 foundLanguage = userLanguageCode;
205 m_arrowName =
"basicarrow";
208 void Kanagram::reloadSettings()
211 refreshVocabularies();
214 void Kanagram::setupActions()
216 m_actionCollection =
new KActionCollection(
this);
219 KAction *nextAnagramAction =
new KAction(i18n(
m_nextText), m_actionCollection);
220 nextAnagramAction->setShortcut(Qt::CTRL+Qt::Key_N);
221 connect(nextAnagramAction, SIGNAL(triggered(
bool)),
this, SLOT(slotNextAnagram()));
222 m_actionCollection->addAction(
"nextanagram", nextAnagramAction);
225 KAction *showHintAction =
new KAction(i18n(
"Show Hint"), m_actionCollection);
226 showHintAction->setShortcut(Qt::CTRL+Qt::Key_H);
227 connect(showHintAction, SIGNAL(triggered(
bool)),
this, SLOT(slotToggleHint()));
228 m_actionCollection->addAction(
"showhint", showHintAction);
231 KAction *revealWordAction =
new KAction(i18n(
"Reveal Anagram"), m_actionCollection);
232 revealWordAction->setShortcut(Qt::CTRL+Qt::Key_R);
233 connect(revealWordAction, SIGNAL(triggered(
bool)),
this, SLOT(slotRevealWord()));
234 m_actionCollection->addAction(
"revealword", revealWordAction);
237 KAction *priorVocabularyAction =
new KAction(i18n(
"Previous Vocabulary"), m_actionCollection);
238 priorVocabularyAction->setShortcut(Qt::Key_PageUp);
239 connect(priorVocabularyAction, SIGNAL(triggered(
bool)),
this, SLOT(slotPrevVocabulary()));
240 m_actionCollection->addAction(
"priorvocabulary", priorVocabularyAction);
242 KAction *nextVocabularyAction =
new KAction(i18n(
"Next Vocabulary"), m_actionCollection);
243 nextVocabularyAction->setShortcut(Qt::Key_PageDown);
244 connect(nextVocabularyAction, SIGNAL(triggered(
bool)),
this, SLOT(slotNextVocabulary()));
245 m_actionCollection->addAction(
"nextvocabulary", nextVocabularyAction);
248 KStandardAction::aboutApp(m_helpMenu, SLOT(aboutApplication()), m_actionCollection);
249 KStandardAction::aboutKDE(m_helpMenu, SLOT(aboutKDE()), m_actionCollection);
250 KStandardAction::helpContents(m_helpMenu, SLOT(appHelpActivated()), m_actionCollection);
253 KStandardAction::preferences(
this, SLOT(slotShowSettings()), m_actionCollection);
254 KStandardAction::quit(
this, SLOT(close()), m_actionCollection);
258 m_actionCollection->readSettings();
260 m_actionCollection->addAssociatedWidget(
this);
261 foreach (QAction* action, m_actionCollection->actions())
262 action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
265 void Kanagram::paintEvent(QPaintEvent *)
267 QPixmap buf(width(), height());
269 p.setRenderHint(QPainter::Antialiasing);
271 m_renderer->render(&p,
"background");
278 p.translate(
int(112.188 * m_xRatio),
int(32.375 * m_yRatio));
280 m_renderer->render(&p,
"logo_hover");
285 p.translate(
int(112.188 * m_xRatio),
int(32.375 * m_yRatio));
287 m_renderer->render(&p,
"logo");
295 m_renderer->render(&p,
"next_hover");
303 m_renderer->render(&p,
"config_hover");
311 m_renderer->render(&p,
"help_hover");
317 p.translate(798.811 * m_xRatio, 556.803 * m_yRatio);
319 m_renderer->render(&p,
"quit_hover");
323 QString anagram = m_game->
anagram();
324 int afontSize = KFontUtils::adaptFontSize(p, anagram, m_blackboardRect.width(), m_blackboardRect.height() / 5);
325 FixFontSize(afontSize);
326 drawTextNew(p, anagram, Qt::AlignCenter, 10, 10, m_blackboardRect,
true, afontSize);
329 m_cornerFontSize = KFontUtils::adaptFontSize(p, reveal, m_blackboardRect.width() / 3, m_blackboardRect.height() / 5);
330 FixFontSize(m_cornerFontSize);
333 drawTextNew(p, reveal, Qt::AlignBottom | Qt::AlignRight, 6, 0, m_blackboardRect, m_overReveal, m_cornerFontSize);
336 drawTextNew(p, i18n(
m_textHint), Qt::AlignBottom | Qt::AlignLeft, 6, 0, m_blackboardRect, m_overHint, m_cornerFontSize);
338 if(!m_game->
picHint().isEmpty())
340 drawTextNew(p, i18n(
m_textPicHint), Qt::AlignTop | Qt::AlignLeft, 6, 8, m_blackboardRect, m_overPicHint, m_cornerFontSize);
344 QFont font = KGlobalSettings::generalFont();
345 font.setPointSize(m_cornerFontSize);
347 QFontMetrics fm(font);
348 QRect r = innerRect(m_blackboardRect, 6, 0);
349 m_hintRect = fm.boundingRect(r, Qt::AlignBottom|Qt::AlignLeft, i18n(
m_textHint));
350 m_picHintRect = fm.boundingRect(r, Qt::AlignTop|Qt::AlignLeft, i18n(
m_textPicHint));
351 m_hintBoxRect = QRect(
int(684.813 * m_xRatio),
int(319.896 * m_yRatio),
int(
xEyesScale * width()),
int(
yEyesScale * height()));
352 r = innerRect(m_blackboardRect, 6, 0);
353 m_revealRect = fm.boundingRect(r, Qt::AlignBottom|Qt::AlignRight, reveal);
355 drawSwitcher(p, 9, 8);
357 p.setPen(QPen(Qt::black, 3));
360 QRect borderRect = m_inputBox->geometry();
361 p.drawRoundRect(borderRect, 10, 5);
362 int inputBoxFontSize = KFontUtils::adaptFontSize(p,
"A", borderRect.width(), borderRect.height()) - 1;
363 FixFontSize(inputBoxFontSize);
365 f.setPointSize(inputBoxFontSize);
366 m_inputBox->setFont(f);
369 borderRect = m_upRect;
370 p.fillRect(borderRect, m_fillColor);
371 p.drawRoundRect(borderRect, 10, 5);
373 QString upArrow =
"up";
374 if (m_overUp && !m_inputBox->text().isEmpty())
376 upArrow =
"up_hover";
378 else if (m_inputBox->text().isEmpty())
380 upArrow =
"up_disabled";
383 p.translate(m_inputBox->x() + m_inputBox->width() + 26 * m_xRatio, m_inputBox->y() + 12 * m_yRatio);
385 m_renderer->render(&p, upArrow);
390 p.translate(684.813 * m_xRatio, 319.896 * m_yRatio);
392 m_renderer->render(&p, m_hintOverlayName);
396 QFont f = KGlobalSettings::generalFont();
397 f.setWeight(QFont::Bold);
399 QString hint = m_game->
hint();
400 int fontSize = KFontUtils::adaptFontSize(p, hint,
int(250 * m_xRatio),
int(110 * m_yRatio));
401 FixFontSize(fontSize);
402 f.setPointSize(fontSize);
404 p.drawText(
int(694 * m_xRatio),
int(330 * m_yRatio),
int(250 * m_xRatio),
int(110 * m_yRatio),
405 Qt::TextWordWrap | Qt::AlignCenter, hint);
410 p.drawImage(m_picHintRect.topLeft(),m_pictureHint);
413 if (m_overHelp && !m_showHint && !m_showPicHint)
417 p.translate(808.377 * m_xRatio, 335.352 * m_yRatio);
419 m_renderer->render(&p,
"appicon_hover");
421 drawHelpText(p, i18n(
"About Kanagram"));
425 p.translate(808.377 * m_xRatio, 335.352 * m_yRatio);
427 m_renderer->render(&p,
"appicon");
432 p.translate(865.877 * m_xRatio, 335.352 * m_yRatio);
434 m_renderer->render(&p,
"kicon_hover");
436 drawHelpText(p, i18n(
"About KDE"));
440 p.translate(865.877 * m_xRatio, 335.352 * m_yRatio);
442 m_renderer->render(&p,
"kicon");
447 p.translate(750.877 * m_xRatio, 335.352 * m_yRatio);
449 m_renderer->render(&p,
"handbook_hover");
451 drawHelpText(p, i18n(
"Kanagram Handbook"));
455 p.translate(750.877 * m_xRatio, 335.352 * m_yRatio);
457 m_renderer->render(&p,
"handbook");
465 else if (m_overConfig)
467 drawHelpText(p, i18n(
"Configure Kanagram"));
471 drawHelpText(p, i18n(
"Quit Kanagram"));
475 p2.drawPixmap(0, 0, buf);
479 void Kanagram::FixFontSize(
int &fontSize)
487 void Kanagram::resizeEvent(QResizeEvent *)
492 m_blackboardRect = QRect(
int(63.657 * m_xRatio),
int(182.397 * m_yRatio),
int(563.273 * m_xRatio),
int(380.735 * m_yRatio));
493 m_inputBox->setGeometry(QRect(
int(80 * m_xRatio),
int(657.272 * m_yRatio),
int(420 * m_xRatio),
int(44.639 * m_yRatio)));
495 m_upRect = QRect(
int(m_inputBox->x() + m_inputBox->width() + 20 * m_xRatio), m_inputBox->y(), int(50 * m_xRatio), m_inputBox->height());
496 m_arrowRect = QRect(m_switcherRect.right() + 5, m_switcherRect.top(), int(16.250 * m_xRatio), int(25.0 * m_yRatio));
497 m_logoRect = QRect(
int(112.188 * m_xRatio),
int(32.375 * m_yRatio),
int(466.981 * m_xRatio),
int(91.407 * m_yRatio));
501 m_aboutKDERect = QRect(
int(867 * m_xRatio),
int(335.352 * m_yRatio),
503 m_handbookRect = QRect(
int(753 * m_xRatio),
int(335.352 * m_yRatio),
506 m_nextRect = QRect(
int(735.448 * m_xRatio),
int(49.028 * m_yRatio),
int(206.142 * m_xRatio),
int(117.537 * m_yRatio));
507 m_configRect = QRect(
int(735.448 * m_xRatio),
int(188.264 * m_yRatio),
int(206.142 * m_xRatio),
int(117.537 * m_yRatio));
508 m_helpRect = QRect(
int(735.448 * m_xRatio),
int(327.5 * m_yRatio),
int(206.142 * m_xRatio),
int(117.537 * m_yRatio));
509 m_quitRect = QRect(
int(697.549 * m_xRatio),
int(542.337 * m_yRatio),
int(279.935 * m_xRatio),
int(160.68 * m_yRatio));
514 void Kanagram::drawHelpText(QPainter &p,
const QString &text)
516 p.translate(700.582 * m_xRatio, 424.176 * m_yRatio);
518 m_renderer->render(&p,
"card");
522 QFont font = KGlobalSettings::generalFont();
523 font.setPointSize(m_cornerFontSize);
526 p.translate(720.582 * m_xRatio, 480 * m_yRatio);
531 p.drawText(0, 0, text.section(
' ', 0, 0));
533 p.drawText(0,
int(30 * m_yRatio), text.section(
' ', 1));
537 void Kanagram::drawSwitcher(QPainter &p,
const int xMargin,
const int yMargin)
539 const int padding = 5;
541 QFont font = KGlobalSettings::generalFont();
542 font.setPointSize(m_cornerFontSize);
543 QFontMetrics fm(font);
544 QRect r = innerRect(m_blackboardRect, xMargin, yMargin);
546 r.translate(- padding -
int(16.250 * m_xRatio), yMargin);
547 r.setHeight(
int(25.0 * m_yRatio));
548 m_switcherRect = p.boundingRect(r, Qt::AlignVCenter|Qt::AlignRight, text);
550 QString arrow = m_arrowName;
553 p.setPen(m_chalkHighlightColor);
554 arrow = m_arrowName +
"_hover";
558 p.setPen(m_chalkColor);
560 p.translate(m_switcherRect.right() + padding, m_switcherRect.top());
562 m_renderer->render(&p, arrow);
565 m_switcherRect.translate(0, -2);
566 p.drawText(m_switcherRect, Qt::AlignVCenter|Qt::AlignRight, text);
569 QRect Kanagram::innerRect(
const QRect &rect,
const int xMargin,
const int yMargin)
575 r.setWidth(r.width() - 2 * xMargin);
576 r.translate(xMargin, 0);
580 r.setHeight(r.height() - 2 * yMargin);
581 r.translate(0, yMargin);
588 void Kanagram::slotNextAnagram()
590 m_wordRevealed =
false;
594 if (!m_game->
picHint().isEmpty())
596 m_pictureHint.load(m_game->
picHint().pathOrUrl());
603 m_inputBox->setPalette(QPalette());
606 if (m_resolveTime != 0)
608 m_resolveTimer->start(m_resolveTime * 1000);
612 void Kanagram::slotRevealWord()
614 m_wordRevealed =
true;
620 void Kanagram::slotNextVocabulary()
637 void Kanagram::slotPrevVocabulary()
653 void Kanagram::slotToggleHint()
663 m_hintTimer->start(m_hintHideTime * 1000);
671 void Kanagram::slotTogglePicHint()
675 m_showPicHint =
false;
681 m_hintTimer->start(m_hintHideTime * 1000);
683 m_showPicHint =
true;
691 void Kanagram::mousePressEvent(QMouseEvent *e)
698 if (m_nextRect.contains(e->pos()))
703 if (m_configRect.contains(e->pos()))
708 if (m_quitRect.contains(e->pos()))
713 if (m_revealRect.contains(e->pos()))
718 if (m_logoRect.contains(e->pos()))
720 m_helpMenu->aboutApplication();
723 if (!m_showHint && m_overHelp && !m_showPicHint)
725 if (m_handbookRect.contains(e->pos()))
727 m_helpMenu->appHelpActivated();
730 if (m_aboutKDERect.contains(e->pos()))
732 m_helpMenu->aboutKDE();
735 if (m_aboutAppRect.contains(e->pos()))
737 m_helpMenu->aboutApplication();
741 if (m_hintBoxRect.contains(e->pos()))
746 if (m_switcherRect.contains(e->pos()) || m_arrowRect.contains(e->pos()))
748 if (!(e->button() == Qt::RightButton))
750 slotNextVocabulary();
754 slotPrevVocabulary();
758 if (m_hintRect.contains(e->pos()))
763 if (m_picHintRect.contains(e->pos()))
768 if (m_upRect.contains(e->pos()) && !m_inputBox->text().isEmpty())
775 void Kanagram::CheckRect(
const QRect &rect,
const QPoint &p,
bool &flag,
bool &changed)
777 if (rect.contains(p))
789 void Kanagram::mouseMoveEvent(QMouseEvent *e)
792 bool haveToUpdate =
false;
794 CheckRect(m_nextRect, p, m_overNext, haveToUpdate);
795 CheckRect(m_configRect, p, m_overConfig, haveToUpdate);
796 CheckRect(m_logoRect, p, m_overLogo, haveToUpdate);
797 CheckRect(m_helpRect, p, m_overHelp, haveToUpdate);
798 CheckRect(m_quitRect, p, m_overQuit, haveToUpdate);
799 CheckRect(m_hintRect, p, m_overHint, haveToUpdate);
800 if (!m_game->
picHint().isEmpty())
802 CheckRect(m_picHintRect, p, m_overPicHint, haveToUpdate);
804 CheckRect(m_hintBoxRect, p, m_overHintBox, haveToUpdate);
805 CheckRect(m_revealRect, p, m_overReveal, haveToUpdate);
806 CheckRect(m_upRect, p, m_overUp, haveToUpdate);
807 CheckRect(m_aboutAppRect, p, m_overAboutApp, haveToUpdate);
809 if (m_switcherRect.contains(p) || m_arrowRect.contains(p))
811 haveToUpdate = !m_overSwitcher;
812 m_overSwitcher =
true;
814 else if (m_overSwitcher)
816 m_overSwitcher =
false;
820 if (!m_showHint ||!m_showPicHint)
822 CheckRect(m_handbookRect, p, m_overHandbook, haveToUpdate);
823 CheckRect(m_aboutKDERect, p, m_overAboutKDE, haveToUpdate);
826 if (m_overAboutKDE || m_overHandbook || m_overSwitcher || m_overNext || m_overQuit
827 || m_overConfig || (m_overReveal && !m_wordRevealed) || m_overHint || m_overPicHint || (m_overUp && !m_inputBox->text().isEmpty())
828 || m_overAboutApp || m_overHintBox || m_overLogo)
830 this->setCursor(Qt::PointingHandCursor);
843 void Kanagram::drawTextNew(QPainter &p,
const QString &text,
int textAlign,
int xMargin,
int yMargin,
const QRect &rect,
bool highlight,
int fontSize)
845 QRect r = innerRect(rect, xMargin, yMargin);
846 QFont font = KGlobalSettings::generalFont();
847 font.setPointSize(fontSize);
851 const bool withMargin =
false;
854 p.fillRect(r, m_fillColor);
855 p.setPen(QPen(Qt::black, 3));
856 p.drawRoundRect(r.left(), r.top(), r.width(), r.height(), 15, 15);
860 p.setPen(m_chalkHighlightColor);
862 p.setPen(m_chalkColor);
863 p.drawText(r, textAlign, text);
866 void Kanagram::checkWord()
869 QString enteredWord = m_inputBox->text().toLower().trimmed();
870 QString word = m_game->
word().toLower().trimmed();
871 if (!enteredWord.isEmpty())
873 if (enteredWord == word || stripAccents(enteredWord) == stripAccents(word))
875 if (m_useSounds) play(
"right.ogg");
876 palette.setColor(m_inputBox->backgroundRole(), QColor(0, 255, 0));
877 QTimer::singleShot(1000,
this, SLOT(resetInputBox()));
879 m_wordRevealed =
false;
885 if (m_useSounds) play(
"wrong.ogg");
886 palette.setColor(m_inputBox->backgroundRole(), QColor(255, 0, 0));
887 QTimer::singleShot(1000,
this, SLOT(resetInputBox()));
890 m_inputBox->setPalette(palette);
895 QString Kanagram::stripAccents(
const QString & original)
898 QString decomposed = original.normalized(QString::NormalizationForm_D);
899 for (
int i = 0; i < decomposed.length(); ++i) {
900 if ( decomposed[i].category() != QChar::Mark_NonSpacing ) {
901 noAccents.append(decomposed[i]);
907 void Kanagram::randomHintImage()
909 unsigned long imageNum = m_randomImage.getLong(8);
910 m_hintOverlayName =
"eyes" + QString::number(imageNum + 1);
913 void Kanagram::slotShowSettings()
915 if (!KConfigDialog::showDialog(
"settings"))
919 connect(m_configDialog, SIGNAL(finished()),
this, SLOT(reloadSettings()));
923 connect (mainSettingsPage, SIGNAL(settingsChanged()),
this, SLOT(reloadSettings()));
924 m_configDialog->addPage(mainSettingsPage , i18nc(
"@title:group main settings page name",
"General" ),
"preferences-other" );
928 m_configDialog->addPage(m_vocabSettings, i18n(
"Vocabularies"),
"document-properties" );
931 m_shortcutsEditor =
new KShortcutsEditor(m_actionCollection, m_configDialog);
932 m_configDialog->addPage(m_shortcutsEditor, i18n(
"Shortcuts"),
"preferences-desktop-keyboard");
933 connect(m_configDialog, SIGNAL(accepted()),
this, SLOT(slotSaveSettings()));
934 connect(m_configDialog, SIGNAL(rejected()),
this, SLOT(slotSettingsCancelled()));
935 connect(m_shortcutsEditor, SIGNAL(keyChange()),
this, SLOT(slotEnableApplyButton()));
937 m_configDialog->setHelp(
"kanagram/index.html");
938 m_configDialog->resize(600, 500);
939 m_configDialog->show();
943 void Kanagram::slotSaveSettings()
945 m_shortcutsEditor->save();
948 void Kanagram::slotSettingsCancelled()
950 m_shortcutsEditor->undoChanges();
953 void Kanagram::slotEnableApplyButton()
955 m_configDialog->enableButtonApply(
true);
958 void Kanagram::hideHint()
960 if (m_showHint ==
true )
967 void Kanagram::hidePicHint()
969 if (m_showPicHint ==
true || !m_game->
picHint().isEmpty())
971 m_showPicHint =
false;
976 void Kanagram::resetInputBox()
978 m_inputBox->setPalette(QPalette());
981 void Kanagram::refreshVocabularies()
1002 void Kanagram::play(
const QString &filename)
1004 if (!filename.isEmpty())
1006 QString soundFile = KStandardDirs::locate(
"appdata",
"sounds/" + filename);
1007 if (!soundFile.isEmpty())
1011 m_player = Phonon::createPlayer(Phonon::GameCategory, soundFile);
1015 m_player->setCurrentSource(soundFile);
1022 void Kanagram::slotFileError(
const QString &filename)
1024 QString msg = i18n(
"File %1 cannot be found.\n Please ensure that Kanagram is properly installed.", filename);
1025 KMessageBox::sorry(
this, msg, i18n(
"Error"));
1030 void Kanagram::slotChooseVocabulary()
1034 #include "kanagram.moc"
Kanagram()
default constructor
KUrl picHint()
Get this anagram's picture hint URL.
static QString resolveTime()
Get This setting allows you to set in seconds how much time is available for resolving the anagram...
QString anagram() const
Get the anagram to show.
bool refreshVocabularyList()
Refresh the list of vocabulary files available from what we find on disk.
Q_INVOKABLE QString hint() const
Get this anagram's hint.
void refreshView()
reload the list of vocabularies from what's on disk
QString word() const
Get this anagram's answer.
static bool useSounds()
Get Turns sounds on/off.
virtual QSize sizeHint() const
sizehint method for initial size
static KanagramSettings * self()
void previousVocabulary()
Use the previous vocabulary file in the list.
static const char * m_textHint
static void setDataLanguage(const QString &v)
Set Set the default translation.
static const char * m_textPicHint
Vocabulary Settings class.
static const char * m_textRevealWord
double yTranslateConfigButton
void nextVocabulary()
Use the next vocabulary file in the list.
static const char * m_nextText
void nextAnagram()
Set the index to the next word.
~Kanagram()
default destructor
static QString dataLanguage()
Get Set the default translation.
double yTranslateNextButton
void restoreWord()
Restore the word, set the anagram to the answer.
QString documentTitle() const
Get the current vocabulary file's title.
QString filename() const
Get the current vocabulary file's filename.
user preferences page of the config dialog allows choosing a hint hide time, the language, and the sound settings
header file for kanagram class
double yTranslateHelpButton
static void setDefaultVocabulary(const QString &v)
Set Set the default vocabulary.
static QString hintHideTime()
Get This setting allows you to set in seconds how long Kanagram's hint bubble is shown.