summaryrefslogtreecommitdiff
path: root/client/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/mainwindow.cc')
-rw-r--r--client/mainwindow.cc34
1 files changed, 30 insertions, 4 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index 46662fa..9634f24 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -59,10 +59,21 @@ MainWindow::MainWindow(QString cpr, QString templ, QString host,
status->addPermanentWidget(new QLabel("Pracro v."VERSION));
QToolBar *toolbar = addToolBar("controls");
+ toolbar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
QAction *close_commit = toolbar->addAction("Close and commit");
+ close_commit->setIcon(QPixmap(":icons/icon_close_commit.png"));
+
QAction *close_no_commit = toolbar->addAction("Close no commit");
+ close_no_commit->setIcon(QPixmap(":icons/icon_close_no_commit.png"));
+
QAction *close_discard = toolbar->addAction("Close discard");
+ close_discard->setIcon(QPixmap(":icons/icon_discard.png"));
+
+ toolbar->addSeparator();
+
QAction *show_sessions = toolbar->addAction("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(close_discard, SIGNAL(triggered()), this, SLOT(closeDiscard()));
@@ -78,8 +89,12 @@ MainWindow::MainWindow(QString cpr, QString templ, QString host,
this->templ = templ;
setStatusBar(status);
-
+
init();
+
+ if(sessions.isEmpty()) {
+ show_sessions->setEnabled(false);
+ }
}
MainWindow::~MainWindow()
@@ -95,15 +110,26 @@ void MainWindow::closeCommit()
void MainWindow::closeNoCommit()
{
+ QMessageBox::information(this,
+ "Closing without commit",
+ "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);
close();
}
void MainWindow::closeDiscard()
{
- netcom.discard();
- sessions.remove(cpr);
- close();
+ if(QMessageBox::question(this,
+ "Discard",
+ "This session will <strong>NOT</strong> be stored in the journal.<br/>"
+ "Are you sure you want to continue?",
+ QMessageBox::Yes | QMessageBox::Abort)
+ == QMessageBox::Yes) {
+ netcom.discard();
+ sessions.remove(cpr);
+ close();
+ }
}
void MainWindow::showSessions()