# HG changeset patch # User Teemu Piippo # Date 1521279307 -7200 # Node ID 52732b1db3f0fff2518986a086ea73d7b4b70650 # Parent 66d2050d3bd9cb1ce11cf859eb0e5cf0a30bf8f2 removed the old Add History Line tool diff -r 66d2050d3bd9 -r 52732b1db3f0 CMakeLists.txt --- a/CMakeLists.txt Sat Mar 17 11:33:05 2018 +0200 +++ b/CMakeLists.txt Sat Mar 17 11:35:07 2018 +0200 @@ -165,7 +165,6 @@ set (LDFORGE_FORMS src/dialogs/aboutdialog.ui - src/dialogs/addhistorylinedialog.ui src/dialogs/colorselector.ui src/dialogs/configdialog.ui src/dialogs/covererdialog.ui diff -r 66d2050d3bd9 -r 52732b1db3f0 src/dialogs/addhistorylinedialog.ui --- a/src/dialogs/addhistorylinedialog.ui Sat Mar 17 11:33:05 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ - - - AddHistoryLine - - - - 0 - 0 - 410 - 120 - - - - Add History Line - - - - - - - - Date: - - - - - - - - - - Username: - - - - - - - - - - Comment: - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - AddHistoryLine - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - AddHistoryLine - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff -r 66d2050d3bd9 -r 52732b1db3f0 src/mainwindow.ui --- a/src/mainwindow.ui Sat Mar 17 11:33:05 2018 +0200 +++ b/src/mainwindow.ui Sat Mar 17 11:35:07 2018 +0200 @@ -43,6 +43,14 @@ 0 + + + 0 + 0 + 465 + 362 + + Header @@ -313,7 +321,6 @@ - @@ -1523,11 +1530,6 @@ &Download From... - - - Add History Line - - &Go to Line... diff -r 66d2050d3bd9 -r 52732b1db3f0 src/toolsets/algorithmtoolset.cpp --- a/src/toolsets/algorithmtoolset.cpp Sat Mar 17 11:33:05 2018 +0200 +++ b/src/toolsets/algorithmtoolset.cpp Sat Mar 17 11:35:07 2018 +0200 @@ -39,7 +39,6 @@ #include "ui_replacecoordinatesdialog.h" #include "ui_editrawdialog.h" #include "ui_flipdialog.h" -#include "ui_addhistorylinedialog.h" #include "algorithmtoolset.h" AlgorithmToolset::AlgorithmToolset (MainWindow* parent) : @@ -349,52 +348,6 @@ print (tr ("Auto-colored: new color is [%1] %2"), color.index(), color.name()); } -void AlgorithmToolset::addHistoryLine() -{ - LDObject* obj; - bool ishistory = false; - bool prevIsHistory = false; - - QDialog dialog {m_window}; - Ui_AddHistoryLine ui; - ui.setupUi(&dialog); - ui.m_username->setText (m_config->defaultUser()); - ui.m_date->setDate (QDate::currentDate()); - ui.m_comment->setFocus(); - - if (not dialog.exec()) - return; - - // Find a spot to place the new comment - for (obj = currentDocument()->getObject (0); - obj and next(obj) and not next(obj)->isScemantic(); - obj = next(obj)) - { - LDComment* comment = dynamic_cast (obj); - - if (comment and comment->text().startsWith ("!HISTORY ")) - ishistory = true; - - if (prevIsHistory and not ishistory) - break; // Last line was history, this isn't, thus insert the new history line here. - - prevIsHistory = ishistory; - } - - int idx = obj ? currentDocument()->indexOf(obj).row() : 0; - - // Create the comment object based on input - currentDocument()->emplaceAt(idx++, format("!HISTORY %1 [%2] %3", - ui.m_date->date().toString ("yyyy-MM-dd"), - ui.m_username->text(), - ui.m_comment->text())); - - // If we're adding a history line right before a scemantic object, pad it - // an empty line - if (obj and next(obj) and next(obj)->isScemantic()) - currentDocument()->emplaceAt(idx); -} - void AlgorithmToolset::splitLines() { bool ok; diff -r 66d2050d3bd9 -r 52732b1db3f0 src/toolsets/algorithmtoolset.h --- a/src/toolsets/algorithmtoolset.h Sat Mar 17 11:33:05 2018 +0200 +++ b/src/toolsets/algorithmtoolset.h Sat Mar 17 11:35:07 2018 +0200 @@ -25,7 +25,6 @@ public: explicit AlgorithmToolset (MainWindow* parent); - Q_INVOKABLE void addHistoryLine(); Q_INVOKABLE void autocolor(); Q_INVOKABLE void demote(); Q_INVOKABLE void editRaw();