-rw-r--r-- | noncore/apps/tinykate/libkate/view/kateviewdialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp index f82356b..b7cf9f5 100644 --- a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp +++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp | |||
@@ -127,129 +127,129 @@ QString SearchDialog::getSearchFor() | |||
127 | 127 | ||
128 | QString SearchDialog::getReplaceWith() | 128 | QString SearchDialog::getReplaceWith() |
129 | { | 129 | { |
130 | return m_replace->currentText(); | 130 | return m_replace->currentText(); |
131 | } | 131 | } |
132 | 132 | ||
133 | int SearchDialog::getFlags() | 133 | int SearchDialog::getFlags() |
134 | { | 134 | { |
135 | int flags = 0; | 135 | int flags = 0; |
136 | 136 | ||
137 | if( m_opt1->isChecked() ) flags |= KateView::sfCaseSensitive; | 137 | if( m_opt1->isChecked() ) flags |= KateView::sfCaseSensitive; |
138 | if( m_opt2->isChecked() ) flags |= KateView::sfWholeWords; | 138 | if( m_opt2->isChecked() ) flags |= KateView::sfWholeWords; |
139 | if( m_opt3->isChecked() ) flags |= KateView::sfFromBeginning; | 139 | if( m_opt3->isChecked() ) flags |= KateView::sfFromBeginning; |
140 | if( m_opt4->isChecked() ) flags |= KateView::sfBackward; | 140 | if( m_opt4->isChecked() ) flags |= KateView::sfBackward; |
141 | if( m_opt5->isChecked() ) flags |= KateView::sfSelected; | 141 | if( m_opt5->isChecked() ) flags |= KateView::sfSelected; |
142 | if( m_optRegExp->isChecked() ) flags |= KateView::sfRegularExpression; | 142 | if( m_optRegExp->isChecked() ) flags |= KateView::sfRegularExpression; |
143 | if( m_replace ) | 143 | if( m_replace ) |
144 | { | 144 | { |
145 | if( m_opt6->isChecked() ) | 145 | if( m_opt6->isChecked() ) |
146 | flags |= KateView::sfPrompt; | 146 | flags |= KateView::sfPrompt; |
147 | 147 | ||
148 | flags |= KateView::sfReplace; | 148 | flags |= KateView::sfReplace; |
149 | } | 149 | } |
150 | 150 | ||
151 | return flags; | 151 | return flags; |
152 | } | 152 | } |
153 | 153 | ||
154 | void SearchDialog::slotOk() | 154 | void SearchDialog::slotOk() |
155 | { | 155 | { |
156 | if ( !m_search->currentText().isEmpty() ) | 156 | if ( !m_search->currentText().isEmpty() ) |
157 | { | 157 | { |
158 | if ( !m_optRegExp->isChecked() ) | 158 | if ( !m_optRegExp->isChecked() ) |
159 | { | 159 | { |
160 | accept(); | 160 | accept(); |
161 | } | 161 | } |
162 | else | 162 | else |
163 | { | 163 | { |
164 | // Check for a valid regular expression. | 164 | // Check for a valid regular expression. |
165 | 165 | ||
166 | QRegExp regExp( m_search->currentText() ); | 166 | QRegExp regExp( m_search->currentText() ); |
167 | 167 | ||
168 | if ( regExp.isValid() ) | 168 | if ( regExp.isValid() ) |
169 | accept(); | 169 | accept(); |
170 | } | 170 | } |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | void SearchDialog::setSearchText( const QString &searchstr ) | 174 | void SearchDialog::setSearchText( const QString &searchstr ) |
175 | { | 175 | { |
176 | m_search->insertItem( searchstr, 0 ); | 176 | m_search->insertItem( searchstr, 0 ); |
177 | m_search->setCurrentItem( 0 ); | 177 | m_search->setCurrentItem( 0 ); |
178 | m_search->lineEdit()->selectAll(); | 178 | m_search->lineEdit()->selectAll(); |
179 | } | 179 | } |
180 | 180 | ||
181 | // this dialog is not modal | 181 | // this dialog is not modal |
182 | ReplacePrompt::ReplacePrompt( QWidget *parent ) | 182 | ReplacePrompt::ReplacePrompt( QWidget *parent ) |
183 | : KDialogBase(parent, 0L, false, i18n( "Replace Text" ), | 183 | : KDialogBase(parent, 0L, false, i18n( "Replace Text" ), |
184 | User3 | User2 | User1 | Close, User3, true, | 184 | User3 | User2 | User1 | Close, User3, true, |
185 | i18n("&All"), i18n("&No"), i18n("&Yes")) { | 185 | i18n("&All"), i18n("&No"), i18n("&Yes")) { |
186 | 186 | ||
187 | QWidget *page = new QWidget(this); | 187 | QWidget *page = new QWidget(this); |
188 | setMainWidget(page); | 188 | setMainWidget(page); |
189 | 189 | ||
190 | QBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); | 190 | QBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); |
191 | QLabel *label = new QLabel(i18n("Replace this occurence?"),page); | 191 | QLabel *label = new QLabel(i18n("Replace this occurrence?"),page); |
192 | topLayout->addWidget(label ); | 192 | topLayout->addWidget(label ); |
193 | } | 193 | } |
194 | 194 | ||
195 | void ReplacePrompt::slotUser1( void ) { // All | 195 | void ReplacePrompt::slotUser1( void ) { // All |
196 | done(KateView::srAll); | 196 | done(KateView::srAll); |
197 | } | 197 | } |
198 | 198 | ||
199 | void ReplacePrompt::slotUser2( void ) { // No | 199 | void ReplacePrompt::slotUser2( void ) { // No |
200 | done(KateView::srNo); | 200 | done(KateView::srNo); |
201 | } | 201 | } |
202 | 202 | ||
203 | void ReplacePrompt::slotUser3( void ) { // Yes | 203 | void ReplacePrompt::slotUser3( void ) { // Yes |
204 | accept(); | 204 | accept(); |
205 | } | 205 | } |
206 | 206 | ||
207 | void ReplacePrompt::done(int r) { | 207 | void ReplacePrompt::done(int r) { |
208 | setResult(r); | 208 | setResult(r); |
209 | emit clicked(); | 209 | emit clicked(); |
210 | } | 210 | } |
211 | 211 | ||
212 | void ReplacePrompt::closeEvent(QCloseEvent *) { | 212 | void ReplacePrompt::closeEvent(QCloseEvent *) { |
213 | reject(); | 213 | reject(); |
214 | } | 214 | } |
215 | 215 | ||
216 | GotoLineDialog::GotoLineDialog(QWidget *parent, int line, int max) | 216 | GotoLineDialog::GotoLineDialog(QWidget *parent, int line, int max) |
217 | : KDialogBase(parent, 0L, true, i18n("Goto Line"), Ok | Cancel, Ok) { | 217 | : KDialogBase(parent, 0L, true, i18n("Goto Line"), Ok | Cancel, Ok) { |
218 | 218 | ||
219 | QWidget *page = new QWidget(this); | 219 | QWidget *page = new QWidget(this); |
220 | setMainWidget(page); | 220 | setMainWidget(page); |
221 | 221 | ||
222 | QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); | 222 | QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); |
223 | e1 = new QSpinBox(page); | 223 | e1 = new QSpinBox(page); |
224 | e1->setMinValue(1); | 224 | e1->setMinValue(1); |
225 | e1->setMaxValue(max); | 225 | e1->setMaxValue(max); |
226 | e1->setValue((int)line); | 226 | e1->setValue((int)line); |
227 | 227 | ||
228 | QLabel *label = new QLabel( e1,i18n("&Goto Line:"), page ); | 228 | QLabel *label = new QLabel( e1,i18n("&Goto Line:"), page ); |
229 | topLayout->addWidget(label); | 229 | topLayout->addWidget(label); |
230 | topLayout->addWidget(e1); | 230 | topLayout->addWidget(e1); |
231 | topLayout->addSpacing(spacingHint()); // A little bit extra space | 231 | topLayout->addSpacing(spacingHint()); // A little bit extra space |
232 | topLayout->addStretch(10); | 232 | topLayout->addStretch(10); |
233 | e1->setFocus(); | 233 | e1->setFocus(); |
234 | } | 234 | } |
235 | 235 | ||
236 | int GotoLineDialog::getLine() { | 236 | int GotoLineDialog::getLine() { |
237 | return e1->value(); | 237 | return e1->value(); |
238 | } | 238 | } |
239 | 239 | ||
240 | const int IndentConfigTab::flags[] = {KateView::cfAutoIndent, KateView::cfSpaceIndent, | 240 | const int IndentConfigTab::flags[] = {KateView::cfAutoIndent, KateView::cfSpaceIndent, |
241 | KateView::cfBackspaceIndents,KateView::cfTabIndents, KateView::cfKeepIndentProfile, KateView::cfKeepExtraSpaces}; | 241 | KateView::cfBackspaceIndents,KateView::cfTabIndents, KateView::cfKeepIndentProfile, KateView::cfKeepExtraSpaces}; |
242 | 242 | ||
243 | IndentConfigTab::IndentConfigTab(QWidget *parent, KateView *view) | 243 | IndentConfigTab::IndentConfigTab(QWidget *parent, KateView *view) |
244 | : QWidget(parent, 0L) | 244 | : QWidget(parent, 0L) |
245 | { | 245 | { |
246 | QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); | 246 | QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); |
247 | int configFlags = view->config(); | 247 | int configFlags = view->config(); |
248 | 248 | ||
249 | opt[0] = new QCheckBox(i18n("&Auto Indent"), this); | 249 | opt[0] = new QCheckBox(i18n("&Auto Indent"), this); |
250 | layout->addWidget(opt[0], 0, AlignLeft); | 250 | layout->addWidget(opt[0], 0, AlignLeft); |
251 | opt[0]->setChecked(configFlags & flags[0]); | 251 | opt[0]->setChecked(configFlags & flags[0]); |
252 | 252 | ||
253 | opt[1] = new QCheckBox(i18n("Indent With &Spaces"), this); | 253 | opt[1] = new QCheckBox(i18n("Indent With &Spaces"), this); |
254 | layout->addWidget(opt[1], 0, AlignLeft); | 254 | layout->addWidget(opt[1], 0, AlignLeft); |
255 | opt[1]->setChecked(configFlags & flags[1]); | 255 | opt[1]->setChecked(configFlags & flags[1]); |