~ubuntu-branches/ubuntu/vivid/nip2/vivid-proposed

« back to all changes in this revision

Viewing changes to src/workspacedefs.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Terry
  • Date: 2009-05-12 09:26:46 UTC
  • mfrom: (1.2.11 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090512092646-j8lb1w2x69pvgma4
Tags: 7.18.1-1ubuntu1
* Merge from debian unstable (LP: #375435), remaining changes:
  - debian/control: Also Recommend abrowser

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
        Workspacedefs *workspacedefs = WORKSPACEDEFS( vobject );
64
64
        Mainw *mainw = workspacedefs->mainw;
65
65
        Workspace *ws = mainw->ws;
66
 
        BufInfo buf;
 
66
        VipsBuf buf;
67
67
        char txt[256];
68
68
 
69
69
#ifdef DEBUG
90
90
                }
91
91
        }
92
92
 
93
 
        buf_init_static( &buf, txt, 512 );
 
93
        vips_buf_init_static( &buf, txt, 512 );
94
94
        if( workspacedefs->mainw->ws->local_kit ) {
95
95
                int n = icontainer_get_n_children( ICONTAINER( 
96
96
                        workspacedefs->mainw->ws->local_kit ) );
97
97
 
98
 
                buf_appendf( &buf, ngettext( "%d definition", 
 
98
                vips_buf_appendf( &buf, ngettext( "%d definition", 
99
99
                        "%d definitions", n ), n );
100
100
        }
101
101
        if( workspacedefs->errors ) {
102
 
                if( !buf_is_empty( &buf ) )
103
 
                        buf_appendf( &buf, ", " ); 
104
 
                buf_appendf( &buf, _( "errors" ) ); 
 
102
                if( !vips_buf_is_empty( &buf ) )
 
103
                        vips_buf_appendf( &buf, ", " ); 
 
104
                vips_buf_appendf( &buf, _( "errors" ) ); 
105
105
        }
106
106
        if( workspacedefs->changed ) {
107
 
                if( !buf_is_empty( &buf ) )
108
 
                        buf_appendf( &buf, ", " ); 
109
 
                buf_appendf( &buf, _( "modified" ) ); 
 
107
                if( !vips_buf_is_empty( &buf ) )
 
108
                        vips_buf_appendf( &buf, ", " ); 
 
109
                vips_buf_appendf( &buf, _( "modified" ) ); 
110
110
        }
111
 
        set_glabel( workspacedefs->status, "%s", buf_all( &buf ) );
 
111
        set_glabel( workspacedefs->status, "%s", vips_buf_all( &buf ) );
112
112
 
113
113
        VOBJECT_CLASS( parent_class )->refresh( vobject );
114
114
}
155
155
        Workspacedefs *workspacedefs = WORKSPACEDEFS( client );
156
156
        char *fname;
157
157
 
158
 
        if( !(fname = filesel_get_filename( filesel )) ) 
 
158
        if( !(fname = filesel_get_filename( filesel )) ) {
159
159
                nfn( sys, IWINDOW_ERROR );
160
 
        else {
161
 
                if( !workspacedefs_set_text_from_file( workspacedefs, 
162
 
                        fname ) ) 
163
 
                        nfn( sys, IWINDOW_ERROR );
 
160
                return;
 
161
        }
164
162
 
 
163
        if( !workspacedefs_set_text_from_file( workspacedefs, fname ) ) {
165
164
                g_free( fname );
 
165
                nfn( sys, IWINDOW_ERROR );
 
166
                return;
166
167
        }
167
168
 
168
 
        nfn( sys, IWINDOW_TRUE );
 
169
        g_free( fname );
 
170
 
 
171
        nfn( sys, IWINDOW_YES );
169
172
}
170
173
 
171
174
static void
198
201
                        FILEMODEL( ws->local_kit ) );
199
202
}
200
203
 
201
 
static void
202
 
workspacedefs_hide_cb( GtkWidget *wid, Workspacedefs *workspacedefs )
203
 
{
204
 
        Mainw *mainw = workspacedefs->mainw;
205
 
 
206
 
        pane_set_open( mainw->lpane, FALSE );
207
 
}
208
 
 
209
204
static gboolean
210
205
workspacedefs_set_text( Workspacedefs *workspacedefs, const char *txt )
211
206
{
269
264
                GTK_SIGNAL_FUNC( workspacedefs_replace_cb ), workspacedefs );
270
265
        menu_add_but( pane, GTK_STOCK_SAVE_AS,
271
266
                GTK_SIGNAL_FUNC( workspacedefs_save_as_cb ), workspacedefs );
272
 
        menu_add_sep( pane );
273
 
        menu_add_but( pane, GTK_STOCK_CLOSE,
274
 
                GTK_SIGNAL_FUNC( workspacedefs_hide_cb ), workspacedefs );
275
267
 
276
268
        hbox = gtk_hbox_new( FALSE, 7 );
277
269
        gtk_box_pack_start( GTK_BOX( workspacedefs ), hbox, FALSE, FALSE, 0 );
278
270
        gtk_widget_show( hbox );
279
271
 
280
272
        mb = gtk_menu_bar_new();
281
 
        gtk_box_pack_end( GTK_BOX( hbox ), mb, FALSE, FALSE, 0 );
 
273
        gtk_box_pack_start( GTK_BOX( hbox ), mb, FALSE, FALSE, 0 );
282
274
        gtk_widget_show( mb );
283
275
        but = gtk_menu_item_new();
284
276
        gtk_menu_item_set_submenu( GTK_MENU_ITEM( but ), pane );
291
283
        but = gtk_button_new_with_label( _( "Process" ) );
292
284
        g_signal_connect( G_OBJECT( but ), "clicked",
293
285
                G_CALLBACK( workspacedefs_process_cb ), workspacedefs );
294
 
        gtk_box_pack_end( GTK_BOX( hbox ), but, FALSE, FALSE, 0 );
 
286
        gtk_box_pack_start( GTK_BOX( hbox ), but, FALSE, FALSE, 0 );
295
287
        gtk_widget_show( but );
296
288
        workspacedefs->status = gtk_label_new( NULL );
297
 
        gtk_misc_set_alignment( GTK_MISC( workspacedefs->status ), 1.0, 0.5 );
298
 
        gtk_box_pack_end( GTK_BOX( hbox ), 
 
289
        gtk_misc_set_alignment( GTK_MISC( workspacedefs->status ), 0, 0.5 );
 
290
        gtk_box_pack_start( GTK_BOX( hbox ), 
299
291
                workspacedefs->status, TRUE, TRUE, 0 );
300
292
        gtk_widget_show( workspacedefs->status );
301
293