2022-06-21 21:07:06 +02:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
2022-06-20 21:44:58 +02:00
|
|
|
|
2022-06-23 04:00:37 +02:00
|
|
|
#include "qmainwindow.h"
|
|
|
|
#include "qfontdatabase.h"
|
|
|
|
#include "qmessagebox.h"
|
2022-06-20 21:44:58 +02:00
|
|
|
|
2022-06-21 21:07:06 +02:00
|
|
|
#include "qtreewidget.h"
|
|
|
|
|
2022-06-30 20:47:05 +02:00
|
|
|
#include <thread>
|
|
|
|
|
2022-06-24 19:56:34 +02:00
|
|
|
#include "utilities.h"
|
2022-06-27 21:55:14 +02:00
|
|
|
#include "modules.h"
|
2022-06-26 22:31:45 +02:00
|
|
|
#include "tools/craplog/craplog.h"
|
2022-06-23 04:00:37 +02:00
|
|
|
|
2022-06-20 21:44:58 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
2022-06-21 21:07:06 +02:00
|
|
|
namespace Ui { class MainWindow; }
|
2022-06-20 21:44:58 +02:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2022-06-21 21:07:06 +02:00
|
|
|
class MainWindow : public QMainWindow
|
2022-06-20 21:44:58 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2022-06-24 19:56:34 +02:00
|
|
|
|
2022-06-20 21:44:58 +02:00
|
|
|
public:
|
2022-06-21 21:07:06 +02:00
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
~MainWindow();
|
2022-06-24 19:56:34 +02:00
|
|
|
|
2022-06-30 20:47:05 +02:00
|
|
|
//void operator()( int a );
|
|
|
|
|
2022-06-21 21:07:06 +02:00
|
|
|
private slots:
|
2022-06-30 20:47:05 +02:00
|
|
|
void on_button_LogFiles_ViewFile_clicked();
|
2022-06-24 19:56:34 +02:00
|
|
|
|
2022-06-25 21:17:40 +02:00
|
|
|
void on_checkBox_LogFiles_CheckAll_stateChanged(int arg1);
|
2022-06-24 19:56:34 +02:00
|
|
|
|
2022-06-30 20:47:05 +02:00
|
|
|
void on_button_LogFiles_RefreshList_clicked();
|
2022-06-24 19:56:34 +02:00
|
|
|
|
2022-06-21 21:07:06 +02:00
|
|
|
void on_listLogFiles_itemDoubleClicked(QTreeWidgetItem *item, int column);
|
2022-06-24 19:56:34 +02:00
|
|
|
|
2022-06-22 21:37:35 +02:00
|
|
|
void on_listLogFiles_itemChanged(QTreeWidgetItem *item, int column);
|
2022-06-24 19:56:34 +02:00
|
|
|
|
2022-06-26 23:12:57 +02:00
|
|
|
void on_button_LogFiles_Apache_clicked();
|
|
|
|
|
|
|
|
void on_button_LogFiles_Nginx_clicked();
|
|
|
|
|
|
|
|
void on_button_LogFiles_Iis_clicked();
|
|
|
|
|
2022-06-30 20:47:05 +02:00
|
|
|
void on_button_MakeStats_Start_clicked();
|
|
|
|
|
|
|
|
// custom
|
|
|
|
void update_MakeStats_labels();
|
|
|
|
|
2022-06-20 21:44:58 +02:00
|
|
|
private:
|
2022-06-21 21:07:06 +02:00
|
|
|
Ui::MainWindow *ui;
|
2022-06-24 19:56:34 +02:00
|
|
|
|
2022-06-27 19:49:09 +02:00
|
|
|
Craplog craplog;
|
2022-06-30 20:47:05 +02:00
|
|
|
std::thread craplog_thread;
|
|
|
|
QTimer *craplog_timer;
|
|
|
|
std::chrono::system_clock::time_point
|
|
|
|
craplog_timer_start,
|
|
|
|
craplog_timer_lapse;
|
|
|
|
std::chrono::system_clock::duration craplog_timer_elapsed;
|
|
|
|
void craplogStarted();
|
|
|
|
void craplogFinished();
|
2022-06-24 19:56:34 +02:00
|
|
|
|
2022-06-27 19:49:09 +02:00
|
|
|
// quantoty of informational dialogs to display
|
|
|
|
int dialogs_Level = 1; // 0: essential, 1: usefull, 2: explanatory
|
|
|
|
|
2022-06-27 21:55:14 +02:00
|
|
|
std::unordered_map<int, std::unordered_map<std::string, QString>> TB_COLOR_SCHEMES;
|
2022-06-24 19:56:34 +02:00
|
|
|
std::unordered_map<std::string, QColor> COLORS;
|
2022-06-25 18:48:08 +02:00
|
|
|
std::unordered_map<std::string, QFont> FONTS;
|
|
|
|
int font_size = 13,
|
|
|
|
font_size_big = 16,
|
|
|
|
font_size_small = 10;
|
2022-06-24 19:56:34 +02:00
|
|
|
|
2022-06-25 18:48:08 +02:00
|
|
|
// base font families, to build fonts from
|
2022-06-30 20:47:05 +02:00
|
|
|
QString main_font_family,
|
|
|
|
script_font_family;
|
|
|
|
|
|
|
|
/////////////////////
|
|
|
|
//// GENERAL USE ////
|
|
|
|
// get a printable size, from Bytes to the best fit
|
|
|
|
QString printableSize( int bytes ),
|
|
|
|
printableSpeed( int bytes, int secs ),
|
|
|
|
printableTime( int seconds );
|
2022-06-25 18:48:08 +02:00
|
|
|
|
2022-06-27 19:49:09 +02:00
|
|
|
//////////////
|
|
|
|
//// LOGS ////
|
|
|
|
// web servers related
|
|
|
|
bool loading_LogsList = false;
|
|
|
|
std::unordered_map<int, bool> allowed_web_servers;
|
2022-06-30 20:47:05 +02:00
|
|
|
void disableAllButtons_LogFiles_WS(),
|
|
|
|
enableAllButtons_LogFiles_WS();
|
2022-06-27 19:49:09 +02:00
|
|
|
// logs list related
|
2022-06-30 20:47:05 +02:00
|
|
|
bool display_used_files = true,
|
|
|
|
display_warnsize_files = true;
|
2022-06-25 18:48:08 +02:00
|
|
|
// text browser related
|
2022-06-27 21:55:14 +02:00
|
|
|
TextBrowser TB;
|
|
|
|
|
2022-06-20 21:44:58 +02:00
|
|
|
};
|
2022-06-21 21:07:06 +02:00
|
|
|
#endif // MAINWINDOW_H
|