Work on adding categories.

This commit is contained in:
Martin Rotter 2013-12-29 23:25:21 +01:00
parent fd18cfd904
commit 27488ed2c3
2 changed files with 41 additions and 22 deletions

View File

@ -7,7 +7,9 @@
#include "gui/iconthemefactory.h"
#include "gui/feedsview.h"
#include <QPushButton>
#include <QLineEdit>
#include <QTextEdit>
#include <QToolButton>
FormCategoryDetails::FormCategoryDetails(FeedsModel *model, QWidget *parent)
@ -26,18 +28,16 @@ FormCategoryDetails::~FormCategoryDetails() {
void FormCategoryDetails::setEditableCategory(FeedsModelCategory *editable_category) {
m_editableCategory = editable_category;
if (m_editableCategory != NULL) {
// TODO: Setup the dialog according to new category.
// so remove this category from category combobox!!
}
// TODO: Setup the dialog according to new category.
// 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,
FeedsModelCategory *output_item,
FeedsModelRootItem *parent_item) {
// TODO: Implement this.
setEditableCategory(input_category);
int result = QDialog::exec();
if (input_category == NULL) {
@ -45,6 +45,7 @@ int FormCategoryDetails::exec(FeedsModelCategory *input_category,
}
else {
// User is editing existing category.
setEditableCategory(input_category);
}
return result;

View File

@ -6,10 +6,16 @@
<rect>
<x>0</x>
<y>0</y>
<width>362</width>
<height>183</height>
<width>346</width>
<height>199</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>180</height>
</size>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
@ -21,48 +27,50 @@
<property name="text">
<string>Parent category</string>
</property>
<property name="buddy">
<cstring>m_cmbParentCategory</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="m_cmbParentCategory"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="m_lblParentCategory_2">
<widget class="QLabel" name="m_lblTitle">
<property name="text">
<string>Title</string>
</property>
<property name="buddy">
<cstring>m_txtTitle</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit">
<widget class="QLineEdit" name="m_txtTitle">
<property name="placeholderText">
<string>Title of the category</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="m_lblParentCategory_3">
<widget class="QLabel" name="m_lblDescription">
<property name="text">
<string>Description</string>
</property>
</widget>
</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">
<widget class="QLabel" name="m_lblParentCategory_4">
<widget class="QLabel" name="m_lblIcon">
<property name="text">
<string>Icon</string>
</property>
<property name="buddy">
<cstring>m_btnIcon</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QToolButton" name="toolButton">
<widget class="QToolButton" name="m_btnIcon">
<property name="minimumSize">
<size>
<width>40</width>
@ -74,6 +82,16 @@
</property>
</widget>
</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>
</item>
<item>