1 #include "MeetingInfoDialog.h"
11 MeetingInfoDialog::MeetingInfoDialog( Meeting *aMeeting, QWidget *aParent ) :
14 setWindowTitle( tr( "Details" ) );
18 createDialogView( aMeeting );
21 setMinimumWidth( MeetingInfoDialog::width );
22 setMinimumHeight( MeetingInfoDialog::height );
25 MeetingInfoDialog::~MeetingInfoDialog()
29 void MeetingInfoDialog::setMeeting(Meeting *aMeeting)
31 createDialogView( aMeeting );
34 void MeetingInfoDialog::createDialogView(Meeting *aMeeting)
36 qDebug() << "[MeetingInfoDialog::createDialogView] <Invoked>";
39 normalFont.setPointSize( 11 );
42 boldFont.setPointSize( 11 );
43 boldFont.setBold( true );
45 QLabel *subjectLabel = ToolBox::createLabel( tr( "Subject:" ), boldFont );
46 QLabel *subjectContent = ToolBox::createLabel( aMeeting->subject(), normalFont );
48 QLabel *descriptionLabel = ToolBox::createLabel( tr( "Description:" ), boldFont );
49 QTextEdit *descriptionContent = new QTextEdit( "" );
50 descriptionContent->setHtml( aMeeting->description() );
51 descriptionContent->setReadOnly( true );
52 descriptionContent->setFont( normalFont );
54 QLabel *organizerLabel = NULL;
55 QLabel *organizerContent = NULL;
57 QString roomAddr = aMeeting->room().address();
58 QString organizer = aMeeting->organizer();
59 if( !organizer.contains( roomAddr ) )
61 organizerLabel = ToolBox::createLabel( tr( "Organizer:" ), boldFont );
62 organizerContent = ToolBox::createLabel( aMeeting->organizer(), normalFont );
64 QLabel *startsAtLabel = ToolBox::createLabel( tr( "Starts at:" ), boldFont );
65 QLabel *startsAtContent = ToolBox::createLabel( aMeeting->startsAt().toString( tr( "d MMMM yyyy hh:mm" ) ), normalFont );
67 QLabel *endsAtLabel = ToolBox::createLabel( tr( "Ends at:" ), boldFont );
68 QLabel *endsAtContent = ToolBox::createLabel( aMeeting->endsAt().toString( tr( "d MMMM yyyy hh:mm" ) ), normalFont );
70 QPushButton *button = new QPushButton;
71 button->setText( tr( "OK" ) );
72 connect( button, SIGNAL( clicked() ), this, SLOT( close() ) );
74 QHBoxLayout *buttonLayout = new QHBoxLayout;
75 buttonLayout->addStretch();
76 buttonLayout->addWidget( button );
77 buttonLayout->addStretch();
79 QVBoxLayout *layout = new QVBoxLayout;
80 layout->addWidget( subjectLabel );
81 layout->addWidget( subjectContent );
82 layout->addSpacing( 5 );
83 layout->addWidget( descriptionLabel );
84 layout->addWidget( descriptionContent );
85 layout->addSpacing( 5 );
87 layout->addWidget( organizerLabel );
88 if( organizerContent )
89 layout->addWidget( organizerContent );
90 layout->addSpacing( 5 );
91 layout->addWidget( startsAtLabel );
92 layout->addWidget( startsAtContent );
93 layout->addSpacing( 5 );
94 layout->addWidget( endsAtLabel );
95 layout->addWidget( endsAtContent );
96 layout->addSpacing( 5 );
98 layout->addLayout( buttonLayout );
101 qDebug() << "[MeetingInfoDialog::createDialogView] <Finished>";