<commit_before>#pragma once

#include "WebUpdates.hpp"
#include "ClientWrapper.hpp"
#include "html5viewer/html5viewer.h"

#include <QMainWindow>
#include <QSettings>
#include <QMenu>
#include <QTimer>
#include <QUuid>

#include <QtWidgets>
//#include <QtWebEngineWidgets>

QT_BEGIN_NAMESPACE
class QWebEngineView;
class QLineEdit;
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT
    QSettings _settings;
    QMenu* _fileMenu;
    QMenu* _accountMenu;
    QString _deferredUrl;

    //Temporary storage for a web update description being considered for application.
    //Do not trust this as the in-use web update.
    WebUpdateManifest::UpdateDetails _webUpdateDescription;
    //Version information for the running client and GUI. These values may be trusted
    //as accurate regarding the web update currently being shown to the user.
    uint8_t _majorVersion = 0;
    uint8_t _forkVersion = 0;
    uint8_t _minorVersion = 0;
    uint8_t _patchVersion = 0;

    QTimer* _updateChecker;
    QUuid app_id;
    QString version;

  public:
    MainWindow();
    QMenu* fileMenu() { return _fileMenu; }
    QMenu* accountMenu() { return _accountMenu; }

    bool eventFilter(QObject* object, QEvent* event);

    ClientWrapper *clientWrapper() const;
    void setClientWrapper(ClientWrapper* clientWrapper);
    void navigateTo(const QString& path);

    bool detectCrash();
    QUuid getAppId() const { return app_id; }

public Q_SLOTS:
    void goToMyAccounts();
    void goToAccount(QString accountName);
    void goToCreateAccount();
    void goToAddContact();
    void checkWebUpdates(bool showNoUpdatesAlert = true,
                         std::function<void()> finishedCheckCallback = std::function<void()>());
    void loadWebUpdates();

    //Causes this window to attempt to become the front window on the desktop
    void takeFocus();
    void hideWindow();

    ///Used to schedule a custom URL for processing later, once the app has finished starting
    void deferCustomUrl(QString url);
    ///Triggers the deferred URL processign. Call once app has finished starting
    void processDeferredUrl();
    ///Used to process a custom URL now (only call if app has finished starting)<commit_msg>revert unexpected deleted codes<commit_after>#pragma once

#include "WebUpdates.hpp"
#include "ClientWrapper.hpp"
#include "html5viewer/html5viewer.h"

#include <QMainWindow>
#include <QSettings>
#include <QMenu>
#include <QTimer>
#include <QUuid>

#include <QtWidgets>
//#include <QtWebEngineWidgets>

QT_BEGIN_NAMESPACE
class QWebEngineView;
class QLineEdit;
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT
    QSettings _settings;
    QMenu* _fileMenu;
    QMenu* _accountMenu;
    QString _deferredUrl;

    QLineEdit *_locationEdit;
    QToolBar *_navToolBar;

    //Temporary storage for a web update description being considered for application.
    //Do not trust this as the in-use web update.
    WebUpdateManifest::UpdateDetails _webUpdateDescription;
    //Version information for the running client and GUI. These values may be trusted
    //as accurate regarding the web update currently being shown to the user.
    uint8_t _majorVersion = 0;
    uint8_t _forkVersion = 0;
    uint8_t _minorVersion = 0;
    uint8_t _patchVersion = 0;

    QTimer* _updateChecker;
    QUuid app_id;
    QString version;

  public:
    MainWindow();
    QMenu* fileMenu() { return _fileMenu; }
    QMenu* accountMenu() { return _accountMenu; }

    bool eventFilter(QObject* object, QEvent* event);

    ClientWrapper *clientWrapper() const;
    void setClientWrapper(ClientWrapper* clientWrapper);
    void navigateTo(const QString& path);

    bool detectCrash();
    QUuid getAppId() const { return app_id; }

public Q_SLOTS:
    void goToMyAccounts();
    void goToAccount(QString accountName);
    void goToCreateAccount();
    void goToAddContact();
    void checkWebUpdates(bool showNoUpdatesAlert = true,
                         std::function<void()> finishedCheckCallback = std::function<void()>());
    void loadWebUpdates();

    //Causes this window to attempt to become the front window on the desktop
    void takeFocus();
    void hideWindow();

    void setupNavToolbar();    
    void changeLocation();      
    void updateLocationEdit(const QUrl& newUrl);

    ///Used to schedule a custom URL for processing later, once the app has finished starting
    void deferCustomUrl(QString url);
    ///Triggers the deferred URL processign. Call once app has finished starting
    void processDeferredUrl();
    ///Used to process a custom URL now (only call if app has finished starting)
{'fraction_non_alphanumeric': 0.081702859600086, 'fraction_numerical': 0.0043001505052676844, 'mean_word_length': 3.756646216768916, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1492560', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1338, 'n_words': 454}