Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
oliver_kranz
Posts: 216
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2

SystemProgressDialog without button

How can I show a SystemProgressDialog without a button?

 

I show a SystemProgressDialog as an attached object of a Page.

 

Page {
    attachedObjects: [
        SystemProgressDialog {
            title: "Setting configuration"
            body: "Saving data"
            confirmButton.enabled: false
            dismissAutomatically: false
} ] }

 

By default the SystemProgressDialog has a confirmButton. Currently, I disable the confirm button. This shows a button which is grayed out. Since the button is a SystemUiButton it has no property visible which can be set to false like the cascades button.

 

Furthermore, I know that there is a workaround for the SystemDialog. There you can just set the SystemUiButton.label property to undefined which removes the button. But this does not work for the SystemProgressDialog.

 

SystemProgressToast cannot be used, too. It has no button but uses a predefined timout which closes the dialog automatically. This automatic closing cannot be avoided. Even if I use a QTimer calling the SystemProgressToast.show() method periodically then the dialog closes automatically.

 

So, how do I show a dialog without a button? I know that I can implement a custom Dialog. But this will not have round corners. And I also know that a custom Dialog can be implemented using a 9-sliced background image with round corners.

 

But is it possible to just remove the button from the SystemProgressDialog?

Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: SystemProgressDialog without button

Can you have a try to set the label of button as undefined?

 

confirmButton.label: undefined




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
oliver_kranz
Posts: 216
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2

Re: SystemProgressDialog without button

Yes, thanks. This is a workaround for SystemDialog. I already tried it. And it does not work for SystemProgressDialog.

Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: SystemProgressDialog without button

Have you test this way?

Note:

This button is omitted if its bb::system::SystemUiButton::label property is a default-constructed QString.

 




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
oliver_kranz
Posts: 216
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2

Re: SystemProgressDialog without button

Nice suggestion. I tried it in C++.

 

This shows a dialog with an OK button:

SystemProgressDialog* dialog = new SystemProgressDialog("OK", parent);
dialog->setBody(body);
dialog->setTitle(title);
dialog->show();

 

This just does not show the dialog:

SystemProgressDialog* dialog = new SystemProgressDialog(QString(), parent);
dialog->setBody(body);
dialog->setTitle(title);
dialog->show();

 

Seems like a bug for me.

Please use plain text.
New Contributor
eddielong
Posts: 9
Registered: ‎02-28-2013
My Device: BB10
My Carrier: None

Re: SystemProgressDialog without button

I had this exactly issue yesterday, I set the title of the cancel and confirm buttons to the empty string and the dialog just didn't appear, no errors to the console.

So instead I've gone with the 'god-awful' solution of leaving the button in with 'Ok' in it but disabling the button. Pretty sucky I know, only other alternative I can see is to make a custom dialog look like the system default ones.

Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: SystemProgressDialog without button

[ Edited ]

Maybe you can customize a dialog with an ActivityIndicator like the ActivityDialog in the sample application of PushCollector. It is really a good sample.

 

But it is not a progress bar, you can embed a ProgressIndicator and use signal to update it.




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
simon_hain
Posts: 15,940
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: SystemProgressDialog without button

[ Edited ]

This works for me if i set the button label to a default constructed QString, as said in the API.

It does not work if i set the QString in the dialog constructor.

Calling setEnabled(false) shows the button as disabled, but does not hide it.

 

SystemProgressDialog dialog = new SystemProgressDialog(parent);
dialog->confirmButton()->setLabel(QString());

Edit:

This only works in 10.2, i tested it on 10.1 and the SystemProgressDialog is not shown at all.

The related bug is https://www.blackberry.com/jira/browse/BBTEN-929

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
HorizonXP
Posts: 133
Registered: ‎03-28-2011
My Device: BlackBerry 9900 & PlayBook
My Carrier: Bell

Re: SystemProgressDialog without button

If you need to do this in QML, you can use the fact that SystemProgressDialog's cancelButton.label defaults to not being visible with a default QString. So in QML, if you do the following:

 

SystemProgressDialog {
    id: dlg
    body: "Some progress text."
    progress: -1
    title: "SomeProgressDialog title"
    confirmButton.label: cancelButton.label
}

 It will show the SystemProgressDialog with no buttons.


Founder of Pulsecode Inc. and taab
Authomator - Two-factor authentication codes on BlackBerry 10 - http://www.xitijpatel.com/ - Follow @xitijpatel
Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Please use plain text.