~ubuntu-branches/ubuntu/vivid/rawstudio/vivid

« back to all changes in this revision

Viewing changes to librawstudio/rs-gui-functions.c

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz
  • Date: 2011-07-28 17:36:32 UTC
  • mfrom: (2.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20110728173632-5czluz9ye3c83zc5
Tags: 2.0-1
* [3750b2cf] Merge commit 'upstream/2.0'
* [63637468] Removing Patch, not necessary anymore.
* [2fb580dc] Add new build-dependencies.
* [c57d953b] Run dh_autoreconf due to patches in configure.in
* [13febe39] Add patch to remove the libssl requirement.
* [5ae773fe] Replace libjpeg62-dev by libjpeg8-dev :)
* [1969d755] Don't build static libraries.
* [7cfe0a2e] Add a patch to fix the plugin directory path.
  As plugins are shared libraries, they need to go into /usr/lib,
  not into /usr/share.
  Thanks to Andrew McMillan
* [c1d0d9dd] Don't install .la files for all plugins and libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * * Copyright (C) 2006-2011 Anders Brander <anders@brander.dk>, 
 
3
 * * Anders Kvist <akv@lnxbx.dk> and Klaus Post <klauspost@gmail.com>
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
 
 
20
#include <glib.h>
 
21
#include <glib/gstdio.h>
 
22
#include <gtk/gtk.h>
 
23
#include "rs-gui-functions.h"
 
24
 
 
25
GtkWidget *
 
26
gui_dialog_make_from_text(const gchar *stock_id, gchar *primary_text, gchar *secondary_text)
 
27
{
 
28
        GtkWidget *secondary_label;
 
29
 
 
30
        secondary_label = gtk_label_new (NULL);
 
31
        gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
 
32
        gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
 
33
        gtk_misc_set_alignment (GTK_MISC (secondary_label), 0.0, 0.5);
 
34
        gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
 
35
        gtk_label_set_markup (GTK_LABEL (secondary_label), secondary_text);
 
36
        
 
37
        return(gui_dialog_make_from_widget(stock_id, primary_text, secondary_label));
 
38
}
 
39
 
 
40
GtkWidget *
 
41
gui_dialog_make_from_widget(const gchar *stock_id, gchar *primary_text, GtkWidget *widget)
 
42
{
 
43
        GtkWidget *dialog, *image, *hhbox, *vvbox;
 
44
        GtkWidget *primary_label;
 
45
        gchar *str;
 
46
 
 
47
        image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_DIALOG);
 
48
        gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
 
49
        dialog = gtk_dialog_new();
 
50
        gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
 
51
        gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14);
 
52
        gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
 
53
        gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
 
54
        gtk_window_set_title (GTK_WINDOW (dialog), "");
 
55
        gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
 
56
        gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
 
57
 
 
58
        primary_label = gtk_label_new (NULL);
 
59
        gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
 
60
        gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
 
61
        gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5);
 
62
        gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
 
63
        str = g_strconcat("<span weight=\"bold\" size=\"larger\">", primary_text, "</span>", NULL);
 
64
        gtk_label_set_markup (GTK_LABEL (primary_label), str);
 
65
        g_free(str);
 
66
 
 
67
        hhbox = gtk_hbox_new (FALSE, 12);
 
68
        gtk_container_set_border_width (GTK_CONTAINER (hhbox), 5);
 
69
        gtk_box_pack_start (GTK_BOX (hhbox), image, FALSE, FALSE, 0);
 
70
        vvbox = gtk_vbox_new (FALSE, 12);
 
71
        gtk_box_pack_start (GTK_BOX (hhbox), vvbox, FALSE, FALSE, 0);
 
72
        gtk_box_pack_start (GTK_BOX (vvbox), primary_label, FALSE, FALSE, 0);
 
73
        gtk_box_pack_start (GTK_BOX (vvbox), widget, FALSE, FALSE, 0);
 
74
        gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hhbox, FALSE, FALSE, 0);
 
75
 
 
76
        return(dialog);
 
77
}