×
Namespaces

Variants
Actions

Using common dialogs with S60 and Maemo Platform

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.


Article Metadata
Article
Created: ebra (29 Oct 2007)
Last edited: hamishwillee (30 May 2013)

Comparison

Both S60 Platform and Maemo Platform have a number of common dialogs to ease the application development.

Comparing S60 and Maemo Platforms

S60 Platform

S60CommonDialog2.png

enum TCommonDialogType
{
ECFDDialogTypeNormal,
ECFDDialogTypeSelect,
ECFDDialogTypeSave,
ECFDDialogTypeMove,
ECFDDialogTypeBrowse,
ECFDDialogTypeDefaultSetting,
ECFDDialogTypeCopy
};
...
TFileName fileName;
TBuf<KMaxFileName> defaultPath;
TCommonDialogType dialogType = ECFDDialogTypeSave;
...
CAknFileSelectionDialog* dialog = CAknFileSelectionDialog::NewL(dialogType);
...
TBool result = dialog->RunDlgLD(fileName, defaultPath);
...

Maemo Platform

MaemoCommonDialog2.png

typedef struct _AppData AppData;
struct _AppData
{
HildonProgram *program; /* handle to application */
HildonWindow *window; /* handle to app's window */
osso_context_t *osso; /* handle to osso */
};
/* Struct to include view's information */
typedef struct _MainView MainView;
struct _MainView
{
/* Handle to app's data */
AppData *data;
 
...
 
};
/* File chooser */
gchar* interface_file_chooser(MainView * mainview, GtkFileChooserAction action)
{
GtkWidget *dialog;
gchar* filename = NULL;
 
dialog = hildon_file_chooser_dialog_new( GTK_WINDOW(mainview->data->program), action);
gtk_widget_show_all (GTK_WIDGET(dialog));
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
{
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
}
gtk_widget_destroy (dialog);
return filename;
}
This page was last modified on 30 May 2013, at 09:39.
48 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×