mirror of
https://github.com/Snigdha-OS/snigdhaos-assistant.git
synced 2025-09-08 05:35:02 +02:00
refactor(reform): re format the comments as explanation
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
//main function of the application, responsible for starting the Qt application and
|
||||||
|
//creating an instance of the SnigdhaOSAssistant class.
|
||||||
|
|
||||||
#include "snigdhaosassistant.h"
|
#include "snigdhaosassistant.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
@@ -4,16 +4,18 @@
|
|||||||
* love from Bangladesh
|
* love from Bangladesh
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//preprocessor directives: ensures that the contents of the file are only included once in a translation unit,
|
/*
|
||||||
//preventing multiple inclusions and potential naming conflicts
|
* preprocessor directives: ensures that the contents of the file are only included once in a translation unit,
|
||||||
|
* preventing multiple inclusions and potential naming conflicts
|
||||||
|
*/
|
||||||
#ifndef SNIGDHAOSASSISTANT_H
|
#ifndef SNIGDHAOSASSISTANT_H
|
||||||
#define SNIGDHAOSASSISTANT_H
|
#define SNIGDHAOSASSISTANT_H
|
||||||
|
|
||||||
//class for main application windows
|
/*class for main application windows*/
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
//abstract base class for buttons
|
/*abstract base class for buttons*/
|
||||||
#include <QAbstractButton>
|
#include <QAbstractButton>
|
||||||
//class for managing network operations
|
/*class for managing network operations*/
|
||||||
#include <QtNetwork/QNetworkAccessManager>
|
#include <QtNetwork/QNetworkAccessManager>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -26,14 +28,19 @@ class SnigdhaOSAssistant;
|
|||||||
}
|
}
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
//declares a class named SnigdhaOSAssistant, which inherits from QMainWindow.
|
/*
|
||||||
//the Q_OBJECT macro is used to enable the Qt's meta-object system for this class, allowing features like signals and slots.
|
* declares a class named SnigdhaOSAssistant, which inherits from QMainWindow.
|
||||||
|
* the Q_OBJECT macro is used to enable the Qt's meta-object system for this class,
|
||||||
|
* allowing features like signals and slots.
|
||||||
|
*/
|
||||||
class SnigdhaOSAssistant : public QMainWindow
|
class SnigdhaOSAssistant : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
//declares an enumeration type named State inside the SnigdhaOSAssistant class,
|
/*
|
||||||
//containing various states that the application can be in.
|
* declares an enumeration type named State inside the SnigdhaOSAssistant class,
|
||||||
|
* containing various states that the application can be in.
|
||||||
|
*/
|
||||||
public:
|
public:
|
||||||
enum class State {
|
enum class State {
|
||||||
QUIT,
|
QUIT,
|
||||||
@@ -50,27 +57,38 @@ public:
|
|||||||
SUCCESS
|
SUCCESS
|
||||||
};
|
};
|
||||||
|
|
||||||
//constructor and destructor declarations for the SnigdhaOSAssistant class.
|
/*
|
||||||
//the constructor takes a QWidget pointer as the parent widget and a QString representing the initial state of the application.
|
* constructor and destructor declarations for the SnigdhaOSAssistant class.
|
||||||
//the destructor has no parameters.
|
* the constructor takes a QWidget pointer as the parent widget and a QString representing
|
||||||
|
* the initial state of the application.
|
||||||
|
* the destructor has no parameters.
|
||||||
|
*/
|
||||||
SnigdhaOSAssistant(QWidget* parent = nullptr, QString state = "WELCOME");
|
SnigdhaOSAssistant(QWidget* parent = nullptr, QString state = "WELCOME");
|
||||||
~SnigdhaOSAssistant();
|
~SnigdhaOSAssistant();
|
||||||
|
|
||||||
//declare private slots, which are functions that can be connected to signals from widgets
|
/*
|
||||||
|
* declare private slots, which are functions that can be connected to signals from widgets
|
||||||
|
*/
|
||||||
private slots:
|
private slots:
|
||||||
void on_textWidget_buttonBox_clicked(QAbstractButton* button);
|
void on_textWidget_buttonBox_clicked(QAbstractButton* button);
|
||||||
void on_selectWidget_buttonBox_clicked(QAbstractButton* button);
|
void on_selectWidget_buttonBox_clicked(QAbstractButton* button);
|
||||||
|
|
||||||
//These are private member variables of the SnigdhaOSAssistant class.
|
/*
|
||||||
//ui is a pointer to the user interface object generated by Qt Designer.
|
* These are private member variables of the SnigdhaOSAssistant class.
|
||||||
//executable_modify_date is a QDateTime object representing the modification date of the executable.
|
* ui is a pointer to the user interface object generated by Qt Designer.
|
||||||
//currentState is an instance of the State enumeration representing the current state of the application.
|
* executable_modify_date is a QDateTime object representing the modification date of the executable.
|
||||||
|
* currentState is an instance of the State enumeration representing the current state of the application.
|
||||||
|
*/
|
||||||
private:
|
private:
|
||||||
Ui::SnigdhaOSAssistant *ui;
|
Ui::SnigdhaOSAssistant *ui;
|
||||||
QDateTime executable_modify_date;
|
QDateTime executable_modify_date;
|
||||||
State currentState;
|
State currentState;
|
||||||
//private member functions of the SnigdhaOSAssistant class.
|
/*
|
||||||
//they perform various tasks such as making internet requests, updating the application, populating select widgets, updating the application state, and relaunching the application.
|
* private member functions of the SnigdhaOSAssistant class.
|
||||||
|
* they perform various tasks such as making internet requests,
|
||||||
|
* updating the application, populating select widgets,
|
||||||
|
* updating the application state, and relaunching the application.
|
||||||
|
*/
|
||||||
void doInternetUpRequest();
|
void doInternetUpRequest();
|
||||||
void doUpdate();
|
void doUpdate();
|
||||||
void doApply();
|
void doApply();
|
||||||
|
Reference in New Issue
Block a user