Show confidential meeting details setting added
[qtmeetings] / src / UserInterface / Views / MeetingInfoDialog.cpp
index 95e2cce..760eca9 100644 (file)
@@ -1,7 +1,10 @@
 #include "MeetingInfoDialog.h"
+
 #include "ToolBox.h"
 #include "Meeting.h"
 #include "Room.h"
+#include "Configuration.h"
+
 #include <QLabel>
 #include <QVBoxLayout>
 #include <QPushButton>
@@ -13,6 +16,28 @@ MeetingInfoDialog::MeetingInfoDialog( Meeting *aMeeting, QWidget *aParent ) :
 {
        setWindowTitle( tr( "Details" ) );
 
+       if ( aMeeting != 0 )
+       {
+               createDialogView( aMeeting );
+       }
+
+       setMinimumWidth( MeetingInfoDialog::width );
+       setMinimumHeight( MeetingInfoDialog::height );
+}
+
+MeetingInfoDialog::~MeetingInfoDialog()
+{
+}
+
+void MeetingInfoDialog::setMeeting(Meeting *aMeeting)
+{
+       createDialogView( aMeeting );
+}
+
+void MeetingInfoDialog::createDialogView(Meeting *aMeeting)
+{
+       qDebug() << "[MeetingInfoDialog::createDialogView] <Invoked>";
+       
        QFont normalFont;
        normalFont.setPointSize( 11 );
 
@@ -21,11 +46,30 @@ MeetingInfoDialog::MeetingInfoDialog( Meeting *aMeeting, QWidget *aParent ) :
        boldFont.setBold( true );
 
        QLabel *subjectLabel = ToolBox::createLabel( tr( "Subject:" ), boldFont );
-       QLabel *subjectContent = ToolBox::createLabel( aMeeting->subject(), normalFont );
+       QLabel *subjectContent = new QLabel();
+       subjectContent->setFont( normalFont );
 
        QLabel *descriptionLabel = ToolBox::createLabel( tr( "Description:" ), boldFont );
        QTextEdit *descriptionContent = new QTextEdit( "" );
-       descriptionContent->setHtml( aMeeting->description() );
+
+       if( Configuration::instance()->showConfidentialMeetingDetails() )
+       {
+               subjectContent->setText( aMeeting->subject() );
+               descriptionContent->setHtml( aMeeting->description() );
+       }
+
+       if( subjectContent->text().isEmpty() )
+       {
+               subjectContent->setText( tr( "Room reserved", "Meeting Info Subject" ) ); // default subject text
+       }
+
+       qDebug() << "############ Desc: " << descriptionContent->toPlainText().trimmed();
+
+       if( descriptionContent->toPlainText().trimmed().isEmpty() )
+       {
+               descriptionContent->setPlainText( tr( "Room reserved", "Meeting Info Description" ) ); // default description text
+       }
+
        descriptionContent->setReadOnly( true );
        descriptionContent->setFont( normalFont );
 
@@ -75,11 +119,6 @@ MeetingInfoDialog::MeetingInfoDialog( Meeting *aMeeting, QWidget *aParent ) :
        layout->addStretch();
        layout->addLayout( buttonLayout );
        setLayout( layout );
-
-       setMinimumWidth( MeetingInfoDialog::width );
-       setMinimumHeight( MeetingInfoDialog::height );
-}
-
-MeetingInfoDialog::~MeetingInfoDialog()
-{
+       
+       qDebug() << "[MeetingInfoDialog::createDialogView] <Finished>";
 }