bool DbStructureModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int, int, const QModelIndex&)
{
    if(action == Qt::IgnoreAction)
        return true;

    if(!data->hasFormat("text/plain"))
        return false;

    if(data->property("db_file") == m_db->curDBFilename)
        return false;

    // Get data
    QByteArray d = data->data("text/plain");

    // Try to execute the SQL statement
    if(m_db->executeMultiSQL(d, true, true))
    {
        m_db->updateSchema();
        reloadData(m_db);
        return true;
    } else {
        QMessageBox::warning(0, QApplication::applicationName(), m_db->lastErrorMessage);
        return false;
    }
}
ParameterSphere::ParameterSphere(std::tr1::shared_ptr<Object> object) : ParameterObject(object)
{
	QGroupBox * b = new QGroupBox(this);
	QGridLayout * g = new QGridLayout(b);
	b->setTitle(tr("Sphere"));
	b->setLayout(g);
	g->addWidget(new QLabel(tr("Radius:")), 0, 0);
	g->addWidget(new QLabel(tr("Slices:")), 1, 0);
	g->addWidget(new QLabel(tr("Stacks:")), 2, 0);
	lineRadius_ = new QLineEdit();
	lineSlices_ = new QLineEdit();
	lineStacks_ = new QLineEdit();
	lineRadius_->setAlignment(Qt::AlignRight);
	lineSlices_->setAlignment(Qt::AlignRight);
	lineStacks_->setAlignment(Qt::AlignRight);
	g->addWidget(lineRadius_, 0, 2, 1, 3);
	g->addWidget(lineSlices_, 1, 2, 1, 3);
	g->addWidget(lineStacks_, 2, 2, 1, 3);
	g->setRowStretch(3, 1);
	addWidget(b);

	connect(lineRadius_, SIGNAL(editingFinished()),
			this, SLOT(radiusEdited()));
	connect(lineSlices_, SIGNAL(editingFinished()),
			this, SLOT(slicesEdited()));
	connect(lineStacks_, SIGNAL(editingFinished()),
			this, SLOT(stacksEdited()));

	if (object)
	{
		reloadData();
	}
}
ParameterPatternStereogram::ParameterPatternStereogram(std::tr1::shared_ptr<AbstractTexture> texture)
	: ParameterStereogram(texture)
{
	QGroupBox * b = new QGroupBox(this);
	QGridLayout * g = new QGridLayout(b);
	b->setTitle(tr("Pattern"));
	b->setLayout(g);
	g->addWidget(new QLabel(tr("Background:")), 0, 0);
	g->addWidget(new QLabel(tr("Foreground:")), 1, 0);
	linePathBG_ = new QLineEdit();
	linePathFG_ = new QLineEdit();
	pbBG_ = new QPushButton("...");
	pbFG_ = new QPushButton("...");
	g->addWidget(linePathBG_, 0, 2, 1, 2);
	g->addWidget(linePathFG_, 1, 2, 1, 2);
	g->addWidget(pbBG_, 0, 4);
	g->addWidget(pbFG_, 1, 4);
	g->setRowStretch(2, 1);

	addWidget(b);

	connect(linePathBG_, SIGNAL(editingFinished()),
			this, SLOT(pathBGEdited()));
	connect(linePathFG_, SIGNAL(editingFinished()),
			this, SLOT(pathFGEdited()));
	connect(pbBG_, SIGNAL(clicked()),
			this, SLOT(openBG()));
	connect(pbFG_, SIGNAL(clicked()),
			this, SLOT(openFG()));

	reloadData();
}
// pull up data is appending at the end,
// so we should set the offset whitch refreshed before
void Pull2RefreshTableView::onPullUpRefreshComplete()
{
	m_nPullActionStatus = kPull2RefreshStatusNormal;
	CCPoint offset = getContentOffset();
	reloadData();
	setContentOffset(offset);
}
void LabelPointsBySectionImageToolBoxAction::createMainCommandWidget()
{
    QVBoxLayout *vb=new QVBoxLayout();

    select = new QPushButton("Select Point");
    select->setCheckable(true);
    connect(select,SIGNAL(toggled(bool)),this,SLOT(selectionPointButtonClick(bool)));

    vb->addWidget(select);

    QHBoxLayout *hb=new QHBoxLayout();

    QPushButton *updatePB = new QPushButton("update");
    connect(updatePB,SIGNAL(clicked()),this,SLOT(updateData()));
    QPushButton *reloadPB = new QPushButton("reload");
    connect(reloadPB,SIGNAL(clicked()),this,SLOT(reloadData()));
    QPushButton *loadfilePB = new QPushButton("load file");
    connect(loadfilePB,SIGNAL(clicked()),this,SLOT(loadFileData()));
    QPushButton *savefilePB = new QPushButton("save file");
    connect(savefilePB,SIGNAL(clicked()),this,SLOT(saveFileData()));

    hb->addWidget(updatePB);
    hb->addWidget(reloadPB);
    hb->addWidget(loadfilePB);
    hb->addWidget(savefilePB);

    vb->addLayout(hb);

    QGroupBox *gb = new QGroupBox("Main Commands");

    gb->setLayout(vb);

    this->addWidget(gb);
}
示例#6
0
void CallStackView::updateCallStack()
{
    DBGCALLSTACK callstack;
    memset(&callstack, 0, sizeof(DBGCALLSTACK));
    if(!DbgFunctions()->GetCallStack)
        return;
    DbgFunctions()->GetCallStack(&callstack);
    setRowCount(callstack.total);
    for(int i = 0; i < callstack.total; i++)
    {
        QString addrText = ToPtrString(callstack.entries[i].addr);
        setCellContent(i, 0, addrText);
        addrText = ToPtrString(callstack.entries[i].to);
        setCellContent(i, 1, addrText);
        if(callstack.entries[i].from)
        {
            addrText = ToPtrString(callstack.entries[i].from);
            setCellContent(i, 2, addrText);
        }
        setCellContent(i, 3, callstack.entries[i].comment);
    }
    if(callstack.total)
        BridgeFree(callstack.entries);
    reloadData();
}
示例#7
0
void AvailableGroups::slotDeleteServer(quint16 serverId)
{
	Dbt key, data;
	memset(&key, 0, sizeof(key));
	memset(&data, 0, sizeof(data));
    Dbc *cursor = 0;
	int ret;
	groupDb->cursor(0, &cursor, DB_WRITECURSOR);

	while ((ret=cursor->get(&key, &data, DB_NEXT)) != DB_NOTFOUND)
	{
        g=new AvailableGroup((char*)data.get_data());

		g->removeServerPresence(serverId);
		//resave the group...
		const char *p=g->data();
		memset(&data, 0, sizeof(data));
		data.set_data((void*)p);
		data.set_size(g->size());
		if (g->noServerPresence())
		{
			ret=cursor->del(0);
			if (ret != 0)
				quban->getLogAlertList()->logMessage(LogAlertList::Error, tr("Cannot delete server ") + servers->value(serverId)->getHostName() + tr(" group record"));

		}
		else if ((ret=cursor->put(&key, &data, DB_CURRENT)) != 0)
			quban->getLogAlertList()->logMessage(LogAlertList::Error, tr("Cannot update group record. Error: ") + dbEnv->strerror(ret));

        Q_DELETE(p);
	}
	cursor->close();

	reloadData();
}
示例#8
0
RssParser::RssParser(QString url, QObject *parent)
	: QObject(parent)
{
	if(!url.isEmpty())
		setUrl(url);

	connect(&m_reloadTimer, SIGNAL(timeout()), this, SLOT(reloadData()));
	setUpdateTime(60);
}
示例#9
0
Resources::Resources() : _rnd(LureEngine::getReference().rnd()) {
	int_resources = this;
	reloadData();

	// Load the string list
	MemoryBlock *mb = Disk::getReference().getEntry(STRING_LIST_RESOURCE_ID);
	_stringList.load(mb);
	delete mb;
}
ParameterStereogram::ParameterStereogram(std::tr1::shared_ptr<AbstractTexture> texture)
	: ParameterAbstractTexture(texture)
{
	QGroupBox * b = new QGroupBox(this);
	QGridLayout * g = new QGridLayout(b);
	b->setTitle(tr("Stereogram"));
	b->setLayout(g);
	g->addWidget(new QLabel(tr("Depth:")), 0, 0);
	g->addWidget(new QLabel(tr("Left:")), 1, 0);
	g->addWidget(new QLabel(tr("Right:")), 2, 0);
	g->addWidget(new QLabel(tr("Offset:")), 3, 0);
	linePathDepth_ = new QLineEdit();
	linePathLeft_ = new QLineEdit();
	linePathRight_ = new QLineEdit();
	pbDepth_ = new QPushButton("...");
	pbLeft_ = new QPushButton("...");
	pbRight_ = new QPushButton("...");
	pbDepth_->resize(26, 26);
	pbLeft_->resize(26, 26);
	pbRight_->resize(26, 26);
	lineOffset_ = new QLineEdit();
	lineOffset_->setAlignment(Qt::AlignRight);
	comboStyle_ = new QComboBox(this);
	comboStyle_->addItem("Convex");
	comboStyle_->addItem("Concave");
	g->addWidget(linePathDepth_, 0, 2, 1, 2);
	g->addWidget(linePathLeft_, 1, 2, 1, 2);
	g->addWidget(linePathRight_, 2, 2, 1, 2);
	g->addWidget(pbDepth_, 0, 4);
	g->addWidget(pbLeft_, 1, 4);
	g->addWidget(pbRight_, 2, 4);
	g->addWidget(lineOffset_, 3, 2, 1, 3);
	g->addWidget(comboStyle_, 4, 2, 1, 3);
	g->setRowStretch(5, 1);

	addWidget(b);

	connect(linePathDepth_, SIGNAL(editingFinished()),
			this, SLOT(pathDepthEdited()));
	connect(linePathLeft_, SIGNAL(editingFinished()),
			this, SLOT(pathLeftEdited()));
	connect(linePathRight_, SIGNAL(editingFinished()),
			this, SLOT(pathRightEdited()));
	connect(lineOffset_, SIGNAL(editingFinished()),
			this, SLOT(offsetEdited()));
	connect(comboStyle_, SIGNAL(activated(int)),
			this, SLOT(styleActivated(int)));
	connect(pbDepth_, SIGNAL(clicked()),
			this, SLOT(openDepth()));
	connect(pbLeft_, SIGNAL(clicked()),
			this, SLOT(openLeft()));
	connect(pbRight_, SIGNAL(clicked()),
			this, SLOT(openRight()));

	reloadData();
}
示例#11
0
void Resources::reset() {
	freeData();

	_fieldList.reset();
	_barmanLists.reset();
	_talkState = TALK_NONE;
	_activeTalkData = NULL;

	reloadData();
}
void ParameterStereogram::pathRightEdited()
{
	if (texture())
	{
		std::tr1::shared_ptr<Stereogram> tex = std::tr1::dynamic_pointer_cast<Stereogram>(texture());
		if (tex && tex->texRight())
		{
			// Path
			tex->texRight()->setPath(linePathRight_->text().toStdString());
			reloadData(); // No auto reload, unlike for objects
		}
	}
}
void ParameterPatternStereogram::pathBGEdited()
{
	if (texture())
	{
		std::tr1::shared_ptr<PatternStereogram> tex = std::tr1::dynamic_pointer_cast<PatternStereogram>(texture());
		if (tex)
		{
			// Path
			tex->texBG()->setPath(linePathBG_->text().toStdString());
			tex->recreateStereogram();
			reloadData(); // No auto reload, unlike for objects
		}
	}
}
示例#14
0
bool QgsWFSProvider::setSubsetString( const QString& theSQL, bool updateFeatureCount )
{
  mSubsetString = theSQL;
  mCacheMinMaxDirty = true;

  // update URI
  mShared->mURI.setFilter( theSQL );
  setDataSourceUri( mShared->mURI.uri() );
  mShared->computeFilter();
  reloadData();
  if ( updateFeatureCount )
    featureCount();
  return true;
}
void ParameterRandomDot::excColorsEdited()
{
	if (texture())
	{
		std::tr1::shared_ptr<RandomdotStereogram> tex = std::tr1::dynamic_pointer_cast<RandomdotStereogram>(texture());
		if (tex)
		{
			bool ok;
			int i = lineExcColors_->text().toInt(&ok);
			if (ok)
			{
				tex->setExclusiveColor(i);
			}
			reloadData(); // No auto reload, unlike for objects
		}
	}
}
void DialogSearchBrand::on_queryLineEdit_textChanged(const QString &arg1){
    ui->informationResultSearch->setText("Não foi encontrado nenhuma marca  \""+arg1+"\"");
    ui->createNewBrand->setText("Cadastrar marca  \""+arg1+"\"");
    listAuxSearch->clear();

    QString query = arg1.toLower();
    std::cout<<listAuxSearch->size()<<" "<<listBrand->size()<<std::endl;

    for(std::list<npl::Brand>::iterator brand = listBrand->begin(); brand != listBrand->end(); brand++){
        npl::Brand auxBrand = (*brand);

        if(auxBrand.getDescription().toLower().contains( query )){
            listAuxSearch->push_back( auxBrand );
        }

    }
    reloadData();
}
void ParameterStereogram::offsetEdited()
{
	if (texture())
	{
		std::tr1::shared_ptr<Stereogram> tex = std::tr1::dynamic_pointer_cast<Stereogram>(texture());
		if (tex)
		{
			// Offset
			bool ok;
			int i = lineOffset_->text().toInt(&ok);
			if (ok)
			{
				tex->setOffset(i);
			}
			reloadData(); // No auto reload, unlike for objects
		}
	}
}
void ParameterStereogram::openRight()
{
	if (texture())
	{
		std::tr1::shared_ptr<Stereogram> tex = std::tr1::dynamic_pointer_cast<Stereogram>(texture());
		if (tex && tex->texRight())
		{
			// Path
			std::string p = openFileRelative("Open Right Texture");
			if (!p.empty())
			{
				tex->texRight()->setPath(p);
				tex->recreateStereogram();
				reloadData(); // No auto reload, unlike for objects
			}
		}
	}
}
示例#19
0
void CPUDisassembly::mouseDoubleClickEvent(QMouseEvent* event)
{
    if(event->button() != Qt::LeftButton)
        return;
    switch(getColumnIndexFromX(event->x()))
    {
    case 0: //address
    {
        int_t mSelectedVa = rvaToVa(getInitialSelection());
        if(mRvaDisplayEnabled && mSelectedVa == mRvaDisplayBase)
            mRvaDisplayEnabled = false;
        else
        {
            mRvaDisplayEnabled = true;
            mRvaDisplayBase = mSelectedVa;
            mRvaDisplayPageBase = getBase();
        }
        reloadData();
    }
    break;

    case 1: //opcodes
    {
        toggleInt3BPAction(); //toggle INT3 breakpoint
    }
    break;

    case 2: //disassembly
    {
        assembleAt();
    }
    break;

    case 3: //comments
    {
        setComment();
    }
    break;

    default:
        Disassembly::mouseDoubleClickEvent(event);
        break;
    }
}
示例#20
0
void CPUDisassembly::mousePressEvent(QMouseEvent* event)
{
    if(event->buttons() == Qt::MiddleButton) //copy address to clipboard
    {
        if(!DbgIsDebugging())
            return;
        MessageBeep(MB_OK);
        copyAddress();
    }
    else
    {
        Disassembly::mousePressEvent(event);
        if(mHighlightingMode) //disable highlighting mode after clicked
        {
            mHighlightingMode = false;
            reloadData();
        }
    }
}
ParameterAtmosphere::ParameterAtmosphere(std::tr1::shared_ptr<Object> object)
	: ParameterObject(object)
{
	// Create Object interface
	QGroupBox * b = new QGroupBox(this);
	QGridLayout * g = new QGridLayout(b);
	b->setTitle(tr("Atmosphere"));
	b->setLayout(g);
	g->addWidget(new QLabel(tr("Density:")), 0, 0);
	g->addWidget(new QLabel(tr("Start:")), 1, 0);
	g->addWidget(new QLabel(tr("End:")), 2, 0);
	g->addWidget(new QLabel(tr("Mode:")), 3, 0);
	lineDensity_ = new QLineEdit(this);
	lineStart_ = new QLineEdit(this);
	lineEnd_ = new QLineEdit(this);
	lineDensity_->setAlignment(Qt::AlignRight);
	lineStart_->setAlignment(Qt::AlignRight);
	lineEnd_->setAlignment(Qt::AlignRight);
	pulldownMode_ = new QComboBox(this);
	pulldownMode_->addItem("Exp");
	pulldownMode_->addItem("Exp2");
	pulldownMode_->addItem("Linear");
	g->addWidget(lineDensity_, 0, 2, 1, 3);
	g->addWidget(lineStart_, 1, 2, 1, 3);
	g->addWidget(lineEnd_, 2, 2, 1, 3);
	g->addWidget(pulldownMode_, 3, 2, 1, 3);
	g->setRowStretch(4, 1);
	addWidget(b);

	connect(lineDensity_, SIGNAL(editingFinished()),
			this, SLOT(densityEdited()));
	connect(lineStart_, SIGNAL(editingFinished()),
			this, SLOT(startEdited()));
	connect(lineEnd_, SIGNAL(editingFinished()),
			this, SLOT(endEdited()));
	connect(pulldownMode_, SIGNAL(activated(int)),
			this, SLOT(modeActivated(int)));

	if (object)
	{
		reloadData();
	}
}
/*!
 Constructs the collection data model.
 */
