]> Shamusworld >> Repos - schematic/commitdiff
Initial commit.
authorShamus Hammons <jlhamm@acm.org>
Wed, 19 Sep 2012 03:31:53 +0000 (22:31 -0500)
committerShamus Hammons <jlhamm@acm.org>
Wed, 19 Sep 2012 03:31:53 +0000 (22:31 -0500)
20 files changed:
database-schema.txt [new file with mode: 0644]
phase1.ui [new file with mode: 0644]
res/schematic.png [new file with mode: 0644]
schematic [new file with mode: 0755]
schematic-schema.sql [new file with mode: 0644]
schematic.pro [new file with mode: 0644]
schematic.qrc [new file with mode: 0644]
specs.txt [new file with mode: 0644]
src/about.cpp [new file with mode: 0644]
src/about.h [new file with mode: 0644]
src/configdialog.cpp [new file with mode: 0644]
src/configdialog.h [new file with mode: 0644]
src/generaltab.cpp [new file with mode: 0644]
src/generaltab.h [new file with mode: 0644]
src/logindialog.cpp [new file with mode: 0644]
src/logindialog.h [new file with mode: 0644]
src/main.cpp [new file with mode: 0644]
src/main.h [new file with mode: 0644]
src/mainwin.cpp [new file with mode: 0644]
src/mainwin.h [new file with mode: 0644]

