Changeset 834
- Timestamp:
- 08/18/08 16:26:26 (3 months ago)
- Location:
- mcbuilder/trunk
- Files:
-
- 2 added
- 7 modified
-
mcbuilder.pro (modified) (2 diffs)
-
src/About.cpp (modified) (1 diff)
-
src/AppUpdater.cpp (modified) (4 diffs)
-
src/Builder.cpp (modified) (8 diffs)
-
src/MainWindow.cpp (modified) (25 diffs)
-
src/Uploader.cpp (modified) (3 diffs)
-
src/main.cpp (modified) (2 diffs)
-
translations (added)
-
translations/mcbuilder_fr.ts (added)
Legend:
- Unmodified
- Added
- Removed
-
mcbuilder/trunk/mcbuilder.pro
r799 r834 1 MCBUILDER_VERSION = "0. 2.0"1 MCBUILDER_VERSION = "0.5.0" 2 2 TEMPLATE = app 3 3 #CONFIG += release … … 39 39 src/BuildLog.cpp \ 40 40 src/ProjectManager.cpp 41 42 TRANSLATIONS = translations/mcbuilder_fr.ts 41 43 42 44 TARGET = mcbuilder -
mcbuilder/trunk/src/About.cpp
r797 r834 28 28 verticalLayout->addWidget(&body); 29 29 body.setOpenExternalLinks(true); 30 versionLabel->setText( QString("<font size=6>mcbuilder</font><br>Version %1").arg(MCBUILDER_VERSION));31 body.append( QString("By <a href=\"http://www.makingthings.com\">MakingThings</a>, %1.<br>").arg(QDate::currentDate().toString("yyyy")));32 body.append( "Thanks to Erik Gilling for <a href=\"http://oss.tekno.us/sam7utils\">sam7utils</a>.<br>");33 body.append( "Thanks to Michael Fischer for <a href=\"http://www.yagarto.de\">Yagarto</a>.<br>");34 body.append( "Application icon by <a href=\"http://cultivatestudios.com\">Cultivate Studios</a>.<br>");35 body.append( "Toolbar icons by <a href=\"http://www.mattballdesign.com\">Matt Ball</a> and <a href=\"http://cultivatestudios.com\">Cultivate Studios</a>.");30 versionLabel->setText(tr("<font size=6>mcbuilder</font><br>Version %1").arg(MCBUILDER_VERSION)); 31 body.append(tr("By <a href=\"http://www.makingthings.com\">MakingThings</a>, %1.<br>").arg(QDate::currentDate().toString("yyyy"))); 32 body.append(tr("Thanks to Erik Gilling for <a href=\"http://oss.tekno.us/sam7utils\">sam7utils</a>.<br>")); 33 body.append(tr("Thanks to Michael Fischer for <a href=\"http://www.yagarto.de\">Yagarto</a>.<br>")); 34 body.append(tr("Application icon by <a href=\"http://cultivatestudios.com\">Cultivate Studios</a>.<br>")); 35 body.append(tr("Toolbar icons by <a href=\"http://www.mattballdesign.com\">Matt Ball</a> and <a href=\"http://cultivatestudios.com\">Cultivate Studios</a>.")); 36 36 } 37 37 -
mcbuilder/trunk/src/AppUpdater.cpp
r805 r834 32 32 { 33 33 setModal( true ); 34 setWindowTitle( "Software Update");34 setWindowTitle( tr("Software Update") ); 35 35 36 36 acceptButton.setDefault( true ); … … 82 82 if (!doc.setContent(http.readAll(), true, &err, &line, &col)) 83 83 { 84 headline.setText( "<font size=4>Couldn't contact the update server...</font>");85 details.setText( QString( "Make sure you're connected to the internet." ) );84 headline.setText( tr("<font size=4>Couldn't contact the update server...</font>") ); 85 details.setText( tr( "Make sure you're connected to the internet." ) ); 86 86 acceptButton.setText( tr("OK") ); 87 87 acceptButton.disconnect( ); // make sure it wasn't connected by anything else previously … … 133 133 if( updateAvailable ) 134 134 { 135 headline.setText( "<font size=4>A new version of mcbuilder is available!</font>");136 QString d = QString( "mcbuilder %1 is now available (you have %2). Would you like to download it?" )135 headline.setText( tr("<font size=4>A new version of mcbuilder is available!</font>" )); 136 QString d = tr( "mcbuilder %1 is now available (you have %2). Would you like to download it?" ) 137 137 .arg(latest.first).arg( MCBUILDER_VERSION ); 138 138 details.setText( d ); … … 152 152 else 153 153 { 154 headline.setText( "<font size=4>You're up to date!</font>");155 details.setText( QString( "You're running the latest version of mcbuilder, version %1." ).arg( MCBUILDER_VERSION ) );154 headline.setText( tr("<font size=4>You're up to date!</font>") ); 155 details.setText( tr( "You're running the latest version of mcbuilder, version %1." ).arg( MCBUILDER_VERSION ) ); 156 156 acceptButton.setText( tr("OK") ); 157 157 acceptButton.disconnect( ); -
mcbuilder/trunk/src/Builder.cpp
r807 r834 54 54 { 55 55 createConfigFile(currentProjectPath); // create a config file based on the Properties for this project 56 qDebug(" creating/updating config file");56 qDebug("builder - creating/updating config file"); 57 57 } 58 58 createMakefile(currentProjectPath); // create a Makefile for this project, given the dependencies … … 138 138 if(filesize <= 256000) 139 139 { 140 mainWindow->printOutput( QString("%1.bin is %2 out of a possible 256000 bytes.").arg(projectName).arg(filesize));140 mainWindow->printOutput(tr("%1.bin is %2 out of a possible 256000 bytes.").arg(projectName).arg(filesize)); 141 141 mainWindow->onBuildComplete(true); 142 142 success = true; 143 143 } 144 144 else 145 mainWindow->printOutputError( QString("Error - %1.bin is too big! %2 out of a possible 256000 bytes.").arg(projectName).arg(filesize));145 mainWindow->printOutputError(tr("Error - %1.bin is too big! %2 out of a possible 256000 bytes.").arg(projectName).arg(filesize)); 146 146 } 147 147 if(!success) … … 181 181 QTextStream tofile(&makefile); 182 182 tofile << "##################################################################################################" << endl; 183 tofile << "#" << endl << "# This file generated automatically by mcbuilder - ";183 tofile << "#" << endl << tr("# This file generated automatically by mcbuilder - "); 184 184 tofile << QDateTime::currentDateTime().toString("MMM d, yyyy h:m ap") << endl; 185 tofile << "# Any manual changes made to this file will be overwritten the next time mcbuilder builds."<< endl << "#" << endl;185 tofile << tr("# Any manual changes made to this file will be overwritten the next time mcbuilder builds.") << endl << "#" << endl; 186 186 tofile << "##################################################################################################" << endl << endl; 187 187 … … 349 349 tofile << "/*****************************************************************************************" << endl << endl; 350 350 tofile << " config.h" << endl; 351 tofile << " Generated automatically by mcbuilder - "<< QDateTime::currentDateTime().toString("MMM d, yyyy h:m ap") << endl;352 tofile << " Any manual changes made to this file will be overwritten the next time mcbuilder builds."<< endl << endl;351 tofile << tr(" Generated automatically by mcbuilder - ") << QDateTime::currentDateTime().toString("MMM d, yyyy h:m ap") << endl; 352 tofile << tr(" Any manual changes made to this file will be overwritten the next time mcbuilder builds.") << endl << endl; 353 353 tofile << "******************************************************************************************/" << endl << endl; 354 354 … … 546 546 { 547 547 case QProcess::FailedToStart: 548 msg = QString("'%1' failed to start. It's either missing, or doesn't have the correct permissions").arg(currentProcess);548 msg = tr("'%1' failed to start. It's either missing, or doesn't have the correct permissions").arg(currentProcess); 549 549 break; 550 550 case QProcess::Crashed: 551 msg = QString("'%1' was canceled or crashed.").arg(currentProcess);551 msg = tr("'%1' was canceled or crashed.").arg(currentProcess); 552 552 break; 553 553 case QProcess::Timedout: 554 msg = QString("'%1' timed out.").arg(currentProcess);554 msg = tr("'%1' timed out.").arg(currentProcess); 555 555 break; 556 556 case QProcess::WriteError: 557 msg = QString("'%1' reported a write error.").arg(currentProcess);557 msg = tr("'%1' reported a write error.").arg(currentProcess); 558 558 break; 559 559 case QProcess::ReadError: 560 msg = QString("'%1' reported a read error.").arg(currentProcess);560 msg = tr("'%1' reported a read error.").arg(currentProcess); 561 561 break; 562 562 case QProcess::UnknownError: 563 msg = QString("'%1' - unknown error type.").arg(currentProcess);564 break; 565 } 566 mainWindow->printOutputError( "Error: "+ msg);563 msg = tr("'%1' - unknown error type.").arg(currentProcess); 564 break; 565 } 566 mainWindow->printOutputError(tr("Error: ") + msg); 567 567 resetBuildProcess(); 568 568 mainWindow->onBuildComplete(false); … … 676 676 QFileInfo fi(filepath); 677 677 ConsoleItem *item; 678 QString fullmsg = QString("%1 (line %2): %3").arg(fi.fileName()).arg(linenumber).arg(msg);678 QString fullmsg = tr("%1 (line %2): %3").arg(fi.fileName()).arg(linenumber).arg(msg); 679 679 if(severity == "error") 680 680 { … … 713 713 //qDebug("cap! %s: In function %s", qPrintable(filepath), qPrintable(func)); 714 714 QFileInfo fi(filepath); 715 QString fullmsg = QString("%1: In function %2").arg(fi.fileName()).arg(func);715 QString fullmsg = tr("%1: In function %2").arg(fi.fileName()).arg(func); 716 716 mainWindow->printOutputError(fullmsg); 717 717 pos += errExp.matchedLength(); // step the index past the match so we can continue looking … … 738 738 //qDebug("cap! %s: In function %s", qPrintable(filepath), qPrintable(func)); 739 739 QFileInfo fi(filepath); 740 QString fullmsg = QString("Error - in %1: Undefined reference to %2").arg(fi.fileName()).arg(func);740 QString fullmsg = tr("Error - in %1: Undefined reference to %2").arg(fi.fileName()).arg(func); 741 741 mainWindow->printOutputError(fullmsg); 742 742 pos += errExp.matchedLength(); // step the index past the match so we can continue looking -
mcbuilder/trunk/src/MainWindow.cpp
r833 r834 221 221 editor->setExtraSelections( extras ); 222 222 223 statusBar()->showMessage( QString("Line: %1 Column: %2").arg(c.blockNumber()+1).arg(c.columnNumber()));223 statusBar()->showMessage( tr("Line: %1 Column: %2").arg(c.blockNumber()+1).arg(c.columnNumber())); 224 224 } 225 225 … … 361 361 if(currentProject.isEmpty()) 362 362 { 363 statusBar()->showMessage( "Need to open a project first. Open or create a new one from the File menu.", 3500 );363 statusBar()->showMessage( tr("Need to open a project first. Open or create a new one from the File menu."), 3500 ); 364 364 return; 365 365 } … … 426 426 QTextStream out(&file); 427 427 out << QString("// %1").arg(fi.fileName()) << endl; 428 out << QString("// created %1").arg(QDate::currentDate().toString("MMM d, yyyy") ) << endl << endl;428 out << tr("// created %1").arg(QDate::currentDate().toString("MMM d, yyyy") ) << endl << endl; 429 429 file.close(); 430 430 editorLoadFile(fi.filePath()); … … 449 449 else 450 450 { 451 QString message = QString("Couldn't find %1.").arg(file.fileName());451 QString message = tr("Couldn't find %1.").arg(file.fileName()); 452 452 currentFileDropDown->removeItem(currentFileDropDown->findText(file.fileName())); 453 453 statusBar()->showMessage(message, 3000); … … 495 495 QString projectName = projectDir.dirName(); 496 496 if(!projectDir.exists()) 497 return statusBar()->showMessage( QString("Couldn't find %1.").arg(projectName), 3500 );497 return statusBar()->showMessage( tr("Couldn't find %1.").arg(projectName), 3500 ); 498 498 499 499 QString pathname = projectName; // filename should not have spaces … … 534 534 } 535 535 else 536 return statusBar()->showMessage( QString("Couldn't find main file for %1.").arg(projectName), 3500 );536 return statusBar()->showMessage( tr("Couldn't find main file for %1.").arg(projectName), 3500 ); 537 537 } 538 538 … … 577 577 { 578 578 if(currentFile.isEmpty()) 579 return statusBar()->showMessage( "Need to open a file or project first. Open or create a new one from the File menu.", 3500 );579 return statusBar()->showMessage( tr("Need to open a file or project first. Open or create a new one from the File menu."), 3500 ); 580 580 save( ); 581 581 } … … 599 599 else 600 600 { 601 statusBar()->showMessage( "Couldn't save...maybe the current file has been moved or deleted.", 3500 );601 statusBar()->showMessage( tr("Couldn't save...maybe the current file has been moved or deleted."), 3500 ); 602 602 return false; 603 603 } … … 633 633 { 634 634 if(currentFile.isEmpty()) 635 return statusBar()->showMessage( "Need to open a project first. Open or create a new one from the File menu.", 3500 );635 return statusBar()->showMessage( tr("Need to open a project first. Open or create a new one from the File menu."), 3500 ); 636 636 637 637 QString newFileName = QFileDialog::getSaveFileName(this, tr("Save As"), … … 684 684 { 685 685 if(currentProject.isEmpty()) 686 return statusBar()->showMessage( "Open a project to build, or create a new one from the File menu.", 3500 );686 return statusBar()->showMessage( tr("Open a project to build, or create a new one from the File menu."), 3500 ); 687 687 if(!maybeSave( )) 688 688 return; … … 694 694 } 695 695 else 696 return statusBar()->showMessage( "Builder is currently busy...give it a second, then try again.", 3500 );696 return statusBar()->showMessage( tr("Builder is currently busy...give it a second, then try again."), 3500 ); 697 697 } 698 698 … … 715 715 if(success) 716 716 { 717 outputConsole->addItem(new QListWidgetItem(QIcon(":/icons/success.png"), "Build succeeded.", outputConsole));717 outputConsole->addItem(new QListWidgetItem(QIcon(":/icons/success.png"), tr("Build succeeded."), outputConsole)); 718 718 outputConsole->scrollToBottom(); 719 statusBar()->showMessage( "Build succeeded.");719 statusBar()->showMessage(tr("Build succeeded.")); 720 720 } 721 721 else 722 722 { 723 outputConsole->addItem(new QListWidgetItem(QIcon(":/icons/error.png"), "Build failed.", outputConsole));723 outputConsole->addItem(new QListWidgetItem(QIcon(":/icons/error.png"), tr("Build failed."), outputConsole)); 724 724 outputConsole->scrollToBottom(); 725 statusBar()->showMessage( "Build failed.");725 statusBar()->showMessage(tr("Build failed.")); 726 726 } 727 727 actionStop->setEnabled(false); … … 732 732 if(success) 733 733 { 734 outputConsole->addItem(new QListWidgetItem(QIcon(":/icons/success.png"), "Upload succeeded.", outputConsole));734 outputConsole->addItem(new QListWidgetItem(QIcon(":/icons/success.png"), tr("Upload succeeded."), outputConsole)); 735 735 outputConsole->scrollToBottom(); 736 statusBar()->showMessage( "Upload succeeded.");736 statusBar()->showMessage(tr("Upload succeeded.")); 737 737 } 738 738 else 739 739 { 740 outputConsole->addItem(new QListWidgetItem(QIcon(":/icons/error.png"), "Upload failed.", outputConsole));740 outputConsole->addItem(new QListWidgetItem(QIcon(":/icons/error.png"), tr("Upload failed."), outputConsole)); 741 741 outputConsole->scrollToBottom(); 742 statusBar()->showMessage( "Upload failed.");742 statusBar()->showMessage(tr("Upload failed.")); 743 743 } 744 744 } … … 747 747 { 748 748 outputConsole->clear(); 749 outputConsole->addItem(new QListWidgetItem(QIcon(":/icons/success.png"), "Clean succeeded.", outputConsole));750 statusBar()->showMessage( "Clean succeeded.");749 outputConsole->addItem(new QListWidgetItem(QIcon(":/icons/success.png"), tr("Clean succeeded."), outputConsole)); 750 statusBar()->showMessage(tr("Clean succeeded.")); 751 751 } 752 752 753 753 void MainWindow::buildingNow(QString file) 754 754 { 755 statusBar()->showMessage( "Building..."+ file);755 statusBar()->showMessage(tr("Building...") + file); 756 756 } 757 757 … … 767 767 builder->clean(currentProject); 768 768 else 769 return statusBar()->showMessage( "Builder is currently busy...give it a second, then try again.", 3500 );769 return statusBar()->showMessage( tr("Builder is currently busy...give it a second, then try again."), 3500 ); 770 770 } 771 771 … … 777 777 { 778 778 if(currentProject.isEmpty()) 779 return statusBar()->showMessage( "Open a project first, or create a new one from the File menu.", 3500 );779 return statusBar()->showMessage( tr("Open a project first, or create a new one from the File menu."), 3500 ); 780 780 if( !projInfo->loadAndShow() ) 781 781 { 782 782 QDir dir(currentProject); 783 return statusBar()->showMessage( "Couldn't find/open project properties for "+ dir.dirName(), 3500 );783 return statusBar()->showMessage( tr("Couldn't find/open project properties for ") + dir.dirName(), 3500 ); 784 784 } 785 785 } … … 792 792 { 793 793 if(currentProject.isEmpty()) 794 return statusBar()->showMessage( "Open a project to upload, or create a new one from the File menu.", 3500 );794 return statusBar()->showMessage( tr("Open a project to upload, or create a new one from the File menu."), 3500 ); 795 795 QDir projectDir(currentProject); 796 796 projectDir.cd("build"); … … 800 800 uploadFile(bins.first().filePath()); 801 801 else 802 return statusBar()->showMessage( "Couldn't find the file to upload for this project.", 3500 );802 return statusBar()->showMessage( tr("Couldn't find the file to upload for this project."), 3500 ); 803 803 } 804 804 … … 825 825 QFileInfo fi(filename); 826 826 if(!fi.exists()) 827 return statusBar()->showMessage( QString("Couldn't find %1.").arg(fi.fileName()), 3500 );827 return statusBar()->showMessage( tr("Couldn't find %1.").arg(fi.fileName()), 3500 ); 828 828 QAction *board = boardTypeGroup->checkedAction( ); 829 829 if(board) … … 832 832 uploader->upload(board->data().toString(), filename); 833 833 else 834 return statusBar()->showMessage( "Uploader is currently busy...give it a second, then try again.", 3500 );834 return statusBar()->showMessage( tr("Uploader is currently busy...give it a second, then try again."), 3500 ); 835 835 } 836 836 else 837 return statusBar()->showMessage( "Please select a board type from the Project menu first.", 3500 );837 return statusBar()->showMessage( tr("Please select a board type from the Project menu first."), 3500 ); 838 838 } 839 839 … … 934 934 QMenu *menu = new QMenu(libname, menuLibraries); 935 935 menuLibraries->addMenu(menu); 936 QAction *a = new QAction( "Import to Current Project", menu);936 QAction *a = new QAction(tr("Import to Current Project"), menu); 937 937 a->setData(library); 938 938 menu->addAction(a); … … 941 941 if(nodes.count()) 942 942 { 943 a = new QAction( "View Documentation", menu);943 a = new QAction(tr("View Documentation"), menu); 944 944 QString doclink = nodes.at(0).toElement().text(); 945 945 QUrl url(doclink); … … 962 962 void MainWindow::onLibrary(QAction *example) 963 963 { 964 if(example->text() == "Import to Current Project")964 if(example->text() == tr("Import to Current Project")) 965 965 { 966 966 QString includeString = QString("#include \"%1.h\"").arg(example->data().toString()); … … 973 973 } 974 974 } 975 else if(example->text() == "View Documentation")975 else if(example->text() == tr("View Documentation")) 976 976 QDesktopServices::openUrl(QUrl::fromLocalFile(example->data().toString())); 977 977 } … … 1002 1002 void MainWindow::printOutputError(QString text) 1003 1003 { 1004 if(text.startsWith( "Warning"))1004 if(text.startsWith(tr("Warning"))) 1005 1005 outputConsole->addItem(new QListWidgetItem(QIcon(":/icons/warning.png"), text.trimmed(), outputConsole)); 1006 else if(text.startsWith( "Error"))1006 else if(text.startsWith(tr("Error"))) 1007 1007 outputConsole->addItem(new QListWidgetItem(QIcon(":/icons/error.png"), text.trimmed(), outputConsole)); 1008 1008 else -
mcbuilder/trunk/src/Uploader.cpp
r659 r834 107 107 if(err.startsWith("can't find boot agent")) 108 108 { 109 mainWindow->printOutputError( "Error - couldn't find an unprogrammed board to upload to.");110 mainWindow->printOutputError( " Make sure you've erased and unplugged/replugged your board.");109 mainWindow->printOutputError(tr("Error - couldn't find an unprogrammed board to upload to.")); 110 mainWindow->printOutputError(tr(" Make sure you've erased and unplugged/replugged your board.")); 111 111 } 112 112 else … … 122 122 { 123 123 QFileInfo fi(currentFile); 124 uploaderProgress->setLabelText( QString("Uploading %1...").arg(fi.fileName()));124 uploaderProgress->setLabelText(tr("Uploading %1...").arg(fi.fileName())); 125 125 uploaderProgress->show(); 126 126 } … … 149 149 { 150 150 case QProcess::FailedToStart: 151 msg = QString("uploader failed to start. '%1' is either missing, or doesn't have the correct permissions").arg(uploaderName);151 msg = tr("uploader failed to start. '%1' is either missing, or doesn't have the correct permissions").arg(uploaderName); 152 152 break; 153 153 case QProcess::Crashed: 154 msg = QString("uploader (%1) was canceled or crashed.").arg(uploaderName);154 msg = tr("uploader (%1) was canceled or crashed.").arg(uploaderName); 155 155 break; 156 156 case QProcess::Timedout: 157 msg = QString("uploader (%1) timed out.").arg(uploaderName);157 msg = tr("uploader (%1) timed out.").arg(uploaderName); 158 158 break; 159 159 case QProcess::WriteError: 160 msg = QString("uploader (%1) reported a write error.").arg(uploaderName);160 msg = tr("uploader (%1) reported a write error.").arg(uploaderName); 161 161 break; 162 162 case QProcess::ReadError: 163 msg = QString("uploader (%1) reported a read error.").arg(uploaderName);163 msg = tr("uploader (%1) reported a read error.").arg(uploaderName); 164 164 break; 165 165 case QProcess::UnknownError: 166 msg = QString("uploader (%1) - unknown error type.").arg(uploaderName);166 msg = tr("uploader (%1) - unknown error type.").arg(uploaderName); 167 167 break; 168 168 } 169 mainWindow->printOutputError( "Error - "+ msg);169 mainWindow->printOutputError(tr("Error - ") + msg); 170 170 } 171 171 -
mcbuilder/trunk/src/main.cpp
r601 r834 19 19 20 20 #include <QApplication> 21 #include <QTranslator> 22 #include <QLibraryInfo> 21 23 #include "MainWindow.h" 22 24 … … 24 26 { 25 27 QApplication app(argc, argv); 28 29 QString locale = QLocale::system().name(); 30 31 QTranslator qtTranslator; 32 QTranslator mcbuilderTranslator; 33 34 qtTranslator.load(QString("qt_") + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); 35 app.installTranslator(&qtTranslator); 36 37 mcbuilderTranslator.load(QString("mcbuilder_") + locale); 38 app.installTranslator(&mcbuilderTranslator); 39 26 40 MainWindow window; 27 41 window.show();
