Window::Window()
{
echoLineEdit->setFocus();
connect(convert, SIGNAL(clicked()),this, SLOT(runAnscare()));
connect(browse, SIGNAL(clicked()),this, SLOT(getPath()));
layout->addWidget(echoGroup, 0, 0);
setLayout(layout);
setWindowTitle(tr("WinCares"));
}
void Window::runAnscare()
{
convert->setEnabled( false );
if( process )
delete process;
connect( process, SIGNAL(readyReadStandardOutput()), this, SLOT(handleReadStandardOutput()));
process->start( "anscares.exe ");
}
void Window::handleReadStandardOutput()
{
QString string
=echoLineEdit
->text
();
int i=name.size();
name.remove(i-4,4);
process->write(name.toAscii()+"\n");
}
Window::Window()
{
QGroupBox *echoGroup = new QGroupBox(tr("Anscare"));
QLabel *echoLabel = new QLabel(tr("File:"));
QPushButton *browse = new QPushButton(tr("browse.."));
QPushButton *convert = new QPushButton(tr("convert"));
echoLineEdit = new QLineEdit;
echoLineEdit->setFocus();
connect(convert, SIGNAL(clicked()),this, SLOT(runAnscare()));
connect(browse, SIGNAL(clicked()),this, SLOT(getPath()));
QGridLayout *layout = new QGridLayout;
layout->addWidget(echoGroup, 0, 0);
setLayout(layout);
setWindowTitle(tr("WinCares"));
}
void Window::runAnscare()
{
convert->setEnabled( false );
if( process )
delete process;
process = new QProcess( this );
connect( process, SIGNAL(readyReadStandardOutput()), this, SLOT(handleReadStandardOutput()));
process->start( "anscares.exe ");
}
void Window::handleReadStandardOutput()
{
QString string=echoLineEdit->text();
QFileInfo fi(string);
QString name=fi.fileName();
int i=name.size();
name.remove(i-4,4);
process->write(name.toAscii()+"\n");
}
To copy to clipboard, switch view to plain text mode
Bookmarks