Пример #1
0
void GenericLayout::resize( int width, int height )
{
    // Update the window size
    m_width = width;
    m_height = height;

    // Recreate a new image
    if( m_pImage )
    {
        delete m_pImage;
        OSFactory *pOsFactory = OSFactory::instance( getIntf() );
        m_pImage = pOsFactory->createOSGraphics( width, height );
    }

    // Notify all the controls that the size has changed and redraw them
    list<LayeredControl>::const_iterator iter;
    for( iter = m_controlList.begin(); iter != m_controlList.end(); iter++ )
    {
        iter->m_pControl->onResize();
    }

    // Resize and refresh the associated window
    TopWindow *pWindow = getWindow();
    if( pWindow )
    {
        // Resize the window
        pWindow->resize( width, height );
        refreshAll();
        // Change the shape of the window and redraw it
        pWindow->updateShape();
        refreshAll();
    }
}
Пример #2
0
	void RadioManager::HandleWokeUp ()
	{
		if (XmlSettingsManager::Instance ().property ("RefreshRadioOnWakeup").toBool ())
			QTimer::singleShot (15000,
					this,
					SLOT (refreshAll ()));
	}
Пример #3
0
ImportsWidget::ImportsWidget(MainWindow *main, QAction *action) :
    CutterDockWidget(main, action),
    ui(new Ui::ImportsWidget),
    importsModel(new ImportsModel(&imports, this)),
    importsProxyModel(new ImportsProxyModel(importsModel, this))
{
    ui->setupUi(this);

    ui->importsTreeView->setModel(importsProxyModel);
    ui->importsTreeView->sortByColumn(ImportsModel::NameColumn, Qt::AscendingOrder);

    // Ctrl-F to show/hide the filter entry
    QShortcut *searchShortcut = new QShortcut(QKeySequence::Find, this);
    connect(searchShortcut, &QShortcut::activated, ui->quickFilterView, &QuickFilterView::showFilter);
    searchShortcut->setContext(Qt::WidgetWithChildrenShortcut);

    // Esc to clear the filter entry
    QShortcut *clearShortcut = new QShortcut(QKeySequence(Qt::Key_Escape), this);
    connect(clearShortcut, &QShortcut::activated, ui->quickFilterView, &QuickFilterView::clearFilter);
    clearShortcut->setContext(Qt::WidgetWithChildrenShortcut);

    connect(ui->quickFilterView, SIGNAL(filterTextChanged(const QString &)),
            importsProxyModel, SLOT(setFilterWildcard(const QString &)));
    connect(ui->quickFilterView, SIGNAL(filterClosed()), ui->importsTreeView, SLOT(setFocus()));

    setScrollMode();

    connect(Core(), SIGNAL(refreshAll()), this, SLOT(refreshImports()));
}
Пример #4
0
void OSGridView::showEvent(QShowEvent * event)
{
  m_gridController->connectToModel();
  refreshAll();

  QWidget::showEvent(event);
}
Пример #5
0
//generates a fruit at a random location in the game
Bodypart *generateFruit( struct game *gm, int dimy, int dimx )
{	
	refreshAll( gm );
	gm->fruit.x = 1+ ( rand() % (dimx-2) );
	gm->fruit.y = 1+ ( rand() % (dimy-2) );
	return &(gm->fruit);
}
Пример #6
0
void MainWindow::executeCommand(bool withClear)
{
	QString command = m_inputEdit->text();

	// A blank command is a "silent step"
	if (command == "")
	{
		m_machine->debugger().cpu().get_visible_cpu()->debug()->single_step();
		return;
	}

	// Send along the command
	m_machine->debugger().console().execute_command(command.toLocal8Bit().data(), true);

	// Add history & set the index to be the top of the stack
	addToHistory(command);

	// Clear out the text and reset the history pointer only if asked
	if (withClear)
	{
		m_inputEdit->clear();
		m_historyIndex = m_inputHistory.size();
	}

	// Refresh
	m_consoleView->viewport()->update();
	refreshAll();
}
Пример #7
0
void printWarnMsg(const char * msg) {
	wattron(wnd, COLOR_PAIR(2));
	wprintw(wnd, "Warning: ");
	wattroff(wnd, COLOR_PAIR(2));
	wprintw(wnd, "%s\n", msg);
	refreshAll();
}
Пример #8
0
void printErrorMsg(const char * msg) {
	wattron(wnd, COLOR_PAIR(1));
	wprintw(wnd, "Error: ");
	wattroff(wnd, COLOR_PAIR(1));
	wprintw(wnd, "%s\n", msg);
	refreshAll();
}
void CtrlrPanelComponentProperties::managerStateChanged (const CtrlrManager::CtrlrManagerState newState)
{
	if (newState == CtrlrManager::PanelsLoaded)
	{
		refreshAll();
	}
}
Пример #10
0
void tdRenderer::setExtensionsFlags(int flags)
{
    sd_markdown_free(m_markdown);
    m_ext = flags;
    m_markdown = sd_markdown_new(m_ext, 16, &m_callbacks, &m_options);
    refreshAll();
    emit rendererSettingsChanged();
}
// Checked: 2010-04-18 (RLVa-1.3.1c) | Modified: RLVa-1.2.0e
void RlvFloaterBehaviours::onAvatarNameLookup(const LLUUID& idAgent, const LLAvatarName& avName)
{
	uuid_vec_t::iterator itLookup = std::find(m_PendingLookup.begin(), m_PendingLookup.end(), idAgent);
	if (itLookup != m_PendingLookup.end())
		m_PendingLookup.erase(itLookup);
	if (getVisible())
		refreshAll();
}
// <FS:PP> FIRE-5646: Option to show only active gestures
void LLFloaterGesture::refreshForActiveSort()
{
	if(gSavedPerAccountSettings.getBOOL("FSShowOnlyActiveGestures"))
	{
		mItems.clear();
		mGestureList->deleteAllItems();
	}
	refreshAll();
}
Пример #13
0
void RlvFloaterBehaviour::onAvatarNameLookup(const LLUUID& uuid)
{
    std::map<LLUUID, boost::signals2::connection>::iterator itLookup = m_PendingLookup.find(uuid);
    if (itLookup != m_PendingLookup.end())
    {
        itLookup->second.disconnect();
        m_PendingLookup.erase(itLookup);
    }

    refreshAll();
}
Пример #14
0
void GenericLayout::onShow()
{
    m_visible = true;

    refreshAll();
    // TODO find a better way to handle the vout ?
    if( m_pVideoControl )
    {
        m_pVideoControl->setVisible( true );
    }
}
void PackageManager::refreshAll(uint delay)
{
#ifdef PACKAGEMANAGER_LOG
    qDebug() << Q_FUNC_INFO << delay;
#endif
    if (delay == 0) {
        refreshUpdate();
        refreshInstalled();
    } else {
        QTimer::singleShot(delay, this, SLOT(refreshAll()));
    }
}
Пример #16
0
void MainWindow::mountImage(bool changedTo)
{
	// The image interface index was assigned to the QAction's data memeber
	const int imageIndex = dynamic_cast<QAction*>(sender())->data().toInt();
	image_interface_iterator iter(m_machine->root_device());
	device_image_interface *img = iter.byindex(imageIndex);
	if (img == nullptr)
	{
		m_machine->debugger().console().printf("Something is wrong with the mount menu.\n");
		refreshAll();
		return;
	}

	// File dialog
	QString filename = QFileDialog::getOpenFileName(this,
													"Select an image file",
													QDir::currentPath(),
													tr("All files (*.*)"));

	if (img->load(filename.toUtf8().data()) != image_init_result::PASS)
	{
		m_machine->debugger().console().printf("Image could not be mounted.\n");
		refreshAll();
		return;
	}

	// Activate the unmount menu option
	QAction* unmountAct = sender()->parent()->findChild<QAction*>("unmount");
	unmountAct->setEnabled(true);

	// Set the mount name
	QMenu* parentMenuItem = dynamic_cast<QMenu*>(sender()->parent());
	QString baseString = parentMenuItem->title();
	baseString.truncate(baseString.lastIndexOf(QString(" : ")));
	const QString newTitle = baseString + QString(" : ") + QString(img->filename());
	parentMenuItem->setTitle(newTitle);

	m_machine->debugger().console().printf("Image %s mounted successfully.\n", filename.toUtf8().data());
	refreshAll();
}
Пример #17
0
VisualNavbar::VisualNavbar(MainWindow *main, QWidget *parent) :
    QToolBar(main),
    graphicsView(new QGraphicsView),
    cursorGraphicsItem(nullptr),
    main(main)
{
    Q_UNUSED(parent);

    setObjectName("visualNavbar");
    setWindowTitle(tr("Visual navigation bar"));
    //    setMovable(false);
    setContentsMargins(0, 0, 0, 0);
    // If line below is used, with the dark theme the paintEvent is not called
    // and the result is wrong. Something to do with overwriting the style sheet :/
    //setStyleSheet("QToolBar { border: 0px; border-bottom: 0px; border-top: 0px; border-width: 0px;}");

    /*
    QComboBox *addsCombo = new QComboBox();
    addsCombo->addItem("");
    addsCombo->addItem("Entry points");
    addsCombo->addItem("Marks");
    */
    addWidget(this->graphicsView);
    //addWidget(addsCombo);

    connect(Core(), SIGNAL(seekChanged(RVA)), this, SLOT(on_seekChanged(RVA)));
    connect(Core(), SIGNAL(refreshAll()), this, SLOT(fetchAndPaintData()));
    connect(Core(), SIGNAL(functionsChanged()), this, SLOT(updateMetadataAndPaint()));
    connect(Core(), SIGNAL(flagsChanged()), this, SLOT(updateMetadataAndPaint()));

    graphicsScene = new QGraphicsScene(this);

    const QBrush bg = QBrush(QColor(74, 74, 74));

    graphicsScene->setBackgroundBrush(bg);

    this->graphicsView->setAlignment(Qt::AlignLeft);
    this->graphicsView->setMinimumHeight(20);
    this->graphicsView->setMaximumHeight(20);
    this->graphicsView->setFrameShape(QFrame::NoFrame);
    this->graphicsView->setRenderHints(0);
    this->graphicsView->setScene(graphicsScene);
    this->graphicsView->setRenderHints(QPainter::Antialiasing);
    this->graphicsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    this->graphicsView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    // So the graphicsView doesn't intercept mouse events.
    this->graphicsView->setEnabled(false);
    this->graphicsView->setMouseTracking(true);
    setMouseTracking(true);
}
Пример #18
0
	RadioManager::RadioManager (QObject *parent)
	: QObject (parent)
	, StationsModel_ (new QStandardItemModel (this))
	, AutoRefreshTimer_ (new QTimer (this))
	{
		XmlSettingsManager::Instance ().RegisterObject ({ "AutoRefreshRadios",
					"RadioRefreshTimeout" },
				this, "handleRefreshSettingsChanged");
		handleRefreshSettingsChanged ();

		connect (AutoRefreshTimer_,
				SIGNAL (timeout ()),
				this,
				SLOT (refreshAll ()));
	}
