📝 docs(_func): SnigdhaOSBlackbox::SnigdhaOSBlackbox(QWidget *parent, QString state)

This commit is contained in:
eshanized
2024-12-20 18:42:15 +05:30
parent f5b3898997
commit b6d103c711

View File

@@ -14,13 +14,23 @@
const char* INTERNET_CHECK_URL = "https://snigdha-os.github.io/"; // URL used to verify internet connectivity by sending a network request. const char* INTERNET_CHECK_URL = "https://snigdha-os.github.io/"; // URL used to verify internet connectivity by sending a network request.
SnigdhaOSBlackbox::SnigdhaOSBlackbox(QWidget *parent, QString state) SnigdhaOSBlackbox::SnigdhaOSBlackbox(QWidget *parent, QString state)
: QMainWindow(parent) : QMainWindow(parent) // Calls the constructor of the QMainWindow base class to initialize the main window with the parent widget.
, ui(new Ui::SnigdhaOSBlackbox) , ui(new Ui::SnigdhaOSBlackbox) // Initializes the user interface (UI) for the SnigdhaOSBlackbox window, using the UI class auto-generated by Qt Designer.
{ {
// Sets the window icon to the specified file path, ensuring that the application window will display the given icon (SVG format).
this->setWindowIcon(QIcon("/usr/share/pixmaps/snigdhaos-blackbox.svg")); this->setWindowIcon(QIcon("/usr/share/pixmaps/snigdhaos-blackbox.svg"));
// Initializes the user interface, setting up the UI components (buttons, labels, etc.) in the SnigdhaOSBlackbox window.
ui->setupUi(this); ui->setupUi(this);
// Modifies the window flags to disable the close button on the window (i.e., the application cannot be closed directly via the window).
this->setWindowFlags(this->windowFlags() & -Qt::WindowCloseButtonHint); this->setWindowFlags(this->windowFlags() & -Qt::WindowCloseButtonHint);
// Gets the last modified timestamp of the executable file (the current running application), which is useful for checking when the application was last updated.
executable_modify_date = QFileInfo(QCoreApplication::applicationFilePath()).lastModified(); executable_modify_date = QFileInfo(QCoreApplication::applicationFilePath()).lastModified();
// Updates the application state based on the provided `state` parameter.
// This can be a state like "WELCOME", "INTERNET", etc., depending on the condition provided by the caller.
updateState(state); updateState(state);
} }