Set the title when adding a chart

Fixes #967
This commit is contained in:
Mark Liversedge
2014-07-10 20:13:45 +01:00
parent 3182491792
commit 515f9f77fc
3 changed files with 11 additions and 0 deletions

View File

@@ -113,6 +113,15 @@ QStringList windowsForType(int type)
return returning;
}
QString
GcWindowRegistry::title(GcWinID id)
{
for(int i=0; GcWindows[i].relevance; i++) {
if (GcWindows[i].relevance && GcWindows[i].id == id)
return GcWindows[i].name;
}
}
QList<GcWinID> idsForType(int type)
{
QList<GcWinID> returning;

View File

@@ -84,6 +84,7 @@ class GcWindowRegistry {
static GcWindow *newGcWindow(GcWinID id, Context *context);
static QStringList windowsForType(int type);
static QList<GcWinID> idsForType(int type);
static QString title(GcWinID id);
};
extern GcWindowRegistry* GcWindows;

View File

@@ -1041,6 +1041,7 @@ GcWindowDialog::GcWindowDialog(GcWinID type, Context *context, GcWindow **here)
title = new QLineEdit(this);
chartLayout->addWidget(title);
title->setText(GcWindowRegistry::title(type));
win = GcWindowRegistry::newGcWindow(type, context);
chartLayout->addWidget(win);