Пример #19
0
void clearInput(void) {
	nchars = 0;
	wmove(inputWnd, 1, 0);
	whline(inputWnd, ' ', termCols);
	int chanLen = strnlen(curChannel, CHANNEL_MAX);
	if(termCols - chanLen - 64 > 0) {
		wmove(inputWnd, 1, termCols - chanLen);
		wattron(inputWnd, COLOR_PAIR(5));
		wprintw(inputWnd, "%.32s", curChannel);
	wattroff(inputWnd, COLOR_PAIR(5));
	}
	wmove(inputWnd, 1, 0);
	waddch(inputWnd, '>' | A_BOLD);
	waddch(inputWnd, ' ');
	refreshAll();
}
Пример #20
0
void OSGridView::doRefresh()
{
  std::cout << " DO REFRESH CALLED " << m_queueRequests.size() << std::endl;

  if (m_queueRequests.empty())
  {
    setEnabled(true);
    return;
  }

  bool has_add_row = false;
  bool has_remove_row = false;
  bool has_refresh_grid = false;
  bool has_refresh_all = false;

  for (const auto &r : m_queueRequests)
  {
    if (r == AddRow) has_add_row = true;
    if (r == RemoveRow) has_remove_row = true;
    if (r == RefreshGrid) has_refresh_grid = true;
    if (r == RefreshAll) has_refresh_all = true;
  }

  m_queueRequests.clear();

  //if (has_refresh_all) {
  //  refreshAll();
  //}
  //else if (has_refresh_grid) {
  //  refreshGrid(); // This now causes a crash
  //}
  //else if (has_add_row) {
  //  addRow(m_rowToAdd);
  //}
  //else if (has_remove_row) {
  //  removeRow(m_rowToRemove);
  //}
  //else {
  //  // Should never get here
  //  OS_ASSERT(false);
  //}

  refreshAll(); // TODO remove this and uncomment the block above for finer granularity refreshes
  setEnabled(true);
}
Пример #21
0
	RadioManager::RadioManager (QObject *parent)
	: QObject { parent }
	, MergeModel_ { new RadioModel { { "Station" }, this } }
	, PilesModel_ { new QStandardItemModel { this } }
	, AutoRefreshTimer_ { new QTimer { this } }
	{
		XmlSettingsManager::Instance ().RegisterObject ({ "AutoRefreshRadios",
					"RadioRefreshTimeout" },
				this, "handleRefreshSettingsChanged");
		handleRefreshSettingsChanged ();

		connect (AutoRefreshTimer_,
				SIGNAL (timeout ()),
				this,
				SLOT (refreshAll ()));

		MergeModel_->AddModel (PilesModel_);
	}
