ModestConfNotificationId notification_id,
ModestFolderView *self);
+#ifndef MODEST_TOOLKIT_HILDON2
/* DnD functions */
static void on_drag_data_get (GtkWidget *widget,
GdkDragContext *context,
guint time,
gpointer user_data);
-static void expand_root_items (ModestFolderView *self);
+static void setup_drag_and_drop (GtkTreeView *self);
+
+static void on_row_inserted_maybe_select_folder (GtkTreeModel *tree_model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ ModestFolderView *self);
static gint expand_row_timeout (gpointer data);
+#endif
-static void setup_drag_and_drop (GtkTreeView *self);
+static void expand_root_items (ModestFolderView *self);
static gboolean _clipboard_set_selected_data (ModestFolderView *folder_view,
gboolean delete);
static void _clear_hidding_filter (ModestFolderView *folder_view);
-#ifndef MODEST_TOOLKIT_HILDON2
-static void on_row_inserted_maybe_select_folder (GtkTreeModel *tree_model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- ModestFolderView *self);
-#endif
-
static void on_display_name_changed (ModestAccountMgr *self,
const gchar *account,
gpointer user_data);
/* Build treeview */
add_columns (GTK_WIDGET (obj));
+#ifndef MODEST_TOOLKIT_HILDON2
/* Setup drag and drop */
setup_drag_and_drop (GTK_TREE_VIEW(obj));
+#endif
/* Connect signals */
g_signal_connect (G_OBJECT (obj),
modest_folder_view_update_model (MODEST_FOLDER_VIEW (self), account_store);
priv->reselect = FALSE;
+#ifndef MODEST_TOOLKIT_HILDON2
modest_folder_view_select_first_inbox_or_local (MODEST_FOLDER_VIEW (self));
+#endif
g_object_unref (G_OBJECT (device));
}
return same_account;
}
+#ifndef MODEST_TOOLKIT_HILDON2
/**
*
* Selects the first inbox or the local account in an idle
return FALSE;
}
+#endif
static void
on_account_changed (TnyAccountStore *account_store,
/* Refilter the model */
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (filter_model));
+#ifndef MODEST_TOOLKIT_HILDON2
/* Select the first INBOX if the currently selected folder
belongs to the account that is being deleted */
if (same_account && !MODEST_IS_TNY_LOCAL_FOLDERS_ACCOUNT (tny_account))
g_idle_add (on_idle_select_first_inbox_or_local, self);
+#endif
}
static void
/* Refilter the model */
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (filter_model));
+#ifndef MODEST_TOOLKIT_HILDON2
/* Select the first INBOX if the currently selected folder
belongs to the account that is being deleted */
if (same_account)
g_idle_add (on_idle_select_first_inbox_or_local, self);
+#endif
}
void
deathlock situation */
/* TODO: check if this is still the case */
priv->reselect = FALSE;
+#ifndef MODEST_TOOLKIT_HILDON2
modest_folder_view_select_first_inbox_or_local (self);
+#endif
/* Notify the display name observers */
g_signal_emit (G_OBJECT(self),
signals[FOLDER_DISPLAY_NAME_CHANGED_SIGNAL], 0,
return cmp;
}
+#ifndef MODEST_TOOLKIT_HILDON2
/*****************************************************************************/
/* DRAG and DROP stuff */
/*****************************************************************************/
return folder;
}
-
/*
* This function is used by drag_data_received_cb to manage drag and
* drop of a header, i.e, and drag from the header view to the folder
}
/* Check if the get_data failed */
+#if GTK_CHECK_VERSION (2,14,0)
+ if ((selection_data == NULL) || (gtk_selection_data_get_length (selection_data) < 0))
+#else
if (selection_data == NULL || selection_data->length < 0)
+#endif
goto end;
/* Select the destination model */
/* Set up the folder view as a dnd destination. Set only the
highlight flag, otherwise gtk will have a different
behaviour */
-#ifdef MODEST_TOOLKIT_HILDON2
- return;
-#endif
gtk_drag_dest_set (GTK_WIDGET (self),
GTK_DEST_DEFAULT_HIGHLIGHT,
folder_view_drag_types,
G_CALLBACK (drag_drop_cb),
NULL);
}
+#endif
/*
* This function manages the navigation through the folders using the
return FALSE;
}
-
-
-
+#ifndef MODEST_TOOLKIT_HILDON2
void
modest_folder_view_select_first_inbox_or_local (ModestFolderView *self)
{
-#ifndef MODEST_TOOLKIT_HILDON2
GtkTreeModel *model;
GtkTreeIter iter, inbox_iter;
GtkTreeSelection *sel;
/* set focus */
gtk_widget_grab_focus (GTK_WIDGET(self));
-#endif
}
-
+#endif
/* recursive */
static gboolean
/* Set color */
attr_list = pango_attr_list_new ();
- if (!gtk_style_lookup_color (GTK_WIDGET (self)->style, "SecondaryTextColor", &style_color)) {
+
+ if (!gtk_style_lookup_color (gtk_widget_get_style (GTK_WIDGET (self)), "SecondaryTextColor", &style_color)) {
gdk_color_parse ("grey", &style_color);
}
attr = pango_attr_foreground_new (style_color.red, style_color.green, style_color.blue);
pango_attr_list_unref (attr_list);
}
- if (gtk_style_lookup_color (GTK_WIDGET (self)->style, "ActiveTextColor", &style_active_color)) {
+ if (gtk_style_lookup_color (gtk_widget_get_style (GTK_WIDGET (self)), "ActiveTextColor", &style_active_color)) {
priv->active_color = style_active_color;
} else {
gdk_color_parse ("000", &(priv->active_color));