summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--src/add_entry_form.cpp20
-rw-r--r--src/add_entry_form.h4
-rw-r--r--src/add_group_form.cpp10
-rw-r--r--src/add_group_form.h6
-rw-r--r--src/entry_form.ui (renamed from src/add_entry_form.ui)24
-rw-r--r--src/group_form.ui (renamed from src/add_group_form.ui)18
7 files changed, 48 insertions, 38 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cfb8660..a8fd55c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,10 +34,8 @@ endforeach()
set(project_sources
"src/add_entry_form.cpp"
"src/add_entry_form.h"
- "src/add_entry_form.ui"
"src/add_group_form.cpp"
"src/add_group_form.h"
- "src/add_group_form.ui"
"src/backend/db_sqlite.cpp"
"src/backend/db_sqlite.h"
"src/assignmentList.cpp"
@@ -45,8 +43,10 @@ set(project_sources
"src/assignmentList.ui"
"src/entry.cpp"
"src/entry.h"
+ "src/entry_form.ui"
"src/group.cpp"
"src/group.h"
+ "src/group_form.ui"
"src/lib.cpp"
"src/lib.h"
"src/main.cpp"
diff --git a/src/add_entry_form.cpp b/src/add_entry_form.cpp
index b08fedc..25a8af2 100644
--- a/src/add_entry_form.cpp
+++ b/src/add_entry_form.cpp
@@ -11,17 +11,21 @@ AddEntryForm::AddEntryForm(int parent_id) :
// load uic
ui.setupUi(this);
+ // set titles
+ this->setWindowTitle("Add Entry");
+ ui.title->setText("Add Entry");
+
// widgets setup
- ui.new_entry_due->setDate(QDate::currentDate());
+ ui.entry_due->setDate(QDate::currentDate());
}
void AddEntryForm::accept() {
- QString desc_text = ui.new_entry_desc->text();
- QDateTime due_text = ui.new_entry_due->date().startOfDay();
- QString due_alt_text = ui.new_entry_due_alt->text();
- QString link_text = ui.new_entry_link->text();
- QString color_text = ui.new_entry_color->text();
- QString highlight_text = ui.new_entry_highlight->text();
+ QString desc_text = ui.entry_desc->text();
+ QDateTime due_text = ui.entry_due->date().startOfDay();
+ QString due_alt_text = ui.entry_due_alt->text();
+ QString link_text = ui.entry_link->text();
+ QString color_text = ui.entry_color->text();
+ QString highlight_text = ui.entry_highlight->text();
QMessageBox error_message;
BackendDB database;
int new_id;
@@ -36,7 +40,7 @@ void AddEntryForm::accept() {
}
// replace due_text with null date if due_checkbox is unchecked
- if(!ui.new_entry_due_checkbox->isChecked())
+ if(!ui.entry_due_checkbox->isChecked())
due_text = QDateTime();
new_id = database.insertEntry(Entry(0, this->parent_id, desc_text, due_text, due_alt_text, link_text, color_text, highlight_text));
diff --git a/src/add_entry_form.h b/src/add_entry_form.h
index 863dc57..7cf1ad1 100644
--- a/src/add_entry_form.h
+++ b/src/add_entry_form.h
@@ -3,7 +3,7 @@
#include <QObject>
-#include "ui_add_entry_form.h"
+#include "ui_entry_form.h"
class AddEntryForm : public QDialog {
Q_OBJECT
@@ -12,7 +12,7 @@ class AddEntryForm : public QDialog {
AddEntryForm(int parent_id);
private:
- Ui::addEntryDialog ui;
+ Ui::entryDialog ui;
int parent_id;
diff --git a/src/add_group_form.cpp b/src/add_group_form.cpp
index 4a84934..98cdb63 100644
--- a/src/add_group_form.cpp
+++ b/src/add_group_form.cpp
@@ -8,12 +8,16 @@
AddGroupForm::AddGroupForm() {
// load uic
ui.setupUi(this);
+
+ // set titles
+ this->setWindowTitle("Add Group");
+ ui.title->setText("Add Group");
}
void AddGroupForm::accept() {
- QString name_text = ui.new_group_name->text();
- QString column_text = ui.new_group_column->currentText();
- QString link_text = ui.new_group_link->text();
+ QString name_text = ui.group_name->text();
+ QString column_text = ui.group_column->currentText();
+ QString link_text = ui.group_link->text();
QMessageBox error_message;
BackendDB database;
int new_id;
diff --git a/src/add_group_form.h b/src/add_group_form.h
index 3b9c381..2e602b8 100644
--- a/src/add_group_form.h
+++ b/src/add_group_form.h
@@ -1,7 +1,9 @@
#ifndef ADDGROUPFORM_H
#define ADDGROUPFORM_H
-#include "ui_add_group_form.h"
+#include <QObject>
+
+#include "ui_group_form.h"
class AddGroupForm : public QDialog {
Q_OBJECT
@@ -10,7 +12,7 @@ class AddGroupForm : public QDialog {
AddGroupForm();
private:
- Ui::addGroupDialog ui;
+ Ui::groupDialog ui;
private slots:
void accept();
diff --git a/src/add_entry_form.ui b/src/entry_form.ui
index 7a33856..bce8ce3 100644
--- a/src/add_entry_form.ui
+++ b/src/entry_form.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>addEntryDialog</class>
- <widget class="QDialog" name="addEntryDialog">
+ <class>entryDialog</class>
+ <widget class="QDialog" name="entryDialog">
<property name="geometry">
<rect>
<x>0</x>
@@ -24,7 +24,7 @@
</widget>
</item>
<item row="1" column="1">
- <widget class="QLineEdit" name="new_entry_desc"/>
+ <widget class="QLineEdit" name="entry_desc"/>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="title">
@@ -35,7 +35,7 @@
</font>
</property>
<property name="text">
- <string>Add Entry</string>
+ <string>[TITLE]</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -65,14 +65,14 @@
<number>0</number>
</property>
<item>
- <widget class="QDateTimeEdit" name="new_entry_due">
+ <widget class="QDateTimeEdit" name="entry_due">
<property name="displayFormat">
<string>MM/dd/yyyy</string>
</property>
</widget>
</item>
<item>
- <widget class="QCheckBox" name="new_entry_due_checkbox">
+ <widget class="QCheckBox" name="entry_due_checkbox">
<property name="enabled">
<bool>true</bool>
</property>
@@ -95,7 +95,7 @@
</widget>
</item>
<item row="3" column="1">
- <widget class="QLineEdit" name="new_entry_due_alt"/>
+ <widget class="QLineEdit" name="entry_due_alt"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="linkLabel">
@@ -105,7 +105,7 @@
</widget>
</item>
<item row="4" column="1">
- <widget class="QLineEdit" name="new_entry_link"/>
+ <widget class="QLineEdit" name="entry_link"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="colorLabel">
@@ -115,7 +115,7 @@
</widget>
</item>
<item row="5" column="1">
- <widget class="QLineEdit" name="new_entry_color"/>
+ <widget class="QLineEdit" name="entry_color"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="highlightLabel">
@@ -125,7 +125,7 @@
</widget>
</item>
<item row="6" column="1">
- <widget class="QLineEdit" name="new_entry_highlight"/>
+ <widget class="QLineEdit" name="entry_highlight"/>
</item>
</layout>
</item>
@@ -152,7 +152,7 @@
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
- <receiver>addEntryDialog</receiver>
+ <receiver>entryDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
@@ -168,7 +168,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
- <receiver>addEntryDialog</receiver>
+ <receiver>entryDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
diff --git a/src/add_group_form.ui b/src/group_form.ui
index 53b854b..4f58e1d 100644
--- a/src/add_group_form.ui
+++ b/src/group_form.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>addGroupDialog</class>
- <widget class="QDialog" name="addGroupDialog">
+ <class>groupDialog</class>
+ <widget class="QDialog" name="groupDialog">
<property name="geometry">
<rect>
<x>0</x>
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
- <string>Add Entry</string>
+ <string>Group Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
@@ -25,7 +25,7 @@
</font>
</property>
<property name="text">
- <string>Add Group</string>
+ <string>[TITLE]</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -40,7 +40,7 @@
</widget>
</item>
<item row="1" column="1">
- <widget class="QLineEdit" name="new_group_name"/>
+ <widget class="QLineEdit" name="group_name"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="dueDateLabel">
@@ -50,7 +50,7 @@
</widget>
</item>
<item row="2" column="1">
- <widget class="QComboBox" name="new_group_column">
+ <widget class="QComboBox" name="group_column">
<item>
<property name="text">
<string>Left</string>
@@ -71,7 +71,7 @@
</widget>
</item>
<item row="3" column="1">
- <widget class="QLineEdit" name="new_group_link"/>
+ <widget class="QLineEdit" name="group_link"/>
</item>
</layout>
</item>
@@ -98,7 +98,7 @@
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
- <receiver>addGroupDialog</receiver>
+ <receiver>groupDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
@@ -114,7 +114,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
- <receiver>addGroupDialog</receiver>
+ <receiver>groupDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">