diff options
| author | Lars Bisballe Jensen <larsbisballe@gmail.com> | 2011-11-03 11:34:04 +0100 | 
|---|---|---|
| committer | Lars Bisballe Jensen <larsbisballe@gmail.com> | 2011-11-03 11:34:04 +0100 | 
| commit | fa13e95b495e49316524c27f6045c1c3cd2547ca (patch) | |
| tree | 60c35916947217ff43049e5a6efed8a2c033bf66 /client/pracro.cc | |
| parent | 592211cbd4b710caf8934e2806e259415087f69d (diff) | |
| parent | 140d002d641d22d2dc9e9a1e7c234b747c979a16 (diff) | |
Merge branch 'master' of http://git.aasimon.org/public/pracro
Diffstat (limited to 'client/pracro.cc')
| -rw-r--r-- | client/pracro.cc | 27 | 
1 files changed, 20 insertions, 7 deletions
| diff --git a/client/pracro.cc b/client/pracro.cc index 2c9c141..abc2374 100644 --- a/client/pracro.cc +++ b/client/pracro.cc @@ -46,6 +46,7 @@  #define CONFIG_DEFAULT "pracro.ini"  QString cpr; +QString patientname;  QString user = USER_DEFAULT;  QString config = CONFIG_DEFAULT;  QString host; @@ -65,6 +66,7 @@ static void print_usage()           "                            Server.\n");    printf("  -C  --course COURSE       Lists templates in COURSE.\n");    printf("  -P, --patient PATIENTID   Defines the patientid for use with the macro.\n"); +  printf("  -n, --name PATIENTNAME    Defines the patient name for display in the window header.\n");    printf("  -c, --config FILE         The configfile to use. Default is \""CONFIG_DEFAULT"\"\n");    printf("  -u, -U, --user USER       Defines the requesting user(not the patient),\n"           "                            defaults to \""USER_DEFAULT"\"\n"); @@ -118,6 +120,10 @@ int main(int argc, char *argv[])              *arg == "-V") {        show_viewer = true;      } +    else if(*arg == "--name" || +            *arg == "-n") { +      patientname = getParam(args, arg); +    }      else if(*arg == "--user" ||              *arg == "-U" ||              *arg == "-u") { @@ -182,15 +188,22 @@ int main(int argc, char *argv[])    }    */ +  MainWindow mainwindow(cpr, course, templ, host, port, user); +  mainwindow.show(); + +  PCPViewer *pcpviewer = NULL;    if(show_viewer) { -    PCPViewer pcpviewer(cpr); -    pcpviewer.show(); -    return app.exec(); -  } else { -    MainWindow mainwindow(cpr, course, templ, host, port, user); -    mainwindow.show(); -    return app.exec(); +    pcpviewer = new PCPViewer(cpr); +    pcpviewer->show(); +    QObject::connect(&mainwindow, SIGNAL(isClosing()), +                     pcpviewer, SLOT(close()));    } + +  int ret = app.exec(); + +  if(pcpviewer) delete pcpviewer; + +  return ret;  }  #endif/*TESTING*/ | 
