Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/ktextedit.cpp
Show All 38 Lines | |||||
39 | #include <sonnet/dialog.h> | 39 | #include <sonnet/dialog.h> | ||
40 | #include <sonnet/backgroundchecker.h> | 40 | #include <sonnet/backgroundchecker.h> | ||
41 | #include <sonnet/spellcheckdecorator.h> | 41 | #include <sonnet/spellcheckdecorator.h> | ||
42 | #include <kcursor.h> | 42 | #include <kcursor.h> | ||
43 | #include <kstandardaction.h> | 43 | #include <kstandardaction.h> | ||
44 | #include <kstandardshortcut.h> | 44 | #include <kstandardshortcut.h> | ||
45 | #include <klocalizedstring.h> | 45 | #include <klocalizedstring.h> | ||
46 | #include <kmessagebox.h> | 46 | #include <kmessagebox.h> | ||
47 | #include <kwindowsystem.h> | | |||
48 | 47 | | |||
49 | #include "kreplacedialog.h" | 48 | #include "kreplacedialog.h" | ||
50 | #include "kfinddialog.h" | 49 | #include "kfinddialog.h" | ||
51 | #include "kfind.h" | 50 | #include "kfind.h" | ||
52 | #include "kreplace.h" | 51 | #include "kreplace.h" | ||
53 | 52 | | |||
54 | class KTextDecorator : public Sonnet::SpellCheckDecorator | 53 | class KTextDecorator : public Sonnet::SpellCheckDecorator | ||
55 | { | 54 | { | ||
▲ Show 20 Lines • Show All 738 Lines • ▼ Show 20 Line(s) | |||||
794 | 793 | | |||
795 | void KTextEdit::replace() | 794 | void KTextEdit::replace() | ||
796 | { | 795 | { | ||
797 | if (document()->isEmpty()) { // saves having to track the text changes | 796 | if (document()->isEmpty()) { // saves having to track the text changes | ||
798 | return; | 797 | return; | ||
799 | } | 798 | } | ||
800 | 799 | | |||
801 | if (d->repDlg) { | 800 | if (d->repDlg) { | ||
802 | KWindowSystem::activateWindow(d->repDlg->winId()); | 801 | d->repDlg->activateWindow(); | ||
803 | } else { | 802 | } else { | ||
804 | d->repDlg = new KReplaceDialog(this, 0, | 803 | d->repDlg = new KReplaceDialog(this, 0, | ||
805 | QStringList(), QStringList(), false); | 804 | QStringList(), QStringList(), false); | ||
806 | connect(d->repDlg, &KFindDialog::okClicked, this, &KTextEdit::slotDoReplace); | 805 | connect(d->repDlg, &KFindDialog::okClicked, this, &KTextEdit::slotDoReplace); | ||
807 | } | 806 | } | ||
808 | d->repDlg->show(); | 807 | d->repDlg->show(); | ||
809 | } | 808 | } | ||
810 | 809 | | |||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Line(s) | |||||
957 | 956 | | |||
958 | void KTextEdit::slotFind() | 957 | void KTextEdit::slotFind() | ||
959 | { | 958 | { | ||
960 | if (document()->isEmpty()) { // saves having to track the text changes | 959 | if (document()->isEmpty()) { // saves having to track the text changes | ||
961 | return; | 960 | return; | ||
962 | } | 961 | } | ||
963 | 962 | | |||
964 | if (d->findDlg) { | 963 | if (d->findDlg) { | ||
965 | KWindowSystem::activateWindow(d->findDlg->winId()); | 964 | d->findDlg->activateWindow(); | ||
966 | } else { | 965 | } else { | ||
967 | d->findDlg = new KFindDialog(this); | 966 | d->findDlg = new KFindDialog(this); | ||
968 | connect(d->findDlg, &KFindDialog::okClicked, this, &KTextEdit::slotDoFind); | 967 | connect(d->findDlg, &KFindDialog::okClicked, this, &KTextEdit::slotDoFind); | ||
969 | } | 968 | } | ||
970 | d->findDlg->show(); | 969 | d->findDlg->show(); | ||
971 | } | 970 | } | ||
972 | 971 | | |||
973 | void KTextEdit::slotReplace() | 972 | void KTextEdit::slotReplace() | ||
974 | { | 973 | { | ||
975 | if (document()->isEmpty()) { // saves having to track the text changes | 974 | if (document()->isEmpty()) { // saves having to track the text changes | ||
976 | return; | 975 | return; | ||
977 | } | 976 | } | ||
978 | 977 | | |||
979 | if (d->repDlg) { | 978 | if (d->repDlg) { | ||
980 | KWindowSystem::activateWindow(d->repDlg->winId()); | 979 | d->repDlg->activateWindow(); | ||
981 | } else { | 980 | } else { | ||
982 | d->repDlg = new KReplaceDialog(this, 0, | 981 | d->repDlg = new KReplaceDialog(this, 0, | ||
983 | QStringList(), QStringList(), false); | 982 | QStringList(), QStringList(), false); | ||
984 | connect(d->repDlg, &KFindDialog::okClicked, this, &KTextEdit::slotDoReplace); | 983 | connect(d->repDlg, &KFindDialog::okClicked, this, &KTextEdit::slotDoReplace); | ||
985 | } | 984 | } | ||
986 | d->repDlg->show(); | 985 | d->repDlg->show(); | ||
987 | } | 986 | } | ||
988 | 987 | | |||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |