|
|
|
@ -300,7 +300,7 @@ void CSVDoc::View::setupUi()
|
|
|
|
|
setupDebugMenu();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVDoc::View::updateTitle(const std::string subview)
|
|
|
|
|
void CSVDoc::View::updateTitle()
|
|
|
|
|
{
|
|
|
|
|
std::ostringstream stream;
|
|
|
|
|
|
|
|
|
@ -312,8 +312,13 @@ void CSVDoc::View::updateTitle(const std::string subview)
|
|
|
|
|
if (mViewTotal>1)
|
|
|
|
|
stream << " [" << (mViewIndex+1) << "/" << mViewTotal << "]";
|
|
|
|
|
|
|
|
|
|
if (subview != "")
|
|
|
|
|
stream << " - " << subview;
|
|
|
|
|
CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance();
|
|
|
|
|
|
|
|
|
|
bool hideTitle = userSettings.setting ("window/hide-subview", QString ("false"))=="true" &&
|
|
|
|
|
mSubViews.size()==1 && !mSubViews.at (0)->isFloating();
|
|
|
|
|
|
|
|
|
|
if (hideTitle)
|
|
|
|
|
stream << " - " << mSubViews.at (0)->getTitle();
|
|
|
|
|
|
|
|
|
|
setWindowTitle (stream.str().c_str());
|
|
|
|
|
}
|
|
|
|
@ -323,24 +328,26 @@ void CSVDoc::View::updateSubViewIndicies(SubView *view)
|
|
|
|
|
if(view && mSubViews.contains(view))
|
|
|
|
|
mSubViews.removeOne(view);
|
|
|
|
|
|
|
|
|
|
if (mSubViews.size() == 1)
|
|
|
|
|
{
|
|
|
|
|
if(!mSubViews.at(0)->isFloating())
|
|
|
|
|
{
|
|
|
|
|
mSubViews.at(0)->setTitleBarWidget(new QWidget(this));
|
|
|
|
|
updateTitle(mSubViews.at(0)->getUniversalId().getTypeName().c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance();
|
|
|
|
|
|
|
|
|
|
bool hideTitle = userSettings.setting ("window/hide-subview", QString ("false"))=="true" &&
|
|
|
|
|
mSubViews.size()==1 && !mSubViews.at (0)->isFloating();
|
|
|
|
|
|
|
|
|
|
updateTitle();
|
|
|
|
|
|
|
|
|
|
foreach (SubView *subView, mSubViews)
|
|
|
|
|
{
|
|
|
|
|
updateTitle();
|
|
|
|
|
if(mSubViews.size() > 1)
|
|
|
|
|
if (!subView->isFloating())
|
|
|
|
|
{
|
|
|
|
|
foreach(SubView * sb, mSubViews)
|
|
|
|
|
if (hideTitle)
|
|
|
|
|
{
|
|
|
|
|
subView->setTitleBarWidget (new QWidget (this));
|
|
|
|
|
subView->setWindowTitle (QString::fromUtf8 (subView->getTitle().c_str()));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
QWidget * tb = sb->titleBarWidget();
|
|
|
|
|
if(tb) delete tb;
|
|
|
|
|
sb->setTitleBarWidget(0);
|
|
|
|
|
delete subView->titleBarWidget();
|
|
|
|
|
subView->setTitleBarWidget (0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -520,6 +527,8 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
|
|
|
|
|
|
|
|
|
|
connect (view, SIGNAL (closeRequest (SubView *)), this, SLOT (closeRequest (SubView *)));
|
|
|
|
|
|
|
|
|
|
connect (view, SIGNAL (updateTitle()), this, SLOT (updateTitle()));
|
|
|
|
|
|
|
|
|
|
view->show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -731,9 +740,11 @@ void CSVDoc::View::resizeViewHeight (int height)
|
|
|
|
|
resize (geometry().width(), height);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVDoc::View::updateUserSetting
|
|
|
|
|
(const QString &name, const QStringList &list)
|
|
|
|
|
{}
|
|
|
|
|
void CSVDoc::View::updateUserSetting (const QString &name, const QStringList &list)
|
|
|
|
|
{
|
|
|
|
|
if (name=="window/hide-subview")
|
|
|
|
|
updateSubViewIndicies (0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVDoc::View::toggleShowStatusBar (bool show)
|
|
|
|
|
{
|
|
|
|
@ -766,7 +777,10 @@ void CSVDoc::View::stop()
|
|
|
|
|
|
|
|
|
|
void CSVDoc::View::closeRequest (SubView *subView)
|
|
|
|
|
{
|
|
|
|
|
if (mSubViews.size()>1 || mViewTotal<=1)
|
|
|
|
|
CSMSettings::UserSettings &userSettings = CSMSettings::UserSettings::instance();
|
|
|
|
|
|
|
|
|
|
if (mSubViews.size()>1 || mViewTotal<=1 ||
|
|
|
|
|
userSettings.setting ("window/hide-subview", QString ("false"))!="true")
|
|
|
|
|
subView->deleteLater();
|
|
|
|
|
else if (mViewManager.closeRequest (this))
|
|
|
|
|
mViewManager.removeDocAndView (mDocument);
|
|
|
|
|