Huggle
build:^490^dce1e5c
|
Miscelanceous system functions, all of these functions are static. More...
#include <core.hpp>
Static Public Member Functions | |
static void | AppendQuery (Query *item) |
Insert a query to internal list of running queries, so that they can be watched This will insert it to a process list in main form. More... | |
static void | CheckQueries () |
Check if all running queries are finished and if so it removes them from list. | |
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 | DeleteEdit (WikiEdit *edit) |
Remove edit in proper manner. | |
static void | DeveloperError () |
Display a message box telling user that function is not allowed during developer mode. | |
static EditQuery * | EditPage (WikiPage *page, QString text, QString summary="Edited using huggle", bool minor=false) |
static void | ExceptionHandler (Exception *exception) |
static void | ExtensionLoad () |
Load extensions (libraries as well as python) | |
static void | FinalizeMessages () |
static QString | GetKeyFromValue (QString item) |
static QString | GetKeyOfWarningTypeFromWarningName (QString id) |
static QString | GetNameOfWarningTypeFromWarningKey (QString key) |
static QString | GetProjectScriptURL (WikiSite Project) |
Return a script url like http://en.wikipedia.org/w/. | |
static QString | GetProjectScriptURL () |
Return a script url like http://en.wikipedia.org/w/. | |
static QString | GetProjectURL (WikiSite Project) |
Helper function that will return URL of project in question. More... | |
static QString | GetProjectURL () |
Return a base url of current project. | |
static QString | GetProjectWikiURL (WikiSite Project) |
Return a full url like http://en.wikipedia.org/wiki/. | |
static QString | GetProjectWikiURL () |
Return a full url like http://en.wikipedia.org/wiki/. | |
static QString | GetSummaryOfWarningTypeFromWarningKey (QString key) |
static QString | GetValueFromKey (QString item) |
static void | Init () |
Function which is called as one of first when huggle is loaded. | |
static void | InsertToRingLog (QString text) |
static void | LoadDB () |
static void | LoadDefs () |
Load a definitions of problematic users, see WikiUser::ProblematicUsers for details. | |
static void | LoadLocalizations () |
static QString | Localize (QString key) |
static void | Log (QString Message) |
Write text to terminal as well as ring log. More... | |
static Message * | MessageUser (WikiUser *user, QString message, QString title, QString summary, bool section=true, Query *dependency=NULL) |
MessageUser Message user. More... | |
static void | ParsePats (QString text) |
Parse a part patterns for score words. | |
static void | ParseWords (QString text) |
static void | PostProcessEdit (WikiEdit *_e) |
static bool | PreflightCheck (WikiEdit *_e) |
Check if we can revert this edit. | |
static void | PreProcessEdit (WikiEdit *_e) |
static void | ProcessEdit (WikiEdit *e) |
static bool | ReportPreFlightCheck () |
static QString | RetrieveTemplateToWarn (QString type) |
static RevertQuery * | RevertEdit (WikiEdit *_e, QString summary="", bool minor=false, bool rollback=true, bool keep=false) |
RevertEdit Reverts the edit. More... | |
static QStringList | RingLogToQStringList () |
Return a ring log as qstring list. More... | |
static QString | RingLogToText () |
Return a ring log represented as 1 huge string. | |
static int | RunningQueriesGetCount () |
static void | SaveDefs () |
Store a definitions of problematic users, see WikiUser::ProblematicUsers for details. | |
static void | Shutdown () |
Terminate the process, call this after you release all resources and finish all queries. | |
static QString | Trim (QString text) |
Remove leading and finishing space of string. | |
static void | VersionRead () |
VersionRead - read the version from embedded git file. More... | |
Static Public Attributes | |
static WikiPage * | AIVP = NULL |
Pointer to AIV page. | |
static QList< iExtension * > | Extensions |
List of extensions loaded in huggle. | |
static Login * | f_Login = NULL |
Login form. | |
static QList< HuggleQueueFilter * > | FilterDB |
static QString | HtmlFooter = "</table></body></html>" |
This string contains a html footer. | |
static QString | HtmlHeader = "" |
This string contains a html header. | |
static QList< Language * > | LocalizationData |
Languages D: | |
static MainWindow * | Main = NULL |
Pointer to main. | |
static QList< EditQuery * > | PendingMods |
Pending changes. | |
static HuggleFeed * | PrimaryFeedProvider = NULL |
Pointer to primary feed provider. | |
static QList< WikiEdit * > | ProcessingEdits |
static bool | Running = true |
Change this to false when you want to terminate all threads properly (you will need to wait few ms) | |
static HuggleFeed * | SecondaryFeedProvider = NULL |
Pointer to secondary feed provider. | |
static QDateTime | StartupTime = QDateTime::currentDateTime() |
static WikiPage * | UAAP = NULL |
Pointer to UAA page. | |
Static Private Member Functions | |
static void | LocalInit (QString name) |
Initializes a localization with given name. More... | |
static Language * | MakeLanguage (QString text, QString name) |
Static Private Attributes | |
static QList< Message * > | Messages |
List of all messages that are being sent. | |
static ProcessorThread * | Processor = NULL |
This is a post-processor for edits. | |
static QStringList | RingLog |
Ring log is a buffer that contains system messages. | |
static QList< Query * > | RunningQueries |
List of all running queries. | |
Miscelanceous system functions, all of these functions are static.
Making any instance of this class is nonsense don't do it :D
|
static |
Insert a query to internal list of running queries, so that they can be watched This will insert it to a process list in main form.
item | Query that is about to be inserted to list of running queries |
Definition at line 557 of file core.cpp.
References Huggle::Collectable::RegisterConsumer(), and RunningQueries.
Referenced by Huggle::DeleteForm::checkDelToken(), Huggle::BlockUser::CheckToken(), Huggle::ProtectPage::checkTokenToProtect(), Huggle::Message::Finish(), Huggle::UAAReport::getPageContents(), Huggle::DeleteForm::getToken(), Huggle::BlockUser::GetToken(), Huggle::ProtectPage::getTokenToProtect(), Huggle::WikiEdit::PostProcess(), Huggle::EditQuery::Process(), Huggle::EditQuery::Processed(), Huggle::HuggleFeedProviderWiki::Refresh(), RevertEdit(), Huggle::RevertQuery::Rollback(), and Huggle::Message::Send().
|
static |
Helper function that will return URL of project in question.
Project | Site |
Definition at line 649 of file core.cpp.
References Huggle::Configuration::GetURLProtocolPrefix(), and Huggle::WikiSite::URL.
|
staticprivate |
Initializes a localization with given name.
This function will create a new localization object using built-in localization file using Core::MakeLanguage() and insert that to language list
name | Name of a localization that is a name of language without txt suffix in localization folder |
Definition at line 937 of file core.cpp.
References LocalizationData.
|
static |
Write text to terminal as well as ring log.
Definition at line 563 of file core.cpp.
References Huggle::MainWindow::lUnwrittenLogs, Main, and Huggle::MainWindow::UnwrittenLogs.
Referenced by Huggle::MainWindow::_ReportUser(), Huggle::VandalNw::Connect(), DebugLog(), Huggle::HuggleWeb::DisplayDiff(), Huggle::MainWindow::Exit(), ExtensionLoad(), Huggle::Message::Fail(), Huggle::WikiEdit::FinalizePostProcessing(), Huggle::Message::Finish(), Huggle::HuggleTool::FinishPage(), Huggle::MainWindow::ForceWarn(), Huggle::Login::GetToken(), Init(), Huggle::Configuration::LoadConfig(), LoadDefs(), Huggle::MainWindow::MainWindow(), MessageUser(), Huggle::MainWindow::on_actionBlock_user_triggered(), Huggle::MainWindow::on_actionClear_talk_page_of_user_triggered(), Huggle::MainWindow::on_actionDelete_triggered(), Huggle::MainWindow::on_actionEdit_info_triggered(), Huggle::MainWindow::on_actionProtect_triggered(), Huggle::MainWindow::on_actionReport_user_2_triggered(), Huggle::MainWindow::on_actionReport_user_triggered(), Huggle::MainWindow::on_actionReport_username_triggered(), Huggle::MainWindow::on_actionWiki_triggered(), Huggle::UAAReport::onTick(), Huggle::EditQuery::Processed(), Huggle::RevertQuery::ProcessRevert(), Huggle::MainWindow::ReconnectIRC(), Huggle::HuggleFeedProviderWiki::Refresh(), Huggle::MainWindow::Revert(), Huggle::RevertQuery::Rollback(), Huggle::Configuration::SaveConfig(), SaveDefs(), Shutdown(), Huggle::HuggleFeedProviderIRC::Start(), Huggle::HuggleFeedProviderIRC::Stop(), Huggle::MainWindow::Warn(), and Huggle::MainWindow::Welcome().
|
static |
MessageUser Message user.
user | Pointer to user |
message | Text of message |
title | Title |
summary | Summary |
section | Whether this message should be created in a new section |
dependency | Query that is used as a dependency, if it's not NULL the system will wait for it to finish before the message is sent |
Definition at line 427 of file core.cpp.
References Huggle::Message::Dependency, Log(), Messages, Huggle::Message::Section, Huggle::Message::Send(), Huggle::Message::title, and Huggle::WikiUser::Username.
Referenced by Huggle::MainWindow::ForceWarn(), Huggle::MainWindow::Warn(), and Huggle::MainWindow::Welcome().
|
static |
Perform more expensive tasks to finalize edit processing
Definition at line 774 of file core.cpp.
References Huggle::WikiEdit::PostProcess(), ProcessingEdits, Huggle::Collectable::RegisterConsumer(), and Huggle::Collectable::UnregisterConsumer().
Referenced by Huggle::HuggleTool::FinishPage(), Huggle::HuggleFeedProviderWiki::RetrieveEdit(), and Huggle::HuggleFeedProviderIRC::RetrieveEdit().
|
static |
Check the edit summary and similar in order to determine several edit attributes etc
Definition at line 747 of file core.cpp.
References Huggle::WikiEdit::Bot, Huggle::WikiEdit::EditMadeByHuggle, Huggle::Configuration::EditSuffixOfHuggle, Huggle::WikiEdit::Summary, and Huggle::WikiEdit::User.
|
static |
RevertEdit Reverts the edit.
_e | Pointer to edit that needs to be reverted |
summary | Summary to use if this is empty the default revert summary is used |
minor | If revert should be considered as minor edit |
rollback | If rollback feature should be used |
keep | Whether the query produced by this function should not be automatically deleted |
Definition at line 855 of file core.cpp.
References AppendQuery(), Huggle::Configuration::EnforceManualSoftwareRollback, Huggle::WikiEdit::Page, Huggle::RevertQuery::Process(), Huggle::Collectable::RegisterConsumer(), Huggle::WikiEdit::User, and Huggle::RevertQuery::UsingSR.
Referenced by Huggle::MainWindow::Revert().
|
static |
Return a ring log as qstring list.
Definition at line 724 of file core.cpp.
References RingLog.
Referenced by Huggle::MainWindow::MainWindow().
|
static |
VersionRead - read the version from embedded git file.
This function may be called also from terminal parser
Definition at line 627 of file core.cpp.
References Huggle::Configuration::HuggleVersion.
Referenced by Init().
|
static |
This is a list of all edits that are being processed by some way whole list needs to be checked and probed everytime once a while
Definition at line 124 of file core.hpp.
Referenced by PostProcessEdit().