Reply
Thread Tools
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#31
Originally Posted by D-Iivil View Post
Thanks for you guys for the help. I know it's frustrading to teach someone who has no_idea_at_all what's happening
You're welcome!
Tbh, I like your style.

Basically, you went from zero to a working application in less than half day - and we just gave you some pointers about where to look, without any copy-pasteable code.

This is quite impressive!
 
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#32
Originally Posted by Venemo View Post
You're welcome!
Tbh, I like your style.

Basically, you went from zero to a working application in less than half day - and we just gave you some pointers about where to look, without any copy-pasteable code.

This is quite impressive!
Haha, well.. it was pretty much copy-paste :P

The application is working fine on the device and the binary is easy to put inside my theme package. Now I need still to figure out how to display a progressbar which covers the UI while the shell script is being excecuted (running the script takes a minute, so it's good to tell the user that "this is gonna take a while, sit back and wait). I already downloaded source of fapman (great app!) because it has a nice overlay effect with bouncing status indicator, but couldn't implement it yet

To be continued later tonight...
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
Posts: 180 | Thanked: 76 times | Joined on May 2010
#33
Originally Posted by D-Iivil View Post
Now I need still to figure out how to display a progressbar which covers the UI while the shell script is being excecuted (running the script takes a minute, so it's good to tell the user that "this is gonna take a while, sit back and wait).
When script is executed, start progress indicator. There is finished signal in QProcess. You can connect it to slot which stops progress indicator.

http://doc.qt.nokia.com/4.6/qprocess.html#finished
 

The Following User Says Thank You to Diph For This Useful Post:
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#34
Originally Posted by Diph View Post
When script is executed, start progress indicator. There is finished signal in QProcess. You can connect it to slot which stops progress indicator.

http://doc.qt.nokia.com/4.6/qprocess.html#finished
Hmm... okay, I think I understood the idea. What I don't know is how to open a same kind of "dialog window" with seeking progressbar like for example built in application manager shows when updating catalogs or installing programs.

Allthough I don't necessarily need a progress bar, all I need is a window that covers the UI and has text that says "Please wait, setting up the theme. This may take few minutes." and the script would be executed in background. I just want to prevent user to hit the "apply settings" during the script is already running.

Should I create another "form" in qt desinger and somehow launch that when the apply -button has been hit?
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
Posts: 180 | Thanked: 76 times | Joined on May 2010
#35
I haven't tried this but maybe this helps...

http://doc.qt.nokia.com/qt-maemo-4.6...essdialog.html

E: Or use QDialog with QProgressBar.

Last edited by Diph; 2010-07-16 at 17:02.
 
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#36
Originally Posted by Diph View Post
I haven't tried this but maybe this helps...

http://doc.qt.nokia.com/qt-maemo-4.6...essdialog.html

E: Or use QDialog with QProgressBar.
Tried that already, but couldn't get it working. I propably misunderstood something because I cannot make the progressdialog to appear.

I'm trying to do it like this:
Code:
void MainWindow::on_pushButton_clicked()
{
    QProgressDialog progress("Setting up the theme, please wait...", "Abort", 0, 1, this);
    progress.setWindowModality(Qt::WindowModal);

    progress.setValue(0);
        QStringList arguments;
        arguments << ui->Transition->currentText() << ui->Font->currentText() << ui->Color->currentText();
        QProcess::execute("/sbin/myscriptlauncher", arguments);
    progress.setValue(1);
}
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
Posts: 180 | Thanked: 76 times | Joined on May 2010
#37
The dialog gets destroyed before it shown (add progress.show() also). You can make the dialog member variable of MainWindow and create dialog with new and delete it when dialog is closed.

E: Or add dialog.exec();

Last edited by Diph; 2010-07-16 at 18:28.
 

The Following User Says Thank You to Diph For This Useful Post:
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#38
Originally Posted by Diph View Post
The dialog gets destroyed before it shown (add progress.show() also). You can make the dialog member variable of MainWindow and create dialog with new and delete it when dialog is closed.

E: Or add dialog.exec();
Will try, thanks again
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#39
Originally Posted by Diph View Post
The dialog gets destroyed before it shown (add progress.show() also). You can make the dialog member variable of MainWindow and create dialog with new and delete it when dialog is closed.

E: Or add dialog.exec();
Adding progress.show() made the dialog appear and the script is ran in the background. But; there's nothing in the dialog, just blank dialog. How could I get my text shown there also and the progress bar itself?
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
Posts: 180 | Thanked: 76 times | Joined on May 2010
#40
Did you try the dialog.exec()? It should block until user closes it. QProgressDialog wants minimum and maximum values and it might be difficult to set. Set both values to 0 and the dialog only shows busy indicator.
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:01.