aboutsummaryrefslogtreecommitdiff
path: root/demos/widgetsgallery
diff options
context:
space:
mode:
authorDominik Kapusta <dominik.kapusta@teleca.com>2010-06-30 14:06:14 +0200
committerTomas Junnonen <tomas.junnonen@nokia.com>2010-07-09 14:50:29 +0300
commit2e575e3f5cb7d1f986cd46827cdc10849a6e8154 (patch)
tree6c36503cec7839d8fa2ac02cc57cf22e2a02be7e /demos/widgetsgallery
parentf8e7a0c4df48a44b31d44f7c47d24c5d0432a53f (diff)
Fixes: NB#175663 - system dialog cannot be minimised
RevBy: Marcin Miklas, Tomas Junnonen Details: Introducing system property for MDialog. It enables creating System Dialogs that are modeless (when modal property is set to false). The difference between System Dialog and System Modal Dialog is that the former is equipped with the home button that allows skipping the dialog temporarily and later invoking it from the task switcher.
Diffstat (limited to 'demos/widgetsgallery')
-rw-r--r--demos/widgetsgallery/singleselectiondialogspage.cpp33
-rw-r--r--demos/widgetsgallery/singleselectiondialogspage.h1
2 files changed, 31 insertions, 3 deletions
diff --git a/demos/widgetsgallery/singleselectiondialogspage.cpp b/demos/widgetsgallery/singleselectiondialogspage.cpp
index 1f3cd19f..aa1d7453 100644
--- a/demos/widgetsgallery/singleselectiondialogspage.cpp
+++ b/demos/widgetsgallery/singleselectiondialogspage.cpp
@@ -108,10 +108,12 @@ void SingleSelectionDialogsPage::itemClicked(const QModelIndex &index)
if (index.row() == 0)
openStackedDialogs();
else if (index.row() == 1)
- openSystemModalDialog();
+ openSystemDialog();
else if (index.row() == 2)
- openDialogWithProgressIndicator();
+ openSystemModalDialog();
else if (index.row() == 3)
+ openDialogWithProgressIndicator();
+ else if (index.row() == 4)
openMessageBox();
}
@@ -156,6 +158,29 @@ void SingleSelectionDialogsPage::openNestedMessageBox()
nestedMessageBox->appear(MSceneWindow::DestroyWhenDone);
}
+void SingleSelectionDialogsPage::openSystemDialog()
+{
+ if (dialog)
+ return;
+
+ dialog = new MDialog(
+ //% "System Dialog"
+ qtTrId("xx_dialogs_and_notifications_system_dialog_title"),
+ M::OkButton);
+
+ dialog->setCentralWidget(
+ //% "I'm a system dialog.<br>"
+ //% "There actually is a way around me...<br>"
+ //% "You can skip me with the home button, but I'll remain<br>"
+ //% "alive until you make a selection."
+ new MLabel(qtTrId("xx_dialogs_and_notifications_system_dialog_label")));
+
+ dialog->setSystem(true);
+ dialog->setModal(false);
+
+ dialog->appear(MSceneWindow::DestroyWhenDone);
+}
+
void SingleSelectionDialogsPage::openSystemModalDialog()
{
if (dialog)
@@ -172,7 +197,7 @@ void SingleSelectionDialogsPage::openSystemModalDialog()
//% "Muwhahaha... [evil laugh]"
new MLabel(qtTrId("xx_dialogs_and_notifications_system_modal_dialog_label")));
- dialog->setSystemModal(true);
+ dialog->setSystem(true);
dialog->appear(MSceneWindow::DestroyWhenDone);
}
@@ -230,6 +255,8 @@ void SingleSelectionDialogsPage::retranslateUi()
QStringList singleSelectionDialogTypes;
//% "Stacked Dialogs"
singleSelectionDialogTypes << qtTrId("xx_wg_single_selection_dialogs_page_stacked_dialogs");
+ //% "System Dialog"
+ singleSelectionDialogTypes << qtTrId("xx_wg_single_selection_dialogs_page_system_dialog");
//% "System Modal Dialog"
singleSelectionDialogTypes << qtTrId("xx_wg_single_selection_dialogs_page_system_modal_dialog");
//% "Dialog with Progress Indicator"
diff --git a/demos/widgetsgallery/singleselectiondialogspage.h b/demos/widgetsgallery/singleselectiondialogspage.h
index 3e7e0fb9..64bcaf59 100644
--- a/demos/widgetsgallery/singleselectiondialogspage.h
+++ b/demos/widgetsgallery/singleselectiondialogspage.h
@@ -41,6 +41,7 @@ public:
void populateLayout();
void openStackedDialogs();
+ void openSystemDialog();
void openSystemModalDialog();
void openDialogWithProgressIndicator();
void openMessageBox();