TnyAccountStore *account_store;
ModestMainWindowPrivate *priv;
TnyFolderStoreQuery *query;
- TnyDevice *device;
GtkWidget *icon;
gboolean online;
/* online/offline combo */
priv->online_toggle = gtk_toggle_button_new ();
- device = tny_account_store_get_device (account_store);
- online = tny_device_is_online (device);
+ online = tny_device_is_online (modest_runtime_get_device());
icon = gtk_image_new_from_icon_name (online ? GTK_STOCK_CONNECT : GTK_STOCK_DISCONNECT,
GTK_ICON_SIZE_BUTTON);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(priv->online_toggle), online);
priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self);
- device = tny_account_store_get_device
- (TNY_ACCOUNT_STORE(modest_runtime_get_account_store()));
-
+ device = modest_runtime_get_device ();
online = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->online_toggle));
if (online)
tny_device_force_online (device);
else
tny_device_force_offline (device);
-
- g_object_unref (G_OBJECT (device));
}
static gboolean
{
ModestWindowPrivate *parent_priv;
ModestMainWindowPrivate *priv;
- TnyDevice *device;
ModestTnyAccountStore *account_store;
priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self);
parent_priv = MODEST_WINDOW_GET_PRIVATE(self);
account_store = modest_runtime_get_account_store ();
- device = tny_account_store_get_device(TNY_ACCOUNT_STORE(account_store));
/* folder view */
g_signal_connect (G_OBJECT(priv->folder_view), "folder_selection_changed",
G_CALLBACK (modest_ui_actions_on_password_requested), self);
/* Device */
- g_signal_connect (G_OBJECT(device), "connection_changed",
+ g_signal_connect (G_OBJECT(modest_runtime_get_device()), "connection_changed",
G_CALLBACK(on_connection_changed), self);
g_signal_connect (G_OBJECT(priv->online_toggle), "toggled",
G_CALLBACK(on_online_toggle_toggled), self);
{
ModestWindowPrivate *parent_priv;
ModestMainWindowPrivate *priv;
- TnyDevice *device;
- ModestTnyAccountStore *account_store;
priv = MODEST_MAIN_WINDOW_GET_PRIVATE(self);
parent_priv = MODEST_WINDOW_GET_PRIVATE(self);
-
- account_store = modest_runtime_get_account_store ();
- device = tny_account_store_get_device(TNY_ACCOUNT_STORE(account_store));
/* folder view */
g_signal_connect (G_OBJECT(priv->folder_view), "folder_selection_changed",
/* Account store */
g_signal_connect (G_OBJECT (modest_runtime_get_account_store()), "accounts_reloaded",
G_CALLBACK (modest_ui_actions_on_accounts_reloaded), self);
-
-
+
/* window */
g_signal_connect (G_OBJECT(self), "destroy", G_CALLBACK(on_destroy), NULL);
g_signal_connect (G_OBJECT(self), "delete-event", G_CALLBACK(on_delete_event), self);