Work on adding categories.
This commit is contained in:
parent
fd18cfd904
commit
27488ed2c3
2 changed files with 41 additions and 22 deletions
|
@ -7,7 +7,9 @@
|
||||||
#include "gui/iconthemefactory.h"
|
#include "gui/iconthemefactory.h"
|
||||||
#include "gui/feedsview.h"
|
#include "gui/feedsview.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QLineEdit>
|
||||||
|
#include <QTextEdit>
|
||||||
|
#include <QToolButton>
|
||||||
|
|
||||||
|
|
||||||
FormCategoryDetails::FormCategoryDetails(FeedsModel *model, QWidget *parent)
|
FormCategoryDetails::FormCategoryDetails(FeedsModel *model, QWidget *parent)
|
||||||
|
@ -26,18 +28,16 @@ FormCategoryDetails::~FormCategoryDetails() {
|
||||||
void FormCategoryDetails::setEditableCategory(FeedsModelCategory *editable_category) {
|
void FormCategoryDetails::setEditableCategory(FeedsModelCategory *editable_category) {
|
||||||
m_editableCategory = editable_category;
|
m_editableCategory = editable_category;
|
||||||
|
|
||||||
if (m_editableCategory != NULL) {
|
// TODO: Setup the dialog according to new category.
|
||||||
// TODO: Setup the dialog according to new category.
|
// so remove this category from category combobox!!
|
||||||
// so remove this category from category combobox!!
|
m_ui->m_txtTitle->setText(editable_category->title());
|
||||||
}
|
m_ui->m_txtDescription->setText(editable_category->description());
|
||||||
|
m_ui->m_btnIcon->setIcon(editable_category->icon());
|
||||||
}
|
}
|
||||||
|
|
||||||
int FormCategoryDetails::exec(FeedsModelCategory *input_category,
|
int FormCategoryDetails::exec(FeedsModelCategory *input_category,
|
||||||
FeedsModelCategory *output_item,
|
FeedsModelCategory *output_item,
|
||||||
FeedsModelRootItem *parent_item) {
|
FeedsModelRootItem *parent_item) {
|
||||||
// TODO: Implement this.
|
|
||||||
setEditableCategory(input_category);
|
|
||||||
|
|
||||||
int result = QDialog::exec();
|
int result = QDialog::exec();
|
||||||
|
|
||||||
if (input_category == NULL) {
|
if (input_category == NULL) {
|
||||||
|
@ -45,6 +45,7 @@ int FormCategoryDetails::exec(FeedsModelCategory *input_category,
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// User is editing existing category.
|
// User is editing existing category.
|
||||||
|
setEditableCategory(input_category);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -6,10 +6,16 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>362</width>
|
<width>346</width>
|
||||||
<height>183</height>
|
<height>199</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>300</width>
|
||||||
|
<height>180</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Dialog</string>
|
<string>Dialog</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -21,48 +27,50 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Parent category</string>
|
<string>Parent category</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>m_cmbParentCategory</cstring>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QComboBox" name="m_cmbParentCategory"/>
|
<widget class="QComboBox" name="m_cmbParentCategory"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="m_lblParentCategory_2">
|
<widget class="QLabel" name="m_lblTitle">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Title</string>
|
<string>Title</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>m_txtTitle</cstring>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLineEdit" name="lineEdit">
|
<widget class="QLineEdit" name="m_txtTitle">
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string>Title of the category</string>
|
<string>Title of the category</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="m_lblParentCategory_3">
|
<widget class="QLabel" name="m_lblDescription">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Description</string>
|
<string>Description</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLineEdit" name="lineEdit_2">
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string>Description of the category</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="m_lblParentCategory_4">
|
<widget class="QLabel" name="m_lblIcon">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Icon</string>
|
<string>Icon</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>m_btnIcon</cstring>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QToolButton" name="toolButton">
|
<widget class="QToolButton" name="m_btnIcon">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>40</width>
|
||||||
|
@ -74,6 +82,16 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QTextEdit" name="m_txtDescription">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
Loading…
Add table
Reference in a new issue