Commit ca310605 authored by Victor Ananjevsky's avatar Victor Ananjevsky

working commit

parent f01bbc5b
......@@ -27,6 +27,7 @@ yad_SOURCES = \
util.c \
main.c \
yad.h \
stock.h \
calendar.xpm
if HTML
......
......@@ -64,13 +64,8 @@ load_uri (const gchar * uri)
addr = g_strdup (uri);
}
if (addr)
{
webkit_web_view_load_uri (view, addr);
g_free (addr);
}
else
g_printerr ("yad_html_load_uri: cannot load uri '%s'\n", uri);
}
static void
......@@ -105,7 +100,7 @@ policy_cb (WebKitWebView *v, WebKitPolicyDecision *pd, WebKitPolicyDecisionType
}
static void
select_file_cb (GtkEntry * entry, GtkEntryIconPosition pos, GdkEventButton * ev, gpointer d)
select_file_cb (GtkEntry *entry, GtkEntryIconPosition pos, GdkEventButton *ev, gpointer d)
{
GtkWidget *dlg;
static gchar *dir = NULL;
......@@ -116,7 +111,9 @@ select_file_cb (GtkEntry * entry, GtkEntryIconPosition pos, GdkEventButton * ev,
dlg = gtk_file_chooser_dialog_new (_("YAD - Select File"),
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (entry))),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
_("OK"), GTK_RESPONSE_ACCEPT,
_("Cancel"), GTK_RESPONSE_CANCEL,
NULL);
if (dir)
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dlg), dir);
......@@ -135,20 +132,22 @@ select_file_cb (GtkEntry * entry, GtkEntryIconPosition pos, GdkEventButton * ev,
}
static void
do_open_cb (GtkWidget * w, GtkDialog * dlg)
do_open_cb (GtkWidget *w, GtkDialog *dlg)
{
gtk_dialog_response (dlg, GTK_RESPONSE_ACCEPT);
}
static void
open_cb (GtkWidget * w, gpointer d)
open_cb (GtkWidget *w, gpointer d)
{
GtkWidget *dlg, *cnt, *lbl, *entry;
dlg = gtk_dialog_new_with_buttons (_("Open URI"),
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
_("Cancel"), GTK_RESPONSE_REJECT,
_("Open"), GTK_RESPONSE_ACCEPT,
NULL);
gtk_window_set_default_size (GTK_WINDOW (dlg), 350, -1);
cnt = gtk_dialog_get_content_area (GTK_DIALOG (dlg));
......@@ -173,7 +172,7 @@ open_cb (GtkWidget * w, gpointer d)
}
static gboolean
menu_cb (WebKitWebView * view, GtkWidget * menu, WebKitHitTestResult * hit, gboolean kb, gpointer d)
menu_cb (WebKitWebView *view, GtkWidget *menu, WebKitHitTestResult *hit, gboolean kb, gpointer d)
{
GtkWidget *mi;
......
......@@ -29,6 +29,7 @@
#include <sys/shm.h>
#include "yad.h"
#include "stock.h"
YadSettings settings;
......@@ -113,8 +114,7 @@ write_settings (void)
g_key_file_set_integer (kf, "General", "timeout", settings.timeout);
g_key_file_set_comment (kf, "General", "timeout", " Default timeout (0 for no timeout)", NULL);
g_key_file_set_string (kf, "General", "timeout_indicator", settings.to_indicator);
g_key_file_set_comment (kf, "General", "timeout_indicator",
" Position of timeout indicator (top, bottom, left, right, none)", NULL);
g_key_file_set_comment (kf, "General", "timeout_indicator", " Position of timeout indicator (top, bottom, left, right, none)", NULL);
g_key_file_set_boolean (kf, "General", "show_remain", settings.show_remain);
g_key_file_set_comment (kf, "General", "show_remain", " Show remain seconds in timeout indicator", NULL);
g_key_file_set_boolean (kf, "General", "combo_always_editable", settings.combo_always_editable);
......@@ -151,6 +151,12 @@ write_settings (void)
g_free (context);
}
static gboolean
stock_lookup (gchar *key, YadStock *it)
{
return FALSE;
}
GdkPixbuf *
get_pixbuf (gchar * name, YadIconSize size, gboolean force)
{
......@@ -359,8 +365,8 @@ get_tabs (key_t key, gboolean create)
GtkWidget *
get_label (gchar * str, guint border)
{
GtkWidget *a, *t, *i, *l;
GtkStockItem it;
GtkWidget *t, *i, *l;
YadStock it;
gchar **vals;
if (!str || !*str)
......@@ -368,17 +374,14 @@ get_label (gchar * str, guint border)
l = i = NULL;
a = gtk_alignment_new (0.5, 0.5, 0, 0);
gtk_container_set_border_width (GTK_CONTAINER (a), border);
t = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (a), t);
gtk_container_set_border_width (GTK_CONTAINER (t), border);
vals = g_strsplit_set (str, options.common_data.item_separator, 3);
if (gtk_stock_lookup (vals[0], &it))
if (stock_lookup (vals[0], &it))
{
l = gtk_label_new_with_mnemonic (it.label);
i = gtk_image_new_from_pixbuf (get_pixbuf (it.stock_id, YAD_SMALL_ICON, TRUE));
i = gtk_image_new_from_pixbuf (get_pixbuf (it.icon, YAD_SMALL_ICON, TRUE));
}
else
{
......@@ -396,7 +399,8 @@ get_label (gchar * str, guint border)
}
if (i)
gtk_box_pack_start (GTK_BOX (t), i, FALSE, FALSE, 1);
gtk_container_add (GTK_CONTAINER (t), i);
if (l)
{
gtk_label_set_xalign (GTK_LABEL (l), 0.0);
......@@ -414,9 +418,9 @@ get_label (gchar * str, guint border)
g_strfreev (vals);
gtk_widget_show_all (a);
gtk_widget_show_all (t);
return a;
return t;
}
gchar *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment