Hide history row when viewing history items.

This commit is contained in:
Felix Geyer 2012-07-02 00:15:31 +02:00
parent 61984a5748
commit d0fd9af5e6
3 changed files with 9 additions and 2 deletions

View File

@ -46,6 +46,11 @@ void EditWidget::add(const QString& labelText, QWidget* widget)
m_ui->stackedWidget->addWidget(widget); m_ui->stackedWidget->addWidget(widget);
} }
void EditWidget::setRowHidden(int row, bool hide)
{
m_ui->categoryList->item(row)->setHidden(hide);
}
void EditWidget::setCurrentRow(int index) void EditWidget::setCurrentRow(int index)
{ {
m_ui->categoryList->setCurrentRow(index); m_ui->categoryList->setCurrentRow(index);

View File

@ -37,6 +37,7 @@ public:
~EditWidget(); ~EditWidget();
void add(const QString& labelText, QWidget* widget); void add(const QString& labelText, QWidget* widget);
void setRowHidden(int row, bool hide);
void setCurrentRow(int index); void setCurrentRow(int index);
void setHeadline(const QString& text); void setHeadline(const QString& text);
QLabel* headlineLabel(); QLabel* headlineLabel();

View File

@ -177,6 +177,9 @@ void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const Q
} }
setForms(entry); setForms(entry);
setCurrentRow(0);
setRowHidden(4, m_history);
} }
void EditEntryWidget::setForms(const Entry* entry, bool restore) void EditEntryWidget::setForms(const Entry* entry, bool restore)
@ -247,8 +250,6 @@ void EditEntryWidget::setForms(const Entry* entry, bool restore)
updateHistoryButtons(m_historyUi->historyView->currentIndex(), QModelIndex()); updateHistoryButtons(m_historyUi->historyView->currentIndex(), QModelIndex());
setCurrentRow(0);
m_mainUi->titleEdit->setFocus(); m_mainUi->titleEdit->setFocus();
} }