Back to index

fet  5.18.0
Public Member Functions | Private Slots | Private Attributes
TimetablePrintForm Class Reference

#include <timetableprintform.h>

List of all members.

Public Member Functions

 TimetablePrintForm (QWidget *parent)
 ~TimetablePrintForm ()

Private Slots

void selectAll ()
void unselectAll ()
void updateNamesList ()
void updateHTMLprintString (bool printAll)
void print ()
void printPreviewFull ()
void updatePreviewFull (QPrinter *printer)
void printPreviewSmall ()
void updatePreviewSmall (QPrinter *printer)

Private Attributes

QTextDocument * textDocument
QComboBox * CBTables
QListWidget * namesList
QPushButton * pbSelectAll
QPushButton * pbUnselectAll
QGroupBox * actionsBox
QRadioButton * RBDaysHorizontal
QRadioButton * RBDaysVertical
QRadioButton * RBTimeHorizontal
QRadioButton * RBTimeVertical
QRadioButton * RBTimeHorizontalDay
QRadioButton * RBTimeVerticalDay
QGroupBox * optionsBox
QComboBox * CBBreak
QComboBox * CBWhiteSpace
QComboBox * CBpaperSize
QComboBox * CBorientationMode
QSpinBox * activitiesPadding
QSpinBox * tablePadding
QSpinBox * fontSizeTable
QSpinBox * maxNames
QSpinBox * leftPageMargin
QSpinBox * topPageMargin
QSpinBox * rightPageMargin
QSpinBox * bottomPageMargin
QCheckBox * printDetailedTables
QCheckBox * printActivityTags
QPushButton * pbPrintPreviewSmall
QPushButton * pbPrintPreviewFull
QPushButton * pbPrint
QPushButton * pbClose

Detailed Description

Definition at line 52 of file timetableprintform.h.


Constructor & Destructor Documentation

