From 27488ed2c3f68edac669951fce0c4e60492628ca Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Sun, 29 Dec 2013 23:25:21 +0100 Subject: [PATCH] Work on adding categories. --- src/gui/formcategorydetails.cpp | 17 ++++++------ src/gui/formcategorydetails.ui | 46 +++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/src/gui/formcategorydetails.cpp b/src/gui/formcategorydetails.cpp index c41d9b7e3..25fec2977 100644 --- a/src/gui/formcategorydetails.cpp +++ b/src/gui/formcategorydetails.cpp @@ -7,7 +7,9 @@ #include "gui/iconthemefactory.h" #include "gui/feedsview.h" -#include +#include +#include +#include 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; diff --git a/src/gui/formcategorydetails.ui b/src/gui/formcategorydetails.ui index cb4fbe73a..24d3075d0 100644 --- a/src/gui/formcategorydetails.ui +++ b/src/gui/formcategorydetails.ui @@ -6,10 +6,16 @@ 0 0 - 362 - 183 + 346 + 199 + + + 300 + 180 + + Dialog @@ -21,48 +27,50 @@ Parent category + + m_cmbParentCategory + - + Title + + m_txtTitle + - + Title of the category - + Description - - - - Description of the category - - - - + Icon + + m_btnIcon + - + 40 @@ -74,6 +82,16 @@ + + + + + 0 + 0 + + + +