Ejemplo n.º 1
0
//
// Init the whole view
//
void VirtualConsole::initView(void)
{
    setCaption("Virtual Console");
    resize(200, 400);

    initMenuBar();

    // Reset ID
    VCFrame::ResetID();

    // Dock & Draw Area
    initDockArea();
    initDrawArea();

    slotModeChanged();
    connect(_app, SIGNAL(modeChanged()), this, SLOT(slotModeChanged()));

    // Check if VC should be open
    QString config;
    _app->settings()->get(KEY_VIRTUAL_CONSOLE_OPEN, config);
    if (config == Settings::trueValue())
    {
        _app->slotViewVirtualConsole();
    }
    else
    {
        hide();
        _app->slotVirtualConsoleClosed();
    }

    // Grid
    _app->settings()->get(KEY_VIRTUAL_CONSOLE_SNAPGRID, config);
    if (config == Settings::trueValue())
    {
        m_gridEnabled = true;
    }
    else
    {
        m_gridEnabled = false;
    }

    // Grid X
    if (_app->settings()->get(KEY_VIRTUAL_CONSOLE_GRIDX, config))
    {
        m_gridX = config.toInt();
    }
    else
    {
        m_gridX = 10;
    }

    // Grid Y
    if (_app->settings()->get(KEY_VIRTUAL_CONSOLE_GRIDY, config))
    {
        m_gridY = config.toInt();
    }
    else
    {
        m_gridY = 10;
    }
}
Ejemplo n.º 2
0
VirtualConsole::VirtualConsole(QWidget* parent, Doc* doc)
    : QWidget(parent)
    , m_doc(doc)

    , m_editAction(EditNone)
    , m_toolbar(NULL)

    , m_addActionGroup(NULL)
    , m_editActionGroup(NULL)
    , m_bgActionGroup(NULL)
    , m_fgActionGroup(NULL)
    , m_fontActionGroup(NULL)
    , m_frameActionGroup(NULL)
    , m_stackingActionGroup(NULL)

    , m_addButtonAction(NULL)
    , m_addButtonMatrixAction(NULL)
    , m_addSliderAction(NULL)
    , m_addSliderMatrixAction(NULL)
    , m_addSpeedDialAction(NULL)
    , m_addXYPadAction(NULL)
    , m_addCueListAction(NULL)
    , m_addFrameAction(NULL)
    , m_addSoloFrameAction(NULL)
    , m_addLabelAction(NULL)

    , m_toolsSettingsAction(NULL)

    , m_editCutAction(NULL)
    , m_editCopyAction(NULL)
    , m_editPasteAction(NULL)
    , m_editDeleteAction(NULL)
    , m_editPropertiesAction(NULL)
    , m_editRenameAction(NULL)

    , m_bgColorAction(NULL)
    , m_bgImageAction(NULL)
    , m_bgDefaultAction(NULL)

    , m_fgColorAction(NULL)
    , m_fgDefaultAction(NULL)

    , m_fontAction(NULL)
    , m_resetFontAction(NULL)

    , m_frameSunkenAction(NULL)
    , m_frameRaisedAction(NULL)
    , m_frameNoneAction(NULL)

    , m_stackingRaiseAction(NULL)
    , m_stackingLowerAction(NULL)

    , m_customMenu(NULL)
    , m_editMenu(NULL)
    , m_addMenu(NULL)

    , m_dockArea(NULL)
    , m_contentsLayout(NULL)
    , m_scrollArea(NULL)
    , m_contents(NULL)

    , m_tapModifierDown(false)
{
    Q_ASSERT(s_instance == NULL);
    s_instance = this;

    Q_ASSERT(doc != NULL);

    /* Main layout */
    new QHBoxLayout(this);
    layout()->setMargin(1);
    layout()->setSpacing(1);

    initActions();
    initDockArea();
    m_contentsLayout = new QVBoxLayout;
    layout()->addItem(m_contentsLayout);
    initMenuBar();
    initContents();

    // Propagate mode changes to all widgets
    connect(m_doc, SIGNAL(modeChanged(Doc::Mode)),
            this, SLOT(slotModeChanged(Doc::Mode)));

    // Use the initial mode
    slotModeChanged(m_doc->mode());

    // Nothing is selected
    updateActions();
}