// Manage the cancel/close button
bcview().setCancel(dialog_->closePB);
+ type_ = toc::getType(controller().params().getCmdName());
+ dialog_->enableButtons();
}
setTitle(guiname);
}
}
+ type_ = type;
+ dialog_->enableButtons();
}
string type;
if (!choice.empty())
type = choice[dialog_->typeCO->currentItem()];
+ type_ = type;
+ dialog_->enableButtons();
toc::Toc const & contents = controller().getContents(type);
}
+bool QToc::canOutline()
+{
+ return controller().canOutline(type_);
+}
+
+
void QToc::select(string const & text)
{
toc::Toc::const_iterator iter = toclist.begin();
void QToc::moveup()
{
controller().outline(toc::UP);
- update_contents();
+ updateToc(depth_);
}
void QToc::movedn()
{
controller().outline(toc::DOWN);
- update_contents();
+ updateToc(depth_);
}
void QToc::movein()
{
controller().outline(toc::IN);
- update_contents();
+ updateToc(depth_);
}
void QToc::moveout()
{
controller().outline(toc::OUT);
- update_contents();
+ updateToc(depth_);
}
/// update the listview
void updateToc(int newdepth);
+ ///
+ bool canOutline();
+
/// update the float types
void updateType();
/// Store selected item's string
std::string text_;
+
+ /// Store ToC list type
+ std::string type_;
};
} // namespace frontend
}
+void QTocDialog::enableButtons(bool enable)
+{
+ updatePB->setEnabled(enable);
+
+ if (!form_->canOutline())
+ enable = false;
+
+ moveupPB->setEnabled(enable);
+ movednPB->setEnabled(enable);
+ moveinPB->setEnabled(enable);
+ moveoutPB->setEnabled(enable);
+}
+
+
void QTocDialog::update_adaptor()
{
form_->update();