mirror of
https://github.com/Snigdha-OS/snigdhaos-blackbox.git
synced 2025-09-21 03:55:05 +02:00
📝 docs(_func): SnigdhaOSBlackbox::SnigdhaOSBlackbox(QWidget *parent, QString state)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user