fileview.c File Reference

#include <gconf/gconf-client.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <libergtk/ergtk.h>
#include <liberutils/display_utils.h>
#include "ctb_log.h"
#include "ctb_actions.h"
#include "fileview.h"
#include "filefind.h"
#include "filetypes.h"
#include "measures.h"
#include "i18n.h"
#include "ipc.h"
#include "menu.h"
Include dependency graph for fileview.c:

Go to the source code of this file.

Data Structures

struct  ctb_action_t

Defines

#define UNUSED(x)   (void)(x)

Typedefs

typedef int(* ctb_item_callback )(const GString *directory, const filelist_entry_t *file_info)

Enumerations

enum  delete_state { INITIAL = 0, CONFIRM }

Functions

static gchar * get_filename_at_cursor ()
static void set_cursor_at_filename (const gchar *cursor_item)
static void set_cursor (gint row, gint column)
static void setViewMode (ctb_viewmodes_t newmode, gboolean updateScreen)
static void scroll_to_letter (gchar letter, gboolean jump_to_dir)
static void alphabar_update ()
static void alphabar_select (int new_index)
static void handle_activate_item ()
static void listview_set_column_headers ()
static void update_titles ()
static void update_gui ()
void fileview_update_screen_texts ()
 Update screen texts, using current language setting.
void fileview_grab_focus (void)
 Grab focus for current view.
static void update_padding ()
void fileview_set_sort_order (const ctb_sort_order_t sort_order)
 Set sorting order for items in view.
static void update_view_for_desktop ()
void fileview_dir_up ()
void fileview_dir_down (const gchar *dir, const char *cursorname)
void fileview_show_desktop ()
 Show content of the desktop.
ctb_viewtypes_t get_viewtype_from_registry (void)
void fileview_media_mounted (const gchar *mountpoint)
 Notification that a storage device has been mounted.
static void save_viewtype_to_registry (ctb_viewtypes_t view)
void fileview_save_view_type ()
void fileview_media_unmounted ()
 Notification that the storage device will be (has been) unmounted.
