X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt%2FGuiCompare.cpp;h=e485ec0a548c6de028a6ae5ed6952dfcfd8a84b4;hb=5cb80b867f4a59c3253487652ba74a29ad5b3f0f;hp=e48be86f22ac7efe9ec3eef1220525d061d1d4a7;hpb=78f457796c87bd86a10c7b24bf70f9bf60894f4f;p=lyx.git diff --git a/src/frontends/qt/GuiCompare.cpp b/src/frontends/qt/GuiCompare.cpp index e48be86f22..e485ec0a54 100644 --- a/src/frontends/qt/GuiCompare.cpp +++ b/src/frontends/qt/GuiCompare.cpp @@ -12,10 +12,13 @@ #include "GuiCompare.h" +#include "GuiApplication.h" + #include "Buffer.h" #include "BufferView.h" #include "BufferList.h" #include "buffer_funcs.h" +#include "ColorCache.h" #include "Compare.h" #include "FuncRequest.h" #include "GuiView.h" @@ -318,11 +321,18 @@ int GuiCompare::run(bool blocking_mode) return 0; dest_buffer_->changed(true); - dest_buffer_->markDirty(); + if (blocking_mode) + //blocking mode is infinitive and we don't want diff autosave + //if user decides to kill ther running lyx instance + dest_buffer_->markClean(); + else + dest_buffer_->markDirty(); + // get the options from the dialog CompareOptions options; options.settings_from_new = newSettingsRB->isChecked(); + options.author = authorCO->currentIndex(); // init the compare object and start it @@ -364,10 +374,14 @@ bool GuiCompare::initialiseParams(std::string const &par) return false; } - // Wait for the Compare function to process in a thread (2 minute timeout) - compare_->wait(120000); + // Wait for the Compare function to process in a thread + compare_->wait(); finished(false); + //Hiding dialog does not work as intended through finished routine, because showView + //is triggered after initialiseParams returns true. So we return false, warning will + //show on the terminal though. + return false; } } @@ -375,6 +389,19 @@ bool GuiCompare::initialiseParams(std::string const &par) progressBar->setEnabled(false); progressBar->setMaximum(1); + // If empty fill the author combobox with the current and the comparison + // author and their respective colors + if (authorCO->count() == 0) { + authorCO->clear(); + QPixmap colorIcon(32, 32); + colorIcon.fill(guiApp->colorCache().get( + Color(Color_changedtext_workarea_author1))); + authorCO->addItem(colorIcon, qt_("Current Author")); + colorIcon.fill(guiApp->colorCache().get( + Color(Color_changedtext_workarea_comparison))); + authorCO->addItem(colorIcon, qt_("Document Comparison")); + } + return true; }