Пример #1
0
Allocations::Allocations(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Allocations)
{
    ui->setupUi(this);
    ui->dateEdit->setDateTime(QDateTime::currentDateTime());

    setEditMode(false);
    setAllocationId(0);
    setItemId(0);

    ui->buttonBox->button(QDialogButtonBox::Save)->setEnabled(false);

    items_model = 0;
    locations_model = 0;
    operators_model = 0;
    logger = 0;

    loadItems();
    loadLocations();
    loadOperators();

    ui->to_operator_comboBox->completer()->setCompletionMode(QCompleter::PopupCompletion);
    ui->to_location_comboBox->completer()->setCompletionMode(QCompleter::PopupCompletion);

    connect(ui->filter_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(setItemsFilter(QString)));
}
Пример #2
0
void Program::initialize()
{
	m_id = glCreateProgram();
	glAttachShader(m_id, m_vertexShader->getShader());
	glAttachShader(m_id, m_fragmentShader->getShader());

	GLint linked = GL_FALSE;
	glLinkProgram(m_id);
	glGetProgramiv(m_id, GL_LINK_STATUS, &linked);
	if (GL_FALSE == linked)
	{
		GLint infoLen = 0;
		glGetProgramiv(m_id, GL_INFO_LOG_LENGTH, &infoLen);
		if (infoLen > 1)
		{
			char* infoLog = new char[infoLen];
			glGetProgramInfoLog(m_id, infoLen, null, infoLog);
			Log("Linking has failed. log: %s\n", infoLog);
			delete [] infoLog;
		}
		assert(0);
	}

	loadLocations();
}
Пример #3
0
// Close window
void AdminAccomLocations::closeEvent(QCloseEvent *) {

	// Reload data set if it hasn't been saved successfully
	if(!everythingIsOkay)
		loadLocations(dbData->getAccommodationLocations());

}
Пример #4
0
static void createCcdsGene(struct sqlConnection *conn, char *ccdsGeneFile,
                           struct genomeInfo *genome, struct hash* ignoreTbl,
                           struct hash *gotCcds)
/* create the ccdsGene tab file from the ccds database */
{
struct ccdsLocationsJoin *locs = loadLocations(conn, genome, ignoreTbl, gotCcds);
struct genePred *gp, *genes = buildCcdsGene(&locs);
FILE *genesFh;

genesFh = mustOpen(ccdsGeneFile, "w");
for (gp = genes; gp != NULL; gp = gp->next)
    {
    if (loadDb)
        fprintf(genesFh, "%d\t", binFromRange(gp->txStart, gp->txEnd));
    genePredTabOut(gp, genesFh);
    }
carefulClose(&genesFh);
genePredFreeList(&genes);
}
Пример #5
0
Program::Program(bool useNormals/*=false*/, 
				bool useColors/*=false*/, 
				bool useTextures/*=false*/) {
	needsNormals = useNormals;
	needsColors = useColors;
	needsTextures = useTextures;
    light=NULL;
    view=NULL;
    projection=NULL;
	if (compileShaders()) {
		//continue to find locations necessary
        if(loadLocations()) {
        	//success, what else do we need to do?
        } else {
        	std::cerr<<"Failed to locate value in program."<<std::endl;
			exit(EXIT_FAILURE);
        }
	} else {
		//error
		std::cerr<<"Failed to compile shaders for program."<<std::endl;
		exit(EXIT_FAILURE);
	}
}
Пример #6
0
void ImportNotes::setTabIndex(int index_)
{
	tabIndex=index_;
	loadLocations();
	exec();
}
Пример #7
0
void ImportNotes::loadDetails()
{
	loadLocations();
	txtSearch_textChanged(ui.txtSearch->text());
}
Пример #8
0
AdminAccomLocations::AdminAccomLocations(QCA::SecureArray pwOffice, QWidget *parent) : QDialog(parent) {

	this->setWindowTitle("Accommodation Locations");
	this->setMinimumSize(400,300);

	tabs = new QTabWidget;

	QScrollArea *scrollAreaBNB = new QScrollArea;
	scrollAreaBNB->setObjectName("bnb");
	QWidget *scrollBNB = new QWidget;
	scrollAreaBNB->setWidget(scrollBNB);
	scrollAreaBNB->setWidgetResizable(true);
	layBNB = new QVBoxLayout;
	scrollBNB->setLayout(layBNB);
	layBNB->addStretch();


	QScrollArea *scrollAreaHOSTEL = new QScrollArea;
	scrollAreaHOSTEL->setObjectName("hostel");
	QWidget *scrollHOSTEL = new QWidget;
	scrollAreaHOSTEL->setWidget(scrollHOSTEL);
	scrollAreaHOSTEL->setWidgetResizable(true);
	layHOSTEL = new QVBoxLayout;
	scrollHOSTEL->setLayout(layHOSTEL);
	layHOSTEL->addStretch();


	allItemsBNB.clear();
	allDelsBNB.clear();
	allItemsHOSTEL.clear();
	allDelsHOSTEL.clear();


	tabs->addTab(scrollAreaBNB,"Bed and Breakfast");
	tabs->addTab(scrollAreaHOSTEL,"Hostel");


	err = new Errors;
	dbData = new ConfigData(pwOffice,QStringList() << "accommodationlocations");
	loadLocations(dbData->getAccommodationLocations());
	connect(dbData, SIGNAL(changeAccommodationLocations(QMultiMap<QString,SaverDbAccomLocations>)), this, SLOT(loadLocations(QMultiMap<QString,SaverDbAccomLocations>)));



	addNew = new QPushButton("Add New Location");
	save = new QPushButton("Save Locations");
	cancel = new QPushButton("Cancel");
	addNew->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 10px;");
	save->setStyleSheet("font-weight: bold; font-size: 10pt; padding: 10px;");
	cancel->setStyleSheet("font-size: 10pt; padding: 10px;");
	QHBoxLayout *butLay = new QHBoxLayout;
	butLay->addWidget(addNew);
	butLay->addStretch();
	butLay->addWidget(save);
	butLay->addWidget(cancel);
	connect(save, SIGNAL(clicked()), this, SLOT(saveData()));
	connect(addNew, SIGNAL(clicked()), this, SLOT(addNewItem()));
	connect(cancel, SIGNAL(clicked()), this, SLOT(close()));


	QLabel *title = new QLabel("<center><h2>Adjust Accommodation Locations</h2></center>");
	title->setWordWrap(true);


	QVBoxLayout *lay = new QVBoxLayout;
	lay->addSpacing(10);
	lay->addWidget(title);
	lay->addSpacing(10);
	lay->addWidget(tabs);
	lay->addLayout(butLay);

	this->setLayout(lay);

}