From b6d103c711e19e203260f636b5ee537bb0e032a7 Mon Sep 17 00:00:00 2001 From: eshanized Date: Fri, 20 Dec 2024 18:42:15 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs(=5Ffunc):=20SnigdhaOSBlackb?= =?UTF-8?q?ox::SnigdhaOSBlackbox(QWidget=20*parent,=20QString=20state)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qt/snigdhaosblackbox.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/qt/snigdhaosblackbox.cpp b/qt/snigdhaosblackbox.cpp index 417c3e6..18df089 100644 --- a/qt/snigdhaosblackbox.cpp +++ b/qt/snigdhaosblackbox.cpp @@ -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. SnigdhaOSBlackbox::SnigdhaOSBlackbox(QWidget *parent, QString state) - : QMainWindow(parent) - , ui(new Ui::SnigdhaOSBlackbox) + : QMainWindow(parent) // Calls the constructor of the QMainWindow base class to initialize the main window with the parent widget. + , 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")); + + // Initializes the user interface, setting up the UI components (buttons, labels, etc.) in the SnigdhaOSBlackbox window. 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); + + // 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(); + + // 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); }