From 59e00220f562b3840295d9f2dc1eb6038a7c09c2 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 4 Nov 2011 09:27:32 +0100 Subject: Replace --name with --title. --- client/mainwindow.cc | 9 +++------ client/mainwindow.h | 2 +- client/pracro.cc | 12 ++++++------ 3 files changed, 10 insertions(+), 13 deletions(-) (limited to 'client') diff --git a/client/mainwindow.cc b/client/mainwindow.cc index 27d8486..9aa6241 100644 --- a/client/mainwindow.cc +++ b/client/mainwindow.cc @@ -53,9 +53,6 @@ #include "debug.h" -// Declared in pracro.cc -extern QString patientname; - class Dbg : public QLabel { public: Dbg() { @@ -70,8 +67,8 @@ public: MainWindow *gmainwindow = NULL; -MainWindow::MainWindow(QString patientid, QString course, QString templ, - QString host, quint16 port, QString user) +MainWindow::MainWindow(QString patientid, QString title, QString course, + QString templ, QString host, quint16 port, QString user) : QMainWindow(0), // Qt::WindowContextHelpButtonHint netcom(host, port) { @@ -102,7 +99,7 @@ MainWindow::MainWindow(QString patientid, QString course, QString templ, this->course = course; this->templ = templ; - setWindowTitle("Pracro - " + patientid + ": " + patientname); + setWindowTitle("Pracro - " + title); setWindowIcon(QIcon(":/icons/icon.png")); QStatusBar *status = statusBar(); diff --git a/client/mainwindow.h b/client/mainwindow.h index 524242c..84151ad 100644 --- a/client/mainwindow.h +++ b/client/mainwindow.h @@ -42,7 +42,7 @@ class MainWindow : public QMainWindow { Q_OBJECT public: - MainWindow(QString patientid, QString course, QString templ, + MainWindow(QString patientid, QString title, QString course, QString templ, QString host, quint16 port, QString user); ~MainWindow(); diff --git a/client/pracro.cc b/client/pracro.cc index abc2374..1e11e95 100644 --- a/client/pracro.cc +++ b/client/pracro.cc @@ -46,7 +46,6 @@ #define CONFIG_DEFAULT "pracro.ini" QString cpr; -QString patientname; QString user = USER_DEFAULT; QString config = CONFIG_DEFAULT; QString host; @@ -66,7 +65,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(" -T, --title TITLE Sets the string used in the mainwindow title.\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"); @@ -100,6 +99,7 @@ int main(int argc, char *argv[]) QString course; QString templs; bool show_viewer = false; + QString title; QStringList args = app.arguments(); QStringList::iterator arg = args.begin(); @@ -120,9 +120,9 @@ int main(int argc, char *argv[]) *arg == "-V") { show_viewer = true; } - else if(*arg == "--name" || - *arg == "-n") { - patientname = getParam(args, arg); + else if(*arg == "--title" || + *arg == "-T") { + title = getParam(args, arg); } else if(*arg == "--user" || *arg == "-U" || @@ -188,7 +188,7 @@ int main(int argc, char *argv[]) } */ - MainWindow mainwindow(cpr, course, templ, host, port, user); + MainWindow mainwindow(cpr, title, course, templ, host, port, user); mainwindow.show(); PCPViewer *pcpviewer = NULL; -- cgit v1.2.3