~ubuntu-branches/ubuntu/vivid/liferea/vivid-proposed

« back to all changes in this revision

Viewing changes to src/ui/search_folder_dialog.c

  • Committer: Package Import Robot
  • Author(s): Moray Allan, Bojo42, Rodrigo Gallardo, Moray Allan
  • Date: 2012-03-27 21:44:42 UTC
  • mfrom: (1.5.1)
  • mto: (3.3.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 122.
  • Revision ID: package-import@ubuntu.com-20120327214442-g0xfh714cdmsbnts
Tags: 1.8.3-0.1
[ Bojo42 ]
* Non-maintainer upload.
* New upstream release (Closes: #502307, #623619, #631778, #651913) 
* debian/patches:
  - drop libnotify0.7 as in upstream
  - debian-example-feeds: update, move planets from "News" to "Open Source"
  - www-browser: update due to new file location
  - libtool-dont-rearange-as-needed: rebase
* debian/control:
  - update Standards-Version
  - remove obsolete Build-Depends:
    - quilt not needed for "3.0 (quilt)" source format
    - libnm-glib-dev & libdbus-glib-1-dev: upstream switched to GDBus
    - liblua5.1-0-dev: LUA scripting support got dropped
  - new Build-Depends on libunique-dev, libjson-glib-dev & dh_autoreconf
  - update version dependencies
* debian/rules: run dh_autoreconf & update translations
* debian/liferea.install: nothing to ship from /usr/lib/liferea

[ Rodrigo Gallardo ]
* Lintian love:
  - debian/control: switch from Conflicts to Breaks
  - debian/rules: redo build targets

[ Moray Allan ]
* debian/copyright: update to include additional copyright owners.
* debian/patches/www-browser: also set default external browser.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
2
 * @file search-folder-dialog.c  Search folder properties dialog
3
3
 *
4
 
 * Copyright (C) 2007-2008 Lars Lindner <lars.lindner@gmail.com>
 
4
 * Copyright (C) 2007-2011 Lars Lindner <lars.lindner@gmail.com>
5
5
 *
6
6
 * This program is free software; you can redistribute it and/or modify
7
7
 * it under the terms of the GNU General Public License as published by
23
23
#include "feedlist.h"
24
24
#include "itemlist.h"
25
25
#include "vfolder.h"
 
26
#include "ui/itemview.h"
26
27
#include "ui/liferea_dialog.h"
27
28
#include "ui/liferea_shell.h"
28
29
#include "ui/rule_editor.h"
29
 
#include "ui/ui_itemlist.h"
30
30
#include "ui/ui_node.h"
31
31
 
32
 
static void search_folder_dialog_class_init     (SearchFolderDialogClass *klass);
33
 
static void search_folder_dialog_init           (SearchFolderDialog *ld);
34
 
 
35
32
#define SEARCH_FOLDER_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), SEARCH_FOLDER_DIALOG_TYPE, SearchFolderDialogPrivate))
36
33
 
37
34
struct SearchFolderDialogPrivate {
43
40
 
44
41
static GObjectClass *parent_class = NULL;
45
42
 
46
 
GType
47
 
search_folder_dialog_get_type (void) 
48
 
{
49
 
        static GType type = 0;
50
 
 
51
 
        if (G_UNLIKELY (type == 0)) 
52
 
        {
53
 
                static const GTypeInfo our_info = 
54
 
                {
55
 
                        sizeof (SearchFolderDialogClass),
56
 
                        NULL, /* base_init */
57
 
                        NULL, /* base_finalize */
58
 
                        (GClassInitFunc) search_folder_dialog_class_init,
59
 
                        NULL,
60
 
                        NULL, /* class_data */
61
 
                        sizeof (SearchFolderDialog),
62
 
                        0, /* n_preallocs */
63
 
                        (GInstanceInitFunc) search_folder_dialog_init
64
 
                };
65
 
 
66
 
                type = g_type_register_static (G_TYPE_OBJECT,
67
 
                                               "SearchFolderDialog",
68
 
                                               &our_info, 0);
69
 
        }
70
 
 
71
 
        return type;
72
 
}
 
43
G_DEFINE_TYPE (SearchFolderDialog, search_folder_dialog, G_TYPE_OBJECT);
73
44
 
74
45
static void
75
46
search_folder_dialog_finalize (GObject *object)
107
78
        if (response_id == GTK_RESPONSE_OK) {   
108
79
                /* save new search folder settings */
109
80
                node_set_title (sfd->priv->node, gtk_entry_get_text (GTK_ENTRY (sfd->priv->nameEntry)));
110
 
                rule_editor_save (sfd->priv->re, sfd->priv->vfolder);
111
 
                sfd->priv->vfolder->anyMatch = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (GTK_WIDGET (dialog), "anyRuleRadioBtn")));
 
81
                rule_editor_save (sfd->priv->re, sfd->priv->vfolder->itemset);
 
82
                sfd->priv->vfolder->itemset->anyMatch = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (GTK_WIDGET (dialog), "anyRuleRadioBtn")));
112
83
 
113
84
                /* update search folder */
114
 
                ui_itemlist_clear ();
115
 
                vfolder_refresh (sfd->priv->vfolder);
 
85
                itemview_clear ();
 
86
                vfolder_reset (sfd->priv->vfolder);
116
87
                itemlist_unload (FALSE);
117
88
                
118
89
                /* If we are finished editing a new search folder add it to the feed list */
120
91
                        feedlist_node_added (sfd->priv->node);
121
92
                        
122
93
                ui_node_update (sfd->priv->node->id);
123
 
        } else if (response_id == GTK_RESPONSE_CANCEL) {
124
 
                /* Only destroy temporary nodes */
125
 
                if (!sfd->priv->node->parent)
126
 
                        node_free(sfd->priv->node);
127
94
        }
128
95
        
129
96
        gtk_widget_destroy (GTK_WIDGET (dialog));
145
112
        SearchFolderDialog      *sfd;
146
113
        
147
114
        sfd = SEARCH_FOLDER_DIALOG (g_object_new (SEARCH_FOLDER_DIALOG_TYPE, NULL));
148
 
        sfd->priv->re = rule_editor_new ((vfolderPtr)node->data);
149
115
        sfd->priv->node = node;
150
116
        sfd->priv->vfolder = (vfolderPtr)node->data;
 
117
        sfd->priv->re = rule_editor_new (sfd->priv->vfolder->itemset);
151
118
        
152
119
        /* Create the dialog */
153
120
        dialog = liferea_dialog_new (NULL, "vfolderdialog");
157
124
        gtk_entry_set_text (GTK_ENTRY (sfd->priv->nameEntry), node_get_title (node));
158
125
        
159
126
        /* Set up rule match type */
160
 
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (dialog, sfd->priv->vfolder->anyMatch?"anyRuleRadioBtn":"allRuleRadioBtn")), TRUE);
 
127
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (dialog, sfd->priv->vfolder->itemset->anyMatch?"anyRuleRadioBtn":"allRuleRadioBtn")), TRUE);
161
128
        
162
129
        /* Set up rule list vbox */
163
130
        gtk_container_add (GTK_CONTAINER (liferea_dialog_lookup (dialog, "ruleview_vfolder_dialog")), rule_editor_get_widget (sfd->priv->re));