Exemplo n.º 1
0
void
GltxList::performRefresh()
{
    Id gltx_id = currentId();
    QListViewItem* current = NULL;
    clearLists();

    vector<Gltx> gltxs;
    _quasar->db()->select(gltxs, GltxSelect());
    DateValcon dateValcon;

    for (unsigned int i = 0; i < gltxs.size(); i++) {
	Gltx& gltx = gltxs[i];

	ListViewItem* lvi = new ListViewItem(_list, gltx.id());
	lvi->setText(0, dateValcon.format(gltx.postDate()));
	lvi->setText(1, gltx.memo());

	if (gltx.id() == gltx_id)
	    current = lvi;
    }

    if (current == NULL)
	current = _list->firstChild();

    _list->setCurrentItem(current);
    _list->setSelected(current, true);
}
Exemplo n.º 2
0
void
CompanyList::performRefresh()
{
    bool showInactive = _inactive->isChecked();
    Id company_id = currentId();
    QListViewItem* current = NULL;
    clearLists();

    CompanySelect conditions;
    conditions.activeOnly = !showInactive;
    vector<Company> companies;
    _quasar->db()->select(companies, conditions);

    for (unsigned int i = 0; i < companies.size(); ++i) {
	Company& company = companies[i];

	ListViewItem* lvi = new ListViewItem(_list, company.id());
	lvi->setValue(0, company.name());
	lvi->setValue(1, company.number());
	if (showInactive) lvi->setValue(2, !company.isActive());
	if (company.id() == company_id) current = lvi;
    }

    if (current == NULL) current = _list->firstChild();

    _list->setCurrentItem(current);
    _list->setSelected(current, true);
}
Exemplo n.º 3
0
void Wizard::showHelp()
{

    QString message;

    switch (currentId())
    {
        case 0:
            message = tr("In this first page you should provide the nifti image to convert and optionally a reference DICOM header from which copy anagraphical data of the patient ");
            break;

        case 1:
            message = tr("In this page you should edit DICOM field filling proper information required for the output header. To do this simply right-click on the proper row. At the end press enter to confirm your change for the selected tag.");
            break;

        case 2:
            message = tr("In this page you would be asked for an output directory where all the dicom slices will be written to and the accession Number. All those fields are mandatory. At the right side of the page you could review the final header. Nothing has been already written to the final files so you can go back to the previous page and edit correctly the header tags");
            break;

        default:
            message = tr("This Dialog will contain information for the current step");
    }

    QMessageBox::information(this, tr("QNifti2Dicom Help dialog"), message);
}
Exemplo n.º 4
0
void
TaxList::performEdit()
{
    Id tax_id = currentId();
    TaxMaster* master = new TaxMaster(_main, tax_id);
    master->show();
}
Exemplo n.º 5
0
void
AddressBook::addToPopup(QPopupMenu* menu)
{
    ActiveList::addToPopup(menu);
    menu->insertItem(tr("Send Email"), this, SLOT(slotEmail()));

    Card card;
    if (!_quasar->db()->lookup(currentId(), card)) return;
    if (card.dataType() == DataObject::PERSONAL) return;
    if (card.dataType() == DataObject::EMPLOYEE) return;

    menu->insertItem(tr("Inquiry"), this, SLOT(slotInquiry()));
    menu->insertItem(tr("Find Tx"), this, SLOT(slotFindTx()));
    if (card.dataType() == DataObject::CUSTOMER) {
	menu->insertItem(tr("Aged List"), this, SLOT(slotAgedAR()));
	menu->insertItem(tr("Sales"), this, SLOT(slotSales()));
	menu->insertItem(tr("Payment"), this, SLOT(slotReceipt()));
	menu->insertItem(tr("Withdraw"), this, SLOT(slotWithdraw()));
	menu->insertItem(tr("Write Cheque"), this, SLOT(slotCheque()));
	menu->insertItem(tr("Allocate"), this, SLOT(slotAllocate()));
    }
    if (card.dataType() == DataObject::VENDOR) {
	menu->insertItem(tr("Aged List"), this, SLOT(slotAgedAP()));
	menu->insertItem(tr("Purchases"), this, SLOT(slotPurchases()));
	menu->insertItem(tr("Payment"), this, SLOT(slotPayment()));
	menu->insertItem(tr("Allocate"), this, SLOT(slotAllocate()));
    }
}
Exemplo n.º 6
0
void
TaxList::performRefresh()
{
    bool showInactive = _inactive->isChecked();
    Id tax_id = currentId();
    QListViewItem* current = NULL;
    clearLists();

    TaxSelect conditions;
    conditions.activeOnly = !showInactive;
    vector<Tax> taxes;
    _quasar->db()->select(taxes, conditions);

    for (unsigned int i = 0; i < taxes.size(); i++) {
	Tax& tax = taxes[i];
	fixed rate = _db->taxRate(tax);

	ListViewItem* lvi = new ListViewItem(_list, tax.id());
	lvi->setValue(0, tax.name());
	lvi->setValue(1, tax.description());
	lvi->setValue(2, rate);
	if (showInactive) lvi->setValue(3, !tax.isActive());
	if (tax.id() == tax_id) current = lvi;
    }

    if (current == NULL) current = _list->firstChild();

    _list->setCurrentItem(current);
    _list->setSelected(current, true);
}
Exemplo n.º 7
0
void WizardMain::closeEvent(QCloseEvent *event) {
    //!
    //!SLOT: catches the close button event on the wizard and ignore it only on the last page.
    //!

    //!If the user closes the wizard the textual report is saved.

    QString userText;

    if(mode == false) {
          userText = this->field("UserDescription").toString();
          report->setUserText(userText); //User description inserted.
    }

    xml->save();

    //The event is ignored on the last page of the wizard because the user must press 'finished'
    //to execute the last code.

    //The last page changes the id according to the wizard mode.

    if(currentId() == lastPage)
        event->ignore();

    emit rejected(); //The signal is used by sendtextreportform class to close the form.
}
Exemplo n.º 8
0
void
AddressBook::performEdit()
{
    Id card_id = currentId();
    Card card;
    if (!_quasar->db()->lookup(card_id, card))
	return;

    QWidget* window = NULL;
    switch (card.dataType()) {
    case DataObject::CUSTOMER:
	window = new CustomerMaster(_main, card_id);
	break;
    case DataObject::EMPLOYEE:
	window = new EmployeeMaster(_main, card_id);
	break;
    case DataObject::PERSONAL:
	window = new PersonalMaster(_main, card_id);
	break;
    case DataObject::VENDOR:
	window = new VendorMaster(_main, card_id);
	break;
    default:
	assert(false);
    }
    window->show();
}
Exemplo n.º 9
0
void NewWizard::showHelp()
{
	static QString lastMessage;
	QString message;

	switch(currentId()) {
		case Page_New:
				message = tr("You must specify the dimensions of the matrix and "
							 "the configuration of differential transformations");
				break;
		case Page_Matrix:
				message = tr("You must specify each element of the matrix based on "
								" the agreed syntax");
				break;
		default:
				message = tr("This help wasn't a help at all.");
				break;
	}

	if (lastMessage == message) {
			message = tr("Sorry, I've already helped you as much as I could. "
							"Maybe you should ask a human.?");
	}

	QMessageBox::information(this, tr("New Session Wizard Help"), message);
	lastMessage = message;
}
Exemplo n.º 10
0
void
CompanyList::performEdit()
{
    Id company_id = currentId();
    CompanyMaster* master = new CompanyMaster(_main, company_id);
    master->show();
}
Exemplo n.º 11
0
int ConnectFriendWizard::nextId() const
{
    switch ((Page) currentId()) {
    case Page_Intro:
        if (ui->textRadioButton->isChecked()) return Page_Text;
        if (ui->certRadioButton->isChecked()) return Page_Cert;
        if (ui->foffRadioButton->isChecked()) return Page_Foff;
        if (ui->rsidRadioButton->isChecked()) return Page_Rsid;
        if (ui->emailRadioButton->isChecked()) return Page_Email;
        if (ui->friendRecommendationsRadioButton->isChecked()) return Page_FriendRecommendations;
        return ConnectFriendWizard::Page_Foff;
    case Page_Text:
    case Page_Cert:
    case Page_Rsid:
        return error ? ConnectFriendWizard::Page_Conclusion : ConnectFriendWizard::Page_ErrorMessage;
    case Page_Foff:
    case Page_Email:
    case Page_ErrorMessage:
    case Page_Conclusion:
    case Page_FriendRequest:
    case Page_FriendRecommendations:
        return -1;
    }

    return -1;
}
Exemplo n.º 12
0
void CompleteWiz::skip()
{
    Operate[currentId()]=false;
    if(nextId()!=-1)
        next();
    else
        emit accept();
}
Exemplo n.º 13
0
/*virtual*/ void AddFeedWizard::done(int result)
{
  if (result == QDialog::Rejected) {
    if (progressBar_->isVisible() || (currentId() == 1))
      deleteFeed();
  }
  QWizard::done(result);
}
Exemplo n.º 14
0
void AuthenticationWizard::nextState()
{
    qCDebug(KTP_TEXTUI_LIB);
	if(currentId() == Page_Wait1) {
		static_cast<WaitPage*>(currentPage())->ready();
		next();
	}
}
Exemplo n.º 15
0
void CheckoutWizardDialog::reject()
{
    // First click kills, 2nd closes
    if (currentId() == m_progressPageId && m_progressPage->isRunning())
        m_progressPage->terminate();
    else
        QWizard::reject();
}
Exemplo n.º 16
0
int QtUserSearchWindow::nextId() const {
	switch (currentId()) {
		case 1: return firstPage_->byJID_->isChecked() ? (type_ == AddContact ? 4 : -1) : 2;
		case 2: return 3;
		case 3: return type_ == AddContact ? 4 : -1;
		case 4: return -1;
		default: return -1;
	}
}
Exemplo n.º 17
0
void
ActiveList::addToPopup(QPopupMenu* menu)
{
    menu->insertSeparator();
    if (isActive(currentId()))
	menu->insertItem(tr("Set inactive"), this, SLOT(slotSetInactive()));
    else
	menu->insertItem(tr("Set active"), this, SLOT(slotSetActive()));
}
Exemplo n.º 18
0
void SetupWizard::customBackClicked()
{
    if(currentId() == PAGE_CALIBRATION) {
        static_cast<OutputCalibrationPage*>(currentPage())->customBackClicked();
    }
    else {
        back();
    }
}
Exemplo n.º 19
0
void AuthenticationWizard::aborted()
{
	if(currentId() == Page_SharedSecret || currentId() == Page_QuestionAnswer) {
		next();
	}
	if(currentId() == Page_Wait1){
		next();
	}
	if(currentId() == Page_Wait2){
		next();
	}
	currentPage()->setTitle(i18n("Authentication aborted"));
	lFinal->setText(i18n("<b>%1</b> has aborted the authentication process."
                " To make sure you are not talking to an imposter, "
                "try again using the manual fingerprint verification method.", contact));

	setOption(QWizard::NoCancelButton, true);
}
Exemplo n.º 20
0
int wizardDisk::nextId() const
{
  switch (currentId()) {
     case Page_Intro:
       if (radioExpert->isChecked())
         return Page_Expert;
       if (radioBasic->isChecked()) {
	 checkGPT->setVisible(false);
	 checkGRUB->setVisible(false);
	 checkForce4K->setVisible(false);
	 groupZFSPool->setVisible(false);
       }
       if (radioAdvanced->isChecked()) {
	 checkGPT->setVisible(true);
	 checkGRUB->setVisible(true);
	 checkForce4K->setVisible(true);
	 groupZFSPool->setVisible(true);
       }
	break;
     case Page_BasicDisk:
       if (radioBasic->isChecked())
         return Page_Confirmation;
       if (comboPartition->currentIndex() != 0 ) {
	 groupZFSOpts->setEnabled(false);
         return Page_Mounts;
       } else {
         groupZFSOpts->setEnabled(true);
         return Page_ZFS;
       }
       break;
     case Page_ZFS:
       return Page_Mounts;
       break;
     case Page_Mounts:
       return Page_Confirmation;
       break;
     case Page_Confirmation:
       return -1;
       break;
     default:
	return currentId() + 1;
  }
  return currentId() + 1;
}
int MobileConnectionWizard::nextId() const
{
    // Providers page
    if (currentId() == 2 && type() != Knm::Connection::Gsm) {
        // Jumps to Confirm page instead of Plans page if type != Gsm.
        return 4;
    } else {
        return QWizard::nextId();
    }
}
Exemplo n.º 22
0
void
AddressBook::slotEmail()
{
    SendEmail* window = new SendEmail(_main);
    window->show();

    Id card_id = currentId();
    if (card_id != INVALID_ID)
	window->setCard(card_id);
}
Exemplo n.º 23
0
void
PriceList::performEdit()
{
    ListView* list = currentList();
    Id price_id = currentId();

    bool isCost = (list == _cost);
    PriceMaster* master = new PriceMaster(_main, price_id, isCost);
    master->show();
}
Exemplo n.º 24
0
void
ActiveList::slotActivities()
{
    _activities->clear();
    if (isActive(currentId()))
	_activities->insertItem(tr("Set inactive"), this,
				SLOT(slotSetInactive()));
    else
	_activities->insertItem(tr("Set active"), this,
				SLOT(slotSetActive()));
}
Exemplo n.º 25
0
int KEndingBalanceDlg::nextId() const
{
  // Starting from the current page, look for the first enabled page
  // and return that value
  // If the end of the list is encountered first, then return -1.
  for (int i = currentId() + 1; i < d->m_pages.size() && i < pageIds().size(); ++i) {
    if (d->m_pages.testBit(i))
      return pageIds()[i];
  }
  return -1;
}
Exemplo n.º 26
0
int LPWizard::nextId() const{
	int cpg = currentId();
	if(cpg == 1 && ui->radio_automatic->isChecked() ){
	  //Automatic snapshot schedule - skip the snapshot pruning page (not needed)
	  return 3;
	}else if(cpg==4){ //last page
	  return -1;
	}else{
	  return (cpg+1); //go to the next page
	}
}
Exemplo n.º 27
0
	ExecuteCommandDialog::ExecuteCommandDialog (const QString& jid,
			const QString& command,
			GlooxAccount *account, QWidget *parent)
	: ExecuteCommandDialog { jid, account, parent, Tag {} }
	{
		const int idx = addPage (new WaitPage { tr ("Please wait while "
				"the selected command is executed.") });
		if (currentId () != idx)
			next ();

		ExecuteCommand ({ {}, command });
	}
Exemplo n.º 28
0
void
AddressBook::slotAllocate()
{
    QString type = "CardAllocate";
    CardAllocate* window = (CardAllocate*)(_main->findWindow(type));
    if (window == NULL) {
	window = new CardAllocate(_main);
	window->show();
    }

    window->setCardId(currentId());
}
Exemplo n.º 29
0
void
AddressBook::slotPayment()
{
    QString type = "VendorPayment";
    ChequeVendor* window = (ChequeVendor*)(_main->findWindow(type));
    if (window == NULL) {
	window = new ChequeVendor(_main);
	window->show();
    }

    window->setStoreId(_store->getId());
    window->setCardId(currentId());
}
/* private slots */
int CreateVirtNetwork_Ass::nextId() const
{
    switch (currentId()) {
    case Page_Intro:
    case Page_Bridge:
    case Page_Forward:
    case Page_IP:
    case Page_NoGateway:
        return currentPage()->nextId();
    default:
        return -1;
    }
}