Commit 55c43b58 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Fixed Watt dialog.

parent 17941b95
......@@ -36,6 +36,7 @@
#include "co_error.h"
#include "cow_qt_helpers.h"
#include "cow_style_qt.h"
#include "xtt_tbl_qt.h"
......
/*
* ProviewR Open Source Process Control.
* Copyright (C) 2005-2018 SSAB EMEA AB.
*
* This file is part of ProviewR.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProviewR. If not, see <http://www.gnu.org/licenses/>
*
* Linking ProviewR statically or dynamically with other modules is
* making a combined work based on ProviewR. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* ProviewR give you permission to, from the build function in the
* ProviewR Configurator, combine ProviewR with modules generated by the
* ProviewR PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of ProviewR (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#include <math.h>
#include <float.h>
#include "pwr.h"
#include "pwr_systemclasses.h"
#include "pwr_baseclasses.h"
#include "co_time.h"
#include "rt_lck.h"
#include "rt_plc.h"
#include "rt_plc_rt.h"
#include "rt_plc_dirlink.h"
#include "rt_plc_ioarea.h"
#include "rt_plc_timer.h"
#include "rt_plc_arithm.h"
#include "rt_plc_io.h"
#include "rt_plc_pid.h"
#include "rt_plc_data.h"
#include "rt_plc_drive.h"
#include "rt_plc_macro_logic.h"
#include "rt_plc_macro_io.h"
#include "rt_plc_macro_grafcet.h"
#include "rt_plc_macro_sup.h"
#include "rt_plc_macro_div.h"
#include "rt_plc_macro_mps.h"
#include "rt_plc_macro_string.h"
#include "rt_plc_macro_time.h"
#include "pwr_nmpsclasses.h"
#include "nmps_plc_macro.h"
#include "nmps.h"
#include "pwr_profibusclasses.h"
#include "pwr_remoteclasses.h"
#include "remote_plc_macro.h"
#include "pwr_basecomponentclasses.h"
#include "rt_plc_bcomp.h"
#include "ra_plc_user.h"
......@@ -260,8 +260,6 @@ void WAttQt::change_value_close()
void WAttQtWidget::activate_cmd_entry()
{
watt->wattnav->set_inputfocus();
char* text = qPrintableLatin1(watt->cmd_entry->text());
if (watt->input_open) {
......@@ -279,6 +277,8 @@ void WAttQtWidget::activate_cmd_entry()
watt->cmd_prompt->setVisible(false);
watt->cmd_entry->setVisible(false);
watt->wattnav->set_inputfocus();
if (!text) {
watt->message('E', "Input error, invalid character");
}
......
......@@ -1599,6 +1599,7 @@ bool FlowDrawQt::draw_timer_cb()
(timer_cb->callback_func)(timer_cb->ctx);
draw_ctx->toplevel->update();
delete timer_cb->timer_id;
delete timer_cb;
return FALSE;
}
......@@ -1632,10 +1633,6 @@ void FlowDrawQt::event_timer(QMouseEvent* event, QWidget *target)
void FlowDrawQt::set_timer(
FlowCtx* ctx, int time_ms, void (*callback_func)(FlowCtx* ctx), void** id)
{
if (timer_cb) {
delete timer_cb->timer_id;
delete timer_cb;
}
timer_cb = new flow_draw_sTimerCb();
timer_cb->ctx = ctx;
timer_cb->callback_func = callback_func;
......
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