Esempio n. 1
0
void msgfrm::print()
{
    printfrm *pfrm = new printfrm;
    if(pfrm->exec())
    {
		if(pfrm->rdbtn_1->isChecked())
	    	printalllist();
		else if(pfrm->rdbtn_2->isChecked())
	    	printall();
		else if(pfrm->rdbtn_3->isChecked())
	    	printsellist();
		else if(pfrm->rdbtn_4->isChecked())
	    	printsel();
    }
}
Esempio n. 2
0
mainwindow::mainwindow()
{
    // Interface Construction
    ui.setupUi(this);
    pt_mth = pt_type = -1;
    evt = isreset = 1;
    pdfpath = "./PDF/";
    lstroll = "";


    dt = QDate::currentDate().toString("dd.MM.yyyy");
    ui.date->setText(dt);

    mwsdt = new sdetails();
    // Scene Construction
    setdmscene();


    // Load Modules
    btable = new bulkprint(this,ui.tab_5);
    btable->show();
    selprint = new selectiveprint(this);
    setupmenu();


    // Start the Authentication Dialog
    AuthenDialog *authendialog = new AuthenDialog(this);
    authendialog->show();

    // Printer Info
    QPrinter print;
    QPrinterInfo pinfo(print);
    ui.pinfo->setText(pinfo.printerName());//.section("",-1,-1));

    // Fetch Printing Positions
    QFile file2("./positions.dat");
    file2.open(QIODevice::ReadOnly);
    QDataStream inp(&file2);
    inp >> lt;

    //set printer
    setprinter();

    //Connections
    connect(ui.bselback,SIGNAL(pressed()),selprint,SLOT(back()));
    connect(ui.bqreset,SIGNAL(pressed()),this,SLOT(breset()));
    connect(ui.bqprint,SIGNAL(pressed()),this,SLOT(qprint()));
    connect(ui.bbulkprintall,SIGNAL(pressed()),this,SLOT(bprintall()));
    connect(ui.bbulkselprint,SIGNAL(pressed()),this,SLOT(bprintsel()));
    connect(ui.bselnext,SIGNAL(released()),selprint,SLOT(next()));
    connect(ui.babortprint,SIGNAL(released()),this,SLOT(abortprint()));
    connect(ui.bpositions,SIGNAL(released()),this,SLOT(positionsdialog()));
    connect(ui.changeButton,SIGNAL(released()),this,SLOT(changepasswd()));

    connect(ui.leqroll,SIGNAL(textChanged(const QString &)),this,SLOT(rollchanged(const QString &)));
    connect(ui.leqsname,SIGNAL(textChanged(const QString &)),this,SLOT(snamechanged(const QString &)));
    connect(ui.leqfname,SIGNAL(textChanged(const QString &)),this,SLOT(fnamechanged(const QString &)));
    connect(ui.cbcourse,SIGNAL(currentIndexChanged(const QString &)),this,SLOT(coursechanged(const QString &)));
    connect(ui.cbbranch,SIGNAL(currentIndexChanged(const QString &)),this,SLOT(branchchanged(const QString &)));
    connect(ui.cbyear,SIGNAL(currentIndexChanged(const QString &)),this,SLOT(yearchanged(const QString &)));
    connect(ui.cbsem,SIGNAL(currentIndexChanged(const QString &)),this,SLOT(semchanged(const QString &)));
    //connect(ui.cbpl,SIGNAL(currentIndexChanged(const QString &)),this,SLOT(ptchanged(const QString &)));
    connect(ui.leqfrom,SIGNAL(textChanged(const QString &)),this,SLOT(fromchanged(const QString &)));
    connect(ui.leqto,SIGNAL(textChanged(const QString &)),this,SLOT(tochanged(const QString &)));
    connect(ui.lepurpose,SIGNAL(textChanged(const QString &)),this,SLOT(ppchanged(const QString &)));
    connect(ui.cbgen,SIGNAL(currentIndexChanged(int)),this,SLOT(genchanged(int)));
    connect(ui.modetab,SIGNAL(currentChanged(int)),this,SLOT(pmode(int)));


    connect(ui.ptcombo,SIGNAL(currentIndexChanged(QString)),ui.ltype,SLOT(setText(const QString &)));
    connect(ui.outbox,SIGNAL(currentIndexChanged(QString)),ui.lout,SLOT(setText(const QString &)));
    connect(ui.gbcno,SIGNAL(toggled(bool)),this,SLOT(cidtoggle(bool)));
    connect(ui.sbcno,SIGNAL(valueChanged (int)),this,SLOT(cidvalue(int)));
    connect(ui.actionQuit,SIGNAL(triggered()),this,SLOT(close()));
    connect(ui.actionAbout,SIGNAL(triggered()),this,SLOT(about_p()));
    connect(actionselprintall,SIGNAL(triggered()),selprint,SLOT(printall()));
    connect(actionselprintsel,SIGNAL(triggered()),selprint,SLOT(printsel()));
    connect(ui.actionPrint,SIGNAL(triggered()),this,SLOT(qprint()));
    connect(ui.actionReset,SIGNAL(triggered()),this,SLOT(reset()));

    ui.leqroll->setFocus();
    ui.lepurpose->setText("Bus Pass");
    qp1 = "select STUDENT_ID from student_admission where STUDENT_ROLLNO=";
    qp2 = "select student_name,father_name,gender from student_info where student_id=" ;
    qp3 = "select course,branch_id,current_sem,current_year from student_academic where student_id=" ;

}