Definition at line 141 of file timetableprintform.cpp.

                                                     : QDialog(parent){
       this->setWindowTitle(tr("Print timetable dialog"));
       
       //maybe TODO: add this as preview. but it must be qtextbrowser or qtextedit then?! Problem: it is currently much to slow! Solution: preview only the first page?!
       //            this could be done by updateHTMLprintString(bool updateAll).

       textDocument = new QTextDocument();
       textDocument->setUndoRedoEnabled(false);
       
       QHBoxLayout* wholeDialog=new QHBoxLayout(this);
       
       QVBoxLayout* leftDialog=new QVBoxLayout();

       QStringList timetableNames;
       timetableNames<<tr("Subgroups")
              <<tr("Groups")
              <<tr("Years")
              <<tr("Teachers")
              <<tr("Teachers Free Periods")
              <<tr("Rooms")
              <<tr("Subjects")
              <<tr("All activities");
       CBTables=new QComboBox();
       CBTables->addItems(timetableNames);

       namesList = new QListWidget();
       namesList->setSelectionMode(QAbstractItemView::MultiSelection);

       QHBoxLayout* selectUnselect=new QHBoxLayout();
       pbSelectAll=new QPushButton(tr("All", "Refers to a list of items, select all. Please keep translation short"));
       //pbSelectAll->setAutoDefault(false);
       pbUnselectAll=new QPushButton(tr("None", "Refers to a list of items, select none. Please keep translation short"));
       selectUnselect->addWidget(pbSelectAll);
       selectUnselect->addWidget(pbUnselectAll);

       leftDialog->addWidget(CBTables);
       leftDialog->addWidget(namesList);
       leftDialog->addLayout(selectUnselect);
       
       QVBoxLayout* rightDialog=new QVBoxLayout();
       
       /*QGroupBox**/ actionsBox=new QGroupBox(tr("Print"));
       QGridLayout* actionsBoxGrid=new QGridLayout();
       RBDaysHorizontal= new QRadioButton(tr("Days horizontal"));
       RBDaysVertical= new QRadioButton(tr("Days vertical"));
       RBTimeHorizontal= new QRadioButton(tr("Time horizontal"));
       RBTimeVertical= new QRadioButton(tr("Time vertical"));
       //By Liviu Lalescu - not used anymore
       //CBDivideTimeAxisByDay=new QCheckBox(tr("Divide by days", "Refers to dividing time axis timetables by days"));
       //CBDivideTimeAxisByDay->setChecked(false);
       RBTimeHorizontalDay= new QRadioButton(tr("Time horizontal per day"));
       RBTimeVerticalDay= new QRadioButton(tr("Time vertical per day"));

       actionsBoxGrid->addWidget(RBDaysHorizontal,0,0);
       actionsBoxGrid->addWidget(RBDaysVertical,0,1);
       actionsBoxGrid->addWidget(RBTimeHorizontal,1,0);
       actionsBoxGrid->addWidget(RBTimeVertical,1,1);
       //actionsBoxGrid->addWidget(CBDivideTimeAxisByDay, 2, 0, 1, 2);
       actionsBoxGrid->addWidget(RBTimeHorizontalDay,2,0);
       actionsBoxGrid->addWidget(RBTimeVerticalDay,2,1);
       RBDaysHorizontal->setChecked(true);
       //CBDivideTimeAxisByDay->setDisabled(RBDaysHorizontal->isChecked() || RBDaysVertical->isChecked());
       actionsBox->setLayout(actionsBoxGrid);
       
       /*QGroupBox**/ optionsBox=new QGroupBox(tr("Options"));
       QGridLayout* optionsBoxGrid=new QGridLayout();
       
       QStringList breakStrings;
       //strings by Liviu Lalescu
       breakStrings<<tr("Page-break: none", "No page-break between timetables. Please keep translation short")
              <<tr("Page-break: always", "Page-break after each timetable. Please keep translation short")
              <<tr("Page-break: even", "Page-break after each even timetable. Please keep translation short");
       CBBreak=new QComboBox();
       CBBreak->addItems(breakStrings);
       CBBreak->setCurrentIndex(1);
       CBBreak->setSizePolicy(QSizePolicy::Expanding, CBBreak->sizePolicy().verticalPolicy());
       
       QStringList whiteSpaceStrings;
       whiteSpaceStrings<<QString("normal")<<QString("pre")<<QString("nowrap")<<QString("pre-wrap");     //don't translate these strings, because they are css parameters!
       CBWhiteSpace=new QComboBox();
       CBWhiteSpace->addItems(whiteSpaceStrings);
       CBWhiteSpace->setCurrentIndex(0);
       CBWhiteSpace->setSizePolicy(QSizePolicy::Expanding, CBWhiteSpace->sizePolicy().verticalPolicy());
       
       QStringList printerOrientationStrings;
       printerOrientationStrings<<tr("Portrait")<<tr("Landscape");
       CBorientationMode=new QComboBox();
       CBorientationMode->addItems(printerOrientationStrings);
       CBorientationMode->setCurrentIndex(0);
       //CBorientationMode->setDisabled(true);
       CBorientationMode->setSizePolicy(QSizePolicy::Expanding, CBorientationMode->sizePolicy().verticalPolicy());
       
/*     QStringList printerModeStrings;
       printerModeStrings<<tr("ScreenResolution")<<tr("PrinterResolution")<<tr("HighResolution");
       CBprinterMode=new QComboBox();
       CBprinterMode->addItems(printerModeStrings);
       CBprinterMode->setCurrentIndex(2);
       CBprinterMode->setDisabled(true);
       CBprinterMode->setSizePolicy(QSizePolicy::Expanding, CBprinterMode->sizePolicy().verticalPolicy());
*/     
       paperSizesMap.clear();
#ifdef QT_NO_PRINTER
       paperSizesMap.insert(tr("Custom", "Type of paper size"), 30);
#else
       paperSizesMap.insert(tr("A0", "Type of paper size"), QPrinter::A0);
       paperSizesMap.insert(tr("A1", "Type of paper size"), QPrinter::A1);
       paperSizesMap.insert(tr("A2", "Type of paper size"), QPrinter::A2);
       paperSizesMap.insert(tr("A3", "Type of paper size"), QPrinter::A3);
       paperSizesMap.insert(tr("A4", "Type of paper size"), QPrinter::A4);
       paperSizesMap.insert(tr("A5", "Type of paper size"), QPrinter::A5);
       paperSizesMap.insert(tr("A6", "Type of paper size"), QPrinter::A6);
       paperSizesMap.insert(tr("A7", "Type of paper size"), QPrinter::A7);
       paperSizesMap.insert(tr("A8", "Type of paper size"), QPrinter::A8);
       paperSizesMap.insert(tr("A9", "Type of paper size"), QPrinter::A9);
       paperSizesMap.insert(tr("B0", "Type of paper size"), QPrinter::B0);
       paperSizesMap.insert(tr("B1", "Type of paper size"), QPrinter::B1);
       paperSizesMap.insert(tr("B2", "Type of paper size"), QPrinter::B2);
       paperSizesMap.insert(tr("B3", "Type of paper size"), QPrinter::B3);
       paperSizesMap.insert(tr("B4", "Type of paper size"), QPrinter::B4);
       paperSizesMap.insert(tr("B5", "Type of paper size"), QPrinter::B5);
       paperSizesMap.insert(tr("B6", "Type of paper size"), QPrinter::B6);
       paperSizesMap.insert(tr("B7", "Type of paper size"), QPrinter::B7);
       paperSizesMap.insert(tr("B8", "Type of paper size"), QPrinter::B8);
       paperSizesMap.insert(tr("B9", "Type of paper size"), QPrinter::B9);
       paperSizesMap.insert(tr("B10", "Type of paper size"), QPrinter::B10);
       paperSizesMap.insert(tr("C5E", "Type of paper size"), QPrinter::C5E);
       paperSizesMap.insert(tr("Comm10E", "Type of paper size"), QPrinter::Comm10E);
       paperSizesMap.insert(tr("DLE", "Type of paper size"), QPrinter::DLE);
       paperSizesMap.insert(tr("Executive", "Type of paper size"), QPrinter::Executive);
       paperSizesMap.insert(tr("Folio", "Type of paper size"), QPrinter::Folio);
       paperSizesMap.insert(tr("Ledger", "Type of paper size"), QPrinter::Ledger);
       paperSizesMap.insert(tr("Legal", "Type of paper size"), QPrinter::Legal);
       paperSizesMap.insert(tr("Letter", "Type of paper size"), QPrinter::Letter);
       paperSizesMap.insert(tr("Tabloid", "Type of paper size"), QPrinter::Tabloid);
#endif

       CBpaperSize=new QComboBox();
       CBpaperSize->addItems(paperSizesMap.keys());
       if(CBpaperSize->count()>=5)
              CBpaperSize->setCurrentIndex(4);
       else if(CBpaperSize->count()>=1)
              CBpaperSize->setCurrentIndex(0);
       CBpaperSize->setSizePolicy(QSizePolicy::Expanding, CBpaperSize->sizePolicy().verticalPolicy());
       
//     markNotAvailable=new QCheckBox(tr("Mark not available"));
//     markNotAvailable->setChecked(true);
       
//     markBreak=new QCheckBox(tr("Mark break"));
//     markBreak->setChecked(true);
       
//     printSameStartingTime=new QCheckBox(tr("Print same starting time"));
//     printSameStartingTime->setChecked(false);

       printDetailedTables=new QCheckBox(tr("Detailed tables"));
       printDetailedTables->setChecked(true);
       
       printActivityTags=new QCheckBox(tr("Activity tags"));
       printActivityTags->setChecked(false);
       
       fontSizeTable=new QSpinBox;
       fontSizeTable->setRange(4, 20);
       fontSizeTable->setValue(8);

       /*QString str, left, right;
       str=tr("Font size: %1 pt");
       dividePrefixSuffix(str, left, right);
       fontSizeTable->setPrefix(left);
       fontSizeTable->setSuffix(right);*/
       
       fontSizeTable->setPrefix(tr("Font size:")+QString(" "));
       fontSizeTable->setSuffix(QString(" ")+tr("pt", "Means points for font size, when printing the timetable"));

       fontSizeTable->setSizePolicy(QSizePolicy::Expanding, fontSizeTable->sizePolicy().verticalPolicy());
       
       activitiesPadding=new QSpinBox;
       activitiesPadding->setRange(0, 25);
       activitiesPadding->setValue(0);

       /*str=tr("Activities padding: %1 px");
       dividePrefixSuffix(str, left, right);
       activitiesPadding->setPrefix(left);
       activitiesPadding->setSuffix(right);*/

       activitiesPadding->setPrefix(tr("Activities padding:")+QString(" "));
       activitiesPadding->setSuffix(QString(" ")+tr("px", "Means pixels, when printing the timetable"));

       activitiesPadding->setSizePolicy(QSizePolicy::Expanding, activitiesPadding->sizePolicy().verticalPolicy());
       
       tablePadding=new QSpinBox;
       tablePadding->setRange(1, 99);
       tablePadding->setValue(1);

       /*str=tr("Space after table: +%1 px");
       dividePrefixSuffix(str, left, right);
       tablePadding->setPrefix(left);
       tablePadding->setSuffix(right);*/

       tablePadding->setPrefix(tr("Space after table:")+QString(" +"));
       tablePadding->setSuffix(QString(" ")+tr("px", "Means pixels, when printing the timetable"));

       tablePadding->setSizePolicy(QSizePolicy::Expanding, tablePadding->sizePolicy().verticalPolicy());
       
       maxNames=new QSpinBox;
       maxNames->setRange(1, 999);
       maxNames->setValue(10);
       
       /*str=tr("Split after %1 names");
       dividePrefixSuffix(str, left, right);
       maxNames->setPrefix(left);
       maxNames->setSuffix(right);*/

       maxNames->setPrefix(tr("Split after:", "When printing, the whole phrase is 'Split after ... names'")+QString(" "));
       maxNames->setSuffix(QString(" ")+tr("names", "When printing, the whole phrase is 'Split after ... names'"));
       
       maxNames->setSizePolicy(QSizePolicy::Expanding, maxNames->sizePolicy().verticalPolicy());

       leftPageMargin=new QSpinBox;
       leftPageMargin->setRange(0, 50);
       leftPageMargin->setValue(10);

       /*str=tr("Left margin: %1 mm");
       dividePrefixSuffix(str, left, right);
       leftPageMargin->setPrefix(left);
       leftPageMargin->setSuffix(right);*/

       leftPageMargin->setPrefix(tr("Left margin:")+QString(" "));
       leftPageMargin->setSuffix(QString(" ")+tr("mm", "Means milimeter, when setting page margin"));

       leftPageMargin->setSizePolicy(QSizePolicy::Expanding, leftPageMargin->sizePolicy().verticalPolicy());
       
       topPageMargin=new QSpinBox;
       topPageMargin->setRange(0, 50);
       topPageMargin->setValue(10);

       /*str=tr("Top margin: %1 mm");
       dividePrefixSuffix(str, left, right);
       topPageMargin->setPrefix(left);
       topPageMargin->setSuffix(right);*/

       topPageMargin->setPrefix(tr("Top margin:")+QString(" "));
       topPageMargin->setSuffix(QString(" ")+tr("mm", "Means milimeter, when setting page margin"));

       topPageMargin->setSizePolicy(QSizePolicy::Expanding, topPageMargin->sizePolicy().verticalPolicy());
       
       rightPageMargin=new QSpinBox;
       rightPageMargin->setRange(0, 50);
       rightPageMargin->setValue(10);

       /*str=tr("Right margin: %1 mm");
       dividePrefixSuffix(str, left, right);
       rightPageMargin->setPrefix(left);
       rightPageMargin->setSuffix(right);*/

       rightPageMargin->setPrefix(tr("Right margin:")+QString(" "));
       rightPageMargin->setSuffix(QString(" ")+tr("mm", "Means milimeter, when setting page margin"));

       rightPageMargin->setSizePolicy(QSizePolicy::Expanding, rightPageMargin->sizePolicy().verticalPolicy());
       
       bottomPageMargin=new QSpinBox;
       bottomPageMargin->setRange(0, 50);
       bottomPageMargin->setValue(10);

       /*str=tr("Bottom margin: %1 mm");
       dividePrefixSuffix(str, left, right);
       bottomPageMargin->setPrefix(left);
       bottomPageMargin->setSuffix(right);*/

       bottomPageMargin->setPrefix(tr("Bottom margin:")+QString(" "));
       bottomPageMargin->setSuffix(QString(" ")+tr("mm", "Means milimeter, when setting page margin"));

       bottomPageMargin->setSizePolicy(QSizePolicy::Expanding, bottomPageMargin->sizePolicy().verticalPolicy());
       
       pbPrintPreviewSmall=new QPushButton(tr("Teaser", "Small print preview. Please keep translation short"));
       pbPrintPreviewFull=new QPushButton(tr("Preview", "Full print preview. Please keep translation short"));
       pbPrint=new QPushButton(tr("Print", "Please keep translation short"));

       pbClose=new QPushButton(tr("Close", "Please keep translation short"));
       pbClose->setAutoDefault(false);
       
       optionsBoxGrid->addWidget(leftPageMargin,0,0);
       optionsBoxGrid->addWidget(rightPageMargin,1,0);
       optionsBoxGrid->addWidget(topPageMargin,2,0);
       optionsBoxGrid->addWidget(bottomPageMargin,3,0);
       
       optionsBoxGrid->addWidget(fontSizeTable,0,1);
       optionsBoxGrid->addWidget(maxNames,1,1);
       optionsBoxGrid->addWidget(activitiesPadding,2,1);
       optionsBoxGrid->addWidget(tablePadding,3,1);
       
       optionsBoxGrid->addWidget(CBpaperSize,4,0);
       optionsBoxGrid->addWidget(CBWhiteSpace,4,1);
       optionsBoxGrid->addWidget(CBorientationMode,5,0);
       optionsBoxGrid->addWidget(CBBreak,5,1);
//     optionsBoxGrid->addWidget(CBprinterMode,5,0);
       optionsBoxGrid->addWidget(printActivityTags,6,0);
       optionsBoxGrid->addWidget(printDetailedTables,6,1);

       optionsBox->setLayout(optionsBoxGrid);
       optionsBox->setSizePolicy(QSizePolicy::Expanding, optionsBox->sizePolicy().verticalPolicy());
       
// maybe TODO: be careful. the form is pretty full already!
// be careful: these are global settings, so it will also change html output setting?! so it need parameter in each function!
//     optionsBoxVertical->addWidget(markNotAvailable);
//     optionsBoxVertical->addWidget(markBreak);
//     optionsBoxVertical->addWidget(printSameStartingTime);
// maybe TODO: select font, select color, select them also for line 0-4!

       QHBoxLayout* previewPrintClose=new QHBoxLayout();
       previewPrintClose->addStretch();
       previewPrintClose->addWidget(pbPrintPreviewSmall);
       previewPrintClose->addWidget(pbPrintPreviewFull);
       previewPrintClose->addWidget(pbPrint);
       previewPrintClose->addStretch();
       previewPrintClose->addWidget(pbClose);

       rightDialog->addWidget(actionsBox);
       rightDialog->addWidget(optionsBox);
       rightDialog->addStretch();
       rightDialog->addLayout(previewPrintClose);

       //wholeDialog->addWidget(textDocument);
       wholeDialog->addLayout(leftDialog);
       wholeDialog->addLayout(rightDialog);
       
       updateNamesList();
       
       connect(CBTables, SIGNAL(currentIndexChanged(int)), this, SLOT(updateNamesList()));
       connect(pbSelectAll, SIGNAL(clicked()), this, SLOT(selectAll()));
       connect(pbUnselectAll, SIGNAL(clicked()), this, SLOT(unselectAll()));
       connect(pbPrint, SIGNAL(clicked()), this, SLOT(print()));
       connect(pbPrintPreviewSmall, SIGNAL(clicked()), this, SLOT(printPreviewSmall()));
       connect(pbPrintPreviewFull, SIGNAL(clicked()), this, SLOT(printPreviewFull()));
       connect(pbClose, SIGNAL(clicked()), this, SLOT(close()));
       
       //connect(RBDaysHorizontal, SIGNAL(toggled(bool)), this, SLOT(updateCBDivideTimeAxisByDay()));
       //connect(RBDaysVertical, SIGNAL(toggled(bool)), this, SLOT(updateCBDivideTimeAxisByDay()));
       //connect(RBTimeHorizontal, SIGNAL(toggled(bool)), this, SLOT(updateCBDivideTimeAxisByDay()));
       //connect(RBTimeVertical, SIGNAL(toggled(bool)), this, SLOT(updateCBDivideTimeAxisByDay()));

       int ww=this->sizeHint().width();
       if(ww>900)
              ww=900;
       if(ww<700)
              ww=700;

       int hh=this->sizeHint().height();
       if(hh>650)
              hh=650;
       if(hh<500)
              hh=500;
       
       this->resize(ww, hh);
       centerWidgetOnScreen(this);
       restoreFETDialogGeometry(this);
       
       QSettings settings(COMPANY, PROGRAM);
       
       if(settings.contains(this->metaObject()->className()+CBTablesState))
              CBTables->setCurrentIndex(settings.value(this->metaObject()->className()+CBTablesState).toInt());
       
       if(settings.contains(this->metaObject()->className()+RBDaysHorizontalState))
              RBDaysHorizontal->setChecked(settings.value(this->metaObject()->className()+RBDaysHorizontalState).toBool());
       if(settings.contains(this->metaObject()->className()+RBDaysVerticalState))
              RBDaysVertical->setChecked(settings.value(this->metaObject()->className()+RBDaysVerticalState).toBool());
       if(settings.contains(this->metaObject()->className()+RBTimeHorizontalState))
              RBTimeHorizontal->setChecked(settings.value(this->metaObject()->className()+RBTimeHorizontalState).toBool());
       if(settings.contains(this->metaObject()->className()+RBTimeVerticalState))
              RBTimeVertical->setChecked(settings.value(this->metaObject()->className()+RBTimeVerticalState).toBool());
       //if(settings.contains(this->metaObject()->className()+CBDivideTimeAxisByDayState))
       //     CBDivideTimeAxisByDay->setChecked(settings.value(this->metaObject()->className()+CBDivideTimeAxisByDayState).toBool());
       if(settings.contains(this->metaObject()->className()+RBTimeHorizontalDayState))
              RBTimeHorizontalDay->setChecked(settings.value(this->metaObject()->className()+RBTimeHorizontalDayState).toBool());
       if(settings.contains(this->metaObject()->className()+RBTimeVerticalDayState))
              RBTimeVerticalDay->setChecked(settings.value(this->metaObject()->className()+RBTimeVerticalDayState).toBool());
       //
       if(settings.contains(this->metaObject()->className()+CBBreakState))
              CBBreak->setCurrentIndex(settings.value(this->metaObject()->className()+CBBreakState).toInt());
       if(settings.contains(this->metaObject()->className()+CBWhiteSpaceState))
              CBWhiteSpace->setCurrentIndex(settings.value(this->metaObject()->className()+CBWhiteSpaceState).toInt());
       //if(settings.contains(this->metaObject()->className()+CBprinterModeState))
       //     CBprinterMode->setCurrentIndex(settings.value(this->metaObject()->className()+CBprinterModeState).toInt());
       if(settings.contains(this->metaObject()->className()+CBpaperSizeState))
              CBpaperSize->setCurrentIndex(settings.value(this->metaObject()->className()+CBpaperSizeState).toInt());
       if(settings.contains(this->metaObject()->className()+CBorientationModeState))
              CBorientationMode->setCurrentIndex(settings.value(this->metaObject()->className()+CBorientationModeState).toInt());
       //
              //if(settings.contains(this->metaObject()->className()+markNotAvailableState))
       //     markNotAvailable->setChecked(settings.value(this->metaObject()->className()+markNotAvailableState).toBool());
                     //if(settings.contains(this->metaObject()->className()+markBreakState))
       //     markBreak->setChecked(settings.value(this->metaObject()->className()+markBreakState).toBool());
                     //if(settings.contains(this->metaObject()->className()+printSameStartingTimeState))
       //     printSameStartingTime->setChecked(settings.value(this->metaObject()->className()+printSameStartingTimeState).toBool());
       if(settings.contains(this->metaObject()->className()+printDetailedTablesState))
              printDetailedTables->setChecked(settings.value(this->metaObject()->className()+printDetailedTablesState).toBool());
       if(settings.contains(this->metaObject()->className()+printActivityTagsState))
              printActivityTags->setChecked(settings.value(this->metaObject()->className()+printActivityTagsState).toBool());
       //
       if(settings.contains(this->metaObject()->className()+activitiesPaddingState))
              activitiesPadding->setValue(settings.value(this->metaObject()->className()+activitiesPaddingState).toInt());
       if(settings.contains(this->metaObject()->className()+tablePaddingState))
              tablePadding->setValue(settings.value(this->metaObject()->className()+tablePaddingState).toInt());
       if(settings.contains(this->metaObject()->className()+fontSizeTableState))
              fontSizeTable->setValue(settings.value(this->metaObject()->className()+fontSizeTableState).toInt());
       if(settings.contains(this->metaObject()->className()+maxNamesState))
              maxNames->setValue(settings.value(this->metaObject()->className()+maxNamesState).toInt());
       if(settings.contains(this->metaObject()->className()+leftPageMarginState))
              leftPageMargin->setValue(settings.value(this->metaObject()->className()+leftPageMarginState).toInt());
       if(settings.contains(this->metaObject()->className()+topPageMarginState))
              topPageMargin->setValue(settings.value(this->metaObject()->className()+topPageMarginState).toInt());
       if(settings.contains(this->metaObject()->className()+CBorientationModeState))
              rightPageMargin->setValue(settings.value(this->metaObject()->className()+rightPageMarginState).toInt());
       if(settings.contains(this->metaObject()->className()+bottomPageMarginState))
              bottomPageMargin->setValue(settings.value(this->metaObject()->className()+bottomPageMarginState).toInt());
}

