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