<property name="label" translatable="yes">Refresh</property>
<property name="stock_id">gtk-refresh</property>
</object>
- <object class="GtkListStore" id="feed_store">
+ <object class="GtkListStore" id="headline_store">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
<column type="gint"/>
</columns>
</object>
- <object class="GtkListStore" id="headline_store">
+ <object class="GtkListStore" id="feed_store">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
<column type="gint"/>
</columns>
</object>
+ <object class="GtkListStore" id="liststore1">
+ <columns>
+ <!-- column-name gchararray1 -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">horizontal</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">vertical</col>
+ </row>
+ </data>
+ </object>
<object class="GtkDialog" id="settings_dialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
</packing>
</child>
<child>
- <object class="GtkGrid" id="grid1">
+ <object class="GtkNotebook" id="notebook1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="row_homogeneous">True</property>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">URL:</property>
+ <property name="row_homogeneous">True</property>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">URL:</property>
+ </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>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Login:</property>
+ </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>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xpad">1</property>
+ <property name="label" translatable="yes">Password:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="url_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="invisible_char_set">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="login_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="invisible_char_set">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="password_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
+ <property name="invisible_char">•</property>
+ <property name="invisible_char_set">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</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>
- <object class="GtkLabel" id="label2">
+ <child type="tab">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Login:</property>
+ <property name="label" translatable="yes">Account</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="tab_fill">False</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="label3">
+ <object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xpad">1</property>
- <property name="label" translatable="yes">Password:</property>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Layout:</property>
+ </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>
+ <object class="GtkComboBox" id="layout">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">liststore1</property>
+ <property name="active">0</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext2"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</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">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkEntry" id="url_entry">
+ <child type="tab">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">•</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Interface</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="login_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">•</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
+ <placeholder/>
</child>
- <child>
- <object class="GtkEntry" id="password_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="visibility">False</property>
- <property name="invisible_char">•</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
+ <child type="tab">
+ <placeholder/>
</child>
</object>
<packing>
static const char *program_name;
static GSettings *settings;
+static GtkPaned *w_panel;
+
static int model_state;
enum {
gtk_list_store_set(GTK_LIST_STORE(model),
&iter,
- 0, title,
- 1, (*feeds)->id,
+ COL_FEED_TITLE, title,
+ COL_FEED_ID, (*feeds)->id,
-1);
free(title);
feeds++;
log_debug("update() done");
}
+void update_layout()
+{
+ int layout;
+
+ layout = g_settings_get_int(settings, "layout");
+
+ switch (layout) {
+ case 1:
+ gtk_orientable_set_orientation(GTK_ORIENTABLE(w_panel),
+ GTK_ORIENTATION_HORIZONTAL);
+ break;
+ case 0:
+ default:
+ gtk_orientable_set_orientation(GTK_ORIENTABLE(w_panel),
+ GTK_ORIENTATION_VERTICAL);
+ }
+}
+
void refresh_clicked_cbk(GtkWidget *btn, gpointer data)
{
log_debug("refresh_clicked_cbk()");
GtkDialog *diag;
GtkBuilder *builder;
GtkEntry *login, *url, *pwd;
+ GtkComboBox *layout;
log_debug("settings_activate_cbk()");
pwd = GTK_ENTRY(gtk_builder_get_object(builder, "password_entry"));
gtk_entry_set_text(pwd, g_settings_get_string(settings, "password"));
+ layout = GTK_COMBO_BOX(gtk_builder_get_object(builder,
+ "layout"));
+
+ gtk_combo_box_set_active(layout, g_settings_get_int(settings,
+ "layout"));
+
if (gtk_dialog_run(diag)) {
+ g_settings_set_int(settings,
+ "layout",
+ gtk_combo_box_get_active(layout));
+
g_settings_set_string(settings,
"password",
gtk_entry_get_text(pwd));
g_settings_get_string(settings, "password"));
ws_open_session();
+ update_layout();
update();
}
gtk_list_store_set(headline_store,
&iter,
- 0, title,
- 1, (*headlines)->id,
+ COL_HEADLINE_TITLE,
+ title,
+ COL_HEADLINE_ID,
+ (*headlines)->id,
-1);
free(title);
GtkTreeIter iter;
GtkTreeModel *model;
struct headline *headline;
- char *str;
+ char *str, *tmp;
log_debug("headline_cursor_changed_cbk()");
headline = get_selected_headline(&iter);
if (headline) {
- str = ttrss_get_headline_content(headline);
-
- if (str)
+ tmp = ttrss_get_headline_content(headline);
+
+ if (tmp) {
+ str = g_strdup_printf("<h1><a href='%s'>%s</a></h1>%s",
+ headline->url,
+ headline->title,
+ tmp);
+ free(tmp);
+
web_load(str);
- else
+ free(str);
+ } else {
web_load("");
+ }
- free(str);
-
+
if (headline->unread) {
ttrss_set_article_unread(headline->id, 0);
headline->unread = 0;
w_headlinetree = GTK_TREE_VIEW(gtk_builder_get_object(builder,
"headline_tree"));
+ w_panel = GTK_PANED(gtk_builder_get_object(builder, "paned2"));
+
gtk_builder_connect_signals(builder, NULL);
panh = GTK_WIDGET(gtk_builder_get_object(builder, "webkit_window"));
g_object_unref(G_OBJECT(builder));
gtk_widget_show_all(window);
+ update_layout();
gtk_main();