mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-30 05:12:40 +00:00
* PanelStack.{cpp,h}:
- new members showPanel, isCurrentPanel * GuiDocument.cpp: - hide Child Documents panel if there are no children. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32940 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
902dbf3f13
commit
e2925a160f
@ -2488,10 +2488,12 @@ void GuiDocument::paramsToDialog()
|
||||
std::vector<Buffer *> children = buffer().getChildren(false);
|
||||
if (children.empty()) {
|
||||
masterChildModule->childrenTW->clear();
|
||||
masterChildModule->setEnabled(false);
|
||||
masterChildModule->includeallRB->setChecked(true);
|
||||
includeonlys_.clear();
|
||||
docPS->showPanel(qt_("Child Documents"), false);
|
||||
if (docPS->isCurrentPanel(qt_("Child Documents")))
|
||||
docPS->setCurrentPanel(qt_("Document Class"));
|
||||
} else {
|
||||
docPS->showPanel(qt_("Child Documents"), true);
|
||||
masterChildModule->setEnabled(true);
|
||||
includeonlys_ = bp_.getIncludedChildren();
|
||||
updateIncludeonlys();
|
||||
|
@ -94,6 +94,15 @@ void PanelStack::addPanel(QWidget * panel, QString const & name, QString const &
|
||||
}
|
||||
|
||||
|
||||
void PanelStack::showPanel(QString const & name, bool show)
|
||||
{
|
||||
QTreeWidgetItem * item = panel_map_.value(name, 0);
|
||||
LASSERT(item, return);
|
||||
|
||||
item->setHidden(!show);
|
||||
}
|
||||
|
||||
|
||||
void PanelStack::setCurrentPanel(QString const & name)
|
||||
{
|
||||
QTreeWidgetItem * item = panel_map_.value(name, 0);
|
||||
@ -107,6 +116,15 @@ void PanelStack::setCurrentPanel(QString const & name)
|
||||
}
|
||||
|
||||
|
||||
bool PanelStack::isCurrentPanel(QString const & name) const
|
||||
{
|
||||
QTreeWidgetItem * item = panel_map_.value(name, 0);
|
||||
LASSERT(item, return false);
|
||||
|
||||
return (list_->currentItem() == item);
|
||||
}
|
||||
|
||||
|
||||
void PanelStack::switchPanel(QTreeWidgetItem * item,
|
||||
QTreeWidgetItem * previous)
|
||||
{
|
||||
|
@ -36,9 +36,13 @@ public:
|
||||
/// add a widget panel with a given name, under the given parent
|
||||
void addPanel(QWidget * panel, QString const & name,
|
||||
QString const & parent = QString());
|
||||
/// show or hide panel
|
||||
void showPanel(QString const & name, bool show);
|
||||
/// set current panel by logical name
|
||||
void setCurrentPanel(QString const &);
|
||||
///
|
||||
bool isCurrentPanel(QString const & name) const;
|
||||
///
|
||||
QSize sizeHint() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
|
Loading…
Reference in New Issue
Block a user