-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
if logging is started then confirmationbox will apear if user need to go back to settings window. some other small bugs are also identified and killed. :-)
- Loading branch information
Showing
16 changed files
with
381 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
|
||
|
||
#include "qdebug.h" | ||
|
||
#include "confirmationbox.h" | ||
|
||
class globalVars : public QObject | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#include "confirmationbox.h" | ||
#include "ui_confirmationbox.h" | ||
|
||
ConfirmationBox::ConfirmationBox(QWidget *parent) : | ||
QDialog(parent), | ||
ui(new Ui::ConfirmationBox) | ||
{ | ||
ui->setupUi(this); | ||
this->setFixedSize(530, 300); | ||
// int msgBox_width = 530; | ||
// int msgBox_height = 300; | ||
// int x = (parentWidget()->window()->frameGeometry().topLeft().x()+ parentWidget()->window()->rect().y()) - (msgBox_width); | ||
// int y = parentWidget()->window()->frameGeometry().topLeft().y() + parentWidget()->window()->rect().y() - (msgBox_height); | ||
|
||
//this->setGeometry(x, y, msgBox_width, msgBox_height); | ||
//qDebug()<<" x:"<<x<<" y:"<<y<<" width:"<<msgBox_width<<" Height:"<<msgBox_height; | ||
|
||
this->setWindowFlags(Qt::FramelessWindowHint); | ||
//this->setWindowState(Qt::WindowFullScreen); | ||
this->setWindowFlag(Qt::WindowStaysOnTopHint); | ||
this->setAttribute(Qt::WA_DeleteOnClose, true); //so that it will be deleted when closed | ||
|
||
|
||
|
||
} | ||
|
||
ConfirmationBox::~ConfirmationBox() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void ConfirmationBox::on_pb_Yes_clicked() | ||
{ | ||
emit tx_confirmationBoxClosed(true, localParam); | ||
this->close(); | ||
} | ||
void ConfirmationBox::on_pb_No_clicked() | ||
{ | ||
emit tx_confirmationBoxClosed(false, localParam); | ||
this->close(); | ||
} | ||
|
||
|
||
// ---------------- slots ------------------------- | ||
void ConfirmationBox::rx_MessageBoxVariables(int parm, QString title, QString msg) | ||
{ | ||
localParam = parm; | ||
ui->lbl_Title->setText(title); | ||
ui->lbl_Message->setText(msg); | ||
} | ||
void ConfirmationBox::rx_MessageBoxVariables(int parm, QString title, QString msg, QString yesBtnText, bool yesBtnShow, QString noBtnText, bool noBtnShow) | ||
{ | ||
localParam = parm; | ||
ui->lbl_Title->setText(title); | ||
ui->lbl_Message->setText(msg); | ||
|
||
ui->pb_Yes->setText(yesBtnText); | ||
ui->pb_Yes->setVisible(yesBtnShow); | ||
|
||
ui->pb_No->setText(noBtnText); | ||
ui->pb_No->setVisible(noBtnShow); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef CONFIRMATIONBOX_H | ||
#define CONFIRMATIONBOX_H | ||
|
||
#include <QDialog> | ||
|
||
#include "qdebug.h" | ||
|
||
namespace Ui { | ||
class ConfirmationBox; | ||
} | ||
|
||
class ConfirmationBox : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit ConfirmationBox(QWidget *parent = nullptr); | ||
~ConfirmationBox(); | ||
|
||
signals: | ||
void tx_confirmationBoxClosed(bool yesBTN, int param); | ||
|
||
|
||
|
||
public slots: | ||
void rx_MessageBoxVariables(int parm, QString title, QString msg); | ||
void rx_MessageBoxVariables(int parm, QString title, QString msg, QString yesBtnText, bool yesBtnShow, QString noBtnText, bool noBtnShow); | ||
|
||
|
||
|
||
private slots: | ||
void on_pb_Yes_clicked(); | ||
void on_pb_No_clicked(); | ||
|
||
private: | ||
Ui::ConfirmationBox *ui; | ||
|
||
int localParam = 0; | ||
}; | ||
|
||
#endif // CONFIRMATIONBOX_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>ConfirmationBox</class> | ||
<widget class="QDialog" name="ConfirmationBox"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>530</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Dialog</string> | ||
</property> | ||
<property name="styleSheet"> | ||
<string notr="true">QDialog {color: qlineargradient(spread:pad, x1:0 y1:0, x2:1 y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255)); | ||
|
||
background: qlineargradient( x1:0 y1:0, x2:1 y2:0, stop:0 rgb(39, 46, 141) , stop:0.5 rgb(39, 46, 141) , stop:1 rgb(149, 155, 173) ); | ||
} | ||
QPushButton { | ||
font: 600 20pt "Times New Roman"; | ||
padding: 5px; | ||
background-color: rgb(255, 255, 255); | ||
border: 1px solid black; | ||
border-radius:5px; | ||
} | ||
QPushButton:hover { | ||
font: 600 20pt "Times New Roman"; | ||
padding: 5px; | ||
background-color: rgb(215, 215, 215); | ||
border: 2px solid black; | ||
border-radius:5px; | ||
} | ||
QLabel { | ||
font: 600 18pt "Times New Roman"; | ||
padding: 8px; | ||
color:white; | ||
} | ||
|
||
QLCDNumber{ | ||
font: 600 18pt "Times New Roman"; | ||
padding: 8px; | ||
background-color:transparent; | ||
border:0px solid transparent; | ||
} | ||
|
||
QPushButton:disabled { | ||
background-color:#ff0000; | ||
border:0px solid transparent; | ||
} </string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QLabel" name="lbl_Title"> | ||
<property name="styleSheet"> | ||
<string notr="true">color:white; | ||
font:700 36pt "Old English Text MT"; | ||
text-decoration:underline;</string> | ||
</property> | ||
<property name="text"> | ||
<string>Title</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="lbl_Message"> | ||
<property name="minimumSize"> | ||
<size> | ||
<width>0</width> | ||
<height>150</height> | ||
</size> | ||
</property> | ||
<property name="styleSheet"> | ||
<string notr="true">color:white; | ||
font:600 18pt "Times New Roman";</string> | ||
</property> | ||
<property name="text"> | ||
<string>Message</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
<property name="wordWrap"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<item> | ||
<spacer name="horizontalSpacer_2"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeType"> | ||
<enum>QSizePolicy::Fixed</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="pb_Yes"> | ||
<property name="text"> | ||
<string>Yes</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer_3"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeType"> | ||
<enum>QSizePolicy::Preferred</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="pb_No"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="text"> | ||
<string>No</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeType"> | ||
<enum>QSizePolicy::Fixed</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
Oops, something went wrong.