-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 26 | ||||
-rw-r--r-- | core/apps/textedit/filePermissions.cpp | 12 | ||||
-rw-r--r-- | core/apps/textedit/fileSaver.cpp | 6 | ||||
-rw-r--r-- | core/apps/textedit/fontDialog.cpp | 2 | ||||
-rw-r--r-- | core/apps/textedit/textedit.cpp | 18 |
5 files changed, 32 insertions, 32 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp index b655c96..bc99348 100644 --- a/core/apps/textedit/fileBrowser.cpp +++ b/core/apps/textedit/fileBrowser.cpp | |||
@@ -43,17 +43,17 @@ static int get_unique_id() | |||
43 | { | 43 | { |
44 | return u_id++; | 44 | return u_id++; |
45 | } | 45 | } |
46 | 46 | ||
47 | fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString mimeFilter ) | 47 | fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString mimeFilter ) |
48 | : QDialog( parent, name, modal, fl ) | 48 | : QDialog( parent, name, modal, fl ) |
49 | { | 49 | { |
50 | if ( !name ) | 50 | if ( !name ) |
51 | setName( "fileBrowser" ); | 51 | setName( tr("fileBrowser") ); |
52 | setCaption(tr( name ) ); | 52 | setCaption(tr( name ) ); |
53 | // mimeType = mimeFilter; | 53 | // mimeType = mimeFilter; |
54 | // MimeType mt( mimeType); | 54 | // MimeType mt( mimeType); |
55 | // if( mt.extension().isEmpty()) | 55 | // if( mt.extension().isEmpty()) |
56 | // QStringList filterList; | 56 | // QStringList filterList; |
57 | // filterList=QStringList::split(";",mimeFilter,FALSE); | 57 | // filterList=QStringList::split(";",mimeFilter,FALSE); |
58 | // for ( QStringList::Iterator it = filterList.begin(); it != filterList.end(); ++it ) { | 58 | // for ( QStringList::Iterator it = filterList.begin(); it != filterList.end(); ++it ) { |
59 | // printf( "%s \n", (*it).latin1() ); | 59 | // printf( "%s \n", (*it).latin1() ); |
@@ -115,17 +115,17 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags | |||
115 | 115 | ||
116 | ListView = new QListView( this, "ListView" ); | 116 | ListView = new QListView( this, "ListView" ); |
117 | // ListView->setMinimumSize( QSize( 100, 25 ) ); | 117 | // ListView->setMinimumSize( QSize( 100, 25 ) ); |
118 | ListView->addColumn( tr( "Name" ) ); | 118 | ListView->addColumn( tr( "Name" ) ); |
119 | ListView->setColumnWidth(0,120); | 119 | ListView->setColumnWidth(0,120); |
120 | ListView->setSorting( 2, FALSE); | 120 | ListView->setSorting( 2, FALSE); |
121 | ListView->addColumn( tr( "Size" ) ); | 121 | ListView->addColumn( tr( "Size" ) ); |
122 | ListView->setColumnWidth(1,-1); | 122 | ListView->setColumnWidth(1,-1); |
123 | ListView->addColumn( "Date",-1); | 123 | ListView->addColumn( tr("Date"),-1); |
124 | 124 | ||
125 | ListView->setColumnWidthMode(0,QListView::Manual); | 125 | ListView->setColumnWidthMode(0,QListView::Manual); |
126 | ListView->setColumnAlignment(1,QListView::AlignRight); | 126 | ListView->setColumnAlignment(1,QListView::AlignRight); |
127 | ListView->setColumnAlignment(2,QListView::AlignRight); | 127 | ListView->setColumnAlignment(2,QListView::AlignRight); |
128 | ListView->setAllColumnsShowFocus( TRUE ); | 128 | ListView->setAllColumnsShowFocus( TRUE ); |
129 | 129 | ||
130 | QPEApplication::setStylusOperation( ListView->viewport(),QPEApplication::RightOnHold); | 130 | QPEApplication::setStylusOperation( ListView->viewport(),QPEApplication::RightOnHold); |
131 | connect( ListView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 131 | connect( ListView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
@@ -343,24 +343,24 @@ void fileBrowser::docButtonPushed() { | |||
343 | currentDir.cd( current, TRUE); | 343 | currentDir.cd( current, TRUE); |
344 | populateList(); | 344 | populateList(); |
345 | update(); | 345 | update(); |
346 | 346 | ||
347 | } | 347 | } |
348 | 348 | ||
349 | void fileBrowser::selectionChanged( const QString &select ) | 349 | void fileBrowser::selectionChanged( const QString &select ) |
350 | { | 350 | { |
351 | if ( select == "Documents") { | 351 | if ( select == tr("Documents")) { |
352 | FileStack->raiseWidget( fileSelector ); | 352 | FileStack->raiseWidget( fileSelector ); |
353 | dirPathCombo->hide(); | 353 | dirPathCombo->hide(); |
354 | cdUpButton->hide(); | 354 | cdUpButton->hide(); |
355 | docButton->hide(); | 355 | docButton->hide(); |
356 | homeButton->hide(); | 356 | homeButton->hide(); |
357 | } else { | 357 | } else { |
358 | if ( select == "All files" ) | 358 | if ( select == tr("All files") ) |
359 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::All); | 359 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::All); |
360 | else | 360 | else |
361 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 361 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
362 | 362 | ||
363 | populateList(); | 363 | populateList(); |
364 | update(); | 364 | update(); |
365 | dirPathCombo->show(); | 365 | dirPathCombo->show(); |
366 | cdUpButton->show(); | 366 | cdUpButton->show(); |
@@ -407,60 +407,60 @@ void fileBrowser::showListMenu(QListViewItem *item) { | |||
407 | } | 407 | } |
408 | 408 | ||
409 | void fileBrowser::doCd() { | 409 | void fileBrowser::doCd() { |
410 | listClicked( ListView->currentItem()); | 410 | listClicked( ListView->currentItem()); |
411 | } | 411 | } |
412 | 412 | ||
413 | void fileBrowser::makDir() { | 413 | void fileBrowser::makDir() { |
414 | InputDialog *fileDlg; | 414 | InputDialog *fileDlg; |
415 | fileDlg = new InputDialog(this,"Make Directory",TRUE, 0); | 415 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); |
416 | fileDlg->exec(); | 416 | fileDlg->exec(); |
417 | if( fileDlg->result() == 1 ) { | 417 | if( fileDlg->result() == 1 ) { |
418 | QString filename = fileDlg->LineEdit1->text(); | 418 | QString filename = fileDlg->LineEdit1->text(); |
419 | qDebug("Make dir"); | 419 | qDebug("Make dir"); |
420 | currentDir.mkdir( currentDir.canonicalPath()+"/"+filename); | 420 | currentDir.mkdir( currentDir.canonicalPath()+"/"+filename); |
421 | } | 421 | } |
422 | populateList(); | 422 | populateList(); |
423 | } | 423 | } |
424 | 424 | ||
425 | void fileBrowser::localRename() { | 425 | void fileBrowser::localRename() { |
426 | QString curFile = ListView->currentItem()->text(0); | 426 | QString curFile = ListView->currentItem()->text(0); |
427 | InputDialog *fileDlg; | 427 | InputDialog *fileDlg; |
428 | fileDlg = new InputDialog(this,"Rename",TRUE, 0); | 428 | fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); |
429 | fileDlg->setTextEdit((const QString &) curFile); | 429 | fileDlg->setTextEdit((const QString &) curFile); |
430 | fileDlg->exec(); | 430 | fileDlg->exec(); |
431 | if( fileDlg->result() == 1 ) { | 431 | if( fileDlg->result() == 1 ) { |
432 | QString oldname = currentDir.canonicalPath() + "/" + curFile; | 432 | QString oldname = currentDir.canonicalPath() + "/" + curFile; |
433 | QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();//+".playlist"; | 433 | QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();//+".playlist"; |
434 | if( rename(oldname.latin1(), newName.latin1())== -1) | 434 | if( rename(oldname.latin1(), newName.latin1())== -1) |
435 | QMessageBox::message("Note","Could not rename"); | 435 | QMessageBox::message(tr("Note"),tr("Could not rename")); |
436 | } | 436 | } |
437 | populateList(); | 437 | populateList(); |
438 | } | 438 | } |
439 | 439 | ||
440 | void fileBrowser::localDelete() { | 440 | void fileBrowser::localDelete() { |
441 | QString f = ListView->currentItem()->text(0); | 441 | QString f = ListView->currentItem()->text(0); |
442 | if(QDir(f).exists() ) { | 442 | if(QDir(f).exists() ) { |
443 | switch ( QMessageBox::warning(this,"Delete","Do you really want to delete\n"+f+ | 443 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+ |
444 | " ?\nIt must be empty","Yes","No",0,0,1) ) { | 444 | tr(" ?\nIt must be empty"),tr("Yes"),tr("No"),0,0,1) ) { |
445 | case 0: { | 445 | case 0: { |
446 | f=currentDir.canonicalPath()+"/"+f; | 446 | f=currentDir.canonicalPath()+"/"+f; |
447 | QString cmd="rmdir "+f; | 447 | QString cmd="rmdir "+f; |
448 | system( cmd.latin1()); | 448 | system( cmd.latin1()); |
449 | populateList(); | 449 | populateList(); |
450 | } | 450 | } |
451 | break; | 451 | break; |
452 | case 1: | 452 | case 1: |
453 | // exit | 453 | // exit |
454 | break; | 454 | break; |
455 | }; | 455 | }; |
456 | } else { | 456 | } else { |
457 | switch ( QMessageBox::warning(this,"Delete","Do you really want to delete\n"+f | 457 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f |
458 | +" ?","Yes","No",0,0,1) ) { | 458 | +" ?",tr("Yes"),tr("No"),0,0,1) ) { |
459 | case 0: { | 459 | case 0: { |
460 | f=currentDir.canonicalPath()+"/"+f; | 460 | f=currentDir.canonicalPath()+"/"+f; |
461 | QString cmd="rm "+f; | 461 | QString cmd="rm "+f; |
462 | system( cmd.latin1()); | 462 | system( cmd.latin1()); |
463 | populateList(); | 463 | populateList(); |
464 | } | 464 | } |
465 | break; | 465 | break; |
466 | case 1: | 466 | case 1: |
@@ -488,17 +488,17 @@ void fileBrowser::updateMimeTypeMenu() { | |||
488 | // typemb->select(prev); | 488 | // typemb->select(prev); |
489 | 489 | ||
490 | connect(typemb, SIGNAL(selected(const QString&)), this, SLOT(showType(const QString&))); | 490 | connect(typemb, SIGNAL(selected(const QString&)), this, SLOT(showType(const QString&))); |
491 | } | 491 | } |
492 | 492 | ||
493 | void fileBrowser::showType(const QString &t) { | 493 | void fileBrowser::showType(const QString &t) { |
494 | 494 | ||
495 | qDebug(t); | 495 | qDebug(t); |
496 | if(t.find("All",0,TRUE) != -1) { | 496 | if(t.find(tr("All"),0,TRUE) != -1) { |
497 | filterStr = "*"; | 497 | filterStr = "*"; |
498 | } else { | 498 | } else { |
499 | QStringList list = mimetypes.grep( t,TRUE); | 499 | QStringList list = mimetypes.grep( t,TRUE); |
500 | QString ext; | 500 | QString ext; |
501 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | 501 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
502 | mimeType =(*it); | 502 | mimeType =(*it); |
503 | MimeType mt( mimeType); | 503 | MimeType mt( mimeType); |
504 | // qDebug("mime "+mimeType); | 504 | // qDebug("mime "+mimeType); |
@@ -600,17 +600,17 @@ void fileBrowser::fillCombo(const QString ¤tPath) { | |||
600 | } | 600 | } |
601 | } | 601 | } |
602 | 602 | ||
603 | 603 | ||
604 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 604 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
605 | : QDialog( parent, name, modal, fl ) | 605 | : QDialog( parent, name, modal, fl ) |
606 | { | 606 | { |
607 | if ( !name ) | 607 | if ( !name ) |
608 | setName( "InputDialog" ); | 608 | setName( tr("InputDialog") ); |
609 | resize( 234, 50 ); | 609 | resize( 234, 50 ); |
610 | setMaximumSize( QSize( 240, 50 ) ); | 610 | setMaximumSize( QSize( 240, 50 ) ); |
611 | setCaption( tr(name ) ); | 611 | setCaption( tr(name ) ); |
612 | 612 | ||
613 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 613 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
614 | LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); | 614 | LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); |
615 | } | 615 | } |
616 | 616 | ||
diff --git a/core/apps/textedit/filePermissions.cpp b/core/apps/textedit/filePermissions.cpp index 5af3971..def957b 100644 --- a/core/apps/textedit/filePermissions.cpp +++ b/core/apps/textedit/filePermissions.cpp | |||
@@ -30,18 +30,18 @@ | |||
30 | #include <sys/types.h> | 30 | #include <sys/types.h> |
31 | #include <pwd.h> | 31 | #include <pwd.h> |
32 | #include <grp.h> | 32 | #include <grp.h> |
33 | 33 | ||
34 | filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName ) | 34 | filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName ) |
35 | : QDialog( parent, name, modal, fl ) | 35 | : QDialog( parent, name, modal, fl ) |
36 | { | 36 | { |
37 | if ( !name ) | 37 | if ( !name ) |
38 | setName( "filePermissions" ); | 38 | setName( tr("filePermissions") ); |
39 | qDebug("FilePermissions "+fileName); | 39 | // qDebug("FilePermissions "+fileName); |
40 | resize( 236, 210 ); | 40 | resize( 236, 210 ); |
41 | setMaximumSize( QSize( 236, 210 ) ); | 41 | setMaximumSize( QSize( 236, 210 ) ); |
42 | setCaption( tr( "Set File Permissions" ) ); | 42 | setCaption( tr( "Set File Permissions" ) ); |
43 | 43 | ||
44 | TextLabel1 = new QLabel( this, "TextLabel1" ); | 44 | TextLabel1 = new QLabel( this, "TextLabel1" ); |
45 | TextLabel1->setGeometry( QRect( 25, 5, 175, 20 ) ); | 45 | TextLabel1->setGeometry( QRect( 25, 5, 175, 20 ) ); |
46 | TextLabel1->setText( tr( "Set file permissions for:" ) ); | 46 | TextLabel1->setText( tr( "Set file permissions for:" ) ); |
47 | 47 | ||
@@ -243,32 +243,32 @@ void filePermissions::wrldExeCheck() { | |||
243 | void filePermissions::accept() { | 243 | void filePermissions::accept() { |
244 | 244 | ||
245 | QFileInfo fi(file); | 245 | QFileInfo fi(file); |
246 | struct passwd *pwd=0; | 246 | struct passwd *pwd=0; |
247 | struct group *grp=0; | 247 | struct group *grp=0; |
248 | pwd = getpwnam(OwnerLineEdit->text().latin1() ); | 248 | pwd = getpwnam(OwnerLineEdit->text().latin1() ); |
249 | if(pwd == NULL) { | 249 | if(pwd == NULL) { |
250 | perror("getpwnam"); | 250 | perror("getpwnam"); |
251 | QMessageBox::warning(this,"Warning","Error- no user"); | 251 | QMessageBox::warning(this,tr("Warning"),tr("Error- no user")); |
252 | return; | 252 | return; |
253 | } else { | 253 | } else { |
254 | grp = getgrnam(GroupLineEdit->text().latin1()); | 254 | grp = getgrnam(GroupLineEdit->text().latin1()); |
255 | if(grp==NULL) { | 255 | if(grp==NULL) { |
256 | perror("getgrnam"); | 256 | perror("getgrnam"); |
257 | QMessageBox::warning(this,"Warning","Error- no group"); | 257 | QMessageBox::warning(this,tr("Warning"),tr("Error- no group")); |
258 | return; | 258 | return; |
259 | } | 259 | } |
260 | if( chown( file.latin1(), pwd->pw_uid, grp->gr_gid) <0) { | 260 | if( chown( file.latin1(), pwd->pw_uid, grp->gr_gid) <0) { |
261 | perror("chown"); | 261 | perror("chown"); |
262 | QMessageBox::warning(this,"Warning","Error setting ownership or group"); | 262 | QMessageBox::warning(this,tr("Warning"),tr("Error setting ownership or group")); |
263 | return; | 263 | return; |
264 | } | 264 | } |
265 | bool ok; | 265 | bool ok; |
266 | uint moder = modeStr.toUInt(&ok,8); | 266 | uint moder = modeStr.toUInt(&ok,8); |
267 | if( chmod( file.latin1(), moder) < 0) { | 267 | if( chmod( file.latin1(), moder) < 0) { |
268 | perror("chmod"); | 268 | perror("chmod"); |
269 | QMessageBox::warning(this,"Warning","Error setting mode"); | 269 | QMessageBox::warning(this,tr("Warning"),tr("Error setting mode")); |
270 | return; | 270 | return; |
271 | } | 271 | } |
272 | } | 272 | } |
273 | close(); | 273 | close(); |
274 | } | 274 | } |
diff --git a/core/apps/textedit/fileSaver.cpp b/core/apps/textedit/fileSaver.cpp index f2a5355..b1ddc0b 100644 --- a/core/apps/textedit/fileSaver.cpp +++ b/core/apps/textedit/fileSaver.cpp | |||
@@ -25,17 +25,17 @@ | |||
25 | #include <qcheckbox.h> | 25 | #include <qcheckbox.h> |
26 | 26 | ||
27 | #include <unistd.h> | 27 | #include <unistd.h> |
28 | 28 | ||
29 | fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl , const QString currentFileName ) | 29 | fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl , const QString currentFileName ) |
30 | : QDialog( parent, name, modal, fl ) | 30 | : QDialog( parent, name, modal, fl ) |
31 | { | 31 | { |
32 | if ( !name ) | 32 | if ( !name ) |
33 | setName( "fileSaver" ); | 33 | setName( tr("fileSaver")); |
34 | resize( 240, 280 ); | 34 | resize( 240, 280 ); |
35 | setCaption(tr( name ) ); | 35 | setCaption(tr( name ) ); |
36 | QFileInfo fi(currentFileName); | 36 | QFileInfo fi(currentFileName); |
37 | QString tmpFileName=fi.fileName(); | 37 | QString tmpFileName=fi.fileName(); |
38 | // qDebug( tmpFileName); | 38 | // qDebug( tmpFileName); |
39 | dirLabel = new QLabel(this, "DirLabel"); | 39 | dirLabel = new QLabel(this, "DirLabel"); |
40 | dirLabel->setText(currentDir.canonicalPath()); | 40 | dirLabel->setText(currentDir.canonicalPath()); |
41 | dirLabel->setGeometry(10,20,230,15); | 41 | dirLabel->setGeometry(10,20,230,15); |
@@ -58,33 +58,33 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl | |||
58 | hideButton->setFlat(TRUE); | 58 | hideButton->setFlat(TRUE); |
59 | 59 | ||
60 | ListView = new QListView( this, "ListView" ); | 60 | ListView = new QListView( this, "ListView" ); |
61 | ListView->addColumn( tr( "Name" ) ); | 61 | ListView->addColumn( tr( "Name" ) ); |
62 | ListView->setColumnWidth(0,120); | 62 | ListView->setColumnWidth(0,120); |
63 | ListView->setSorting( 2, FALSE); | 63 | ListView->setSorting( 2, FALSE); |
64 | ListView->addColumn( tr( "Size" ) ); | 64 | ListView->addColumn( tr( "Size" ) ); |
65 | ListView->setColumnWidth(1,-1); | 65 | ListView->setColumnWidth(1,-1); |
66 | ListView->addColumn( "Date",-1); | 66 | ListView->addColumn( tr("Date"),-1); |
67 | 67 | ||
68 | ListView->setColumnWidthMode(0,QListView::Manual); | 68 | ListView->setColumnWidthMode(0,QListView::Manual); |
69 | ListView->setColumnAlignment(1,QListView::AlignRight); | 69 | ListView->setColumnAlignment(1,QListView::AlignRight); |
70 | // ListView->setMultiSelection(true); | 70 | // ListView->setMultiSelection(true); |
71 | // ListView->setSelectionMode(QListView::Extended); | 71 | // ListView->setSelectionMode(QListView::Extended); |
72 | 72 | ||
73 | ListView->setAllColumnsShowFocus( TRUE ); | 73 | ListView->setAllColumnsShowFocus( TRUE ); |
74 | ListView->setGeometry( QRect( 10,35,220,125)); | 74 | ListView->setGeometry( QRect( 10,35,220,125)); |
75 | 75 | ||
76 | fileEdit= new QLineEdit(this); | 76 | fileEdit= new QLineEdit(this); |
77 | fileEdit->setGeometry( QRect( 10, 162, 205, 17)); | 77 | fileEdit->setGeometry( QRect( 10, 162, 205, 17)); |
78 | 78 | ||
79 | fileEdit->setText( tmpFileName); | 79 | fileEdit->setText( tmpFileName); |
80 | 80 | ||
81 | filePermCheck = new QCheckBox( this, "SetFilePerms" ); | 81 | filePermCheck = new QCheckBox( this, "SetFilePerms" ); |
82 | filePermCheck->setText("set file permissions"); | 82 | filePermCheck->setText(tr("set file permissions")); |
83 | filePermCheck->setGeometry(10, 178, 150,17); | 83 | filePermCheck->setGeometry(10, 178, 150,17); |
84 | // signals and slots connections | 84 | // signals and slots connections |
85 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); | 85 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); |
86 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); | 86 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); |
87 | 87 | ||
88 | // tmpFileName=fi.FilePath(); | 88 | // tmpFileName=fi.FilePath(); |
89 | // qDebug( tmpFileName); | 89 | // qDebug( tmpFileName); |
90 | currentDir.setPath( QDir::currentDirPath() ); | 90 | currentDir.setPath( QDir::currentDirPath() ); |
diff --git a/core/apps/textedit/fontDialog.cpp b/core/apps/textedit/fontDialog.cpp index e7bd924..681e8a6 100644 --- a/core/apps/textedit/fontDialog.cpp +++ b/core/apps/textedit/fontDialog.cpp | |||
@@ -30,17 +30,17 @@ copyright 2002 by L.J. Potter ljp@llornkcor.com | |||
30 | #include <qvariant.h> | 30 | #include <qvariant.h> |
31 | #include <qtooltip.h> | 31 | #include <qtooltip.h> |
32 | #include <qwhatsthis.h> | 32 | #include <qwhatsthis.h> |
33 | 33 | ||
34 | FontDialog::FontDialog( QWidget * parent, const char* name , bool modal, WFlags fl ) | 34 | FontDialog::FontDialog( QWidget * parent, const char* name , bool modal, WFlags fl ) |
35 | :QDialog /*QWidget*/( parent, name , modal, fl ) | 35 | :QDialog /*QWidget*/( parent, name , modal, fl ) |
36 | { | 36 | { |
37 | if ( !name ) | 37 | if ( !name ) |
38 | setName( "FontDialog" ); | 38 | setName( tr("FontDialog") ); |
39 | setCaption( tr( "Font Dialog" ) ); | 39 | setCaption( tr( "Font Dialog" ) ); |
40 | FontTextLabel4 = new QLabel( this, "TextLabel4" ); | 40 | FontTextLabel4 = new QLabel( this, "TextLabel4" ); |
41 | FontTextLabel4->setGeometry( QRect( 145, 100, 30, 19 /*192, 0, 43, 19*/ ) ); | 41 | FontTextLabel4->setGeometry( QRect( 145, 100, 30, 19 /*192, 0, 43, 19*/ ) ); |
42 | FontTextLabel4->setText( tr( "Size" ) ); | 42 | FontTextLabel4->setText( tr( "Size" ) ); |
43 | 43 | ||
44 | FamilyGroup = new QGroupBox( this, "FamilyGroup" ); | 44 | FamilyGroup = new QGroupBox( this, "FamilyGroup" ); |
45 | FamilyGroup->setGeometry( QRect( 5, 5, 115, 135 /*0, 6, 185, 131 */) ); | 45 | FamilyGroup->setGeometry( QRect( 5, 5, 115, 135 /*0, 6, 185, 131 */) ); |
46 | FamilyGroup->setTitle( tr( "Font" ) ); | 46 | FamilyGroup->setTitle( tr( "Font" ) ); |
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index d28ece8..6804918 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -330,17 +330,17 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) | |||
330 | #endif | 330 | #endif |
331 | 331 | ||
332 | QAction *wa = new QAction( tr("Wrap lines"), QString::null, 0, this, 0 ); | 332 | QAction *wa = new QAction( tr("Wrap lines"), QString::null, 0, this, 0 ); |
333 | connect( wa, SIGNAL( toggled(bool) ), this, SLOT( setWordWrap(bool) ) ); | 333 | connect( wa, SIGNAL( toggled(bool) ), this, SLOT( setWordWrap(bool) ) ); |
334 | wa->setToggleAction(TRUE); | 334 | wa->setToggleAction(TRUE); |
335 | wa->addTo( font ); | 335 | wa->addTo( font ); |
336 | 336 | ||
337 | font->insertSeparator(); | 337 | font->insertSeparator(); |
338 | font->insertItem("Font", this, SLOT(changeFont()) ); | 338 | font->insertItem(tr("Font"), this, SLOT(changeFont()) ); |
339 | 339 | ||
340 | font->insertSeparator(); | 340 | font->insertSeparator(); |
341 | nStart = new QAction( tr("Start with new file"), QString::null, 0, this, 0 ); | 341 | nStart = new QAction( tr("Start with new file"), QString::null, 0, this, 0 ); |
342 | connect( nStart, SIGNAL( toggled(bool) ), this, SLOT( changeStartConfig(bool) ) ); | 342 | connect( nStart, SIGNAL( toggled(bool) ), this, SLOT( changeStartConfig(bool) ) ); |
343 | nStart->setToggleAction(TRUE); | 343 | nStart->setToggleAction(TRUE); |
344 | nStart->addTo( font ); | 344 | nStart->addTo( font ); |
345 | 345 | ||
346 | mb->insertItem( tr( "File" ), file ); | 346 | mb->insertItem( tr( "File" ), file ); |
@@ -488,17 +488,17 @@ void TextEdit::fileNew() | |||
488 | if( !bFromDocView ) { | 488 | if( !bFromDocView ) { |
489 | saveAs(); | 489 | saveAs(); |
490 | } | 490 | } |
491 | newFile(DocLnk()); | 491 | newFile(DocLnk()); |
492 | } | 492 | } |
493 | 493 | ||
494 | void TextEdit::fileOpen() | 494 | void TextEdit::fileOpen() |
495 | { | 495 | { |
496 | browseForFiles=new fileBrowser(this,"Open File",TRUE,0, "text/*"); // | 496 | browseForFiles=new fileBrowser(this,tr("Open File"),TRUE,0, "text/*"); // |
497 | browseForFiles->setFileView( viewSelection ); | 497 | browseForFiles->setFileView( viewSelection ); |
498 | browseForFiles->showMaximized(); | 498 | browseForFiles->showMaximized(); |
499 | if( browseForFiles->exec() != -1 ) { | 499 | if( browseForFiles->exec() != -1 ) { |
500 | QString selFile = browseForFiles->selectedFileName; | 500 | QString selFile = browseForFiles->selectedFileName; |
501 | QStringList fileList = browseForFiles->fileList; | 501 | QStringList fileList = browseForFiles->fileList; |
502 | qDebug(selFile); | 502 | qDebug(selFile); |
503 | QStringList::ConstIterator f; | 503 | QStringList::ConstIterator f; |
504 | QString fileTemp; | 504 | QString fileTemp; |
@@ -529,17 +529,17 @@ void TextEdit::doSearchBar() | |||
529 | cfg.setGroup("View"); | 529 | cfg.setGroup("View"); |
530 | if(cfg.readEntry("SearchBar","Closed") != "Opened") | 530 | if(cfg.readEntry("SearchBar","Closed") != "Opened") |
531 | searchBar->hide(); | 531 | searchBar->hide(); |
532 | } | 532 | } |
533 | 533 | ||
534 | #if 0 | 534 | #if 0 |
535 | void TextEdit::slotFind() | 535 | void TextEdit::slotFind() |
536 | { | 536 | { |
537 | FindDialog frmFind( "Text Editor", this ); | 537 | FindDialog frmFind( tr("Text Editor"), this ); |
538 | connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), | 538 | connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), |
539 | editor, SLOT(slotDoFind( const QString&,bool,bool))); | 539 | editor, SLOT(slotDoFind( const QString&,bool,bool))); |
540 | 540 | ||
541 | //case sensitive, backwards, [category] | 541 | //case sensitive, backwards, [category] |
542 | 542 | ||
543 | connect( editor, SIGNAL(notFound()), | 543 | connect( editor, SIGNAL(notFound()), |
544 | &frmFind, SLOT(slotNotFound()) ); | 544 | &frmFind, SLOT(slotNotFound()) ); |
545 | connect( editor, SIGNAL(searchWrapped()), | 545 | connect( editor, SIGNAL(searchWrapped()), |
@@ -742,40 +742,40 @@ bool TextEdit::saveAs() | |||
742 | delete doc; | 742 | delete doc; |
743 | doc = 0; | 743 | doc = 0; |
744 | return true; | 744 | return true; |
745 | } | 745 | } |
746 | 746 | ||
747 | QString rt = editor->text(); | 747 | QString rt = editor->text(); |
748 | qDebug(currentFileName); | 748 | qDebug(currentFileName); |
749 | 749 | ||
750 | if( currentFileName.isEmpty() || currentFileName == "Unnamed") { | 750 | if( currentFileName.isEmpty() || currentFileName == tr("Unnamed")) { |
751 | qDebug("do silly TT filename thing"); | 751 | qDebug("do silly TT filename thing"); |
752 | if ( doc->name().isEmpty() ) { | 752 | if ( doc->name().isEmpty() ) { |
753 | QString pt = rt.simplifyWhiteSpace(); | 753 | QString pt = rt.simplifyWhiteSpace(); |
754 | int i = pt.find( ' ' ); | 754 | int i = pt.find( ' ' ); |
755 | QString docname = pt; | 755 | QString docname = pt; |
756 | if ( i > 0 ) | 756 | if ( i > 0 ) |
757 | docname = pt.left( i ); | 757 | docname = pt.left( i ); |
758 | // remove "." at the beginning | 758 | // remove "." at the beginning |
759 | while( docname.startsWith( "." ) ) | 759 | while( docname.startsWith( "." ) ) |
760 | docname = docname.mid( 1 ); | 760 | docname = docname.mid( 1 ); |
761 | docname.replace( QRegExp("/"), "_" ); | 761 | docname.replace( QRegExp("/"), "_" ); |
762 | // cut the length. filenames longer than that don't make sense and something goes wrong when they get too long. | 762 | // cut the length. filenames longer than that don't make sense and something goes wrong when they get too long. |
763 | if ( docname.length() > 40 ) | 763 | if ( docname.length() > 40 ) |
764 | docname = docname.left(40); | 764 | docname = docname.left(40); |
765 | if ( docname.isEmpty() ) | 765 | if ( docname.isEmpty() ) |
766 | docname = "Unnamed"; | 766 | docname = tr("Unnamed"); |
767 | doc->setName(docname); | 767 | doc->setName(docname); |
768 | currentFileName=docname; | 768 | currentFileName=docname; |
769 | } | 769 | } |
770 | } | 770 | } |
771 | 771 | ||
772 | 772 | ||
773 | fileSaveDlg=new fileSaver(this,"Save File As?",TRUE, 0, currentFileName); | 773 | fileSaveDlg=new fileSaver(this,tr("Save File As?"),TRUE, 0, currentFileName); |
774 | qDebug("wanna save filename "+currentFileName); | 774 | qDebug("wanna save filename "+currentFileName); |
775 | fileSaveDlg->exec(); | 775 | fileSaveDlg->exec(); |
776 | if( fileSaveDlg->result() == 1 ) { | 776 | if( fileSaveDlg->result() == 1 ) { |
777 | QString fileNm=fileSaveDlg->selectedFileName; | 777 | QString fileNm=fileSaveDlg->selectedFileName; |
778 | qDebug("saving filename "+fileNm); | 778 | qDebug("saving filename "+fileNm); |
779 | QFileInfo fi(fileNm); | 779 | QFileInfo fi(fileNm); |
780 | currentFileName=fi.fileName(); | 780 | currentFileName=fi.fileName(); |
781 | if(doc) { | 781 | if(doc) { |
@@ -792,17 +792,17 @@ bool TextEdit::saveAs() | |||
792 | updateCaption( currentFileName); | 792 | updateCaption( currentFileName); |
793 | 793 | ||
794 | FileManager fm; | 794 | FileManager fm; |
795 | if ( !fm.saveFile( *doc, rt ) ) { | 795 | if ( !fm.saveFile( *doc, rt ) ) { |
796 | return false; | 796 | return false; |
797 | } | 797 | } |
798 | if( fileSaveDlg->filePermCheck->isChecked() ) { | 798 | if( fileSaveDlg->filePermCheck->isChecked() ) { |
799 | filePermissions *filePerm; | 799 | filePermissions *filePerm; |
800 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)fileNm); | 800 | filePerm = new filePermissions(this, tr("Permissions"),true,0,(const QString &)fileNm); |
801 | filePerm->exec(); | 801 | filePerm->exec(); |
802 | 802 | ||
803 | if( filePerm) | 803 | if( filePerm) |
804 | delete filePerm; | 804 | delete filePerm; |
805 | } | 805 | } |
806 | } | 806 | } |
807 | } | 807 | } |
808 | editor->setEdited(TRUE); | 808 | editor->setEdited(TRUE); |
@@ -883,29 +883,29 @@ void TextEdit::changeFont() { | |||
883 | QString family = cfg.readEntry("Family", fontInfo.family()); | 883 | QString family = cfg.readEntry("Family", fontInfo.family()); |
884 | QString style = cfg.readEntry("Style", fdb.styleString(defaultFont)); | 884 | QString style = cfg.readEntry("Style", fdb.styleString(defaultFont)); |
885 | int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10); | 885 | int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10); |
886 | QString charSet = cfg.readEntry("CharSet", QFont::encodingName( fontInfo.charSet()) ); | 886 | QString charSet = cfg.readEntry("CharSet", QFont::encodingName( fontInfo.charSet()) ); |
887 | 887 | ||
888 | defaultFont = fdb.font(family,style,i_size,charSet); | 888 | defaultFont = fdb.font(family,style,i_size,charSet); |
889 | 889 | ||
890 | FontDialog *fontDlg; | 890 | FontDialog *fontDlg; |
891 | fontDlg=new FontDialog(this,"FontDialog",TRUE); | 891 | fontDlg=new FontDialog(this,tr("FontDialog"),TRUE); |
892 | 892 | ||
893 | fontDlg->exec(); | 893 | fontDlg->exec(); |
894 | 894 | ||
895 | QFont myFont=fontDlg->selectedFont; | 895 | QFont myFont=fontDlg->selectedFont; |
896 | editor->setFont( myFont); | 896 | editor->setFont( myFont); |
897 | delete fontDlg; | 897 | delete fontDlg; |
898 | 898 | ||
899 | } | 899 | } |
900 | 900 | ||
901 | void TextEdit::editDelete() | 901 | void TextEdit::editDelete() |
902 | { | 902 | { |
903 | switch ( QMessageBox::warning(this,"Text Editor","Do you really want\nto delete the current file\nfrom the disk?\nThis is irreversable!!","Yes","No",0,0,1) ) { | 903 | switch ( QMessageBox::warning(this,tr("Text Editor"),tr("Do you really want\nto delete the current file\nfrom the disk?\nThis is irreversable!!"),tr("Yes"),tr("No"),0,0,1) ) { |
904 | case 0: | 904 | case 0: |
905 | if(doc) { | 905 | if(doc) { |
906 | doc->removeFiles(); | 906 | doc->removeFiles(); |
907 | clear(); | 907 | clear(); |
908 | setCaption( tr("Text Editor") ); | 908 | setCaption( tr("Text Editor") ); |
909 | } | 909 | } |
910 | break; | 910 | break; |
911 | case 1: | 911 | case 1: |