~ubuntu-branches/debian/sid/tickr/sid

« back to all changes in this revision

Viewing changes to src/tickr/tickr_quickfeedpicker.c

  • Committer: Package Import Robot
  • Author(s): Emmanuel Thomas-Maurin
  • Date: 2012-06-04 14:23:24 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120604142324-j6ycu0cw6vvoahhy
Tags: 0.6.1-1
* Add: 'quick setup' thing (in tickr_quicksetup.c) which is launched
  at program startup if config file doesn't exist.

* Little improvements in layout of 'feed picker win' and 'preferences
  win'.

* Fix a segfault that happens when trying to export params and no
  config file exists yet.

* Make several windows that should not be resized by user, unresizable.

* Fix Launchpad bug #1007346: When 'window always-on-top' is disabled,
  'visible on all user desktops' stops working.

* If mouse wheel scrolling applies to speed (or feed), then Ctrl +
  mouse wheel scrolling applies to feed (or speed.)

* No real code changes in libetm, only in comments, so no need for a
  new version number.

* Update tickr_helptext.c and tickr.1 (man page.)

* Add new cli option 'no-ui' (similar to 'instance-id') used by new
  IF_UI_ALLOWED macro and remove all #if USE_GUI occurences.

* In tickr_list.c, free listfname before using it. Fixed by swapping 2
  lines:
    warning(FALSE, 4, "Can't save URL list ", listfname, ...);
    l_str_free(listfname);

* Use/add #define
    FONT_MAXLEN         68
    ARBITRARY_TASKBAR_HEIGHT    25
  to replace a few 'magic' numeric values.

* Rename: rss_title/description(_delimiter) ->
    item_title/description(_delimiter)
  then add new param: feed_title(_delimiter). Now we have:
  feed title / item title / item description.

* Use table in resource properties window.

* Fix a bug in f_list_load_from_file() in tickr_list.c which
  uncorrectly retrieves any feed title string containing TITLE_TAG_CHAR
  when TITLE_TAG_CHAR has not been removed from string first, for
  instance: 'NYT > World' -> ' World'.

* New param: disable left-click.

* Add 'check for updates' feature.

* Launch 'import OPML file' if feed list doesn't exist.

* Remove code changing get_params()->disable_popups value in
    START/END_PAUSE_TICKER_WHILE_OPENING
  macros which prevents this setting to be saved and add
    START/END_PAUSE_TICKER_ENABLE_POPUPS_WHILE_OPENING
  new macros. Which ones to use depends on context.

* Move:
    #ifdef G_OS_WIN32
    extern FILE *stdout_fp, *stderr_fp;
    #endif
  from *.c into tickr.h.

* Default always-on-top setting changed to 'n' (so that tickr is not
  intrusive by default.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
#include "tickr.h"
20
20
 
21
 
#if USE_GUI
22
 
 
23
21
static GtkWidget        *dialog, *sc_win;
24
22
static FList            *flist;
25
 
static int              f_index;        /* starting at 0 (row starts at 1) */
 
23
static int              f_index;        /* Starting at 0 (row starts at 1) */
26
24
static char             url[FILE_NAME_MAXLEN + 1];
27
25
 
28
26
enum {COLUMN_INT, COLUMN_STRING_TITLE, COLUMN_STRING_URL, N_COLUMNS};
29
27
 
30
 
static gint esc_key_pressed(GtkWidget *dialog2, GdkEventKey *event)
31
 
{
32
 
        if (event->keyval == GDK_Escape) {
33
 
                gtk_dialog_response(GTK_DIALOG(dialog2), GTK_RESPONSE_CLOSE);
34
 
                return TRUE;
35
 
        } else
36
 
                return FALSE;
37
 
}
38
 
 
39
 
static gint enter_key_pressed(GtkWidget *dialog2, GdkEventKey *event)
40
 
{
41
 
        if (event->keyval == GDK_Return) {
 
28
static gint enter_key_pressed(GtkWidget *dialog2, GdkEventKey *event_key)
 
29
{
 
30
        if (event_key->keyval == GDK_Return) {
42
31
                gtk_dialog_response(GTK_DIALOG(dialog2), GTK_RESPONSE_OK);
43
32
                return TRUE;
44
33
        } else
45
34
                return FALSE;
46
35
}
47
36
 
48
 
static void force_quit_dialog(GtkWidget *dialog2)
49
 
{
50
 
        gtk_dialog_response(GTK_DIALOG(dialog2), GTK_RESPONSE_CLOSE);
51
 
}
52
 
 
53
 
/* tree selection callback - get url */
 
37
/* Tree selection callback - get url */
54
38
static gint tree_selection_changed(GtkTreeSelection *selection)
55
39
{
56
40
        GtkTreeModel    *tree_model;
69
53
        return TRUE;
70
54
}
71
55
 
72
 
/* catch double-click on tree view */
 
56
/* Catch double-click on tree view */
73
57
static gint double_click_on_tree_view(GtkTreeView *tree_view, GtkTreePath *tree_path)
74
58
{
75
59
        GtkTreeModel    *tree_model;
89
73
        return TRUE;
90
74
}
91
75
 
92
 
/* clear the list before filling it */
 
76
/* Clear the list before filling it */
93
77
static void fill_list_store_from_flnode(GtkListStore *list_store)
94
78
{
95
79
        FList           *flist2;
109
93
                }
110
94
}
111
95
 
112
 
/* actually ***selected feed*** picker */
 
96
/* Actually ***selected feed*** picker */
113
97
void quick_feed_picker(int up_or_down)
114
98
{
115
99
        GtkTreeView             *tree_view;
119
103
        GtkTreeSelection        *selection;
120
104
        gint                    response;
121
105
 
122
 
        up_or_down = up_or_down;        /* unused so far */
 
106
        up_or_down = up_or_down;        /* Unused so far */
123
107
 
124
108
        dialog = gtk_dialog_new_with_buttons(
125
109
                        "Selected Feed Picker", GTK_WINDOW(get_ticker_env()->win),
128
112
 
129
113
        set_tickr_icon_to_dialog(GTK_WINDOW(dialog));
130
114
        gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE);
 
115
        gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);
131
116
        gtk_container_set_border_width(GTK_CONTAINER(dialog), 0);
132
117
        gtk_widget_set_size_request(dialog, 450, 200);
133
118
 
142
127
                fill_list_store_from_flnode(list_store);
143
128
        } else {
144
129
                warning(FALSE, 2, "No feed selection available\n",
145
 
                        "(You have set 'Mouse wheel scrolling apply to: Feed' and\n"
 
130
                        "(You have set 'Mouse wheel scrolling applies to: Feed' and\n"
146
131
                        "either there is no feed list or no feed has been selected)");
147
132
                gtk_widget_destroy(dialog);
148
133
                return;
184
169
        }
185
170
        gtk_widget_destroy(dialog);
186
171
}
187
 
#endif