Commit 866ec6ab authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Clean up ge_subgraphs slightly.

parent 6da3f072
......@@ -198,7 +198,6 @@ WAttTextQt::WAttTextQt(QWidget* wa_parent_wid, void* wa_parent_ctx,
}
toplevel = new WAttTextQtWidget(this, wa_parent_wid);
toplevel->setToolTip(fl("wb_watttext widget"));
toplevel->setMinimumSize(800, 700);
toplevel->setWindowTitle(fl(namep));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
......
......@@ -69,7 +69,6 @@ NodelistQt::NodelistQt(void* nodelist_parent_ctx, QWidget* nodelist_parent_wid,
pwr_tStatus sts;
toplevel = new NodelistQtWidget(this, nodelist_parent_wid);
toplevel->setToolTip(fl("cow_statusmon_nodelist widget"));
toplevel->setMinimumSize(850, 300);
toplevel->setWindowTitle(fl(nodelist_name));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
......
......@@ -315,7 +315,6 @@ AttrQt::AttrQt(QWidget* a_parent_wid, void* a_parent_ctx, attr_eType a_type,
if (!embedded) {
toplevel = new AttrQtWidget(this, a_parent_wid);
toplevel->setToolTip(fl("ge_attr widget"));
toplevel->setMinimumSize(500, 700);
toplevel->setWindowTitle(fl("Object Attributes"));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
......
......@@ -749,7 +749,6 @@ GeCurveQt::GeCurveQt(void* gc_parent_ctx, QWidget* parent_widget,
// Qt
toplevel = new GeCurveQtWidget(this, parent_widget);
toplevel->setToolTip(fl("ge_curve widget"));
if (!(options & curve_mOptions_Embedded)) {
toplevel->setMinimumSize(window_width, window_height);
toplevel->setWindowTitle(convert_utf8(title));
......
......@@ -139,6 +139,10 @@ void GeQt::subgraphs_new()
{
int sts;
if (subgraphs_widget) {
subgraphs_widget->close();
}
subgraphs = new SubGraphsQt(this, toplevel, "SubGraphs",
(void*)graph->grow->ctx, &subgraphs_widget, &sts);
subgraphs->message_cb = &Ge::message_cb;
......@@ -1262,8 +1266,8 @@ GeQt::~GeQt()
wow->DeleteList(open_dialog);
}
if (subgraphs) {
delete subgraphs;
if (subgraphs_widget) {
subgraphs_widget->close();
}
delete subpalette;
delete recall_entry;
......
......@@ -51,10 +51,10 @@
void SubGraphsQtWidget::closeEvent(QCloseEvent* event)
{
debug_print("SubGraphsQtWidget::closeEvent\n");
if (subgraphs->close_cb) {
(subgraphs->close_cb)(subgraphs);
} else {
trace_timerid->stop();
delete subgraphs;
}
QWidget::closeEvent(event);
......@@ -118,8 +118,6 @@ SubGraphsQt::SubGraphsQt(void* xn_parent_ctx, QWidget* xn_parent_wid,
parent_wid(xn_parent_wid)
{
toplevel = new SubGraphsQtWidget(this, xn_parent_wid);
toplevel->setToolTip(fl("ge_subgraphs widget"));
toplevel->setMinimumSize(300, 500);
toplevel->setWindowTitle(fl(name));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
......@@ -147,7 +145,6 @@ SubGraphsQt::SubGraphsQt(void* xn_parent_ctx, QWidget* xn_parent_wid,
addMenuItem(
toplevel, help, "&Help", SLOT(subgraphs_activate_help()), "CTRL+H");
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget
= scrolledbrowwidgetqt_new(SubGraphs::init_brow_cb, this, &brow_widget);
......@@ -165,14 +162,10 @@ SubGraphsQt::SubGraphsQt(void* xn_parent_ctx, QWidget* xn_parent_wid,
SubGraphsQt::~SubGraphsQt()
{
debug_print("SubGraphsQt::~SubGraphsQt\n");
subgraphs_tAttr attrlist_p, next_p;
// Delete all attr-widgets in attrlist
attrlist_p = attrlist;
next_p = NULL;
subgraphs_tAttr attrlist_p = attrlist;
while (attrlist_p) {
next_p = attrlist_p->next;
subgraphs_tAttr next_p = attrlist_p->next;
delete attrlist_p->attrctx;
free((char*)attrlist_p);
attrlist_p = next_p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment