commit - 246f99d92348714ff096669610916a82b493003b
commit + 5470555b5a6f5f52231b028509f6149ed9dd6378
blob - 79edfabd3b1c4d89979a186e068c329c34f246ea (mode 644)
blob + /dev/null
--- src/gtk/description_window.c
+++ /dev/null
-/*
- * Claws Mail -- a GTK based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glib.h>
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-#include "defs.h"
-#include "manage_window.h"
-#include "description_window.h"
-#include "gtkutils.h"
-#include "prefs_gtk.h"
-
-static void description_create (DescriptionWindow *dwindow);
-static gboolean description_window_focus_in_event (GtkWidget *widget,
- GdkEventFocus *event,
- gpointer data);
-static gboolean description_window_focus_out_event (GtkWidget *widget,
- GdkEventFocus *event,
- gpointer data);
-static void description_window_destroy (GtkWidget *parent,
- gpointer data);
-
-void description_window_create(DescriptionWindow *dwindow)
-{
- if (!dwindow->window) {
- description_create(dwindow);
-
- gtk_window_set_transient_for(GTK_WINDOW(dwindow->window), GTK_WINDOW(dwindow->parent));
- dwindow->parent_modal = gtk_window_get_modal(GTK_WINDOW(dwindow->parent));
- gtk_window_set_modal(GTK_WINDOW(dwindow->parent), TRUE);
- gtk_window_set_destroy_with_parent(GTK_WINDOW(dwindow->window), TRUE);
- gtk_widget_show(dwindow->window);
-
- } else g_print("window exists\n");
-}
-
-static void description_create(DescriptionWindow * dwindow)
-{
- GtkWidget *hbox;
- GtkWidget *label;
- GtkWidget *vbox;
- GtkWidget *table;
- GtkWidget *hbbox;
- GtkWidget *close_btn;
- GtkWidget *scrolledwin;
- int i;
- int line;
- int j;
- int *max_width = g_new0(int, dwindow->columns), width=0;
- GtkRequisition req;
-
- dwindow->window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "description_window");
-
- gtk_window_set_title(GTK_WINDOW(dwindow->window), dwindow->title);
- gtk_container_set_border_width(GTK_CONTAINER(dwindow->window), 8);
- gtk_window_set_resizable(GTK_WINDOW(dwindow->window), TRUE);
- gtk_window_set_type_hint(GTK_WINDOW(dwindow->window), GDK_WINDOW_TYPE_HINT_DIALOG);
-
- scrolledwin = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
- table = gtk_grid_new();
- gtk_container_add(GTK_CONTAINER(scrolledwin), table);
- gtk_container_set_border_width(GTK_CONTAINER(table), 4);
-
- line = 0;
- for(i = 0; dwindow->symbol_table[i] != NULL; i = i + dwindow->columns) {
- if(dwindow->symbol_table[i][0] != '\0') {
- GtkWidget *label;
-
- for (j = 0; j < dwindow->columns; j++) {
- gint col = j;
- gint colend = j+1;
- /* Expand using next NULL columns */
- while ((colend < dwindow->columns) &&
- (dwindow->symbol_table[i+colend] == NULL)) {
- colend++;
- j++;
- }
- label = gtk_label_new(dwindow->symbol_table[i+col]);
- gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
- gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
- gtk_label_set_xalign(GTK_LABEL(label), 0.0);
- gtk_label_set_yalign(GTK_LABEL(label), 0.0);
- gtk_widget_set_margin_end(GTK_WIDGET(label), 12);
- gtk_grid_attach(GTK_GRID(table), label, col, line, 1, 1);
-
- gtk_widget_get_preferred_size(label, &req, NULL);
- if(req.width > max_width[j])
- max_width[j] = req.width;
- }
- } else {
- GtkWidget *separator;
-
- separator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
- gtk_grid_attach(GTK_GRID(table), separator, 0, line, 1, 1);
- }
- line++;
- }
-
- for(j=0; j<dwindow->columns; j++)
- width += max_width[j];
-
- g_free(max_width);
- width += 100;
-
- gtkut_stock_button_set_create(&hbbox, &close_btn, "window-close", _("_Close"),
- NULL, NULL, NULL, NULL, NULL, NULL);
-
- vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, VSPACING_NARROW);
- gtk_container_add(GTK_CONTAINER(dwindow->window), vbox);
-
- hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-
- label = gtk_label_new(dwindow->description);
- gtk_widget_set_size_request(GTK_WIDGET(label), width-2, -1);
- gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
- gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-
- gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(scrolledwin),
- TRUE, TRUE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbbox),
- FALSE, FALSE, 3);
-
- gtk_widget_grab_default(close_btn);
-
- g_signal_connect(G_OBJECT(close_btn), "clicked",
- G_CALLBACK(description_window_destroy), dwindow);
- g_signal_connect(G_OBJECT(dwindow->window), "focus_in_event",
- G_CALLBACK(description_window_focus_in_event), NULL);
- g_signal_connect(G_OBJECT(dwindow->window), "focus_out_event",
- G_CALLBACK(description_window_focus_out_event), NULL);
- g_signal_connect(G_OBJECT(dwindow->window), "destroy",
- G_CALLBACK(description_window_destroy), dwindow);
-
- if(dwindow->parent)
- g_signal_connect(G_OBJECT(dwindow->parent), "hide",
- G_CALLBACK(description_window_destroy), dwindow);
-
- gtk_widget_show_all(vbox);
- gtk_widget_set_size_request(dwindow->window,
- (width < 400) ? 400 : width, 450);
-}
-
-static gboolean description_window_focus_in_event (GtkWidget *widget,
- GdkEventFocus *event,
- gpointer data)
-{
- if (gtk_grab_get_current() != widget)
- gtk_grab_add(GTK_WIDGET(widget));
-
- return FALSE;
-}
-
-static gboolean description_window_focus_out_event (GtkWidget *widget,
- GdkEventFocus *event,
- gpointer data)
-{
- gtk_grab_remove(GTK_WIDGET(widget));
-
- return FALSE;
-}
-
-static void description_window_destroy (GtkWidget *widget, gpointer data)
-{
- DescriptionWindow *dwindow = (DescriptionWindow *) data;
-
- if(dwindow->window) {
- gtk_widget_hide(dwindow->window);
- gtk_widget_destroy(dwindow->window);
- dwindow->window = NULL;
- }
-
- if(dwindow->parent) {
- if (GTK_IS_WINDOW(dwindow->parent))
- gtk_window_set_modal(GTK_WINDOW(dwindow->parent), dwindow->parent_modal);
- g_signal_handlers_disconnect_by_func(G_OBJECT(dwindow->parent),
- description_window_destroy, dwindow->parent);
- }
-}
blob - 22ab015380b3844ced41bac4450e298ddc4095e9 (mode 644)
blob + /dev/null
--- src/gtk/description_window.h
+++ /dev/null
-/*
- * Claws Mail -- a GTK based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef _DESCRIPTION_WINDOW_H
-#define _DESCRIPTION_WINDOW_H
-
-typedef struct _DescriptionWindow DescriptionWindow;
-
-struct _DescriptionWindow
-{
- GtkWidget * window;
- GtkWidget * parent;
- gboolean parent_modal;
- /** Number of columns for each line of data **/
- int columns;
- /** title of the window **/
- gchar * title;
- /** description **/
- gchar * description;
- /** points to the table of strings to be show in the window */
- gchar ** symbol_table;
-};
-
-void description_window_create(DescriptionWindow *dwindow);
-
-#endif /* _DESCRIPTION_WINDOW_H */
blob - c10a90c4c1b81c59764449f7a2bb6dd3a7bc5e4e
blob + 66ba9aeb2bfc1ddc1821041aedd2c6e384137625
--- src/prefs_actions.c
+++ src/prefs_actions.c
#include "alertpanel.h"
#include "prefs_actions.h"
#include "action.h"
-#include "description_window.h"
#include "manual.h"
#include "menu.h"
#include "prefs_toolbar.h"
static void prefs_actions_set_dialog (void);
static gint prefs_actions_clist_set_row (gint row);
-/* callback functions */
-static void prefs_actions_info_cb (GtkWidget *w,
- GtkWidget *window);
static void prefs_actions_register_cb (GtkWidget *w,
gpointer data);
static void prefs_actions_substitute_cb (GtkWidget *w,
CLAWS_SET_TIP(clear_btn,
_("Clear all the input fields in the dialog"));
- info_btn = gtkut_stock_button("dialog-information", _("_Information"));
- gtk_widget_show(info_btn);
- gtk_box_pack_end(GTK_BOX(reg_hbox), info_btn, FALSE, FALSE, 0);
- g_signal_connect(G_OBJECT(info_btn), "clicked",
- G_CALLBACK(prefs_actions_info_cb), GTK_WINDOW(window));
- CLAWS_SET_TIP(info_btn,
- _("Show information on configuring actions"));
-
cond_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
gtk_widget_show(cond_hbox);
gtk_box_pack_start(GTK_BOX(vbox1), cond_hbox, TRUE, TRUE, 0);
inc_unlock();
}
-/*
- * Strings describing action format strings
- *
- * When adding new lines, remember to put one string for each line
- */
-static gchar *actions_desc_strings[] = {
- N_("<span weight=\"bold\" underline=\"single\">Menu name:</span>"), NULL,
- N_("Use / in menu name to make submenus."), NULL,
- "", NULL,
- N_("<span weight=\"bold\" underline=\"single\">Command-line:</span>"), NULL,
- N_("<span weight=\"bold\">Begin with:</span>"), NULL,
- " |", N_("to send message body or selection to command's standard input"),
- " >", N_("to send user provided text to command's standard input"),
- " *", N_("to send user provided hidden text to command's standard input"),
- N_("<span weight=\"bold\">End with:</span>"), NULL,
- " |", N_("to replace message body or selection with command's standard output"),
- " >", N_("to insert command's standard output without replacing old text"),
- " &", N_("to run command asynchronously"),
- N_("<span weight=\"bold\">Use:</span>"), NULL,
- " %f", N_("for the file of the selected message in RFC822/2822 format "),
- " %F", N_("for the list of the files of the selected messages in RFC822/2822 format"),
- " %p", N_("for the file of the selected decoded message MIME part"),
- " %u", N_("for a user provided argument"),
- " %h", N_("for a user provided hidden argument (e.g. password)"),
- " %s", N_("for the text selection"),
- " %as{}", N_("apply filtering actions between {} to selected messages"),
- " %%", N_("for a literal %"),
- NULL, NULL
-};
-
-
-static DescriptionWindow actions_desc_win = {
- NULL,
- NULL,
- TRUE,
- 2,
- N_("Actions"),
- N_("The Actions feature is a way for the user to launch "
- "external commands to process a complete message file or just "
- "one of its parts."),
- actions_desc_strings
-};
-
-
-static void prefs_actions_info_cb(GtkWidget *w, GtkWidget *window)
-{
- actions_desc_win.parent = window;
- description_window_create(&actions_desc_win);
-}
-
static GtkListStore* prefs_actions_create_data_store(void)
{
return gtk_list_store_new(N_PREFS_ACTIONS_COLUMNS,
blob - 2f01028c53307cdf4da3d7caa297a61d91450baf
blob + 1dfdaa000fa48c6b729bb178efa5e4828076b0ec
--- src/summaryview.c
+++ src/summaryview.c
#include "string_match.h"
#include "toolbar.h"
#include "hooks.h"
-#include "description_window.h"
#include "folderutils.h"
#include "log.h"
#include "manual.h"