<commit_before>#include "mainwindow.h"
#include "backuplistwidgetitem.h"
#include "debug.h"
#include "scheduling.h"
#include "translator.h"
#include "utils.h"

#include <QDateTime>
#include <QDesktopServices>
#include <QDir>
#include <QFileDialog>
#include <QHostInfo>
#include <QInputDialog>
#include <QMenu>
#include <QPainter>
#include <QSharedPointer>
#include <QShortcut>

#include <TSettings.h>

#define MAIN_LOGO_RIGHT_MARGIN 5
#define MAIN_LOGO_FUDGE 3

MainWindow::MainWindow(QWidget *parent)
    : QWidget(parent),
      _minWidth(0),
      _menuBar(nullptr),
      _aboutToQuit(false),
      _stopTasksDialog(this),
      _filePickerDialog(this),
      _archivesTabWidget(this),
      _settingsWidget(this),
      _helpWidget(this)
{
    connect(&ConsoleLog::instance(), &ConsoleLog::message, this,
            &MainWindow::appendToConsoleLog);

    // Ui initialization
    _ui.setupUi(this);

    displayTab(_ui.backupTab);
    bool vbt = _backupTabWidget_validateBackupTab();
    _ui.actionBackupNow->setEnabled(vbt);
    _ui.actionBackupMorphIntoJob->setEnabled(vbt);

    _ui.mainContentSplitter->setCollapsible(0, false);
    _ui.journalLog->hide();

    _ui.archivesVerticalLayout->insertWidget(0, &_archivesTabWidget);
    _ui.settingsTabVerticalLayout->insertWidget(0, &_settingsWidget);
    _ui.helpTabLayout->insertWidget(0, &_helpWidget);

    connectSettingsWidget();

    // --

    updateUi();

    // --

    // Ui actions setup
    _ui.settingsTab->addAction(_ui.actionRefreshAccount);
    connect(_ui.actionRefreshAccount, &QAction::triggered, this,
            &MainWindow::getOverallStats);
    connect(_ui.actionRefreshAccount, &QAction::triggered, this,
            [&]() { _settingsWidget.getAccountInfo(); });
    addAction(_ui.actionGoBackup);
    addAction(_ui.actionGoArchives);
    addAction(_ui.actionGoJobs);
    addAction(_ui.actionGoSettings);
    addAction(_ui.actionGoHelp);
    connect(_ui.actionGoBackup, &QAction::triggered,
            [&]() { displayTab(_ui.backupTab); });
    connect(_ui.actionGoArchives, &QAction::triggered,<commit_msg>MainWindow: simpler *TabWidget layout<commit_after>#include "mainwindow.h"
#include "backuplistwidgetitem.h"
#include "debug.h"
#include "scheduling.h"
#include "translator.h"
#include "utils.h"

#include <QDateTime>
#include <QDesktopServices>
#include <QDir>
#include <QFileDialog>
#include <QHostInfo>
#include <QInputDialog>
#include <QMenu>
#include <QPainter>
#include <QSharedPointer>
#include <QShortcut>

#include <TSettings.h>

#define MAIN_LOGO_RIGHT_MARGIN 5
#define MAIN_LOGO_FUDGE 3

MainWindow::MainWindow(QWidget *parent)
    : QWidget(parent),
      _minWidth(0),
      _menuBar(nullptr),
      _aboutToQuit(false),
      _stopTasksDialog(this),
      _filePickerDialog(this),
      _archivesTabWidget(this),
      _settingsWidget(this),
      _helpWidget(this)
{
    connect(&ConsoleLog::instance(), &ConsoleLog::message, this,
            &MainWindow::appendToConsoleLog);

    // Ui initialization
    _ui.setupUi(this);

    displayTab(_ui.backupTab);
    bool vbt = _backupTabWidget_validateBackupTab();
    _ui.actionBackupNow->setEnabled(vbt);
    _ui.actionBackupMorphIntoJob->setEnabled(vbt);

    _ui.mainContentSplitter->setCollapsible(0, false);
    _ui.journalLog->hide();

    _ui.archivesVerticalLayout->addWidget(&_archivesTabWidget);
    _ui.settingsTabVerticalLayout->addWidget(&_settingsWidget);
    _ui.helpTabLayout->addWidget(&_helpWidget);

    connectSettingsWidget();

    // --

    updateUi();

    // --

    // Ui actions setup
    _ui.settingsTab->addAction(_ui.actionRefreshAccount);
    connect(_ui.actionRefreshAccount, &QAction::triggered, this,
            &MainWindow::getOverallStats);
    connect(_ui.actionRefreshAccount, &QAction::triggered, this,
            [&]() { _settingsWidget.getAccountInfo(); });
    addAction(_ui.actionGoBackup);
    addAction(_ui.actionGoArchives);
    addAction(_ui.actionGoJobs);
    addAction(_ui.actionGoSettings);
    addAction(_ui.actionGoHelp);
    connect(_ui.actionGoBackup, &QAction::triggered,
            [&]() { displayTab(_ui.backupTab); });
    connect(_ui.actionGoArchives, &QAction::triggered,
{'fraction_non_alphanumeric': 0.13354037267080746, 'fraction_numerical': 0.0026278069756330625, 'mean_word_length': 4.487549148099607, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 41, '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': '4908480', 'n_tokens_mistral': 1389, 'n_tokens_neox': 1366, 'n_words': 193}