static void get_cursor (gint *row, gint *column)
void fileview_stop_update_display ()
static gboolean update_display (gpointer data)
static void on_idle_update_display (gint type)
static gboolean on_idle_set_cursor (gpointer data)
static int find_nearest_active (int index)
static gboolean on_letter_click (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
static GtkWidget * create_alpha_bar ()
static gboolean on_file_search_clicked (GtkWidget *button, GdkEventButton *event, gpointer data)
static GtkWidget * create_screen_layout ()
static void on_iconview_item_activated (GtkIconView *iconview, GtkTreePath *path, gpointer user_data)
static void fileview_page_previous (int new_row, int new_col)
static void fileview_page_next (int new_row, int new_col)
static void on_iconview_navigate_cursor (erGtkIconView *er_iconview, erGtkIconViewKeyPress keycode, gpointer user_data)
static void update_view_size ()
static void on_listview_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer user_data)
static void on_listview_row_activated (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
static void on_listview_navigate_cursor (erGtkListView *er_listview, erGtkListViewKeyPress keycode, gpointer user_data)
static gboolean isFirstItem (GtkTreeModel *model, GtkTreeIter *iter)
static int iter_to_index (GtkTreeModel *model, const GtkTreeIter *iter)
static void reset_delete_state ()
static void handle_delete_activated (GtkTreeModel *model, GtkTreeIter *iter)
static void on_iconview_item_activated_delete (GtkIconView *iconview, GtkTreePath *path, gpointer user_data)
static void on_contentview_row_activated_delete (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
static void toggle_cell_function (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
static void setViewModeIconView (ctb_viewmodes_t newmode)
static void setViewModeListView (ctb_viewmodes_t newmode, int position, int width)
void show_error_dialog (const gchar *msg)
void fileview_show_search_dialog ()
void fileview_refresh (gboolean force_reload)
 Refresh the current screen data, keep cursor at same item if possible.
void fileview_set_on_top (gboolean ontop)
void fileview_toggle_delete_mode ()
static filelist_entry_tget_entry_at_cursor ()
void fileview_create_shortcut ()
 Create desktop shortcut(s) for the currently selected item(s).
void fileview_show_prev_page ()
void fileview_show_next_page ()
static void set_cursor_at_index (int index)
static gboolean on_idle_set_cursor_at_filename (gpointer data)
static void fileview_set_cursor_at_filename (const gchar *filename)
int fileview_get_xid ()
void fileview_move_up (guint delta)
void fileview_move_undo ()
static void on_iconview_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer user_data)
static GtkWidget * create_iconview ()
static GtkWidget * create_listview ()
static GtkWidget * create_contentview ()
void fileview_set_view_type (const ctb_viewtypes_t view, gboolean do_cursor)
 Select which view to use for displaying the files.
static void on_destroy (GtkWidget *widget, gpointer data)
void fileview_create ()
void fileview_init ()
 Initialisation.

Variables

static const gchar * REGKEY_VIEWTYPE = "/apps/er/sys/ctb/viewtype"
static const gchar * REGVAL_VIEWTYPE_ICON = "iconview"
static const gchar * REGVAL_VIEWTYPE_LIST = "listview"
static const gchar * REGVAL_VIEWTYPE_CONTENT = "listcontent"
static const gchar * REGVAL_VIEWTYPE_AUTO = "auto-select"
static GtkWidget * g_main_window = NULL
static GtkWidget * g_alphabar = NULL
static GtkWidget * g_background = NULL
static ctb_viewtypes_t g_current_view = -1
static GtkWidget * g_iconview = NULL
static GtkWidget * g_listview = NULL
static GtkWidget * g_eventbox = NULL
static GtkWidget * g_title_label = NULL
static GtkWidget * g_subtitle_label = NULL
static GtkWidget * g_search_button = NULL
static GtkWidget * g_search_dialog = NULL
static gboolean g_is_user_selected_view = FALSE
static ctb_viewmodes_t g_viewmode = BROWSE_MODE
static GtkTreeViewColumn * g_toggleColumn = NULL
static int g_handler_id = 0
static gboolean g_got_display_control = FALSE
static gboolean g_cursor_in_progress = FALSE
static gboolean g_operation_in_progress = FALSE
static int g_cursor_update_type = DM_HINT_FULL
static int g_width = 0
static int g_height = 0
static delete_state g_delete_state = -1
static const char * letters [FILEMODEL_NUM_ALPHA] = {"#", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
static GtkWidget * g_labels [FILEMODEL_NUM_ALPHA]
static int g_selected_letter = -1
static int g_last_clicked_index = -1

Define Documentation

#define UNUSED (  )     (void)(x)

Copyright (C) 2008 iRex Technologies B.V. All rights reserved.

Definition at line 48 of file fileview.c.


Typedef Documentation

typedef int(* ctb_item_callback)(const GString *directory, const filelist_entry_t *file_info)

Definition at line 55 of file fileview.c.


Enumeration Type Documentation

Enumerator:
INITIAL 
CONFIRM 

Definition at line 112 of file fileview.c.

00113         {
00114             INITIAL = 0,
00115             CONFIRM,
00116         } delete_state;


Function Documentation

static void alphabar_select ( int  new_index  )  [static]

Definition at line 623 of file fileview.c.

References buffer, filemodel_get_alpha_list(), FILEMODEL_NUM_ALPHA, g_alphabar, g_labels, g_selected_letter, and letters.

Referenced by alphabar_update(), fileview_dir_up(), fileview_page_next(), fileview_page_previous(), fileview_refresh(), on_idle_set_cursor_at_filename(), on_letter_click(), and update_view_size().

00623                                            {
00624     if (!GTK_WIDGET_VISIBLE(g_alphabar)) return;
00625     g_assert(new_index <= FILEMODEL_NUM_ALPHA);
00626 
00627     // deselect previously selected
00628     if (g_selected_letter != -1) {
00629         gtk_label_set_text(GTK_LABEL(g_labels[g_selected_letter]), letters[g_selected_letter]);
00630         g_selected_letter = -1;
00631     }
00632     if (new_index == -1) return;
00633 
00634     // select new entry
00635     const char* list = filemodel_get_alpha_list();
00636     g_assert(list[new_index] != 0);
00637     g_selected_letter = new_index;
00638     char buffer[4];
00639     snprintf(buffer, sizeof(buffer), "-%s-", letters[g_selected_letter]);
00640     gtk_label_set_text(GTK_LABEL(g_labels[g_selected_letter]), buffer);
00641 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void alphabar_update (  )  [static]

Definition at line 592 of file fileview.c.

References alphabar_select(), filemodel_get_alpha_list(), FILEMODEL_NUM_ALPHA, filemodel_show_alphabar(), g_alphabar, g_labels, and update_padding().

Referenced by fileview_refresh(), fileview_set_sort_order(), handle_delete_activated(), and update_gui().

00593 {
00594     if (!filemodel_show_alphabar()) {
00595         gtk_widget_hide(g_alphabar);
00596         update_padding();
00597         return;
00598     } else {
00599         gtk_widget_show(g_alphabar);
00600         update_padding();
00601     }
00602 
00603     const char* list = filemodel_get_alpha_list();
00604     int selected = -1;
00605     int i;
00606     for (i=0; i<FILEMODEL_NUM_ALPHA; i++) {
00607         if (list[i] == 0) {
00608             gtk_widget_set_name(g_labels[i], "irex-alphabar-label-inactive");
00609         } else {
00610             // select first active letter by default
00611             if (selected == -1) selected = i;
00612             gtk_widget_set_name(g_labels[i], "irex-alphabar-label-active");
00613         }
00614     }
00615     if (selected != -1) {
00616         alphabar_select(selected);
00617     } else {
00618         alphabar_select(-1);
00619     }
00620 }

Here is the call graph for this function:

Here is the caller graph for this function:

static GtkWidget* create_alpha_bar (  )  [static]

Definition at line 644 of file fileview.c.

References FILEMODEL_NUM_ALPHA, g_alphabar, g_labels, label, letters, and on_letter_click().

Referenced by create_screen_layout().

00645 {
00646     GtkWidget* vbox = gtk_vbox_new(TRUE, 0);
00647     g_alphabar = vbox;
00648     gtk_widget_set_size_request(vbox, 36, -1);  // force width to avoid later updates
00649     
00650     int i; 
00651     for (i=0; i<FILEMODEL_NUM_ALPHA; i++) {
00652         GtkWidget* letterbox = gtk_event_box_new();
00653         gtk_box_pack_start(GTK_BOX(vbox), letterbox, TRUE, TRUE, 0);
00654         GtkWidget* label = gtk_label_new(letters[i]);
00655         gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
00656         gtk_widget_set_name(label, "irex-alphabar-label-inactive");
00657         g_labels[i] = label;
00658         gtk_container_add(GTK_CONTAINER(letterbox), label); 
00659         g_signal_connect(GTK_EVENT_BOX(letterbox), "button-press-event",
00660             G_CALLBACK(on_letter_click), (void*)i);
00661     }
00662     return vbox;
00663 }

Here is the call graph for this function:

Here is the caller graph for this function:

static GtkWidget* create_contentview (  )  [static]

Definition at line 1762 of file fileview.c.

References ergtk_cell_renderer_border_new(), ergtk_cell_renderer_text_new(), ERGTK_LIST_VIEW, ergtk_list_view_append_column(), ergtk_list_view_new_with_model(), ergtk_list_view_set_focus_mode(), g_handler_id, get_filemodel(), MODCOL_SUBTITLE, MODCOL_THUMBNAIL, MODCOL_TITLE, on_listview_navigate_cursor(), on_listview_row_activated(), and on_listview_size_allocate().

Referenced by fileview_set_view_type().

01763 {
01764     GtkWidget *view = ergtk_list_view_new_with_model( get_filemodel() );
01765     g_signal_connect(G_OBJECT(view), "size-allocate",   G_CALLBACK(on_listview_size_allocate),   NULL);
01766     g_handler_id = g_signal_connect(view, "row-activated",   G_CALLBACK(on_listview_row_activated),   NULL);
01767     g_signal_connect(G_OBJECT(view), "navigate-cursor", G_CALLBACK(on_listview_navigate_cursor), NULL);
01768     gtk_widget_set_name(view, "contentview-irex-ctb");
01769 
01770     erGtkListView *er_listview = ERGTK_LIST_VIEW(view);
01771     GtkTreeView *treeview = GTK_TREE_VIEW(view);
01772     gtk_tree_view_set_headers_visible(treeview, FALSE);
01773     GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview);
01774     gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
01775     ergtk_list_view_set_focus_mode(er_listview, TRUE, FALSE);
01776     gtk_tree_view_set_fixed_height_mode(treeview, TRUE);
01777 
01778     // icon column
01779     GtkCellRenderer *renderer = gtk_cell_renderer_pixbuf_new();
01780     g_object_set( G_OBJECT(renderer),
01781                   "xpad",   10,
01782                   "ypad",   0,
01783                   "xalign", 0.5,
01784                   "yalign", 0.5,
01785                   NULL );
01786     GtkTreeViewColumn *column = gtk_tree_view_column_new_with_attributes( NULL,
01787                                                        renderer,
01788                                                        "pixbuf", MODCOL_THUMBNAIL,
01789                                                        NULL );
01790     g_object_set( G_OBJECT(column),
01791                   "sizing", GTK_TREE_VIEW_COLUMN_FIXED,
01792                   "expand", FALSE,
01793                   NULL );
01794     gtk_tree_view_column_set_fixed_width(column, 90);
01795     ergtk_list_view_append_column(er_listview, column);
01796 
01797     // title + author column
01798     renderer = ergtk_cell_renderer_text_new(2);
01799     g_object_set( G_OBJECT(renderer),
01800                   "xpad",          0,
01801                   "ypad",          0,
01802                   "xalign",        0.0, // left
01803                   "yalign",        1.0, // bottom
01804                   "ellipsize",     PANGO_ELLIPSIZE_END,
01805                   "ellipsize-set", TRUE,
01806                   "font-0",        "Normal 10",
01807                   "font-1",        "Normal italic 9",
01808                   "height-0",      32,
01809                   "height-1",      22,
01810                   "foreground-0",  "black",
01811                   "foreground-1",  "#555555",
01812                   NULL );
01813     column = gtk_tree_view_column_new_with_attributes( "",
01814                                                        renderer,
01815                                                        "text-0", MODCOL_TITLE,
01816                                                        "text-1", MODCOL_SUBTITLE,
01817                                                        NULL );
01818     g_object_set( G_OBJECT(column),
01819                   "sizing", GTK_TREE_VIEW_COLUMN_FIXED,
01820                   "expand", TRUE,
01821                   NULL );
01822     gtk_tree_view_column_set_fixed_width(column, 300);
01823     ergtk_list_view_append_column(er_listview, column);
01824 
01825     // border column (invisible)
01826     // Note: add this to the GtkTreeView to avoid separator column from erGtkListView
01827     renderer = ergtk_cell_renderer_border_new();
01828     g_object_set( G_OBJECT(renderer),
01829                   "xpad",          0,
01830                   "ypad",          0,
01831                   "xalign",        0.0,
01832                   "yalign",        0.5,
01833                   "border-width",  2,
01834                   "border-offset", 3,
01835                   "border-color",  "dark grey",
01836                   NULL );
01837     column = gtk_tree_view_column_new_with_attributes( "",
01838                                                        renderer,
01839                                                        NULL );
01840     g_object_set( G_OBJECT(column),
01841                   "sizing", GTK_TREE_VIEW_COLUMN_FIXED,
01842                   "expand", FALSE,
01843                   NULL );
01844     gtk_tree_view_column_set_fixed_width(column, 10);
01845     gtk_tree_view_append_column(treeview, column);
01846 
01847     return view;
01848 }

Here is the call graph for this function:

Here is the caller graph for this function:

static GtkWidget* create_iconview (  )  [static]

Definition at line 1621 of file fileview.c.

References ERGTK_ICON_VIEW, ergtk_icon_view_new_with_model(), ergtk_icon_view_set_focus_mode(), g_handler_id, get_filemodel(), MODCOL_THUMBNAIL, MODCOL_TITLE, on_iconview_item_activated(), on_iconview_navigate_cursor(), on_iconview_size_allocate(), and widget.

Referenced by fileview_set_view_type().

01622 {
01623     GtkWidget *widget = ergtk_icon_view_new_with_model( get_filemodel() );
01624 #if MACHINE_IS_DR800S || MACHINE_IS_DR800SG || MACHINE_IS_DR800SW
01625     g_object_set(G_OBJECT(widget), "navigate-mode", "simple-navigate-mode", NULL);
01626 #endif 
01627     g_signal_connect(G_OBJECT(widget), "size-allocate",   G_CALLBACK(on_iconview_size_allocate),   NULL);
01628     g_handler_id = g_signal_connect(G_OBJECT(widget), "item-activated",  G_CALLBACK(on_iconview_item_activated),  NULL);
01629     g_signal_connect(G_OBJECT(widget), "navigate-cursor", G_CALLBACK(on_iconview_navigate_cursor), NULL);
01630     gtk_widget_set_name(widget, "iconview-irex-ctb");
01631     GtkIconView *view = GTK_ICON_VIEW(widget);
01632     ergtk_icon_view_set_focus_mode(ERGTK_ICON_VIEW(widget), TRUE, FALSE);
01633     gtk_icon_view_set_selection_mode(GTK_ICON_VIEW(widget), GTK_SELECTION_SINGLE);
01634     gtk_icon_view_set_spacing(view, 8);    // pixels between icon and text
01635 
01636     // add filename column
01637     gtk_icon_view_set_text_column(view, MODCOL_TITLE);
01638     // add thumbnail column
01639     gtk_icon_view_set_pixbuf_column(view, MODCOL_THUMBNAIL);
01640 
01641     return widget;
01642 }

Here is the call graph for this function:

Here is the caller graph for this function:

static GtkWidget* create_listview (  )  [static]

Definition at line 1645 of file fileview.c.

References ERGTK_LIST_VIEW, ergtk_list_view_append_column(), ergtk_list_view_new_with_model(), ergtk_list_view_set_focus_mode(), ergtk_list_view_set_row_height(), g_handler_id, get_filemodel(), MODCOL_FILEDATE, MODCOL_FILESIZE, MODCOL_FILETYPE_DISPLAY, MODCOL_THUMBNAIL, MODCOL_TITLE, on_listview_navigate_cursor(), on_listview_row_activated(), and on_listview_size_allocate().

Referenced by fileview_set_view_type().

01646 {
01647     GtkWidget *view = ergtk_list_view_new_with_model( get_filemodel() );
01648     g_signal_connect(G_OBJECT(view), "size-allocate",   G_CALLBACK(on_listview_size_allocate),   NULL);
01649     g_handler_id = g_signal_connect(G_OBJECT(view), "row-activated",   G_CALLBACK(on_listview_row_activated),   NULL);
01650     g_signal_connect(G_OBJECT(view), "navigate-cursor", G_CALLBACK(on_listview_navigate_cursor), NULL);
01651     gtk_widget_set_name(view, "listview-irex-ctb");
01652 
01653     erGtkListView *er_listview = ERGTK_LIST_VIEW(view);
01654     GtkTreeView *treeview = GTK_TREE_VIEW(view);
01655     GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview);
01656     gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
01657     ergtk_list_view_set_focus_mode(er_listview, TRUE, FALSE);
01658     gtk_tree_view_set_fixed_height_mode(treeview, TRUE);
01659     // NOTE: customized for DR1000's
01660     ergtk_list_view_set_row_height(er_listview, 34);
01661 
01662     // icon column
01663     GtkCellRenderer *renderer = gtk_cell_renderer_pixbuf_new();
01664     g_object_set( G_OBJECT(renderer),
01665                   "xpad",   0,
01666                   "ypad",   0,
01667                   "xalign", 0.5,
01668                   "yalign", 0.5,
01669                   NULL );
01670     GtkTreeViewColumn *column = gtk_tree_view_column_new_with_attributes( NULL,
01671                                                        renderer,
01672                                                        "pixbuf", MODCOL_THUMBNAIL,
01673                                                        NULL );
01674     g_object_set( G_OBJECT(column),
01675                   "sizing", GTK_TREE_VIEW_COLUMN_FIXED,
01676                   "expand", FALSE,
01677                   NULL );
01678     gtk_tree_view_column_set_fixed_width(column, 50);
01679     ergtk_list_view_append_column(er_listview, column);
01680 
01681     // filename column
01682     renderer = gtk_cell_renderer_text_new();
01683     g_object_set( G_OBJECT(renderer),
01684                   "xpad",          0,
01685                   "ypad",          0,
01686                   "xalign",        0.0,
01687                   "yalign",        0.5,
01688                   "ellipsize",     PANGO_ELLIPSIZE_END,
01689                   "ellipsize-set", TRUE,
01690                   NULL );
01691     column = gtk_tree_view_column_new_with_attributes( "",
01692                                                        renderer,
01693                                                        "text", MODCOL_TITLE,
01694                                                        NULL );
01695     g_object_set( G_OBJECT(column),
01696                   "sizing", GTK_TREE_VIEW_COLUMN_FIXED,
01697                   "expand", TRUE,
01698                   NULL );
01699     ergtk_list_view_append_column(er_listview, column);
01700 
01701     // filetype column
01702     renderer = gtk_cell_renderer_text_new();
01703     g_object_set( G_OBJECT(renderer),
01704                   "xpad",          0,
01705                   "ypad",          0,
01706                   "xalign",        0.0,
01707                   "yalign",        0.5,
01708                   NULL );
01709     column = gtk_tree_view_column_new_with_attributes( "",
01710                                                        renderer,
01711                                                        "text", MODCOL_FILETYPE_DISPLAY,
01712                                                        NULL );
01713     g_object_set( G_OBJECT(column),
01714                   "sizing", GTK_TREE_VIEW_COLUMN_FIXED,
01715                   "expand", FALSE,
01716                   NULL );
01717     gtk_tree_view_column_set_fixed_width(column, 120);
01718     ergtk_list_view_append_column(er_listview, column);
01719 
01720     // filesize column
01721     renderer = gtk_cell_renderer_text_new();
01722     g_object_set( G_OBJECT(renderer),
01723                   "xpad",   0,
01724                   "ypad",   0,
01725                   "xalign", 1.0,
01726                   "yalign", 0.5,
01727                   NULL );
01728     column = gtk_tree_view_column_new_with_attributes( "",
01729                                                        renderer,
01730                                                        "text", MODCOL_FILESIZE,
01731                                                        NULL );
01732     g_object_set( G_OBJECT(column),
01733                   "sizing", GTK_TREE_VIEW_COLUMN_FIXED,
01734                   "alignment", 0.0,
01735                   NULL );
01736     gtk_tree_view_column_set_fixed_width(column, 80);
01737     ergtk_list_view_append_column(er_listview, column);
01738 
01739     // filedate column
01740     renderer = gtk_cell_renderer_text_new();
01741     g_object_set( G_OBJECT(renderer),
01742                   "xpad",   0,
01743                   "ypad",   0,
01744                   "xalign", 0.5,
01745                   "yalign", 0.5,
01746                   NULL );
01747     column = gtk_tree_view_column_new_with_attributes( "",
01748                                                        renderer,
01749                                                        "text", MODCOL_FILEDATE,
01750                                                        NULL );
01751     g_object_set( G_OBJECT(column),
01752                   "sizing", GTK_TREE_VIEW_COLUMN_FIXED,
01753                   NULL );
01754     // note: required width depends on locale, this should fit all
01755     gtk_tree_view_column_set_fixed_width(column, 250);
01756     ergtk_list_view_append_column(er_listview, column);
01757 
01758     return view;
01759 }

Here is the call graph for this function:

Here is the caller graph for this function:

static GtkWidget* create_screen_layout ( void   )  [static]

Definition at line 698 of file fileview.c.

References create_alpha_bar(), g_background, g_eventbox, g_search_button, g_subtitle_label, g_title_label, ipc_sys_is_in_portrait_mode(), on_file_search_clicked(), path, TITLE_HEIGHT, TITLE_SPACING, TITLE_V_PADDING, widget, WINDOW_BOTTOM_PADDING, WINDOW_H_PADDING, and WINDOW_TOP_PADDING.

Referenced by fileview_create().

00699 {
00700     // object hierarchy:
00701     //     background (alignment)
00702     //       |
00703     GtkWidget *background = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
00704 
00705     guint delta = (ipc_sys_is_in_portrait_mode()) ? 0 : 5;
00706     gtk_alignment_set_padding( GTK_ALIGNMENT(background),
00707                                (WINDOW_TOP_PADDING - delta),
00708                                WINDOW_BOTTOM_PADDING,
00709                                WINDOW_H_PADDING,
00710                                WINDOW_H_PADDING  );
00711     g_background = background;
00712     gtk_widget_show(background);
00713     //       |
00714     //       |-- vbox
00715     //             |
00716     GtkWidget *widget = gtk_vbox_new(FALSE, 0);
00717     gtk_container_add(GTK_CONTAINER(background), widget);
00718     gtk_widget_show(widget);
00719     GtkBox *vbox = GTK_BOX(widget);
00720     //             |
00721     //             |-- hbox
00722     //             |     |
00723     widget = gtk_hbox_new(FALSE, TITLE_SPACING);
00724     gtk_box_pack_start(vbox, widget, FALSE, FALSE, TITLE_V_PADDING);
00725     gtk_widget_set_size_request(widget, -1, TITLE_HEIGHT);
00726     GtkBox *hbox = GTK_BOX(widget);
00727 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00728     //             |     |
00729     //             |     | -- home event box
00730     GtkWidget* home_event_box = gtk_event_box_new();
00731     gtk_box_pack_start(hbox, home_event_box, FALSE, FALSE, 0);
00732     gtk_widget_set_events(home_event_box, GDK_BUTTON_PRESS_MASK);
00733     g_signal_connect(home_event_box, "button-press-event" , G_CALLBACK(on_home_clicked), NULL);
00734     gtk_widget_show(home_event_box);
00735     g_home_eventbox = home_event_box;
00736     //             |     |
00737     //             |     | -- home_label
00738     GtkWidget* home_label = gtk_label_new(NULL);
00739     gtk_label_set_ellipsize(GTK_LABEL(home_label), PANGO_ELLIPSIZE_NONE);
00740     gtk_widget_set_name(home_label, "irex-ctb-title");
00741     gtk_container_add(GTK_CONTAINER(home_event_box), home_label);
00742     g_home_label = home_label;
00743     //             |     |
00744     //             |     | -- home_separator
00745     GtkWidget* home_separator = gtk_image_new_from_file(DATADIR"/pathbar-separator.png");
00746     gtk_widget_show(home_separator);
00747     gtk_box_pack_start(hbox, home_separator, FALSE, FALSE, 0);
00748     g_home_separator = home_separator;
00749 #endif
00750     //             |     |
00751     //             |     | -- title_label
00752     GtkWidget* title_label = gtk_label_new(NULL);
00753     gtk_label_set_ellipsize(GTK_LABEL(title_label), PANGO_ELLIPSIZE_NONE);
00754     gtk_widget_set_name(title_label, "irex-ctb-title");
00755     gtk_box_pack_start(hbox, title_label, FALSE, FALSE, 0);
00756     g_title_label = title_label;
00757     //             |     |
00758     //             |     | -- subtitle_label
00759     GtkWidget* subtitle_label = gtk_label_new(NULL);
00760     gtk_label_set_ellipsize(GTK_LABEL(subtitle_label), PANGO_ELLIPSIZE_END);
00761     gtk_misc_set_alignment(GTK_MISC(subtitle_label), 0.0, 0.5);
00762     gtk_widget_set_name(subtitle_label, "irex-ctb-subtitle");
00763     gtk_box_pack_start(hbox, subtitle_label, TRUE, TRUE, 0);
00764     g_subtitle_label = subtitle_label;
00765     //             |    |
00766     char path[512];
00767 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00768     //             |    | -- Shortcut event box "button"
00769     GtkWidget* sc_event_box = gtk_event_box_new();
00770     gtk_box_pack_end(hbox, sc_event_box, FALSE, FALSE, 0);
00771     gtk_widget_show(sc_event_box);
00772     snprintf (path, 512, "%s/%s", DATADIR, "icon-shortcut-button.png");
00773     GtkWidget* sc_image = gtk_image_new_from_file( (gchar*) path );
00774     gtk_container_add(GTK_CONTAINER(sc_event_box), sc_image);
00775     gtk_widget_show(sc_image);
00776     gtk_widget_set_events(sc_event_box, GDK_BUTTON_PRESS_MASK);
00777     g_signal_connect( sc_event_box, "button-press-event" , G_CALLBACK(on_shortcut_clicked), NULL);
00778     g_shortcut_button = sc_event_box;
00779 #endif
00780     //             |    |
00781     //             |    | -- File Find event box "button"
00782     GtkWidget* ff_event_box = gtk_event_box_new();
00783     gtk_box_pack_end(hbox, ff_event_box, FALSE, FALSE, 0);
00784     gtk_widget_show(ff_event_box);
00785     snprintf (path, 512, "%s/%s", DATADIR, "icon-search-button.png");
00786     GtkWidget* search_image = gtk_image_new_from_file( (gchar*) path );
00787     gtk_container_add(GTK_CONTAINER(ff_event_box), search_image);
00788     gtk_widget_show(search_image);
00789     gtk_widget_set_events(ff_event_box, GDK_BUTTON_PRESS_MASK);
00790     g_signal_connect( ff_event_box, "button-press-event" , G_CALLBACK(on_file_search_clicked), NULL);
00791     g_search_button = ff_event_box;
00792     //             |
00793     gtk_widget_show_all(widget);
00794     //             |-- hbox2
00795     //             |     |
00796     GtkWidget* hbox2 = gtk_hbox_new(FALSE, 20); 
00797     gtk_box_pack_start(vbox, hbox2, TRUE, TRUE, 0);
00798     gtk_widget_show(hbox2);
00799     //             |     |
00800     //             |     | -- g_eventbox
00801     widget = gtk_event_box_new();
00802     gtk_widget_show(widget);
00803     gtk_box_pack_start(GTK_BOX(hbox2), widget, TRUE, TRUE, 0);
00804     g_eventbox = widget;
00805     //             |     |
00806     //             |     | -- alpha_bar
00807     GtkWidget *alphabar = create_alpha_bar();
00808     gtk_box_pack_start(GTK_BOX(hbox2), alphabar, FALSE, FALSE, 0);
00809     gtk_widget_show_all(alphabar);
00810 
00811     return background;
00812 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_create (  ) 

Definition at line 1938 of file fileview.c.

References create_screen_layout(), fileview_set_view_type(), fileview_show_desktop(), g_is_user_selected_view, g_main_window, get_viewtype_from_registry(), on_destroy(), and widget.

Referenced by main().

01939 {
01940     // create the top level window 
01941     GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
01942     gtk_window_set_title(GTK_WINDOW(window), PACKAGE " " VERSION);
01943     gtk_window_maximize(GTK_WINDOW(window));
01944     gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
01945     gtk_container_set_border_width(GTK_CONTAINER(window), 0);
01946     gtk_window_set_modal(GTK_WINDOW(window), TRUE);
01947     g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(on_destroy), NULL);
01948     g_main_window = window;
01949 
01950     GtkWidget *widget = create_screen_layout();
01951     gtk_container_add(GTK_CONTAINER(window), widget);
01952 
01953     ctb_viewtypes_t view = get_viewtype_from_registry();
01954     fileview_set_view_type(view, FALSE);
01955     g_is_user_selected_view = FALSE;
01956 
01957     fileview_show_desktop();
01958     gtk_widget_show(window);
01959 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_create_shortcut (  ) 

Create desktop shortcut(s) for the currently selected item(s).

---------------------------------------------------------------------------

Name : fileview_create_shortcut

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 1453 of file fileview.c.

References create_shortcut_item(), filelist_entry_free(), and get_entry_at_cursor().

Referenced by menu_on_item_activated().

01454 {
01455     filelist_entry_t *entry = get_entry_at_cursor();
01456     if (entry) {
01457         create_shortcut_item(entry);
01458         filelist_entry_free(entry);
01459     }
01460 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_dir_down ( const gchar *  dir,
const char *  cursorname 
)

Definition at line 308 of file fileview.c.

References BROWSE_MODE, filemodel_chdir_down(), g_viewmode, LOGPRINTF, set_cursor(), and update_gui().

Referenced by activate_item(), activate_shortcut(), fileview_show_search_dialog(), and set_special_viewmode().

00309 {
00310     LOGPRINTF("dir=%s  cursor=%s", dir, cursorname ? cursorname : "NULL");
00311     g_assert(g_viewmode == BROWSE_MODE);
00312 
00313     filemodel_chdir_down(dir, cursorname);
00314 
00315     update_gui();
00316     set_cursor(0, 0);
00317 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_dir_up (  ) 

Definition at line 285 of file fileview.c.

References alphabar_select(), BROWSE_MODE, ERRORPRINTF, filemodel_chdir_up(), filemodel_get_dir_depth(), filemodel_get_first_alpha_index(), g_viewmode, set_cursor_at_filename(), update_gui(), and update_view_for_desktop().

Referenced by handle_special_item().

00286 {
00287     g_assert(g_viewmode == BROWSE_MODE);
00288     gchar* cursor_item = NULL;
00289 
00290     if (filemodel_get_dir_depth() == 1)
00291     {
00292         // next dir up is the desktop
00293         update_view_for_desktop();
00294     }
00295 
00296     cursor_item = filemodel_chdir_up();
00297     update_gui();
00298 
00299     if (cursor_item) {
00300         alphabar_select(filemodel_get_first_alpha_index());
00301         set_cursor_at_filename(cursor_item);
00302         g_free(cursor_item);
00303     } else
00304         ERRORPRINTF("no cursor set!");
00305 }

Here is the call graph for this function:

Here is the caller graph for this function:

int fileview_get_xid (  ) 

Definition at line 1582 of file fileview.c.

References g_main_window.

Referenced by ipc_sys_startup_complete().

01583 {
01584     return GDK_WINDOW_XID(g_main_window->window);
01585 }

Here is the caller graph for this function:

void fileview_grab_focus ( void   ) 

Grab focus for current view.

---------------------------------------------------------------------------

Name : fileview_grab_focus

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 218 of file fileview.c.

References CTB_CONTENTVIEW, CTB_ICONVIEW, CTB_LISTVIEW, g_current_view, g_iconview, and g_listview.

Referenced by fileview_show_search_dialog(), and on_window_activated().

00219 {
00220     switch (g_current_view)
00221     {
00222         case CTB_ICONVIEW:
00223             gtk_widget_grab_focus(GTK_WIDGET(g_iconview));
00224             break;
00225         case CTB_LISTVIEW:
00226         case CTB_CONTENTVIEW:
00227             gtk_widget_grab_focus(GTK_WIDGET(g_listview));
00228             break;
00229         default:
00230             break;
00231     }
00232 }

Here is the caller graph for this function:

void fileview_init (  ) 

Initialisation.

---------------------------------------------------------------------------

Name : fileview_init

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 1962 of file fileview.c.

References filemodel_init(), and reset_delete_state().

Referenced by main().

01963 {
01964     filemodel_init();
01965     reset_delete_state();
01966 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_media_mounted ( const gchar *  mountpoint  ) 

Notification that a storage device has been mounted.

---------------------------------------------------------------------------

Name : fileview_media_mounted

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 382 of file fileview.c.

References CTB_AUTOSELECT, fileview_set_view_type(), fileview_show_desktop(), g_is_user_selected_view, get_viewtype_from_registry(), and LOGPRINTF.

Referenced by main().

00383 {
00384     LOGPRINTF("entry: mountpoint [%s]", mountpoint);
00385     g_assert(mountpoint && *mountpoint);
00386 
00387     ctb_viewtypes_t view = get_viewtype_from_registry();
00388     if (view != CTB_AUTOSELECT)
00389     {
00390         fileview_set_view_type(view, FALSE);
00391         g_is_user_selected_view = FALSE;
00392     }
00393 
00394     fileview_show_desktop();
00395 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_media_unmounted (  ) 

Notification that the storage device will be (has been) unmounted.

---------------------------------------------------------------------------

Name : fileview_media_unmounted

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 452 of file fileview.c.

References BROWSE_MODE, filemodel_chdir_desktop(), fileview_save_view_type(), g_search_dialog, and setViewMode().

Referenced by main().

00453 {
00454     fileview_save_view_type();
00455     if (g_search_dialog) {
00456         gtk_widget_destroy(g_search_dialog);
00457         g_search_dialog = NULL;
00458     }
00459     setViewMode(BROWSE_MODE, FALSE);
00460     filemodel_chdir_desktop();
00461 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_move_undo (  ) 

Definition at line 1601 of file fileview.c.

References g_background, WINDOW_BOTTOM_PADDING, WINDOW_H_PADDING, and WINDOW_TOP_PADDING.

Referenced by on_changed_orientation().

01602 {
01603     gtk_alignment_set_padding( GTK_ALIGNMENT(g_background),
01604                                WINDOW_TOP_PADDING,
01605                                WINDOW_BOTTOM_PADDING,
01606                                WINDOW_H_PADDING,
01607                                WINDOW_H_PADDING  );
01608 }

Here is the caller graph for this function:

void fileview_move_up ( guint  delta  ) 

Definition at line 1588 of file fileview.c.

References g_background, WINDOW_BOTTOM_PADDING, WINDOW_H_PADDING, and WINDOW_TOP_PADDING.

Referenced by on_changed_orientation().

01589 {
01590     if (delta > WINDOW_TOP_PADDING )
01591     {
01592         delta = WINDOW_TOP_PADDING;
01593     }
01594     gtk_alignment_set_padding( GTK_ALIGNMENT(g_background),
01595                                (WINDOW_TOP_PADDING - delta),
01596                                WINDOW_BOTTOM_PADDING,
01597                                WINDOW_H_PADDING,
01598                                WINDOW_H_PADDING  );
01599 }

Here is the caller graph for this function:

static void fileview_page_next ( int  new_row,
int  new_col 
) [static]

Definition at line 831 of file fileview.c.

References alphabar_select(), filemodel_get_first_alpha_index(), filemodel_page_next(), fileview_stop_update_display(), and set_cursor().

Referenced by fileview_show_next_page(), on_iconview_navigate_cursor(), and on_listview_navigate_cursor().

00831                                                          {
00832     fileview_stop_update_display();
00833     filemodel_page_next();
00834     alphabar_select(filemodel_get_first_alpha_index());
00835     set_cursor(new_row, new_col);
00836 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void fileview_page_previous ( int  new_row,
int  new_col 
) [static]

Definition at line 823 of file fileview.c.

References alphabar_select(), filemodel_get_first_alpha_index(), filemodel_page_previous(), fileview_stop_update_display(), and set_cursor().

Referenced by fileview_show_prev_page(), on_iconview_navigate_cursor(), and on_listview_navigate_cursor().

00823                                                              {
00824     fileview_stop_update_display();
00825     filemodel_page_previous();
00826     alphabar_select(filemodel_get_first_alpha_index());
00827     set_cursor(new_row, new_col);
00828 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_refresh ( gboolean  force_reload  ) 

Refresh the current screen data, keep cursor at same item if possible.

---------------------------------------------------------------------------

Name : fileview_refresh

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 1361 of file fileview.c.

References alphabar_select(), alphabar_update(), BROWSE_MODE, filemodel_get_first_alpha_index(), filemodel_resync(), filemodel_scroll_to_filename(), filemodel_window_is_on_top(), fileview_stop_update_display(), get_filename_at_cursor(), LOGPRINTF, set_cursor_at_filename(), and setViewMode().

Referenced by fileview_update_screen_texts(), on_filesystem_change(), and on_window_activated().

01362 {
01363     LOGPRINTF("");
01364 
01365     if (filemodel_window_is_on_top()) fileview_stop_update_display();
01366 
01367     // cancel possible DELETE_MODE
01368     setViewMode(BROWSE_MODE, FALSE);
01369 
01370     gchar *cursor_item = get_filename_at_cursor();
01371     if (filemodel_resync(force_reload)) {
01372         alphabar_update();
01373         filemodel_scroll_to_filename(cursor_item);
01374         alphabar_select(filemodel_get_first_alpha_index());
01375     }
01376 
01377     set_cursor_at_filename(cursor_item);
01378     g_free(cursor_item);
01379 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_save_view_type (  ) 

Definition at line 442 of file fileview.c.

References g_current_view, g_is_user_selected_view, and save_viewtype_to_registry().

Referenced by fileview_media_unmounted(), and on_prepare_standby().

00443 {
00444     if (g_is_user_selected_view)
00445     {
00446         save_viewtype_to_registry(g_current_view);
00447         g_is_user_selected_view = FALSE;
00448     }
00449 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void fileview_set_cursor_at_filename ( const gchar *  filename  )  [static]

Definition at line 1574 of file fileview.c.

References on_idle_set_cursor_at_filename().

Referenced by fileview_set_view_type().

01575 {
01576     if (filename && *filename) {
01577         g_idle_add(on_idle_set_cursor_at_filename, g_strdup(filename));
01578     }
01579 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_set_on_top ( gboolean  ontop  ) 

Definition at line 1382 of file fileview.c.

References filemodel_set_window_is_on_top(), START_TIMER, and STOP_TIMER.

Referenced by on_window_activated(), and on_window_deactivated().

01383 {
01384     if (ontop) {
01385         START_TIMER();
01386     } else {
01387         STOP_TIMER();
01388     }
01389     filemodel_set_window_is_on_top(ontop);
01390 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_set_sort_order ( const ctb_sort_order_t  sort_order  ) 

Set sorting order for items in view.

---------------------------------------------------------------------------

Name : fileview_set_sort_order

Parameters:
[in] sort_order - requested sorting order
Returns:
--

--------------------------------------------------------------------------

Definition at line 261 of file fileview.c.

References alphabar_update(), filemodel_get_subtitle(), filemodel_set_sortorder(), fileview_stop_update_display(), g_subtitle_label, get_filename_at_cursor(), and set_cursor_at_filename().

Referenced by menu_on_item_activated().

00262 {
00263     fileview_stop_update_display();
00264     gchar *cursor_item = get_filename_at_cursor();
00265 
00266     gboolean order_has_changed = filemodel_set_sortorder( sort_order, cursor_item, TRUE);
00267     if (order_has_changed) {
00268         gtk_label_set_text(GTK_LABEL(g_subtitle_label), filemodel_get_subtitle());
00269         alphabar_update();
00270     }
00271     set_cursor_at_filename(cursor_item);
00272     g_free(cursor_item);
00273 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_set_view_type ( const ctb_viewtypes_t  view,
gboolean  do_cursor 
)

Select which view to use for displaying the files.

---------------------------------------------------------------------------

Name : fileview_set_view_type

Parameters:
[in] view - requested view type
Returns:
--

--------------------------------------------------------------------------

Definition at line 1851 of file fileview.c.

References create_contentview(), create_iconview(), create_listview(), CTB_CONTENTVIEW, CTB_ICONVIEW, CTB_LISTVIEW, DELETE_MODE, filemodel_set_thumbsize(), fileview_set_cursor_at_filename(), fileview_stop_update_display(), g_current_view, g_eventbox, g_height, g_iconview, g_is_user_selected_view, g_listview, g_operation_in_progress, g_viewmode, g_width, get_filename_at_cursor(), listview_set_column_headers(), LOGPRINTF, menu_select_view_type(), MODTHUMB_MEDIUM, MODTHUMB_MINI, MODTHUMB_SMALL, update_padding(), WARNPRINTF, and widget.

Referenced by fileview_create(), fileview_media_mounted(), menu_on_item_activated(), and update_view_for_desktop().

01852 {
01853     if (g_viewmode == DELETE_MODE) {
01854         WARNPRINTF("cannot switch viewtype in delete mode");
01855         return;
01856     }
01857 
01858     LOGPRINTF("old=%d -> new=%d", g_current_view, view);
01859     g_is_user_selected_view = TRUE;
01860     if ( view == g_current_view ) return;
01861     fileview_stop_update_display();
01862 
01863     gchar *cursor_item = NULL;
01864     if (do_cursor) cursor_item = get_filename_at_cursor();
01865 
01866     // delete old view
01867     switch (g_current_view) {
01868         case CTB_ICONVIEW:
01869             if (g_iconview) {
01870                 gtk_widget_destroy(g_iconview);
01871                 g_iconview = NULL;
01872             }
01873             break;
01874         case CTB_LISTVIEW:
01875         case CTB_CONTENTVIEW:
01876             if (g_listview) {
01877                 gtk_widget_destroy(g_listview);
01878                 g_listview = NULL;
01879             }
01880             break;
01881         default:
01882             break;
01883     }
01884 
01885     g_current_view = view;
01886     
01887     // create new view
01888     GtkWidget *widget = NULL;
01889     switch (view)
01890     {
01891         case CTB_ICONVIEW:
01892             filemodel_set_thumbsize(MODTHUMB_MEDIUM, do_cursor);
01893             widget = create_iconview();
01894             g_iconview = widget;
01895             g_signal_connect(widget, "destroy", G_CALLBACK(gtk_widget_destroyed), &widget);
01896             gtk_widget_show(widget);
01897             gtk_container_add(GTK_CONTAINER(g_eventbox), widget);
01898             if (g_width != 0) gtk_widget_set_size_request(widget, g_width, g_height);
01899             break;
01900         case CTB_LISTVIEW:
01901             filemodel_set_thumbsize(MODTHUMB_MINI, do_cursor);
01902             widget = create_listview();
01903             g_listview = widget;
01904             g_signal_connect(widget, "destroy", G_CALLBACK(gtk_widget_destroyed), &widget);
01905             gtk_widget_show(widget);
01906             gtk_container_add(GTK_CONTAINER(g_eventbox), widget);
01907             listview_set_column_headers();
01908             break;
01909         case CTB_CONTENTVIEW:
01910             filemodel_set_thumbsize(MODTHUMB_SMALL, do_cursor);
01911             widget = create_contentview();
01912             g_listview = widget;
01913             g_signal_connect(widget, "destroy", G_CALLBACK(gtk_widget_destroyed), &widget);
01914             gtk_widget_show(widget);
01915             gtk_container_add(GTK_CONTAINER(g_eventbox), widget);
01916             if (g_width != 0) gtk_widget_set_size_request(widget, g_width, g_height);
01917             break;
01918         default:
01919             break;
01920     }
01921 
01922     update_padding();
01923     menu_select_view_type(view);
01924     if (do_cursor) {
01925         g_operation_in_progress = TRUE;
01926         fileview_set_cursor_at_filename(cursor_item);
01927         g_free(cursor_item);
01928     }
01929 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_show_desktop (  ) 

Show content of the desktop.

---------------------------------------------------------------------------

Name : fileview_show_desktop

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 320 of file fileview.c.

References BROWSE_MODE, filemodel_chdir_desktop(), fileview_stop_update_display(), set_cursor(), setViewMode(), update_gui(), and update_view_for_desktop().

Referenced by fileview_create(), fileview_media_mounted(), and menu_on_goto_location().

00321 {
00322     fileview_stop_update_display();
00323     // cancel possible DELETE_MODE
00324     setViewMode(BROWSE_MODE, FALSE);
00325     update_view_for_desktop();
00326     filemodel_chdir_desktop();
00327 
00328     update_gui();
00329     set_cursor(0, 0);
00330 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_show_next_page (  ) 

Definition at line 1484 of file fileview.c.

References fileview_page_next(), get_cursor(), and START_TIMER.

Referenced by on_page_change().

01485 {
01486     START_TIMER();
01487     gint row    = 0;
01488     gint column = 0;
01489     get_cursor(&row, &column);
01490     fileview_page_next(row, column);
01491 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_show_prev_page (  ) 

Definition at line 1474 of file fileview.c.

References fileview_page_previous(), get_cursor(), and START_TIMER.

Referenced by on_page_change().

01475 {
01476     START_TIMER();
01477     gint row    = 0;
01478     gint column = 0;
01479     get_cursor(&row, &column);
01480     fileview_page_previous(row, column);
01481 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_show_search_dialog (  ) 

Definition at line 1324 of file fileview.c.

References DIR_LIBRARY, DM_HINT_FULL, filefind_dialog_create(), filefind_get_text(), filemodel_chdir_desktop(), filemodel_current_is_desktop(), filemodel_set_search_filter(), filemodel_set_viewmode2(), fileview_dir_down(), fileview_grab_focus(), fileview_stop_update_display(), g_main_window, g_search_dialog, ipc_menu_block(), ipc_menu_unblock(), on_idle_update_display(), SEARCH_VIEW, and SPECIAL_SEARCH.

Referenced by handle_special_item(), and on_file_search_clicked().

01325 { 
01326     ipc_menu_block();
01327     GtkWidget* dialog = filefind_dialog_create(g_main_window);
01328     g_search_dialog = dialog;
01329     gint result = gtk_dialog_run(GTK_DIALOG(dialog));
01330     if (result != GTK_RESPONSE_NONE) fileview_stop_update_display();
01331     switch (result)
01332     {
01333         case GTK_RESPONSE_ACCEPT:
01334         {
01335             if (!filemodel_current_is_desktop()) {
01336                 filemodel_chdir_desktop();
01337             }
01338             const gchar* search_string = filefind_get_text(); 
01339             filemodel_set_search_filter(search_string);
01340             filemodel_set_viewmode2(SEARCH_VIEW);
01341             fileview_dir_down(DIR_LIBRARY, SPECIAL_SEARCH);
01342         }
01343             break;
01344         default:
01345             // do nothing
01346             break;
01347     }
01348     ipc_menu_unblock();
01349     if (g_search_dialog) {
01350         gtk_widget_destroy(dialog);
01351         g_search_dialog = NULL;
01352     }
01353     fileview_grab_focus();
01354     if (result != GTK_RESPONSE_ACCEPT && result != GTK_RESPONSE_NONE) {
01355         // Note: sometimes we only get partial update, force fullscreen one
01356         on_idle_update_display(DM_HINT_FULL);
01357     }
01358 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_stop_update_display (  ) 
void fileview_toggle_delete_mode (  ) 

Definition at line 1393 of file fileview.c.

References BROWSE_MODE, DELETE_MODE, fileview_stop_update_display(), g_viewmode, and setViewMode().

Referenced by menu_on_item_activated().

01394 {
01395     fileview_stop_update_display();
01396     ctb_viewmodes_t newmode = BROWSE_MODE;
01397     switch (g_viewmode) {
01398     case BROWSE_MODE:
01399         newmode = DELETE_MODE;
01400         break;
01401     case DELETE_MODE:   // fallthrough
01402     default:
01403         newmode = BROWSE_MODE;
01404         break;
01405     }
01406     setViewMode(newmode, TRUE);
01407 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fileview_update_screen_texts (  ) 

Update screen texts, using current language setting.

---------------------------------------------------------------------------

Name : fileview_update_screen_texts

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 209 of file fileview.c.

References filemodel_set_delete_text(), fileview_refresh(), listview_set_column_headers(), and update_titles().

Referenced by main_set_locale().

00210 {
00211     listview_set_column_headers();
00212     fileview_refresh(TRUE);
00213     filemodel_set_delete_text(_("Finish Delete"));
00214     update_titles();
00215 }

Here is the call graph for this function:

Here is the caller graph for this function:

static int find_nearest_active ( int  index  )  [static]

Definition at line 555 of file fileview.c.

References filemodel_get_alpha_list(), and FILEMODEL_NUM_ALPHA.

Referenced by on_letter_click().

00555                                           {
00556     const gchar* list = filemodel_get_alpha_list();
00557     if (index >= 1 && list[index-1]) return index-1;
00558     if (index <= FILEMODEL_NUM_ALPHA-1 && list[index+1]) return index+1;
00559     return -1;
00560 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void get_cursor ( gint *  row,
gint *  column 
) [static]

Definition at line 464 of file fileview.c.

References CTB_CONTENTVIEW, CTB_ICONVIEW, CTB_LISTVIEW, ERGTK_ICON_VIEW, ergtk_icon_view_get_cursor(), ERGTK_LIST_VIEW, ergtk_list_view_get_cursor(), g_current_view, g_iconview, and g_listview.

Referenced by fileview_show_next_page(), and fileview_show_prev_page().

00465 {
00466     // select first item and set cursor
00467     switch (g_current_view)
00468     {
00469         case CTB_ICONVIEW:
00470             g_assert(g_iconview);
00471             ergtk_icon_view_get_cursor( ERGTK_ICON_VIEW(g_iconview), row, column );
00472             break;
00473         case CTB_LISTVIEW:
00474         case CTB_CONTENTVIEW:
00475             g_assert(g_listview);
00476             ergtk_list_view_get_cursor( ERGTK_LIST_VIEW(g_listview), row);
00477             *column = 0;
00478             break;
00479         default:
00480             g_assert_not_reached();
00481     }
00482 }

Here is the call graph for this function:

Here is the caller graph for this function:

static filelist_entry_t* get_entry_at_cursor (  )  [static]

Definition at line 1410 of file fileview.c.

References CTB_CONTENTVIEW, CTB_ICONVIEW, CTB_LISTVIEW, filelist_entry_t::directory_path, filemodel_get_current_dir(), g_current_view, g_iconview, g_listview, get_filemodel(), iter_to_entry(), and path.

Referenced by fileview_create_shortcut(), get_filename_at_cursor(), and handle_activate_item().

01411 {
01412     filelist_entry_t *entry = NULL;
01413 
01414     switch (g_current_view) {
01415         case CTB_ICONVIEW:
01416         {
01417             GtkIconView *iconview = GTK_ICON_VIEW(g_iconview);
01418             GtkTreePath *path = NULL;
01419             gboolean cursor = gtk_icon_view_get_cursor(iconview, &path, NULL);
01420             if (cursor) {
01421                 GtkTreeModel* model = get_filemodel();
01422                 GtkTreeIter iter;
01423                 gtk_tree_model_get_iter(model, &iter, path);
01424                 entry = iter_to_entry(model, &iter);
01425             }
01426             gtk_tree_path_free(path);
01427             break;
01428         }
01429         case CTB_LISTVIEW:
01430         case CTB_CONTENTVIEW:
01431         {
01432             GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_listview));
01433             GtkTreeModel *model;
01434             GtkTreeIter iter;
01435             if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
01436                 entry = iter_to_entry(model, &iter);
01437             }
01438             break;
01439         }
01440         default:
01441             break;
01442     }
01443 
01444     if (entry) {
01445         if (strcmp(entry->directory_path->str, ".") == 0) {
01446             g_string_assign(entry->directory_path, filemodel_get_current_dir());
01447         }
01448     }
01449     return entry;
01450 }

Here is the call graph for this function:

Here is the caller graph for this function:

static gchar * get_filename_at_cursor (  )  [static]

Definition at line 1494 of file fileview.c.

References filelist_entry_free(), filelist_entry_t::filename, filename, and get_entry_at_cursor().

Referenced by fileview_refresh(), fileview_set_sort_order(), and fileview_set_view_type().

01495 {
01496     gchar *filename = NULL;
01497     filelist_entry_t *entry = get_entry_at_cursor();
01498     if (entry) {
01499         filename = g_strdup(entry->filename->str);
01500         filelist_entry_free(entry);
01501     }
01502     return filename;
01503 }

Here is the call graph for this function:

Here is the caller graph for this function:

ctb_viewtypes_t get_viewtype_from_registry ( void   ) 

Definition at line 333 of file fileview.c.

References client, CTB_AUTOSELECT, CTB_CONTENTVIEW, CTB_ICONVIEW, CTB_LISTVIEW, device_caps_t::has_stylus, ipc_sys_get_device_capabilities(), LOGPRINTF, REGKEY_VIEWTYPE, REGVAL_VIEWTYPE_CONTENT, REGVAL_VIEWTYPE_ICON, REGVAL_VIEWTYPE_LIST, and WARNPRINTF.

Referenced by fileview_create(), and fileview_media_mounted().

00334 {
00335     LOGPRINTF("");
00336 
00337     // get registry value
00338     GConfClient *client = gconf_client_get_default();
00339     gchar* val = gconf_client_get_string(client, REGKEY_VIEWTYPE, NULL);
00340     g_object_unref(client);
00341 
00342     // convert string value to viewtype
00343     ctb_viewtypes_t view = CTB_AUTOSELECT;
00344     if (val)
00345     {
00346         if ( strcmp(val, REGVAL_VIEWTYPE_ICON) == 0 )
00347         {
00348             view = CTB_ICONVIEW;
00349         }
00350         else if ( strcmp(val, REGVAL_VIEWTYPE_LIST) == 0 )
00351         {
00352             view = CTB_LISTVIEW;
00353         }
00354         else if ( strcmp(val, REGVAL_VIEWTYPE_CONTENT) == 0 )
00355         {
00356             view = CTB_CONTENTVIEW;
00357         }
00358         g_free(val);
00359     } else {
00360         WARNPRINTF("error fetching GConf key %s", REGKEY_VIEWTYPE);
00361     }
00362 
00363     // for auto-select choose view depending on stylus availability
00364     if (view == CTB_AUTOSELECT)
00365     {
00366         const device_caps_t *dev_caps = ipc_sys_get_device_capabilities();
00367         g_assert(dev_caps);
00368         if (dev_caps->has_stylus)
00369         {
00370             view = CTB_ICONVIEW;
00371         }
00372         else
00373         {
00374             view = CTB_LISTVIEW;
00375         }
00376     }
00377 
00378     return view;
00379 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void handle_activate_item (  )  [static]

Definition at line 1463 of file fileview.c.

References activate_item(), filelist_entry_free(), get_entry_at_cursor(), and START_TIMER.

Referenced by on_iconview_item_activated(), and on_listview_row_activated().

01464 {
01465     START_TIMER();
01466     filelist_entry_t *entry = get_entry_at_cursor();
01467     if (entry) {
01468         activate_item(entry);
01469         filelist_entry_free(entry);
01470     }
01471 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void handle_delete_activated ( GtkTreeModel *  model,
GtkTreeIter *  iter 
) [static]

Definition at line 1104 of file fileview.c.

References alphabar_update(), BROWSE_MODE, CONFIRM, DM_HINT_CURSOR, filemodel_delete_toggled(), filemodel_num_toggled(), filemodel_set_delete_text(), filemodel_toggle_entry(), fileview_stop_update_display(), g_delete_state, INITIAL, ipc_sys_busy(), isFirstItem(), iter_to_index(), MODCOL_TOGGLED, on_idle_update_display(), reset_delete_state(), setViewMode(), and START_TIMER.

Referenced by on_contentview_row_activated_delete(), and on_iconview_item_activated_delete().

01105 {
01106     START_TIMER();
01107     fileview_stop_update_display();
01108     if (isFirstItem(model, iter)) {    // special item (Delete action)
01109         // check whether first click or confirm
01110         if (g_delete_state == INITIAL) {
01111             int count = filemodel_num_toggled();
01112             if (count > 0) {
01113                 g_delete_state = CONFIRM;
01114                 char buf[128];
01115                 // TRANSLATORS: this is an ngettext(3) call which needs a singular and plural translation
01116                 snprintf(buf, 127, ngettext("Finish Delete - delete %d item?", "Finish Delete - delete %d items?", count), count);
01117                 filemodel_set_delete_text(buf);
01118             } else {
01119                 setViewMode(BROWSE_MODE, TRUE);
01120                 return;
01121             }
01122         } else if (g_delete_state == CONFIRM) {
01123             ipc_sys_busy(TRUE);
01124             filemodel_delete_toggled();
01125             alphabar_update();
01126             setViewMode(BROWSE_MODE, TRUE);
01127             ipc_sys_busy(FALSE);
01128             return;
01129         }
01130     } else {    // normal item
01131         int toggled;
01132         gtk_tree_model_get (model, iter, MODCOL_TOGGLED, &toggled, -1);
01133         if (toggled != -1) {        // -1 means not allowed
01134             toggled = 1 - toggled;
01135             filemodel_toggle_entry(iter_to_index(model, iter), toggled, iter);
01136             reset_delete_state();
01137         }
01138     }
01139     on_idle_update_display(DM_HINT_CURSOR);
01140 }

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean isFirstItem ( GtkTreeModel *  model,
GtkTreeIter *  iter 
) [static]

Definition at line 1073 of file fileview.c.

Referenced by handle_delete_activated().

01074 {
01075     GtkTreeIter first;
01076     gtk_tree_model_get_iter_first(model, &first);
01077     if (iter->user_data == first.user_data) return TRUE;
01078     return FALSE;
01079 }

Here is the caller graph for this function:

static int iter_to_index ( GtkTreeModel *  model,
const GtkTreeIter *  iter 
) [static]

Definition at line 1082 of file fileview.c.

Referenced by handle_delete_activated().

01083 {
01084     int index = 0;
01085     GtkTreeIter iter2;
01086     gtk_tree_model_get_iter_first(model, &iter2);
01087     while (gtk_tree_model_iter_next(model, &iter2)) {
01088         index++;
01089         if (iter->user_data == iter2.user_data) break;
01090     }
01091     return index;
01092 }

Here is the caller graph for this function:

static void listview_set_column_headers (  )  [static]

Definition at line 142 of file fileview.c.

References CTB_LISTVIEW, g_current_view, and g_listview.

Referenced by fileview_set_view_type(), and fileview_update_screen_texts().

00143 {
00144 
00145     if (g_current_view != CTB_LISTVIEW) return;
00146 
00147     static const struct
00148     {
00149         const char *header;
00150         guint index;
00151     }           column_headers[] =
00152                 {
00153                     { N_("Name"),           2 },
00154                     { N_("Type"),           4 },
00155                     { N_("Size"),           6 },
00156                     { N_("Date Modified"),  8 },
00157                     { NULL, 0 }  // end of list
00158                 };
00159 
00160     int i;
00161     for (i = 0 ; column_headers[i].header ; i++)
00162     {
00163         GtkTreeViewColumn *column = gtk_tree_view_get_column( GTK_TREE_VIEW(g_listview), column_headers[i].index );
00164         if (column)
00165         {
00166             gtk_tree_view_column_set_title(column, _(column_headers[i].header));
00167         }
00168     }
00169 }

Here is the caller graph for this function:

static void on_contentview_row_activated_delete ( GtkTreeView *  view,
GtkTreePath *  path,
GtkTreeViewColumn *  column,
gpointer  user_data 
) [static]

Definition at line 1155 of file fileview.c.

References handle_delete_activated(), and WARNPRINTF.

Referenced by setViewModeListView().

01159 {
01160     GtkTreeSelection *selection = gtk_tree_view_get_selection(view);
01161     GtkTreeModel *model;
01162     GtkTreeIter iter;
01163     if (!gtk_tree_selection_get_selected(selection, &model, &iter)) {
01164         WARNPRINTF("no row selected");
01165         return;
01166     }
01167     handle_delete_activated(model, &iter);
01168 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void on_destroy ( GtkWidget *  widget,
gpointer  data 
) [static]

Definition at line 1932 of file fileview.c.

Referenced by fileview_create().

01933 {
01934     gtk_main_quit();
01935 }

Here is the caller graph for this function:

static gboolean on_file_search_clicked ( GtkWidget *  button,
GdkEventButton *  event,
gpointer  data 
) [static]

Definition at line 682 of file fileview.c.

References fileview_show_search_dialog().

Referenced by create_screen_layout().

00683 {
00684     fileview_show_search_dialog();
00685     return FALSE;
00686 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void on_iconview_item_activated ( GtkIconView *  iconview,
GtkTreePath *  path,
gpointer  user_data 
) [static]

Definition at line 815 of file fileview.c.

References handle_activate_item().

Referenced by create_iconview(), and setViewModeIconView().

00818 {
00819     handle_activate_item();
00820 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void on_iconview_item_activated_delete ( GtkIconView *  iconview,
GtkTreePath *  path,
gpointer  user_data 
) [static]

Definition at line 1143 of file fileview.c.

References get_filemodel(), and handle_delete_activated().

Referenced by setViewModeIconView().

01146 {
01147     GtkTreeModel* model = get_filemodel();
01148     GtkTreeIter iter;
01149     gtk_tree_model_get_iter(model, &iter, path);
01150 
01151     handle_delete_activated(model, &iter);
01152 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void on_iconview_navigate_cursor ( erGtkIconView er_iconview,
erGtkIconViewKeyPress  keycode,
gpointer  user_data 
) [static]

Definition at line 839 of file fileview.c.

References ergtk_icon_view_get_cursor(), ergtk_icon_view_get_view_size(), ERGTK_ICON_VIEW_PRESS_LONG_DOWN, ERGTK_ICON_VIEW_PRESS_LONG_LEFT, ERGTK_ICON_VIEW_PRESS_LONG_RIGHT, ERGTK_ICON_VIEW_PRESS_LONG_UP, ERGTK_ICON_VIEW_PRESS_SHORT_DOWN, ERGTK_ICON_VIEW_PRESS_SHORT_LEFT, ERGTK_ICON_VIEW_PRESS_SHORT_RIGHT, ERGTK_ICON_VIEW_PRESS_SHORT_UP, ERRORPRINTF, filemodel_has_next_page(), filemodel_has_prev_page(), fileview_page_next(), fileview_page_previous(), and LOGPRINTF.

Referenced by create_iconview().

00842 {
00843     // old iconview details
00844     gint        old_row;
00845     gint        old_col;
00846     gint        num_rows;
00847     gint        num_cols;
00848     gint        num_items;
00849 
00850     // new iconview details
00851     gboolean    prev_page = FALSE;      // goto previous page
00852     gboolean    next_page = FALSE;      // goto next page
00853     gint        new_row = 0;
00854     gint        new_col = 0;
00855 
00856     LOGPRINTF("entry: keycode [%d]", keycode);
00857 
00858     // get iconview details
00859     ergtk_icon_view_get_cursor(er_iconview, &old_row, &old_col);
00860     ergtk_icon_view_get_view_size(er_iconview, &num_rows, &num_cols, &num_items);
00861 
00862     // determine new cursor position
00863     switch (keycode)
00864     {
00865         case ERGTK_ICON_VIEW_PRESS_SHORT_UP:
00866             // previous page, last row, same column
00867             prev_page = TRUE;
00868             new_row   = num_rows - 1;
00869             new_col   = old_col;
00870             break;
00871 
00872         case ERGTK_ICON_VIEW_PRESS_SHORT_DOWN:
00873             // next page, first row, same column
00874             next_page = TRUE;
00875             new_row   = 0;
00876             new_col   = old_col;
00877             break;
00878 
00879         case ERGTK_ICON_VIEW_PRESS_SHORT_LEFT:
00880             // previous page, last item
00881             prev_page = TRUE;
00882             new_row   = num_rows - 1;
00883             new_col   = num_cols - 1;
00884             break;
00885 
00886         case ERGTK_ICON_VIEW_PRESS_SHORT_RIGHT:
00887             // next page, first item
00888             next_page = TRUE;
00889             new_row   = 0;
00890             new_col   = 0;
00891             break;
00892 
00893         case ERGTK_ICON_VIEW_PRESS_LONG_UP:
00894             // previous page, same position
00895             prev_page = TRUE;
00896             new_row   = old_row;
00897             new_col   = old_col;
00898             break;
00899 
00900         case ERGTK_ICON_VIEW_PRESS_LONG_DOWN:
00901             // next page, same position
00902             next_page = TRUE;
00903             new_row   = old_row;
00904             new_col   = old_col;
00905             break;
00906 
00907         case ERGTK_ICON_VIEW_PRESS_LONG_LEFT:
00908             // previous page, start of last row
00909             prev_page = TRUE;
00910             new_row   = num_rows - 1;
00911             new_col   = 0;
00912             break;
00913 
00914         case ERGTK_ICON_VIEW_PRESS_LONG_RIGHT:
00915             // next page, end of first row
00916             next_page = TRUE;
00917             new_row   = 0;
00918             new_col   = num_cols - 1;
00919             break;
00920 
00921         default:
00922             ERRORPRINTF("illegal erGtkIconViewKeyPress [%d]", keycode);
00923             ;  // ignore
00924     }
00925 
00926     // move page as needed, set new cursor position
00927     if ( prev_page  &&  filemodel_has_prev_page() )
00928     {
00929         fileview_page_previous(new_row, new_col);
00930     }
00931     else if ( next_page  &&  filemodel_has_next_page())
00932     {
00933         fileview_page_next(new_row, new_col);
00934     }
00935 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void on_iconview_size_allocate ( GtkWidget *  widget,
GtkAllocation *  allocation,
gpointer  user_data 
) [static]

Definition at line 1611 of file fileview.c.

References filemodel_window_is_on_top(), g_height, g_width, and update_view_size().

Referenced by create_iconview().

01614 {
01615     g_width = allocation->width;
01616     g_height = allocation->height;
01617     if (filemodel_window_is_on_top()) update_view_size();
01618 }

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean on_idle_set_cursor ( gpointer  data  )  [static]

Definition at line 515 of file fileview.c.

References CTB_CONTENTVIEW, CTB_ICONVIEW, CTB_LISTVIEW, DM_HINT_FULL, ERGTK_ICON_VIEW, ergtk_icon_view_set_cursor(), ERGTK_LIST_VIEW, ergtk_list_view_set_cursor(), g_current_view, g_cursor_in_progress, g_cursor_update_type, g_iconview, g_listview, and on_idle_update_display().

Referenced by set_cursor().

00516 {
00517     gulong  row_col = (gulong)data;
00518     gint    row    = (row_col >> 8) & 0xFF;
00519     gint    column =  row_col       & 0x00FF;
00520 
00521     // select first item and set cursor
00522     switch (g_current_view)
00523     {
00524         case CTB_ICONVIEW:
00525             g_assert(g_iconview);
00526             ergtk_icon_view_set_cursor( ERGTK_ICON_VIEW(g_iconview), row, column );
00527             break;
00528         case CTB_LISTVIEW:
00529         case CTB_CONTENTVIEW:
00530             g_assert(g_listview);
00531             ergtk_list_view_set_cursor( ERGTK_LIST_VIEW(g_listview), row);
00532             break;
00533         default:
00534             g_assert_not_reached();
00535     }
00536     g_cursor_in_progress = FALSE;
00537     on_idle_update_display(g_cursor_update_type);
00538     g_cursor_update_type = DM_HINT_FULL;
00539     return FALSE;  // don't call me again
00540 }

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean on_idle_set_cursor_at_filename ( gpointer  data  )  [static]

Definition at line 1560 of file fileview.c.

References alphabar_select(), filemodel_get_first_alpha_index(), filemodel_scroll_to_filename(), filename, and set_cursor_at_filename().

Referenced by fileview_set_cursor_at_filename().

01561 {
01562     gchar *filename = (gchar*)data;
01563 
01564     filemodel_scroll_to_filename(filename);
01565     alphabar_select(filemodel_get_first_alpha_index());
01566     set_cursor_at_filename(filename);
01567 
01568     g_free(filename);
01569 
01570     return FALSE;  // don't call me again
01571 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void on_idle_update_display ( gint  type  )  [static]

Definition at line 507 of file fileview.c.

References g_got_display_control, and update_display().

Referenced by fileview_show_search_dialog(), handle_delete_activated(), on_idle_set_cursor(), and show_error_dialog().

00508 {
00509     if (g_got_display_control) {
00510         g_idle_add(update_display, (gpointer) type);
00511     }
00512 }

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean on_letter_click ( GtkWidget *  widget,
GdkEventButton *  event,
gpointer  user_data 
) [static]

Definition at line 563 of file fileview.c.

References alphabar_select(), filemodel_get_alpha_list(), fileview_stop_update_display(), find_nearest_active(), g_last_clicked_index, g_selected_letter, letters, scroll_to_letter(), START_TIMER, and UNUSED.

Referenced by create_alpha_bar().

00564 {
00565     UNUSED(widget);
00566     UNUSED(event);
00567     START_TIMER();
00568     const gchar* list = filemodel_get_alpha_list();
00569     int index = (int)user_data;
00570     if (list[index] == 0) {
00571         index = find_nearest_active(index);
00572     }
00573     if (index != -1) {
00574         fileview_stop_update_display();
00575         if (index != g_selected_letter) alphabar_select(index);
00576 
00577         // clicking on same letter twice jumps to file with initial, otherwise jump to directory
00578         gboolean jump_to_dir = TRUE;
00579         if (index == g_last_clicked_index) {
00580             jump_to_dir = FALSE;
00581             g_last_clicked_index = -1;
00582         } else {
00583             g_last_clicked_index = index;
00584         }
00585         scroll_to_letter(letters[index][0], jump_to_dir);
00586     }
00587     return FALSE;
00588 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void on_listview_navigate_cursor ( erGtkListView er_listview,
erGtkListViewKeyPress  keycode,
gpointer  user_data 
) [static]

Definition at line 997 of file fileview.c.

References ergtk_list_view_get_cursor(), ergtk_list_view_get_view_size(), ERGTK_LIST_VIEW_PRESS_LONG_DOWN, ERGTK_LIST_VIEW_PRESS_LONG_UP, ERGTK_LIST_VIEW_PRESS_SHORT_DOWN, ERGTK_LIST_VIEW_PRESS_SHORT_UP, ERRORPRINTF, filemodel_has_next_page(), filemodel_has_prev_page(), fileview_page_next(), fileview_page_previous(), LOGPRINTF, and set_cursor().

Referenced by create_contentview(), and create_listview().

01000 {
01001     // old listview details
01002     gint        old_row;
01003     gint        num_rows;
01004     gint        num_items;
01005 
01006     // new listview details
01007     gboolean    prev_page = FALSE;      // goto previous page
01008     gboolean    next_page = FALSE;      // goto next page
01009     gint        new_row = 0;
01010 
01011     LOGPRINTF("entry: keycode [%d]", keycode);
01012 
01013     // get listview details
01014     ergtk_list_view_get_cursor(er_listview, &old_row);
01015     ergtk_list_view_get_view_size(er_listview, &num_rows, &num_items);
01016 
01017     // determine new cursor position
01018     switch (keycode)
01019     {
01020         case ERGTK_LIST_VIEW_PRESS_SHORT_UP:
01021             // previous page, last row
01022             prev_page = TRUE;
01023             new_row   = num_rows - 1;
01024             break;
01025 
01026         case ERGTK_LIST_VIEW_PRESS_SHORT_DOWN:
01027             // next page, first row
01028             next_page = TRUE;
01029             new_row   = 0;
01030             break;
01031 
01032         case ERGTK_LIST_VIEW_PRESS_LONG_UP:
01033             if (filemodel_has_prev_page()) {
01034                 // previous page, same row
01035                 prev_page = TRUE;
01036                 new_row   = old_row;
01037             } else {
01038                 // first row on same page
01039                 set_cursor(new_row, 0);
01040                 return;
01041             }
01042             break;
01043 
01044         case ERGTK_LIST_VIEW_PRESS_LONG_DOWN:
01045             if (filemodel_has_next_page()) {
01046                 // next page, same row
01047                 next_page = TRUE;
01048                 new_row   = old_row;
01049             } else {
01050                 // last row on same page
01051                 set_cursor(40, 0);
01052                 return;
01053             }
01054             break;
01055 
01056         default:
01057             ERRORPRINTF("illegal erGtkListViewKeyPress [%d]", keycode);
01058             ;  // ignore
01059     }
01060 
01061     // move page as needed, set new cursor position
01062     if ( prev_page  &&  filemodel_has_prev_page() )
01063     {
01064         fileview_page_previous(new_row, 0);
01065     }
01066     else if ( next_page  &&  filemodel_has_next_page() )
01067     {
01068         fileview_page_next(new_row, 0);
01069     }
01070 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void on_listview_row_activated ( GtkTreeView *  view,
GtkTreePath *  path,
GtkTreeViewColumn *  column,
gpointer  user_data 
) [static]

Definition at line 988 of file fileview.c.

References handle_activate_item().

Referenced by create_contentview(), create_listview(), and setViewModeListView().

00992 {
00993     handle_activate_item();
00994 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void on_listview_size_allocate ( GtkWidget *  widget,
GtkAllocation *  allocation,
gpointer  user_data 
) [static]

Definition at line 978 of file fileview.c.

References filemodel_window_is_on_top(), g_height, g_width, and update_view_size().

Referenced by create_contentview(), and create_listview().

00981 {
00982     g_width = allocation->width;
00983     g_height = allocation->height;
00984     if (filemodel_window_is_on_top()) update_view_size();
00985 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void reset_delete_state (  )  [static]

Definition at line 1095 of file fileview.c.

References filemodel_set_delete_text(), g_delete_state, and INITIAL.

Referenced by fileview_init(), handle_delete_activated(), and setViewMode().

01096 {
01097     if (g_delete_state != INITIAL) {
01098         g_delete_state = INITIAL;
01099         filemodel_set_delete_text(_("Finish Delete"));
01100     }
01101 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void save_viewtype_to_registry ( ctb_viewtypes_t  view  )  [static]

Definition at line 398 of file fileview.c.

References client, CTB_CONTENTVIEW, CTB_ICONVIEW, CTB_LISTVIEW, ERRORPRINTF, LOGPRINTF, REGKEY_VIEWTYPE, REGVAL_VIEWTYPE_AUTO, REGVAL_VIEWTYPE_CONTENT, REGVAL_VIEWTYPE_ICON, and REGVAL_VIEWTYPE_LIST.

Referenced by fileview_save_view_type().

00399 {
00400     GConfClient  *client  = NULL;
00401     gchar        *val_old = NULL;
00402     const gchar  *val_new = NULL;
00403     GError       *err     = NULL;
00404 
00405     LOGPRINTF("entry");
00406 
00407     // convert viewtype to string value
00408     switch (view)
00409     {
00410         case CTB_ICONVIEW:
00411             val_new = REGVAL_VIEWTYPE_ICON;
00412             break;
00413         case CTB_LISTVIEW:
00414             val_new = REGVAL_VIEWTYPE_LIST;
00415             break;
00416         case CTB_CONTENTVIEW:
00417             val_new = REGVAL_VIEWTYPE_CONTENT;
00418             break;
00419         default:
00420             val_new = REGVAL_VIEWTYPE_AUTO;
00421     }
00422 
00423     // save to registry
00424     client = gconf_client_get_default();
00425     val_old = gconf_client_get_string(client, REGKEY_VIEWTYPE, NULL);
00426     if (   val_old == NULL
00427         || strcmp(val_old, val_new) != 0 )
00428     {
00429         gboolean ok = gconf_client_set_string(client, REGKEY_VIEWTYPE, val_new, &err);
00430         if ( !ok )
00431         {
00432             ERRORPRINTF("cannot write registry key [%s] - error [%s]", REGKEY_VIEWTYPE, err->message);
00433         }
00434         g_clear_error(&err);
00435     }
00436     g_object_unref(client);
00437 
00438     g_free(val_old);
00439 }

Here is the caller graph for this function:

static void scroll_to_letter ( gchar  letter,
gboolean  jump_to_dir 
) [static]

Definition at line 1543 of file fileview.c.

References DM_HINT_CURSOR, DM_HINT_FULL, filemodel_scroll_to_letter(), g_cursor_update_type, and set_cursor_at_index().

Referenced by on_letter_click().

01544 {
01545     gboolean same_page = FALSE;
01546     int index = filemodel_scroll_to_letter(letter, jump_to_dir, &same_page);
01547     if (same_page) g_cursor_update_type = DM_HINT_CURSOR;
01548     else g_cursor_update_type = DM_HINT_FULL;
01549     set_cursor_at_index(index);
01550 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void set_cursor ( gint  row,
gint  column 
) [static]

Definition at line 543 of file fileview.c.

References g_cursor_in_progress, g_operation_in_progress, and on_idle_set_cursor().

Referenced by fileview_dir_down(), fileview_page_next(), fileview_page_previous(), fileview_show_desktop(), on_listview_navigate_cursor(), set_cursor_at_index(), setViewMode(), and update_view_size().

00544 {
00545     if (!g_cursor_in_progress) {
00546         gulong row_col = ((row & 0xFF) << 8) | (column & 0xFF);
00547 
00548         g_idle_add(on_idle_set_cursor, (gpointer)row_col);
00549         g_cursor_in_progress = TRUE;
00550         g_operation_in_progress = FALSE;
00551     }
00552 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void set_cursor_at_filename ( const gchar *  cursor_item  )  [static]

Definition at line 1553 of file fileview.c.

References filemodel_get_display_index(), and set_cursor_at_index().

Referenced by fileview_dir_up(), fileview_refresh(), fileview_set_sort_order(), and on_idle_set_cursor_at_filename().

01554 {
01555     int index = filemodel_get_display_index(cursor_item);
01556     set_cursor_at_index(index);
01557 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void set_cursor_at_index ( int  index  )  [static]

Definition at line 1506 of file fileview.c.

References CTB_CONTENTVIEW, CTB_ICONVIEW, CTB_LISTVIEW, ERGTK_ICON_VIEW, ergtk_icon_view_get_view_size(), g_current_view, g_iconview, set_cursor(), and WARNPRINTF.

Referenced by scroll_to_letter(), and set_cursor_at_filename().

01507 {
01508     gint  row   = 0;
01509     gint  col   = 0;
01510 
01511     if (index > 0)
01512     {
01513         switch (g_current_view)
01514         {
01515             case -1:
01516                 WARNPRINTF("viewtype not set");
01517                 break;
01518             case CTB_ICONVIEW:
01519             {
01520                 g_assert(g_iconview);
01521                 erGtkIconView *iconview = ERGTK_ICON_VIEW(g_iconview);
01522                 gint n_cols;
01523                 ergtk_icon_view_get_view_size(iconview, NULL, &n_cols, NULL);
01524                 if (n_cols != 0) {  // when switching view, n_cols is sometimes zero!!
01525                     row = index / n_cols;
01526                     col = index % n_cols;
01527                 }
01528                 break;
01529             }
01530             case CTB_LISTVIEW:
01531             case CTB_CONTENTVIEW:
01532                 row = index;
01533                 col = 0;
01534                 break;
01535             default:
01536                 g_assert_not_reached();
01537         }
01538     }
01539     set_cursor(row, col);
01540 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void setViewMode ( ctb_viewmodes_t  newmode,
gboolean  updateScreen 
) [static]

Definition at line 1266 of file fileview.c.

References CTB_CONTENTVIEW, CTB_ICONVIEW, CTB_LISTVIEW, DELETE_MODE, filemodel_set_viewmode(), g_current_view, g_search_button, g_viewmode, reset_delete_state(), set_cursor(), setViewModeIconView(), and setViewModeListView().

Referenced by fileview_media_unmounted(), fileview_refresh(), fileview_show_desktop(), fileview_toggle_delete_mode(), and handle_delete_activated().

01267 {
01268     if (g_viewmode == newmode) return;
01269 
01270     g_viewmode = newmode;
01271     filemodel_set_viewmode(newmode, updateScreen);
01272     reset_delete_state();
01273 
01274     if (newmode == DELETE_MODE) {
01275         gtk_widget_hide(g_search_button);
01276 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
01277         gtk_widget_hide(g_shortcut_button);
01278 #endif
01279     } else {
01280         gtk_widget_show(g_search_button);
01281 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
01282         gtk_widget_show(g_shortcut_button);
01283 #endif
01284     }
01285 
01286     switch (g_current_view)
01287     {
01288         case CTB_ICONVIEW:
01289             setViewModeIconView(newmode);
01290             break;
01291         case CTB_LISTVIEW:
01292             setViewModeListView(newmode, -1, 50);
01293             break;
01294         case CTB_CONTENTVIEW:
01295             setViewModeListView(newmode, 3, 80);
01296             break;
01297         default:
01298             g_assert_not_reached();
01299     }
01300 
01301     if (updateScreen) set_cursor(0, 0);
01302 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void setViewModeIconView ( ctb_viewmodes_t  newmode  )  [static]

Definition at line 1209 of file fileview.c.

References BROWSE_MODE, DELETE_MODE, g_handler_id, g_iconview, on_iconview_item_activated(), and on_iconview_item_activated_delete().

Referenced by setViewMode().

01210 {
01211     switch (newmode) {
01212         case BROWSE_MODE:
01213         {
01214             // change activated handler
01215             if (g_handler_id != 0) g_signal_handler_disconnect(g_iconview, g_handler_id);
01216             g_handler_id = g_signal_connect(G_OBJECT(g_iconview), "item-activated",  G_CALLBACK(on_iconview_item_activated),  NULL);
01217             break;
01218         }
01219         case DELETE_MODE:
01220         {
01221             // change activated handler
01222             if (g_handler_id != 0) g_signal_handler_disconnect(g_iconview, g_handler_id);
01223             g_handler_id = g_signal_connect(G_OBJECT(g_iconview), "item-activated",  G_CALLBACK(on_iconview_item_activated_delete),  NULL);
01224             break;
01225         }
01226     }
01227 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void setViewModeListView ( ctb_viewmodes_t  newmode,
int  position,
int  width 
) [static]

Definition at line 1230 of file fileview.c.

References BROWSE_MODE, DELETE_MODE, g_handler_id, g_listview, g_toggleColumn, on_contentview_row_activated_delete(), on_listview_row_activated(), and toggle_cell_function().

Referenced by setViewMode().

01231 {
01232     GtkTreeView *view = GTK_TREE_VIEW(g_listview);
01233     switch (newmode) {
01234         case BROWSE_MODE:
01235         {
01236             // remove toggle column
01237             if (g_toggleColumn) gtk_tree_view_remove_column(view, g_toggleColumn);
01238             g_toggleColumn = NULL;
01239 
01240             // change activated handler
01241             if (g_handler_id != 0) g_signal_handler_disconnect(g_listview, g_handler_id);
01242             g_handler_id = g_signal_connect(g_listview, "row-activated", G_CALLBACK(on_listview_row_activated), NULL);
01243             break;
01244         }
01245         case DELETE_MODE:
01246         {
01247             // add toggle column
01248             GtkCellRenderer *renderer = gtk_cell_renderer_pixbuf_new();
01249             GtkTreeViewColumn *column = gtk_tree_view_column_new();
01250             gtk_tree_view_column_pack_start (column, renderer, TRUE);
01251             gtk_tree_view_column_set_cell_data_func(column, renderer, toggle_cell_function, NULL, NULL);
01252             gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
01253             gtk_tree_view_column_set_fixed_width(column, width);
01254             gtk_tree_view_insert_column(view, column, position);
01255             g_toggleColumn = column;
01256 
01257             // change activated handler
01258             if (g_handler_id != 0) g_signal_handler_disconnect(g_listview, g_handler_id);
01259             g_handler_id = g_signal_connect(g_listview, "row-activated", G_CALLBACK(on_contentview_row_activated_delete), NULL);
01260             break;
01261         }
01262     }
01263 }

Here is the call graph for this function:

Here is the caller graph for this function:

void show_error_dialog ( const gchar *  msg  ) 

Definition at line 1305 of file fileview.c.

References DM_HINT_FULL, fileview_stop_update_display(), g_main_window, ipc_menu_block(), ipc_menu_unblock(), and on_idle_update_display().

Referenced by activate_item(), activate_shortcut(), activate_shortcut_to_application(), activate_shortcut_to_web_location(), and create_shortcut_item().

01306 {
01307     GtkWidget *dialog = gtk_message_dialog_new(
01308                             GTK_WINDOW(g_main_window),
01309                             GTK_DIALOG_DESTROY_WITH_PARENT,
01310                             GTK_MESSAGE_ERROR,
01311                             GTK_BUTTONS_OK,
01312                             msg );
01313     gtk_window_set_deletable( GTK_WINDOW(dialog), FALSE );
01314     ipc_menu_block();
01315     gtk_dialog_run( GTK_DIALOG(dialog) );
01316     fileview_stop_update_display();
01317     ipc_menu_unblock();
01318     gtk_widget_destroy( dialog );
01319     // Note: sometimes we only get partial update, force fullscreen one
01320     on_idle_update_display(DM_HINT_FULL);
01321 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void toggle_cell_function ( GtkTreeViewColumn *  col,
GtkCellRenderer *  renderer,
GtkTreeModel *  model,
GtkTreeIter *  iter,
gpointer  user_data 
) [static]

Definition at line 1171 of file fileview.c.

References CTB_CONTENTVIEW, CTB_LISTVIEW, g_current_view, get_icon_delete_toggle(), MODCOL_TOGGLED, MODTHUMB_MEDIUM, MODTHUMB_MINI, and MODTHUMB_SMALL.

Referenced by setViewModeListView().

01176 {
01177     int toggled;
01178     gtk_tree_model_get (model, iter, MODCOL_TOGGLED, &toggled, -1);
01179 
01180     GdkPixbuf *icon = NULL;
01181     gboolean show = TRUE;
01182     
01183     if (toggled == -1) {
01184         show = FALSE;
01185     } else {
01186         filemodel_thumbsize_t size = MODTHUMB_MINI;
01187         switch (g_current_view)
01188         {
01189             case CTB_LISTVIEW:
01190                 size = MODTHUMB_MINI;
01191                 break;
01192             case CTB_CONTENTVIEW:
01193                 size = MODTHUMB_SMALL;
01194                 break;
01195             default:
01196                 size = MODTHUMB_MEDIUM;
01197                 break;
01198         }
01199         icon = get_icon_delete_toggle(toggled, size);
01200     }
01201 
01202     g_object_set(G_OBJECT(renderer),
01203         "visible", show,
01204         "pixbuf", icon,
01205         NULL);
01206 }

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean update_display ( gpointer  data  )  [static]

Definition at line 495 of file fileview.c.

References display_update_return_control(), g_got_display_control, LOGPRINTF, and STOP_TIMER.

Referenced by on_idle_update_display().

00496 {
00497     LOGPRINTF("got_control=%d", g_got_display_control);
00498     if (g_got_display_control) {
00499         display_update_return_control((gint) data);
00500         g_got_display_control = FALSE;
00501         STOP_TIMER();
00502     }
00503     return FALSE;
00504 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void update_gui (  )  [static]

Definition at line 189 of file fileview.c.

References alphabar_update(), filemodel_has_searchbutton(), g_last_clicked_index, g_search_button, and update_titles().

Referenced by fileview_dir_down(), fileview_dir_up(), and fileview_show_desktop().

00190 {
00191     g_last_clicked_index = -1;
00192     if (filemodel_has_searchbutton()) {
00193         gtk_widget_show(g_search_button);
00194 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00195         gtk_widget_show(g_shortcut_button);
00196 #endif
00197     } else {
00198         gtk_widget_hide(g_search_button);
00199 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00200         gtk_widget_hide(g_shortcut_button);
00201 #endif
00202     }
00203 
00204     alphabar_update();
00205     update_titles();
00206 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void update_padding (  )  [static]

Definition at line 235 of file fileview.c.

References CTB_ICONVIEW, g_alphabar, g_background, g_current_view, ipc_sys_is_in_portrait_mode(), WINDOW_BOTTOM_PADDING, WINDOW_H_PADDING, and WINDOW_TOP_PADDING.

Referenced by alphabar_update(), and fileview_set_view_type().

00236 {
00237     int left = WINDOW_H_PADDING;
00238     int right = WINDOW_H_PADDING;
00239 
00240     // alphabar visible
00241     if (GTK_WIDGET_VISIBLE(g_alphabar)) right -= 20;
00242 
00243     // icon/contenview
00244     switch (g_current_view) {
00245         case CTB_ICONVIEW:
00246             left += 20;
00247             if (!GTK_WIDGET_VISIBLE(g_alphabar)) left += 20;
00248             break;
00249         default:
00250             break;
00251     }
00252 
00253     guint delta = (ipc_sys_is_in_portrait_mode()) ? 0 : 5;
00254     gtk_alignment_set_padding( GTK_ALIGNMENT(g_background),
00255                                ( WINDOW_TOP_PADDING - delta),
00256                                WINDOW_BOTTOM_PADDING,
00257                                left, right);
00258 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void update_titles (  )  [static]

Definition at line 172 of file fileview.c.

References filemodel_current_is_desktop(), filemodel_get_subtitle(), filemodel_get_title(), g_subtitle_label, and g_title_label.

Referenced by fileview_update_screen_texts(), and update_gui().

00173 {
00174 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00175     gtk_label_set_text(GTK_LABEL(g_home_label), _("Home"));
00176     if (filemodel_current_is_desktop()) {
00177         gtk_widget_hide(g_home_eventbox);
00178         gtk_widget_hide(g_home_separator);
00179     } else {
00180         gtk_widget_show(g_home_eventbox);
00181         gtk_widget_show(g_home_separator);
00182     }
00183 #endif
00184     gtk_label_set_text(GTK_LABEL(g_title_label), filemodel_get_title());
00185     gtk_label_set_text(GTK_LABEL(g_subtitle_label), filemodel_get_subtitle());
00186 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void update_view_for_desktop (  )  [static]

Definition at line 276 of file fileview.c.

References CTB_CONTENTVIEW, CTB_ICONVIEW, fileview_set_view_type(), and g_current_view.

Referenced by fileview_dir_up(), and fileview_show_desktop().

00277 {
00278     if (g_current_view != CTB_CONTENTVIEW && g_current_view != CTB_ICONVIEW)
00279     {
00280         fileview_set_view_type(CTB_CONTENTVIEW, FALSE);
00281     }
00282 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void update_view_size (  )  [static]

Definition at line 938 of file fileview.c.

References alphabar_select(), CTB_CONTENTVIEW, CTB_ICONVIEW, CTB_LISTVIEW, ERGTK_ICON_VIEW, ergtk_icon_view_get_view_size(), ERGTK_LIST_VIEW, ergtk_list_view_get_view_size(), filemodel_get_first_alpha_index(), filemodel_set_viewsize(), g_current_view, g_iconview, g_listview, g_operation_in_progress, and set_cursor().

Referenced by on_iconview_size_allocate(), and on_listview_size_allocate().

00939 {
00940     int num_items = 1;
00941 
00942     switch (g_current_view)
00943     {
00944         case CTB_ICONVIEW:
00945             if ( g_iconview  &&  GTK_WIDGET_VISIBLE(g_iconview) )
00946             {
00947                 int num_columns = 1;
00948                 int num_rows  = 1;
00949                 erGtkIconView *iconview = ERGTK_ICON_VIEW(g_iconview);
00950                 ergtk_icon_view_get_view_size(iconview, &num_columns, &num_rows, NULL);
00951                 num_items = num_rows * num_columns;
00952             }
00953             break;
00954         case CTB_LISTVIEW:
00955         case CTB_CONTENTVIEW:
00956             if ( g_listview  &&  GTK_WIDGET_VISIBLE(g_listview) )
00957             {
00958                 int num_rows  = 1;
00959                 erGtkListView *listview = ERGTK_LIST_VIEW(g_listview);
00960                 ergtk_list_view_get_view_size(listview, &num_rows, &num_items);
00961                 num_items = num_rows;
00962             }
00963             break;
00964         default:
00965             g_assert_not_reached();
00966     }
00967 
00968     if (num_items > 0) {
00969         gboolean changed = filemodel_set_viewsize(num_items, !g_operation_in_progress);
00970         if (changed && !g_operation_in_progress) {
00971             alphabar_select(filemodel_get_first_alpha_index());
00972             set_cursor(0,0);
00973         }
00974     }
00975 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

GtkWidget* g_alphabar = NULL [static]

Definition at line 81 of file fileview.c.

Referenced by alphabar_select(), alphabar_update(), create_alpha_bar(), and update_padding().

GtkWidget* g_background = NULL [static]
gboolean g_cursor_in_progress = FALSE [static]

Definition at line 105 of file fileview.c.

Referenced by on_idle_set_cursor(), and set_cursor().

int g_cursor_update_type = DM_HINT_FULL [static]

Definition at line 107 of file fileview.c.

Referenced by on_idle_set_cursor(), and scroll_to_letter().

Definition at line 117 of file fileview.c.

Referenced by handle_delete_activated(), and reset_delete_state().

GtkWidget* g_eventbox = NULL [static]

Definition at line 86 of file fileview.c.

Referenced by create_screen_layout(), and fileview_set_view_type().

gboolean g_got_display_control = FALSE [static]
int g_handler_id = 0 [static]
int g_height = 0 [static]
GtkWidget* g_iconview = NULL [static]
gboolean g_is_user_selected_view = FALSE [static]
GtkWidget* g_labels[FILEMODEL_NUM_ALPHA] [static]

Definition at line 121 of file fileview.c.

Referenced by alphabar_select(), alphabar_update(), and create_alpha_bar().

int g_last_clicked_index = -1 [static]

Definition at line 123 of file fileview.c.

Referenced by on_letter_click(), and update_gui().

GtkWidget* g_listview = NULL [static]
GtkWidget* g_main_window = NULL [static]
gboolean g_operation_in_progress = FALSE [static]

Definition at line 106 of file fileview.c.

Referenced by fileview_set_view_type(), set_cursor(), and update_view_size().

GtkWidget* g_search_button = NULL [static]

Definition at line 94 of file fileview.c.

Referenced by create_screen_layout(), setViewMode(), and update_gui().

GtkWidget* g_search_dialog = NULL [static]

Definition at line 95 of file fileview.c.

Referenced by fileview_media_unmounted(), and fileview_show_search_dialog().

int g_selected_letter = -1 [static]

Definition at line 122 of file fileview.c.

Referenced by alphabar_select(), and on_letter_click().

GtkWidget* g_subtitle_label = NULL [static]

Definition at line 93 of file fileview.c.

Referenced by create_screen_layout(), fileview_set_sort_order(), and update_titles().

GtkWidget* g_title_label = NULL [static]

Definition at line 92 of file fileview.c.

Referenced by create_screen_layout(), and update_titles().

GtkTreeViewColumn* g_toggleColumn = NULL [static]

Definition at line 102 of file fileview.c.

Referenced by setViewModeListView().

ctb_viewmodes_t g_viewmode = BROWSE_MODE [static]
int g_width = 0 [static]
const char* letters[FILEMODEL_NUM_ALPHA] = {"#", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"} [static]

Definition at line 120 of file fileview.c.

Referenced by alphabar_select(), create_alpha_bar(), and on_letter_click().

const gchar* REGKEY_VIEWTYPE = "/apps/er/sys/ctb/viewtype" [static]

Definition at line 69 of file fileview.c.

Referenced by get_viewtype_from_registry(), and save_viewtype_to_registry().

const gchar* REGVAL_VIEWTYPE_AUTO = "auto-select" [static]

Definition at line 73 of file fileview.c.

Referenced by save_viewtype_to_registry().

const gchar* REGVAL_VIEWTYPE_CONTENT = "listcontent" [static]

Definition at line 72 of file fileview.c.

Referenced by get_viewtype_from_registry(), and save_viewtype_to_registry().

const gchar* REGVAL_VIEWTYPE_ICON = "iconview" [static]

Definition at line 70 of file fileview.c.

Referenced by get_viewtype_from_registry(), and save_viewtype_to_registry().

const gchar* REGVAL_VIEWTYPE_LIST = "listview" [static]

Definition at line 71 of file fileview.c.

Referenced by get_viewtype_from_registry(), and save_viewtype_to_registry().

Generated by  doxygen 1.6.2-20100208