Пример #1
0
void pfGUIControlMod::read(hsStream* S, plResManager* mgr) {
    plSingleModifier::read(S, mgr);

    fTagID = S->readInt();
    fVisible = S->readBool();
    setHandler(pfGUICtrlProcWriteableObject::Read(S));

    if (S->readBool()) {
        fDynTextLayer = mgr->readKey(S);
        fDynTextMap = mgr->readKey(S);
    }

    if (S->readBool()) {
        setColorScheme(new pfGUIColorScheme());
        fColorScheme->read(S);
    } else {
        setColorScheme(NULL);
    }

    fSoundIndices.resize(S->readByte());
    for (size_t i=0; i<fSoundIndices.size(); i++)
        fSoundIndices[i] = S->readInt();

    if (fFlags[kHasProxy])
        fProxy = mgr->readKey(S);
    fSkin = mgr->readKey(S);
}
Пример #2
0
BuddyListContact::BuddyListContact(PurpleBlistNode *node_)
: BuddyListNode(node_)
{
  setColorScheme("buddylistcontact");

  contact = PURPLE_CONTACT(blist_node);
}
Пример #3
0
void ccHistogramWindow::fromSF(	ccScalarField* sf,
								unsigned initialNumberOfClasses/*=0*/,
								bool numberOfClassesCanBeChanged/*=true*/,
								bool showNaNValuesInGrey/*=true*/)
{
	if (m_associatedSF != sf)
	{
		if (m_associatedSF)
			m_associatedSF->release();
		m_associatedSF = sf;
		if (m_associatedSF)
			m_associatedSF->link();
	}

	if (m_associatedSF)
	{
		m_minVal = showNaNValuesInGrey ? m_associatedSF->getMin() : m_associatedSF->displayRange().start();
		m_maxVal = showNaNValuesInGrey ? m_associatedSF->getMax() : m_associatedSF->displayRange().stop();
		m_numberOfClassesCanBeChanged = numberOfClassesCanBeChanged;
	}
	else
	{
		assert(false);
		m_minVal = m_maxVal = 0;
		m_numberOfClassesCanBeChanged = false;
	}

	setColorScheme(USE_SF_SCALE);
	setNumberOfClasses(initialNumberOfClasses);
};
void
VBoxDbgConsoleOutput::sltSelectColorScheme()
{
    QAction *pAction = qobject_cast<QAction *>(sender());
    if (pAction)
        setColorScheme((VBoxDbgConsoleColor)pAction->data().toInt(), true /*fSaveIt*/);
}
Пример #5
0
BuddyListChat::BuddyListChat(PurpleBlistNode *node_)
: BuddyListNode(node_)
{
  setColorScheme("buddylistchat");

  chat = PURPLE_CHAT(blist_node);
}
Пример #6
0
void BuddyListBuddy::updateColorScheme()
{
  char *new_scheme;

  switch (BUDDYLIST->getColorizationMode()) {
    case BuddyList::COLOR_BY_STATUS:
      new_scheme = Utils::getColorSchemeString("buddylistbuddy", buddy);
      setColorScheme(new_scheme);
      g_free(new_scheme);
      break;
    default:
      // note: COLOR_BY_ACCOUNT case is handled by BuddyListBuddy::draw()
      setColorScheme("buddylistbuddy");
      break;
  }
}
Пример #7
0
BuddyListBuddy::BuddyListBuddy(PurpleBlistNode *node_)
: BuddyListNode(node_)
{
  setColorScheme("buddylistbuddy");

  buddy = PURPLE_BUDDY(blist_node);
}
Пример #8
0
BuddyListGroup::BuddyListGroup(PurpleBlistNode *node_)
: BuddyListNode(node_)
{
  setColorScheme("buddylistgroup");

  group = PURPLE_GROUP(blist_node);
}
Пример #9
0
void BuddyListContact::updateColorScheme()
{
  char *new_scheme;
  PurpleBuddy *buddy;

  switch (BUDDYLIST->getColorizationMode()) {
    case BuddyList::COLOR_BY_STATUS:
      buddy = purple_contact_get_priority_buddy(contact);
      new_scheme = Utils::getColorSchemeString("buddylistcontact", buddy);
      setColorScheme(new_scheme);
      g_free(new_scheme);
      break;
    default:
      // note: COLOR_BY_ACCOUNT case is handled by BuddyListContact::draw()
      setColorScheme("buddylistcontact");
      break;
  }
}
Пример #10
0
Notify::UserInfoDialog::UserInfoDialog(const char *title)
: SplitDialog(title)
{
  setColorScheme("generalwindow");

  treeview = new CppConsUI::TreeView(AUTOSIZE, AUTOSIZE);
  setContainer(*treeview);

  buttons->appendItem(_("Done"), sigc::hide(sigc::mem_fun(this,
          &UserInfoDialog::close)));
}
Пример #11
0
void pfGUIControlMod::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "ControlParams") {
        fTagID = tag->getParam("TagID", "0").toUint();
        fVisible = tag->getParam("Visible", "true").toBool();
    } else if (tag->getName() == "Handler") {
        if (tag->hasChildren())
            setHandler(pfGUICtrlProcWriteableObject::PrcParse(tag->getFirstChild()));
        else
            setHandler(NULL);
    } else if (tag->getName() == "DynTextLayer") {
        if (tag->hasChildren())
            fDynTextLayer = mgr->prcParseKey(tag->getFirstChild());
    } else if (tag->getName() == "DynTextMap") {
        if (tag->hasChildren())
            fDynTextMap = mgr->prcParseKey(tag->getFirstChild());
    } else if (tag->getName() == "pfGUIColorScheme") {
        if (tag->getParam("NULL", "false")) {
            setColorScheme(NULL);
        } else {
            setColorScheme(new pfGUIColorScheme());
            fColorScheme->prcParse(tag);
        }
    } else if (tag->getName() == "SoundIndices") {
        fSoundIndices.resize(tag->countChildren());
        const pfPrcTag* child = tag->getFirstChild();
        for (size_t i=0; i<fSoundIndices.size(); i++) {
            if (child->getName() != "SoundIndex")
                throw pfPrcTagException(__FILE__, __LINE__, child->getName());
            fSoundIndices[i] = child->getParam("value", "0").toInt();
            child = child->getNextSibling();
        }
    } else if (tag->getName() == "Proxy") {
        if (tag->hasChildren())
            fProxy = mgr->prcParseKey(tag->getFirstChild());
    } else if (tag->getName() == "Skin") {
        if (tag->hasChildren())
            fSkin = mgr->prcParseKey(tag->getFirstChild());
    } else {
        plSingleModifier::IPrcParse(tag, mgr);
    }
}
Пример #12
0
SubCommandLine::SubCommandLine(uint index,
                               QMutex *mutex,
                               QWidget *parent)
    : CommandLine(mutex, parent),
      _index(index)
{
    this->setReadOnly(true);

    setColorScheme(new SubCLColorScheme(this));

    connect(&thread,
            SIGNAL(finished()),
            this,
            SLOT(emitWasReleased()));
}
Пример #13
0
void TermWidgetImpl::propertiesChanged()
{
    setColorScheme(Properties::Instance()->colorScheme);
    setTerminalFont(Properties::Instance()->font);
    setMotionAfterPasting(Properties::Instance()->m_motionAfterPaste);

    if (Properties::Instance()->historyLimited)
    {
        setHistorySize(Properties::Instance()->historyLimitedTo);
    }
    else
    {
        // Unlimited history
        setHistorySize(-1);
    }

    setKeyBindings(Properties::Instance()->emulation);
    setTerminalOpacity(1.0 - Properties::Instance()->termTransparency/100.0);

    /* be consequent with qtermwidget.h here */
    switch(Properties::Instance()->scrollBarPos) {
    case 0:
        setScrollBarPosition(QTermWidget::NoScrollBar);
        break;
    case 1:
        setScrollBarPosition(QTermWidget::ScrollBarLeft);
        break;
    case 2:
    default:
        setScrollBarPosition(QTermWidget::ScrollBarRight);
        break;
    }

    switch(Properties::Instance()->keyboardCursorShape) {
    case 1:
        setKeyboardCursorShape(QTermWidget::UnderlineCursor);
        break;
    case 2:
        setKeyboardCursorShape(QTermWidget::IBeamCursor);
        break;
    default:
    case 0:
        setKeyboardCursorShape(QTermWidget::BlockCursor);
        break;
    }

    update();
}
void KoReportDesignerItemChart::slotPropertyChanged(KoProperty::Set &s, KoProperty::Property &p)
{       
    if (p.name() == "Name") {
        //For some reason p.oldValue returns an empty string
        if (!m_reportDesigner->isEntityNameUnique(p.value().toString(), this)) {
            p.setValue(m_oldName);
        } else {
            m_oldName = p.value().toString();
        }
    } else if (p.name() == "three-dimensions") {
        set3D(p.value().toBool());
    } else if (p.name() == "antialiased") {
        setAA(p.value().toBool());
    } else if (p.name() == "color-scheme") {
        setColorScheme(p.value().toString());
    } else if (p.name() == "data-source") {
        populateData();
    } else if (p.name() == "title-x-axis" ||   p.name() == "title-y-axis") {
        setAxis(m_xTitle->value().toString(), m_yTitle->value().toString());
    } else if (p.name() == "background-color") {
        setBackgroundColor(p.value().value<QColor>());
    } else if (p.name() == "display-legend") {
        if (m_chartWidget && p.value().toBool()) {
            populateData();
        }
    } else if (p.name() == "legend-position") {
        if (m_chartWidget) {
            populateData();
        }
    } else if (p.name() == "legend-orientation") {
        if (m_chartWidget) {
            populateData();
        }
    } else if (p.name() == "chart-type") {
        if (m_chartWidget) {
	    populateData();
            //m_chartWidget->setType((KDChart::Widget::ChartType) m_chartType->value().toInt());
        }
    } else if (p.name() == "chart-sub-type") {
        if (m_chartWidget) {
            m_chartWidget->setSubType((KDChart::Widget::SubType) m_chartSubType->value().toInt());
        }
    }

    KoReportDesignerItemRectBase::propertyChanged(s, p);
    if (m_reportDesigner) m_reportDesigner->setModified(true);
}
Пример #15
0
AccountWindow::AccountWindow()
: SplitDialog(0, 0, 80, 24, _("Accounts"))
{
  setColorScheme("generalwindow");

  treeview = new CppConsUI::TreeView(AUTOSIZE, AUTOSIZE);
  setContainer(*treeview);

  // populate all defined accounts
  for (GList *i = purple_accounts_get_all(); i; i = i->next)
    populateAccount(reinterpret_cast<PurpleAccount*>(i->data));

  buttons->appendItem(_("Add"), sigc::mem_fun(this,
        &AccountWindow::addAccount));
  buttons->appendSeparator();
  buttons->appendItem(_("Done"), sigc::hide(sigc::mem_fun(this,
          &AccountWindow::close)));
}
Пример #16
0
	void TermTab::SetupColorsButton ()
	{
		auto colorMenu = new QMenu { tr ("Color scheme"), this };
		colorMenu->menuAction ()->setProperty ("ActionIcon", "fill-color");
		connect (colorMenu,
				SIGNAL (triggered (QAction*)),
				this,
				SLOT (setColorScheme (QAction*)));
		connect (colorMenu,
				SIGNAL (hovered (QAction*)),
				this,
				SLOT (previewColorScheme (QAction*)));
		connect (colorMenu,
				SIGNAL (aboutToHide ()),
				this,
				SLOT (stopColorSchemePreview ()));

		const auto& lastScheme = XmlSettingsManager::Instance ()
				.Property ("LastColorScheme", "Linux").toString ();

		const auto colorActionGroup = new QActionGroup { colorMenu };
		for (const auto& colorScheme : ColorSchemesMgr_->GetSchemes ())
		{
			auto act = colorMenu->addAction (colorScheme.Name_);
			act->setCheckable (true);
			act->setProperty ("ER/ColorScheme", colorScheme.ID_);

			if (colorScheme.ID_ == lastScheme)
			{
				act->setChecked (true);
				setColorScheme (act);
			}

			colorActionGroup->addAction (act);
		}

		auto colorButton = new QToolButton { Toolbar_ };
		colorButton->setPopupMode (QToolButton::InstantPopup);
		colorButton->setMenu (colorMenu);
		colorButton->setProperty ("ActionIcon", "fill-color");

		Toolbar_->addWidget (colorButton);
	}
