Smartlet: TemplateMakerPageGui Class Reference
Signals | Public Member Functions | Public Attributes

TemplateMakerPageGui Class Reference

The widget used by FileUploadWizard for making new templates. More...

#include <templatemakerpagegui.h>

Inheritance diagram for TemplateMakerPageGui:
Inheritance graph
[legend]
Collaboration diagram for TemplateMakerPageGui:
Collaboration graph
[legend]

List of all members.

Signals

void signal_userInteraction (TagContainer::GeneralTag tag, QString change)

Public Member Functions

 TemplateMakerPageGui (TagContainer *tagContainer, FileSelectionModel *model, QWidget *parent=0)

Public Attributes

QGridLayout * mainGridLayout
QGroupBox * delimiterGroupBox
QCheckBox * checkBoxComma
QCheckBox * checkBoxSemicolon
QCheckBox * checkBoxTab
QLineEdit * otherDelimiterLineEdit
QSpinBox * spinBoxSkipLines
FilterEdit * rowFilterEdit
FileSelectionView * selectedFiles
QLineEdit * mergeOnSplitsLineEdit
QCheckBox * checkBoxLimitedPreview
ImportFileView * importFileView

Detailed Description

The widget used by FileUploadWizard for making new templates.

Todo:
selectedFiles grows to its sizeHint() komt, probably becase sizeHint() precedes QSizePolicy::ExpandFlag?

Constructor & Destructor Documentation

TemplateMakerPageGui::TemplateMakerPageGui ( TagContainer *  tagContainer,
FileSelectionModel *  model,
QWidget *  parent = 0 
)

                                                                                                                           : QWidget(parent)
{
    mainGridLayout = new QGridLayout(this);
    setLayout(mainGridLayout);

    delimiterGroupBox = new QGroupBox("Delimiters", this);
    delimiterGroupBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    checkBoxComma = new QCheckBox("Comma", delimiterGroupBox);
    checkBoxSemicolon = new QCheckBox("Semicolon", delimiterGroupBox);
    checkBoxTab = new QCheckBox("Tab", delimiterGroupBox);
    otherDelimiterLineEdit = new QLineEdit(delimiterGroupBox);
    otherDelimiterLineEdit->setToolTip("QRegExp allowed.");
    otherDelimiterLineEdit->setMaximumSize(QSize(30, 16777215));

    QHBoxLayout *otherDelimiterLayout = new QHBoxLayout();
    otherDelimiterLayout->addWidget(new QLabel("Other:", this));
    otherDelimiterLayout->addWidget(otherDelimiterLineEdit);

    QVBoxLayout *groupBoxLayout = new QVBoxLayout();
    groupBoxLayout->addWidget(checkBoxComma);
    groupBoxLayout->addWidget(checkBoxSemicolon);
    groupBoxLayout->addWidget(checkBoxTab);
    groupBoxLayout->addLayout(otherDelimiterLayout);

    delimiterGroupBox->setLayout(groupBoxLayout);

    QHBoxLayout *skipLinesLayout = new QHBoxLayout();
    QLabel *skipLinesLabel = new QLabel("Skip lines:", this);
    spinBoxSkipLines = new QSpinBox(this);
    spinBoxSkipLines->setMinimumSize(QSize(50, 0));
    spinBoxSkipLines->setMaximumSize(QSize(80, 16777215));
    skipLinesLayout->addWidget(skipLinesLabel);
    skipLinesLayout->addWidget(spinBoxSkipLines);

    QVBoxLayout *left = new QVBoxLayout();
    left->addWidget(delimiterGroupBox, 0, Qt::AlignTop);
    left->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum));
    left->addLayout(skipLinesLayout);

    selectedFiles = new FileSelectionView(this);
    selectedFiles->setAllowDeletions(false);
    selectedFiles->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
    selectedFiles->setSelectionMode(QAbstractItemView::SingleSelection);
    selectedFiles->setModel(model);


    QHBoxLayout *mergeOnSplitsLayout = new QHBoxLayout();
    rowFilterEdit = new FilterEdit(this);
    rowFilterEdit->setToolTip("QRegExp allowed.");
    mergeOnSplitsLayout->addWidget(new QLabel("Rowfilter:", this));
    mergeOnSplitsLayout->addWidget(rowFilterEdit);
    mergeOnSplitsLineEdit = new QLineEdit(this);
    mergeOnSplitsLayout->addWidget(new QLabel("Merge on split (seperated by comma):", this));
    mergeOnSplitsLayout->addWidget(mergeOnSplitsLineEdit);

    QVBoxLayout *middle = new QVBoxLayout();
    middle->addWidget(selectedFiles);
    middle->addLayout(mergeOnSplitsLayout);

    checkBoxLimitedPreview = new QCheckBox("Limited Preview", this);
    checkBoxLimitedPreview->setChecked(true);

    QVBoxLayout *right = new QVBoxLayout();
    right->addWidget(checkBoxLimitedPreview, 0, Qt::AlignBottom);

    importFileView = new ImportFileView(this, tagContainer);
    importFileView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    mainGridLayout->addLayout(left, 0, 0);
    mainGridLayout->addLayout(middle, 0, 1);
    mainGridLayout->addLayout(right, 0, 2);
    mainGridLayout->addWidget(importFileView, 1, 0, 1, 3);

    // Connections
    connect(spinBoxSkipLines, SIGNAL(valueChanged(QString)), this, SLOT(slot_skipLinesChanged(QString)));
    connect(checkBoxComma, SIGNAL(toggled(bool)), this, SLOT(slot_delimiterChanged()));
    connect(checkBoxSemicolon, SIGNAL(toggled(bool)), this, SLOT(slot_delimiterChanged()));
    connect(checkBoxTab, SIGNAL(toggled(bool)), this, SLOT(slot_delimiterChanged()));
    connect(otherDelimiterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slot_delimiterChanged()));
    connect(mergeOnSplitsLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slot_mergeOnSplitsChanged(QString)));
    connect(rowFilterEdit, SIGNAL(textChanged(QString)), this, SLOT(onRowFilterChange(QString)));

    connect(checkBoxLimitedPreview, SIGNAL(clicked(bool)), importFileView->model(), SLOT(setLimitedPreview(bool)));
    connect(selectedFiles->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
            this, SLOT(slot_selectedFileChanged(QItemSelection, QItemSelection)));
}


Member Function Documentation

void TemplateMakerPageGui::signal_userInteraction ( TagContainer::GeneralTag  tag,
QString  change 
) [signal]

Member Data Documentation

Referenced by TemplateMakerPageGui().

Referenced by TemplateMakerPageGui().

Referenced by TemplateMakerPageGui().

Referenced by TemplateMakerPageGui().

Referenced by TemplateMakerPageGui().

Referenced by TemplateMakerPageGui().

Referenced by TemplateMakerPageGui().

Referenced by TemplateMakerPageGui().

Referenced by TemplateMakerPageGui().

Referenced by TemplateMakerPageGui().

Referenced by TemplateMakerPageGui().

Referenced by TemplateMakerPageGui().


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