beta
authornicola <nicola@nicola-desktop.(none)>
Tue, 8 Dec 2009 13:28:53 +0000 (14:28 +0100)
committernicola <nicola@nicola-desktop.(none)>
Tue, 8 Dec 2009 13:28:53 +0000 (14:28 +0100)
badgewindow.cpp

index e5df78c..a030ede 100644 (file)
@@ -15,6 +15,11 @@ BadgeWindow::BadgeWindow(QWidget *parent)
     ui->menuBar->addAction(ui->actionInfo);
     ui->menuBar->addAction(ui->actionClose);
     connect(ui->actionSearch, SIGNAL(triggered()), this, SLOT(search()));
+    connect(ui->actionClose, SIGNAL(triggered()), this, SLOT(close()));
+    connect(ui->actionInfo, SIGNAL(triggered()), this, SLOT(info()));
+
+
+    showMaximized();
 }
 
 
@@ -38,14 +43,34 @@ void BadgeWindow::selectedDay(QDate date)
 void BadgeWindow::search()
 {
     DialogSearch searchDialog;
-    QString total;
+    QTime total;
+    QString message;
     QString hours;
+    QString minutes;
+    bool ok;
+
+    total = searchDialog.totalHours(ok);
+    if (ok) {
+        hours.setNum(total.hour());
+        minutes.setNum(total.minute());
+        message = "Total time is: " + hours + " hours and " + minutes + " minutes";
+        QMessageBox::information(this, tr("Badge"), tr(message.toLatin1()));
+    }
 
-    total.setNum(searchDialog.totalHours());
-    hours = "Total hours is :" + total;
-    QMessageBox::information(this, tr("Badge"),
-                             tr(hours.toLatin1()));;
+}
 
+void BadgeWindow::info()
+{
+    QMessageBox::aboutQt(this);
+    QMessageBox::about(this, tr("Badge"), tr("(c) 2009 Nicola De Filippo - nicola@nicoladefilippo.it\n"
+                         "This program is licensed to you under terms of the GNU General Public\n"
+                        "License Version 2 as published by Free Software Foundation. This gives\n"
+                        "you legal permission to copy, distribute and/or modify this software under\n"
+                        "certain conditions. For details, see the file 'COPYING' that came with this\n"
+                        "software distribution. If you did not get the file, send email to author.\n\n"
+                        "The program is provided AS IS with No WARRANTY OF ANY KIND,\n"
+                        "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND\n"
+                        "FITNESS FOR PARTICULAR PURPOSE"));
 }
 
 BadgeWindow::~BadgeWindow()