Here is the call graph for this function:

Definition at line 556 of file timetableprintform.cpp.

                                       {
       saveFETDialogGeometry(this);
       
       QSettings settings(COMPANY, PROGRAM);
       //save other settings
       settings.setValue(this->metaObject()->className()+CBTablesState, CBTables->currentIndex());
       
       settings.setValue(this->metaObject()->className()+RBDaysHorizontalState, RBDaysHorizontal->isChecked());
       settings.setValue(this->metaObject()->className()+RBDaysVerticalState, RBDaysVertical->isChecked());
       settings.setValue(this->metaObject()->className()+RBTimeHorizontalState, RBTimeHorizontal->isChecked());
       settings.setValue(this->metaObject()->className()+RBTimeVerticalState, RBTimeVertical->isChecked());
       //settings.setValue(this->metaObject()->className()+CBDivideTimeAxisByDayState, CBDivideTimeAxisByDay->isChecked());
       settings.setValue(this->metaObject()->className()+RBTimeHorizontalDayState, RBTimeHorizontalDay->isChecked());
       settings.setValue(this->metaObject()->className()+RBTimeVerticalDayState, RBTimeVerticalDay->isChecked());
       //
       settings.setValue(this->metaObject()->className()+CBBreakState, CBBreak->currentIndex());
       settings.setValue(this->metaObject()->className()+CBWhiteSpaceState, CBWhiteSpace->currentIndex());
       //settings.setValue(this->metaObject()->className()+CBprinterModeState, CBprinterMode->currentIndex());
       settings.setValue(this->metaObject()->className()+CBpaperSizeState, CBpaperSize->currentIndex());
       settings.setValue(this->metaObject()->className()+CBorientationModeState, CBorientationMode->currentIndex());
       //
       //settings.setValue(this->metaObject()->className()+markNotAvailableState, markNotAvailable->isChecked());
       //settings.setValue(this->metaObject()->className()+markBreakState, markBreak->isChecked());
       //settings.setValue(this->metaObject()->className()+printSameStartingTimeState, printSameStartingTime->isChecked());
       settings.setValue(this->metaObject()->className()+printDetailedTablesState, printDetailedTables->isChecked());
       settings.setValue(this->metaObject()->className()+printActivityTagsState, printActivityTags->isChecked());
       //
       settings.setValue(this->metaObject()->className()+activitiesPaddingState, activitiesPadding->value());
       settings.setValue(this->metaObject()->className()+tablePaddingState, tablePadding->value());
       settings.setValue(this->metaObject()->className()+fontSizeTableState, fontSizeTable->value());
       settings.setValue(this->metaObject()->className()+maxNamesState, maxNames->value());
       settings.setValue(this->metaObject()->className()+leftPageMarginState, leftPageMargin->value());
       settings.setValue(this->metaObject()->className()+topPageMarginState, topPageMargin->value());
       settings.setValue(this->metaObject()->className()+rightPageMarginState, rightPageMargin->value());
       settings.setValue(this->metaObject()->className()+bottomPageMarginState, bottomPageMargin->value());
       
       delete textDocument;
}

