Line 1... |
Line 1... |
/**
|
/*
|
* @file
|
* Copyright 2018 Sergey Khabarov, sergeykhbr@gmail.com
|
* @copyright Copyright 2017 GNSS Sensor Ltd. All right reserved.
|
*
|
* @author Sergey Khabarov - sergeykhbr@gmail.com
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
* @brief QT Wrapper connects QT libs to debugger core library.
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
*/
|
*/
|
|
|
#include "api_core.h"
|
#include "api_core.h"
|
#include "qt_wrapper.h"
|
#include "qt_wrapper.h"
|
#include "moc_qt_wrapper.h"
|
#include "moc_qt_wrapper.h"
|
Line 20... |
Line 29... |
/** It's a blocking event that runs only once */
|
/** It's a blocking event that runs only once */
|
void ui_events_update(void *args) {
|
void ui_events_update(void *args) {
|
QtWrapper *ui = reinterpret_cast<QtWrapper *>(args);
|
QtWrapper *ui = reinterpret_cast<QtWrapper *>(args);
|
ui->eventsUpdate();
|
ui->eventsUpdate();
|
RISCV_event_set(&eventAppDestroyed_);
|
RISCV_event_set(&eventAppDestroyed_);
|
|
//RISCV_event_close(&eventAppDestroyed_);
|
}
|
}
|
|
|
QtWrapper::QtWrapper(IGui *igui)
|
QtWrapper::QtWrapper(IGui *igui)
|
: QObject() {
|
: QObject() {
|
igui_ = igui;
|
igui_ = igui;
|
Line 48... |
Line 58... |
mainWindow_ = new DbgMainWindow(igui_);
|
mainWindow_ = new DbgMainWindow(igui_);
|
connect(mainWindow_, SIGNAL(signalAboutToClose()),
|
connect(mainWindow_, SIGNAL(signalAboutToClose()),
|
this, SLOT(slotMainWindowAboutToClose()));
|
this, SLOT(slotMainWindowAboutToClose()));
|
|
|
mainWindow_->show();
|
mainWindow_->show();
|
|
RISCV_unregister_timer(ui_events_update);
|
app.exec();
|
app.exec();
|
|
|
delete mainWindow_;
|
delete mainWindow_;
|
app.quit();
|
app.quit();
|
}
|
}
|
|
|
void QtWrapper::gracefulClose() {
|
void QtWrapper::gracefulClose() {
|
if (!exiting_) {
|
if (!exiting_) {
|
/** Exit through console command 'exit' */
|
/** Exit through console command 'exit' */
|
mainWindow_->close();
|
mainWindow_->close();
|
RISCV_event_wait_ms(&eventAppDestroyed_, 10000);
|
RISCV_event_wait_ms(&eventAppDestroyed_, 10000);
|
}
|
}
|
RISCV_event_close(&eventAppDestroyed_);
|
|
}
|
}
|
|
|
void QtWrapper::slotMainWindowAboutToClose() {
|
void QtWrapper::slotMainWindowAboutToClose() {
|
if (exiting_) {
|
if (exiting_) {
|
return;
|
return;
|