Commit 3a092405 authored by Christoffer Ackelman's avatar Christoffer Ackelman

Added a small logging library. License window now working correctly.

parent 17bf9697
......@@ -144,12 +144,15 @@ WbQt::WbQt(int argc, char *argv[]) : mainwindow(0)
strcpy(username, "");
strcpy(password, "");
debug_print("wb_qt: started with arguments:\n");
// Open directory volume as default
volumename_p = volumename;
strcpy(volumename, "directory");
sw_projectvolume = 1;
arg_cnt = 0;
for (i = 1; i < argc; i++) {
debug_print("arg%d: %s\n", i, argv[i]);
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'h':
......@@ -221,6 +224,7 @@ WbQt::WbQt(int argc, char *argv[]) : mainwindow(0)
}
toplevel = new QWidget();
toplevel->setToolTip(fl("WbQt widget"));
toplevel->setMinimumSize(100, 100);
toplevel->setWindowTitle(fl("Pwr wb"));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
......
......@@ -61,6 +61,7 @@ WbBckWQt::WbBckWQt(void *bckw_parent_ctx, QWidget *bckw_parent_wid,
status)
{
toplevel = new WbBckWQtWidget(this, bckw_parent_wid);
toplevel->setToolTip(fl("WbBckWQt widget"));
toplevel->setMinimumSize(1100, 600);
toplevel->setWindowTitle(fl(bckw_name));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
......
......@@ -60,6 +60,7 @@ WbBckWNavQt::WbBckWNavQt(void *l_parent_ctx, QWidget *l_parent_wid,
int l_editmode, QWidget **w)
: WbBckWNav(l_parent_ctx, l_ldhses, l_list, l_editmode)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget =
scrolledbrowwidgetqt_new(WbBckWNav::init_brow_cb, this, &brow_widget);
......
......@@ -60,6 +60,7 @@ WbExpWNavQt::WbExpWNavQt(void *l_parent_ctx, QWidget *l_parent_wid,
QWidget **w)
: WbExpWNav(l_parent_ctx, l_ldhses, l_type, l_editmode)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget =
scrolledbrowwidgetqt_new(WbExpWNav::init_brow_cb, this, &brow_widget);
......
......@@ -70,7 +70,7 @@ WGreQt::WGreQt(void *wg_parent_ctx, QWidget *wg_parent_wid, const char *name)
: WGre(wg_parent_ctx, 0), trace_obj(0)
{
ctx_init();
debug_print("creating a scrolledflowwidgetqt\n");
form_widget = scrolledflowwidgetqt_new(init_flow, this, &flow_widget);
showNow(flow_widget);
popupmenu_mode = GRE_POPUPMENUMODE_OBJECT;
......@@ -83,6 +83,7 @@ WGreQt::~WGreQt()
int WGreQt::new_navigator(QWidget *parent)
{
debug_print("creating a flownavwidgetqt\n");
nav_widget = flownavwidgetqt_new(flow_widget);
return 1;
}
......
......@@ -61,6 +61,7 @@ NavQt::NavQt(void *nav_parent_ctx, QWidget *nav_parent_wid,
{
trace_obj = new NavQtTraceObject(this);
debug_print("creating a scrolledbrowwidgetqt\n");
QWidget *scrolledbrow =
scrolledbrowwidgetqt_new(Nav::init_brow_cb, this, &brow_widget);
......
......@@ -68,6 +68,7 @@ PalQt::PalQt(void *pal_parent_ctx, QWidget *pal_parent_wid,
{
trace_obj = new PalQtTraceObject(this);
debug_print("creating a scrolledbrowwidgetqt\n");
QWidget *scrolledbrow =
scrolledbrowwidgetqt_new(Pal::init_brow_cb, this, &brow_widget);
......
......@@ -68,6 +68,7 @@ WAttNavQt::WAttNavQt(void *wa_parent_ctx, wattnav_eType wa_type,
: WAttNav(wa_parent_ctx, wa_type, wa_name, wa_ldhses, wa_aref, wa_editmode,
wa_advanced_user, wa_display_objectname, wa_utility, status)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget =
scrolledbrowwidgetqt_new(WAttNav::init_brow_cb, this, &brow_widget);
......
......@@ -69,6 +69,7 @@ WdaNavQt::WdaNavQt(void *wa_parent_ctx, QWidget *wa_parent_wid,
wa_attribute, wa_editmode, wa_advanced_user,
wa_display_objectname, wa_utility, status)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget =
scrolledbrowwidgetqt_new(WdaNav::init_brow_cb, this, &brow_widget);
......
......@@ -102,6 +102,7 @@ WNavQt::WNavQt(void *xn_parent_ctx, QWidget *xn_parent_wid, const char *xn_name,
trace_obj = new WNavQtTraceObject(this);
debug_print("creating a scrolledbrowwidgetqt\n");
QWidget *scrolledbrow =
scrolledbrowwidgetqt_new(WNav::init_brow_base_cb, this, &brow_widget);
......
......@@ -63,6 +63,7 @@ WPkgNavQt::WPkgNavQt(void *wa_parent_ctx, QWidget *wa_parent_wid,
pwr_tStatus *status)
: WPkgNav(wa_parent_ctx, wa_name, wa_utility, status)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget = scrolledbrowwidgetqt_new(init_brow_cb, this, &brow_widget);
showNow(brow_widget);
......
......@@ -62,6 +62,7 @@ WRevNavQt::WRevNavQt(void *wa_parent_ctx, QWidget *wa_parent_wid,
wb_eUtility wa_utility, QWidget **w, pwr_tStatus *status)
: WRevNav(wa_parent_ctx, wa_ldhses, wa_name, wa_utility, status)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget = scrolledbrowwidgetqt_new(init_brow_cb, this, &brow_widget);
showNow(brow_widget);
......
......@@ -82,6 +82,14 @@ CoHelpQt::CoHelpQt(int argc, char *argv[], int *return_sts) : CoHelpMain(argc,
return_sts)
{
pwr_tStatus sts;
debug_print("co_help_qt: started with arguments:\n");
if (argc > 1) {
for (int i = 1; i < argc; i++) {
debug_print("arg%d: %s\n", i, argv[i]);
}
}
// Create help window
CoXHelp
*xhelp = new CoXHelpQt(0 /*toplevel*/, this, xhelp_eUtility_Xtt, &sts);
......
......@@ -67,8 +67,11 @@ int main(int argc, char *argv[])
int sts;
char display[80] = "";
debug_print("pwr_rtmon_qt: started with arguments:\n");
if (argc > 1) {
for (int i = 1; i < argc; i++) {
debug_print("arg%d: %s\n", i, argv[i]);
if (strcmp(argv[i], "-h") == 0) {
usage();
exit(0);
......
......@@ -71,8 +71,11 @@ int main(int argc, char *argv[])
int view_descr = 0;
char language[20] = "";
debug_print("rt_statusmon_qt: started with arguments:\n");
if (argc > 1) {
for (int i = 1; i < argc; i++) {
debug_print("arg%d: %s\n", i, argv[i]);
if (strcmp(argv[i], "-h") == 0) {
usage();
exit(0);
......
......@@ -607,6 +607,13 @@ XttQt::XttQt(int argc, char *argv[], int *return_sts) : Xtt(&argc, &argv,
strcat(title, nodename);
}
debug_print("rt_xtt_qt: started with arguments:\n");
if (argc > 1) {
for (int i = 1; i < argc; i++) {
debug_print("arg%d: %s\n", i, argv[i]);
}
}
// Qt
toplevel = new XttQtWidget(this);
toplevel->setFixedSize(window_width, window_height);
......
......@@ -100,8 +100,11 @@ int main(int argc, char *argv[])
/* If arguments, treat them as a command and then exit */
// Open directory volume as default
debug_print("rt_xtt_cmd_qt: started with arguments:\n");
str[0] = 0;
for (i = 1; i < argc; i++) {
debug_print("arg%d: %s\n", i, argv[i]);
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'h':
......
......@@ -95,8 +95,11 @@ int main(int argc, char *argv[])
CoXHelpQt *xhelp = new CoXHelpQt(mainwindow, 0, xhelp_eUtility_Wtt, &sts);
CoXHelpQt::set_default(xhelp);
debug_print("wb_ge_qt: started with arguments:\n");
if (argc > 1) {
for (i = 1; i < argc; i++) {
debug_print("arg%d: %s\n", i, argv[i]);
if (strcmp(argv[i], "-l") == 0) {
if (i + 1 >= argc) {
usage();
......
......@@ -58,6 +58,7 @@ CoLogWNavQt::CoLogWNavQt(void *l_parent_ctx, QWidget *l_parent_wid,
int l_show_item, QWidget **w)
: CoLogWNav(l_parent_ctx, l_show_item)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget =
scrolledbrowwidgetqt_new(CoLogWNav::init_brow_cb, this, &brow_widget);
......
......@@ -57,6 +57,7 @@ extern "C" {
MsgListQt::MsgListQt(void *ev_parent_ctx, QWidget *ev_parent_wid, QWidget **w)
: MsgList(ev_parent_ctx)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget =
scrolledbrowwidgetqt_new(MsgList::init_brow_cb, this, &brow_widget);
......
......@@ -66,6 +66,7 @@ MsgWindowQt::MsgWindowQt(void *msg_parent_ctx, QWidget *msg_parent_wid,
: MsgWindow(msg_parent_ctx, msg_name, status)
{
toplevel = new MsgWindowQtWidget(this, msg_parent_wid);
toplevel->setToolTip(fl("MsgWindowQt widget"));
toplevel->setFixedSize(800, 600);
toplevel->setWindowTitle(translate_utf8(msg_name));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
......@@ -97,6 +98,7 @@ MsgWindowQt::MsgWindowQt(void *msg_parent_ctx, QWidget *msg_parent_wid,
msgnav->find_ge_cb = MsgWindow::msgw_find_ge_cb;
form->setMenuBar(menu_bar);
nav_widget->setToolTip(fl("MsgList widget"));
add_expanding(form, nav_widget);
toplevel->setLayout(form);
......
......@@ -45,6 +45,38 @@
#include <QShowEvent>
#include <QToolButton>
void print_time(FILE *stream, int fulldate)
{
time_t t;
struct tm *tm;
char Date[11], Time[11];
time(&t);
tm = localtime(&t);
if (fulldate) {
strftime(Date, 11, "%Y-%m-%d", tm);
fprintf(stream, "%s ", Date);
}
strftime(Time, 11, "%H:%M:%S", tm);
fprintf(stream, "%s", Time);
}
void dbg_print(const char *file, int line, const char *fmt, ...)
{
if (DEBUG) {
// 1. print timestamp
print_time(stderr);
// 2. print filename only, without path
const char *file2 = strrchr(file, '/');
file2 = file2 ? (file2 + 1) : file;
fprintf(stderr, " %s:%d: ", file2, line);
// 3. print the actual debug message
va_list args;
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
}
}
QString fl(const char *text)
{
return QString::fromLocal8Bit(text);
......
......@@ -44,6 +44,15 @@
#include <QString>
#include <QToolBar>
void print_time(FILE *stream, int fulldate = 0);
#define DEBUG 1
void dbg_print(const char *file, int line, const char *fmt, ...);
#define debug_print(fmt, args...) \
do { if (DEBUG) { dbg_print(__FILE__, __LINE__, fmt, ##args); } } while (0)
/*
* Qt Helper functions
*/
......
......@@ -67,6 +67,7 @@ NodelistNavQt::NodelistNavQt(void *nodelist_parent_ctx,
{
trace_obj = new NodelistNavQtTraceObject(this);
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget = scrolledbrowwidgetqt_new(init_brow_cb, this, &brow_widget);
showNow(brow_widget);
......
......@@ -68,6 +68,7 @@ TreeNavQt::TreeNavQt(
: TreeNav(xn_parent_ctx, xn_itemlist, xn_item_cnt, xn_options,
xn_get_object_info, xn_get_node_info, status)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget =
scrolledbrowwidgetqt_new(TreeNav::init_brow_cb, this, &brow_widget);
......
......@@ -67,7 +67,6 @@
#include <QPrinter>
#include <QPushButton>
#include <QScrollArea>
#include <QTextEdit>
#include <QTimer>
#include <QVBoxLayout>
......@@ -334,7 +333,7 @@ void CoWowQt::DeleteList(void *data)
void CoWowWarrantQt::display_license()
{
ctx->DisplayLicense();
((CoWowQtObject *) parentWidget())->DisplayLicense();
}
void CoWowWarrantQt::reject()
......@@ -384,8 +383,8 @@ QString loadText(string filename)
}
}
CoWowWarrantQt::CoWowWarrantQt(CoWowQt *parent_ctx, QWidget *parent)
: QDialog(parent), ctx(parent_ctx)
CoWowWarrantQt::CoWowWarrantQt(CoWowQtObject *parent)
: QDialog(parent)
{
QVBoxLayout *main_layout = new QVBoxLayout();
......@@ -397,7 +396,8 @@ CoWowWarrantQt::CoWowWarrantQt(CoWowQt *parent_ctx, QWidget *parent)
inner_layout->addWidget(image);
inner_layout->setAlignment(image, Qt::AlignTop);
QTextEdit *label = new QTextEdit(loadText("acceptlicense.txt"), this);
QLabel *label = new QLabel(loadText("acceptlicense.txt"), this);
label->setWordWrap(true);
add_expanding(inner_layout, label);
main_layout->addLayout(inner_layout, 1);
......@@ -427,7 +427,7 @@ CoWowWarrantQt::CoWowWarrantQt(CoWowQt *parent_ctx, QWidget *parent)
void CoWowQtObject::DisplayWarranty()
{
new CoWowWarrantQt(wow, this);
new CoWowWarrantQt(this);
}
void CoWowQtObject::DisplayLicense()
......@@ -438,12 +438,13 @@ void CoWowQtObject::DisplayLicense()
mbox->setAttribute(Qt::WA_DeleteOnClose);
QScrollArea *scroll = new QScrollArea(mbox);
scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
scroll->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
scroll->setWidgetResizable(true);
scroll->setWidget(new QLabel(loadText("license.txt")));
scroll->setMinimumSize(600, 600);
scroll->adjustSize();
scroll->setFixedWidth(scroll->width());
scroll->setFixedHeight(600);
scroll->setWidgetResizable(true);
QGridLayout *dialog_layout = ((QGridLayout *) mbox->layout());
dialog_layout->addWidget(scroll, 0, 0);
......
......@@ -49,14 +49,6 @@
#include "cow_qt_helpers.h"
class CoWowWidgetQt : public CoWowWidget {
CoWowWidgetQt(QWidget *w) : widget(w)
{
}
QWidget *widget;
};
class CoWowEntryQt : public QLineEdit {
Q_OBJECT
......@@ -181,13 +173,13 @@ public slots:
void list_cancel_cb();
};
class CoWowQt;
class CoWowQtObject;
class CoWowWarrantQt : public QDialog {
Q_OBJECT
public:
explicit CoWowWarrantQt(CoWowQt *parent_ctx, QWidget *parent);
explicit CoWowWarrantQt(CoWowQtObject *parent);
public slots:
virtual void reject();
......@@ -195,12 +187,8 @@ public slots:
protected:
void destroy(bool destroyWindow = true, bool destroySubWindows = true);
private:
CoWowQt *ctx;
};
class CoWowQtObject;
class CoWowQt : public CoWow {
public:
CoWowQtObject *object;
......
......@@ -68,6 +68,7 @@ CoXHelpNavQt::CoXHelpNavQt(void *xn_parent_ctx, QWidget *xn_parent_wid,
QWidget **w, pwr_tStatus *status)
: CoXHelpNav(xn_parent_ctx, xn_name, xn_utility, status)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget = scrolledbrowwidgetqt_new(CoXHelpNav::init_brow_base_cb, this,
&brow_widget);
......
......@@ -48,6 +48,8 @@
#include "flow_scroll_widget_qt.h"
#include "cow_qt_helpers.h"
static void scroll_callback(flow_sScroll *data)
{
widget_sScroll *scroll_data = (widget_sScroll *) data->scroll_data;
......@@ -87,6 +89,7 @@ QWidget *browwidgetqt_new(int (*init_proc)(FlowCtx *ctx, void *client_data),
void *client_data)
{
QtScrollWidgetFlow *w = new QtScrollWidgetFlow();
debug_print("creating a new flow scroll widget\n");
w->init(flow_eCtxType_Brow, init_proc, client_data, brow_init_proc);
return w;
}
......@@ -96,6 +99,7 @@ QWidget *scrolledbrowwidgetqt_new(
QWidget **browwidget)
{
QtScrollWidgetFlow *w = new QtScrollWidgetFlow();
debug_print("creating a new flow scroll widget\n");
QWidget *form = w->initScroll(flow_eCtxType_Brow, init_proc, client_data,
brow_init_proc);
*browwidget = w;
......@@ -105,6 +109,7 @@ QWidget *scrolledbrowwidgetqt_new(
QWidget *brownavwidgetqt_new(QWidget *main_brow)
{
QtScrollWidgetFlow *w = new QtScrollWidgetFlow();
debug_print("creating a new flow scroll widget\n");
w->init(flow_eCtxType_Brow, main_brow);
return w;
}
......
......@@ -221,7 +221,6 @@ void QtScrollWidgetFlow::moveEvent(QMoveEvent *event)
void QtScrollWidgetFlow::resizeEvent(QResizeEvent *event)
{
printf("QtScrollWidgetFlow::resizeEvent\n");
realize();
handleEvent(event, true);
QWidget::resizeEvent(event);
......@@ -229,7 +228,6 @@ void QtScrollWidgetFlow::resizeEvent(QResizeEvent *event)
void QtScrollWidgetFlow::showEvent(QShowEvent *event)
{
printf("QtScrollWidgetFlow::showEvent\n");
realize();
QWidget::showEvent(event);
}
......@@ -274,8 +272,6 @@ void QtScrollWidgetFlow::realize()
return;
}
printf("QtScrollWidgetGlow::realize\n");
if (!parent_ctx) {
if (is_navigator) {
QtScrollWidgetFlow *main = dynamic_cast<QtScrollWidgetFlow *>(
......
......@@ -47,6 +47,8 @@
#include "flow_scroll_widget_qt.h"
#include "cow_qt_helpers.h"
static void scroll_callback(flow_sScroll *data)
{
widget_sScroll *scroll_data = (widget_sScroll *) data->scroll_data;
......@@ -86,6 +88,7 @@ QWidget *flowwidgetqt_new(int (*init_proc)(FlowCtx *ctx, void *client_data),
void *client_data)
{
QtScrollWidgetFlow *w = new QtScrollWidgetFlow();
debug_print("creating a new flow scroll widget\n");
w->init(flow_eCtxType_Flow, init_proc, client_data, flow_init_proc);
return w;
}
......@@ -96,7 +99,7 @@ QWidget *scrolledflowwidgetqt_new(
{
QtScrollWidgetFlow *w = new QtScrollWidgetFlow();
*flowwidget = w;
debug_print("creating a new flow scroll widget\n");
return w
->initScroll(flow_eCtxType_Flow, init_proc, client_data, flow_init_proc);
}
......@@ -104,6 +107,7 @@ QWidget *scrolledflowwidgetqt_new(
QWidget *flownavwidgetqt_new(QWidget *main_flow)
{
QtScrollWidgetFlow *w = new QtScrollWidgetFlow();
debug_print("creating a new flow scroll widget\n");
w->init(flow_eCtxType_Flow, main_flow);
return w;
}
......
......@@ -73,6 +73,7 @@ AttrNavQt::AttrNavQt(void *xn_parent_ctx, QWidget *xn_parent_wid,
{
trace_obj = new AttrNavQtTraceObject(this);
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget =
scrolledbrowwidgetqt_new(AttrNav::init_brow_cb, this, &brow_widget);
......
......@@ -774,13 +774,14 @@ GeCurveQt::GeCurveQt(void *gc_parent_ctx, QWidget *parent_widget,
addToolItem(toplevel, timetools, "Remove selected curve", SLOT(activate_remove()),
"$pwr_exe/xtt_remove.png");
debug_print("creating a scrolledgrowwidgetqt\n");
QWidget *w;
grownames_main_widget = scrolledgrowwidgetqt_new(init_grownames_cb, this, &w);
debug_print("creating a curvewidgetqt\n");
growcurve_main_widget = curvewidgetqt_new(init_growcurve_cb, this);
debug_print("creating a growwidgetqt\n");
growaxis_main_widget = growwidgetqt_new(init_growaxis_cb, this);
debug_print("creating a curvenavwidgetqt\n");
nav_widget = curvenavwidgetqt_new(growcurve_main_widget);
QHBoxLayout *hbox = new QHBoxLayout();
......
......@@ -70,9 +70,11 @@ GraphQt::GraphQt(void *xn_parent_ctx, QWidget *xn_parent_wid,
default_access = xn_default_access;
if (scrollbar) {
debug_print("creating a scrolledgrowwidgetqt\n");
form_widget =
scrolledgrowwidgetqt_new(graph_init_grow_base_cb, this, &grow_widget);
} else {
debug_print("creating a growwidgetqt\n");
grow_widget = form_widget = growwidgetqt_new(graph_init_grow_base_cb, this);
}
......@@ -136,6 +138,7 @@ void GraphQt::trace_timer_add(int time)
int GraphQt::create_navigator(QWidget *parent)
{
debug_print("creating a grownavwidgetqt\n");
nav_widget = grownavwidgetqt_new(grow_widget);
return 1;
}
......
......@@ -2064,6 +2064,7 @@ GeQt::GeQt(void *x_parent_ctx, QWidget *x_parent_widget,
subpalette_mapped = 1;
// Color palette
debug_print("creating a scrolledcolpalwidgetqt\n");
colpal_main_widget =
scrolledcolpalwidgetqt_new(Ge::init_colorpalette_cb, this,
&colorpalette_widget);
......
......@@ -162,6 +162,7 @@ SubGraphsQt::SubGraphsQt(void *xn_parent_ctx, QWidget *xn_parent_wid,
QMenu *help = menu_bar->addMenu(fl("&Help"));
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);
......
......@@ -71,6 +71,7 @@ SubPaletteQt::SubPaletteQt(void *xn_parent_ctx, QWidget *xn_parent_wid,
pwr_tStatus *status)
: SubPalette(xn_parent_ctx, xn_name, status)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget =
scrolledbrowwidgetqt_new(SubPalette::init_brow_cb, this, &brow_widget);
......
......@@ -46,6 +46,8 @@
#include "glow_scroll_widget_qt.h"
#include "cow_qt_helpers.h"
static void scroll_callback(glow_sScroll *data)
{
widget_sScroll *scroll_data = (widget_sScroll *) data->scroll_data;
......@@ -92,6 +94,7 @@ QWidget *colpalwidgetqt_new(int (*init_proc)(GlowCtx *ctx, void *client_data),
void *client_data)
{
QtScrollWidgetGlow *w = new QtScrollWidgetGlow();
debug_print("creating a new glow scroll widget\n");
w->init(glow_eCtxType_ColPal, init_proc, client_data, colpal_init_proc);
return w;
}
......@@ -102,7 +105,7 @@ QWidget *scrolledcolpalwidgetqt_new(
{
QtScrollWidgetGlow *w = new QtScrollWidgetGlow();
*colpalwidget = w;
debug_print("creating a new glow scroll widget\n");
return w->initScroll(glow_eCtxType_ColPal, init_proc, client_data,
colpal_init_proc);
}
......@@ -110,6 +113,7 @@ QWidget *scrolledcolpalwidgetqt_new(
QWidget *colpalnavwidgetqt_new(QWidget *main_colpal)
{
QtScrollWidgetGlow *w = new QtScrollWidgetGlow();
debug_print("creating a new glow scroll widget\n");
w->init(glow_eCtxType_ColPal, main_colpal);
return w;
}
\ No newline at end of file
......@@ -44,6 +44,8 @@
#include "glow_draw.h"
#include "glow_draw_qt.h"
#include "cow_qt_helpers.h"
static void scroll_callback(glow_sScroll *data)
{
widget_sScroll *scroll_data = (widget_sScroll *) data->scroll_data;
......@@ -112,6 +114,7 @@ QWidget *curvewidgetqt_new(int (*init_proc)(GlowCtx *ctx, void *client_data),
void *client_data)
{
CurveWidgetQt *w = new CurveWidgetQt();
debug_print("creating a new glow scroll widget\n");
w->init(glow_eCtxType_Curve, init_proc, client_data, curve_init_proc);
return (QWidget *) w;
}
......@@ -122,7 +125,7 @@ QWidget *scrolledcurvewidgetqt_new(
{
CurveWidgetQt *w = new CurveWidgetQt();
*curvewidget = w;
debug_print("creating a new glow scroll widget\n");
return w->initScroll(glow_eCtxType_Curve, init_proc, client_data,
curve_init_proc);
}
......@@ -130,6 +133,7 @@ QWidget *scrolledcurvewidgetqt_new(
QWidget *curvenavwidgetqt_new(QWidget *main_curve)
{
CurveWidgetQt *w = new CurveWidgetQt();
debug_print("creating a new glow scroll widget\n");
w->init(glow_eCtxType_Curve, main_curve);
return (QWidget *) w;
}
\ No newline at end of file
......@@ -47,6 +47,8 @@
#include "glow_scroll_widget_qt.h"
#include "cow_qt_helpers.h"
static void scroll_callback(glow_sScroll *data)
{
widget_sScroll *scroll_data = (widget_sScroll *) data->scroll_data;
......@@ -86,6 +88,7 @@ QWidget *growwidgetqt_new(int (*init_proc)(GlowCtx *ctx, void *client_data),
void *client_data)
{
QtScrollWidgetGlow *w = new QtScrollWidgetGlow();
debug_print("creating a new glow scroll widget\n");
w->init(glow_eCtxType_Grow, init_proc, client_data, grow_init_proc);
return (QWidget *) w;
}
......@@ -96,7 +99,7 @@ QWidget *scrolledgrowwidgetqt_new(
{
QtScrollWidgetGlow *w = new QtScrollWidgetGlow();
*growwidget = w;
debug_print("creating a new glow scroll widget\n");
return (QWidget *) w
->initScroll(glow_eCtxType_Grow, init_proc, client_data, grow_init_proc);;
}
......@@ -104,6 +107,7 @@ QWidget *scrolledgrowwidgetqt_new(
QWidget *grownavwidgetqt_new(QWidget *main_grow)
{
QtScrollWidgetGlow *w = new QtScrollWidgetGlow();
debug_print("creating a new glow scroll widget\n");
w->init(glow_eCtxType_Grow, main_grow);
return (QWidget *) w;
}
\ No newline at end of file
......@@ -46,6 +46,8 @@
#include "glow_scroll_widget_qt.h"
#include "cow_qt_helpers.h"
static int keyboard_init_proc(QWidget *w, GlowCtx *fctx, void *client_data)
{
QtScrollWidgetGlow *key_widget = ((QtScrollWidgetGlow *) w);
......@@ -64,6 +66,7 @@ QWidget *keyboardwidgetqt_new(int (*init_proc)(GlowCtx *ctx, void *client_data),
void *client_data)
{
QtScrollWidgetGlow *w = new QtScrollWidgetGlow();
debug_print("creating a new glow scroll widget\n");
w->init(glow_eCtxType_Keyboard, init_proc, client_data, keyboard_init_proc);
return (QWidget *) w;
}
......@@ -71,6 +74,7 @@ QWidget *keyboardwidgetqt_new(int (*init_proc)(GlowCtx *ctx, void *client_data),
QWidget *keyboardnavwidgetqt_new(QWidget *main_keyboard)
{
QtScrollWidgetGlow *w = new QtScrollWidgetGlow();
debug_print("creating a new glow scroll widget\n");
w->init(glow_eCtxType_Keyboard, main_keyboard);
return (QWidget *) w;
}
\ No newline at end of file
......@@ -221,7 +221,6 @@ void QtScrollWidgetGlow::moveEvent(QMoveEvent *event)
void QtScrollWidgetGlow::resizeEvent(
QResizeEvent *event)
{
printf("QtScrollWidgetGlow::resizeEvent\n");
realize();
handleEvent(event, true);
QWidget::resizeEvent(event);
......@@ -229,7 +228,6 @@ void QtScrollWidgetGlow::resizeEvent(
void QtScrollWidgetGlow::showEvent(QShowEvent *event)
{
printf("QtScrollWidgetGlow::showEvent\n");
realize();
QWidget::showEvent(event);
}
......@@ -276,8 +274,6 @@ void QtScrollWidgetGlow::realize()
return;
}
printf("QtScrollWidgetGlow::realize\n");
if (!parent_ctx) {
if (is_navigator) {
QtScrollWidgetGlow *main = dynamic_cast<QtScrollWidgetGlow *>(
......
......@@ -63,6 +63,7 @@ CLogNavQt::CLogNavQt(void *clog_parent_ctx, QWidget *clog_parent_wid,
QWidget **w)
: CLogNav(clog_parent_ctx)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget = scrolledbrowwidgetqt_new(init_brow_cb, this, &brow_widget);
showNow(brow_widget);
......
......@@ -64,6 +64,7 @@ EvListQt::EvListQt(void *ev_parent_ctx, QWidget *ev_parent_wid,
QWidget **w, void (*ev_init_cb)(void *))
: EvList(ev_parent_ctx, ev_type, ev_size, ev_eventname_seg, ev_init_cb)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget = scrolledbrowwidgetqt_new(init_brow_cb, this, &brow_widget);
showNow(brow_widget);
......
......@@ -88,6 +88,7 @@ XttKeyboardQt::XttKeyboardQt(void *xn_parent_ctx, QWidget *xn_parent_wid,
toplevel->setWindowTitle(translate_utf8(xn_name));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
debug_print("creating a keyboardwidgetqt\n");
keyboard_widget = keyboardwidgetqt_new(init_keyboard_cb, this);
QVBoxLayout *vbox = new QVBoxLayout(toplevel);
......
......@@ -329,10 +329,11 @@ RtTraceQt::RtTraceQt(void *tr_parent_ctx, QWidget *tr_parent_wid,
"$pwr_exe/xtt_zoom_reset.png");
// Flow widget
debug_print("creating a scrolledflowwidgetqt\n");
QWidget
*flow_scrolled = scrolledflowwidgetqt_new(init_flow, this, &flow_widget);
showNow(flow_widget);
debug_print("creating a flownavwidgetqt\n");
nav_widget = flownavwidgetqt_new(flow_widget);
QSplitter *paned = new QSplitter(toplevel);
......
......@@ -66,6 +66,7 @@ XAttNavQt::XAttNavQt(void *xa_parent_ctx, QWidget *xa_parent_wid,
: XAttNav(xa_parent_ctx, xa_type, xa_name, xa_objar, xa_advanced_user,
xa_userdata, status)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget = scrolledbrowwidgetqt_new(init_brow_cb, this, &brow_widget);
showNow(brow_widget);
......
......@@ -100,6 +100,7 @@ XNavQt::XNavQt(void *xn_parent_ctx, QWidget *xn_parent_wid, const char *xn_name,
int xn_op_close_button, pwr_tStatus *status)
: XNav(xn_parent_ctx, xn_name, root_menu, xn_opplace_name, xn_op_close_button, status), parent_wid(xn_parent_wid)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget = scrolledbrowwidgetqt_new(init_brow_base_cb, this, &brow_widget);
showNow(brow_widget);
......
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