From 680e46441d395ea3567cb25b12c0834db4f25b4a Mon Sep 17 00:00:00 2001 From: cc9cii Date: Tue, 12 May 2015 08:21:05 +1000 Subject: [PATCH 1/3] Feature #2533. Similar but less complete implementation PR was not accepted (see https://github.com/OpenMW/openmw/pull/276#issuecomment-57612802). - User preferences setting to save the window state (position, geometry, etc) at the time of exit. - User preferences setting to workaround some X window managers not keeping pre-maximised state. - Uses opencs.ini to store window states between sessions. --- apps/opencs/model/settings/usersettings.cpp | 25 ++++++ apps/opencs/model/settings/usersettings.hpp | 2 + apps/opencs/view/doc/operations.cpp | 1 + apps/opencs/view/doc/subview.cpp | 2 + apps/opencs/view/doc/view.cpp | 90 ++++++++++++++++++--- apps/opencs/view/doc/view.hpp | 10 +++ apps/opencs/view/doc/viewmanager.cpp | 21 +++++ 7 files changed, 139 insertions(+), 12 deletions(-) diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 9e00b7d1a..491e70a88 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -143,6 +143,16 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() minWidth->setDefaultValue (325); minWidth->setRange (50, 10000); minWidth->setToolTip ("Minimum width of subviews."); + + Setting *saveState = createSetting (Type_CheckBox, "save-state", "Save window size and position"); + saveState->setDefaultValue ("true"); + saveState->setToolTip ("Remember window size and position between editing sessions."); + + Setting *saveX = createSetting (Type_CheckBox, "x-save-state-workaround", "X windows workaround"); + saveX->setDefaultValue ("false"); + saveX->setToolTip ("Some X window managers don't remember the windows state before being" + " maximized. In such environments exiting while maximized will correctly start in a maximized" + " window, but restoring back to the normal size won't work. Try this workaround."); } declareSection ("records", "Records"); @@ -458,6 +468,21 @@ QString CSMSettings::UserSettings::setting(const QString &viewKey, const QString return QString(); } +QVariant CSMSettings::UserSettings::value(const QString &viewKey, const QVariant &value) +{ + if(value != QVariant()) + { + mSettingDefinitions->setValue (viewKey, value); + return value; + } + else if(mSettingDefinitions->contains(viewKey)) + { + return mSettingDefinitions->value (viewKey); + } + + return QVariant(); +} + bool CSMSettings::UserSettings::hasSettingDefinitions (const QString &viewKey) const { return (mSettingDefinitions->contains (viewKey)); diff --git a/apps/opencs/model/settings/usersettings.hpp b/apps/opencs/model/settings/usersettings.hpp index 5188a9842..c4c5ea583 100644 --- a/apps/opencs/model/settings/usersettings.hpp +++ b/apps/opencs/model/settings/usersettings.hpp @@ -82,6 +82,8 @@ namespace CSMSettings { QString setting(const QString &viewKey, const QString &value = QString()); + QVariant value(const QString &viewKey, const QVariant &value = QVariant()); + private: void buildSettingModelDefaults(); diff --git a/apps/opencs/view/doc/operations.cpp b/apps/opencs/view/doc/operations.cpp index 7ee4b8726..934c94a96 100644 --- a/apps/opencs/view/doc/operations.cpp +++ b/apps/opencs/view/doc/operations.cpp @@ -19,6 +19,7 @@ CSVDoc::Operations::Operations() setVisible (false); setFixedHeight (widgetContainer->height()); setTitleBarWidget (new QWidget (this)); + setObjectName (QString("operations")); // needed to suppress warning while saving window state } void CSVDoc::Operations::setProgress (int current, int max, int type, int threads) diff --git a/apps/opencs/view/doc/subview.cpp b/apps/opencs/view/doc/subview.cpp index df1e7ee49..230812eb0 100644 --- a/apps/opencs/view/doc/subview.cpp +++ b/apps/opencs/view/doc/subview.cpp @@ -8,6 +8,8 @@ CSVDoc::SubView::SubView (const CSMWorld::UniversalId& id) /// \todo add a button to the title bar that clones this sub view setWindowTitle (QString::fromUtf8 (mUniversalId.toString().c_str())); + // set object name to suppress warning while saving window state + setObjectName (QString::fromUtf8 (mUniversalId.toString().c_str())); setAttribute(Qt::WA_DeleteOnClose); } diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index 5636fff94..02852ab52 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -32,6 +32,23 @@ void CSVDoc::View::closeEvent (QCloseEvent *event) event->ignore(); else { + if (mSaveWindowState) + { + CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance(); + if (isMaximized() && mXWorkaround) + { + userSettings.setDefinitions("window/maximized", (QStringList() << "true")); + userSettings.saveDefinitions(); // store previously saved geometry & state + } + else + { + userSettings.value("window/geometry", saveGeometry()); + userSettings.value("window/state", saveState()); + userSettings.setDefinitions("window/maximized", (QStringList() << "false")); + userSettings.saveDefinitions(); + } + } + // closeRequest() returns true if last document mViewManager.removeDocAndView(mDocument); } @@ -381,22 +398,35 @@ void CSVDoc::View::updateActions() CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews) : mViewManager (viewManager), mDocument (document), mViewIndex (totalViews-1), - mViewTotal (totalViews) + mViewTotal (totalViews), mSaveWindowState(false), mXWorkaround(false) { - int width = CSMSettings::UserSettings::instance().settingValue - ("window/default-width").toInt(); + CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance(); + mXWorkaround = userSettings.settingValue ("window/x-save-state-workaround").toStdString() == "true"; + mSaveWindowState = userSettings.setting ("window/save-state", "true").toStdString() == "true"; - int height = CSMSettings::UserSettings::instance().settingValue - ("window/default-height").toInt(); + // check if saved state should be used and whether it is the first time + if (mSaveWindowState && userSettings.hasSettingDefinitions ("window/maximized")) + { + restoreGeometry(userSettings.value("window/geometry").toByteArray()); + restoreState(userSettings.value("window/state").toByteArray()); - width = std::max(width, 300); - height = std::max(height, 300); + if (mXWorkaround && userSettings.settingValue ("window/maximized").toStdString() == "true") + setWindowState(windowState() | Qt::WindowMaximized); + } + else + { + int width = userSettings.settingValue ("window/default-width").toInt(); + int height = userSettings.settingValue ("window/default-height").toInt(); - // trick to get the window decorations and their sizes - show(); - hide(); - resize (width - (frameGeometry().width() - geometry().width()), - height - (frameGeometry().height() - geometry().height())); + width = std::max(width, 300); + height = std::max(height, 300); + + // trick to get the window decorations and their sizes + show(); + hide(); + resize (width - (frameGeometry().width() - geometry().width()), + height - (frameGeometry().height() - geometry().height())); + } mSubViewWindow.setDockOptions (QMainWindow::AllowNestedDocks); @@ -770,6 +800,12 @@ void CSVDoc::View::updateUserSetting (const QString &name, const QStringList &li if (name=="window/hide-subview") updateSubViewIndicies (0); + if (name == "window/save-state") + mSaveWindowState = list.at(0) == "true"; + + if (name == "window/x-save-state-workaround") + mXWorkaround = list.at(0) == "true"; + foreach (SubView *subView, mSubViews) { subView->updateUserSetting (name, list); @@ -815,3 +851,33 @@ void CSVDoc::View::closeRequest (SubView *subView) else if (mViewManager.closeRequest (this)) mViewManager.removeDocAndView (mDocument); } + +// for more reliable detetion of isMaximized(), see https://bugreports.qt.io/browse/QTBUG-30085 +void CSVDoc::View::saveWindowState() +{ + if (!isMaximized()) + { + // update but don't save to config file yet + CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance(); + userSettings.value("window/geometry", saveGeometry()); + userSettings.value("window/state", saveState()); + } +} + +// For X11 where Qt does not remember pre-maximised state +void CSVDoc::View::moveEvent (QMoveEvent *event) +{ + if (mXWorkaround && mSaveWindowState) + QMetaObject::invokeMethod(this, "saveWindowState", Qt::QueuedConnection); + + QMainWindow::moveEvent(event); +} + +// For X11 where Qt does not remember pre-maximised state +void CSVDoc::View::resizeEvent (QResizeEvent *event) +{ + if (mXWorkaround && mSaveWindowState) + QMetaObject::invokeMethod(this, "saveWindowState", Qt::QueuedConnection); + + QMainWindow::resizeEvent(event); +} diff --git a/apps/opencs/view/doc/view.hpp b/apps/opencs/view/doc/view.hpp index 32d7159c2..398f4fa67 100644 --- a/apps/opencs/view/doc/view.hpp +++ b/apps/opencs/view/doc/view.hpp @@ -48,6 +48,9 @@ namespace CSVDoc QMainWindow mSubViewWindow; GlobalDebugProfileMenu *mGlobalDebugProfileMenu; + bool mSaveWindowState; + bool mXWorkaround; + // not implemented View (const View&); @@ -112,6 +115,11 @@ namespace CSVDoc /// Function called by view manager when user preferences are updated void updateEditorSetting (const QString &, const QString &); + protected: + + virtual void moveEvent(QMoveEvent * event); + virtual void resizeEvent(QResizeEvent * event); + signals: void newGameRequest(); @@ -228,6 +236,8 @@ namespace CSVDoc void stop(); void closeRequest (SubView *subView); + + void saveWindowState(); }; } diff --git a/apps/opencs/view/doc/viewmanager.cpp b/apps/opencs/view/doc/viewmanager.cpp index 6362f9659..106f147f9 100644 --- a/apps/opencs/view/doc/viewmanager.cpp +++ b/apps/opencs/view/doc/viewmanager.cpp @@ -405,6 +405,27 @@ bool CSVDoc::ViewManager::removeDocument (CSVDoc::View *view) else remainingViews.push_back(*iter); } + + // FIXME: seems removeDocument() and closeRequest() are duplicated functionality + CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance(); + if (remainingViews.empty() && !mViews.empty() && + userSettings.settingValue ("window/save-state").toStdString() == "true") + { + if (userSettings.settingValue ("window/x-save-state-workaround").toStdString() == "true" + && mViews.back()->isMaximized()) + { + userSettings.setDefinitions("window/maximized", (QStringList() << "true")); + userSettings.saveDefinitions(); // store previously saved geometry & state + } + else + { + userSettings.value("window/geometry", mViews.back()->saveGeometry()); + userSettings.value("window/state", mViews.back()->saveState()); + userSettings.setDefinitions("window/maximized", (QStringList() << "false")); + userSettings.saveDefinitions(); + } + } + mDocumentManager.removeDocument(document); mViews = remainingViews; } From 65a88aaedb18c4df0514d78ec716348ceafa9e92 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Tue, 12 May 2015 23:47:36 +1000 Subject: [PATCH 2/3] Feature #2532. Global filter shortcuts for project::added and project::modified. - Initial global filter shortcuts are set in the user preferences setting. These are applied when a table is first opened. - Subsequent changes are done per table view via tickboxes next to the record filter box. --- apps/opencs/model/settings/usersettings.cpp | 15 +++- apps/opencs/view/world/table.cpp | 84 ++++++++++++++++++++- apps/opencs/view/world/table.hpp | 7 ++ apps/opencs/view/world/tablesubview.cpp | 23 +++++- 4 files changed, 122 insertions(+), 7 deletions(-) diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 491e70a88..5eb795046 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -241,13 +241,26 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() Setting *lineNum = createSetting (Type_CheckBox, "show-linenum", "Show Line Numbers"); lineNum->setDefaultValue ("true"); lineNum->setToolTip ("Show line numbers to the left of the script editor window." - "The current row and column numbers of the text cursor are shown at the bottom."); + " The current row and column numbers of the text cursor are shown at the bottom."); Setting *monoFont = createSetting (Type_CheckBox, "mono-font", "Use monospace font"); monoFont->setDefaultValue ("true"); monoFont->setToolTip ("Whether to use monospaced fonts on script edit subview."); } + declareSection ("filter", "Global Filter"); + { + Setting *projAdded = createSetting (Type_CheckBox, "project-added", "Project::added initial value"); + projAdded->setDefaultValue ("false"); + projAdded->setToolTip ("Show records added by the project when a table is first opened." + " Other records are filterd out."); + + Setting *projModified = createSetting (Type_CheckBox, "project-modified", "Project::modified initial value"); + projModified->setDefaultValue ("false"); + projModified->setToolTip ("Show records modified by the project when a table is first opened." + " Other records are filterd out."); + } + { /****************************************************************** * There are three types of values: diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index 5a650f98a..2314a9397 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -21,6 +21,10 @@ #include "../../model/world/tablemimedata.hpp" #include "../../model/world/tablemimedata.hpp" #include "../../model/world/commanddispatcher.hpp" +#include "../../model/filter/parser.hpp" +#include "../../model/filter/andnode.hpp" +#include "../../model/filter/ornode.hpp" +#include "../../model/settings/usersettings.hpp" #include "recordstatusdelegate.hpp" #include "util.hpp" @@ -362,6 +366,24 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id, mDoubleClickActions.insert (std::make_pair (Qt::ShiftModifier, Action_EditRecord)); mDoubleClickActions.insert (std::make_pair (Qt::ControlModifier, Action_View)); mDoubleClickActions.insert (std::make_pair (Qt::ShiftModifier | Qt::ControlModifier, Action_EditRecordAndClose)); + + CSMFilter::Parser parser(mDocument.getData()); + + CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance(); + if(userSettings.settingValue ("filter/project-added") == "true") + { + parser.parse("!string(\"Modified\", \"Added\")"); + mAdded = parser.getFilter(); + } + + if(userSettings.settingValue ("filter/project-modified") == "true") + { + parser.parse("!string(\"Modified\", \"Modified\")"); + mModified = parser.getFilter(); + } + + if(mAdded || mModified) + recordFilterChanged(boost::shared_ptr()); } void CSVWorld::Table::setEditLock (bool locked) @@ -517,8 +539,7 @@ void CSVWorld::Table::previewRecord() } } -void CSVWorld::Table::updateUserSetting - (const QString &name, const QStringList &list) +void CSVWorld::Table::updateUserSetting (const QString &name, const QStringList &list) { if (name=="records/type-format" || name=="records/status-format") { @@ -626,7 +647,37 @@ void CSVWorld::Table::requestFocus (const std::string& id) void CSVWorld::Table::recordFilterChanged (boost::shared_ptr filter) { - mProxyModel->setFilter (filter); + mFilter = filter; + + boost::shared_ptr global; + if(mAdded && mModified) + { + std::vector > nodes; + nodes.push_back(mAdded); + nodes.push_back(mModified); + global = boost::shared_ptr(new CSMFilter::OrNode (nodes)); + } + else if(mAdded) + { + global = mAdded; + } + else if(mModified) + { + global = mModified; + } + + if(filter && global) + { + std::vector > nodes; + nodes.push_back(filter); + nodes.push_back(global); + boost::shared_ptr combined(new CSMFilter::AndNode (nodes)); + mProxyModel->setFilter (combined); + } + else if(global) + mProxyModel->setFilter (global); + else + mProxyModel->setFilter (filter); tableSizeUpdate(); selectionSizeUpdate(); } @@ -700,3 +751,30 @@ std::vector< CSMWorld::UniversalId > CSVWorld::Table::getDraggedRecords() const return idToDrag; } +void CSVWorld::Table::globalFilterAddedChanged(int state) +{ + if(state == Qt::Checked && !mAdded) + { + CSMFilter::Parser parser(mDocument.getData()); + parser.parse("!string(\"Modified\", \"Added\")"); + mAdded = parser.getFilter(); + } + else if(state == Qt::Unchecked) + mAdded.reset(); + + recordFilterChanged(mFilter); +} + +void CSVWorld::Table::globalFilterModifiedChanged(int state) +{ + if(state == Qt::Checked && !mModified) + { + CSMFilter::Parser parser(mDocument.getData()); + parser.parse("!string(\"Modified\", \"Modified\")"); + mModified = parser.getFilter(); + } + else if(state == Qt::Unchecked) + mModified.reset(); + + recordFilterChanged(mFilter); +} diff --git a/apps/opencs/view/world/table.hpp b/apps/opencs/view/world/table.hpp index 75161b8b6..e87828e2f 100644 --- a/apps/opencs/view/world/table.hpp +++ b/apps/opencs/view/world/table.hpp @@ -68,6 +68,10 @@ namespace CSVWorld CSMWorld::UniversalId mEditCellId; std::map mDoubleClickActions; + boost::shared_ptr mFilter; + boost::shared_ptr mAdded; + boost::shared_ptr mModified; + private: void contextMenuEvent (QContextMenuEvent *event); @@ -139,6 +143,9 @@ namespace CSVWorld void recordFilterChanged (boost::shared_ptr filter); void updateUserSetting (const QString &name, const QStringList &list); + + void globalFilterAddedChanged (int state); + void globalFilterModifiedChanged (int state); }; } diff --git a/apps/opencs/view/world/tablesubview.cpp b/apps/opencs/view/world/tablesubview.cpp index 729b6b8d7..2d3ec8cc5 100644 --- a/apps/opencs/view/world/tablesubview.cpp +++ b/apps/opencs/view/world/tablesubview.cpp @@ -1,11 +1,14 @@ #include "tablesubview.hpp" +#include +#include #include #include #include "../../model/doc/document.hpp" #include "../../model/world/tablemimedata.hpp" +#include "../../model/settings/usersettings.hpp" #include "../filter/filterbox.hpp" #include "table.hpp" @@ -28,7 +31,19 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D mFilterBox = new CSVFilter::FilterBox (document.getData(), this); - layout->insertWidget (0, mFilterBox); + QHBoxLayout *hLayout = new QHBoxLayout; + QCheckBox *added = new QCheckBox("A"); + QCheckBox *modified = new QCheckBox("M"); + CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance(); + added->setCheckState( + userSettings.settingValue ("filter/project-added") == "true" ? Qt::Checked : Qt::Unchecked); + modified->setCheckState( + userSettings.settingValue ("filter/project-modified") == "true" ? Qt::Checked : Qt::Unchecked); + + hLayout->insertWidget(0,mFilterBox); + hLayout->insertWidget(1,added); + hLayout->insertWidget(2,modified); + layout->insertLayout (0, hLayout); QWidget *widget = new QWidget; @@ -44,6 +59,9 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D connect (mTable, SIGNAL (tableSizeChanged (int, int, int)), mBottom, SLOT (tableSizeChanged (int, int, int))); + connect(added, SIGNAL (stateChanged(int)), mTable, SLOT (globalFilterAddedChanged(int))); + connect(modified, SIGNAL (stateChanged(int)), mTable, SLOT (globalFilterModifiedChanged(int))); + mTable->tableSizeUpdate(); mTable->selectionSizeUpdate(); mTable->viewport()->installEventFilter(this); @@ -84,8 +102,7 @@ void CSVWorld::TableSubView::editRequest (const CSMWorld::UniversalId& id, const focusId (id, hint); } -void CSVWorld::TableSubView::updateUserSetting - (const QString &name, const QStringList &list) +void CSVWorld::TableSubView::updateUserSetting (const QString &name, const QStringList &list) { mTable->updateUserSetting(name, list); } From 60f963382b58d9a024e575f7708c03a94de4932c Mon Sep 17 00:00:00 2001 From: cc9cii Date: Thu, 14 May 2015 19:36:39 +1000 Subject: [PATCH 3/3] Feature #2532. Global filter shortcuts for project::added and project::modified. - Add a startup warning message if global filters are being used. - Add tooltip messages for the checkbox shortcuts. --- apps/opencs/editor.cpp | 47 +++++++++++++++++++++ apps/opencs/editor.hpp | 2 + apps/opencs/model/settings/usersettings.cpp | 4 +- apps/opencs/view/world/tablesubview.cpp | 2 + 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index 1d31c8396..51bfc96cc 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -7,6 +7,9 @@ #include #include #include +#include +#include +#include #include #include @@ -213,6 +216,7 @@ void CS::Editor::createNewFile (const boost::filesystem::path &savePath) mDocumentManager.addDocument (files, savePath, true); mFileDialog.hide(); + showSplashMessage(); } void CS::Editor::createNewGame (const boost::filesystem::path& file) @@ -224,6 +228,7 @@ void CS::Editor::createNewGame (const boost::filesystem::path& file) mDocumentManager.addDocument (files, file, true); mNewGame.hide(); + showSplashMessage(); } void CS::Editor::showStartup() @@ -435,9 +440,51 @@ std::auto_ptr CS::Editor::setupGraphics() void CS::Editor::documentAdded (CSMDoc::Document *document) { mViewManager.addView (document); + showSplashMessage(); } void CS::Editor::lastDocumentDeleted() { QApplication::quit(); } + +void CS::Editor::showSplashMessage() +{ + CSMSettings::UserSettings &settings = CSMSettings::UserSettings::instance(); + if(settings.settingValue ("filter/project-added") == "true" || + settings.settingValue ("filter/project-modified") == "true") + { + QPixmap img(QPixmap(":./openmw-cs.png")); + + QString msgTop("You have active global filters."); + QString msgBottom("Some rows may be hidden!"); + QFont splashFont(QFont("Arial", 16, QFont::Bold)); // TODO: use system font? + //splashFont.setStretch(125); + + QFontMetrics fm(splashFont); + int msgWidth = std::max(fm.width(msgTop), fm.width(msgBottom)); + img.scaledToWidth(msgWidth); + + QSplashScreen *splash = new QSplashScreen(img, Qt::WindowStaysOnTopHint); + splash->setFont(splashFont); + splash->resize(msgWidth+20, splash->height()+fm.lineSpacing()*2+20); // add some margin + + // try to center the message near the center of the saved window + QWidget dummy; + bool xWorkaround = settings.settingValue ("window/x-save-state-workaround").toStdString() == "true"; + if (settings.settingValue ("window/save-state").toStdString() == "true" && + !(xWorkaround && settings.settingValue ("window/maximized").toStdString() == "true")) + { + dummy.restoreGeometry(settings.value("window/geometry").toByteArray()); + splash->move(dummy.x()+std::max(0, (dummy.width()-msgWidth)/2), + dummy.y()+std::max(0, (dummy.height()-splash->height())/2)); + } + else + splash->move(std::max(0, splash->x()-msgWidth/2), splash->y()); + + splash->show(); + splash->showMessage(msgTop+"\n"+msgBottom, Qt::AlignHCenter|Qt::AlignBottom, Qt::red); + QTimer::singleShot(4000, splash, SLOT(close())); // 4 seconds should be enough + splash->raise(); // for X windows + } +} diff --git a/apps/opencs/editor.hpp b/apps/opencs/editor.hpp index 273f0825b..3935ac56a 100644 --- a/apps/opencs/editor.hpp +++ b/apps/opencs/editor.hpp @@ -60,6 +60,8 @@ namespace CS boost::filesystem::ofstream mPidFile; bool mFsStrict; + void showSplashMessage(); + void setupDataFiles (const Files::PathContainer& dataDirs); std::pair > readConfig(); diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 5eb795046..f3de34484 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -252,12 +252,12 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() { Setting *projAdded = createSetting (Type_CheckBox, "project-added", "Project::added initial value"); projAdded->setDefaultValue ("false"); - projAdded->setToolTip ("Show records added by the project when a table is first opened." + projAdded->setToolTip ("Show records added by the project when opening a table." " Other records are filterd out."); Setting *projModified = createSetting (Type_CheckBox, "project-modified", "Project::modified initial value"); projModified->setDefaultValue ("false"); - projModified->setToolTip ("Show records modified by the project when a table is first opened." + projModified->setToolTip ("Show records modified by the project when opening a table." " Other records are filterd out."); } diff --git a/apps/opencs/view/world/tablesubview.cpp b/apps/opencs/view/world/tablesubview.cpp index 2d3ec8cc5..40b52709e 100644 --- a/apps/opencs/view/world/tablesubview.cpp +++ b/apps/opencs/view/world/tablesubview.cpp @@ -34,6 +34,8 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D QHBoxLayout *hLayout = new QHBoxLayout; QCheckBox *added = new QCheckBox("A"); QCheckBox *modified = new QCheckBox("M"); + added->setToolTip("Apply filter project::added. Changes to\nthis filter setting is not saved in preferences."); + modified->setToolTip("Apply filter project::modified. Changes to\nthis filter setting is not saved in preferences."); CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance(); added->setCheckState( userSettings.settingValue ("filter/project-added") == "true" ? Qt::Checked : Qt::Unchecked);