# HG changeset patch # User insilmaril # Date 1157718609 0 # Node ID c79df732d09524805c1e75821a551a990aad84ca # Parent 5f6e176e97185ed6099dea2f0fe9bd2b540b04a4 rows in history window can be selected to undo/redo actions diff -r 5f6e176e9718 -r c79df732d095 aboutdialog.cpp --- a/aboutdialog.cpp Wed Sep 06 12:47:06 2006 +0000 +++ b/aboutdialog.cpp Fri Sep 08 12:30:09 2006 +0000 @@ -173,7 +173,7 @@ tabs->showPage (credits); okbutton =new QPushButton (this,"okbutton"); - okbutton->setText (tr("Ok")); + okbutton->setText (tr("Ok","Ok Button")); okbutton->setMaximumSize (QSize (50,30)); okbutton->setAutoDefault (true); mainLayout->addWidget( okbutton); diff -r 5f6e176e9718 -r c79df732d095 demos/todo.vym Binary file demos/todo.vym has changed diff -r 5f6e176e9718 -r c79df732d095 historywindow.cpp --- a/historywindow.cpp Wed Sep 06 12:47:06 2006 +0000 +++ b/historywindow.cpp Fri Sep 08 12:30:09 2006 +0000 @@ -1,4 +1,5 @@ #include "historywindow.h" +#include "mapeditor.h" HistoryWindow::HistoryWindow (QWidget *parent):QDialog (parent) { @@ -19,28 +20,109 @@ ui.historyTable->setHorizontalHeaderItem(2, item); ui.historyTable->setSelectionBehavior (QAbstractItemView::SelectRows); + + connect ( ui.undoButton, SIGNAL (clicked()), this, SLOT (undo())); + connect ( ui.redoButton, SIGNAL (clicked()), this, SLOT (redo())); + connect ( ui.historyTable, SIGNAL (itemSelectionChanged()), this, SLOT (select())); } +void HistoryWindow::updateRow(int row, int step, SimpleSettings &set) +{ + QTableWidgetItem *item; + + item= new QTableWidgetItem(set.readEntry(QString("/history/step-%1/redoCommand").arg(step))); + ui.historyTable->setItem(row, 0, item); + + item= new QTableWidgetItem(set.readEntry(QString("/history/step-%1/comment").arg(step))); + ui.historyTable->setItem(row, 1, item); + + item=new QTableWidgetItem(set.readEntry(QString("/history/step-%1/undoCommand").arg(step))); + ui.historyTable->setItem(row, 2, item); +} + void HistoryWindow::update(SimpleSettings &set) { - //int rows=set.readNumEntry("/history/undosTotal"); - //ui.historyTable->setRowCount (rows); + int undosAvail=set.readNumEntry("/history/undosAvail",0); + int redosAvail=set.readNumEntry("/history/redosAvail",0); + int stepsTotal=set.readNumEntry("/history/stepsTotal",0); + int curStep=set.readNumEntry ("/history/curStep"); + int i; + int s=curStep; + int r=undosAvail-1; + QTableWidgetItem *item; - int i; - for (i=0;i<= set.readNumEntry("/history/undosAvail",0); i++) + // Update buttons + if (undosAvail<1) + ui.undoButton->setEnabled (false); + else + ui.undoButton->setEnabled (true); + + if (redosAvail<1) + ui.redoButton->setEnabled (false); + else + ui.redoButton->setEnabled (true); + + // Update table + for (i=undosAvail; i>0; i--) { - QTableWidgetItem *item; + updateRow (r,s,set); + r--; + s--; + if (s<1) s=stepsTotal; + } + + // Generated the "now" row + QColor c(255,200,120); + for (i=0;i<=2;i++) + { + if (i!=1) + { + item=new QTableWidgetItem(""); + item->setBackgroundColor (c); + ui.historyTable->setItem(undosAvail, i, item); + } + } + item=new QTableWidgetItem(" - " +tr("Current state","current bar in history hwindow")+ " - "); + item->setBackgroundColor (c); + ui.historyTable->setItem(undosAvail, 1, item); - item= new QTableWidgetItem(set.readEntry(QString("/history/step-%1/redoCommand").arg(i))); - ui.historyTable->setItem(i, 0, item); - item= new QTableWidgetItem(set.readEntry(QString("/history/step-%1/comment").arg(i))); - ui.historyTable->setItem(i, 1, item); + s=curStep; + s++; if (s>stepsTotal) s=1; - item=new QTableWidgetItem(set.readEntry(QString("/history/step-%1/undoCommand").arg(i))); - ui.historyTable->setItem(i, 2, item); + for (i=1;i<= redosAvail; i++) + { + updateRow (undosAvail+i,s,set); + s++; if (s>stepsTotal) s=1; } ui.historyTable->resizeColumnsToContents(); } + +void HistoryWindow::setME (MapEditor *me) +{ + mapEditor=me; +} + +void HistoryWindow::setStepsTotal (int st) +{ + // Number of steps + "current" bar + ui.historyTable->setRowCount (st+1); + +} + +void HistoryWindow::undo() +{ + mapEditor->undo(); +} + +void HistoryWindow::redo() +{ + mapEditor->redo(); +} + +void HistoryWindow::select() +{ + mapEditor->gotoStep (ui.historyTable->row (ui.historyTable->selectedItems().first())); +} diff -r 5f6e176e9718 -r c79df732d095 historywindow.h --- a/historywindow.h Wed Sep 06 12:47:06 2006 +0000 +++ b/historywindow.h Fri Sep 08 12:30:09 2006 +0000 @@ -1,9 +1,13 @@ #ifndef HISTORYWINDOW_H #define HISTORYWINDOW_H +//#include "mapeditor.h" #include "settings.h" #include "ui_historywindow.h" + +class MapEditor; + ///////////////////////////////////////////////////////////////////////////// class HistoryWindow:public QDialog { @@ -12,10 +16,18 @@ public: HistoryWindow(QWidget* parent = 0); void update (SimpleSettings &); - + void setME (MapEditor *); + void setStepsTotal (int); + +private slots: + void undo(); + void redo(); + void select(); private: + void updateRow (int, int, SimpleSettings &); Ui::HistoryWindow ui; + MapEditor *mapEditor; }; diff -r 5f6e176e9718 -r c79df732d095 lang/vym_de.ts --- a/lang/vym_de.ts Wed Sep 06 12:47:06 2006 +0000 +++ b/lang/vym_de.ts Fri Sep 08 12:30:09 2006 +0000 @@ -3,6 +3,11 @@ AboutDialog Ok + Ok + + + Ok + Ok Button Ok @@ -327,12 +332,60 @@ Find Text Text suchen + + Text to find: + Suchen nach: + + + + HistoryWindow + + Dialog + + + + Redo + Wiederherstellen + + + New Row + + + + Time + + + + Comment + + + + Undo + Rückgängig + + + Close + Schliessen + + + Action + + + + Undo action + + + + now + now bar in history hwindow + + Main &File - &Datei + &Datei New map @@ -492,7 +545,7 @@ Jump to map - Gehe zu einer weiteren Map. + Gehe zu einer weiteren Map. Edit link to another vym map @@ -1217,11 +1270,11 @@ Pasting into new branch - In neuen Zweig einfügen + In neuen Zweig einfügen pasting into new branch - In neuen Zweig einfügen + In neuen Zweig einfügen Delete key for deleting branches @@ -1669,10 +1722,6 @@ - %1... - - - Couldn't find configuration for export to Open Office @@ -1681,6 +1730,44 @@ No matches found for "%1" + + &Map + + + + &Actions + + + + Open all URLs in subtree + + + + Open xlinked map + + + + Open all vym links in subtree + + + + URLs and vymLinks + + + + Couldn't create temporary directory before load + + + + + Couldn't create temporary directory before save + + + + + Sorry, currently only Konqueror and Mozilla support tabbed browsing. + + MapEditor @@ -1889,7 +1976,7 @@ vym - save image as - vym - Speichere Bild als + vym - Speichere Bild als vym - Save image as @@ -2098,7 +2185,7 @@ Save image as %1 - Speichere Bild unter %1 + Speichere Bild unter %1 Choose directory structure to import @@ -2122,6 +2209,128 @@ Warning + Warnung + + + Couldn't find script %1 +to notifiy Browsers of changed bookmarks. + Konnte das Script %1 +nicht finden, das nötig ist um die +Browser auf die geänderten Lesezeichen +hinzuweisen. + + + History for + + + + Save image + Speichere Bild + + + + QMessageBox + + Critical Error + Kritischer Fehler + + + + QObject + + new branch + Neuer Zweig + + + New Map + Neue Map + + + This is not an image. + Das ist kein Bild. + + + Critical Export Error + Kritischer Fehler beim Exportieren + + + Could not write %1 + %1 konnte nicht + + + Export failed. + Export fehlgeschlagen. + + + Check "%1" in +%2 + Bitte "%1" prüfen in +%2 + + + Could not read %1 + %1 konnte nicht gelesen werden + + + Critical Error + Kritischer Fehler + + + Couldn't start zip to compress data. + Konnte zip nicht starten, um Daten zu komprimieren. + + + zip didn't exit normally + zip wurde nicht richtig beendet + + + Couldn't start unzip to decompress data. + Konnte unzip nicht starten, um Daten zu dekomprimieren. + + + unzip didn't exit normally + unzip wurde nicht richtig beendet + + + Could not start %1 + %1 konnte nicht gestartet werden + + + %1 didn't exit normally + %1 wurde nicht richtig beendet + + + The file %1 exists already. +Do you want to overwrite it? + Die Datei %1 gibt es bereits. +Wollen Sie sie überschreiben? + + + Overwrite + Überschreiben + + + Cancel + Abbrechen + + + Sorry, no preview for +multiple selected files. + Leider keine Vorschau +möglich für Mehrfachausahl. + + + Exporting the %1 bookmarks will overwrite +your existing bookmarks file. + Das Exportieren der %1 Lesezeichen wird die +bestehende Datei mit Lesezeichen überschreiben. + + + Warning: Overwriting %1 bookmarks + Warnung: Überschreiben der %1 Lesezeichen + + + Warning Warnung @@ -2132,119 +2341,14 @@ Browser auf die geänderten Lesezeichen hinzuweisen. - - - QMessageBox - - Critical Error - Kritischer Fehler - - - - QObject - - new branch - Neuer Zweig - - - New Map - Neue Map - - - This is not an image. - Das ist kein Bild. - - - Critical Export Error - Kritischer Fehler beim Exportieren - - - Could not write %1 - %1 konnte nicht - - - Export failed. - Export fehlgeschlagen. - - - Check "%1" in -%2 - Bitte "%1" prüfen in -%2 - - - Could not read %1 - %1 konnte nicht gelesen werden - - - Critical Error - Kritischer Fehler - - - Couldn't start zip to compress data. - Konnte zip nicht starten, um Daten zu komprimieren. - - - zip didn't exit normally - zip wurde nicht richtig beendet - - - Couldn't start unzip to decompress data. - Konnte unzip nicht starten, um Daten zu dekomprimieren. - - - unzip didn't exit normally - unzip wurde nicht richtig beendet - - - Could not start %1 - %1 konnte nicht gestartet werden - - - %1 didn't exit normally - %1 wurde nicht richtig beendet - - - The file %1 exists already. -Do you want to overwrite it? - Die Datei %1 gibt es bereits. -Wollen Sie sie überschreiben? - - - Overwrite - Überschreiben - - - Cancel - Abbrechen - - - Sorry, no preview for -multiple selected files. - Leider keine Vorschau -möglich für Mehrfachausahl. - - - Exporting the %1 bookmarks will overwrite -your existing bookmarks file. - Das Exportieren der %1 Lesezeichen wird die -bestehende Datei mit Lesezeichen überschreiben. - - - Warning: Overwriting %1 bookmarks - Warnung: Überschreiben der %1 Lesezeichen - - - Warning - Warnung - - - Couldn't find script %1 -to notifiy Browsers of changed bookmarks. - Konnte das Script %1 -nicht finden, das nötig ist um die -Browser auf die geänderten Lesezeichen -hinzuweisen. + + Error + + + + Couldn't access temporary directory + + @@ -2255,18 +2359,22 @@ Close - Schliessen + Schliessen History of %1 Verlauf von %1 + + Dialog + + TextEditor &File - &Datei + &Datei Import @@ -2525,19 +2633,23 @@ F&ormat - File Actions - - - Edit Actions Format Actions + Format Actions + + + Print Document - Print Document + Note Actions + + + + &Note diff -r 5f6e176e9718 -r c79df732d095 lang/vym_en.ts --- a/lang/vym_en.ts Wed Sep 06 12:47:06 2006 +0000 +++ b/lang/vym_en.ts Fri Sep 08 12:30:09 2006 +0000 @@ -3,19 +3,11 @@ AboutDialog Ok + Ok Button - EditXLinkDialog - - - ExportXHTMLDialog - - - ExtraInfoDialog - - FindWindow Clear @@ -33,14 +25,58 @@ Find Text + + Text to find: + + + + + HistoryWindow + + Dialog + + + + Redo + + + + New Row + + + + Time + + + + Comment + + + + Undo + + + + Close + + + + Action + + + + Undo action + + + + now + now bar in history hwindow + + Main - &File - - - New map File menu @@ -191,10 +227,6 @@ - Jump to map - - - Edit link to another vym map @@ -615,14 +647,6 @@ - Pasting into new branch - - - - pasting into new branch - - - Delete key for deleting branches @@ -1028,10 +1052,6 @@ - %1... - - - Couldn't find configuration for export to Open Office @@ -1040,6 +1060,44 @@ No matches found for "%1" + + &Map + + + + &Actions + + + + Open all URLs in subtree + + + + Open xlinked map + + + + Open all vym links in subtree + + + + URLs and vymLinks + + + + Couldn't create temporary directory before load + + + + + Couldn't create temporary directory before save + + + + + Sorry, currently only Konqueror and Mozilla support tabbed browsing. + + MapEditor @@ -1080,10 +1138,6 @@ - vym - save image as - - - Critical Import Error @@ -1122,10 +1176,6 @@ - Save image as %1 - - - Choose directory structure to import @@ -1134,12 +1184,11 @@ - Warning + History for - Couldn't find script %1 -to notifiy Browsers of changed bookmarks. + Save image @@ -1234,17 +1283,30 @@ to notifiy Browsers of changed bookmarks. + + Error + + + + Couldn't access temporary directory + + + ShowTextDialog + + Dialog + + + + Close + + TextEditor - &File - - - Import @@ -1465,10 +1527,6 @@ - File Actions - - - Edit Actions @@ -1480,8 +1538,13 @@ Print Document - - - WarningDialog + + Note Actions + + + + &Note + + diff -r 5f6e176e9718 -r c79df732d095 lang/vym_es.ts --- a/lang/vym_es.ts Wed Sep 06 12:47:06 2006 +0000 +++ b/lang/vym_es.ts Fri Sep 08 12:30:09 2006 +0000 @@ -3,6 +3,11 @@ AboutDialog Ok + Ok + + + Ok + Ok Button Ok @@ -272,12 +277,60 @@ Find Text + + Text to find: + + + + + HistoryWindow + + Dialog + + + + Redo + Rehacer + + + New Row + + + + Time + + + + Comment + + + + Undo + Deshacer + + + Close + Cerrar + + + Action + + + + Undo action + + + + now + now bar in history hwindow + + Main &File - &Archivo + &Archivo New map @@ -447,7 +500,7 @@ Jump to map - Saltar al mapa + Saltar al mapa Edit link to another vym map @@ -1077,14 +1130,6 @@ - Pasting into new branch - - - - pasting into new branch - - - Delete key for deleting branches @@ -1474,10 +1519,6 @@ - %1... - - - Couldn't find configuration for export to Open Office @@ -1486,6 +1527,44 @@ No matches found for "%1" + + &Map + + + + &Actions + + + + Open all URLs in subtree + + + + Open xlinked map + + + + Open all vym links in subtree + + + + URLs and vymLinks + + + + Couldn't create temporary directory before load + + + + + Couldn't create temporary directory before save + + + + + Sorry, currently only Konqueror and Mozilla support tabbed browsing. + + MapEditor @@ -1583,7 +1662,7 @@ vym - save image as - vym - guardar imagen como + vym - guardar imagen como vym - Save image as @@ -1749,10 +1828,6 @@ - Save image as %1 - - - Choose directory structure to import @@ -1762,6 +1837,101 @@ Warning + Advertencia + + + History for + + + + Save image + Guardar imagen + + + + QObject + + This is not an image. + Esto no es una imagen. + + + Critical Export Error + Error de exportación crítico + + + Could not write %1 + + + + Export failed. + + + + Check "%1" in +%2 + + + + Could not read %1 + + + + Critical Error + Error crítico + + + Couldn't start zip to compress data. + No pudo iniciar zip para comprimir datos. + + + zip didn't exit normally + zip no salió normalmente + + + Couldn't start unzip to decompress data. + No pudo iniciar zip para descomprimir datos. + + + unzip didn't exit normally + unzip no salió normalmente + + + Could not start %1 + + + + %1 didn't exit normally + + + + The file %1 exists already. +Do you want to overwrite it? + + + + Overwrite + Sobreescribir + + + Cancel + Cancelar + + + Sorry, no preview for +multiple selected files. + + + + Exporting the %1 bookmarks will overwrite +your existing bookmarks file. + + + + Warning: Overwriting %1 bookmarks + + + + Warning Advertencia @@ -1769,96 +1939,13 @@ to notifiy Browsers of changed bookmarks. - - - QObject - - This is not an image. - Esto no es una imagen. - - - Critical Export Error - Error de exportación crítico - - - Could not write %1 + + Error - Export failed. - - - - Check "%1" in -%2 - - - - Could not read %1 - - - - Critical Error - Error crítico - - - Couldn't start zip to compress data. - No pudo iniciar zip para comprimir datos. - - - zip didn't exit normally - zip no salió normalmente - - - Couldn't start unzip to decompress data. - No pudo iniciar zip para descomprimir datos. - - - unzip didn't exit normally - unzip no salió normalmente - - - Could not start %1 - - - - %1 didn't exit normally - - - - The file %1 exists already. -Do you want to overwrite it? - - - - Overwrite - Sobreescribir - - - Cancel - Cancelar - - - Sorry, no preview for -multiple selected files. - - - - Exporting the %1 bookmarks will overwrite -your existing bookmarks file. - - - - Warning: Overwriting %1 bookmarks - - - - Warning - Advertencia - - - Couldn't find script %1 -to notifiy Browsers of changed bookmarks. + Couldn't access temporary directory + @@ -1870,14 +1957,18 @@ Close - Cerrar + Cerrar + + + Dialog + TextEditor &File - &Archivo + &Archivo Import @@ -2112,10 +2203,6 @@ - File Actions - - - Edit Actions @@ -2127,6 +2214,14 @@ Print Document + + Note Actions + + + + &Note + + WarningDialog diff -r 5f6e176e9718 -r c79df732d095 lang/vym_it.ts --- a/lang/vym_it.ts Wed Sep 06 12:47:06 2006 +0000 +++ b/lang/vym_it.ts Fri Sep 08 12:30:09 2006 +0000 @@ -3,6 +3,11 @@ AboutDialog Ok + Ok + + + Ok + Ok Button Ok @@ -274,12 +279,60 @@ Find Text + + Text to find: + + + + + HistoryWindow + + Dialog + + + + Redo + Rifai + + + New Row + + + + Time + + + + Comment + + + + Undo + Annulla + + + Close + Chiudi + + + Action + + + + Undo action + + + + now + now bar in history hwindow + + Main &File - &File + &File New map @@ -449,7 +502,7 @@ Jump to map - Salta ad una mappa + Salta ad una mappa Edit link to another vym map @@ -1268,14 +1321,6 @@ - Pasting into new branch - - - - pasting into new branch - - - Delete key for deleting branches @@ -1483,10 +1528,6 @@ - %1... - - - Couldn't find configuration for export to Open Office @@ -1495,6 +1536,44 @@ No matches found for "%1" + + &Map + + + + &Actions + + + + Open all URLs in subtree + + + + Open xlinked map + + + + Open all vym links in subtree + + + + URLs and vymLinks + + + + Couldn't create temporary directory before load + + + + + Couldn't create temporary directory before save + + + + + Sorry, currently only Konqueror and Mozilla support tabbed browsing. + + MapEditor @@ -1592,7 +1671,7 @@ vym - save image as - vym - salva immagine come + vym - salva immagine come vym - Save image as @@ -1745,10 +1824,6 @@ - Save image as %1 - - - The file %1 exists already. Do you want to overwrite it? @@ -1767,6 +1842,101 @@ Warning + Attenzione + + + History for + + + + Save image + Salva immagine + + + + QObject + + This is not an image. + Questa non è un immagine. + + + The file %1 exists already. +Do you want to overwrite it? + + + + Overwrite + Sovvrascrivi + + + Cancel + Cancella + + + Critical Export Error + Errore critico nell'esportazione + + + Could not write %1 + + + + Export failed. + + + + Check "%1" in +%2 + + + + Could not read %1 + + + + Critical Error + Errore Critico + + + Couldn't start zip to compress data. + Non è possibile iniziare lo zip per la decompressione dei dati. + + + zip didn't exit normally + lo zip non è finito normalmente + + + Couldn't start unzip to decompress data. + Non è possibile iniziare l'unzip per la decompressione dei dati. + + + unzip didn't exit normally + unzip non è finito normalmente + + + Sorry, no preview for +multiple selected files. + + + + Could not start %1 + + + + %1 didn't exit normally + + + + Exporting the %1 bookmarks will overwrite +your existing bookmarks file. + + + + Warning: Overwriting %1 bookmarks + + + + Warning Attenzione @@ -1774,96 +1944,13 @@ to notifiy Browsers of changed bookmarks. - - - QObject - - This is not an image. - Questa non è un immagine. - - - The file %1 exists already. -Do you want to overwrite it? + + Error - Overwrite - Sovvrascrivi - - - Cancel - Cancella - - - Critical Export Error - Errore critico nell'esportazione - - - Could not write %1 - - - - Export failed. - - - - Check "%1" in -%2 - - - - Could not read %1 - - - - Critical Error - Errore Critico - - - Couldn't start zip to compress data. - Non è possibile iniziare lo zip per la decompressione dei dati. - - - zip didn't exit normally - lo zip non è finito normalmente - - - Couldn't start unzip to decompress data. - Non è possibile iniziare l'unzip per la decompressione dei dati. - - - unzip didn't exit normally - unzip non è finito normalmente - - - Sorry, no preview for -multiple selected files. - - - - Could not start %1 - - - - %1 didn't exit normally - - - - Exporting the %1 bookmarks will overwrite -your existing bookmarks file. - - - - Warning: Overwriting %1 bookmarks - - - - Warning - Attenzione - - - Couldn't find script %1 -to notifiy Browsers of changed bookmarks. + Couldn't access temporary directory + @@ -1875,14 +1962,18 @@ Close - Chiudi + Chiudi + + + Dialog + TextEditor &File - &File + &File Import @@ -2117,10 +2208,6 @@ - File Actions - - - Edit Actions @@ -2132,6 +2219,14 @@ Print Document + + Note Actions + + + + &Note + + WarningDialog diff -r 5f6e176e9718 -r c79df732d095 mapeditor.cpp --- a/mapeditor.cpp Wed Sep 06 12:47:06 2006 +0000 +++ b/mapeditor.cpp Fri Sep 08 12:30:09 2006 +0000 @@ -209,7 +209,8 @@ fileName=tr("unnamed"); mapName=""; - undosTotal=settings.readNumEntry("/mapeditor/undoLevels",50); + stepsTotal=settings.readNumEntry("/mapeditor/stepsTotal",5); + undoSet.setEntry ("/history/stepsTotal",QString::number(stepsTotal)); // Initialize find routine itFind=NULL; @@ -232,6 +233,11 @@ updateViewCenter(); mapCenter->reposition(); // for positioning heading + + // Initialize history window; + historyWindow.setME(this); + historyWindow.setStepsTotal(stepsTotal); + historyWindow.update (undoSet); } MapEditor::~MapEditor() @@ -545,11 +551,12 @@ setChanged(); int undosAvail=undoSet.readNumEntry ("/history/undosAvail",0); + int redosAvail=undoSet.readNumEntry ("/history/redosAvail",0); int curStep=undoSet.readNumEntry ("/history/curStep",0); // Find out current undo directory - if (undosAvailundosTotal) curStep=1; + if (curStep>stepsTotal) curStep=1; QString backupXML; QString bakMapDir=QDir::convertSeparators (QString(tmpMapDir+"/undo-%1").arg(curStep)); @@ -594,8 +601,9 @@ /* TODO remove after testing */ //cout << " into="<< histPath.toStdString()<0) redosAvail--; - if (undosAvailundosTotal) curStep=1; + if (curStep>stepsTotal) curStep=1; QString undoCommand= undoSet.readEntry (QString("/history/step-%1/undoCommand").arg(curStep)); QString undoSelection=undoSet.readEntry (QString("/history/step-%1/undoSelection").arg(curStep)); QString redoCommand= undoSet.readEntry (QString("/history/step-%1/redoCommand").arg(curStep)); @@ -1335,6 +1346,7 @@ undoSet.setEntry ("/history/curStep",QString::number(curStep)); undoSet.writeSettings(histPath); + historyWindow.update (undoSet); updateActions(); /* TODO remove testing @@ -1356,6 +1368,10 @@ int curStep=undoSet.readNumEntry (QString("/history/curStep")); int undosAvail=undoSet.readNumEntry (QString("/history/undosAvail")); int redosAvail=undoSet.readNumEntry (QString("/history/redosAvail")); + + // Can we undo at all? + if (undosAvail<1) return; + QString undoCommand= undoSet.readEntry (QString("/history/step-%1/undoCommand").arg(curStep)); QString undoSelection=undoSet.readEntry (QString("/history/step-%1/undoSelection").arg(curStep)); QString redoCommand= undoSet.readEntry (QString("/history/step-%1/redoCommand").arg(curStep)); @@ -1387,7 +1403,7 @@ undosAvail--; curStep--; - if (curStep<1) curStep=undosTotal; + if (curStep<1) curStep=stepsTotal; redosAvail++; @@ -1405,9 +1421,30 @@ undoSet.setEntry ("/history/curStep",QString::number(curStep)); undoSet.writeSettings(histPath); + historyWindow.update (undoSet); updateActions(); } +void MapEditor::gotoStep (int i) +{ + // Restore variables + int undosAvail=undoSet.readNumEntry (QString("/history/undosAvail")); + + if (i<0) return; + + // Clicking above current steps let's us undo things + if (iundosAvail) + for (int j=undosAvail; j