diff --git a/client/resources/stylesheet.qss b/client/resources/stylesheet.qss index 279a0d71..ca5e08d3 100644 --- a/client/resources/stylesheet.qss +++ b/client/resources/stylesheet.qss @@ -286,21 +286,21 @@ QTreeWidget::branch:open:has-children:has-siblings { /* QLineEdit */ -QLineEdit, QSpinBox, QTextEdit, QDateTimeEdit, QTimeEdit{ +QLineEdit, QSpinBox, QTextEdit, QDateTimeEdit, QTimeEdit, QDateEdit{ background-color: rgba(255,255,255,70%); color:black; min-height: 25px; padding-left: 5px; } -QLineEdit:!enabled, QSpinBox:!enabled, QTextEdit:!enabled, QDateTimeEdit:!enabled, QTimeEdit:!enabled{ +QLineEdit:!enabled, QSpinBox:!enabled, QTextEdit:!enabled, QDateTimeEdit:!enabled, QTimeEdit:!enabled, QDateEdit:!enabled{ background-color: rgba(0,0,0,0%); color:rgba(255,255,255,80%); padding-left: 0px; } -QDateTimeEdit::down-arrow:!enabled, QDateTimeEdit::up-arrow:!enabled { +QDateTimeEdit::down-arrow:!enabled, QDateTimeEdit::up-arrow:!enabled, QDateEdit::down-arrow:!enabled, QDateEdit::up-arrow:!enabled { image: none; } diff --git a/client/src/dialogs/TestInvitationDialog.cpp b/client/src/dialogs/TestInvitationDialog.cpp index 155f27a5..37e7de5e 100644 --- a/client/src/dialogs/TestInvitationDialog.cpp +++ b/client/src/dialogs/TestInvitationDialog.cpp @@ -16,11 +16,25 @@ TestInvitationDialog::~TestInvitationDialog() delete ui; } +void TestInvitationDialog::setTestTypes(const QList &test_types) +{ + ui->cmbTestType->clear(); + + for (TeraData tt: test_types){ + ui->cmbTestType->addItem(tt.getName(), tt.getId()); + } +} + void TestInvitationDialog::initUI() { ui->stackedPages->setCurrentIndex(0); ui->btnPrevious->setEnabled(false); ui->btnOK->setEnabled(false); + + ui->dateExpiration->setDate(QDate::currentDate().addDays(30)); + + ui->widgetInvitees->setCountLimited(false); + } void TestInvitationDialog::on_btnCancel_clicked() diff --git a/client/src/dialogs/TestInvitationDialog.h b/client/src/dialogs/TestInvitationDialog.h index 1cc1c22a..607799c4 100644 --- a/client/src/dialogs/TestInvitationDialog.h +++ b/client/src/dialogs/TestInvitationDialog.h @@ -2,6 +2,7 @@ #define TESTINVITATIONDIALOG_H #include +#include "TeraData.h" namespace Ui { class TestInvitationDialog; @@ -15,15 +16,15 @@ class TestInvitationDialog : public QDialog explicit TestInvitationDialog(QWidget *parent = nullptr); ~TestInvitationDialog(); + void setTestTypes(const QList& test_types); + private slots: void on_btnCancel_clicked(); void on_stackedPages_currentChanged(int current_index); void on_btnPrevious_clicked(); - void on_btnNext_clicked(); - void on_btnOK_clicked(); private: diff --git a/client/src/dialogs/TestInvitationDialog.ui b/client/src/dialogs/TestInvitationDialog.ui index 1772dea7..ae067cde 100644 --- a/client/src/dialogs/TestInvitationDialog.ui +++ b/client/src/dialogs/TestInvitationDialog.ui @@ -17,6 +17,9 @@ :/icons/test.png:/icons/test.png + + + @@ -27,11 +30,11 @@ - 0 + 1 - + @@ -45,34 +48,55 @@ - Usage maximal + Usage maximal (0 = illimité) Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + + + + 0 + 0 + + 0 - 30 + 0 + + QAbstractSpinBox::ButtonSymbols::UpDownArrows + + + 1000 + - - + + + + + 0 + 0 + + 0 - 30 + 0 + + QAbstractSpinBox::ButtonSymbols::UpDownArrows + - + Envoyer les invitations automatiquement par courriel @@ -113,7 +137,7 @@ - + @@ -128,23 +152,7 @@ - - - - - 0 - 0 - - - - false - - - true - - - - + Qt::Orientation::Vertical @@ -162,7 +170,7 @@ - + diff --git a/client/src/editors/ProjectWidget.cpp b/client/src/editors/ProjectWidget.cpp index c68f352e..cb187899 100644 --- a/client/src/editors/ProjectWidget.cpp +++ b/client/src/editors/ProjectWidget.cpp @@ -52,6 +52,7 @@ ProjectWidget::ProjectWidget(ComManager *comMan, const TeraData *data, QWidget * if (!dataIsNew()){ queryServicesProject(); + queryTestTypesProject(); } } @@ -135,6 +136,7 @@ void ProjectWidget::connectSignals() void ProjectWidget::initUI() { ui->wdgInvitations->setComManager(m_comManager); + ui->tabNav->setTabVisible(ui->tabNav->indexOf(ui->tabInvitations), false); // Default display ui->tabNav->setCurrentIndex(0); @@ -510,6 +512,7 @@ void ProjectWidget::updateParticipant(const TeraData *participant) item_last_online = new TableDateWidgetItem(); item_last_online->setTextAlignment(Qt::AlignCenter); ui->tableSummary->setItem(current_row, 5, item_last_online); + } // Set current values @@ -713,6 +716,24 @@ void ProjectWidget::queryUsers() queryDataRequest(WEB_PROJECTACCESS_PATH, args); } +void ProjectWidget::refreshSelectedTestTypes() +{ + QList test_types; + for (int i=0; ilstTestTypes->count(); i++){ + QListWidgetItem* item = ui->lstTestTypes->item(i); + if (item->checkState() == Qt::Checked){ + TeraData tt(TeraDataTypes::TERADATA_TESTTYPE); + tt.setName(item->text()); + int id_test_type = m_listTestTypes_items.key(item); + tt.setId(id_test_type); + test_types.append(tt); + } + } + + ui->tabNav->setTabVisible(ui->tabNav->indexOf(ui->tabInvitations), !test_types.isEmpty()); + ui->wdgInvitations->setCurrentTestTypes(test_types); +} + void ProjectWidget::processFormsReply(QString form_type, QString data) { if (form_type == WEB_FORMS_QUERY_PROJECT){ @@ -760,7 +781,6 @@ void ProjectWidget::processParticipantsReply(QList participants, QUrlQ // Only update state for now... for (int i=0; i ttp_list, QUrlQu } } } + refreshSelectedTestTypes(); } void ProjectWidget::processTestTypeSiteReply(QList tts_list, QUrlQuery reply_query) diff --git a/client/src/editors/ProjectWidget.h b/client/src/editors/ProjectWidget.h index ecd8d2fd..5956f58d 100644 --- a/client/src/editors/ProjectWidget.h +++ b/client/src/editors/ProjectWidget.h @@ -77,9 +77,11 @@ private slots: QHash m_tableUsers_items; QMap m_tableUserGroups_items; - QHash m_tableParticipants_items; QHash m_listGroups_items; + QHash m_tableParticipants_items; + QHash m_participants; + QHash m_treeDevices_items; QHash m_treeDevicesProjects_items; @@ -119,6 +121,8 @@ private slots: void queryUserGroupsProjectAccess(); void queryUsers(); + void refreshSelectedTestTypes(); + void addServiceTab(const TeraData& service_project); void updateControlsState() override; diff --git a/client/src/main.cpp b/client/src/main.cpp index 055de173..22e80f3f 100755 --- a/client/src/main.cpp +++ b/client/src/main.cpp @@ -20,8 +20,8 @@ int main(int argc, char* argv[]) ClientApp app(argc, argv); //Set application style -#ifndef WIN32 // Don't set style on Windows - it creates some issues with combobox look. - //app->setStyle("windows"); +#ifdef WIN32 + app.setStyle("windows"); // Force use of "windows" style, not windows 11 one if on that OS, since it has some issues right now #endif //WebEngine default Settings @@ -29,6 +29,6 @@ int main(int argc, char* argv[]) //QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true); //QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true); int rval = app.exec(); - qDebug() << "Bye!"; + //qDebug() << "Bye!"; return rval; } diff --git a/client/src/widgets/SessionInviteWidget.cpp b/client/src/widgets/SessionInviteWidget.cpp index 58c4018f..cf128f18 100644 --- a/client/src/widgets/SessionInviteWidget.cpp +++ b/client/src/widgets/SessionInviteWidget.cpp @@ -393,6 +393,12 @@ bool SessionInviteWidget::isEditable() const return m_editable; } +void SessionInviteWidget::setCountLimited(const bool &count_limited) +{ + m_countLimited = count_limited; + ui->frameCount->setVisible(m_countLimited); +} + QList SessionInviteWidget::getParticipantsInSession() { QList rval; @@ -929,7 +935,7 @@ void SessionInviteWidget::setSearching(const bool &search) void SessionInviteWidget::on_btnInvite_clicked() { // Check if we are under the allowed maximum number of invitees in a session - if (getInviteesCount() + ui->lstInvitables->selectedItems().count() > MAX_INVITEES_IN_SESSION){ + if (getInviteesCount() + ui->lstInvitables->selectedItems().count() > MAX_INVITEES_IN_SESSION && m_countLimited){ GlobalMessageBox msgbox; msgbox.showError(tr("Nombre maximal d'invités atteint"), tr("Impossible d'ajouter ces invités à la séance: le nombre maximal de participants (") + QString::number(MAX_INVITEES_IN_SESSION) + ") " + tr("serait dépassé")); return; @@ -995,7 +1001,7 @@ void SessionInviteWidget::on_treeInvitees_itemDoubleClicked(QTreeWidgetItem *ite { Q_UNUSED(item) Q_UNUSED(column) - if (!item->isDisabled()) + if (!item->isDisabled() && item->parent()) on_btnRemove_clicked(); } diff --git a/client/src/widgets/SessionInviteWidget.h b/client/src/widgets/SessionInviteWidget.h index 9a6dc6eb..77e01254 100644 --- a/client/src/widgets/SessionInviteWidget.h +++ b/client/src/widgets/SessionInviteWidget.h @@ -63,6 +63,7 @@ class SessionInviteWidget : public QWidget void setEditable(const bool &editable); bool isEditable() const; + void setCountLimited(const bool &count_limited); QList getParticipantsInSession(); QList getUsersInSession(); @@ -112,6 +113,7 @@ private slots: bool m_searching; bool m_confirmRemove; bool m_editable; + bool m_countLimited = true; QHash m_users; // id, data QHash m_participants; diff --git a/client/src/widgets/SessionInviteWidget.ui b/client/src/widgets/SessionInviteWidget.ui index e8790d3e..ebc0a944 100644 --- a/client/src/widgets/SessionInviteWidget.ui +++ b/client/src/widgets/SessionInviteWidget.ui @@ -36,7 +36,7 @@ PointingHandCursor - Ajouter des invités à la séance + Ajouter des invités @@ -56,10 +56,10 @@ - QFrame::StyledPanel + QFrame::Shape::StyledPanel - QFrame::Raised + QFrame::Shadow::Raised @@ -117,7 +117,7 @@ false - QToolButton::InstantPopup + QToolButton::ToolButtonPopupMode::InstantPopup @@ -152,7 +152,7 @@ true - QToolButton::InstantPopup + QToolButton::ToolButtonPopupMode::InstantPopup @@ -187,7 +187,7 @@ true - QToolButton::InstantPopup + QToolButton::ToolButtonPopupMode::InstantPopup @@ -225,7 +225,7 @@ false - QToolButton::InstantPopup + QToolButton::ToolButtonPopupMode::InstantPopup @@ -323,7 +323,7 @@ - QAbstractItemView::ExtendedSelection + QAbstractItemView::SelectionMode::ExtendedSelection @@ -368,10 +368,10 @@ - QFrame::StyledPanel + QFrame::Shape::StyledPanel - QFrame::Raised + QFrame::Shadow::Raised @@ -386,20 +386,20 @@ - Invités dans la séance + Invités - QAbstractItemView::NoEditTriggers + QAbstractItemView::EditTrigger::NoEditTriggers false - QAbstractItemView::ExtendedSelection + QAbstractItemView::SelectionMode::ExtendedSelection @@ -454,31 +454,33 @@ - - - 6 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 0 / 7 - - - - + + + + 6 + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + 0 / 7 + + + + + diff --git a/client/src/widgets/TestInvitationsWidget.cpp b/client/src/widgets/TestInvitationsWidget.cpp index 7c6ca5b6..a4e1bee5 100644 --- a/client/src/widgets/TestInvitationsWidget.cpp +++ b/client/src/widgets/TestInvitationsWidget.cpp @@ -30,6 +30,11 @@ void TestInvitationsWidget::setComManager(ComManager *comMan) } +void TestInvitationsWidget::setCurrentTestTypes(const QList &test_types) +{ + m_testTypes = test_types; +} + void TestInvitationsWidget::loadForProject(const int &id_project) { setViewMode(ViewMode::VIEWMODE_PROJECT); @@ -169,6 +174,7 @@ void TestInvitationsWidget::on_btnInvite_clicked() m_invitationDialog->deleteLater(); m_invitationDialog = new TestInvitationDialog(this); + m_invitationDialog->setTestTypes(m_testTypes); connect(m_invitationDialog, &TestInvitationDialog::finished, this, &TestInvitationsWidget::onTestInvitationDialogFinished); m_invitationDialog->show(); diff --git a/client/src/widgets/TestInvitationsWidget.h b/client/src/widgets/TestInvitationsWidget.h index d51e6ace..c80ce034 100644 --- a/client/src/widgets/TestInvitationsWidget.h +++ b/client/src/widgets/TestInvitationsWidget.h @@ -21,6 +21,8 @@ class TestInvitationsWidget : public QWidget ~TestInvitationsWidget(); void setComManager(ComManager* comMan); + void setCurrentTestTypes(const QList& test_types); + void loadForProject(const int& id_project); private slots: @@ -57,6 +59,8 @@ private slots: ComManager* m_comManager = nullptr; ViewMode m_currentView = VIEWMODE_UNKNOWN; + QList m_testTypes; + TestInvitationDialog* m_invitationDialog = nullptr; QHash m_listInvitations_items; // ID Invitation to QTableWidgetItem* mapping