51
51
static void rb_feed_podcast_properties_dialog_update_author (RBFeedPodcastPropertiesDialog *dialog);
52
52
static void rb_feed_podcast_properties_dialog_update_language (RBFeedPodcastPropertiesDialog *dialog);
53
53
static void rb_feed_podcast_properties_dialog_update_last_update (RBFeedPodcastPropertiesDialog *dialog);
54
static void rb_feed_podcast_properties_dialog_update_last_episode (RBFeedPodcastPropertiesDialog *dialog);
54
55
static void rb_feed_podcast_properties_dialog_update_copyright (RBFeedPodcastPropertiesDialog *dialog);
55
56
static void rb_feed_podcast_properties_dialog_update_summary (RBFeedPodcastPropertiesDialog *dialog);
56
57
static gchar* rb_feed_podcast_properties_dialog_parse_time (gulong time);
58
static GtkWidget * boldify_label (GtkWidget *label);
60
59
struct RBFeedPodcastPropertiesDialogPrivate
98
dialog->priv = g_new0 (RBFeedPodcastPropertiesDialogPrivate, 1);
102
dialog->priv = RB_FEED_PODCAST_PROPERTIES_DIALOG_GET_PRIVATE (dialog);
100
104
g_signal_connect_object (G_OBJECT (dialog),
102
106
G_CALLBACK (rb_feed_podcast_properties_dialog_response_cb),
109
gtk_window_set_default_size (GTK_WINDOW (dialog), 600, 400);
105
111
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
106
112
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
107
113
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
109
gtk_dialog_set_default_response (GTK_DIALOG (dialog),
112
115
xml = rb_glade_xml_new ("podcast-feed-properties.glade",
113
116
"podcastproperties",
117
120
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
118
121
glade_xml_get_widget (xml, "podcastproperties"));
120
dialog->priv->okbutton = gtk_dialog_add_button (GTK_DIALOG (dialog),
123
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
123
dialog->priv->close_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
126
gtk_dialog_set_default_response (GTK_DIALOG (dialog),
125
129
/* get the widgets from the XML */
126
130
dialog->priv->title = glade_xml_get_widget (xml, "titleLabel");
128
132
dialog->priv->location = glade_xml_get_widget (xml, "locationLabel");
129
133
dialog->priv->language = glade_xml_get_widget (xml, "languageLabel");
130
134
dialog->priv->last_update = glade_xml_get_widget (xml, "lastupdateLabel");
135
dialog->priv->last_episode = glade_xml_get_widget (xml, "lastepisodeLabel");
131
136
dialog->priv->copyright = glade_xml_get_widget (xml, "copyrightLabel");
132
137
dialog->priv->summary = glade_xml_get_widget (xml, "summaryLabel");
134
boldify_label (glade_xml_get_widget (xml, "titleDescLabel"));
135
boldify_label (glade_xml_get_widget (xml, "authorDescLabel"));
136
boldify_label (glade_xml_get_widget (xml, "locationDescLabel"));
137
boldify_label (glade_xml_get_widget (xml, "languageDescLabel"));
138
boldify_label (glade_xml_get_widget (xml, "lastupdateDescLabel"));
139
boldify_label (glade_xml_get_widget (xml, "copyrightDescLabel"));
140
boldify_label (glade_xml_get_widget (xml, "summaryDescLabel"));
139
rb_glade_boldify_label (xml, "titleDescLabel");
140
rb_glade_boldify_label (xml, "authorDescLabel");
141
rb_glade_boldify_label (xml, "locationDescLabel");
142
rb_glade_boldify_label (xml, "languageDescLabel");
143
rb_glade_boldify_label (xml, "lastupdateDescLabel");
144
rb_glade_boldify_label (xml, "lastepisodeDescLabel");
145
rb_glade_boldify_label (xml, "copyrightDescLabel");
146
rb_glade_boldify_label (xml, "summaryDescLabel");
142
148
g_object_unref (G_OBJECT (xml));
172
176
return GTK_WIDGET (dialog);
176
boldify_label (GtkWidget *label)
179
str_final = g_strdup_printf ("<b>%s</b>",
180
gtk_label_get_label (GTK_LABEL (label)));
181
gtk_label_set_markup_with_mnemonic (GTK_LABEL (label), str_final);
187
180
rb_feed_podcast_properties_dialog_response_cb (GtkDialog *gtkdialog,
195
188
rb_feed_podcast_properties_dialog_update (RBFeedPodcastPropertiesDialog *dialog)
197
190
g_return_if_fail (dialog->priv->current_entry != NULL);
198
192
rb_feed_podcast_properties_dialog_update_location (dialog);
199
193
rb_feed_podcast_properties_dialog_update_title (dialog);
200
194
rb_feed_podcast_properties_dialog_update_title_label (dialog);
201
195
rb_feed_podcast_properties_dialog_update_author (dialog);
202
196
rb_feed_podcast_properties_dialog_update_language (dialog);
203
197
rb_feed_podcast_properties_dialog_update_last_update (dialog);
198
rb_feed_podcast_properties_dialog_update_last_episode (dialog);
204
199
rb_feed_podcast_properties_dialog_update_copyright (dialog);
205
200
rb_feed_podcast_properties_dialog_update_summary (dialog);
211
206
const char *name;
213
208
name = rb_refstring_get (dialog->priv->current_entry->title);
214
tmp = g_strdup_printf (_("Properties for %s"), name);
209
tmp = g_strdup_printf (_("%s Properties"), name);
215
210
gtk_window_set_title (GTK_WINDOW (dialog), tmp);
257
252
rb_feed_podcast_properties_dialog_update_last_update (RBFeedPodcastPropertiesDialog *dialog)
261
time = rb_feed_podcast_properties_dialog_parse_time (dialog->priv->current_entry->podcast->post_time);
262
gtk_label_set (GTK_LABEL (dialog->priv->last_update),
257
time_val = rhythmdb_entry_get_ulong (dialog->priv->current_entry, RHYTHMDB_PROP_LAST_SEEN);
258
time_str = rb_feed_podcast_properties_dialog_parse_time (time_val);
259
gtk_label_set (GTK_LABEL (dialog->priv->last_update), time_str);
264
rb_feed_podcast_properties_dialog_update_last_episode (RBFeedPodcastPropertiesDialog *dialog)
269
time_val = rhythmdb_entry_get_ulong (dialog->priv->current_entry, RHYTHMDB_PROP_POST_TIME);
270
time_str = rb_feed_podcast_properties_dialog_parse_time (time_val);
271
gtk_label_set (GTK_LABEL (dialog->priv->last_episode), time_str);
275
283
rb_feed_podcast_properties_dialog_parse_time (gulong value)
280
287
if (0 == value) {
288
str = g_strdup (_("Unknown"));
290
str = rb_utf_friendly_time ((time_t)value);
284
localtime_r ((time_t*)&value, &then);
285
str = eel_strdup_strftime (_("%Y-%m-%d %H:%M"), &then);