:)
This commit is contained in:
parent
95a961c151
commit
c0c623ead5
@ -246,7 +246,7 @@ void FeedsView::addNewCategory() {
|
|||||||
|
|
||||||
QPointer<FormCategoryDetails> form_pointer = new FormCategoryDetails(m_sourceModel, this);
|
QPointer<FormCategoryDetails> form_pointer = new FormCategoryDetails(m_sourceModel, this);
|
||||||
|
|
||||||
form_pointer.data()->exec(NULL);
|
form_pointer.data()->exec(NULL, NULL);
|
||||||
|
|
||||||
delete form_pointer.data();
|
delete form_pointer.data();
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ void FeedsView::addNewCategory() {
|
|||||||
void FeedsView::editCategory(FeedsModelCategory *category) {
|
void FeedsView::editCategory(FeedsModelCategory *category) {
|
||||||
QPointer<FormCategoryDetails> form_pointer = new FormCategoryDetails(m_sourceModel, this);
|
QPointer<FormCategoryDetails> form_pointer = new FormCategoryDetails(m_sourceModel, this);
|
||||||
|
|
||||||
form_pointer.data()->exec(category);
|
form_pointer.data()->exec(category, NULL);
|
||||||
|
|
||||||
delete form_pointer.data();
|
delete form_pointer.data();
|
||||||
}
|
}
|
||||||
@ -549,12 +549,17 @@ void FeedsView::initializeContextMenuCategoriesFeeds() {
|
|||||||
qApp->mainForm()->m_ui->m_actionMarkSelectedFeedsAsRead <<
|
qApp->mainForm()->m_ui->m_actionMarkSelectedFeedsAsRead <<
|
||||||
qApp->mainForm()->m_ui->m_actionMarkSelectedFeedsAsUnread <<
|
qApp->mainForm()->m_ui->m_actionMarkSelectedFeedsAsUnread <<
|
||||||
qApp->mainForm()->m_ui->m_actionDeleteSelectedFeedCategory);
|
qApp->mainForm()->m_ui->m_actionDeleteSelectedFeedCategory);
|
||||||
|
m_contextMenuCategoriesFeeds->addSeparator();
|
||||||
|
m_contextMenuCategoriesFeeds->addActions(QList<QAction*>() <<
|
||||||
|
qApp->mainForm()->m_ui->m_actionAddCategory <<
|
||||||
|
qApp->mainForm()->m_ui->m_actionAddFeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsView::initializeContextMenuEmptySpace() {
|
void FeedsView::initializeContextMenuEmptySpace() {
|
||||||
m_contextMenuEmptySpace = new QMenu(tr("Context menu for empty space"), this);
|
m_contextMenuEmptySpace = new QMenu(tr("Context menu for empty space"), this);
|
||||||
|
m_contextMenuEmptySpace->addAction(qApp->mainForm()->m_ui->m_actionUpdateAllFeeds);
|
||||||
|
m_contextMenuEmptySpace->addSeparator();
|
||||||
m_contextMenuEmptySpace->addActions(QList<QAction*>() <<
|
m_contextMenuEmptySpace->addActions(QList<QAction*>() <<
|
||||||
qApp->mainForm()->m_ui->m_actionUpdateAllFeeds <<
|
|
||||||
qApp->mainForm()->m_ui->m_actionAddCategory <<
|
qApp->mainForm()->m_ui->m_actionAddCategory <<
|
||||||
qApp->mainForm()->m_ui->m_actionAddFeed);
|
qApp->mainForm()->m_ui->m_actionAddFeed);
|
||||||
}
|
}
|
||||||
|
@ -57,12 +57,9 @@ FormCategoryDetails::~FormCategoryDetails() {
|
|||||||
|
|
||||||
void FormCategoryDetails::createConnections() {
|
void FormCategoryDetails::createConnections() {
|
||||||
// General connections.
|
// General connections.
|
||||||
connect(m_ui->m_buttonBox, SIGNAL(accepted()),
|
connect(m_ui->m_buttonBox, SIGNAL(accepted()), this, SLOT(apply()));
|
||||||
this, SLOT(apply()));
|
connect(m_ui->m_txtTitle->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onTitleChanged(QString)));
|
||||||
connect(m_ui->m_txtTitle->lineEdit(), SIGNAL(textChanged(QString)),
|
connect(m_ui->m_txtDescription->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(onDescriptionChanged(QString)));
|
||||||
this, SLOT(onTitleChanged(QString)));
|
|
||||||
connect(m_ui->m_txtDescription->lineEdit(), SIGNAL(textChanged(QString)),
|
|
||||||
this, SLOT(onDescriptionChanged(QString)));
|
|
||||||
|
|
||||||
// Icon connections.
|
// Icon connections.
|
||||||
connect(m_actionLoadIconFromFile, SIGNAL(triggered()), this, SLOT(onLoadIconFromFile()));
|
connect(m_actionLoadIconFromFile, SIGNAL(triggered()), this, SLOT(onLoadIconFromFile()));
|
||||||
@ -79,11 +76,14 @@ void FormCategoryDetails::setEditableCategory(FeedsModelCategory *editable_categ
|
|||||||
m_ui->m_btnIcon->setIcon(editable_category->icon());
|
m_ui->m_btnIcon->setIcon(editable_category->icon());
|
||||||
}
|
}
|
||||||
|
|
||||||
int FormCategoryDetails::exec(FeedsModelCategory *input_category) {
|
int FormCategoryDetails::exec(FeedsModelCategory *input_category, FeedsModelRootItem *parent_to_select) {
|
||||||
|
// TODO: řeseni bugu #92. pridal sem parametr parent_to_select
|
||||||
|
// kde volajici preda pointer na doporuceny nadrazeny prvek,
|
||||||
|
// nebo null pokud nic nedoporucuje.
|
||||||
|
// vybereme
|
||||||
|
|
||||||
// Load categories.
|
// Load categories.
|
||||||
loadCategories(m_feedsModel->allCategories().values(),
|
loadCategories(m_feedsModel->allCategories().values(), m_feedsModel->rootItem(), input_category);
|
||||||
m_feedsModel->rootItem(),
|
|
||||||
input_category);
|
|
||||||
|
|
||||||
if (input_category == NULL) {
|
if (input_category == NULL) {
|
||||||
// User is adding new category.
|
// User is adding new category.
|
||||||
|
@ -44,7 +44,7 @@ class FormCategoryDetails : public QDialog {
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// Executes add/edit standard category dialog.
|
// Executes add/edit standard category dialog.
|
||||||
int exec(FeedsModelCategory *input_category);
|
int exec(FeedsModelCategory *input_category, FeedsModelRootItem *parent_to_select);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
// Applies changes.
|
// Applies changes.
|
||||||
@ -72,9 +72,7 @@ class FormCategoryDetails : public QDialog {
|
|||||||
// Loads categories into the dialog + give root "category"
|
// Loads categories into the dialog + give root "category"
|
||||||
// and make sure that no childs of input category (including)
|
// and make sure that no childs of input category (including)
|
||||||
// input category are loaded.
|
// input category are loaded.
|
||||||
void loadCategories(const QList<FeedsModelCategory*> categories,
|
void loadCategories(const QList<FeedsModelCategory*> categories, FeedsModelRootItem *root_item, FeedsModelCategory *input_category);
|
||||||
FeedsModelRootItem *root_item,
|
|
||||||
FeedsModelCategory *input_category);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::FormCategoryDetails *m_ui;
|
Ui::FormCategoryDetails *m_ui;
|
||||||
|
@ -28,7 +28,7 @@ FormRestoreDatabaseSettings::FormRestoreDatabaseSettings(QWidget *parent)
|
|||||||
: QDialog(parent), m_ui(new Ui::FormRestoreDatabaseSettings) {
|
: QDialog(parent), m_ui(new Ui::FormRestoreDatabaseSettings) {
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
m_btnRestart = m_ui->m_buttonBox->addButton(tr("Restart"), QDialogButtonBox::ApplyRole);
|
m_btnRestart = m_ui->m_buttonBox->addButton(tr("Restart"), QDialogButtonBox::ActionRole);
|
||||||
m_ui->m_lblResult->setStatus(WidgetWithStatus::Warning, tr("No operation executed yet."), tr("No operation executed yet."));
|
m_ui->m_lblResult->setStatus(WidgetWithStatus::Warning, tr("No operation executed yet."), tr("No operation executed yet."));
|
||||||
|
|
||||||
setWindowIcon(qApp->icons()->fromTheme("document-import"));
|
setWindowIcon(qApp->icons()->fromTheme("document-import"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user