Пример #17
0
GeneralMenu::GeneralMenu()
: MenuWindow(0, 0, AUTOSIZE, AUTOSIZE)
{
  setColorScheme("generalmenu");

  appendItem(_("Change status"), sigc::mem_fun(this,
        &GeneralMenu::openStatusWindow));
  appendItem(_("Accounts..."), sigc::mem_fun(this,
        &GeneralMenu::openAccountWindow));
  appendItem(_("Add buddy..."), sigc::mem_fun(this,
        &GeneralMenu::openAddBuddyRequest));
  appendItem(_("Add chat..."), sigc::mem_fun(this,
        &GeneralMenu::openAddChatRequest));
  appendItem(_("Add group..."), sigc::mem_fun(this,
        &GeneralMenu::openAddGroupRequest));
  appendItem(_("Pending requests..."), sigc::mem_fun(this,
        &GeneralMenu::openPendingRequests));
  appendItem(_("Config options..."), sigc::mem_fun(this,
        &GeneralMenu::openOptionWindow));
  appendItem(_("Plugins..."), sigc::mem_fun(this,
        &GeneralMenu::openPluginWindow));
  appendSeparator();
#ifdef DEBUG
  MenuWindow *submenu = new MenuWindow(0, 0, AUTOSIZE, AUTOSIZE);
  submenu->setColorScheme("generalmenu");
  submenu->appendItem("Request input", sigc::mem_fun(this,
        &GeneralMenu::openRequestInputTest));
  submenu->appendItem("Request choice", sigc::mem_fun(this,
        &GeneralMenu::openRequestChoiceTest));
  submenu->appendItem("Request action", sigc::mem_fun(this,
        &GeneralMenu::openRequestActionTest));
  submenu->appendItem("Request fields", sigc::mem_fun(this,
        &GeneralMenu::openRequestFieldsTest));
  appendSubMenu("Debug...", *submenu);
  appendSeparator();
#endif // DEBUG
  appendItem(_("Quit"), sigc::hide(sigc::mem_fun(CENTERIM,
          &CenterIM::quit)));
}
Пример #18
0
void Editor::initGui( void* systemWindow )
{
	CRect rc      = childFrame_->getViewSize();
    CCoord middle = rc.width() - 276;
    CCoord bottom = rc.height() - 55;

    CRect rcTabView( rc.left+8, rc.top+8, rc.right-8, rc.bottom-8 );
	CRect rcTabButtons( -3, 0, 100, 64 );	            // size of a TabButton (double height)
	CRect rcDisplay( 0, 0, rc.right-16, bottom );	    // area without tab bar
	CRect rcProgramView( 0, 0, middle, bottom );
	CRect rcCtrlView( middle, 0, rc.right-8, bottom );
    CRect rcBankView( 0, 0, rc.right-8, bottom );
    CRect rcSystemView( 0, 0, rc.right-16, bottom );

	tabView_     = new TabView( rcTabView, rcTabButtons, this );
   	ctrlView_    = new CtrlView( rcCtrlView, this );
	programView_ = new ProgramView( rcProgramView, this, ctrlView_ );
    bankView_    = new BankView( rcBankView, this );
    
	CViewContainer* programTab = new CViewContainer( rcDisplay, childFrame_ );
    programTab->setAutosizeFlags( kAutosizeAll );
    programTab->setTransparency( true );
    programTab->addView( programView_->getScrollView() );
	programTab->addView( ctrlView_ );

    tabView_->addTab( programTab, new TabButton( "Program" ));
	tabView_->addTab( bankView_, new TabButton( "Bank" ) );
	
    if( isStandalone() )
    {
        systemView_ = new SystemView( rcSystemView, this );
        tabView_->addTab( systemView_, new TabButton( "System" ) );
    }

    tabView_->init();	
    childFrame_->addView( tabView_ );
    checkAppState();
    setColorScheme();
}
Пример #19
0
void TermWidgetImpl::propertiesChanged()
{
    setColorScheme(Properties::Instance()->colorScheme);
    setTerminalFont(Properties::Instance()->font);
    setMotionAfterPasting(Properties::Instance()->m_motionAfterPaste);

    if (Properties::Instance()->historyLimited)
    {
        setHistorySize(Properties::Instance()->historyLimitedTo);
    }
    else
    {
        // Unlimited history
        setHistorySize(-1);
    }

    qDebug() << "TermWidgetImpl::propertiesChanged" << this << "emulation:" << Properties::Instance()->emulation;
    setKeyBindings(Properties::Instance()->emulation);
    setTerminalOpacity(Properties::Instance()->termOpacity/100.0);

    /* be consequent with qtermwidget.h here */
    switch(Properties::Instance()->scrollBarPos) {
    case 0:
        setScrollBarPosition(QTermWidget::NoScrollBar);
        break;
    case 1:
        setScrollBarPosition(QTermWidget::ScrollBarLeft);
        break;
    case 2:
    default:
        setScrollBarPosition(QTermWidget::ScrollBarRight);
        break;
    }

    updateShortcuts();

    update();
}
Пример #20
0
void Buffer::setLanguage(const Language *language) {
    if (m_language != language) {
        m_language = language;

        if (language) {
            setLexerLanguage(language->lexer().toLocal8Bit());
            for (int i = 0; i < language->keywords().size(); ++i) {
                setKeyWords(i, language->keywords().at(i).toLatin1());
            }
            setProperty("fold", "1");
            setProperty("fold.compact", "0");
        } else {
            setLexer(SCLEX_NULL);
            setKeyWords(0, "");
            setProperty("fold", "0");
        }

        Configuration *config = Configuration::instance();
        setColorScheme(ColorScheme::getColorScheme(config->colorScheme()));

        emit languageChanged(language);
    }
}
Пример #21
0
void Buffer::loadConfiguration() {
    Configuration *config = Configuration::instance();

    m_trackLineWidth = config->trackLineMarginWidth();
    m_braceHighlight = config->braceHighlight();

    setStyleQFont(STYLE_DEFAULT, config->font());
    setViewWhitespace(config->viewWhitespace());
    setViewIndentationGuides(config->viewIndentationGuides());
    setCaretLineVisible(config->caretLineVisible());
    setLongLineIndicator(config->longLineIndicator());
    setViewEOL(config->viewEndOfLine());
    setShowLineNumbers(config->showLineMargin());
    setShowIconMargin(config->showIconMargin());
    setShowFoldMargin(config->showFoldMargin());
    setTabWidth(config->tabWidth());
    setIndent(config->indentationWidth());
    setUseTabs(config->useTabs());
    setScrollWidth(config->scrollWidth());
    setScrollWidthTracking(config->scrollWidthTracking());
    setFoldSymbols(config->foldSymbols());
    setFoldLines(config->foldLines());
    setColorScheme(ColorScheme::getColorScheme(config->colorScheme()));
}
Пример #22
0
MarkdownEditor::MarkdownEditor
(
    TextDocument* textDocument,
    MarkdownHighlighter* highlighter,
    QWidget* parent
)
    : QPlainTextEdit(parent),
        textDocument(textDocument),
        highlighter(highlighter),
        dictionary(DictionaryManager::instance().requestDictionary()),
        mouseButtonDown(false)
{
    setDocument(textDocument);
    setAcceptDrops(true);

    preferredLayout = new QGridLayout();
    preferredLayout->setSpacing(0);
    preferredLayout->setMargin(0);
    preferredLayout->setContentsMargins(0, 0, 0, 0);
    preferredLayout->addWidget(this, 0, 0);

    blockquoteRegex.setPattern("^ {0,3}(>\\s*)+");
    numberedListRegex.setPattern("^\\s*([0-9]+)[.)]\\s+");
    bulletListRegex.setPattern("^\\s*[+*-]\\s+");
    taskListRegex.setPattern("^\\s*[-] \\[([x ])\\]\\s+");

    this->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
    setCursorWidth(2);
    setCenterOnScroll(true);
    ensureCursorVisible();
    spellCheckEnabled = false;
    installEventFilter(this);
    viewport()->installEventFilter(this);
    wordCount = 0;
    lastBlockCount = 1;
    focusMode = FocusModeDisabled;
    insertSpacesForTabs = false;
    setTabulationWidth(4);
    editorWidth = EditorWidthMedium;

    markupPairs.insert('"', '"');
    markupPairs.insert('\'', '\'');
    markupPairs.insert('(', ')');
    markupPairs.insert('[', ']');
    markupPairs.insert('{', '}');
    markupPairs.insert('*', '*');
    markupPairs.insert('_', '_');
    markupPairs.insert('`', '`');
    markupPairs.insert('<', '>');

    connect(this->document(), SIGNAL(contentsChange(int,int,int)), this, SLOT(onTextChanged(int,int,int)));
    connect(this->document(), SIGNAL(blockCountChanged(int)), this, SLOT(onBlockCountChanged(int)));
    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(onCursorPositionChanged()));
    connect(this, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));

    addWordToDictionaryAction = new QAction(tr("Add word to dictionary"), this);
    checkSpellingAction = new QAction(tr("Check spelling..."), this);

    typingPausedSignalSent = true;
    typingHasPaused = true;

    typingTimer = new QTimer(this);
    connect
    (
        typingTimer,
        SIGNAL(timeout()),
        this,
        SLOT(checkIfTypingPaused())
    );
    typingTimer->start(1000);

    setColorScheme
    (
        QColor(Qt::black),
        QColor(Qt::white),
        QColor(Qt::black),
        QColor(Qt::blue),
        QColor(Qt::red)
    );

    fadeEffect = new GraphicsFadeEffect(this);
    fadeEffect->setFadeHeight(this->fontMetrics().height());
    viewport()->setGraphicsEffect(fadeEffect);
}
VBoxDbgConsoleOutput::VBoxDbgConsoleOutput(QWidget *pParent/* = NULL*/, IVirtualBox *a_pVirtualBox /* = NULL */,
                                           const char *pszName/* = NULL*/)
    : QTextEdit(pParent), m_uCurLine(0), m_uCurPos(0), m_hGUIThread(RTThreadNativeSelf()), m_pVirtualBox(a_pVirtualBox)
{
    setReadOnly(true);
    setUndoRedoEnabled(false);
    setOverwriteMode(false);
    setPlainText("");
    setTextInteractionFlags(Qt::TextBrowserInteraction);
    setAutoFormatting(QTextEdit::AutoAll);
    setTabChangesFocus(true);
    setAcceptRichText(false);

    /*
     * Create actions for color-scheme menu items.
     */
    m_pGreenOnBlackAction = new QAction(tr("Green On Black"), this);
    m_pGreenOnBlackAction->setCheckable(true);
    m_pGreenOnBlackAction->setShortcut(Qt::ControlModifier + Qt::Key_1);
    m_pGreenOnBlackAction->setData((int)kGreenOnBlack);
    connect(m_pGreenOnBlackAction, SIGNAL(triggered()), this, SLOT(sltSelectColorScheme()));

    m_pBlackOnWhiteAction = new QAction(tr("Black On White"), this);
    m_pBlackOnWhiteAction->setCheckable(true);
    m_pBlackOnWhiteAction->setShortcut(Qt::ControlModifier + Qt::Key_2);
    m_pBlackOnWhiteAction->setData((int)kBlackOnWhite);
    connect(m_pBlackOnWhiteAction, SIGNAL(triggered()), this, SLOT(sltSelectColorScheme()));

    /* Create action group for grouping of exclusive color-scheme menu items. */
    QActionGroup *pActionColorGroup = new QActionGroup(this);
    pActionColorGroup->addAction(m_pGreenOnBlackAction);
    pActionColorGroup->addAction(m_pBlackOnWhiteAction);
    pActionColorGroup->setExclusive(true);

    /*
     * Create actions for font menu items.
     */
    m_pCourierFontAction = new QAction(tr("Courier"), this);
    m_pCourierFontAction->setCheckable(true);
    m_pCourierFontAction->setShortcut(Qt::ControlModifier + Qt::Key_D);
    m_pCourierFontAction->setData((int)kFontType_Courier);
    connect(m_pCourierFontAction, SIGNAL(triggered()), this, SLOT(sltSelectFontType()));

    m_pMonospaceFontAction = new QAction(tr("Monospace"), this);
    m_pMonospaceFontAction->setCheckable(true);
    m_pMonospaceFontAction->setShortcut(Qt::ControlModifier + Qt::Key_M);
    m_pMonospaceFontAction->setData((int)kFontType_Monospace);
    connect(m_pMonospaceFontAction, SIGNAL(triggered()), this, SLOT(sltSelectFontType()));

    /* Create action group for grouping of exclusive font menu items. */
    QActionGroup *pActionFontGroup = new QActionGroup(this);
    pActionFontGroup->addAction(m_pCourierFontAction);
    pActionFontGroup->addAction(m_pMonospaceFontAction);
    pActionFontGroup->setExclusive(true);

    /*
     * Create actions for font size menu.
     */
    uint32_t const uDefaultFontSize = font().pointSize();
    m_pActionFontSizeGroup = new QActionGroup(this);
    for (uint32_t i = 0; i < RT_ELEMENTS(m_apFontSizeActions); i++)
    {
        char szTitle[32];
        RTStrPrintf(szTitle, sizeof(szTitle), s_uMinFontSize + i != uDefaultFontSize ? "%upt" : "%upt (default)",
                    s_uMinFontSize + i);
        m_apFontSizeActions[i] = new QAction(tr(szTitle), this);
        m_apFontSizeActions[i]->setCheckable(true);
        m_apFontSizeActions[i]->setData(i + s_uMinFontSize);
        connect(m_apFontSizeActions[i], SIGNAL(triggered()), this, SLOT(sltSelectFontSize()));
        m_pActionFontSizeGroup->addAction(m_apFontSizeActions[i]);
    }

    /*
     * Set the defaults (which syncs with the menu item checked state).
     */
    /* color scheme: */
    com::Bstr bstrColor;
    HRESULT hrc = m_pVirtualBox ? m_pVirtualBox->GetExtraData(com::Bstr("DbgConsole/ColorScheme").raw(), bstrColor.asOutParam()) : E_FAIL;
    if (  SUCCEEDED(hrc)
        && bstrColor.compareUtf8("blackonwhite", com::Bstr::CaseInsensitive) == 0)
        setColorScheme(kBlackOnWhite, false /*fSaveIt*/);
    else
        setColorScheme(kGreenOnBlack, false /*fSaveIt*/);

    /* font: */
    com::Bstr bstrFont;
    hrc = m_pVirtualBox ? m_pVirtualBox->GetExtraData(com::Bstr("DbgConsole/Font").raw(), bstrFont.asOutParam()) : E_FAIL;
    if (  SUCCEEDED(hrc)
        && bstrFont.compareUtf8("monospace", com::Bstr::CaseInsensitive) == 0)
        setFontType(kFontType_Monospace, false /*fSaveIt*/);
    else
        setFontType(kFontType_Courier, false /*fSaveIt*/);

    /* font size: */
    com::Bstr bstrFontSize;
    hrc = m_pVirtualBox ? m_pVirtualBox->GetExtraData(com::Bstr("DbgConsole/FontSize").raw(), bstrFontSize.asOutParam()) : E_FAIL;
    if (SUCCEEDED(hrc))
    {
        com::Utf8Str strFontSize(bstrFontSize);
        uint32_t uFontSizePrf = strFontSize.strip().toUInt32();
        if (   uFontSizePrf - s_uMinFontSize < (uint32_t)RT_ELEMENTS(m_apFontSizeActions)
            && uFontSizePrf != uDefaultFontSize)
            setFontSize(uFontSizePrf, false /*fSaveIt*/);
    }

    NOREF(pszName);
}
Widget_WarpControlPaint::Widget_WarpControlPaint()
{
    boundRect.setCoords(0, 0, 0, 0);
    setZValue(1);
    setColorScheme(1);
}