Пример #22
0
int checkBorder( struct game *gm, int dimy, int dimx, void (*hit)( int ) )
{	int i;
	int hits;	
	Snake *sn;

	for( i=0; i< (gm->no_players); i++ )
	{	if( gm->players[i].killed )
			continue;

		sn = &( gm->players[i].sn );
		if( getSnakeX( sn )<=0 || getSnakeY( sn )<=0 || getSnakeX( sn )>=dimx-1 || getSnakeY( sn )>=dimy-1 )
		{
			refreshAll( gm );
			hits++;
			(*hit)( i );
		}
	}
	return hits;
}
// Checked: 2010-03-11 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
void RlvFloaterLocks::onRlvCommand(const RlvCommand& rlvCmd, ERlvCmdRet eRet) const
{
	// Refresh on any successful @XXX=y|n command where XXX is any of the attachment or wearable locking behaviours
	if ( (RLV_RET_SUCCESS == eRet) && ((RLV_TYPE_ADD == rlvCmd.getParamType()) || (RLV_TYPE_REMOVE == rlvCmd.getParamType())) )
	{
		switch (rlvCmd.getBehaviourType())
		{
			case RLV_BHVR_DETACH:
			case RLV_BHVR_ADDATTACH:
			case RLV_BHVR_REMATTACH:
			case RLV_BHVR_ADDOUTFIT:
			case RLV_BHVR_REMOUTFIT:
				refreshAll();
				break;
			default:
				break;
		}
	}
}
Пример #24
0
void GenericLayout::onControlUpdate( const CtrlGeneric &rCtrl,
                                     int width, int height,
                                     int xOffSet, int yOffSet )
{
    // The size is not valid, refresh the whole layout
    if( width <= 0 || height <= 0 )
    {
        refreshAll();
        return;
    }

    const Position *pPos = rCtrl.getPosition();
    if( pPos )
    {
        refreshRect( pPos->getLeft() + xOffSet,
                     pPos->getTop() + yOffSet,
                     width, height );
    }
}
Пример #25
0
void VBoxSnapshotsWgt::setMachine (const CMachine &aMachine)
{
    mMachine = aMachine;

    if (aMachine.isNull())
    {
        mMachineId = QString::null;
        mSessionState = KSessionState_Null;
        m_fShapshotOperationsAllowed = false;
    }
    else
    {
        mMachineId = aMachine.GetId();
        mSessionState = aMachine.GetSessionState();
        m_fShapshotOperationsAllowed = vboxGlobal().shouldWeAllowSnapshotOperations(mMachine);
    }

    refreshAll();
}
Пример #26
0
void MainWindow::unmountImage(bool changedTo)
{
	// The image interface index was assigned to the QAction's data memeber
	const int imageIndex = dynamic_cast<QAction*>(sender())->data().toInt();
	image_interface_iterator iter(m_machine->root_device());
	device_image_interface *img = iter.byindex(imageIndex);

	img->unload();

	// Deactivate the unmount menu option
	dynamic_cast<QAction*>(sender())->setEnabled(false);

	// Set the mount name
	QMenu* parentMenuItem = dynamic_cast<QMenu*>(sender()->parent());
	QString baseString = parentMenuItem->title();
	baseString.truncate(baseString.lastIndexOf(QString(" : ")));
	const QString newTitle = baseString + QString(" : ") + QString("[empty slot]");
	parentMenuItem->setTitle(newTitle);

	m_machine->debugger().console().printf("Image successfully unmounted.\n");
	refreshAll();
}
Пример #27
0
void DasmWindow::toggleBreakpointAtCursor(bool changedTo)
{
	if (m_dasmView->view()->cursor_visible())
	{
		if (debug_cpu_get_visible_cpu(*m_machine) == m_dasmView->view()->source()->device())
		{
			offs_t address = downcast<debug_view_disasm *>(m_dasmView->view())->selected_address();
			device_debug *cpuinfo = m_dasmView->view()->source()->device()->debug();

			// Find an existing breakpoint at this address
			INT32 bpindex = -1;
			for (device_debug::breakpoint* bp = cpuinfo->breakpoint_first();
					bp != NULL;
					bp = bp->next())
			{
				if (address == bp->address())
				{
					bpindex = bp->index();
					break;
				}
			}

			// If none exists, add a new one
			astring command;
			if (bpindex == -1)
			{
				command.printf("bpset 0x%X", address);
			}
			else
			{
				command.printf("bpclear 0x%X", bpindex);
			}
			debug_console_execute_command(*m_machine, command, 1);
		}
	}

	refreshAll();
}
Пример #28
0
void DasmWindow::toggleBreakpointAtCursor(bool changedTo)
{
	if (m_dasmView->view()->cursor_visible())
	{
		offs_t const address = downcast<debug_view_disasm *>(m_dasmView->view())->selected_address();
		device_t *const device = m_dasmView->view()->source()->device();
		device_debug *const cpuinfo = device->debug();

		// Find an existing breakpoint at this address
		int32_t bpindex = -1;
		for (device_debug::breakpoint* bp = cpuinfo->breakpoint_first();
				bp != nullptr;
				bp = bp->next())
		{
			if (address == bp->address())
			{
				bpindex = bp->index();
				break;
			}
		}

		// If none exists, add a new one
		if (bpindex == -1)
		{
			bpindex = cpuinfo->breakpoint_set(address, nullptr, nullptr);
			m_machine->debugger().console().printf("Breakpoint %X set\n", bpindex);
		}
		else
		{
			cpuinfo->breakpoint_clear(bpindex);
			m_machine->debugger().console().printf("Breakpoint %X cleared\n", bpindex);
		}
		m_machine->debug_view().update_all();
		m_machine->debugger().refresh_display();
	}

	refreshAll();
}
Пример #29
0
void MainWindow::enableBreakpointAtCursor(bool changedTo)
{
	debug_view_disasm *const dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view());
	if (dasmView->cursor_visible() && (m_machine->debugger().cpu().get_visible_cpu() == dasmView->source()->device()))
	{
		offs_t const address = dasmView->selected_address();
		device_debug *const cpuinfo = dasmView->source()->device()->debug();

		// Find an existing breakpoint at this address
		device_debug::breakpoint* bp = cpuinfo->breakpoint_first();
		while ((bp != nullptr) && (bp->address() != address))
			bp = bp->next();

		if (bp != nullptr)
		{
			INT32 const bpindex = bp->index();
			std::string command = string_format(bp->enabled() ? "bpdisable 0x%X" : "bpenable 0x%X", bpindex);
			m_machine->debugger().console().execute_command(command.c_str(), true);
		}
	}

	refreshAll();
}
Пример #30
0
CommentsWidget::CommentsWidget(MainWindow *main, QAction *action) :
    CutterDockWidget(main, action),
    ui(new Ui::CommentsWidget),
    main(main)
{
    ui->setupUi(this);

    commentsModel = new CommentsModel(&comments, &nestedComments, this);
    commentsProxyModel = new CommentsProxyModel(commentsModel, this);
    ui->commentsTreeView->setModel(commentsProxyModel);
    ui->commentsTreeView->sortByColumn(CommentsModel::CommentColumn, Qt::AscendingOrder);

    // Ctrl-F to show/hide the filter entry
    QShortcut *searchShortcut = new QShortcut(QKeySequence::Find, this);
    connect(searchShortcut, &QShortcut::activated, ui->quickFilterView, &QuickFilterView::showFilter);
    searchShortcut->setContext(Qt::WidgetWithChildrenShortcut);

    // Esc to clear the filter entry
    QShortcut *clearShortcut = new QShortcut(QKeySequence(Qt::Key_Escape), this);
    connect(clearShortcut, &QShortcut::activated, ui->quickFilterView, &QuickFilterView::clearFilter);
    clearShortcut->setContext(Qt::WidgetWithChildrenShortcut);

    connect(ui->quickFilterView, SIGNAL(filterTextChanged(const QString &)),
            commentsProxyModel, SLOT(setFilterWildcard(const QString &)));
    connect(ui->quickFilterView, SIGNAL(filterClosed()), ui->commentsTreeView, SLOT(setFocus()));

    setScrollMode();

    ui->actionHorizontal->setChecked(true);
    this->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this, SIGNAL(customContextMenuRequested(const QPoint &)),
            this, SLOT(showTitleContextMenu(const QPoint &)));

    connect(Core(), SIGNAL(commentsChanged()), this, SLOT(refreshTree()));
    connect(Core(), SIGNAL(refreshAll()), this, SLOT(refreshTree()));
}