-rw-r--r-- | core/apps/textedit/textedit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 749e0ac..21bf4b3 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -231,195 +231,195 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) | |||
231 | connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) ); | 231 | connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) ); |
232 | a->addTo( editBar ); | 232 | a->addTo( editBar ); |
233 | a->addTo( edit ); | 233 | a->addTo( edit ); |
234 | 234 | ||
235 | a = new QAction( tr( "Paste" ), Resource::loadPixmap( "paste" ), | 235 | a = new QAction( tr( "Paste" ), Resource::loadPixmap( "paste" ), |
236 | QString::null, 0, this, 0 ); | 236 | QString::null, 0, this, 0 ); |
237 | connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) ); | 237 | connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) ); |
238 | a->addTo( editBar ); | 238 | a->addTo( editBar ); |
239 | a->addTo( edit ); | 239 | a->addTo( edit ); |
240 | 240 | ||
241 | 241 | ||
242 | #ifndef QT_NO_CLIPBOARD | 242 | #ifndef QT_NO_CLIPBOARD |
243 | a = new QAction( tr( "Insert Time and Date" ), Resource::loadPixmap( "paste" ), | 243 | a = new QAction( tr( "Insert Time and Date" ), Resource::loadPixmap( "paste" ), |
244 | QString::null, 0, this, 0 ); | 244 | QString::null, 0, this, 0 ); |
245 | connect( a, SIGNAL( activated() ), this, SLOT( editPasteTimeDate() ) ); | 245 | connect( a, SIGNAL( activated() ), this, SLOT( editPasteTimeDate() ) ); |
246 | a->addTo( edit ); | 246 | a->addTo( edit ); |
247 | #endif | 247 | #endif |
248 | 248 | ||
249 | a = new QAction( tr( "Goto Line..." ), Resource::loadPixmap( "find" ), | 249 | a = new QAction( tr( "Goto Line..." ), Resource::loadPixmap( "find" ), |
250 | QString::null, 0, this, 0 ); | 250 | QString::null, 0, this, 0 ); |
251 | connect( a, SIGNAL( activated() ), this, SLOT( gotoLine() ) ); | 251 | connect( a, SIGNAL( activated() ), this, SLOT( gotoLine() ) ); |
252 | edit->insertSeparator(); | 252 | edit->insertSeparator(); |
253 | a->addTo( edit ); | 253 | a->addTo( edit ); |
254 | 254 | ||
255 | a = new QAction( tr( "Find..." ), Resource::loadPixmap( "find" ), | 255 | a = new QAction( tr( "Find..." ), Resource::loadPixmap( "find" ), |
256 | QString::null, 0, this, 0 ); | 256 | QString::null, 0, this, 0 ); |
257 | connect( a, SIGNAL( activated() ), this, SLOT( editFind() ) ); | 257 | connect( a, SIGNAL( activated() ), this, SLOT( editFind() ) ); |
258 | a->addTo( bar ); | 258 | a->addTo( bar ); |
259 | a->addTo( edit ); | 259 | a->addTo( edit ); |
260 | 260 | ||
261 | zin = new QAction( tr("Zoom in"), QString::null, 0, this, 0 ); | 261 | zin = new QAction( tr("Zoom in"), QString::null, 0, this, 0 ); |
262 | connect( zin, SIGNAL( activated() ), this, SLOT( zoomIn() ) ); | 262 | connect( zin, SIGNAL( activated() ), this, SLOT( zoomIn() ) ); |
263 | zin->addTo( font ); | 263 | zin->addTo( font ); |
264 | 264 | ||
265 | zout = new QAction( tr("Zoom out"), QString::null, 0, this, 0 ); | 265 | zout = new QAction( tr("Zoom out"), QString::null, 0, this, 0 ); |
266 | connect( zout, SIGNAL( activated() ), this, SLOT( zoomOut() ) ); | 266 | connect( zout, SIGNAL( activated() ), this, SLOT( zoomOut() ) ); |
267 | zout->addTo( font ); | 267 | zout->addTo( font ); |
268 | 268 | ||
269 | font->insertSeparator(); | 269 | font->insertSeparator(); |
270 | 270 | ||
271 | font->insertItem(tr("Font"), this, SLOT(changeFont()) ); | 271 | font->insertItem(tr("Font"), this, SLOT(changeFont()) ); |
272 | 272 | ||
273 | font->insertSeparator(); | 273 | font->insertSeparator(); |
274 | font->insertItem(tr("Advanced Features"), advancedMenu); | 274 | font->insertItem(tr("Advanced Features"), advancedMenu); |
275 | 275 | ||
276 | QAction *wa = new QAction( tr("Wrap lines"), | 276 | QAction *wa = new QAction( tr("Wrap lines"), |
277 | QString::null, 0, this, 0 ); | 277 | QString::null, 0, this, 0 ); |
278 | connect( wa, SIGNAL( toggled(bool) ), | 278 | connect( wa, SIGNAL( toggled(bool) ), |
279 | this, SLOT( setWordWrap(bool) ) ); | 279 | this, SLOT( setWordWrap(bool) ) ); |
280 | wa->setToggleAction(true); | 280 | wa->setToggleAction(true); |
281 | wa->addTo( advancedMenu); | 281 | wa->addTo( advancedMenu); |
282 | 282 | ||
283 | nStart = new QAction( tr("Start with new file"), | 283 | nStart = new QAction( tr("Start with new file"), |
284 | QString::null, 0, this, 0 ); | 284 | QString::null, 0, this, 0 ); |
285 | connect( nStart, SIGNAL( toggled(bool) ), | 285 | connect( nStart, SIGNAL( toggled(bool) ), |
286 | this, SLOT( changeStartConfig(bool) ) ); | 286 | this, SLOT( changeStartConfig(bool) ) ); |
287 | nStart->setToggleAction(true); | 287 | nStart->setToggleAction(true); |
288 | nStart->addTo( advancedMenu ); | 288 | nStart->addTo( advancedMenu ); |
289 | nStart->setEnabled(false); | 289 | nStart->setEnabled(false); |
290 | 290 | ||
291 | nAdvanced = new QAction( tr("Prompt on Exit"), | 291 | nAdvanced = new QAction( tr("Prompt on Exit"), |
292 | QString::null, 0, this, 0 ); | 292 | QString::null, 0, this, 0 ); |
293 | connect( nAdvanced, SIGNAL( toggled(bool) ), | 293 | connect( nAdvanced, SIGNAL( toggled(bool) ), |
294 | this, SLOT( doPrompt(bool) ) ); | 294 | this, SLOT( doPrompt(bool) ) ); |
295 | nAdvanced->setToggleAction(true); | 295 | nAdvanced->setToggleAction(true); |
296 | nAdvanced->addTo( advancedMenu ); | 296 | nAdvanced->addTo( advancedMenu ); |
297 | 297 | ||
298 | desktopAction = new QAction( tr("Always open linked file"), | 298 | desktopAction = new QAction( tr("Always open linked file"), |
299 | QString::null, 0, this, 0 ); | 299 | QString::null, 0, this, 0 ); |
300 | connect( desktopAction, SIGNAL( toggled(bool) ), | 300 | connect( desktopAction, SIGNAL( toggled(bool) ), |
301 | this, SLOT( doDesktop(bool) ) ); | 301 | this, SLOT( doDesktop(bool) ) ); |
302 | desktopAction->setToggleAction(true); | 302 | desktopAction->setToggleAction(true); |
303 | desktopAction->addTo( advancedMenu); | 303 | desktopAction->addTo( advancedMenu); |
304 | 304 | ||
305 | filePermAction = new QAction( tr("File Permissions"), | 305 | filePermAction = new QAction( tr("File Permissions"), |
306 | QString::null, 0, this, 0 ); | 306 | QString::null, 0, this, 0 ); |
307 | connect( filePermAction, SIGNAL( toggled(bool) ), | 307 | connect( filePermAction, SIGNAL( toggled(bool) ), |
308 | this, SLOT( doFilePerms(bool) ) ); | 308 | this, SLOT( doFilePerms(bool) ) ); |
309 | filePermAction->setToggleAction(true); | 309 | filePermAction->setToggleAction(true); |
310 | filePermAction->addTo( advancedMenu); | 310 | filePermAction->addTo( advancedMenu); |
311 | 311 | ||
312 | searchBarAction = new QAction( tr("Search Bar Open"), | 312 | searchBarAction = new QAction( tr("Search Bar Open"), |
313 | QString::null, 0, this, 0 ); | 313 | QString::null, 0, this, 0 ); |
314 | connect( searchBarAction, SIGNAL( toggled(bool) ), | 314 | connect( searchBarAction, SIGNAL( toggled(bool) ), |
315 | this, SLOT( setSearchBar(bool) ) ); | 315 | this, SLOT( setSearchBar(bool) ) ); |
316 | searchBarAction->setToggleAction(true); | 316 | searchBarAction->setToggleAction(true); |
317 | searchBarAction->addTo( advancedMenu); | 317 | searchBarAction->addTo( advancedMenu); |
318 | 318 | ||
319 | nAutoSave = new QAction( tr("Auto Save 5 min."), | 319 | nAutoSave = new QAction( tr("Auto Save 5 min."), |
320 | QString::null, 0, this, 0 ); | 320 | QString::null, 0, this, 0 ); |
321 | connect( nAutoSave, SIGNAL( toggled(bool) ), | 321 | connect( nAutoSave, SIGNAL( toggled(bool) ), |
322 | this, SLOT( doTimer(bool) ) ); | 322 | this, SLOT( doTimer(bool) ) ); |
323 | nAutoSave->setToggleAction(true); | 323 | nAutoSave->setToggleAction(true); |
324 | nAutoSave->addTo( advancedMenu); | 324 | nAutoSave->addTo( advancedMenu); |
325 | 325 | ||
326 | 326 | ||
327 | font->insertSeparator(); | 327 | //font->insertSeparator(); |
328 | 328 | ||
329 | font->insertItem(tr("About"), this, SLOT( doAbout()) ); | 329 | //font->insertItem(tr("About"), this, SLOT( doAbout()) ); |
330 | 330 | ||
331 | mb->insertItem( tr( "File" ), file ); | 331 | mb->insertItem( tr( "File" ), file ); |
332 | mb->insertItem( tr( "Edit" ), edit ); | 332 | mb->insertItem( tr( "Edit" ), edit ); |
333 | mb->insertItem( tr( "View" ), font ); | 333 | mb->insertItem( tr( "View" ), font ); |
334 | 334 | ||
335 | searchBar = new QPEToolBar(this); | 335 | searchBar = new QPEToolBar(this); |
336 | addToolBar( searchBar, "Search", QMainWindow::Top, true ); | 336 | addToolBar( searchBar, "Search", QMainWindow::Top, true ); |
337 | 337 | ||
338 | searchBar->setHorizontalStretchable( true ); | 338 | searchBar->setHorizontalStretchable( true ); |
339 | 339 | ||
340 | searchEdit = new QLineEdit( searchBar, "searchEdit" ); | 340 | searchEdit = new QLineEdit( searchBar, "searchEdit" ); |
341 | searchBar->setStretchableWidget( searchEdit ); | 341 | searchBar->setStretchableWidget( searchEdit ); |
342 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ), | 342 | connect( searchEdit, SIGNAL( textChanged( const QString & ) ), |
343 | this, SLOT( search() ) ); | 343 | this, SLOT( search() ) ); |
344 | 344 | ||
345 | a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), | 345 | a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), |
346 | QString::null, 0, this, 0 ); | 346 | QString::null, 0, this, 0 ); |
347 | connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) ); | 347 | connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) ); |
348 | a->addTo( searchBar ); | 348 | a->addTo( searchBar ); |
349 | a->addTo( edit ); | 349 | a->addTo( edit ); |
350 | 350 | ||
351 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), | 351 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), |
352 | QString::null, 0, this, 0 ); | 352 | QString::null, 0, this, 0 ); |
353 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); | 353 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); |
354 | a->addTo( searchBar ); | 354 | a->addTo( searchBar ); |
355 | 355 | ||
356 | edit->insertSeparator(); | 356 | edit->insertSeparator(); |
357 | a = new QAction( tr( "Delete" ), Resource::loadPixmap( "close" ), | 357 | a = new QAction( tr( "Delete" ), Resource::loadPixmap( "close" ), |
358 | QString::null, 0, this, 0 ); | 358 | QString::null, 0, this, 0 ); |
359 | connect( a, SIGNAL( activated() ), this, SLOT( editDelete() ) ); | 359 | connect( a, SIGNAL( activated() ), this, SLOT( editDelete() ) ); |
360 | a->addTo( edit ); | 360 | a->addTo( edit ); |
361 | 361 | ||
362 | searchBar->hide(); | 362 | searchBar->hide(); |
363 | 363 | ||
364 | editor = new QpeEditor( this ); | 364 | editor = new QpeEditor( this ); |
365 | setCentralWidget( editor ); | 365 | setCentralWidget( editor ); |
366 | editor->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 366 | editor->setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
367 | connect( editor, SIGNAL( textChanged() ), | 367 | connect( editor, SIGNAL( textChanged() ), |
368 | this, SLOT( editorChanged() ) ); | 368 | this, SLOT( editorChanged() ) ); |
369 | 369 | ||
370 | QPEApplication::setStylusOperation( editor, QPEApplication::RightOnHold); | 370 | QPEApplication::setStylusOperation( editor, QPEApplication::RightOnHold); |
371 | 371 | ||
372 | Config cfg("TextEdit"); | 372 | Config cfg("TextEdit"); |
373 | cfg. setGroup ( "Font" ); | 373 | cfg. setGroup ( "Font" ); |
374 | 374 | ||
375 | QFont defaultFont = editor-> font ( ); | 375 | QFont defaultFont = editor-> font ( ); |
376 | 376 | ||
377 | QString family = cfg. readEntry ( "Family", defaultFont. family ( )); | 377 | QString family = cfg. readEntry ( "Family", defaultFont. family ( )); |
378 | int size = cfg. readNumEntry ( "Size", defaultFont. pointSize ( )); | 378 | int size = cfg. readNumEntry ( "Size", defaultFont. pointSize ( )); |
379 | int weight = cfg. readNumEntry ( "Weight", defaultFont. weight ( )); | 379 | int weight = cfg. readNumEntry ( "Weight", defaultFont. weight ( )); |
380 | bool italic = cfg. readBoolEntry ( "Italic", defaultFont. italic ( )); | 380 | bool italic = cfg. readBoolEntry ( "Italic", defaultFont. italic ( )); |
381 | 381 | ||
382 | defaultFont = QFont ( family, size, weight, italic ); | 382 | defaultFont = QFont ( family, size, weight, italic ); |
383 | editor-> setFont ( defaultFont ); | 383 | editor-> setFont ( defaultFont ); |
384 | // updateCaption(); | 384 | // updateCaption(); |
385 | 385 | ||
386 | cfg.setGroup ( "View" ); | 386 | cfg.setGroup ( "View" ); |
387 | 387 | ||
388 | promptExit = cfg.readBoolEntry ( "PromptExit", false ); | 388 | promptExit = cfg.readBoolEntry ( "PromptExit", false ); |
389 | openDesktop = cfg.readBoolEntry ( "OpenDesktop", true ); | 389 | openDesktop = cfg.readBoolEntry ( "OpenDesktop", true ); |
390 | filePerms = cfg.readBoolEntry ( "FilePermissions", false ); | 390 | filePerms = cfg.readBoolEntry ( "FilePermissions", false ); |
391 | useSearchBar = cfg.readBoolEntry ( "SearchBar", false ); | 391 | useSearchBar = cfg.readBoolEntry ( "SearchBar", false ); |
392 | startWithNew = cfg.readBoolEntry ( "startNew", true); | 392 | startWithNew = cfg.readBoolEntry ( "startNew", true); |
393 | featureAutoSave = cfg.readBoolEntry( "autosave", false); | 393 | featureAutoSave = cfg.readBoolEntry( "autosave", false); |
394 | 394 | ||
395 | if(useSearchBar) searchBarAction->setOn(true); | 395 | if(useSearchBar) searchBarAction->setOn(true); |
396 | if(promptExit) nAdvanced->setOn( true ); | 396 | if(promptExit) nAdvanced->setOn( true ); |
397 | if(openDesktop) desktopAction->setOn( true ); | 397 | if(openDesktop) desktopAction->setOn( true ); |
398 | if(filePerms) filePermAction->setOn( true ); | 398 | if(filePerms) filePermAction->setOn( true ); |
399 | if(startWithNew) nStart->setOn( true ); | 399 | if(startWithNew) nStart->setOn( true ); |
400 | if(featureAutoSave) nAutoSave->setOn(true); | 400 | if(featureAutoSave) nAutoSave->setOn(true); |
401 | 401 | ||
402 | // { | 402 | // { |
403 | // doTimer(true); | 403 | // doTimer(true); |
404 | // } | 404 | // } |
405 | 405 | ||
406 | bool wrap = cfg. readBoolEntry ( "Wrap", true ); | 406 | bool wrap = cfg. readBoolEntry ( "Wrap", true ); |
407 | wa-> setOn ( wrap ); | 407 | wa-> setOn ( wrap ); |
408 | setWordWrap ( wrap ); | 408 | setWordWrap ( wrap ); |
409 | 409 | ||
410 | ///////////////// | 410 | ///////////////// |
411 | if( qApp->argc() > 1) { | 411 | if( qApp->argc() > 1) { |
412 | currentFileName=qApp->argv()[1]; | 412 | currentFileName=qApp->argv()[1]; |
413 | 413 | ||
414 | QFileInfo fi(currentFileName); | 414 | QFileInfo fi(currentFileName); |
415 | 415 | ||
416 | if(fi.baseName().left(1) == "") { | 416 | if(fi.baseName().left(1) == "") { |
417 | openDotFile(currentFileName); | 417 | openDotFile(currentFileName); |
418 | } else { | 418 | } else { |
419 | openFile(currentFileName); | 419 | openFile(currentFileName); |
420 | } | 420 | } |
421 | } else { | 421 | } else { |
422 | edited1=false; | 422 | edited1=false; |
423 | openDotFile(""); | 423 | openDotFile(""); |
424 | } | 424 | } |
425 | 425 | ||