MpCollectionDataModel::MpCollectionDataModel( MpMpxCollectionData *data, MpPlaybackData *playbackData, QObject *parent )
    : QAbstractListModel(parent),
      mCollectionData(data),
      mPlaybackData(playbackData),
      mRowCount(0),
      mAlbumIndexOffset(0),
      mHiddenItemIndex(-1),
      mCollectionLayout(ECollectionListView)
{
    TX_ENTRY
    connect( mCollectionData, SIGNAL(contextChanged(TCollectionContext)), this, SLOT(setContext(TCollectionContext)) );
    connect( mCollectionData, SIGNAL(dataChanged()), this, SLOT(reloadData()) );
    connect( mCollectionData, SIGNAL(dataChanged(int, int)), this, SLOT(reloadData(int, int)) );
    mAlbumArtManager = new MpCollectionAlbumArtManager(mCollectionData);
    connect( mAlbumArtManager, SIGNAL(albumArtReady(int)), this, SLOT(updateAlbumArt(int)) );
    
    if ( mPlaybackData ) {         
        connect( mPlaybackData, SIGNAL(fileCorrupted(int)), 
                 this, SLOT(fileCorrupted(int)) );
    }
    TX_EXIT
}
ParameterRandomDot::ParameterRandomDot(std::tr1::shared_ptr<AbstractTexture> texture)
	: ParameterStereogram(texture)
{
	QGroupBox * b = new QGroupBox(this);
	QGridLayout * g = new QGridLayout(b);
	b->setTitle(tr("Random Dot"));
	b->setLayout(g);
	g->addWidget(new QLabel(tr("Max Colors:")), 0, 0);
	g->addWidget(new QLabel(tr("Exclusive Colors:")), 1, 0);
	lineMaxColors_ = new QLineEdit();
	lineExcColors_ = new QLineEdit();
	g->addWidget(lineMaxColors_, 0, 2, 1, 3);
	g->addWidget(lineExcColors_, 1, 2, 1, 3);
	g->setRowStretch(2, 1);

	addWidget(b);

	connect(lineMaxColors_, SIGNAL(editingFinished()),
			this, SLOT(maxColorsEdited()));
	connect(lineExcColors_, SIGNAL(editingFinished()),
			this, SLOT(excColorsEdited()));

	reloadData();
}
SchedulerDayModel::SchedulerDayModel(SchedulerModel *model, QObject *parent) : TListModel("SchedulerJobInstance", parent) {
	connect(model, SIGNAL(jobsLoaded()), this, SLOT(reloadData()));
	d = new PrivateData;
	d->model = model;
	this->reloadData();
}
示例#25
0
void ProjectionManagement::yearChanged(QString _year) {
    this->year = _year.toInt();
    reloadData();
}
示例#26
0
void ProjectionManagement::areaChanged(QString _area) {
    this->area = _area;
    reloadData();
}
void Pull2RefreshTableView::onPullDownRefreshComplete()
{
	m_nPullActionStatus = kPull2RefreshStatusNormal;
	reloadData();
}
示例#28
0
void RssParser::setUrl(const QString& url)
{
	m_url = url;
	reloadData();
}
void DialogSearchBrand::loadDataDoPersist(){
   npl::PersistBrand persistBrand ;
   listBrand = persistBrand.getListData();
   listAuxSearch = persistBrand.getListData();
   reloadData();
}
示例#30
0
void TestList::runThisTest()
{
    _cellTouchEnabled = true;
    auto director = Director::getInstance();
    auto scene = Scene::create();

    auto visibleSize = director->getVisibleSize();
    auto origin = director->getVisibleOrigin();

    auto tableView = TestCustomTableView::create(this, Size(400, visibleSize.height));
    tableView->setPosition(origin.x + (visibleSize.width - 400) / 2, origin.y);
    tableView->setDirection(ScrollView::Direction::VERTICAL);
    tableView->setVerticalFillOrder(TableView::VerticalFillOrder::TOP_DOWN);
    tableView->setDelegate(this);
    scene->addChild(tableView);
    tableView->reloadData();

    if (_shouldRestoreTableOffset)
    {
        tableView->setContentOffset(_tableOffset);
    }

    if (_parentTest)
    {
        //Add back button.
        TTFConfig ttfConfig("fonts/arial.ttf", 20);
        auto label = Label::createWithTTF(ttfConfig, "Back");

        auto menuItem = MenuItemLabel::create(label, std::bind(&TestBase::backsUpOneLevel, this));
        auto menu = Menu::create(menuItem, nullptr);

        menu->setPosition(Vec2::ZERO);
        menuItem->setPosition(Vec2(VisibleRect::right().x - 50, VisibleRect::bottom().y + 25));

        scene->addChild(menu, 1);
    }
    else
    {
        //Add close and "Start AutoTest" button.
        auto closeItem = MenuItemImage::create(s_pathClose, s_pathClose, [](Ref* sender){
            TestController::getInstance()->stopAutoTest();
            TestController::destroyInstance();
            Director::getInstance()->end();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
            exit(0);
#endif
        });
        closeItem->setPosition(VisibleRect::right().x - 30, VisibleRect::top().y - 30);

        auto autoTestLabel = Label::createWithTTF("Start AutoTest","fonts/arial.ttf",16);
        auto autoTestItem = MenuItemLabel::create(autoTestLabel, [&](Ref* sender){
            TestController::getInstance()->startAutoTest();
        });
        autoTestItem->setPosition(Vec2(VisibleRect::right().x - 70, VisibleRect::bottom().y + 25));

        auto menu = Menu::create(closeItem, autoTestItem, nullptr);
        menu->setPosition(Vec2::ZERO);
        scene->addChild(menu, 1);
    }

    director->replaceScene(scene);
}