From ce7cef924e80ab551066e779446dcb86c25cb4c9 Mon Sep 17 00:00:00 2001 From: Scott Howard Date: Thu, 1 Jan 2015 22:27:08 -0500 Subject: [PATCH 1/4] when loading a file fails, pop-up critical window and highlight error text --- apps/opencs/view/doc/loader.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/opencs/view/doc/loader.cpp b/apps/opencs/view/doc/loader.cpp index ca7c93f9d..3f3163f26 100644 --- a/apps/opencs/view/doc/loader.cpp +++ b/apps/opencs/view/doc/loader.cpp @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include "../../model/doc/document.hpp" @@ -104,8 +106,10 @@ void CSVDoc::LoadingDocument::nextRecord (int records) void CSVDoc::LoadingDocument::abort (const std::string& error) { mAborted = true; - mError->setText (QString::fromUtf8 (("Loading failed: " + error).c_str())); + mError->setText (QString::fromUtf8 (("Loading failed: " + error + "").c_str())); mButtons->setStandardButtons (QDialogButtonBox::Close); + QMessageBox::critical(this, tr("OpenCS Loading Failed"), + QString::fromUtf8 (("Loading failed:\n" + error).c_str())); } void CSVDoc::LoadingDocument::addMessage (const std::string& message) @@ -199,4 +203,4 @@ void CSVDoc::Loader::loadMessage (CSMDoc::Document *document, const std::string& if (iter!=mDocuments.end()) iter->second->addMessage (message); -} \ No newline at end of file +} From 03b39435f8d6e4ce7d70492f8f784d8286028968 Mon Sep 17 00:00:00 2001 From: Scott Howard Date: Thu, 1 Jan 2015 22:50:35 -0500 Subject: [PATCH 2/4] place user settings window at same location as mouse pointer --- apps/opencs/editor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index f609b80b7..826619b5d 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -236,6 +236,7 @@ void CS::Editor::showSettings() if (mSettings.isHidden()) mSettings.show(); + mSettings.move (QCursor::pos()); mSettings.raise(); mSettings.activateWindow(); } From dece4e2640f2180ae61a8280acf79ab2f8179866 Mon Sep 17 00:00:00 2001 From: Scott Howard Date: Thu, 1 Jan 2015 22:54:32 -0500 Subject: [PATCH 3/4] remove unneeded includes --- apps/opencs/view/doc/loader.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/opencs/view/doc/loader.cpp b/apps/opencs/view/doc/loader.cpp index 3f3163f26..b062a42b8 100644 --- a/apps/opencs/view/doc/loader.cpp +++ b/apps/opencs/view/doc/loader.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include "../../model/doc/document.hpp" From f24c1845b6f754f8817ae6bc6a2564ff99ae9f29 Mon Sep 17 00:00:00 2001 From: Scott Howard Date: Fri, 2 Jan 2015 10:42:09 -0500 Subject: [PATCH 4/4] remove pop-up message on load failure --- apps/opencs/view/doc/loader.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/opencs/view/doc/loader.cpp b/apps/opencs/view/doc/loader.cpp index b062a42b8..f2b897a3e 100644 --- a/apps/opencs/view/doc/loader.cpp +++ b/apps/opencs/view/doc/loader.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include "../../model/doc/document.hpp" @@ -107,8 +106,6 @@ void CSVDoc::LoadingDocument::abort (const std::string& error) mAborted = true; mError->setText (QString::fromUtf8 (("Loading failed: " + error + "").c_str())); mButtons->setStandardButtons (QDialogButtonBox::Close); - QMessageBox::critical(this, tr("OpenCS Loading Failed"), - QString::fromUtf8 (("Loading failed:\n" + error).c_str())); } void CSVDoc::LoadingDocument::addMessage (const std::string& message)