-When installing on Windows client machines, be sure to install the *32-bit* version of the
-MyODBC connector, otherwise it won't work!
+When installing on Windows client machines, be sure to install the *32-bit*
+version of the MyODBC connector, otherwise it won't work!
HEADERS += src/about.h \
src/addresseditwidget.h \
src/addresswidget.h \
+ src/alertdialog.h \
src/configdialog.h \
src/contacteditwidget.h \
src/contactwidget.h \
SOURCES += src/about.cpp \
src/addresseditwidget.cpp \
src/addresswidget.cpp \
+ src/alertdialog.cpp \
src/configdialog.cpp \
src/contacteditwidget.cpp \
src/contactwidget.cpp \
--- /dev/null
+//
+// alertdialog.cpp: Dialog for creating & editing alerts
+//
+// Part of the SCheMatic Project
+// (C) 2012 Underground Software
+//
+// JLH = James Hammons <jlhamm@acm.org>
+//
+// WHO WHEN WHAT
+// --- ---------- ------------------------------------------------------------
+// JLH 12/13/2012 Created this file
+//
+
+#include "alertdialog.h"
+#include <QtSql>
+
+
+AlertDialog::AlertDialog(int uidToUse, QWidget * parent/*= 0*/): QDialog(parent), uid(uidToUse)
+{
+ note = new QTextEdit;
+ buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+
+ QVBoxLayout * mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(note);
+ mainLayout->addWidget(buttonBox);
+ setLayout(mainLayout);
+
+ setWindowTitle(tr("Alert"));
+}
+
+
+AlertDialog::~AlertDialog()
+{
+}
+
+
+void AlertDialog::accept(void)
+{
+ // Call base class version, so things work right
+ QDialog::accept();
+
+#if 0
+ // Add note to DB for this user
+ QString noteText = note->document()->toPlainText();
+
+ if (noteText.isEmpty())
+ return;
+
+ QSqlQuery query;
+ query.prepare("INSERT INTO Notes VALUES ('', ?, NULL, ?)");
+ query.addBindValue(uid);
+// query.addBindValue(NULL);
+ query.addBindValue(noteText.toAscii());
+ query.exec();
+#endif
+}
+
--- /dev/null
+//
+// alertdialog.h: Alert entry/editing
+//
+// by James Hammons
+// (C) 2012 Underground Software
+//
+
+#ifndef __ALERTDIALOG_H__
+#define __ALERTDIALOG_H__
+
+#include <QtGui>
+
+
+class AlertDialog: public QDialog
+{
+ Q_OBJECT
+
+ public:
+ AlertDialog(int uidToUse, QWidget * parent = 0);
+ ~AlertDialog();
+
+ public slots:
+ virtual void accept(void);
+
+ private:
+ QDialogButtonBox * buttonBox;
+
+ public:
+ QTextEdit * note;
+ int uid;
+};
+
+#endif // __ALERTDIALOG_H__
+
//
#include "notedialog.h"
+#include <QtSql>
-NoteDialog::NoteDialog(QWidget * parent/*= 0*/): QDialog(parent)
+NoteDialog::NoteDialog(int uidToUse, QWidget * parent/*= 0*/): QDialog(parent), uid(uidToUse)
{
-// tabWidget = new QTabWidget;
-// generalTab = new GeneralTab(this);
-// tabWidget->addTab(generalTab, tr("General"));
-// tabWidget->addTab(new PermissionsTab(fileInfo), tr("Permissions"));
-// tabWidget->addTab(new ApplicationsTab(fileInfo), tr("Applications"));
note = new QTextEdit;
-
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
setWindowTitle(tr("Note"));
}
+
NoteDialog::~NoteDialog()
{
}
+
+void NoteDialog::accept(void)
+{
+ // Call base class version, so things work right
+ QDialog::accept();
+
+ // Add note to DB for this user
+ QString noteText = note->document()->toPlainText();
+
+ if (noteText.isEmpty())
+ return;
+
+ QSqlQuery query;
+ query.prepare("INSERT INTO Notes VALUES ('', ?, NULL, ?)");
+ query.addBindValue(uid);
+// query.addBindValue(NULL);
+ query.addBindValue(noteText.toAscii());
+ query.exec();
+}
+
#include <QtGui>
-//class GeneralTab;
class NoteDialog: public QDialog
{
Q_OBJECT
public:
- NoteDialog(QWidget * parent = 0);
+ NoteDialog(int uidToUse, QWidget * parent = 0);
~NoteDialog();
+ public slots:
+ virtual void accept(void);
+
private:
-// QTabWidget * tabWidget;
QDialogButtonBox * buttonBox;
public:
QTextEdit * note;
-// GeneralTab * generalTab;
+ int uid;
};
#endif // __NOTEDIALOG_H__
#include "scmwidget.h"
#include <QtSql>
#include "addresswidget.h"
+#include "alertdialog.h"
#include "contactwidget.h"
#include "notedialog.h"
void SCMWidget::CreateNote(void)
{
- NoteDialog dlg;
-
- if (dlg.exec() == true)
- {
- // Add note to DB for this user
- QString note = dlg.note->document()->toPlainText();
+ NoteDialog dlg(currentUID);
- QSqlQuery query;
- query.prepare("INSERT INTO Notes VALUES ('', ?, NULL, ?)");
- query.addBindValue(currentUID);
-// query.addBindValue(NULL);
- query.addBindValue(note.toAscii());
- query.exec();
+ if (dlg.exec() == false)
+ return;
- UpdateNotes();
- }
+ UpdateNotes();
}
void SCMWidget::CreateAlert(void)
{
+ AlertDialog dlg(currentUID);
+
+ if (dlg.exec() == false)
+ return;
+
QMessageBox::warning(this, "Approaching Singularity!", "TODO: Implementation");
+// UpdateAlerts();
}
QSqlQuery query;
query.prepare("SELECT note FROM Notes WHERE uid = ?");
-// "c.name, email, c.address, phone1, phone2, fax, description, v.vlid FROM "
-// "Vendor AS v LEFT OUTER JOIN Location AS l ON v.vid = l.vid "
-// "LEFT OUTER JOIN (Contact AS c JOIN ContactType AS ct ON c.ctid = ct.ctid) "
-// "ON v.vid = c.vid WHERE v.vid = ?");
query.addBindValue(currentUID);
query.exec();
}
}
+
+void SCMWidget::UpdateAlerts(void)
+{
+ // TODO: Implementation
+}
+
void GetVendorIDs(void);
void GetVendor(int);
void UpdateNotes(void);
+ void UpdateAlerts(void);
public:
QTreeView * purchaseOrders;