MCPcopy Create free account
hub / github.com/KDE/kdiff3 / DiffTextWindowFrame

Method DiffTextWindowFrame

src/difftextwindow.cpp:1941–2003  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1939}
1940
1941DiffTextWindowFrame::DiffTextWindowFrame(QWidget* pParent, e_SrcSelector winIdx, const QSharedPointer<SourceData>& psd, KDiff3App& app):
1942 QWidget(pParent)
1943{
1944 m_winIdx = winIdx;
1945
1946 m_pTopLineWidget = new QWidget(this);
1947 m_pFileSelection = new FileNameLineEdit(m_pTopLineWidget);
1948 m_pBrowseButton = new QPushButton("...", m_pTopLineWidget);
1949 m_pBrowseButton->setFixedWidth(30);
1950
1951 m_pFileSelection->setAcceptDrops(true);
1952
1953 m_pLabel = new QLabel("A:", m_pTopLineWidget);
1954 m_pTopLine = new QLabel(m_pTopLineWidget);
1955
1956 mSourceData = psd;
1957 setAutoFillBackground(true);
1958 chk_connect_a(m_pBrowseButton, &QPushButton::clicked, this, &DiffTextWindowFrame::slotBrowseButtonClicked);
1959 chk_connect_a(m_pFileSelection, &QLineEdit::returnPressed, this, &DiffTextWindowFrame::slotReturnPressed);
1960
1961 m_pDiffTextWindow = new DiffTextWindow(this, winIdx, app);
1962 m_pDiffTextWindow->setContentsMargins(4, 4, 4, 4); // (left, top, right, bottom)
1963 m_pDiffTextWindow->setSourceData(psd);
1964 QVBoxLayout* pVTopLayout = new QVBoxLayout(m_pTopLineWidget);
1965 pVTopLayout->setContentsMargins(2, 2, 2, 2);
1966 pVTopLayout->setSpacing(0);
1967 QHBoxLayout* pHL = new QHBoxLayout();
1968 QHBoxLayout* pHL2 = new QHBoxLayout();
1969 pVTopLayout->addLayout(pHL);
1970 pVTopLayout->addLayout(pHL2);
1971
1972 // Upper line:
1973 pHL->setContentsMargins(0, 0, 0, 0);
1974 pHL->setSpacing(2);
1975
1976 pHL->addWidget(m_pLabel, 0);
1977 pHL->addWidget(m_pFileSelection, 1);
1978 pHL->addWidget(m_pBrowseButton, 0);
1979 pHL->addWidget(m_pTopLine, 0);
1980
1981 // Lower line
1982 pHL2->setContentsMargins(0, 0, 0, 0);
1983 pHL2->setSpacing(2);
1984 pHL2->addWidget(m_pTopLine, 0);
1985 m_pEncoding = new EncodingLabel(i18n("Encoding:"), psd);
1986 //EncodeLabel::EncodingChanged should be handled asyncroniously.
1987 chk_connect_q((EncodingLabel*)m_pEncoding, &EncodingLabel::encodingChanged, this, &DiffTextWindowFrame::slotEncodingChanged);
1988
1989 m_pLineEndStyle = new QLabel(i18n("Line end style:"));
1990 pHL2->addWidget(m_pEncoding);
1991 pHL2->addWidget(m_pLineEndStyle);
1992
1993 QVBoxLayout* pVL = new QVBoxLayout(this);
1994 pVL->setContentsMargins(0, 0, 0, 0);
1995 pVL->setSpacing(0);
1996 pVL->addWidget(m_pTopLineWidget, 0);
1997 pVL->addWidget(m_pDiffTextWindow, 1);
1998

Callers

nothing calls this directly

Calls 1

setSourceDataMethod · 0.80

Tested by

no test coverage detected