Here is the call graph for this function:


Member Function Documentation

void TimetablePrintForm::print ( ) [private, slot]

Definition at line 1038 of file timetableprintform.cpp.

                              {
#ifdef QT_NO_PRINTER
       QMessageBox::warning(this, tr("FET warning"), tr("FET is compiled without printer support "
        "- it is impossible to print from this dialog. Please open the HTML timetables from the results directory"));
#else
       QPrinter printer(QPrinter::HighResolution);      //TODO: why doesn't work this CBprinterMode->currentIndex()?

       assert(paperSizesMap.contains(CBpaperSize->currentText()));
       printer.setPaperSize(paperSizesMap.value(CBpaperSize->currentText()));

       switch(CBorientationMode->currentIndex()){
              case 0: printer.setOrientation(QPrinter::Portrait); break;
              case 1: printer.setOrientation(QPrinter::Landscape); break;
              default: assert(0==1);
       }
       printer.setPageMargins(leftPageMargin->value(), topPageMargin->value(), rightPageMargin->value(), bottomPageMargin->value(), QPrinter::Millimeter);
       //QPrintDialog *printDialog = new QPrintDialog(&printer, this);
       QPrintDialog printDialog(&printer, this);
       printDialog.setWindowTitle(tr("Print timetable"));
       if (printDialog.exec() == QDialog::Accepted) {
              updateHTMLprintString(true);
              textDocument->print(&printer);
              textDocument->clear();
       }
       //delete printDialog;
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void TimetablePrintForm::printPreviewFull ( ) [private, slot]

Definition at line 1066 of file timetableprintform.cpp.

                                         {
#ifdef QT_NO_PRINTER
       QMessageBox::warning(this, tr("FET warning"), tr("FET is compiled without printer support "
        "- it is impossible to print from this dialog. Please open the HTML timetables from the results directory"));
#else
       updateHTMLprintString(true);

       QPrinter printer(QPrinter::HighResolution);      //TODO: why doesn't work this CBprinterMode->currentIndex()?

       assert(paperSizesMap.contains(CBpaperSize->currentText()));
       printer.setPaperSize(paperSizesMap.value(CBpaperSize->currentText()));

       switch(CBorientationMode->currentIndex()){
              case 0: printer.setOrientation(QPrinter::Portrait); break;
              case 1: printer.setOrientation(QPrinter::Landscape); break;
              default: assert(0==1);
       }
       printer.setPageMargins(leftPageMargin->value(), topPageMargin->value(), rightPageMargin->value(), bottomPageMargin->value(), QPrinter::Millimeter);
       QPrintPreviewDialog printPreviewFull(&printer, this);
       connect(&printPreviewFull, SIGNAL(paintRequested(QPrinter*)), SLOT(updatePreviewFull(QPrinter*)));
       printPreviewFull.exec();
       textDocument->clear();
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void TimetablePrintForm::printPreviewSmall ( ) [private, slot]

Definition at line 1102 of file timetableprintform.cpp.

                                          {
#ifdef QT_NO_PRINTER
       QMessageBox::warning(this, tr("FET warning"), tr("FET is compiled without printer support "
        "- it is impossible to print from this dialog. Please open the HTML timetables from the results directory"));
#else
       updateHTMLprintString(false);

       QPrinter printer(QPrinter::HighResolution);      //TODO: why doesn't work this: CBprinterMode->currentIndex()?

       assert(paperSizesMap.contains(CBpaperSize->currentText()));
       printer.setPaperSize(paperSizesMap.value(CBpaperSize->currentText()));

       switch(CBorientationMode->currentIndex()){
              case 0: printer.setOrientation(QPrinter::Portrait); break;
              case 1: printer.setOrientation(QPrinter::Landscape); break;
              default: assert(0==1);
       }
       printer.setPageMargins(leftPageMargin->value(), topPageMargin->value(), rightPageMargin->value(), bottomPageMargin->value(), QPrinter::Millimeter);
       QPrintPreviewDialog printPreviewSmall(&printer, this);
       connect(&printPreviewSmall, SIGNAL(paintRequested(QPrinter*)), SLOT(updatePreviewSmall(QPrinter*)));
       printPreviewSmall.exec();
       textDocument->clear();
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void TimetablePrintForm::selectAll ( ) [private, slot]

Definition at line 595 of file timetableprintform.cpp.

                                  {
       namesList->selectAll();
}

Here is the caller graph for this function:

void TimetablePrintForm::unselectAll ( ) [private, slot]

Definition at line 599 of file timetableprintform.cpp.

                                    {
       namesList->clearSelection();
}

Here is the caller graph for this function:

void TimetablePrintForm::updateHTMLprintString ( bool  printAll) [private, slot]

Definition at line 739 of file timetableprintform.cpp.

                                                           {
       QString saveTime=generationLocalizedTime;

       QString tmp;
       tmp+="<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n";
       tmp+="  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\n";
       
       if(LANGUAGE_STYLE_RIGHT_TO_LEFT==false)
              tmp+="<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\""+LANGUAGE_FOR_HTML+"\" xml:lang=\""+LANGUAGE_FOR_HTML+"\">\n";
       else
              tmp+="<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\""+LANGUAGE_FOR_HTML+"\" xml:lang=\""+LANGUAGE_FOR_HTML+"\" dir=\"rtl\">\n";

       //QTBUG-9438
       //QTBUG-2730
       tmp+="  <head>\n";
       tmp+="    <title>"+protect2(gt.rules.institutionName)+"</title>\n";
       tmp+="    <meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n";
       tmp+="    <style type=\"text/css\">\n";
       
       //this variant doesn't need the "back" stuff, but there will be an empty last page!
       //but you need to care about correct odd and even like in the groups tables
/*     tmp+="      table.even_table {\n";
       if(CBBreak->currentIndex()==1 || CBBreak->currentIndex()==2){
              tmp+="        page-break-after: always;";
       } //else {
       //tmp+="        padding-top: "+QString::number(tablePadding->value())+"px;\n";      //not possible: qt bug. (*1*)
       //tmp+="        padding-bottom: "+QString::number(tablePadding->value())+"px;\n";   //not possible: qt bug. (*1*)
       //}
       tmp+="      }\n";
       tmp+="      table.odd_table {\n";
       if(CBBreak->currentIndex()==1){
              tmp+="        page-break-after: always;";
       } //else {
       //tmp+="        padding-top: "+QString::number(tablePadding->value())+"px;\n";      //not possible: qt bug. (*1*)
       //tmp+="        padding-bottom: "+QString::number(tablePadding->value())+"px;\n";   //not possible: qt bug. (*1*)
       //}
       tmp+="      }\n";
*/
       
       //start. the "back" stuff is needed because of an qt bug (*1*). it also solve the last empty page problem.
       tmp+="      p.back0 {\n";   //i can't to that with a class in table, because of a qt bug
       if(CBBreak->currentIndex()==0)
              tmp+="        font-size: "+QString::number(tablePadding->value())+"pt;\n";   //i can't do that in table, because it will also effect detailed table cells. it is not possible with a class, because of a qt bug.
       else
              tmp+="        font-size: 1pt;\n";  //font size 0 is not possible.
//     tmp+="        padding-top: "+QString::number(tablePadding->value())+"px;\n"; //not possible: qt bug.
//     tmp+="        padding-bottom: "+QString::number(tablePadding->value())+"px;\n";     //not possible: qt bug.
       if(CBBreak->currentIndex()==1 || CBBreak->currentIndex()==2)
              tmp+="        page-break-after: always;";
       tmp+="      }\n";
       tmp+="      p.back1 {\n";   //i can't to that with a class in table, because of a qt bug
       if(CBBreak->currentIndex()==0 || CBBreak->currentIndex()==2)
              tmp+="        font-size: "+QString::number(tablePadding->value())+"pt;\n";   //i can't do that in table, because it will also effect detailed table cells. it is not possible with a class, because of a qt bug.
       else
              tmp+="        font-size: 1pt;\n";  //font size 0 is not possible.
//     tmp+="        padding-top: "+QString::number(tablePadding->value())+"px;\n"; //not possible: qt bug.
//     tmp+="        padding-bottom: "+QString::number(tablePadding->value())+"px;\n";     //not possible: qt bug.
       if(CBBreak->currentIndex()==1)
              tmp+="        page-break-after: always;";
       tmp+="      }\n";
       //end. the "back" stuff is only needed because of an qt bug (*1*). delete this as soon as bug is solved
       
       tmp+="      table {\n";
       tmp+="        font-size: "+QString::number(fontSizeTable->value())+"pt;\n";
       tmp+="        padding-top: "+QString::number(tablePadding->value())+"px;\n";
       tmp+="      }\n";
       tmp+="      th {\n";
       tmp+="        text-align: center;\n"; //currently no effect because of an qt bug (compare http://bugreports.qt.nokia.com/browse/QTBUG-2730 )
       tmp+="        vertical-align: middle;\n";
       tmp+="        white-space: "+CBWhiteSpace->currentText()+";\n";
       tmp+="      }\n";
       tmp+="      td {\n";
       tmp+="        text-align: center;\n"; //currently no effect because of an qt bug (compare http://bugreports.qt.nokia.com/browse/QTBUG-2730 )
       tmp+="        vertical-align: middle;\n";
       tmp+="        white-space: "+CBWhiteSpace->currentText()+";\n";
       tmp+="        padding-left: "+QString::number(activitiesPadding->value())+"px;\n";
       tmp+="        padding-right: "+QString::number(activitiesPadding->value())+"px;\n";
       tmp+="      }\n";
       tmp+="      td.detailed {\n";
//     tmp+="        padding-left: 4px;\n";
//     tmp+="        padding-right: 4px;\n";
       tmp+="      }\n";
       tmp+="      th.xAxis {\n";  //need level 2
//     tmp+="        padding-left: 4px;\n";
//     tmp+="        padding-right: 4px;\n";
       tmp+="      }\n";
       tmp+="      th.yAxis {\n";  //need level 2
//     tmp+="        padding-top: 4px;\n";
//     tmp+="        padding-bottom: 4px;\n";
       tmp+="      }\n";
       tmp+="      tr.line0, div.line0 {\n";     //need level 3
       tmp+="        /*font-size: 12pt;*/\n";
       tmp+="        color: gray;\n";
       tmp+="      }\n";
       tmp+="      tr.line1, div.line1 {\n";     //need level 3
       tmp+="        /*font-size: 12pt;*/\n";
       tmp+="      }\n";
       tmp+="      tr.line2, div.line2 {\n";     //need level 3
       tmp+="        /*font-size: 12pt;*/\n";
       tmp+="        color: gray;\n";
       tmp+="      }\n";
       tmp+="      tr.line3, div.line3 {\n";     //need level 3
       tmp+="        /*font-size: 12pt;*/\n";
       tmp+="        color: silver;\n";
       tmp+="      }\n";
       tmp+="    </style>\n";
       tmp+="  </head>\n\n";
       tmp+="  <body id=\"top\">\n";

       if(numberOfPlacedActivities1!=gt.rules.nInternalActivities)
              tmp+="    <h1>"+tr("Warning! Only %1 out of %2 activities placed!").arg(numberOfPlacedActivities1).arg(gt.rules.nInternalActivities)+"</h1>\n";

       QList<int> includedNamesIndex;
       QSet<int> excludedNamesIndex;
       for(int nameIndex=0; nameIndex<namesList->count(); nameIndex++){
              QListWidgetItem* tmpItem=namesList->item(nameIndex);
              if(tmpItem->isSelected()){
                     includedNamesIndex<<nameIndex;
              } else {
                     excludedNamesIndex<<nameIndex;
              }
       }
       
       //maybe TODO: do the pagebreak similar in timetableexport. (so remove the odd and even table tag and use only back1 and back2 (maybe rename to odd and even))
       //            check the GroupsTimetableDaysHorizontalHtml and Year parameter then (iNi%2) isn't needed anymore then.
       
       if(RBDaysHorizontal->isChecked()){
              for(int iNi=0; iNi<includedNamesIndex.size(); iNi++){
                     switch(CBTables->currentIndex()){
                            case 0: tmp+=TimetableExport::singleSubgroupsTimetableDaysHorizontalHtml(3, includedNamesIndex.at(iNi), saveTime, printActivityTags->isChecked()); break;
                            case 1: tmp+=TimetableExport::singleGroupsTimetableDaysHorizontalHtml(3, includedNamesIndex.at(iNi), saveTime, printActivityTags->isChecked(), printDetailedTables->isChecked()); break;
                            case 2: tmp+=TimetableExport::singleYearsTimetableDaysHorizontalHtml(3, includedNamesIndex.at(iNi), saveTime, printActivityTags->isChecked(), printDetailedTables->isChecked()); break;
                            case 3: tmp+=TimetableExport::singleTeachersTimetableDaysHorizontalHtml(3, includedNamesIndex.at(iNi), saveTime, printActivityTags->isChecked()); break;
                            case 4: tmp+=TimetableExport::singleTeachersFreePeriodsTimetableDaysHorizontalHtml(3, saveTime, printDetailedTables->isChecked()); break;
                            case 5: tmp+=TimetableExport::singleRoomsTimetableDaysHorizontalHtml(3, includedNamesIndex.at(iNi), saveTime, printActivityTags->isChecked()); break;
                            case 6: tmp+=TimetableExport::singleSubjectsTimetableDaysHorizontalHtml(3, includedNamesIndex.at(iNi), saveTime, printActivityTags->isChecked()); break;
                            case 7: tmp+=TimetableExport::singleAllActivitiesTimetableDaysHorizontalHtml(3, saveTime, printActivityTags->isChecked()); break;
                            default: assert(0==1);
                     }
                     if(iNi<includedNamesIndex.size()-1){
                            if(iNi%2==0){
                                   tmp+="    <p class=\"back1\"><br /></p>\n\n";
                            } else {
                                   if(!printAll) break;
                                   tmp+="    <p class=\"back0\"><br /></p>\n\n";
                            }
                     }
              }
       }
       if(RBDaysVertical->isChecked()){
              for(int iNi=0; iNi<includedNamesIndex.size(); iNi++){
                     switch(CBTables->currentIndex()){
                            case 0: tmp+=TimetableExport::singleSubgroupsTimetableDaysVerticalHtml(3, includedNamesIndex.at(iNi), saveTime, printActivityTags->isChecked()); break;
                            case 1: tmp+=TimetableExport::singleGroupsTimetableDaysVerticalHtml(3, includedNamesIndex.at(iNi), saveTime, printActivityTags->isChecked(), printDetailedTables->isChecked()); break;
                            case 2: tmp+=TimetableExport::singleYearsTimetableDaysVerticalHtml(3, includedNamesIndex.at(iNi), saveTime, printActivityTags->isChecked(), printDetailedTables->isChecked()); break;
                            case 3: tmp+=TimetableExport::singleTeachersTimetableDaysVerticalHtml(3, includedNamesIndex.at(iNi), saveTime, printActivityTags->isChecked()); break;
                            case 4: tmp+=TimetableExport::singleTeachersFreePeriodsTimetableDaysVerticalHtml(3, saveTime, printDetailedTables->isChecked()); break;
                            case 5: tmp+=TimetableExport::singleRoomsTimetableDaysVerticalHtml(3, includedNamesIndex.at(iNi), saveTime, printActivityTags->isChecked()); break;
                            case 6: tmp+=TimetableExport::singleSubjectsTimetableDaysVerticalHtml(3, includedNamesIndex.at(iNi), saveTime, printActivityTags->isChecked()); break;
                            case 7: tmp+=TimetableExport::singleAllActivitiesTimetableDaysVerticalHtml(3, saveTime, printActivityTags->isChecked()); break;
                            default: assert(0==1);
                     }
                     if(iNi<includedNamesIndex.size()-1){
                            if(iNi%2==0){
                                   tmp+="    <p class=\"back1\"><br /></p>\n\n";
                            } else {
                                   if(!printAll) break;
                                   tmp+="    <p class=\"back0\"><br /></p>\n\n";
                            }
                     }
              }
       }
       if(RBTimeHorizontal->isChecked() /*&& !CBDivideTimeAxisByDay->isChecked()*/){
              int count=0;
              while(excludedNamesIndex.size()<namesList->count()){
                     switch(CBTables->currentIndex()){
                            case 0: tmp+=TimetableExport::singleSubgroupsTimetableTimeHorizontalHtml(3, maxNames->value(), excludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                            case 1: tmp+=TimetableExport::singleGroupsTimetableTimeHorizontalHtml(3, maxNames->value(), excludedNamesIndex, saveTime, printActivityTags->isChecked(), printDetailedTables->isChecked()); break;
                            case 2: tmp+=TimetableExport::singleYearsTimetableTimeHorizontalHtml(3, maxNames->value(), excludedNamesIndex, saveTime, printActivityTags->isChecked(), printDetailedTables->isChecked()); break;
                            case 3: tmp+=TimetableExport::singleTeachersTimetableTimeHorizontalHtml(3, maxNames->value(), excludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                            case 4: /*tmp+=TimetableExport::singleTeachersFreePeriodsTimetableTimeHorizontalHtml(3, saveTime, printDetailedTables->isChecked());*/ break;
                            case 5: tmp+=TimetableExport::singleRoomsTimetableTimeHorizontalHtml(3, maxNames->value(), excludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                            case 6: tmp+=TimetableExport::singleSubjectsTimetableTimeHorizontalHtml(3, maxNames->value(), excludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                            case 7: tmp+=TimetableExport::singleAllActivitiesTimetableTimeHorizontalHtml(3, saveTime, printActivityTags->isChecked());
                                          excludedNamesIndex<<-1; break;
                            default: assert(0==1);
                     }
                     if(excludedNamesIndex.size()<namesList->count()){
                            if(count%2==0){
                                   tmp+="    <p class=\"back1\"><br /></p>\n\n";
                            } else {
                                   if(!printAll) break;
                                   tmp+="    <p class=\"back0\"><br /></p>\n\n";
                            }
                            count++;
                     }
              }
       }
       if(RBTimeVertical->isChecked() /*&& !CBDivideTimeAxisByDay->isChecked()*/){
              int count=0;
              while(excludedNamesIndex.size()<namesList->count()){
                     switch(CBTables->currentIndex()){
                            case 0: tmp+=TimetableExport::singleSubgroupsTimetableTimeVerticalHtml(3, maxNames->value(), excludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                            case 1: tmp+=TimetableExport::singleGroupsTimetableTimeVerticalHtml(3, maxNames->value(), excludedNamesIndex, saveTime, printActivityTags->isChecked(), printDetailedTables->isChecked()); break;
                            case 2: tmp+=TimetableExport::singleYearsTimetableTimeVerticalHtml(3, maxNames->value(), excludedNamesIndex, saveTime, printActivityTags->isChecked(), printDetailedTables->isChecked()); break;
                            case 3: tmp+=TimetableExport::singleTeachersTimetableTimeVerticalHtml(3, maxNames->value(), excludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                            case 4: /*tmp+=TimetableExport::singleTeachersFreePeriodsTimetableTimeVerticalHtml(3, saveTime, printDetailedTables->isChecked());*/ break;
                            case 5: tmp+=TimetableExport::singleRoomsTimetableTimeVerticalHtml(3, maxNames->value(), excludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                            case 6: tmp+=TimetableExport::singleSubjectsTimetableTimeVerticalHtml(3, maxNames->value(), excludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                            case 7: tmp+=TimetableExport::singleAllActivitiesTimetableTimeVerticalHtml(3, saveTime, printActivityTags->isChecked());
                                          excludedNamesIndex<<-1; break;
                            default: assert(0==1);
                     }
                     if(excludedNamesIndex.size()<namesList->count()){
                            if(count%2==0){
                                   tmp+="    <p class=\"back1\"><br /></p>\n\n";
                            } else {
                                   if(!printAll) break;
                                   tmp+="    <p class=\"back0\"><br /></p>\n\n";
                            }
                            count++;
                     }
              }
       }
       if(RBTimeHorizontalDay->isChecked() /*&& CBDivideTimeAxisByDay->isChecked()*/){
              int count=0;
              for(int day=0; day<gt.rules.nDaysPerWeek; day++){
                     QSet<int> tmpExcludedNamesIndex;
                     tmpExcludedNamesIndex=excludedNamesIndex;
                     while(tmpExcludedNamesIndex.size()<namesList->count()){
                            switch(CBTables->currentIndex()){
                                   case 0: tmp+=TimetableExport::singleSubgroupsTimetableTimeHorizontalDailyHtml(3, day, maxNames->value(), tmpExcludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                                   case 1: tmp+=TimetableExport::singleGroupsTimetableTimeHorizontalDailyHtml(3, day, maxNames->value(), tmpExcludedNamesIndex, saveTime, printActivityTags->isChecked(), printDetailedTables->isChecked()); break;
                                   case 2: tmp+=TimetableExport::singleYearsTimetableTimeHorizontalDailyHtml(3, day, maxNames->value(), tmpExcludedNamesIndex, saveTime, printActivityTags->isChecked(), printDetailedTables->isChecked()); break;
                                   case 3: tmp+=TimetableExport::singleTeachersTimetableTimeHorizontalDailyHtml(3, day, maxNames->value(), tmpExcludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                                   case 4: /*tmp+=TimetableExport::singleTeachersFreePeriodsTimetableTimeHorizontalDailyHtml(3, day, saveTime, printDetailedTables->isChecked());*/ break;
                                   case 5: tmp+=TimetableExport::singleRoomsTimetableTimeHorizontalDailyHtml(3, day, maxNames->value(), tmpExcludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                                   case 6: tmp+=TimetableExport::singleSubjectsTimetableTimeHorizontalDailyHtml(3, day, maxNames->value(), tmpExcludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                                   case 7: tmp+=TimetableExport::singleAllActivitiesTimetableTimeHorizontalDailyHtml(3, day, saveTime, printActivityTags->isChecked());
                                                 tmpExcludedNamesIndex<<-1; break;
                                   default: assert(0==1);
                            }
                            if(!(tmpExcludedNamesIndex.size()==namesList->count() && day==gt.rules.nDaysPerWeek-1)){
                                   if(count%2==0){
                                          tmp+="    <p class=\"back1\"><br /></p>\n\n";
                                   } else {
                                          if(!printAll) break;
                                          tmp+="    <p class=\"back0\"><br /></p>\n\n";
                                   }
                                   count++;
                            }
                     }
                     if(!printAll) break;
              }
       }
       if(RBTimeVerticalDay->isChecked() /*&& CBDivideTimeAxisByDay->isChecked()*/){
              int count=0;
              for(int day=0; day<gt.rules.nDaysPerWeek; day++){
                     QSet<int> tmpExcludedNamesIndex;
                     tmpExcludedNamesIndex=excludedNamesIndex;
                     while(tmpExcludedNamesIndex.size()<namesList->count()){
                            switch(CBTables->currentIndex()){
                                   case 0: tmp+=TimetableExport::singleSubgroupsTimetableTimeVerticalDailyHtml(3, day, maxNames->value(), tmpExcludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                                   case 1: tmp+=TimetableExport::singleGroupsTimetableTimeVerticalDailyHtml(3, day, maxNames->value(), tmpExcludedNamesIndex, saveTime, printActivityTags->isChecked(), printDetailedTables->isChecked()); break;
                                   case 2: tmp+=TimetableExport::singleYearsTimetableTimeVerticalDailyHtml(3, day, maxNames->value(), tmpExcludedNamesIndex, saveTime, printActivityTags->isChecked(), printDetailedTables->isChecked()); break;
                                   case 3: tmp+=TimetableExport::singleTeachersTimetableTimeVerticalDailyHtml(3, day, maxNames->value(), tmpExcludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                                   case 4: /*tmp+=TimetableExport::singleTeachersFreePeriodsTimetableTimeVerticalDailyHtml(3, day, saveTime, printDetailedTables->isChecked());*/ break;
                                   case 5: tmp+=TimetableExport::singleRoomsTimetableTimeVerticalDailyHtml(3, day, maxNames->value(), tmpExcludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                                   case 6: tmp+=TimetableExport::singleSubjectsTimetableTimeVerticalDailyHtml(3, day, maxNames->value(), tmpExcludedNamesIndex, saveTime, printActivityTags->isChecked()); break;
                                   case 7: tmp+=TimetableExport::singleAllActivitiesTimetableTimeVerticalDailyHtml(3, day, saveTime, printActivityTags->isChecked());
                                                 tmpExcludedNamesIndex<<-1; break;
                                   default: assert(0==1);
                            }
                            if(!(tmpExcludedNamesIndex.size()==namesList->count() && day==gt.rules.nDaysPerWeek-1)){
                                   if(count%2==0){
                                          tmp+="    <p class=\"back1\"><br /></p>\n\n";
                                   } else {
                                          if(!printAll) break;
                                          tmp+="    <p class=\"back0\"><br /></p>\n\n";
                                   }
                                   count++;
                            }
                     }
                     if(!printAll) break;
              }
       }
       // end
       
       tmp+="  </body>\n";
       tmp+="</html>\n\n";
       textDocument->clear();
       textDocument->setHtml(tmp);
}

Here is the caller graph for this function:

void TimetablePrintForm::updateNamesList ( ) [private, slot]

Definition at line 603 of file timetableprintform.cpp.

                                        {
       namesList->clear();
       
       /*printActivityTags->setDisabled(false);
       printDetailedTables->setDisabled(true);
       
       RBTimeHorizontal->setDisabled(false);
       RBTimeVertical->setDisabled(false);
       CBDivideTimeAxisByDay->setDisabled(false);*/
       //RBTimeHorizontalDay->setDisabled(false);
       //RBTimeVerticalDay->setDisabled(false);
       
       if(CBTables->currentIndex()==0){
              for(int subgroup=0; subgroup<gt.rules.nInternalSubgroups; subgroup++){
                     QString name = gt.rules.internalSubgroupsList[subgroup]->name;
                     namesList->addItem(name);
                     QListWidgetItem* tmpItem=namesList->item(subgroup);
                     tmpItem->setSelected(true);
              }
              printActivityTags->setDisabled(false);
              printDetailedTables->setDisabled(true);
       
              RBTimeHorizontal->setDisabled(false);
              RBTimeVertical->setDisabled(false);
              //CBDivideTimeAxisByDay->setDisabled(RBDaysHorizontal->isChecked() || RBDaysVertical->isChecked());
              RBTimeHorizontalDay->setDisabled(false);
              RBTimeVerticalDay->setDisabled(false);
       } else if(CBTables->currentIndex()==1){
              for(int group=0; group<gt.rules.internalGroupsList.size(); group++){
                     QString name = gt.rules.internalGroupsList[group]->name;
                     namesList->addItem(name);
                     QListWidgetItem* tmpItem=namesList->item(group);
                     tmpItem->setSelected(true);
              }
              printActivityTags->setDisabled(false);
              printDetailedTables->setDisabled(false); //this one is changed
       
              RBTimeHorizontal->setDisabled(false);
              RBTimeVertical->setDisabled(false);
              //CBDivideTimeAxisByDay->setDisabled(RBDaysHorizontal->isChecked() || RBDaysVertical->isChecked());
              RBTimeHorizontalDay->setDisabled(false);
              RBTimeVerticalDay->setDisabled(false);
       } else if(CBTables->currentIndex()==2){
              for(int year=0; year<gt.rules.augmentedYearsList.size(); year++){
                     QString name = gt.rules.augmentedYearsList[year]->name;
                     namesList->addItem(name);
                     QListWidgetItem* tmpItem=namesList->item(year);
                     tmpItem->setSelected(true);
              }
              printActivityTags->setDisabled(false);
              printDetailedTables->setDisabled(false); //this one is changed
       
              RBTimeHorizontal->setDisabled(false);
              RBTimeVertical->setDisabled(false);
              //CBDivideTimeAxisByDay->setDisabled(RBDaysHorizontal->isChecked() || RBDaysVertical->isChecked());
              RBTimeHorizontalDay->setDisabled(false);
              RBTimeVerticalDay->setDisabled(false);
       } else if(CBTables->currentIndex()==3){
              for(int teacher=0; teacher<gt.rules.nInternalTeachers; teacher++){
                     QString teacher_name = gt.rules.internalTeachersList[teacher]->name;
                     namesList->addItem(teacher_name);
                     QListWidgetItem* tmpItem=namesList->item(teacher);
                     tmpItem->setSelected(true);
              }
              printActivityTags->setDisabled(false);
              printDetailedTables->setDisabled(true);
       
              RBTimeHorizontal->setDisabled(false);
              RBTimeVertical->setDisabled(false);
              //CBDivideTimeAxisByDay->setDisabled(RBDaysHorizontal->isChecked() || RBDaysVertical->isChecked());
              RBTimeHorizontalDay->setDisabled(false);
              RBTimeVerticalDay->setDisabled(false);
       } else if(CBTables->currentIndex()==4){
              QString name = tr("All teachers");
              namesList->addItem(name);
              QListWidgetItem* tmpItem=namesList->item(0);
              tmpItem->setSelected(true);

              printActivityTags->setDisabled(true);
              printDetailedTables->setDisabled(false);
       
              if(!RBDaysVertical->isChecked())
                     RBDaysHorizontal->setChecked(true);

              RBTimeHorizontal->setDisabled(true);
              RBTimeVertical->setDisabled(true);
              //CBDivideTimeAxisByDay->setDisabled(RBDaysHorizontal->isChecked() || RBDaysVertical->isChecked());
              RBTimeHorizontalDay->setDisabled(true);
              RBTimeVerticalDay->setDisabled(true);
       } else if(CBTables->currentIndex()==5){
              for(int room=0; room<gt.rules.nInternalRooms; room++){
                     QString name = gt.rules.internalRoomsList[room]->name;
                     namesList->addItem(name);
                     QListWidgetItem* tmpItem=namesList->item(room);
                     tmpItem->setSelected(true);
              }
              printActivityTags->setDisabled(false);
              printDetailedTables->setDisabled(true);
       
              RBTimeHorizontal->setDisabled(false);
              RBTimeVertical->setDisabled(false);
              //CBDivideTimeAxisByDay->setDisabled(RBDaysHorizontal->isChecked() || RBDaysVertical->isChecked());
              RBTimeHorizontalDay->setDisabled(false);
              RBTimeVerticalDay->setDisabled(false);
       } else if(CBTables->currentIndex()==6){
              for(int subject=0; subject<gt.rules.nInternalSubjects; subject++){
                     QString name = gt.rules.internalSubjectsList[subject]->name;
                     namesList->addItem(name);
                     QListWidgetItem* tmpItem=namesList->item(subject);
                     tmpItem->setSelected(true);
              }
              printActivityTags->setDisabled(false);
              printDetailedTables->setDisabled(true);
       
              RBTimeHorizontal->setDisabled(false);
              RBTimeVertical->setDisabled(false);
              //CBDivideTimeAxisByDay->setDisabled(RBDaysHorizontal->isChecked() || RBDaysVertical->isChecked());
              RBTimeHorizontalDay->setDisabled(false);
              RBTimeVerticalDay->setDisabled(false);
       } else if(CBTables->currentIndex()==7){
              QString name = tr("All activities");
              namesList->addItem(name);
              QListWidgetItem* tmpItem=namesList->item(0);
              tmpItem->setSelected(true);

              printActivityTags->setDisabled(false);
              printDetailedTables->setDisabled(true);
       
              RBTimeHorizontal->setDisabled(false);
              RBTimeVertical->setDisabled(false);
              //CBDivideTimeAxisByDay->setDisabled(RBDaysHorizontal->isChecked() || RBDaysVertical->isChecked());
              RBTimeHorizontalDay->setDisabled(false);
              RBTimeVerticalDay->setDisabled(false);
       } else assert(0==1);
}

Here is the caller graph for this function:

void TimetablePrintForm::updatePreviewFull ( QPrinter *  printer) [private, slot]

Definition at line 1091 of file timetableprintform.cpp.

                                                           {
#ifdef QT_NO_PRINTER
       Q_UNUSED(printer);

       QMessageBox::warning(this, tr("FET warning"), tr("FET is compiled without printer support "
        "- it is impossible to print from this dialog. Please open the HTML timetables from the results directory"));
#else
       textDocument->print(printer);
#endif
}

Here is the caller graph for this function:

void TimetablePrintForm::updatePreviewSmall ( QPrinter *  printer) [private, slot]

Definition at line 1127 of file timetableprintform.cpp.

                                                            {
#ifdef QT_NO_PRINTER
       Q_UNUSED(printer);

       QMessageBox::warning(this, tr("FET warning"), tr("FET is compiled without printer support "
        "- it is impossible to print from this dialog. Please open the HTML timetables from the results directory"));
#else
       textDocument->print(printer);
#endif
}

Here is the caller graph for this function:


Member Data Documentation

QGroupBox* TimetablePrintForm::actionsBox [private]

Definition at line 67 of file timetableprintform.h.

Definition at line 83 of file timetableprintform.h.

Definition at line 91 of file timetableprintform.h.

QComboBox* TimetablePrintForm::CBBreak [private]

Definition at line 78 of file timetableprintform.h.

Definition at line 82 of file timetableprintform.h.

QComboBox* TimetablePrintForm::CBpaperSize [private]

Definition at line 81 of file timetableprintform.h.

QComboBox* TimetablePrintForm::CBTables [private]

Definition at line 62 of file timetableprintform.h.

QComboBox* TimetablePrintForm::CBWhiteSpace [private]

Definition at line 79 of file timetableprintform.h.

QSpinBox* TimetablePrintForm::fontSizeTable [private]

Definition at line 85 of file timetableprintform.h.

Definition at line 88 of file timetableprintform.h.

QSpinBox* TimetablePrintForm::maxNames [private]

Definition at line 86 of file timetableprintform.h.

QListWidget* TimetablePrintForm::namesList [private]

Definition at line 63 of file timetableprintform.h.

QGroupBox* TimetablePrintForm::optionsBox [private]

Definition at line 77 of file timetableprintform.h.

QPushButton* TimetablePrintForm::pbClose [private]

Definition at line 103 of file timetableprintform.h.

QPushButton* TimetablePrintForm::pbPrint [private]

Definition at line 101 of file timetableprintform.h.

Definition at line 100 of file timetableprintform.h.

Definition at line 99 of file timetableprintform.h.

QPushButton* TimetablePrintForm::pbSelectAll [private]

Definition at line 64 of file timetableprintform.h.

QPushButton* TimetablePrintForm::pbUnselectAll [private]

Definition at line 65 of file timetableprintform.h.

Definition at line 97 of file timetableprintform.h.

Definition at line 96 of file timetableprintform.h.

QRadioButton* TimetablePrintForm::RBDaysHorizontal [private]

Definition at line 68 of file timetableprintform.h.

QRadioButton* TimetablePrintForm::RBDaysVertical [private]

Definition at line 69 of file timetableprintform.h.

QRadioButton* TimetablePrintForm::RBTimeHorizontal [private]

Definition at line 70 of file timetableprintform.h.

QRadioButton* TimetablePrintForm::RBTimeHorizontalDay [private]

Definition at line 74 of file timetableprintform.h.

QRadioButton* TimetablePrintForm::RBTimeVertical [private]

Definition at line 71 of file timetableprintform.h.

QRadioButton* TimetablePrintForm::RBTimeVerticalDay [private]

Definition at line 75 of file timetableprintform.h.

Definition at line 90 of file timetableprintform.h.

QSpinBox* TimetablePrintForm::tablePadding [private]

Definition at line 84 of file timetableprintform.h.

QTextDocument* TimetablePrintForm::textDocument [private]

Definition at line 60 of file timetableprintform.h.

QSpinBox* TimetablePrintForm::topPageMargin [private]

Definition at line 89 of file timetableprintform.h.


The documentation for this class was generated from the following files: