Lines 49-58
OpenDialog::OpenDialog(
Link Here
|
49 |
dialogUi.lineA->setEditText(n1); |
49 |
dialogUi.lineA->setEditText(n1); |
50 |
|
50 |
|
51 |
QPushButton* button = dialogUi.fileSelectA; |
51 |
QPushButton* button = dialogUi.fileSelectA; |
52 |
chk_connect_a(button, &QPushButton::clicked, this, &OpenDialog::selectFileA); |
52 |
connect(button, &QPushButton::clicked, this, &OpenDialog::selectFileA); |
53 |
QPushButton* button2 = dialogUi.folderSelectA; |
53 |
QPushButton* button2 = dialogUi.folderSelectA; |
54 |
chk_connect_a(button2, &QPushButton::clicked, this, &OpenDialog::selectDirA); |
54 |
connect(button2, &QPushButton::clicked, this, &OpenDialog::selectDirA); |
55 |
chk_connect_a(dialogUi.lineA, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged); |
55 |
connect(dialogUi.lineA, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged); |
56 |
|
56 |
|
57 |
dialogUi.lineB->setEditable(true); |
57 |
dialogUi.lineB->setEditable(true); |
58 |
dialogUi.lineB->insertItems(0, m_pOptions->m_recentBFiles); |
58 |
dialogUi.lineB->insertItems(0, m_pOptions->m_recentBFiles); |
Lines 60-79
OpenDialog::OpenDialog(
Link Here
|
60 |
|
60 |
|
61 |
dialogUi.lineB->setMinimumWidth(200); |
61 |
dialogUi.lineB->setMinimumWidth(200); |
62 |
button = dialogUi.fileSelectB; |
62 |
button = dialogUi.fileSelectB; |
63 |
chk_connect_a(button, &QPushButton::clicked, this, &OpenDialog::selectFileB); |
63 |
connect(button, &QPushButton::clicked, this, &OpenDialog::selectFileB); |
64 |
button2 = dialogUi.folderSelectB; |
64 |
button2 = dialogUi.folderSelectB; |
65 |
chk_connect_a(button2, &QPushButton::clicked, this, &OpenDialog::selectDirB); |
65 |
connect(button2, &QPushButton::clicked, this, &OpenDialog::selectDirB); |
66 |
chk_connect_a(dialogUi.lineB, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged); |
66 |
connect(dialogUi.lineB, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged); |
67 |
|
67 |
|
68 |
dialogUi.lineC->setEditable(true); |
68 |
dialogUi.lineC->setEditable(true); |
69 |
dialogUi.lineC->insertItems(0, m_pOptions->m_recentCFiles); |
69 |
dialogUi.lineC->insertItems(0, m_pOptions->m_recentCFiles); |
70 |
dialogUi.lineC->setEditText(n3); |
70 |
dialogUi.lineC->setEditText(n3); |
71 |
dialogUi.lineC->setMinimumWidth(200); |
71 |
dialogUi.lineC->setMinimumWidth(200); |
72 |
button = dialogUi.fileSelectC; |
72 |
button = dialogUi.fileSelectC; |
73 |
chk_connect_a(button, &QPushButton::clicked, this, &OpenDialog::selectFileC); |
73 |
connect(button, &QPushButton::clicked, this, &OpenDialog::selectFileC); |
74 |
button2 = dialogUi.folderSelectC; |
74 |
button2 = dialogUi.folderSelectC; |
75 |
chk_connect_a(button2, &QPushButton::clicked, this, &OpenDialog::selectDirC); |
75 |
connect(button2, &QPushButton::clicked, this, &OpenDialog::selectDirC); |
76 |
chk_connect_a(dialogUi.lineC, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged); |
76 |
connect(dialogUi.lineC, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged); |
77 |
|
77 |
|
78 |
button = dialogUi.swapCopy; |
78 |
button = dialogUi.swapCopy; |
79 |
|
79 |
|
Lines 87-115
OpenDialog::OpenDialog(
Link Here
|
87 |
m->addAction(i18n("Swap %1<->Output", i18n("A"))); |
87 |
m->addAction(i18n("Swap %1<->Output", i18n("A"))); |
88 |
m->addAction(i18n("Swap %1<->Output", i18n("B"))); |
88 |
m->addAction(i18n("Swap %1<->Output", i18n("B"))); |
89 |
m->addAction(i18n("Swap %1<->Output", i18n("C"))); |
89 |
m->addAction(i18n("Swap %1<->Output", i18n("C"))); |
90 |
chk_connect_a(m, &QMenu::triggered, this, &OpenDialog::slotSwapCopyNames); |
90 |
connect(m, &QMenu::triggered, this, &OpenDialog::slotSwapCopyNames); |
91 |
button->setMenu(m); |
91 |
button->setMenu(m); |
92 |
|
92 |
|
93 |
dialogUi.lineOut->insertItems(0, m_pOptions->m_recentOutputFiles); |
93 |
dialogUi.lineOut->insertItems(0, m_pOptions->m_recentOutputFiles); |
94 |
dialogUi.lineOut->setEditText(outputName); |
94 |
dialogUi.lineOut->setEditText(outputName); |
95 |
|
95 |
|
96 |
button = dialogUi.selectOutputFile; |
96 |
button = dialogUi.selectOutputFile; |
97 |
chk_connect_a(button, &QPushButton::clicked, this, &OpenDialog::selectOutputName); |
97 |
connect(button, &QPushButton::clicked, this, &OpenDialog::selectOutputName); |
98 |
button2 = dialogUi.selectOutputFolder; |
98 |
button2 = dialogUi.selectOutputFolder; |
99 |
chk_connect_a(button2, &QPushButton::clicked, this, &OpenDialog::selectOutputDir); |
99 |
connect(button2, &QPushButton::clicked, this, &OpenDialog::selectOutputDir); |
100 |
chk_connect_a(dialogUi.mergeCheckBox, &QCheckBox::stateChanged, this, &OpenDialog::internalSlot); |
100 |
connect(dialogUi.mergeCheckBox, &QCheckBox::stateChanged, this, &OpenDialog::internalSlot); |
101 |
chk_connect_a(this, &OpenDialog::internalSignal, dialogUi.lineOut, &QComboBox::setEnabled); |
101 |
connect(this, &OpenDialog::internalSignal, dialogUi.lineOut, &QComboBox::setEnabled); |
102 |
chk_connect_a(this, &OpenDialog::internalSignal, button, &QPushButton::setEnabled); |
102 |
connect(this, &OpenDialog::internalSignal, button, &QPushButton::setEnabled); |
103 |
chk_connect_a(this, &OpenDialog::internalSignal, button2, &QPushButton::setEnabled); |
103 |
connect(this, &OpenDialog::internalSignal, button2, &QPushButton::setEnabled); |
104 |
|
104 |
|
105 |
dialogUi.mergeCheckBox->setChecked(bMerge); |
105 |
dialogUi.mergeCheckBox->setChecked(bMerge); |
106 |
|
106 |
|
107 |
QDialogButtonBox *box = dialogUi.buttonBox; |
107 |
QDialogButtonBox *box = dialogUi.buttonBox; |
108 |
button = box->addButton(i18n("Configure..."), QDialogButtonBox::ActionRole); |
108 |
button = box->addButton(i18n("Configure..."), QDialogButtonBox::ActionRole); |
109 |
button->setIcon(QIcon::fromTheme("configure")); |
109 |
button->setIcon(QIcon::fromTheme("configure")); |
110 |
chk_connect_a(button, &QPushButton::clicked, pParent, &KDiff3App::slotConfigure); |
110 |
connect(button, &QPushButton::clicked, pParent, &KDiff3App::slotConfigure); |
111 |
chk_connect_a(box, &QDialogButtonBox::accepted, this, &OpenDialog::accept); |
111 |
connect(box, &QDialogButtonBox::accepted, this, &OpenDialog::accept); |
112 |
chk_connect_a(box, &QDialogButtonBox::rejected, this, &OpenDialog::reject); |
112 |
connect(box, &QDialogButtonBox::rejected, this, &OpenDialog::reject); |
113 |
|
113 |
|
114 |
QSize sh = sizeHint(); |
114 |
QSize sh = sizeHint(); |
115 |
if(sh.height() > 10) |
115 |
if(sh.height() > 10) |
Lines 354-361
FindDialog::FindDialog(QWidget* pParent)
Link Here
|
354 |
QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Cancel, this); |
354 |
QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Cancel, this); |
355 |
layout->addWidget(box, line, 0, 1, 2); |
355 |
layout->addWidget(box, line, 0, 1, 2); |
356 |
box->addButton(i18n("&Search"), QDialogButtonBox::AcceptRole); |
356 |
box->addButton(i18n("&Search"), QDialogButtonBox::AcceptRole); |
357 |
chk_connect(box, &QDialogButtonBox::accepted, this, &FindDialog::accept); |
357 |
connect(box, &QDialogButtonBox::accepted, this, &FindDialog::accept); |
358 |
chk_connect(box, &QDialogButtonBox::rejected, this, &FindDialog::reject); |
358 |
connect(box, &QDialogButtonBox::rejected, this, &FindDialog::reject); |
359 |
|
359 |
|
360 |
hide(); |
360 |
hide(); |
361 |
} |
361 |
} |
Lines 389-395
RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT
Link Here
|
389 |
l->setToolTip(autoMergeRegExpToolTip); |
389 |
l->setToolTip(autoMergeRegExpToolTip); |
390 |
m_pAutoMergeRegExpEdit = new QLineEdit(this); |
390 |
m_pAutoMergeRegExpEdit = new QLineEdit(this); |
391 |
pGrid->addWidget(m_pAutoMergeRegExpEdit, line, 1); |
391 |
pGrid->addWidget(m_pAutoMergeRegExpEdit, line, 1); |
392 |
chk_connect(m_pAutoMergeRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
392 |
connect(m_pAutoMergeRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
393 |
++line; |
393 |
++line; |
394 |
|
394 |
|
395 |
l = new QLabel(i18n("Example auto merge line:"), this); |
395 |
l = new QLabel(i18n("Example auto merge line:"), this); |
Lines 397-403
RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT
Link Here
|
397 |
l->setToolTip(i18n("To test auto merge, copy a line as used in your files.")); |
397 |
l->setToolTip(i18n("To test auto merge, copy a line as used in your files.")); |
398 |
m_pAutoMergeExampleEdit = new QLineEdit(this); |
398 |
m_pAutoMergeExampleEdit = new QLineEdit(this); |
399 |
pGrid->addWidget(m_pAutoMergeExampleEdit, line, 1); |
399 |
pGrid->addWidget(m_pAutoMergeExampleEdit, line, 1); |
400 |
chk_connect(m_pAutoMergeExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
400 |
connect(m_pAutoMergeExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
401 |
++line; |
401 |
++line; |
402 |
|
402 |
|
403 |
l = new QLabel(i18n("Match result:"), this); |
403 |
l = new QLabel(i18n("Match result:"), this); |
Lines 416-422
RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT
Link Here
|
416 |
l->setToolTip(historyStartRegExpToolTip); |
416 |
l->setToolTip(historyStartRegExpToolTip); |
417 |
m_pHistoryStartRegExpEdit = new QLineEdit(this); |
417 |
m_pHistoryStartRegExpEdit = new QLineEdit(this); |
418 |
pGrid->addWidget(m_pHistoryStartRegExpEdit, line, 1); |
418 |
pGrid->addWidget(m_pHistoryStartRegExpEdit, line, 1); |
419 |
chk_connect(m_pHistoryStartRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
419 |
connect(m_pHistoryStartRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
420 |
++line; |
420 |
++line; |
421 |
|
421 |
|
422 |
l = new QLabel(i18n("Example history start line (with leading comment):"), this); |
422 |
l = new QLabel(i18n("Example history start line (with leading comment):"), this); |
Lines 425-431
RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT
Link Here
|
425 |
"including the leading comment.")); |
425 |
"including the leading comment.")); |
426 |
m_pHistoryStartExampleEdit = new QLineEdit(this); |
426 |
m_pHistoryStartExampleEdit = new QLineEdit(this); |
427 |
pGrid->addWidget(m_pHistoryStartExampleEdit, line, 1); |
427 |
pGrid->addWidget(m_pHistoryStartExampleEdit, line, 1); |
428 |
chk_connect(m_pHistoryStartExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
428 |
connect(m_pHistoryStartExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
429 |
++line; |
429 |
++line; |
430 |
|
430 |
|
431 |
l = new QLabel(i18n("Match result:"), this); |
431 |
l = new QLabel(i18n("Match result:"), this); |
Lines 444-450
RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT
Link Here
|
444 |
l->setToolTip(historyEntryStartRegExpToolTip); |
444 |
l->setToolTip(historyEntryStartRegExpToolTip); |
445 |
m_pHistoryEntryStartRegExpEdit = new QLineEdit(this); |
445 |
m_pHistoryEntryStartRegExpEdit = new QLineEdit(this); |
446 |
pGrid->addWidget(m_pHistoryEntryStartRegExpEdit, line, 1); |
446 |
pGrid->addWidget(m_pHistoryEntryStartRegExpEdit, line, 1); |
447 |
chk_connect(m_pHistoryEntryStartRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
447 |
connect(m_pHistoryEntryStartRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
448 |
++line; |
448 |
++line; |
449 |
|
449 |
|
450 |
l = new QLabel(i18n("History sort key order:"), this); |
450 |
l = new QLabel(i18n("History sort key order:"), this); |
Lines 452-458
RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT
Link Here
|
452 |
l->setToolTip(historySortKeyOrderToolTip); |
452 |
l->setToolTip(historySortKeyOrderToolTip); |
453 |
m_pHistorySortKeyOrderEdit = new QLineEdit(this); |
453 |
m_pHistorySortKeyOrderEdit = new QLineEdit(this); |
454 |
pGrid->addWidget(m_pHistorySortKeyOrderEdit, line, 1); |
454 |
pGrid->addWidget(m_pHistorySortKeyOrderEdit, line, 1); |
455 |
chk_connect(m_pHistorySortKeyOrderEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
455 |
connect(m_pHistorySortKeyOrderEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
456 |
++line; |
456 |
++line; |
457 |
|
457 |
|
458 |
l = new QLabel(i18n("Example history entry start line (without leading comment):"), this); |
458 |
l = new QLabel(i18n("Example history entry start line (without leading comment):"), this); |
Lines 461-467
RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT
Link Here
|
461 |
"but omit the leading comment.")); |
461 |
"but omit the leading comment.")); |
462 |
m_pHistoryEntryStartExampleEdit = new QLineEdit(this); |
462 |
m_pHistoryEntryStartExampleEdit = new QLineEdit(this); |
463 |
pGrid->addWidget(m_pHistoryEntryStartExampleEdit, line, 1); |
463 |
pGrid->addWidget(m_pHistoryEntryStartExampleEdit, line, 1); |
464 |
chk_connect(m_pHistoryEntryStartExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
464 |
connect(m_pHistoryEntryStartExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); |
465 |
++line; |
465 |
++line; |
466 |
|
466 |
|
467 |
l = new QLabel(i18n("Match result:"), this); |
467 |
l = new QLabel(i18n("Match result:"), this); |
Lines 480-487
RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT
Link Here
|
480 |
|
480 |
|
481 |
QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); |
481 |
QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); |
482 |
pGrid->addWidget(box, line, 0, 1, 2); |
482 |
pGrid->addWidget(box, line, 0, 1, 2); |
483 |
chk_connect(box, &QDialogButtonBox::accepted, this, &RegExpTester::accept); |
483 |
connect(box, &QDialogButtonBox::accepted, this, &RegExpTester::accept); |
484 |
chk_connect(box, &QDialogButtonBox::rejected, this, &RegExpTester::reject); |
484 |
connect(box, &QDialogButtonBox::rejected, this, &RegExpTester::reject); |
485 |
|
485 |
|
486 |
resize(800, sizeHint().height()); |
486 |
resize(800, sizeHint().height()); |
487 |
} |
487 |
} |