mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-13 14:32:04 +00:00
fcdb71906b
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7722 a592a061-630c-0410-9148-cb99ea01b6c8
85 lines
1.2 KiB
C
85 lines
1.2 KiB
C
/**
|
|
* \file ControlButtons.C
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Angus Leeming
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
|
|
#include "ControlButtons.h"
|
|
#include "ButtonController.h"
|
|
#include "BCView.h"
|
|
#include "lyxrc.h"
|
|
|
|
|
|
ControlButtons::ControlButtons()
|
|
: emergency_exit_(false), is_closing_(false),
|
|
bc_ptr_(new ButtonController), view_ptr_(0)
|
|
{}
|
|
|
|
|
|
ControlButtons::~ControlButtons()
|
|
{}
|
|
|
|
|
|
void ControlButtons::ApplyButton()
|
|
{
|
|
apply();
|
|
bc().apply();
|
|
}
|
|
|
|
|
|
void ControlButtons::OKButton()
|
|
{
|
|
is_closing_ = true;
|
|
apply();
|
|
is_closing_ = false;
|
|
hide();
|
|
bc().ok();
|
|
}
|
|
|
|
|
|
void ControlButtons::CancelButton()
|
|
{
|
|
hide();
|
|
bc().cancel();
|
|
}
|
|
|
|
|
|
void ControlButtons::RestoreButton()
|
|
{
|
|
update();
|
|
bc().restore();
|
|
}
|
|
|
|
|
|
bool ControlButtons::IconifyWithMain() const
|
|
{
|
|
return lyxrc.dialogs_iconify_with_main;
|
|
}
|
|
|
|
|
|
ButtonController & ControlButtons::bc()
|
|
{
|
|
BOOST_ASSERT(bc_ptr_.get());
|
|
return *bc_ptr_.get();
|
|
}
|
|
|
|
|
|
ViewBase & ControlButtons::view()
|
|
{
|
|
BOOST_ASSERT(view_ptr_);
|
|
return *view_ptr_;
|
|
}
|
|
|
|
|
|
void ControlButtons::setView(ViewBase & v)
|
|
{
|
|
view_ptr_ = &v;
|
|
}
|