(no commit message)
authorJean-Philippe Orsini <jeanfi@gmail.com>
Sun, 28 Apr 2013 19:44:03 +0000 (19:44 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Sun, 28 Apr 2013 19:44:03 +0000 (19:44 +0000)
src/glade/prss.glade
src/main.c
src/ttrss_model.h
src/ttrss_ws.c

index f11713e..374106b 100644 (file)
@@ -5,6 +5,11 @@
     <property name="label" translatable="yes">Refresh</property>
     <property name="stock_id">gtk-refresh</property>
   </object>
+  <object class="GtkAction" id="preferences_action">
+    <property name="label" translatable="yes">Preferences</property>
+    <property name="stock_id">gtk-preferences</property>
+    <signal name="activate" handler="preferences_action_activate_cbk" swapped="no"/>
+  </object>
   <object class="GtkListStore" id="feed_store">
     <columns>
       <!-- column-name gchararray1 -->
                     <child>
                       <object class="GtkImageMenuItem" id="imagemenuitem1">
                         <property name="label">gtk-preferences</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="related_action">preferences_action</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
-                        <signal name="activate" handler="settings_activate_cbk" swapped="no"/>
                       </object>
                     </child>
                     <child>
                 <property name="homogeneous">True</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkToolButton" id="preferences">
+                <property name="related_action">preferences_action</property>
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">toolbutton1</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>
                     <property name="can_focus">False</property>
                     <property name="orientation">vertical</property>
                     <child>
-                      <object class="GtkGrid" id="grid3">
+                      <object class="GtkFrame" id="frame1">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">in</property>
                         <child>
-                          <object class="GtkLabel" id="headline_title">
+                          <object class="GtkGrid" id="grid3">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="single_line_mode">True</property>
-                            <attributes>
-                              <attribute name="weight" value="bold"/>
-                              <attribute name="scale" value="1.5"/>
-                            </attributes>
+                            <child>
+                              <object class="GtkLabel" id="headline_title">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="single_line_mode">True</property>
+                                <attributes>
+                                  <attribute name="weight" value="bold"/>
+                                  <attribute name="scale" value="1.5"/>
+                                </attributes>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">0</property>
+                                <property name="width">1</property>
+                                <property name="height">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="headline_date">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <attributes>
+                                  <attribute name="weight" value="light"/>
+                                </attributes>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">1</property>
+                                <property name="width">1</property>
+                                <property name="height">1</property>
+                              </packing>
+                            </child>
                           </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">0</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <placeholder/>
                         </child>
-                        <child>
-                          <placeholder/>
-                        </child>
-                        <child>
+                        <child type="label_item">
                           <placeholder/>
                         </child>
                       </object>
index 67ea46b..13411c9 100644 (file)
@@ -40,6 +40,7 @@ static GSettings *settings;
 
 static GtkPaned *w_panel;
 static GtkLabel *w_headline_title;
+static GtkLabel *w_headline_date;
 
 static int model_state;
 
@@ -161,7 +162,7 @@ void refresh_clicked_cbk(GtkWidget *btn, gpointer data)
        log_debug("refresh_clicked_cbk() done");
 }
 
-void settings_activate_cbk(GtkWidget *menu_item, gpointer data)
+void preferences_action_activate_cbk(GtkAction *action, gpointer data)
 {
        GtkDialog *diag;
        GtkBuilder *builder;
@@ -338,6 +339,8 @@ int headline_cursor_changed_cbk(GtkTreeView *treeview, gpointer data)
 
        if (headline) {
                gtk_label_set_text(w_headline_title, headline->title);
+               gtk_label_set_text(w_headline_date, ctime(&headline->date));
+
 
                str = ttrss_get_headline_content(headline);
 
@@ -526,6 +529,8 @@ int main(int argc, char **argv)
        w_panel = GTK_PANED(gtk_builder_get_object(builder, "paned2"));
        w_headline_title
                = GTK_LABEL(gtk_builder_get_object(builder, "headline_title"));
+       w_headline_date
+               = GTK_LABEL(gtk_builder_get_object(builder, "headline_date"));
 
        gtk_builder_connect_signals(builder, NULL);
 
index e2ac2d8..81f75c2 100644 (file)
@@ -28,6 +28,7 @@ struct headline {
        char *excerpt;
        char *content;
        int unread;
+       time_t date;
 };
 
 struct feed {
index 654374f..4fc64e2 100644 (file)
@@ -302,6 +302,10 @@ int ws_update_headlines(struct feed *feed)
                                                           "excerpt");
                                h->excerpt = strdup(json_object_get_string(j));
 
+                               j = json_object_object_get(jheadline,
+                                                          "updated");
+                               h->date = json_object_get_int(j);
+
                                tmp = headlines_add(feed->headlines, h);
                                if (feed->headlines)
                                        free(feed->headlines);