15 #include <QApplication>
16 #include <QNetworkAccessManager>
19 #include <QPluginLoader>
23 #include <QMessageBox>
26 #include "configuration.hpp"
27 #include "wikiedit.hpp"
28 #include "mainwindow.hpp"
29 #include "exceptionwindow.hpp"
30 #include "message.hpp"
31 #include "iextension.hpp"
32 #include "hugglequeuefilter.hpp"
33 #include "editquery.hpp"
34 #include "history.hpp"
35 #include "apiquery.hpp"
36 #include "revertquery.hpp"
39 #include "pythonengine.h"
51 class ProcessorThread;
53 class HuggleQueueFilter;
56 class OAuthLoginQuery;
70 static void usleep(
unsigned long usecs){QThread::usleep(usecs);}
71 static void msleep(
unsigned long msecs){QThread::msleep(msecs);}
72 static void sleep(
unsigned long secs){QThread::sleep(secs);}
80 QApplication(argc, argv) {}
81 bool notify(QObject* receiver, QEvent* event);
97 QMap<QString, QString> Messages;
109 static QDateTime StartupTime;
129 static QList<HuggleQueueFilter *> FilterDB;
140 static PythonEngine *Python;
176 static void ProcessEdit(
WikiEdit *e);
186 static void InsertToRingLog(QString text);
209 static void LoadDB();
211 static QString
Trim(QString text);
215 static QString GetSummaryOfWarningTypeFromWarningKey(QString key);
216 static QString GetNameOfWarningTypeFromWarningKey(QString key);
217 static QString GetKeyOfWarningTypeFromWarningName(QString
id);
224 static QString GetValueFromKey(QString item);
225 static QString GetKeyFromValue(QString item);
226 static void ParseWords(QString text);
239 static void FinalizeMessages();
240 static QString RetrieveTemplateToWarn(QString type);
241 static EditQuery *EditPage(
WikiPage *page, QString text, QString summary =
"Edited using huggle",
bool minor =
false);
248 static void ExceptionHandler(
Exception *exception);
249 static QString Localize(QString key);
250 static void LoadLocalizations();
251 static bool ReportPreFlightCheck();
252 static int RunningQueriesGetCount();
271 static Language *MakeLanguage(QString text, QString name);
static QString GetProjectScriptURL()
Return a script url like http://en.wikipedia.org/w/.
static QString GetProjectWikiURL()
Return a full url like http://en.wikipedia.org/wiki/.
static WikiPage * AIVP
Pointer to AIV page.
static void Log(QString Message)
Write text to terminal as well as ring log.
static WikiPage * UAAP
Pointer to UAA page.
static void SaveDefs()
Store a definitions of problematic users, see WikiUser::ProblematicUsers for details.
static QString HtmlHeader
This string contains a html header.
static QString GetProjectURL()
Return a base url of current project.
static void PostProcessEdit(WikiEdit *_e)
static QString RingLogToText()
Return a ring log represented as 1 huge string.
static QString HtmlFooter
This string contains a html footer.
Feed provider stub class every provider must be derived from this one.
static void AppendQuery(Query *item)
Insert a query to internal list of running queries, so that they can be watched This will insert it t...
The RevertQuery class can be used to rollback any edit.
static void VersionRead()
VersionRead - read the version from embedded git file.
static Message * MessageUser(WikiUser *user, QString message, QString title, QString summary, bool section=true, Query *dependency=NULL)
MessageUser Message user.
QString LanguageName
This is a short language name which is used by system.
static QList< EditQuery * > PendingMods
Pending changes.
static ProcessorThread * Processor
This is a post-processor for edits.
Overwrite of qapplication so that we can reimplement notify.
static void DeleteEdit(WikiEdit *edit)
Remove edit in proper manner.
static void CheckQueries()
Check if all running queries are finished and if so it removes them from list.
Window that is displayed as first when huggle is started.
This is similar to query, just it's more simple, you can use it to deliver messages to users...
static HuggleFeed * SecondaryFeedProvider
Pointer to secondary feed provider.
static void Shutdown()
Terminate the process, call this after you release all resources and finish all queries.
Edits are post processed in this thread.
static RevertQuery * RevertEdit(WikiEdit *_e, QString summary="", bool minor=false, bool rollback=true, bool keep=false)
RevertEdit Reverts the edit.
static void PreProcessEdit(WikiEdit *_e)
static HuggleFeed * PrimaryFeedProvider
Pointer to primary feed provider.
static void LocalInit(QString name)
Initializes a localization with given name.
Miscelanceous system functions, all of these functions are static.
Every exception raised by huggle is defined by this class.
static void Init()
Function which is called as one of first when huggle is loaded.
static void DeveloperError()
Display a message box telling user that function is not allowed during developer mode.
Modifications of mediawiki pages can be done using this query.
static QList< WikiEdit * > ProcessingEdits
static QList< Query * > RunningQueries
List of all running queries.
static bool Running
Change this to false when you want to terminate all threads properly (you will need to wait few ms) ...
static void DebugLog(QString Message, unsigned int Verbosity=1)
This log is only shown if verbosity is same or larger than requested verbosity.
static void ParsePats(QString text)
Parse a part patterns for score words.
static QList< Message * > Messages
List of all messages that are being sent.
static QList< iExtension * > Extensions
List of extensions loaded in huggle.
This is a workaround that allow us to use sleep.
static QStringList RingLog
Ring log is a buffer that contains system messages.
static QList< Language * > LocalizationData
Languages D:
static void ExtensionLoad()
Load extensions (libraries as well as python)
static Login * f_Login
Login form.
static QStringList RingLogToQStringList()
Return a ring log as qstring list.
QString LanguageID
Long identifier of language that is seen by user.
static bool PreflightCheck(WikiEdit *_e)
Check if we can revert this edit.
static MainWindow * Main
Pointer to main.
static QString Trim(QString text)
Remove leading and finishing space of string.
static void LoadDefs()
Load a definitions of problematic users, see WikiUser::ProblematicUsers for details.
Query base class for all http queries executed by huggle.