summaryrefslogtreecommitdiff
path: root/client/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/mainwindow.cc')
-rw-r--r--client/mainwindow.cc33
1 files changed, 18 insertions, 15 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index 4b6810b..551a78b 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -71,6 +71,7 @@ MainWindow::MainWindow(QString cpr, QString templ, QString host,
this->cpr = cpr;
this->user = user;
+ this->templ = templ;
setWindowTitle("Pracro - " + cpr);
setWindowIcon(QIcon(":/icons/icon.png"));
@@ -94,13 +95,13 @@ MainWindow::MainWindow(QString cpr, QString templ, QString host,
connect(close_discard, SIGNAL(triggered()), this, SLOT(closeDiscard()));
*/
toolbar->addSeparator();
-
+ /*
QAction *show_sessions = toolbar->addAction(tr("Show sessions"));
show_sessions->setIcon(QPixmap(":icons/icon_current_sessions.png"));
-
+ */
connect(close_commit, SIGNAL(triggered()), this, SLOT(closeCommit()));
connect(close_no_commit, SIGNAL(triggered()), this, SLOT(closeNoCommit()));
- connect(show_sessions, SIGNAL(triggered()), this, SLOT(showSessions()));
+ // connect(show_sessions, SIGNAL(triggered()), this, SLOT(showSessions()));
QScrollArea *s = new QScrollArea();
setCentralWidget(s);
@@ -109,15 +110,15 @@ MainWindow::MainWindow(QString cpr, QString templ, QString host,
s->setWidgetResizable(true);
w->setLayout(new QVBoxLayout());
- this->templ = templ;
setStatusBar(status);
init();
-
+ /*
if(sessions.isEmpty()) {
show_sessions->setEnabled(false);
}
+ */
}
MainWindow::~MainWindow()
@@ -127,7 +128,7 @@ MainWindow::~MainWindow()
void MainWindow::closeCommit()
{
netcom.commit();
- sessions.remove(cpr);
+ // sessions.remove(cpr);
isStored = true;
close();
}
@@ -139,8 +140,9 @@ void MainWindow::closeNoCommit()
tr("This session will be stored on this computer "
"only. To reopen it at a later time, simply "
"open the same patient again."));
- sessions.add(cpr, user, netcom.sessionid);
+ // sessions.add(cpr, user, netcom.sessionid);
isStored = true;
+ netcom.nocommit();
close();
}
@@ -154,17 +156,17 @@ void MainWindow::closeDiscard()
QMessageBox::Yes | QMessageBox::No)
== QMessageBox::Yes) {
netcom.discard();
- sessions.remove(cpr);
+ // sessions.remove(cpr);
isStored = true;
close();
}
}
-
+/*
void MainWindow::showSessions()
{
sessions.show();
}
-
+*/
extern QWidget *viewer;
//#include <QApplication>
void MainWindow::closeEvent(QCloseEvent *event)
@@ -179,7 +181,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
== QMessageBox::Yes) {
if(!isStored) {
netcom.discard();
- sessions.remove(cpr);
+ // sessions.remove(cpr);
}
QSettings settings("Aasimon.org", "Pracro");
@@ -187,7 +189,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
settings.beginGroup("MainWindow");
settings.setValue("size", size());
settings.setValue("pos", pos());
- settings.setValue(QString("sessions"), sessions.toVariant());
+ // settings.setValue(QString("sessions"), sessions.toVariant());
settings.endGroup();
event->accept();
@@ -205,19 +207,20 @@ void MainWindow::init()
settings.beginGroup("MainWindow");
resize(settings.value("size", QSize(700, 800)).toSize());
move(settings.value("pos", QPoint(0, 0)).toPoint());
- sessions.fromVariant(settings.value("sessions"));
+ // sessions.fromVariant(settings.value("sessions"));
settings.endGroup();
netcom.patientid = cpr;
+ netcom.templ = templ;
netcom.user = user;
-
+ /*
if(sessions.contains(cpr)) {
netcom.sessionid = sessions.getSessionID(cpr);
if(sessions.getUser(cpr) != user) {
// What to do? We are running an old session with a new user!
}
}
-
+ */
netcom.initConnection();
initialising = true;