mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-12 19:38:18 +00:00
levels are not exclusive
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32674 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c1cd1fbe28
commit
0a6118f0c7
@ -21,17 +21,17 @@
|
|||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QGroupBox>
|
|
||||||
#include <QRadioButton>
|
#include <QCheckBox>
|
||||||
#include <QButtonGroup>
|
|
||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
namespace frontend {
|
namespace frontend {
|
||||||
|
|
||||||
|
|
||||||
struct LevelButton : QRadioButton
|
struct LevelButton : QCheckBox
|
||||||
{
|
{
|
||||||
LevelButton(const QString& name) : QRadioButton(name) {}
|
LevelButton(const QString& name) : QCheckBox(name) {}
|
||||||
Debug::Type level;
|
Debug::Type level;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -61,17 +61,18 @@ GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area,
|
|||||||
font.setStyleHint(QFont::TypeWriter);
|
font.setStyleHint(QFont::TypeWriter);
|
||||||
widget_->outTE->setFont(font);
|
widget_->outTE->setFont(font);
|
||||||
|
|
||||||
QButtonGroup* button_group = new QButtonGroup(this);
|
|
||||||
const std::vector<Debug::Type> levels = Debug::levels();
|
const std::vector<Debug::Type> levels = Debug::levels();
|
||||||
for (unsigned int i = 0; i < levels.size(); i++) {
|
for (unsigned int i = 1; i < levels.size(); i++) {
|
||||||
LevelButton * box = new LevelButton(toqstr(Debug::description(levels[i])));
|
LevelButton * box = new LevelButton(toqstr(Debug::description(levels[i])));
|
||||||
box->level = levels[i];
|
box->level = levels[i];
|
||||||
widget_->settingsLayout->addWidget(box);
|
widget_->settingsLayout->addWidget(box);
|
||||||
button_group->addButton(box);
|
// TODO settings
|
||||||
|
box->setChecked(false);
|
||||||
|
level_buttons << box;
|
||||||
|
connect(box, SIGNAL(stateChanged(int)), this, SLOT(levelChange()));
|
||||||
}
|
}
|
||||||
connect(button_group, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(levelChanged(QAbstractButton*)));
|
|
||||||
// TODO settings
|
|
||||||
button_group->buttons().front()->setChecked(true);
|
|
||||||
|
|
||||||
GuiProgress* progress = dynamic_cast<GuiProgress*>(support::ProgressInterface::instance());
|
GuiProgress* progress = dynamic_cast<GuiProgress*>(support::ProgressInterface::instance());
|
||||||
|
|
||||||
@ -86,11 +87,14 @@ GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiProgressView::levelChanged(QAbstractButton* b)
|
void GuiProgressView::levelChanged()
|
||||||
{
|
{
|
||||||
LevelButton* lb = dynamic_cast<LevelButton*>(b);
|
int level = Debug::NONE;
|
||||||
if (lb)
|
Q_FOREACH(const LevelButton* button, level_buttons) {
|
||||||
lyxerr.level(lb->level);
|
if (button->isChecked())
|
||||||
|
level |= button->level;
|
||||||
|
}
|
||||||
|
lyxerr.level(static_cast<Debug::Type>(level));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,8 +20,9 @@
|
|||||||
#include "GuiProgress.h"
|
#include "GuiProgress.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <QList>
|
||||||
|
|
||||||
|
|
||||||
class QAbstractButton;
|
|
||||||
class QHideEvent;
|
class QHideEvent;
|
||||||
class QShowEvent;
|
class QShowEvent;
|
||||||
|
|
||||||
@ -29,6 +30,8 @@ class QShowEvent;
|
|||||||
namespace lyx {
|
namespace lyx {
|
||||||
namespace frontend {
|
namespace frontend {
|
||||||
|
|
||||||
|
struct LevelButton;
|
||||||
|
|
||||||
|
|
||||||
class ProgressViewWidget : public QWidget, public Ui::ProgressViewUi
|
class ProgressViewWidget : public QWidget, public Ui::ProgressViewUi
|
||||||
{
|
{
|
||||||
@ -69,13 +72,15 @@ private Q_SLOTS:
|
|||||||
void appendText(QString const & text);
|
void appendText(QString const & text);
|
||||||
void clearText();
|
void clearText();
|
||||||
|
|
||||||
void levelChanged(QAbstractButton*);
|
void levelChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProgressViewWidget * widget_;
|
ProgressViewWidget * widget_;
|
||||||
|
|
||||||
void showEvent(QShowEvent*);
|
void showEvent(QShowEvent*);
|
||||||
void hideEvent(QHideEvent*);
|
void hideEvent(QHideEvent*);
|
||||||
|
|
||||||
|
QList<LevelButton*> level_buttons;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user