Fix CMAKE_VERBOSE_MAKEFILE
[nomnom.git] / src / tips.cpp
blob05286cbb30cd8173a819d88d14c7830d70cbfc90
1 /*
2 * Copyright (C) 2010 Toni Gundogdu.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #include <QString>
19 #include <QObject>
20 #include <QApplication>
21 #include <QDebug>
23 #include "tips.h"
25 namespace NomNom {
27 static const char* tips[] = {
29 // 0: reserved.
30 QT_TRANSLATE_NOOP("Tips",
31 "<p>Looks like you are running NomNom for the first time.</p>"
32 "<p>Please make sure you have installed quvi(1) and "
33 "curl(1) commands to your system. You will also need "
34 "a streaming capable media player, e.g. vlc(1).</p>"
35 "<p>Open the Preferences (Ctrl+E) and check that the "
36 "paths to these commands have been specified correctly. "
37 "NomNom will need these commands to work properly.</p>"
39 QT_TRANSLATE_NOOP("Tips",
40 "Right-click opens the context-menu."
42 QT_TRANSLATE_NOOP("Tips",
43 "You can drag and drop video page URLs onto the window to start "
44 "the download (or streaming)."
46 QT_TRANSLATE_NOOP("Tips",
47 "You can make NomNom \"hover\" over the other windows. "
48 "Check the \"Stay on top\" in the Preferences."
50 QT_TRANSLATE_NOOP("Tips",
51 "You can set NomNom to either \"Download\" or \"Stream\" the media. "
52 "When you choose \"Stream\", open the preferences (Ctrl+E) and make "
53 "sure that you have specified the path to a player command (that is "
54 "capable of streaming media)."
56 QT_TRANSLATE_NOOP("Tips",
57 "NomNom resumes file transfers by default (determined by the curl "
58 "command in the Preferences). Check \"Overwrite\" in the context "
59 "menu if you want to overwrite the existing files."
61 QT_TRANSLATE_NOOP("Tips",
62 "To clear the list of recently visited URLs, open the Preferences "
63 "(Ctrl+E), select \"Other\" and click \"Clear recent\"."
65 QT_TRANSLATE_NOOP("Tips",
66 "To access Youtube feeds -- including Youtube users playlists, "
67 "favorites and uploads -- choose \"Feed\" (Ctrl+F) from the "
68 "context menu. "
70 QT_TRANSLATE_NOOP("Tips",
71 "Check \"Do not prompt for filename\" in the Preferences (Ctrl+E) "
72 "if you do not want to choose the video output file everytime you "
73 "start a download."
75 QT_TRANSLATE_NOOP("Tips",
76 "NomNom can minimize automatically when download starts; check "
77 "\"Minimize when download starts\" in the Preferences (Ctrl+E)."
79 NULL // End.
82 static size_t
83 max_tips () {
84 size_t i;
85 for (i=0; tips[i] != NULL; ++i);
86 return i;
89 QString
90 next_tip (size_t &n) {
92 if (n == 0)
93 n = 1;
95 if (++n >= max_tips ())
96 n = 1;
98 return QCoreApplication::translate ("Tips", tips[n]);
101 QString
102 get_tip (size_t& n, const bool first/*=false*/) {
104 n = 0;
106 if (first) return tips[0];
108 n = qrand () % max_tips ();
110 if (n == 0) ++n;
112 return QCoreApplication::translate ("Tips", tips[n]);
115 } // End namespace.