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