Exemplo n.º 1
0
bool DesignNetCorePlugin::initialize( const QStringList &arguments, QString *errorMessage /*= 0*/ )
{
	d->m_mode = new DesignNetMode(this);

	NormalPropertyWidgetFactory *normalPropertyWidgetFactory = new NormalPropertyWidgetFactory(this);
	NormalDataFactory* normalDataFactory = new NormalDataFactory(this);
	addAutoReleasedObject(normalPropertyWidgetFactory);
	addAutoReleasedObject(normalDataFactory);

	Core::BaseFileWizardParameters param;
	param.setIcon(QIcon(":/media/DesignNet.png"));
	param.setCategory(tr("DesignNet"));
	param.setDescription(tr("asdf"));
	param.setDisplayCategory(tr("nimeia"));
	param.setDisplayName(tr("miao"));
	addAutoReleasedObject(d->m_mode);
	addAutoReleasedObject(new ProcessorFactory(this));
	addAutoReleasedObject(new DesignNetSolutionWizard(param, this));
	addAutoReleasedObject(new DesignNetEditorFactory);
	// Core
	connect(ICore::instance(), SIGNAL(saveSettingsRequested()), this, SLOT(writeSettings()));
	d->m_designNetFormMgr = DesignNetFormManager::instance();
	d->m_designNetFormMgr->startInit();
	return true;
}
Exemplo n.º 2
0
ICore::ICore(MainWindow *mainwindow)
{
    m_instance = this;
    m_mainwindow = mainwindow;
    // Save settings once after all plugins are initialized:
    connect(ExtensionSystem::PluginManager::instance(), SIGNAL(initializationDone()),
            this, SIGNAL(saveSettingsRequested()));
}
Exemplo n.º 3
0
void UPacketView::createPacketListGroupBox()
{
    packetListGroupBox_ = new QGroupBox(tr("Packet List"),this);
    packetList_ = new UPacketInfoList(this);
    packetList_->setSortingEnabled(true);
    packetListModel_ = new UPacketInfoListModel(&packetInfos_,&currentDisplayScheme_,this);
    packetInfoProxyModel_ = new UPacketInfoListProxyModel(this);
    packetInfoProxyModel_->setSourceModel(packetListModel_);
    packetList_->setModel(packetInfoProxyModel_);
    
    displayList_ = new UPacketDisplayList(&savedDisplaySchemes_,this);

    silentModePushButton_ = new QPushButton(tr("Silent Mode"),this);
    silentModePushButton_->setCheckable(true);
    silentModePushButton_->setChecked(silentMode_);
    showSendPacketsButton_ = new QPushButton(tr("Show Send"),this);
    showSendPacketsButton_->setCheckable(true);
    showSendPacketsButton_->setChecked(currentDisplayScheme_.showSendPackets);
    showRecvPacketsButton_ = new QPushButton(tr("Show Recv"),this);
    showRecvPacketsButton_->setCheckable(true);
    showRecvPacketsButton_->setChecked(currentDisplayScheme_.showRecvPackets);
    showOnlySelectedButton_ = new QPushButton(tr("Show Only Selected"),this);
    showOnlySelectedButton_->setCheckable(true);
    showOnlySelectedButton_->setChecked(showOnlySelectedPackets_);
    
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(displayList_,30);
    mainLayout->addWidget(packetList_,100);
    UFlowLayout *bottomLayout = new UFlowLayout;
    bottomLayout->addWidget(silentModePushButton_);
    bottomLayout->addWidget(showSendPacketsButton_);
    bottomLayout->addWidget(showRecvPacketsButton_);
    bottomLayout->addWidget(showOnlySelectedButton_);

    mainLayout->addLayout(bottomLayout,0);
    packetListGroupBox_->setLayout(mainLayout);

    connect(packetList_,SIGNAL(visibilityChanged()),this,SLOT(updateFilters()));
    connect(packetListModel_,SIGNAL(saveSettingsRequested()),this,SLOT(saveSettings()));
    connect(silentModePushButton_,SIGNAL(toggled(bool)),this,SLOT(setSilentMode(bool)));
    connect(showOnlySelectedButton_,SIGNAL(toggled(bool)),this,SLOT(setShowOnlySelectedPackets(bool)));
    connect(showSendPacketsButton_,SIGNAL(toggled(bool)),this,SLOT(setShowSendPackets(bool)));
    connect(showRecvPacketsButton_,SIGNAL(toggled(bool)),this,SLOT(setShowRecvPackets(bool)));
    connect(displayList_,SIGNAL(saveSchemeRequested(const QString &)),this,SLOT(saveScheme(const QString &)));
    connect(displayList_,SIGNAL(loadSchemeRequested(const QString &)),this,SLOT(loadScheme(const QString &)));

}
Exemplo n.º 4
0
OutputPaneManager::OutputPaneManager(QWidget *parent) :
    QWidget(parent),
    m_titleLabel(new QLabel),
    m_manageButton(new OutputPaneManageButton),
    m_closeButton(new QToolButton),
    m_minMaxAction(0),
    m_minMaxButton(new QToolButton),
    m_nextAction(0),
    m_prevAction(0),
    m_outputWidgetPane(new QStackedWidget),
    m_opToolBarWidgets(new QStackedWidget),
    m_minimizeIcon(QLatin1String(":/core/images/arrowdown.png")),
    m_maximizeIcon(QLatin1String(":/core/images/arrowup.png")),
    m_maximised(false),
    m_outputPaneHeight(0)
{
    setWindowTitle(tr("Output"));

    m_titleLabel->setContentsMargins(5, 0, 5, 0);

    m_clearAction = new QAction(this);
    m_clearAction->setIcon(QIcon(QLatin1String(Constants::ICON_CLEAN_PANE)));
    m_clearAction->setText(tr("Clear"));
    connect(m_clearAction, SIGNAL(triggered()), this, SLOT(clearPage()));

    m_nextAction = new QAction(this);
    m_nextAction->setIcon(QIcon(QLatin1String(Constants::ICON_NEXT)));
    m_nextAction->setText(tr("Next Item"));
    connect(m_nextAction, SIGNAL(triggered()), this, SLOT(slotNext()));

    m_prevAction = new QAction(this);
    m_prevAction->setIcon(QIcon(QLatin1String(Constants::ICON_PREV)));
    m_prevAction->setText(tr("Previous Item"));
    connect(m_prevAction, SIGNAL(triggered()), this, SLOT(slotPrev()));

    m_minMaxAction = new QAction(this);
    m_minMaxAction->setIcon(m_maximizeIcon);
    m_minMaxAction->setText(tr("Maximize Output Pane"));

    m_closeButton->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE_DOCUMENT)));
    connect(m_closeButton, SIGNAL(clicked()), this, SLOT(slotHide()));

    connect(ICore::instance(), SIGNAL(saveSettingsRequested()), this, SLOT(saveSettings()));

    QVBoxLayout *mainlayout = new QVBoxLayout;
    mainlayout->setSpacing(0);
    mainlayout->setMargin(0);
    m_toolBar = new Utils::StyledBar;
    QHBoxLayout *toolLayout = new QHBoxLayout(m_toolBar);
    toolLayout->setMargin(0);
    toolLayout->setSpacing(0);
    toolLayout->addWidget(m_titleLabel);
    toolLayout->addWidget(new Utils::StyledSeparator);
    m_clearButton = new QToolButton;
    toolLayout->addWidget(m_clearButton);
    m_prevToolButton = new QToolButton;
    toolLayout->addWidget(m_prevToolButton);
    m_nextToolButton = new QToolButton;
    toolLayout->addWidget(m_nextToolButton);
    toolLayout->addWidget(m_opToolBarWidgets);
    toolLayout->addWidget(m_minMaxButton);
    toolLayout->addWidget(m_closeButton);
    mainlayout->addWidget(m_toolBar);
    mainlayout->addWidget(m_outputWidgetPane, 10);
    mainlayout->addWidget(new Core::FindToolBarPlaceHolder(this));
    setLayout(mainlayout);

    m_buttonsWidget = new QWidget;
    m_buttonsWidget->setLayout(new QHBoxLayout);
    m_buttonsWidget->layout()->setContentsMargins(5,0,0,0);
    m_buttonsWidget->layout()->setSpacing(4);
}
Exemplo n.º 5
0
QmlConsolePane::QmlConsolePane(QObject *parent)
    : Core::IOutputPane(parent)
{
    m_consoleWidget = new QWidget;
    m_consoleWidget->setWindowTitle(displayName());
    m_consoleWidget->setEnabled(true);

    QVBoxLayout *vbox = new QVBoxLayout(m_consoleWidget);
    vbox->setMargin(0);
    vbox->setSpacing(0);

    m_consoleView = new QmlConsoleView(m_consoleWidget);
    m_proxyModel = new QmlConsoleProxyModel(this);
    m_proxyModel->setSourceModel(QmlConsoleModel::qmlConsoleItemModel());
    connect(QmlConsoleModel::qmlConsoleItemModel(),
            &QmlConsoleItemModel::selectEditableRow,
            m_proxyModel,
            &QmlConsoleProxyModel::selectEditableRow);

    //Scroll to bottom when rows matching current filter settings are inserted
    //Not connecting rowsRemoved as the only way to remove rows is to clear the
    //model which will automatically reset the view.
    connect(QmlConsoleModel::qmlConsoleItemModel(), &QAbstractItemModel::rowsInserted,
            m_proxyModel, &QmlConsoleProxyModel::onRowsInserted);
    m_consoleView->setModel(m_proxyModel);

    connect(m_proxyModel,
            SIGNAL(setCurrentIndex(QModelIndex,QItemSelectionModel::SelectionFlags)),
            m_consoleView->selectionModel(),
            SLOT(setCurrentIndex(QModelIndex,QItemSelectionModel::SelectionFlags)));
    connect(m_proxyModel, &QmlConsoleProxyModel::scrollToBottom,
            m_consoleView, &QmlConsoleView::onScrollToBottom);

    m_itemDelegate = new QmlConsoleItemDelegate(this);
    connect(m_consoleView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
            m_itemDelegate, SLOT(currentChanged(QModelIndex,QModelIndex)));
    m_consoleView->setItemDelegate(m_itemDelegate);

    Aggregation::Aggregate *aggregate = new Aggregation::Aggregate();
    aggregate->add(m_consoleView);
    aggregate->add(new Core::ItemViewFind(m_consoleView));

    vbox->addWidget(m_consoleView);
    vbox->addWidget(new Core::FindToolBarPlaceHolder(m_consoleWidget));

    m_showDebugButton = new QToolButton(m_consoleWidget);
    m_showDebugButton->setAutoRaise(true);

    m_showDebugButtonAction = new Utils::SavedAction(this);
    m_showDebugButtonAction->setDefaultValue(true);
    m_showDebugButtonAction->setSettingsKey(QLatin1String(CONSOLE), QLatin1String(SHOW_LOG));
    m_showDebugButtonAction->setToolTip(tr("Show debug, log, and info messages."));
    m_showDebugButtonAction->setCheckable(true);
    m_showDebugButtonAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_INFO)));
    connect(m_showDebugButtonAction, &Utils::SavedAction::toggled,
            m_proxyModel, &QmlConsoleProxyModel::setShowLogs);
    m_showDebugButton->setDefaultAction(m_showDebugButtonAction);

    m_showWarningButton = new QToolButton(m_consoleWidget);
    m_showWarningButton->setAutoRaise(true);

    m_showWarningButtonAction = new Utils::SavedAction(this);
    m_showWarningButtonAction->setDefaultValue(true);
    m_showWarningButtonAction->setSettingsKey(QLatin1String(CONSOLE), QLatin1String(SHOW_WARNING));
    m_showWarningButtonAction->setToolTip(tr("Show warning messages."));
    m_showWarningButtonAction->setCheckable(true);
    m_showWarningButtonAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_WARNING)));
    connect(m_showWarningButtonAction, &Utils::SavedAction::toggled,
            m_proxyModel, &QmlConsoleProxyModel::setShowWarnings);
    m_showWarningButton->setDefaultAction(m_showWarningButtonAction);

    m_showErrorButton = new QToolButton(m_consoleWidget);
    m_showErrorButton->setAutoRaise(true);

    m_showErrorButtonAction = new Utils::SavedAction(this);
    m_showErrorButtonAction->setDefaultValue(true);
    m_showErrorButtonAction->setSettingsKey(QLatin1String(CONSOLE), QLatin1String(SHOW_ERROR));
    m_showErrorButtonAction->setToolTip(tr("Show error messages."));
    m_showErrorButtonAction->setCheckable(true);
    m_showErrorButtonAction->setIcon(QIcon(QLatin1String(Core::Constants::ICON_ERROR)));
    connect(m_showErrorButtonAction, &Utils::SavedAction::toggled, m_proxyModel, &QmlConsoleProxyModel::setShowErrors);
    m_showErrorButton->setDefaultAction(m_showErrorButtonAction);

    m_spacer = new QWidget(m_consoleWidget);
    m_spacer->setMinimumWidth(30);

    m_statusLabel = new QLabel(m_consoleWidget);

    readSettings();
    connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()), SLOT(writeSettings()));
}