diff --git a/database-schema.txt b/database-schema.txt
new file mode 100644 (file)
index 0000000..a7bc741
--- /dev/null
@@ -0,0 +1,87 @@
+Supply Chain Management Database (SCheMatic: The Supply Chain Manager-O-Matic)
+------------------------------------------------------------------------------
+
+TABLES:
+
+Vendor
+VID (P-key) | VLID | Name
+CREATE TABLE Vendor (vid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, vlid INT, name VARCHAR(100), FOREIGN KEY (vlid) REFERENCES VendorLevel(vlid)) ENGINE=INNODB;
+
+VendorLevel
+VLID (P-key) | VendorUseable | Color | Description
+CREATE TABLE VendorLevel (vlid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, vendorUsable TINYINT(1) NOT NULL DEFAULT 0, color INT(4), description VARCHAR(100)) ENGINE=INNODB;
+
+VendorType
+VTID (P-key) | VGID | Description
+CREATE TABLE VendorType (vtid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, vgid INT, description VARCHAR(100), FOREIGN KEY (vgid) REFERENCES VendorGroup(vgid)) ENGINE=INNODB;
+
+VendorGroup
+VGID (P-key) | Description
+CREATE TABLE VendorGroup (vgid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, description VARCHAR(100)) ENGINE=INNODB;
+
+VendorSpecificTypes
+VID (multi) | VTID (multi)
+CREATE TABLE VendorSpecificTypes (vid INT, vtid INT, FOREIGN KEY (vid) REFERENCES Vendor(vid), FOREIGN KEY (vtid) REFERENCES VendorType(vtid)) ENGINE=INNODB;
+
+Location
+LID (P-key) | VID | Description
+CREATE TABLE Location () ENGINE=INNODB;
+
+Contact
+CID (P-key) | VID | CTID | Name | Email | Address | Phone1 | Phone2 | Fax
+CREATE TABLE Contact (cid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, vid INT, CTID int, name VARCHAR(64), email VARCHAR(64), address VARCHAR(200), phone1 VARCHAR(32), phone2 VARCHAR(32), fax VARCHAR(32), FOREIGN KEY (vid) REFERENCES Vendor(vid), FOREIGN KEY (ctid) REFERENCES ContactType(ctid)) ENGINE=INNODB;
+
+ContactType
+CTID (P-key) | Description
+CREATE TABLE ContactType (ctid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, description VARCHAR(100)) ENGINE=INNODB;
+
+User
+UID (P-key) | UCID | Name | Login | Password
+CREATE TABLE User (uid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, ucid int, name VARCHAR(64), login VARCHAR(32), password VARCHAR(64), FOREIGN KEY (ucid) REFERENCES UserClass(ucid)) ENGINE=INNODB;
+
+UserClass
+UCID | PrivilegeLevel | Description
+CREATE TABLE UserClass (ucid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, privilegeLevel INT NOT NULL DEFAULT 0, description VARCHAR(100)) ENGINE=INNODB;
+
+PurchaseOrder
+POID (P-key) | VID | Closed | Description
+CREATE TABLE PurchaseOrder (poid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, vid INT, closed TINYINT(1) NOT NULL DEFAULT 0, description VARCHAR(200), FOREIGN KEY (vid) REFERENCES Vendor(vid)) ENGINE=INNODB;
+
+Documents
+DID (P-key) | DTID | VID | POID | Document
+CREATE TABLE Documents (did INT NOT NULL PRIMARY KEY AUTO_INCREMENT, dtid INT, vid INT, poid INT, document LONGBLOB, FOREIGN KEY (dtid) REFERENCES DocumentType(dtid), FOREIGN KEY (vid) REFERENCES Vendor(vid), FOREIGN KEY (poid) REFERENCES PurchaseOrder(poid)) ENGINE=INNODB;
+
+DocumentType
+DTID (P-key) | Description
+CREATE TABLE DocumentType (dtid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, description VARCHAR(100)) ENGINE=INNODB;
+
+Notes
+NID (P-key) | POID | Note
+CREATE TABLE Notes (nid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, poid INT, note VARCHAR(200)) ENGINE=INNODB;
+
+Alerts
+AID (P-key) | UID | NID | Date | Description
+CREATE TABLE Alerts (aid INT NOT NULL PRIMARY KEY AUTO_INCREMENT, uid INT, nid INT, date DATE, description VARCHAR(200), FOREIGN KEY (uid) REFERENCES User(uid)) ENGINE=INNODB;
+
+History
+UID | Date | Note
+CREATE TABLE History (uid INT, date DATETIME, note VARCHAR(100), FOREIGN KEY (uid) REFERENCES User(uid)) ENGINE=INNODB;
+
+-------------------------------------------------------------------------------
+
+PurchaseRequest
+PRID (P-key) | UIDRequestor | Description
+CREATE TABLE () ENGINE=INNODB;
+
+PRItems
+PRID (multi) | Quantity | UnitPrice | Description
+CREATE TABLE () ENGINE=INNODB;
+
+PurchaseApprovals
+PRID (multi) | UIDApprover | Approved
+CREATE TABLE () ENGINE=INNODB;
+
+Approvers
+UIDApprover (multi) | UIDRequestor (multi)
+CREATE TABLE () ENGINE=INNODB;
+
diff --git a/phase1.ui b/phase1.ui
new file mode 100644 (file)
index 0000000..768c40c
--- /dev/null
+++ b/phase1.ui
@@ -0,0 +1,463 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>932</width>
+    <height>626</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <widget class="QTextBrowser" name="textBrowser">
+    <property name="geometry">
+     <rect>
+      <x>570</x>
+      <y>410</y>
+      <width>141</width>
+      <height>111</height>
+     </rect>
+    </property>
+    <property name="html">
+     <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Here's some stuff to look at, isn't it purty? :-)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>50</y>
+      <width>221</width>
+      <height>16</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <pointsize>12</pointsize>
+     </font>
+    </property>
+    <property name="text">
+     <string>Vendor Name</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_2">
+    <property name="geometry">
+     <rect>
+      <x>240</x>
+      <y>10</y>
+      <width>51</width>
+      <height>16</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Search:</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit">
+    <property name="geometry">
+     <rect>
+      <x>290</x>
+      <y>10</y>
+      <width>191</width>
+      <height>22</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="Line" name="line">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>30</y>
+      <width>731</width>
+      <height>16</height>
+     </rect>
+    </property>
+    <property name="orientation">
+     <enum>Qt::Horizontal</enum>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_7">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>230</y>
+      <width>61</width>
+      <height>14</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Contact1:</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_6">
+    <property name="geometry">
+     <rect>
+      <x>90</x>
+      <y>230</y>
+      <width>221</width>
+      <height>22</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Title, email, phone, fax, etc.</string>
+    </property>
+   </widget>
+   <widget class="QCheckBox" name="checkBox">
+    <property name="geometry">
+     <rect>
+      <x>90</x>
+      <y>200</y>
+      <width>121</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>NDA Signed</string>
+    </property>
+   </widget>
+   <widget class="QWidget" name="formLayoutWidget">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>80</y>
+      <width>281</width>
+      <height>111</height>
+     </rect>
+    </property>
+    <layout class="QFormLayout" name="formLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="label_3">
+       <property name="text">
+        <string>Address:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QLineEdit" name="lineEdit_2"/>
+     </item>
+     <item row="1" column="0">
+      <widget class="QLabel" name="label_4">
+       <property name="text">
+        <string>City:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="0">
+      <widget class="QLabel" name="label_5">
+       <property name="text">
+        <string>State:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1">
+      <widget class="QLineEdit" name="lineEdit_4"/>
+     </item>
+     <item row="3" column="1">
+      <widget class="QLineEdit" name="lineEdit_5"/>
+     </item>
+     <item row="3" column="0">
+      <widget class="QLabel" name="label_6">
+       <property name="text">
+        <string>ZIP:</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="QLineEdit" name="lineEdit_3"/>
+     </item>
+    </layout>
+   </widget>
+   <widget class="QLabel" name="label_8">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>250</y>
+      <width>61</width>
+      <height>14</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>Contact2:</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_7">
+    <property name="geometry">
+     <rect>
+      <x>90</x>
+      <y>250</y>
+      <width>113</width>
+      <height>22</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_9">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>10</y>
+      <width>131</width>
+      <height>16</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>User: joneal</string>
+    </property>
+   </widget>
+   <widget class="QTableWidget" name="tableWidget">
+    <property name="geometry">
+     <rect>
+      <x>320</x>
+      <y>50</y>
+      <width>591</width>
+      <height>192</height>
+     </rect>
+    </property>
+    <column>
+     <property name="text">
+      <string>PO #</string>
+     </property>
+    </column>
+    <column>
+     <property name="text">
+      <string>Vendor</string>
+     </property>
+    </column>
+    <column>
+     <property name="text">
+      <string>Desc.</string>
+     </property>
+    </column>
+    <column>
+     <property name="text">
+      <string>OAD</string>
+     </property>
+    </column>
+    <column>
+     <property name="text">
+      <string>UAD</string>
+     </property>
+    </column>
+    <column>
+     <property name="text">
+      <string>Docs</string>
+     </property>
+    </column>
+    <column>
+     <property name="text">
+      <string>FAI</string>
+     </property>
+    </column>
+   </widget>
+   <widget class="QGroupBox" name="groupBox">
+    <property name="geometry">
+     <rect>
+      <x>410</x>
+      <y>380</y>
+      <width>121</width>
+      <height>121</height>
+     </rect>
+    </property>
+    <property name="title">
+     <string>Create Item</string>
+    </property>
+    <widget class="QPushButton" name="pushButton">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>30</y>
+       <width>100</width>
+       <height>23</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>PO</string>
+     </property>
+    </widget>
+    <widget class="QPushButton" name="pushButton_2">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>60</y>
+       <width>100</width>
+       <height>23</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>Alert</string>
+     </property>
+    </widget>
+    <widget class="QPushButton" name="pushButton_3">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>90</y>
+       <width>100</width>
+       <height>23</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>Note</string>
+     </property>
+    </widget>
+   </widget>
+   <widget class="QFrame" name="frame">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>380</y>
+      <width>131</width>
+      <height>121</height>
+     </rect>
+    </property>
+    <property name="frameShape">
+     <enum>QFrame::StyledPanel</enum>
+    </property>
+    <property name="frameShadow">
+     <enum>QFrame::Raised</enum>
+    </property>
+    <widget class="QLabel" name="label_10">
+     <property name="geometry">
+      <rect>
+       <x>10</x>
+       <y>10</y>
+       <width>111</width>
+       <height>101</height>
+      </rect>
+     </property>
+     <property name="font">
+      <font>
+       <pointsize>64</pointsize>
+      </font>
+     </property>
+     <property name="autoFillBackground">
+      <bool>false</bool>
+     </property>
+     <property name="text">
+      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; background-color:#0055ff;&quot;&gt; &amp;nbsp;2 &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignCenter</set>
+     </property>
+    </widget>
+   </widget>
+   <widget class="QTreeWidget" name="treeWidget">
+    <property name="geometry">
+     <rect>
+      <x>150</x>
+      <y>380</y>
+      <width>256</width>
+      <height>192</height>
+     </rect>
+    </property>
+    <column>
+     <property name="text">
+      <string>Vendor Classes</string>
+     </property>
+    </column>
+    <item>
+     <property name="text">
+      <string>Machine</string>
+     </property>
+     <item>
+      <property name="text">
+       <string>Cutter</string>
+      </property>
+     </item>
+     <item>
+      <property name="text">
+       <string>Casting</string>
+      </property>
+     </item>
+    </item>
+    <item>
+     <property name="text">
+      <string>Electronic Parts</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>PCBs</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>Raw Materials</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>Lenses</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>COTS</string>
+     </property>
+    </item>
+    <item>
+     <property name="text">
+      <string>Coatings</string>
+     </property>
+    </item>
+   </widget>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>932</width>
+     <height>20</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuMenu1">
+    <property name="title">
+     <string>Menu1</string>
+    </property>
+    <addaction name="actionSubmenu_Item_1"/>
+   </widget>
+   <widget class="QMenu" name="menuMenu2">
+    <property name="title">
+     <string>Menu2</string>
+    </property>
+    <addaction name="actionSubmenu_Item_2"/>
+   </widget>
+   <addaction name="menuMenu1"/>
+   <addaction name="menuMenu2"/>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+  <action name="actionSubmenu_Item_1">
+   <property name="text">
+    <string>Submenu Item 1</string>
+   </property>
+  </action>
+  <action name="actionSubmenu_Item_2">
+   <property name="text">
+    <string>Submenu Item 1</string>
+   </property>
+  </action>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/res/schematic.png b/res/schematic.png
new file mode 100644 (file)
index 0000000..2b9c7fd
Binary files /dev/null and b/res/schematic.png differ
diff --git a/schematic b/schematic
new file mode 100755 (executable)
index 0000000..56c06a2
Binary files /dev/null and b/schematic differ
diff --git a/schematic-schema.sql b/schematic-schema.sql
new file mode 100644 (file)
index 0000000..acc74fc
--- /dev/null
@@ -0,0 +1,419 @@
+-- MySQL dump 10.13  Distrib 5.1.62, for pc-linux-gnu (x86_64)
+--
+-- Host: localhost    Database: schematic
+-- ------------------------------------------------------
+-- Server version      5.1.62-log
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `Alerts`
+--
+
+DROP TABLE IF EXISTS `Alerts`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Alerts` (
+  `aid` int(11) NOT NULL AUTO_INCREMENT,
+  `uid` int(11) DEFAULT NULL,
+  `nid` int(11) DEFAULT NULL,
+  `date` date DEFAULT NULL,
+  `description` varchar(200) DEFAULT NULL,
+  PRIMARY KEY (`aid`),
+  KEY `uid` (`uid`),
+  CONSTRAINT `Alerts_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `User` (`uid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `Alerts`
+--
+
+LOCK TABLES `Alerts` WRITE;
+/*!40000 ALTER TABLE `Alerts` DISABLE KEYS */;
+/*!40000 ALTER TABLE `Alerts` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `Contact`
+--
+
+DROP TABLE IF EXISTS `Contact`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Contact` (
+  `cid` int(11) NOT NULL AUTO_INCREMENT,
+  `vid` int(11) DEFAULT NULL,
+  `CTID` int(11) DEFAULT NULL,
+  `name` varchar(64) DEFAULT NULL,
+  `email` varchar(64) DEFAULT NULL,
+  `address` varchar(200) DEFAULT NULL,
+  `phone1` varchar(32) DEFAULT NULL,
+  `phone2` varchar(32) DEFAULT NULL,
+  `fax` varchar(32) DEFAULT NULL,
+  PRIMARY KEY (`cid`),
+  KEY `vid` (`vid`),
+  KEY `CTID` (`CTID`),
+  CONSTRAINT `Contact_ibfk_1` FOREIGN KEY (`vid`) REFERENCES `Vendor` (`vid`),
+  CONSTRAINT `Contact_ibfk_2` FOREIGN KEY (`CTID`) REFERENCES `ContactType` (`ctid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `Contact`
+--
+
+LOCK TABLES `Contact` WRITE;
+/*!40000 ALTER TABLE `Contact` DISABLE KEYS */;
+/*!40000 ALTER TABLE `Contact` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `ContactType`
+--
+
+DROP TABLE IF EXISTS `ContactType`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `ContactType` (
+  `ctid` int(11) NOT NULL AUTO_INCREMENT,
+  `description` varchar(100) DEFAULT NULL,
+  PRIMARY KEY (`ctid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `ContactType`
+--
+
+LOCK TABLES `ContactType` WRITE;
+/*!40000 ALTER TABLE `ContactType` DISABLE KEYS */;
+/*!40000 ALTER TABLE `ContactType` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `DocumentType`
+--
+
+DROP TABLE IF EXISTS `DocumentType`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `DocumentType` (
+  `dtid` int(11) NOT NULL AUTO_INCREMENT,
+  `description` varchar(100) DEFAULT NULL,
+  PRIMARY KEY (`dtid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `DocumentType`
+--
+
+LOCK TABLES `DocumentType` WRITE;
+/*!40000 ALTER TABLE `DocumentType` DISABLE KEYS */;
+/*!40000 ALTER TABLE `DocumentType` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `Documents`
+--
+
+DROP TABLE IF EXISTS `Documents`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Documents` (
+  `did` int(11) NOT NULL AUTO_INCREMENT,
+  `dtid` int(11) DEFAULT NULL,
+  `vid` int(11) DEFAULT NULL,
+  `poid` int(11) DEFAULT NULL,
+  `document` longblob,
+  PRIMARY KEY (`did`),
+  KEY `dtid` (`dtid`),
+  KEY `vid` (`vid`),
+  KEY `poid` (`poid`),
+  CONSTRAINT `Documents_ibfk_1` FOREIGN KEY (`dtid`) REFERENCES `DocumentType` (`dtid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `Documents`
+--
+
+LOCK TABLES `Documents` WRITE;
+/*!40000 ALTER TABLE `Documents` DISABLE KEYS */;
+/*!40000 ALTER TABLE `Documents` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `History`
+--
+
+DROP TABLE IF EXISTS `History`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `History` (
+  `uid` int(11) DEFAULT NULL,
+  `date` datetime DEFAULT NULL,
+  `note` varchar(100) DEFAULT NULL,
+  KEY `uid` (`uid`),
+  CONSTRAINT `History_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `User` (`uid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `History`
+--
+
+LOCK TABLES `History` WRITE;
+/*!40000 ALTER TABLE `History` DISABLE KEYS */;
+/*!40000 ALTER TABLE `History` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `Notes`
+--
+
+DROP TABLE IF EXISTS `Notes`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Notes` (
+  `nid` int(11) NOT NULL AUTO_INCREMENT,
+  `poid` int(11) DEFAULT NULL,
+  `note` varchar(200) DEFAULT NULL,
+  PRIMARY KEY (`nid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `Notes`
+--
+
+LOCK TABLES `Notes` WRITE;
+/*!40000 ALTER TABLE `Notes` DISABLE KEYS */;
+/*!40000 ALTER TABLE `Notes` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `PurchaseOrder`
+--
+
+DROP TABLE IF EXISTS `PurchaseOrder`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `PurchaseOrder` (
+  `poid` int(11) NOT NULL AUTO_INCREMENT,
+  `vid` int(11) DEFAULT NULL,
+  `closed` tinyint(1) NOT NULL DEFAULT '0',
+  `description` varchar(200) DEFAULT NULL,
+  PRIMARY KEY (`poid`),
+  KEY `vid` (`vid`),
+  CONSTRAINT `PurchaseOrder_ibfk_1` FOREIGN KEY (`vid`) REFERENCES `Vendor` (`vid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `PurchaseOrder`
+--
+
+LOCK TABLES `PurchaseOrder` WRITE;
+/*!40000 ALTER TABLE `PurchaseOrder` DISABLE KEYS */;
+/*!40000 ALTER TABLE `PurchaseOrder` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `User`
+--
+
+DROP TABLE IF EXISTS `User`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `User` (
+  `uid` int(11) NOT NULL AUTO_INCREMENT,
+  `ucid` int(11) DEFAULT NULL,
+  `name` varchar(64) DEFAULT NULL,
+  `login` varchar(32) DEFAULT NULL,
+  `password` varchar(64) DEFAULT NULL,
+  PRIMARY KEY (`uid`),
+  KEY `ucid` (`ucid`),
+  CONSTRAINT `User_ibfk_1` FOREIGN KEY (`ucid`) REFERENCES `UserClass` (`ucid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `User`
+--
+
+LOCK TABLES `User` WRITE;
+/*!40000 ALTER TABLE `User` DISABLE KEYS */;
+/*!40000 ALTER TABLE `User` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `UserClass`
+--
+
+DROP TABLE IF EXISTS `UserClass`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `UserClass` (
+  `ucid` int(11) NOT NULL AUTO_INCREMENT,
+  `privilegeLevel` int(11) NOT NULL DEFAULT '0',
+  `description` varchar(100) DEFAULT NULL,
+  PRIMARY KEY (`ucid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `UserClass`
+--
+
+LOCK TABLES `UserClass` WRITE;
+/*!40000 ALTER TABLE `UserClass` DISABLE KEYS */;
+/*!40000 ALTER TABLE `UserClass` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `Vendor`
+--
+
+DROP TABLE IF EXISTS `Vendor`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Vendor` (
+  `vid` int(11) NOT NULL AUTO_INCREMENT,
+  `vlid` int(11) DEFAULT NULL,
+  `name` varchar(100) DEFAULT NULL,
+  PRIMARY KEY (`vid`),
+  KEY `vlid` (`vlid`),
+  CONSTRAINT `Vendor_ibfk_1` FOREIGN KEY (`vlid`) REFERENCES `VendorLevel` (`vlid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `Vendor`
+--
+
+LOCK TABLES `Vendor` WRITE;
+/*!40000 ALTER TABLE `Vendor` DISABLE KEYS */;
+/*!40000 ALTER TABLE `Vendor` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `VendorGroup`
+--
+
+DROP TABLE IF EXISTS `VendorGroup`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `VendorGroup` (
+  `vgid` int(11) NOT NULL AUTO_INCREMENT,
+  `description` varchar(100) DEFAULT NULL,
+  PRIMARY KEY (`vgid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `VendorGroup`
+--
+
+LOCK TABLES `VendorGroup` WRITE;
+/*!40000 ALTER TABLE `VendorGroup` DISABLE KEYS */;
+/*!40000 ALTER TABLE `VendorGroup` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `VendorLevel`
+--
+
+DROP TABLE IF EXISTS `VendorLevel`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `VendorLevel` (
+  `vlid` int(11) NOT NULL AUTO_INCREMENT,
+  `vendorUsable` tinyint(1) NOT NULL DEFAULT '0',
+  `color` int(4) DEFAULT NULL,
+  `description` varchar(100) DEFAULT NULL,
+  PRIMARY KEY (`vlid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `VendorLevel`
+--
+
+LOCK TABLES `VendorLevel` WRITE;
+/*!40000 ALTER TABLE `VendorLevel` DISABLE KEYS */;
+/*!40000 ALTER TABLE `VendorLevel` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `VendorSpecificTypes`
+--
+
+DROP TABLE IF EXISTS `VendorSpecificTypes`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `VendorSpecificTypes` (
+  `vid` int(11) DEFAULT NULL,
+  `vtid` int(11) DEFAULT NULL,
+  KEY `vid` (`vid`),
+  KEY `vtid` (`vtid`),
+  CONSTRAINT `VendorSpecificTypes_ibfk_1` FOREIGN KEY (`vid`) REFERENCES `Vendor` (`vid`),
+  CONSTRAINT `VendorSpecificTypes_ibfk_2` FOREIGN KEY (`vtid`) REFERENCES `VendorType` (`vtid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `VendorSpecificTypes`
+--
+
+LOCK TABLES `VendorSpecificTypes` WRITE;
+/*!40000 ALTER TABLE `VendorSpecificTypes` DISABLE KEYS */;
+/*!40000 ALTER TABLE `VendorSpecificTypes` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `VendorType`
+--
+
+DROP TABLE IF EXISTS `VendorType`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `VendorType` (
+  `vtid` int(11) NOT NULL AUTO_INCREMENT,
+  `vgid` int(11) DEFAULT NULL,
+  `description` varchar(100) DEFAULT NULL,
+  PRIMARY KEY (`vtid`),
+  KEY `vgid` (`vgid`),
+  CONSTRAINT `VendorType_ibfk_1` FOREIGN KEY (`vgid`) REFERENCES `VendorGroup` (`vgid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `VendorType`
+--
+
+LOCK TABLES `VendorType` WRITE;
+/*!40000 ALTER TABLE `VendorType` DISABLE KEYS */;
+/*!40000 ALTER TABLE `VendorType` ENABLE KEYS */;
+UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2012-09-18 19:39:04
diff --git a/schematic.pro b/schematic.pro
new file mode 100644 (file)
index 0000000..8cb9689
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# Qt qmake file for SCheMatic (the Vendor Supply Chain Manager-O-Matic)
+# by James Hammons
+# (C) 2012 Underground Software
+#
+
+# Use 'qmake -o Makefile schematic.pro', or just qmake
+
+CONFIG += qt
+#CONFIG += qt debug
+QT += sql
+
+# We stuff all the intermediate crap into obj, so we mere mortals can deal with
+# it. :-)
+
+OBJECTS_DIR = ./obj
+MOC_DIR = ./obj
+RCC_DIR = ./obj
+UI_DIR = ./obj
+
+RESOURCES += schematic.qrc
+
+# Source files
+
+HEADERS += src/about.h \
+       src/configdialog.h \
+       src/generaltab.h \
+       src/logindialog.h \
+       src/main.h \
+       src/mainwin.h
+
+SOURCES += src/about.cpp \
+       src/configdialog.cpp \
+       src/generaltab.cpp \
+       src/logindialog.cpp \
+       src/main.cpp \
+       src/mainwin.cpp
+
diff --git a/schematic.qrc b/schematic.qrc
new file mode 100644 (file)
index 0000000..0ff7cd7
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+       <file>res/schematic.png</file>
+</qresource>
+</RCC>
diff --git a/specs.txt b/specs.txt
new file mode 100644 (file)
index 0000000..8b11dab
--- /dev/null
+++ b/specs.txt
@@ -0,0 +1,103 @@
+Supply Chain Management Database (SCheMatic: The Supply Chain Manager-O-Matic)
+------------------------------------------------------------------------------
+
+Section 1 (Vendor Info):
+
+Essentially here is the display for vendor information including contacts with titles, addresses, phones, faxes & emails.
+
+There needs to be an edit field button for vendor information that activates depending on user level.
+
+There needs to be a lit up or not box for if they have completed an NDA.
+
+
+Section 2 (Open P.O.s):
+
+7 Columns
+
+ o  PO# - well the first column displays the PO# - when you click, you can automatically create a note that will be associated with the PO in history.
+ o  Company Name
+ o  Desc - Well this would be what the PO is called or saved as.
+ o  Original Arrival Date - Date unit expected at time of order.
+ o  Updated Arrival Date - This is a date that can be adjusted based upon information learned. This means it needs to be editable. I figure if we click on this line, a popup displays where you can edit arrival date. It will prompt for a reason which. The reason and note of the update and by whom will be recorded in history.
+ o  Supplied Docs - Here will be a record of documents/files supplied with the PO. These will be uploaded when you "create" the PO in section 3. This will need to be editable with history of edits in the history field.
+ o  FAI - These are docs that are received and saved whenever a shipment is received. Should be able to click on this line section to add.
+
+Check box that says all. If checked all open POs. If not then vendor specific POs.
+
+Open POs are created in section 3.
+
+
+Section 3 (Create PO):
+
+So here is the create section. Three main buttons (at the moment):
+
+ o  PO
+ o  Alert
+ o  Note
+
+So those buttons will call up a popup window I expect. I think for ease of design they can all bring up the same page, just with the sections not applicable greyed out.
+
+PO - This will actually bring up all three sections as they all apply when entering a new PO.
+
+ o  Sections: PO #, PO Desc, PO company name, expected arrival date (have 5 expected arrival date fields as we may have staggered POs), Alerts (again, have 5 fields with date, time, user assigned, admin always copied on alerts, Contact,) Notes.
+
+Alert - Will only open up window with alert, contact, company name (or User Name for Internal contact) and notes, PO #.
+
+Notes - Company name, contact, PO #, Notes
+
+
+Section 4 (Vendor Level):
+
+Section backlit Green if they are a level 1 (Tier 1?).
+Section backlit Blue if they are level 2.
+Section backlit Red if they are BANNED.
+Big number display for level (1, 2, X?)
+
+
+Section 5 (Closed POs):
+
+Similar to section 2
+
+
+Section 6 (Action List):
+
+This is where todos are listed. Either alerts planned or ExactMax saying that a PO has been created.
+Administrator sees all. Users just see their stuff.
+3 columns
+
+ o  First colum reflects check boxes if the line items found in the action list. Check and then hit the delete button if desired.
+ o  Second is the user assigned check box. If you check, then a small pop up comes in with a list of users you can assign this task to.
+ o  Description of action.
+
+
+Section 7 (Action History):
+
+Scrollable action history list. Everyone sees all.
+
+
+Section 8 (Vendor page specific history):
+
+Here is where the history lives for each vendor on their page.
+
+Search box allows you to enter date range, contact name or PO # to view history in box.
+
+Window has 4 Columns
+
+ o  First column is date
+ o  Second column is PO #
+ o  Third column is the vendor note or description of action
+ o  Fourth column is user
+
+
+Section 9 (Vendor Class):
+
+Essentially this is where each vendor has their class ability listed. These classes are searchable.
+
+Edit button to assign classes to vendor.
+
+
+Section 10 (Header Bar):
+
+There is a universal search field.
+
+User name is listed.
diff --git a/src/about.cpp b/src/about.cpp
new file mode 100644 (file)
index 0000000..dc43bdb
--- /dev/null
@@ -0,0 +1,64 @@
+//
+// about.cpp - Credits
+//
+// by James Hammons
+// (C) 2012 Underground Software
+//
+// JLH = James Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -------------------------------------------------------------
+// JLH  01/21/2010  Created this file
+//
+
+#include "about.h"
+//#include "version.h"
+
+AboutWindow::AboutWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog)
+{
+       setWindowTitle(tr("About SCheMatic..."));
+
+       layout = new QVBoxLayout();
+       layout->setSizeConstraint(QLayout::SetFixedSize);
+       setLayout(layout);
+
+       image = new QLabel();
+       image->setAlignment(Qt::AlignRight);
+       image->setPixmap(QPixmap(":/res/schematic.png"));
+       layout->addWidget(image);
+
+       QString s;
+       s.append(tr(
+               "<table>"
+               "<tr><td align='right'><b>Version: </b></td><td>"
+//             VJ_RELEASE_VERSION " (" VJ_RELEASE_SUBVERSION ")"
+               "0.0.1 (Testing)"
+               "</td></tr>"
+               "<tr><td align='right'><b>Coders: </b></td><td>James \"Shamus\" Hammons</td></tr>"
+               "<tr><td align='right'><b>Testers: </b></td><td>Jason O'Neal</td></tr>"
+//             "<tr><td align='right'><b>Build Team: </b></td><td>ggn (win32)<br>LinkoVitch, goldenegg (MacOS)</td></tr>"
+//             "<tr><td align='right'><b>Homepage: </b></td><td>http://icculus.org/virtualjaguar/</td></tr>"
+               "</table>"
+               "<br><br>"
+               "<i>The SCheMatic team would like to express their gratitude to:</i>"
+               "<br><br>"
+               "<b>Tracking Point</b> for underwriting the creation of SCheMatic<br>"
+//             "<b>David Raingeard</b> for the original Virtual Jaguar sources<br>"
+//             "<b>Bernd Schmidt</b> for his UAE 68K emulator<br>"
+//             "<b>Sam Lantinga</b> for his amazing SDL libraries<br>"
+//             "<b>Ryan C. Gordon</b> for Virtual Jaguar's web presence<br>"
+//             "<b>Curt Vendel</b> for various Jaguar & other goodies (you <i>rock!</i>)<br>"
+//             "<b>Reboot</b> for reasons too numerous to mention<br>"
+//             "<b>The Free Jaguar Project</b> (you know why) ;-)<br>"
+//             "The guys over at <b>Atari Age</b> :-)<br>"
+//             "<b>byuu</b> for BSNES and showing us what was possible"
+       ));
+       text = new QLabel(s);
+       layout->addWidget(text);
+}
+
+void AboutWindow::keyPressEvent(QKeyEvent * e)
+{
+       if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return)
+               hide();
+}
diff --git a/src/about.h b/src/about.h
new file mode 100644 (file)
index 0000000..c0a802e
--- /dev/null
@@ -0,0 +1,27 @@
+//
+// about.h: Credits where credits are due ;-)
+//
+// by James Hammons
+// (C) 2012 Underground Software
+//
+
+#ifndef __ABOUT_H__
+#define __ABOUT_H__
+
+#include <QtGui>
+
+class AboutWindow: public QWidget
+{
+       public:
+               AboutWindow(QWidget * parent = 0);
+
+       protected:
+               void keyPressEvent(QKeyEvent *);
+
+       private:
+               QVBoxLayout * layout;
+               QLabel * text;
+               QLabel * image;
+};
+
+#endif // __ABOUT_H__
diff --git a/src/configdialog.cpp b/src/configdialog.cpp
new file mode 100644 (file)
index 0000000..b3c14ed
--- /dev/null
@@ -0,0 +1,41 @@
+//
+// settingsdialog.cpp: Dialog for changing Architektonas settings
+//
+// Part of the Architektonas Project
+// (C) 2011 Underground Software
+// See the README and GPLv3 files for licensing and warranty information
+//
+// JLH = James Hammons <jlhamm@acm.org>
+//
+// WHO  WHEN        WHAT
+// ---  ----------  ------------------------------------------------------------
+// JLH  06/04/2011  Created this file
+
+#include "configdialog.h"
+#include "generaltab.h"
+
+
+ConfigDialog::ConfigDialog(QWidget * parent/*= 0*/): QDialog(parent)
+{
+       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"));
+
+       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(tabWidget);
+       mainLayout->addWidget(buttonBox);
+       setLayout(mainLayout);
+
+       setWindowTitle(tr("SCheMatic Settings"));
+}
+
+ConfigDialog::~ConfigDialog()
+{
+}
diff --git a/src/configdialog.h b/src/configdialog.h
new file mode 100644 (file)
index 0000000..ddfdfda
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef __CONFIGDIALOG_H__
+#define __CONFIGDIALOG_H__
+
+#include <QtGui>
+
+class GeneralTab;
+
+class ConfigDialog: public QDialog
+{
+       Q_OBJECT
+
+       public:
+               ConfigDialog(QWidget * parent = 0);
+               ~ConfigDialog();
+
+       private:
+               QTabWidget * tabWidget;
+               QDialogButtonBox * buttonBox;
+
+       public:
+               GeneralTab * generalTab;
+};
+
+#endif // __CONFIGDIALOG_H__
diff --git a/src/generaltab.cpp b/src/generaltab.cpp
new file mode 100644 (file)
index 0000000..7b18549
--- /dev/null
@@ -0,0 +1,28 @@
+//
+// generaltab.cpp: "General" tab on the settings dialog
+//
+// Part of the Architektonas Project
+// (C) 2011 Underground Software
+// See the README and GPLv3 files for licensing and warranty information
+//
+// JLH = James Hammons <jlhamm@acm.org>
+//
+// WHO  WHEN        WHAT
+// ---  ----------  ------------------------------------------------------------
+// JLH  06/04/2011  Created this file
+
+#include "generaltab.h"
+
+
+GeneralTab::GeneralTab(QWidget * parent/*= 0*/): QWidget(parent)
+{
+       antialiasChk = new QCheckBox(tr("Use Qt's built-in antialiasing"));
+
+       QVBoxLayout * layout = new QVBoxLayout;
+       layout->addWidget(antialiasChk);
+       setLayout(layout);
+}
+
+GeneralTab::~GeneralTab()
+{
+}
diff --git a/src/generaltab.h b/src/generaltab.h
new file mode 100644 (file)
index 0000000..8dde60a
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef __GENERALTAB_H__
+#define __GENERALTAB_H__
+
+#include <QtGui>
+
+class GeneralTab: public QWidget
+{
+       Q_OBJECT
+
+       public:
+               GeneralTab(QWidget * parent = 0);
+               ~GeneralTab();
+
+       public:
+               QCheckBox * antialiasChk;
+};
+
+#endif // __GENERALTAB_H__
diff --git a/src/logindialog.cpp b/src/logindialog.cpp
new file mode 100644 (file)
index 0000000..fdd6ce6
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// logindialog.cpp: The login dialog
+//
+// Part of the SCheMatic Project
+// (C) 2012 Underground Software
+//
+// JLH = James Hammons <jlhamm@acm.org>
+//
+// WHO  WHEN        WHAT
+// ---  ----------  ------------------------------------------------------------
+// JLH  06/04/2011  Created this file
+
+#include "logindialog.h"
+
+
+LoginDialog::LoginDialog(QWidget * parent/*= 0*/): QDialog(parent),
+//     label1(new QLabel(tr("Username:"))),
+//     label2(new QLabel(tr("Password:"))),
+       buttonBox(new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel)),
+       edit1(new QLineEdit()),
+       edit2(new QLineEdit())
+{
+       connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+       connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+
+       edit2->setEchoMode(QLineEdit::Password);
+
+       QFormLayout * formLayout = new QFormLayout;
+       formLayout->addRow(tr("&Username:"), edit1);
+       formLayout->addRow(tr("&Password:"), edit2);
+
+       QVBoxLayout * mainLayout = new QVBoxLayout;
+//     mainLayout->addWidget(tabWidget);
+       mainLayout->addLayout(formLayout);
+       mainLayout->addWidget(buttonBox);
+       setLayout(mainLayout);
+
+       setWindowTitle(tr("Please Log On to SCheMatic"));
+}
+
+LoginDialog::~LoginDialog()
+{
+}
diff --git a/src/logindialog.h b/src/logindialog.h
new file mode 100644 (file)
index 0000000..d583c63
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef __LOGINDIALOG_H__
+#define __LOGINDIALOG_H__
+
+#include <QtGui>
+
+class LoginDialog: public QDialog
+{
+       Q_OBJECT
+
+       public:
+               LoginDialog(QWidget * parent = 0);
+               ~LoginDialog();
+
+       private:
+//             QLabel * label1;
+//             QLabel * label2;
+               QLabel * title;
+               QDialogButtonBox * buttonBox;
+
+       public:
+               QLineEdit * edit1;
+               QLineEdit * edit2;
+};
+
+#endif // __LOGINDIALOG_H__
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644 (file)
index 0000000..9dc9195
--- /dev/null
@@ -0,0 +1,38 @@
+//
+// main.cpp - The Supply Chain Manager-O-Matic
+// by James Hammons
+// (C) 2012 Underground Software
+//
+// JLH = James Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -------------------------------------------------------------
+// JLH  09/14/2012  Created this file
+//
+
+#include "main.h"
+#include <QApplication>
+#include "mainwin.h"
+
+// Main app constructor--we stick globally accessible stuff here...
+
+MainApp::MainApp(int & argc, char * argv[]): QApplication(argc, argv)
+{
+       mainWindow = new MainWindow;
+       mainWindow->show();
+}
+
+
+// Here's the main application loop--short and simple...
+int main(int argc, char * argv[])
+{
+       Q_INIT_RESOURCE(schematic);             // This must the same name as the exe filename
+
+       MainApp app(argc, argv);
+
+       // User either couldn't log on, or cancelled out
+       if (app.mainWindow->loggedInUID == 0)
+               return 0;
+
+       return app.exec();
+}
diff --git a/src/main.h b/src/main.h
new file mode 100644 (file)
index 0000000..62647ac
--- /dev/null
@@ -0,0 +1,25 @@
+//
+// main.h: Header file
+//
+// by James L. Hammons
+// (C) 2012 Underground Software
+//
+
+#ifndef __MAIN_H__
+#define __MAIN_H__
+
+#include <QtGui>
+
+// Forward declarations
+class MainWindow;
+
+class MainApp: public QApplication
+{
+       public:
+               MainApp(int & argc, char * argv[]);
+
+       public:
+               MainWindow * mainWindow;
+};
+
+#endif // __MAIN_H__
diff --git a/src/mainwin.cpp b/src/mainwin.cpp
new file mode 100644 (file)
index 0000000..b7e1748
--- /dev/null
@@ -0,0 +1,168 @@
+//
+// mainwin.cpp - The Supply Chain Manager-O-Matic
+// by James Hammons
+// (C) 2012 Underground Software
+//
+// JLH = James Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -------------------------------------------------------------
+// JLH  09/14/2012  Created this file
+//
+
+// Uncomment this for debugging...
+//#define DEBUG
+//#define DEBUGFOO                             // Various tool debugging...
+//#define DEBUGTP                              // Toolpalette debugging...
+
+#include "mainwin.h"
+#include <QtSql>
+//#include "main.h"
+#include "about.h"
+#include "logindialog.h"
+
+
+MainWindow::MainWindow(): aboutWin(new AboutWindow(this)),
+       loggedInUID(0)
+{
+       setWindowIcon(QIcon(":/res/schematic.png"));
+       setWindowTitle("SCheMatic");
+
+       setUnifiedTitleAndToolBarOnMac(true);
+
+       // Create actions
+
+       quitAppAct = new QAction(tr("E&xit"), this);
+       quitAppAct->setShortcut(QKeySequence(tr("Ctrl+q")));
+       quitAppAct->setStatusTip(tr("Quit SCheMatic"));
+       connect(quitAppAct, SIGNAL(triggered()), this, SLOT(close()));
+
+       aboutAct = new QAction(QIcon(":/res/schematic.png"), tr("&About..."), this);
+       aboutAct->setStatusTip(tr("Blatant self-promotion"));
+       connect(aboutAct, SIGNAL(triggered()), this, SLOT(ShowAboutWin()));
+
+//     helpAct = new QAction(QIcon(":/res/vj-icon.png"), tr("&Contents..."), this);
+//     helpAct->setStatusTip(tr("Help is available, if you should need it"));
+//     connect(helpAct, SIGNAL(triggered()), this, SLOT(ShowHelpWin()));
+
+       // Create menus & toolbars
+
+       QMenu * menu = menuBar()->addMenu(tr("&File"));
+//     fileMenu->addAction(powerAct);
+//     fileMenu->addAction(pauseAct);
+//     fileMenu->addAction(frameAdvanceAct);
+//     fileMenu->addAction(filePickAct);
+//     fileMenu->addAction(useCDAct);
+//     fileMenu->addAction(configAct);
+       menu->addAction(quitAppAct);
+
+       menu = menuBar()->addMenu(tr("&Help"));
+//     menu->addAction(helpAct);
+       menu->addAction(aboutAct);
+
+       QToolBar * toolbar = addToolBar(tr("Stuff"));
+//     toolbar->addAction(powerAct);
+//     toolbar->addAction(pauseAct);
+//     toolbar->addAction(filePickAct);
+//     toolbar->addAction(useCDAct);
+//     toolbar->addSeparator();
+//     toolbar->addAction(x1Act);
+//     toolbar->addAction(x2Act);
+//     toolbar->addAction(x3Act);
+//     toolbar->addSeparator();
+//     toolbar->addAction(ntscAct);
+//     toolbar->addAction(palAct);
+//     toolbar->addSeparator();
+//     toolbar->addAction(blurAct);
+//     toolbar->addAction(fullScreenAct);
+
+       //      Create status bar
+       statusBar()->showMessage(tr("Ready"));
+
+       ReadSettings();
+
+       // Finally, set up database connection
+
+       QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
+       db.setHostName("localhost");
+       db.setDatabaseName("schematic");
+       db.setUserName("scm_user");
+       db.setPassword("scm_user");
+       bool ok = db.open();
+
+#warning "!!! NEED TO SET UP DB SETUP DIALOG IF CONNECTION FAILED !!!"
+
+
+//     printf("Database connection was %sopened successfully.\n", (ok ? "" : "NOT "));
+
+       // Do Login dialog
+       LoginDialog login;
+       bool done = false;
+
+       do
+       {
+               bool accept = login.exec();
+
+               // Check to see if user cancelled out
+               if (!accept)
+                       done = true;
+               else
+               {
+                       // Search DB for this username/login pair
+                       QSqlQuery query("SELECT UID FROM User WHERE Login=? AND Password=?");
+                       query.addBindValue(login.edit1->text());
+                       query.addBindValue(login.edit2->text());
+                       query.exec();
+
+                       while (query.next())
+                       {
+                               // We have a winner!
+                               loggedInUID = query.value(0).toInt();
+                               done = true;
+                       }
+               }
+       }
+       while (!done);
+}
+
+
+void MainWindow::closeEvent(QCloseEvent * event)
+{
+       WriteSettings();
+       event->accept(); // ignore() if can't close for some reason
+}
+
+
+void MainWindow::Open(void)
+{
+}
+
+
+void MainWindow::ShowAboutWin(void)
+{
+       aboutWin->show();
+}
+
+
+void MainWindow::ReadSettings(void)
+{
+       QSettings settings("Underground Software", "SCheMatic");
+       QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
+       QSize size = settings.value("size", QSize(400, 400)).toSize();
+       resize(size);
+       move(pos);
+//     pos = settings.value("charWndPos", QPoint(0, 0)).toPoint();
+//     size = settings.value("charWndSize", QSize(200, 200)).toSize();
+//     ((TTEdit *)qApp)->charWnd->resize(size);
+//     ((TTEdit *)qApp)->charWnd->move(pos);
+}
+
+
+void MainWindow::WriteSettings(void)
+{
+       QSettings settings("Underground Software", "SCheMatic");
+       settings.setValue("pos", pos());
+       settings.setValue("size", size());
+//     settings.setValue("charWndPos", ((TTEdit *)qApp)->charWnd->pos());
+//     settings.setValue("charWndSize", ((TTEdit *)qApp)->charWnd->size());
+}
diff --git a/src/mainwin.h b/src/mainwin.h
new file mode 100644 (file)
index 0000000..0f4cb24
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// mainwin.h: Header file
+//
+// by James Hammons
+// (C) 2012 Underground Software
+//
+
+#ifndef __MAINWINDOW_H__
+#define __MAINWINDOW_H__
+
+#include <QtGui>
+
+class AboutWindow;
+
+class MainWindow: public QMainWindow
+{
+       // All Qt apps require this macro
+       Q_OBJECT
+
+       public:
+               MainWindow();
+
+       protected:
+               void closeEvent(QCloseEvent * event);
+
+       private slots:
+               void Open();
+               void ShowAboutWin(void);
+
+       private:
+               void ReadSettings(void);
+               void WriteSettings(void);
+
+               AboutWindow * aboutWin;
+
+               QAction * quitAppAct;
+               QAction * aboutAct;
+
+       public:
+               int loggedInUID;
+};
+
+#endif // __MAINWINDOW_H__