~ubuntu-branches/ubuntu/precise/rhythmbox/precise-201203091205

« back to all changes in this revision

Viewing changes to lib/rb-glade-helpers.c

Tags: upstream-0.9.5
ImportĀ upstreamĀ versionĀ 0.9.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 *
16
16
 *  You should have received a copy of the GNU General Public License
17
17
 *  along with this program; if not, write to the Free Software
18
 
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
19
19
 *
20
20
 */
21
21
 
22
22
#include <gmodule.h>
23
23
#include <gtk/gtk.h>
 
24
#include <string.h>
24
25
 
25
26
#include "rb-glade-helpers.h"
26
27
#include "rb-file-helpers.h"
113
114
void
114
115
rb_glade_boldify_label (GladeXML *xml, const char *name)
115
116
{
116
 
        GtkLabel *label = GTK_LABEL (glade_xml_get_widget (xml, name));
 
117
        GtkWidget *widget;
 
118
 
 
119
        widget = glade_xml_get_widget (xml, name);
 
120
 
 
121
        if (widget == NULL) {
 
122
                g_warning ("widget '%s' not found", name);
 
123
                return;
 
124
        }
 
125
 
117
126
        /* this way is probably better, but for some reason doesn't work with
118
127
         * labels with mnemonics.
119
128
 
128
137
                attr->end_index = G_MAXINT;
129
138
                pango_attr_list_insert (pattrlist, attr);
130
139
        }
131
 
        gtk_label_set_attributes (label, pattrlist);*/
 
140
        gtk_label_set_attributes (GTK_LABEL (widget), pattrlist);*/
132
141
 
133
142
        gchar *str_final;
134
 
        str_final = g_strdup_printf ("<b>%s</b>", gtk_label_get_label (label));
135
 
        gtk_label_set_markup_with_mnemonic (label, str_final);
 
143
        str_final = g_strdup_printf ("<b>%s</b>", gtk_label_get_label (GTK_LABEL (widget)));
 
144
        gtk_label_set_markup_with_mnemonic (GTK_LABEL (widget), str_final);
136
145
        g_free (str_final);
137
146
}
138
147
 
 
148
gboolean
 
149
rb_combo_box_hyphen_separator_func (GtkTreeModel *model,
 
150
                                    GtkTreeIter *iter,
 
151
                                    gpointer data)
 
152
{
 
153
        const char *s;
 
154
 
 
155
        gtk_tree_model_get (model, iter, 0, &s, -1);
 
156
 
 
157
        if (s == NULL)
 
158
                return FALSE;
 
159
 
 
160
        return (strcmp (s, "-") == 0);
 
161
}
 
162
 
139
163