* Fixes NB#59468, the move to folder shows the folder view even if there is no main window
pmo-trunk-r2235
{
modest_runtime_not_implemented (NULL);
}
{
modest_runtime_not_implemented (NULL);
}
+
+GtkWidget *
+modest_platform_create_folder_view (TnyFolderStoreQuery *query)
+{
+ GtkWidget *widget = modest_folder_view_new (query);
+
+ /* Show all accounts by default */
+ modest_folder_view_set_style (MODEST_FOLDER_VIEW (widget),
+ MODEST_FOLDER_VIEW_STYLE_SHOW_ALL);
+
+ return widget;
+}
GtkWidget *folder_win = (GtkWidget *) user_data;
ModestMainWindowPrivate *priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self);
GtkWidget *folder_win = (GtkWidget *) user_data;
ModestMainWindowPrivate *priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self);
- priv->folder_view = MODEST_FOLDER_VIEW(modest_folder_view_new (NULL));
- if (!priv->folder_view)
- g_printerr ("modest: cannot instantiate folder view\n");
+ priv->folder_view = MODEST_FOLDER_VIEW (modest_platform_create_folder_view (NULL));
gtk_widget_show (GTK_WIDGET (priv->folder_view));
/* Connect signals */
connect_signals ((ModestMainWindow*)self);
gtk_widget_show (GTK_WIDGET (priv->folder_view));
/* Connect signals */
connect_signals ((ModestMainWindow*)self);
- modest_folder_view_set_style (priv->folder_view,
- MODEST_FOLDER_VIEW_STYLE_SHOW_ONE);
-
-
/* Set account store */
tny_account_store_view_set_account_store (TNY_ACCOUNT_STORE_VIEW (priv->folder_view),
TNY_ACCOUNT_STORE (modest_runtime_get_account_store ()));
/* Set account store */
tny_account_store_view_set_account_store (TNY_ACCOUNT_STORE_VIEW (priv->folder_view),
TNY_ACCOUNT_STORE (modest_runtime_get_account_store ()));
/* Load previous osso state, for instance if we are being restored from
* hibernation: */
/* Load previous osso state, for instance if we are being restored from
* hibernation: */
- modest_osso_load_state();
+ modest_osso_load_state ();
/* Restore window & widget settings */
/* Restore window & widget settings */
gtk_widget_show_all(GTK_WIDGET(self));
modest_ui_actions_on_accounts (NULL, MODEST_WINDOW(self));
}
gtk_widget_show_all(GTK_WIDGET(self));
modest_ui_actions_on_accounts (NULL, MODEST_WINDOW(self));
}
modest_maemo_utils_get_device_name ();
/* header view */
modest_maemo_utils_get_device_name ();
/* header view */
- priv->header_view =
- MODEST_HEADER_VIEW(modest_header_view_new (NULL, MODEST_HEADER_VIEW_STYLE_DETAILS));
+ priv->header_view =
+ MODEST_HEADER_VIEW (modest_header_view_new (NULL, MODEST_HEADER_VIEW_STYLE_DETAILS));
if (!priv->header_view)
g_printerr ("modest: cannot instantiate header view\n");
modest_header_view_set_style (priv->header_view, MODEST_HEADER_VIEW_STYLE_TWOLINES);
if (!priv->header_view)
g_printerr ("modest: cannot instantiate header view\n");
modest_header_view_set_style (priv->header_view, MODEST_HEADER_VIEW_STYLE_TWOLINES);
#include <modest-main-window.h>
#include <modest-header-view.h>
#include "maemo/modest-maemo-global-settings-dialog.h"
#include <modest-main-window.h>
#include <modest-header-view.h>
#include "maemo/modest-maemo-global-settings-dialog.h"
+#include "modest-widget-memory.h"
#include <modest-hildon-includes.h>
#include <osso-helplib.h>
#include <dbus_api/modest-dbus-callbacks.h>
#include <modest-hildon-includes.h>
#include <osso-helplib.h>
#include <dbus_api/modest-dbus-callbacks.h>
"system.note.dialog");
/* Play sound SR-SND-18. TODO: play the right file */
"system.note.dialog");
/* Play sound SR-SND-18. TODO: play the right file */
-/* hildon_notification_set_sound (not, "/usr/share/sounds/ui-battery_low.wav"); */
+/* hildon_notification_set_sound (not, "/usr/share/sounds/ui-new_email.wav"); */
/* Set the led pattern */
notify_notification_set_hint_int32 (NOTIFY_NOTIFICATION (not), "led-pattern", 3);
/* Set the led pattern */
notify_notification_set_hint_int32 (NOTIFY_NOTIFICATION (not), "led-pattern", 3);
/* TODO: warning about error showing dialog */
}
}
/* TODO: warning about error showing dialog */
}
}
+
+GtkWidget *
+modest_platform_create_folder_view (TnyFolderStoreQuery *query)
+{
+ GtkWidget *widget = modest_folder_view_new (query);
+
+ /* Show all accounts by default */
+ modest_folder_view_set_style (MODEST_FOLDER_VIEW (widget),
+ MODEST_FOLDER_VIEW_STYLE_SHOW_ONE);
+
+ /* Restore settings */
+ modest_widget_memory_restore (modest_runtime_get_conf(),
+ G_OBJECT (widget),
+ MODEST_CONF_FOLDER_VIEW_KEY);
+
+ return widget;
+}
#include <tny-device.h>
#include "widgets/modest-window.h"
#include <tny-device.h>
#include "widgets/modest-window.h"
+#include "widgets/modest-folder-view.h"
**/
void modest_platform_show_addressbook (GtkWindow *parent_window);
**/
void modest_platform_show_addressbook (GtkWindow *parent_window);
+
+GtkWidget* modest_platform_create_folder_view (TnyFolderStoreQuery *query);
+
G_END_DECLS
#endif /* __MODEST_PLATFORM_UTILS_H__ */
G_END_DECLS
#endif /* __MODEST_PLATFORM_UTILS_H__ */
GTK_POLICY_AUTOMATIC);
/* Create folder view */
GTK_POLICY_AUTOMATIC);
/* Create folder view */
- *tree_view = modest_folder_view_new (NULL);
+ *tree_view = modest_platform_create_folder_view (NULL);
/* It could happen that we're trying to move a message from a
window (msg window for example) after the main window was
/* It could happen that we're trying to move a message from a
window (msg window for example) after the main window was
gtk_widget_show_all (GTK_WIDGET(GTK_DIALOG(dialog)->vbox));
gtk_widget_show_all (GTK_WIDGET(GTK_DIALOG(dialog)->vbox));
+ /* Select INBOX or local account */
+ modest_folder_view_select_first_inbox_or_local (MODEST_FOLDER_VIEW (*tree_view));
+
void
modest_folder_view_select_first_inbox_or_local (ModestFolderView *self)
{
void
modest_folder_view_select_first_inbox_or_local (ModestFolderView *self)
{
/* Do not set it if the folder view was not painted */
if (!GTK_WIDGET_MAPPED (self))
/* Do not set it if the folder view was not painted */
if (!GTK_WIDGET_MAPPED (self))
model = gtk_tree_view_get_model (GTK_TREE_VIEW (self));
if (!model)
model = gtk_tree_view_get_model (GTK_TREE_VIEW (self));
if (!model)