Commit 0a726c12 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Fixed printing of help dialog.

parent 199a6d11
...@@ -80,6 +80,7 @@ WVsel* WbQt::vsel_new(pwr_tStatus* status, const char* name, ...@@ -80,6 +80,7 @@ WVsel* WbQt::vsel_new(pwr_tStatus* status, const char* name,
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
DEBUG=1;
if (argc >= 2 && streq(argv[1], "-m")) { if (argc >= 2 && streq(argv[1], "-m")) {
wb_erep::printMethods(); wb_erep::printMethods();
debug_print("Shutting down...\n"); exit(0); debug_print("Shutting down...\n"); exit(0);
...@@ -93,7 +94,6 @@ int main(int argc, char* argv[]) ...@@ -93,7 +94,6 @@ int main(int argc, char* argv[])
WbQt::WbQt(int argc, char* argv[]) : mainwindow(0) WbQt::WbQt(int argc, char* argv[]) : mainwindow(0)
{ {
DEBUG=1;
pwr_tStatus sts; pwr_tStatus sts;
int login_display = 0; int login_display = 0;
int nav_display = 0; int nav_display = 0;
......
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
#include <QApplication> #include <QApplication>
extern int DEBUG;
CmdQt::CmdQt(int argc, char* argv[]) CmdQt::CmdQt(int argc, char* argv[])
{ {
QWidget* w; QWidget* w;
...@@ -77,6 +79,7 @@ CmdQt::CmdQt(int argc, char* argv[]) ...@@ -77,6 +79,7 @@ CmdQt::CmdQt(int argc, char* argv[])
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
DEBUG=1;
QApplication app(argc, argv); QApplication app(argc, argv);
QApplication::setStyle(new PwrStyle()); QApplication::setStyle(new PwrStyle());
new CmdQt(argc, argv); new CmdQt(argc, argv);
......
...@@ -42,24 +42,24 @@ ...@@ -42,24 +42,24 @@
#include "cow_qt_helpers.h" #include "cow_qt_helpers.h"
#include "cow_style_qt.h" #include "cow_style_qt.h"
#include "cow_xhelp_qt.h"
#include <QApplication> #include <QApplication>
void CoHelpQt::close_cb(void* ctx, void* xhelp) extern int DEBUG;
CoHelpQt* help;
void close_cb(void* ctx, void* xhelp)
{ {
debug_print("Shutting down...\n");
((CoXHelpQt*)xhelp)->toplevel->close(); ((CoXHelpQt*)xhelp)->toplevel->close();
delete help;
debug_print("Shutting down...\n");
exit(0); exit(0);
} }
void CoHelpQt::cohelp_mainloop()
{
QApplication::exec();
}
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
DEBUG=1;
int sts; int sts;
QApplication app(argc, argv); QApplication app(argc, argv);
...@@ -68,14 +68,14 @@ int main(int argc, char* argv[]) ...@@ -68,14 +68,14 @@ int main(int argc, char* argv[])
setlocale(LC_NUMERIC, "POSIX"); setlocale(LC_NUMERIC, "POSIX");
setlocale(LC_TIME, "en_US"); setlocale(LC_TIME, "en_US");
new CoHelpQt(argc, argv, &sts); help = new CoHelpQt(argc, argv, &sts);
return app.exec(); return app.exec();
} }
CoHelpQt::~CoHelpQt() CoHelpQt::~CoHelpQt()
{ {
debug_print("CoHelpQt::~CoHelpQt\n"); delete xhelp;
} }
CoHelpQt::CoHelpQt(int argc, char* argv[], int* return_sts) CoHelpQt::CoHelpQt(int argc, char* argv[], int* return_sts)
...@@ -90,13 +90,10 @@ CoHelpQt::CoHelpQt(int argc, char* argv[], int* return_sts) ...@@ -90,13 +90,10 @@ CoHelpQt::CoHelpQt(int argc, char* argv[], int* return_sts)
fprintf(stderr, "\n"); fprintf(stderr, "\n");
// Create help window // Create help window
CoXHelp* xhelp xhelp = new CoXHelpQt(0 /*toplevel*/, this, xhelp_eUtility_Xtt, &sts);
= new CoXHelpQt(0 /*toplevel*/, this, xhelp_eUtility_Xtt, &sts);
// xhelp->open_URL_cb = open_URL_cb; // xhelp->open_URL_cb = open_URL_cb;
CoXHelp::set_default(xhelp); CoXHelp::set_default(xhelp);
xhelp->close_cb = close_cb; xhelp->close_cb = close_cb;
exec_help(); exec_help();
cohelp_mainloop();
} }
\ No newline at end of file
...@@ -39,15 +39,16 @@ ...@@ -39,15 +39,16 @@
/* co_help_qt.h -- Help window */ /* co_help_qt.h -- Help window */
#include "cow_xhelp_qt.h"
#include "co_help_main.h" #include "co_help_main.h"
class CoHelpQt : public CoHelpMain { class CoHelpQt : public CoHelpMain {
public: public:
CoHelpQt(int argc, char* argv[], int* sts); CoHelpQt(int argc, char* argv[], int* sts);
~CoHelpQt(); ~CoHelpQt();
private:
void cohelp_mainloop(); CoXHelp* xhelp;
static void close_cb(void* ctx, void* xhelp);
}; };
#endif #endif
\ No newline at end of file
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
#include <QApplication> #include <QApplication>
extern int DEBUG;
static void usage() static void usage()
{ {
printf("\nUsage: pwr_rtmonitor\n"); printf("\nUsage: pwr_rtmonitor\n");
...@@ -66,6 +68,7 @@ static void rtmon_close_cb(void* ctx) ...@@ -66,6 +68,7 @@ static void rtmon_close_cb(void* ctx)
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
DEBUG=1;
int sts; int sts;
char display[80] = ""; char display[80] = "";
...@@ -74,7 +77,7 @@ int main(int argc, char* argv[]) ...@@ -74,7 +77,7 @@ int main(int argc, char* argv[])
fprintf(stderr, "%s ", argv[i]); fprintf(stderr, "%s ", argv[i]);
if (streq(argv[i], "-h")) { if (streq(argv[i], "-h")) {
usage(); usage();
debug_print("Shutting down...\n"); exit(0); debug_print("\nShutting down...\n"); exit(0);
} else if (streq(argv[i], "--display") && i + 1 < argc) { } else if (streq(argv[i], "--display") && i + 1 < argc) {
strncpy(display, argv[i + 1], sizeof(display)); strncpy(display, argv[i + 1], sizeof(display));
} }
......
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
#include <QApplication> #include <QApplication>
extern int DEBUG;
static void usage() static void usage()
{ {
printf("\n\ printf("\n\
...@@ -66,6 +68,7 @@ static void statusmon_close(void* ctx) ...@@ -66,6 +68,7 @@ static void statusmon_close(void* ctx)
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
DEBUG=1;
int sts; int sts;
int mode = nodelist_eMode_SystemStatus; int mode = nodelist_eMode_SystemStatus;
int view_descr = 0; int view_descr = 0;
......
...@@ -58,6 +58,8 @@ ...@@ -58,6 +58,8 @@
#include <QMenuBar> #include <QMenuBar>
#include <QVBoxLayout> #include <QVBoxLayout>
extern int DEBUG;
void XttQt::hotkey_Command(char* arg, void* userdata) void XttQt::hotkey_Command(char* arg, void* userdata)
{ {
Xtt* xtt = (Xtt*)userdata; Xtt* xtt = (Xtt*)userdata;
...@@ -550,6 +552,7 @@ void XttQtWidget::valchanged_cmd_entry() ...@@ -550,6 +552,7 @@ void XttQtWidget::valchanged_cmd_entry()
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
DEBUG=1;
int sts; int sts;
QApplication app(argc, argv); QApplication app(argc, argv);
......
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
#include <QApplication> #include <QApplication>
#include <QMainWindow> #include <QMainWindow>
extern int DEBUG;
XttCmdQt::XttCmdQt(QWidget* w) XttCmdQt::XttCmdQt(QWidget* w)
{ {
pwr_tStatus sts; pwr_tStatus sts;
...@@ -75,6 +77,7 @@ static int timeout_func() ...@@ -75,6 +77,7 @@ static int timeout_func()
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
DEBUG=1;
pwr_tStatus sts; pwr_tStatus sts;
int i; int i;
char str[256]; char str[256];
......
...@@ -58,6 +58,8 @@ ...@@ -58,6 +58,8 @@
static QWidget* toplevel; static QWidget* toplevel;
static QWidget* mainwindow; static QWidget* mainwindow;
extern int DEBUG;
static void usage() static void usage()
{ {
printf("\nUsage: wb_ge [-l language] [graphname]\n"); printf("\nUsage: wb_ge [-l language] [graphname]\n");
...@@ -65,6 +67,7 @@ static void usage() ...@@ -65,6 +67,7 @@ static void usage()
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
DEBUG=1;
int i; int i;
pwr_tFileName file; pwr_tFileName file;
char graph_name[80]; char graph_name[80];
......
...@@ -150,7 +150,7 @@ void CoXHelpQt::print() ...@@ -150,7 +150,7 @@ void CoXHelpQt::print()
char title[80]; char title[80];
strcpy(title, qPrintable(translate_utf8("Help"))); strcpy(title, qPrintable(translate_utf8("Help")));
CoWowQt::CreateBrowPrintDialogQt(title, xhelpnav->brow->ctx, brow_widget); CoWowQt::CreateBrowPrintDialogQt(title, xhelpnav->brow->ctx, ((CoXHelpNavQt*)xhelpnav)->brow_widget);
} }
void CoXHelpQtWidget::closeEvent(QCloseEvent* event) void CoXHelpQtWidget::closeEvent(QCloseEvent* event)
......
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