# # # patch ".cdtproject" # from [666c0008ecf103c5660e82388ae314be8b48ab3c] # to [12dbefa33165b73777bc02113bda0b11a42d46bd] # # patch "README" # from [f2ffe9c6f898c0da315ecebc992bc70d7286316f] # to [4b3241a26668f1a528b87e9395eca78a473cd9ef] # # patch "build.sh" # from [09cf13d6d2a9885165cf3f205b6e4ce64d309828] # to [a2d1126a5a2566963ad313535c0c4f013222b506] # # patch "guitone.pro" # from [a858bcf037b1c080dc8b1ec9eee22af8e77e07f6] # to [89e082af2d348fbe6b7b4ec79c3a3bff03ebc202] # # patch "src/main.cpp" # from [d4a6677cce578b067eb80644dda4fc16b1043e69] # to [59347d7e681fed811c599bc6624756ffc974be86] # # patch "src/view/Guitone.cpp" # from [b1d8a32bc9e73eda06be520553184bf12bd78888] # to [cd72691e6335053d2a2c3f196e7a19f36fbfa58c] # # patch "src/view/SandboxView.cpp" # from [152464c08759ef09cc75733b6123dfc584b338c0] # to [23ae08df2a13749cb980fd9bcb6526b8a1091b33] # ============================================================ --- .cdtproject 666c0008ecf103c5660e82388ae314be8b48ab3c +++ .cdtproject 12dbefa33165b73777bc02113bda0b11a42d46bd @@ -1,3 +1,3 @@ +< parser enabled='true'/>/home/tommyd/monotone/guitone/build.shallfalsefalse - ============================================================ --- README f2ffe9c6f898c0da315ecebc992bc70d7286316f +++ README 4b3241a26668f1a528b87e9395eca78a473cd9ef @@ -16,8 +16,8 @@ $ ./build.sh $ bin/guitone -You need to have monotone installed with at least -version 0.26pre3 and you need a checked out workspace. +You need Qt >= 4.1, monotone >= 0.26pre3, and you +need a checked out monotone workspace. Via CTRL-I you select the base folder of the sandbox which is then displayed. ============================================================ --- build.sh 09cf13d6d2a9885165cf3f205b6e4ce64d309828 +++ build.sh a2d1126a5a2566963ad313535c0c4f013222b506 @@ -1,2 +1,8 @@ #!/bin/sh +qmake guitone.pro && \ + lupdate guitone.pro && \ + lrelease guitone.pro && \ + make $@ && \ + (echo `basename $0`: copying language files... && \ + mkdir bin/i18n && cp i18n/*.qm bin/i18n) 2>/dev/null + -qmake guitone.pro && make $@ ============================================================ --- guitone.pro a858bcf037b1c080dc8b1ec9eee22af8e77e07f6 +++ guitone.pro 89e082af2d348fbe6b7b4ec79c3a3bff03ebc202 @@ -18,3 +18,4 @@ MOC_DIR = tmp DESTDIR = bin QT += qt3support +TRANSLATIONS = i18n/guitone_de.ts ============================================================ --- src/main.cpp d4a6677cce578b067eb80644dda4fc16b1043e69 +++ src/main.cpp 59347d7e681fed811c599bc6624756ffc974be86 @@ -18,16 +18,25 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - -#include +#include +#include +#include #include "view/Guitone.h" int main(int argc, char** argv) { QApplication app(argc,argv); + + // try to find a suitable locale and setup translations + QString locale = QLocale::system().name(); + QTranslator translator; + translator.load(QString("i18n/guitone_") + locale); + app.installTranslator(&translator); + + // create and show the main window Guitone *mainWnd = new Guitone(); - mainWnd->setCaption("guitone"); mainWnd->show(); + app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); return app.exec(); } ============================================================ --- src/view/Guitone.cpp b1d8a32bc9e73eda06be520553184bf12bd78888 +++ src/view/Guitone.cpp cd72691e6335053d2a2c3f196e7a19f36fbfa58c @@ -28,10 +28,13 @@ #include #include #include +#include Guitone::Guitone() - : QMainWindow( 0, "Guitone" ) + : QMainWindow() { + setCaption(tr("guitone - a frontend for monotone")); + // create sandbox object mySandbox = new Sandbox(); @@ -39,11 +42,11 @@ // Menubar // menu = menuBar()->addMenu(tr("&File")); + QAction* act = menu->addAction(tr("&Import Sandbox..."), this, SLOT(chooseSandbox())); + act->setShortcut(tr("Ctrl+I", "Import")); - menu->addAction(tr("&Import Sandbox..."), - this, SLOT(chooseSandbox()), Qt::CTRL+Qt::Key_I); - - menu->addAction(tr("&Quit"), this, SLOT(close()), Qt::CTRL+Qt::Key_Q); + act = menu->addAction(tr("&Quit"), this, SLOT(close())); + act->setShortcut(tr("Ctrl+Q", "Quit")); // // Toolbar @@ -58,14 +61,7 @@ QSplitter *mainSplitter = new QSplitter(this); treeView = new SandboxView(mainSplitter, SandboxView::FolderTree); listView = new SandboxView(mainSplitter, SandboxView::FileList); - /* - QSplitter *rightSplitter = new QSplitter(mainSplitter); - rightSplitter->setOrientation(Qt::Vertical); - - listView = new SandboxView(rightSplitter, SandboxView::FileList); - logWindow = new QTextEdit(rightSplitter); - */ - + connect(treeView, SIGNAL(updateDisplay(std::list*)), listView, SLOT(display(std::list*))); @@ -78,7 +74,7 @@ resize( 450, 600 ); - statusBar()->message( tr("Ready"), 2000 ); + statusBar()->message(tr("Ready"), 2000 ); } @@ -90,13 +86,13 @@ QString fn = QFileDialog::getExistingDirectory( QString::null, this, - "select workspace dialog", - "Select your workspace...", + tr("Select your workspace..."), + tr("Select your workspace..."), TRUE ); if (fn.isEmpty()) { - statusBar()->message( tr("Loading aborted"), 2000 ); + statusBar()->message(tr("Loading aborted"), 2000 ); return; } @@ -104,8 +100,8 @@ { QMessageBox::information( this, - "Invalid workspace", - "The chosen directory is no monotone sandbox!", + tr("Invalid workspace"), + tr("The chosen directory is no monotone sandbox!"), QMessageBox::Ok ); return; @@ -120,8 +116,8 @@ { QMessageBox::information( this, - "Inventory could not be read", - "The inventory could not be read. Maybe another task is still running?", + tr("Inventory could not be read"), + tr("The inventory could not be read. Maybe another task is still running?"), QMessageBox::Ok ); return; ============================================================ --- src/view/SandboxView.cpp 152464c08759ef09cc75733b6123dfc584b338c0 +++ src/view/SandboxView.cpp 23ae08df2a13749cb980fd9bcb6526b8a1091b33 @@ -13,22 +13,22 @@ itemPopup = new Q3PopupMenu(this); viewPopup = new Q3PopupMenu(this); viewPopup->setCheckable(true); - hideIgnoredItems_id = viewPopup->insertItem("Hide i&gnored items", this, SLOT(toggleHideIgnoredItems())); + hideIgnoredItems_id = viewPopup->insertItem(tr("Hide i&gnored items"), this, SLOT(toggleHideIgnoredItems())); viewType = type; if (viewType == SandboxView::FileList) { - addColumn("File"); + addColumn(tr("File")); } else { - addColumn("Folder"); + addColumn(tr("Folder")); setRootIsDecorated(true); } // common for both views - addColumn("Status"); + addColumn(tr("Status")); connect(this, SIGNAL(contextMenuRequested(Q3ListViewItem*, const QPoint&,int)), this, SLOT(openContextMenu(Q3ListViewItem*, const QPoint&,int))); @@ -89,7 +89,7 @@ rootItem = new SandboxItem("ROOT", 0 , true); rootItem->setChildren(items); - Q3ListViewItem *listViewRoot = new Q3ListViewItem(this, "ROOT"); + Q3ListViewItem *listViewRoot = new Q3ListViewItem(this, tr("ROOT")); listViewRoot->setPixmap(0, QPixmap(XPM::FolderOpened)); lookupTable[listViewRoot] = rootItem; @@ -149,39 +149,39 @@ if (item->hasStatus(SandboxItem::RenamedFrom)) { - list.append("Rename Source"); + list.append(tr("Rename Source")); } if (item->hasStatus(SandboxItem::RenamedTo)) { - list.append("Rename Target"); + list.append(tr("Rename Target")); } if (item->hasStatus(SandboxItem::Added)) { - list.append("Added"); + list.append(tr("Added")); } if (item->hasStatus(SandboxItem::Dropped)) { - list.append("Dropped"); + list.append(tr("Dropped")); } if (item->hasStatus(SandboxItem::Missing)) { - list.append("Missing"); + list.append(tr("Missing")); } if (item->hasStatus(SandboxItem::Patched)) { - list.append("Patched"); + list.append(tr("Patched")); } if (item->hasStatus(SandboxItem::Unchanged)) { - list.append("Unchanged"); + list.append(tr("Unchanged")); } if (item->hasStatus(SandboxItem::Unknown)) { - list.append("Unknown"); + list.append(tr("Unknown")); } if (item->hasStatus(SandboxItem::Ignored)) { - list.append("Ignored"); + list.append(tr("Ignored")); } return list.join(", "); } @@ -204,31 +204,31 @@ if (sbItem->hasStatus(SandboxItem::Unknown)) { - entry = itemPopup->insertItem("Add", this, SLOT(addItem(int))); + entry = itemPopup->insertItem(tr("Add"), this, SLOT(addItem(int))); itemPopup->setItemParameter(entry, (int)sbItem); } if (sbItem->hasNotStatus(SandboxItem::Ignored) && sbItem->hasNotStatus(SandboxItem::Unknown)) { - entry = itemPopup->insertItem("Drop", this, SLOT(dropItem(int))); + entry = itemPopup->insertItem(tr("Drop"), this, SLOT(dropItem(int))); itemPopup->setItemParameter(entry, (int)sbItem); } if (sbItem->hasStatus(SandboxItem::RenamedFrom)) { - entry = itemPopup->insertItem("Select Rename Target", this, SLOT(selectRenameTarget(int))); + entry = itemPopup->insertItem(tr("Select Rename Target"), this, SLOT(selectRenameTarget(int))); itemPopup->setItemParameter(entry, (int)sbItem); } if (sbItem->hasStatus(SandboxItem::RenamedTo)) { - entry = itemPopup->insertItem("Select Rename Source", this, SLOT(selectRenameSource(int))); + entry = itemPopup->insertItem(tr("Select Rename Source"), this, SLOT(selectRenameSource(int))); itemPopup->setItemParameter(entry, (int)sbItem); } if (sbItem->hasNotStatus(SandboxItem::Ignored) && sbItem->hasNotStatus(SandboxItem::Unchanged) && sbItem->hasNotStatus(SandboxItem::Unknown)) { - entry = itemPopup->insertItem("Revert", this, SLOT(revertItem(int))); + entry = itemPopup->insertItem(tr("Revert"), this, SLOT(revertItem(int))); itemPopup->setItemParameter(entry, (int)sbItem); } @@ -264,7 +264,7 @@ { SandboxItem *sbItem = (SandboxItem*)item; - QMessageBox::information(this,"Info", "No functioality yet, sorry!",QMessageBox::Ok); + QMessageBox::information(this,tr("Info"), tr("No functionality yet, sorry!"),QMessageBox::Ok); qDebug("Adding item %s", sbItem->getFilename().latin1()); } @@ -273,7 +273,7 @@ { SandboxItem *sbItem = (SandboxItem*)item; - QMessageBox::information(this,"Info", "No functioality yet, sorry!",QMessageBox::Ok); + QMessageBox::information(this,tr("Info"), tr("No functionality yet, sorry!"),QMessageBox::Ok); qDebug("Dropping item %s", sbItem->getFilename().latin1()); } @@ -282,7 +282,7 @@ { SandboxItem *sbItem = (SandboxItem*)item; - QMessageBox::information(this,"Info", "No functioality yet, sorry!",QMessageBox::Ok); + QMessageBox::information(this,tr("Info"), tr("No functionality yet, sorry!"),QMessageBox::Ok); qDebug("Reverting item %s", sbItem->getFilename().latin1()); }