summaryrefslogtreecommitdiff
path: root/add_entry_form.py
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2023-09-16 09:36:14 -0400
committerLouie S <louie@example.com>2023-09-16 09:36:14 -0400
commit5648157daee278795ccdd766f0b27f59a7331286 (patch)
tree6ecd85df7a5c0befac4d7fc1f369ba31fd2e6582 /add_entry_form.py
First commit
Diffstat (limited to 'add_entry_form.py')
-rw-r--r--add_entry_form.py62
1 files changed, 62 insertions, 0 deletions
diff --git a/add_entry_form.py b/add_entry_form.py
new file mode 100644
index 0000000..6449076
--- /dev/null
+++ b/add_entry_form.py
@@ -0,0 +1,62 @@
+#!/usr/bin/python3
+import sys
+from PyQt5.QtWidgets import QApplication, QDateTimeEdit, QFormLayout, QHBoxLayout, QLabel, QLineEdit, QPushButton, QWidget
+from PyQt5.QtGui import QFont
+from PyQt5.QtCore import QDate, Qt
+
+class addEntryForm(QWidget):
+ def __init__(self):
+ super().__init__()
+ self.initializeUI()
+
+ def initializeUI(self):
+ self.resize(400, 1)
+ self.setWindowTitle("Add Entry")
+ self.displayWidgets()
+ self.show()
+
+ def displayWidgets(self):
+ entry_form_layout = QFormLayout()
+
+ title = QLabel("Add Entry")
+ title.setFont(QFont("Arial", 18))
+ title.setAlignment(Qt.AlignCenter)
+ entry_form_layout.addRow(title)
+
+ new_entry_desc = QLineEdit()
+ entry_form_layout.addRow("Description:", new_entry_desc)
+
+ new_entry_due = QDateTimeEdit(QDate.currentDate())
+ new_entry_due.setDisplayFormat("MM/dd/yyyy")
+ entry_form_layout.addRow("Due Date:", new_entry_due)
+
+ new_entry_due_alt = QLineEdit()
+ entry_form_layout.addRow("Due Date (Alt):", new_entry_due_alt)
+
+ new_entry_link = QLineEdit() # TODO see if there is a widget specifically for URLs
+ entry_form_layout.addRow("Link:", new_entry_link)
+
+ # TODO:
+ # color
+ # highlight
+ # depends
+
+ # Submit and cancel buttons
+ buttons_h_box = QHBoxLayout()
+ buttons_h_box.addStretch()
+ close_button = QPushButton("Cancel")
+ close_button.clicked.connect(self.close)
+ buttons_h_box.addWidget(close_button)
+ submit_button = QPushButton("Submit")
+ submit_button.clicked.connect(self.close) # TODO connect this to a real method
+ buttons_h_box.addWidget(submit_button)
+ buttons_h_box.addStretch()
+
+ entry_form_layout.addRow(buttons_h_box)
+
+ self.setLayout(entry_form_layout)
+
+if __name__ == "__main__":
+ app = QApplication(sys.argv)
+ window = addEntryForm()
+ sys.exit(app.exec_())