1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 21:45:35 +00:00
openmw/apps/opencs/view/doc/subview.cpp
cc9cii 680e46441d 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.
2015-05-12 08:21:05 +10:00

47 lines
1.1 KiB
C++

#include "subview.hpp"
#include "view.hpp"
CSVDoc::SubView::SubView (const CSMWorld::UniversalId& id)
: mUniversalId (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);
}
CSMWorld::UniversalId CSVDoc::SubView::getUniversalId() const
{
return mUniversalId;
}
void CSVDoc::SubView::setStatusBar (bool show) {}
void CSVDoc::SubView::useHint (const std::string& hint) {}
void CSVDoc::SubView::updateUserSetting (const QString &, const QStringList &)
{}
void CSVDoc::SubView::setUniversalId (const CSMWorld::UniversalId& id)
{
mUniversalId = id;
setWindowTitle (QString::fromUtf8(mUniversalId.toString().c_str()));
}
void CSVDoc::SubView::closeEvent (QCloseEvent *event)
{
emit updateSubViewIndicies (this);
}
std::string CSVDoc::SubView::getTitle() const
{
return mUniversalId.toString();
}
void CSVDoc::SubView::closeRequest()
{
emit closeRequest (this);
}