1 #include "MeetingInfoDialog.h"
11 MeetingInfoDialog::MeetingInfoDialog( Meeting *aMeeting, QWidget *aParent ) :
14 setWindowTitle( tr( "Details" ) );
17 normalFont.setPointSize( 11 );
20 boldFont.setPointSize( 11 );
21 boldFont.setBold( true );
23 QLabel *subjectLabel = ToolBox::createLabel( tr( "Subject:" ), boldFont );
24 QLabel *subjectContent = ToolBox::createLabel( aMeeting->subject(), normalFont );
26 QLabel *descriptionLabel = ToolBox::createLabel( tr( "Description:" ), boldFont );
27 QTextEdit *descriptionContent = new QTextEdit( "" );
28 descriptionContent->setHtml( aMeeting->description() );
29 descriptionContent->setReadOnly( true );
30 descriptionContent->setFont( normalFont );
32 QLabel *organizerLabel = NULL;
33 QLabel *organizerContent = NULL;
35 QString roomAddr = aMeeting->room().address();
36 QString organizer = aMeeting->organizer();
37 if( !organizer.contains( roomAddr ) )
39 organizerLabel = ToolBox::createLabel( tr( "Organizer:" ), boldFont );
40 organizerContent = ToolBox::createLabel( aMeeting->organizer(), normalFont );
42 QLabel *startsAtLabel = ToolBox::createLabel( tr( "Starts at:" ), boldFont );
43 QLabel *startsAtContent = ToolBox::createLabel( aMeeting->startsAt().toString( tr( "d MMMM yyyy hh:mm" ) ), normalFont );
45 QLabel *endsAtLabel = ToolBox::createLabel( tr( "Ends at:" ), boldFont );
46 QLabel *endsAtContent = ToolBox::createLabel( aMeeting->endsAt().toString( tr( "d MMMM yyyy hh:mm" ) ), normalFont );
48 QPushButton *button = new QPushButton;
49 button->setText( tr( "OK" ) );
50 connect( button, SIGNAL( clicked() ), this, SLOT( close() ) );
52 QHBoxLayout *buttonLayout = new QHBoxLayout;
53 buttonLayout->addStretch();
54 buttonLayout->addWidget( button );
55 buttonLayout->addStretch();
57 QVBoxLayout *layout = new QVBoxLayout;
58 layout->addWidget( subjectLabel );
59 layout->addWidget( subjectContent );
60 layout->addSpacing( 5 );
61 layout->addWidget( descriptionLabel );
62 layout->addWidget( descriptionContent );
63 layout->addSpacing( 5 );
65 layout->addWidget( organizerLabel );
66 if( organizerContent )
67 layout->addWidget( organizerContent );
68 layout->addSpacing( 5 );
69 layout->addWidget( startsAtLabel );
70 layout->addWidget( startsAtContent );
71 layout->addSpacing( 5 );
72 layout->addWidget( endsAtLabel );
73 layout->addWidget( endsAtContent );
74 layout->addSpacing( 5 );
76 layout->addLayout( buttonLayout );
79 setMinimumWidth( MeetingInfoDialog::width );
80 setMinimumHeight( MeetingInfoDialog::height );
83 MeetingInfoDialog::~MeetingInfoDialog()