EditStudiesInfosWidget::EditStudiesInfosWidget(const LinQedInClient* cl,QWidget* parent):EditInfosWidget(parent,
                                                                                                    tr("Modifica informazioni di studio"),
                                                                                                    cl){
    setAttribute(Qt::WA_DeleteOnClose);
    try{
        infos=dynamic_cast<const Studies*>(&getProfile().getInformationsBySectionName(Studies::getIDString()));
    }catch(const NoInfoException&){infos=0;}
    formWidget=new QFrame;
    form=new QFormLayout;
    highSchool=new QLineEdit; qualification=new QLineEdit;
    connect(highSchool,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    connect(qualification,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    form->addRow(tr("Scuola Superiore: "),highSchool); form->setAlignment(highSchool,Qt::AlignCenter);
    form->addRow(tr("Qualificazione Professionale: "),qualification); form->setAlignment(qualification,Qt::AlignCenter);
    initDegrees();

    noDegree=new QLabel(noDegreeS);
    noDegree->setStyleSheet(GUIStyle::errorLabelStyle());
    form->addWidget(noDegree); form->setAlignment(noDegree,Qt::AlignCenter);

    addDegree=new QPushButton(tr("Aggiungi Laurea"));
    addDegree->setCursor(QCursor(Qt::PointingHandCursor));
    form->addWidget(addDegree); form->setAlignment(addDegree,Qt::AlignCenter);
    connect(addDegree,SIGNAL(clicked()),this,SLOT(addRow()));

    formWidget->setLayout(form);
    addWidgetToMainLayout(formWidget,Qt::AlignCenter);
    initButtons();
    formWidget->setObjectName("form");
    formWidget->setStyleSheet("#form{"+GUIStyle::borderStyle()+"padding-left:10px;padding-top:10px;}");
    writeDefaultValues();
}//EditStudiesInfosWidget
EditPersonalInfosWidget::EditPersonalInfosWidget(QWidget* parent,const LinQedInClient* cl):EditInfosWidget(parent,
                                                                                                    tr("Modifica informazioni personali"),
                                                                                                    cl),
    infos(getProfile().getPersonalInformations()){
    setAttribute(Qt::WA_DeleteOnClose,true);
    formWidget=new QWidget;
    infosLayout=new QFormLayout;
    name=new QLineEdit; surname=new QLineEdit; birthplace=new QLineEdit; birthState=new QLineEdit;
    connect(name,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    connect(surname,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    connect(birthplace,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    connect(birthState,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    infosLayout->addRow(tr("Nome: "),name); infosLayout->setAlignment(name,Qt::AlignCenter);
    infosLayout->addRow(tr("Cognome: "),surname); infosLayout->setAlignment(surname,Qt::AlignCenter);
    infosLayout->addRow(tr("Luogo di Nascita: "),birthplace); infosLayout->setAlignment(birthplace,Qt::AlignCenter);
    infosLayout->addRow(tr("Paese di Nascita: "),birthState); infosLayout->setAlignment(birthState,Qt::AlignCenter);
    initRadioButtons();
    infosLayout->addRow(tr("Sesso: "),genderBox); infosLayout->setAlignment(genderBox,Qt::AlignCenter);
    calendar=new QCalendarWidget;
    calendar->setGridVisible(true);
    calendar->setMinimumDate(QDate(1950,1,1));
    calendar->setMaximumDate(QDate::currentDate().addYears(-16)); //dai 16 anni in su
    calendar->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader);
    infosLayout->addRow(tr("Data di Nascita"),calendar);
    formWidget->setObjectName("form");
    formWidget->setStyleSheet("#form{"+GUIStyle::borderStyle()+"}");
    formWidget->setContentsMargins(10,10,10,10);
    formWidget->setLayout(infosLayout);
    addWidgetToMainLayout(formWidget,Qt::AlignCenter);
    initButtons();

    writeDefaultValues();
}//EditPersonalInfosWidget
示例#3
0
SessionViewlet::SessionViewlet(QMainWindow *mainWindow, QObject *parent):
    QObject(parent)
{
    QMenu *sessionMenu = synthclone::getChild<QMenu>(mainWindow, "sessionMenu");

    loadAction = synthclone::getChild<QAction>(mainWindow, "loadSessionAction");
    connect(loadAction, SIGNAL(triggered()), SIGNAL(loadRequest()));

    quitAction = synthclone::getChild<QAction>(mainWindow, "quitSessionAction");
    connect(quitAction, SIGNAL(triggered()), SIGNAL(quitRequest()));

    saveAction = synthclone::getChild<QAction>(mainWindow, "saveSessionAction");
    connect(saveAction, SIGNAL(triggered()), SIGNAL(saveRequest()));

    saveAsAction = synthclone::getChild<QAction>(mainWindow,
                                                 "saveSessionAsAction");
    connect(saveAsAction, SIGNAL(triggered()), SIGNAL(saveAsRequest()));

    // Hack: Optimally, we'd like to give an object name to the separator we
    // want to retrieve from the QtDesigner file.  Unfortunately, QtDesigner
    // doesn't allow the naming of QAction items that are separators (they all
    // have to be named 'separator').  So, we have to add the separator here.
    customItemsSeparator = new QAction(this);
    customItemsSeparator->setSeparator(true);
    sessionMenu->insertAction(quitAction, customItemsSeparator);

    menuViewlet = new MenuViewlet(sessionMenu, customItemsSeparator, this);
}
示例#4
0
void PlasmaApp::handleSigHup()
{
    snHup->setEnabled(false);
    char tmp;
    ::read(sighupFd[1], &tmp, sizeof(tmp));

    emit saveRequest();

    snHup->setEnabled(true);
}
void FixtureControlWidget::savePressed()
{
    QString filename = QFileDialog::getSaveFileName(
        this,
        "SAVE: Choose an camera config name",
        ".",
        "Text (*.json)"
    );
    if (!filename.isEmpty()) {
        emit saveRequest(filename);
    }
}
示例#6
0
bool SaveAllSuspects(std::string file)
{
	Ticket ticket = MessageManager::Instance().StartConversation(IPCSocketFD);

	ControlMessage saveRequest(CONTROL_SAVE_SUSPECTS_REQUEST);
	strcpy(saveRequest.m_filePath, file.c_str());

	if(!MessageManager::Instance().WriteMessage(ticket, &saveRequest))
	{
		LOG(ERROR, "Error sending command to NOVAD (CONTROL_SAVE_SUSPECTS_REQUEST)", "");
		return false;
	}

	Message *reply = MessageManager::Instance().ReadMessage(ticket, IPCSocketFD);
	if(reply->m_messageType == ERROR_MESSAGE && ((ErrorMessage*)reply)->m_errorType == ERROR_TIMEOUT)
	{
		LOG(ERROR, "Timeout error when waiting for message reply", "");
		reply->DeleteContents();
		delete reply;
		return false;
	}
	if(reply->m_messageType != CONTROL_MESSAGE )
	{
		LOG(ERROR, "Received the wrong kind of reply message", "");
		reply->DeleteContents();
		delete reply;
		return false;
	}

	ControlMessage *saveReply = (ControlMessage*)reply;
	if( saveReply->m_controlType != CONTROL_SAVE_SUSPECTS_REPLY )
	{
		LOG(ERROR, "Received the wrong kind of control message", "");
		saveReply->DeleteContents();
		delete saveReply;
		return false;
	}
	bool retSuccess = saveReply->m_success;
	delete saveReply;
	return retSuccess;
}
示例#7
0
bool SaveAllSuspects(std::string file)
{
	Lock lock = MessageManager::Instance().UseSocket(IPCSocketFD);

	ControlMessage saveRequest(CONTROL_SAVE_SUSPECTS_REQUEST, DIRECTION_TO_NOVAD);
	strcpy(saveRequest.m_filePath, file.c_str());

	if(!Message::WriteMessage(&saveRequest, IPCSocketFD) )
	{
		//There was an error in sending the message
		//TODO: Log this fact
		return false;
	}

	Message *reply = Message::ReadMessage(IPCSocketFD, DIRECTION_TO_NOVAD);
	if(reply->m_messageType == ERROR_MESSAGE && ((ErrorMessage*)reply)->m_errorType == ERROR_TIMEOUT)
	{
		LOG(ERROR, "Timeout error when waiting for message reply", "");
		delete ((ErrorMessage*)reply);
		return false;
	}
	if(reply->m_messageType != CONTROL_MESSAGE )
	{
		//Received the wrong kind of message
		delete reply;
		return false;
	}

	ControlMessage *saveReply = (ControlMessage*)reply;
	if( saveReply->m_controlType != CONTROL_SAVE_SUSPECTS_REPLY )
	{
		//Received the wrong kind of control message
		delete saveReply;
		return false;
	}
	bool retSuccess = saveReply->m_success;
	delete saveReply;
	return retSuccess;
}
示例#8
0
 void saveRequest(unsigned id, const string &path) { return bind->saveRequest(id, path); }
示例#9
0
void Interface::save() {
  for(auto& memory : cartridge.memory) {
    saveRequest(memory.id, memory.name);
  }
}
示例#10
0
void BinarySettingsDialog::close()
{
    if (isVisible())
        hide();
    emit saveRequest();
}