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

« back to all changes in this revision

Viewing changes to src/mainw.c

  • Committer: Bazaar Package Importer
  • Author(s): Jay Berkenbilt
  • Date: 2010-12-27 14:53:08 UTC
  • mfrom: (2.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20101227145308-vampjbuuft281j3l
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
 
144
144
        /* My instance destroy stuff.
145
145
         */
146
 
        if( mainw->ws )
 
146
        if( mainw->ws ) {
147
147
                mainw->ws->iwnd = NULL;
148
 
        FREESID( mainw->destroy_sid, mainw->ws );
149
 
        FREESID( mainw->changed_sid, mainw->ws );
 
148
 
 
149
                filemodel_set_window_hint( FILEMODEL( mainw->ws ), NULL );
 
150
                FREESID( mainw->destroy_sid, mainw->ws );
 
151
                FREESID( mainw->changed_sid, mainw->ws );
 
152
        }
 
153
 
150
154
        FREESID( mainw->imageinfo_changed_sid, main_imageinfogroup );
151
155
        FREESID( mainw->heap_changed_sid, reduce_context->heap );
152
156
        FREESID( mainw->watch_changed_sid, main_watchgroup );
413
417
                        mainw->ws->compat_minor ); 
414
418
        }
415
419
        if( FILEMODEL( mainw->ws )->filename )
416
 
                vips_buf_appendf( &buf, " - %s", FILEMODEL( mainw->ws )->filename );
 
420
                vips_buf_appendf( &buf, " - %s", 
 
421
                        FILEMODEL( mainw->ws )->filename );
417
422
        else {
418
423
                vips_buf_appends( &buf, " - " );
419
424
                vips_buf_appends( &buf, _( "unsaved workspace" ) );
991
996
                return;
992
997
        }
993
998
 
994
 
        /* If we have just loaded one or more workspaces, and the current
995
 
         * workspace is smpty, we can junk it.
 
999
        /* If there's nothing left to load (we only had workspaes to load and
 
1000
         * we've loaded them all) and the current workspace is smpty, we can 
 
1001
         * junk it.
996
1002
         */
997
1003
        if( !load.nitems && 
998
1004
                workspace_is_empty( mainw->ws ) ) {
1002
1008
                filemodel_set_modified( FILEMODEL( mainw->ws ), FALSE );
1003
1009
                iwindow_kill( IWINDOW( mainw ) );
1004
1010
        }
1005
 
        else {
 
1011
 
 
1012
        /* Some actual files (image, matrix) were selected. Load into
 
1013
         * the current workspace.
 
1014
         */
 
1015
        if( load.nitems ) {
1006
1016
                char txt2[MAX_STRSIZE];
1007
1017
                VipsBuf buf2 = VIPS_BUF_STATIC( txt2 );
1008
1018
 
1012
1022
                else
1013
1023
                        vips_buf_appends( &buf2, vips_buf_all( &buf ) );
1014
1024
 
1015
 
                /* Some actual files (image, matrix) were selected. Load into
1016
 
                 * the current workspace.
1017
 
                 */
1018
1025
                if( !workspace_add_def( mainw->ws, vips_buf_all( &buf2 ) ) ) {
1019
1026
                        error_top( _( "Load failed." ) );
1020
1027
                        error_sub( _( "Unable to execute:\n   %s" ), 
1609
1616
}
1610
1617
 */
1611
1618
 
 
1619
#ifdef HAVE_LIBGVC
 
1620
static void
 
1621
mainw_graph_action_cb( GtkAction *action, Mainw *mainw )
 
1622
{
 
1623
        Graphwindow *graphwindow;
 
1624
 
 
1625
        graphwindow = graphwindow_new( mainw->ws, GTK_WIDGET( mainw ) );
 
1626
        gtk_widget_show( GTK_WIDGET( graphwindow ) );
 
1627
}
 
1628
#endif /*HAVE_LIBGVC*/
 
1629
 
1612
1630
/* Set display mode.
1613
1631
 */
1614
1632
static void
1740
1758
                N_( "Edit preferences" ), 
1741
1759
                G_CALLBACK( mainw_preferences_action_cb ) },
1742
1760
 
 
1761
#ifdef HAVE_LIBGVC
 
1762
        { "Graph", 
 
1763
                NULL, N_( "Workspace as Grap_h" ), NULL,
 
1764
                N_( "Show a graph of workspace dependencies" ), 
 
1765
                G_CALLBACK( mainw_graph_action_cb ) },
 
1766
#endif /*HAVE_LIBGVC*/
 
1767
 
1743
1768
        { "EditToolkits", 
1744
1769
                NULL, N_( "_Edit" ), NULL,
1745
1770
                N_( "Edit toolkits" ), 
1840
1865
"      <menuitem action='ToolkitBrowser'/>"
1841
1866
"      <menuitem action='WorkspaceDefs'/>"
1842
1867
"      <separator/>"
 
1868
#ifdef HAVE_LIBGVC
 
1869
"      <menuitem action='Graph'/>"
 
1870
"      <separator/>"
 
1871
#endif /*HAVE_LIBGVC*/
1843
1872
"      <menuitem action='Normal'/>"
1844
1873
"      <menuitem action='ShowFormula'/>"
1845
1874
"      <menuitem action='NoEdit'/>"
2172
2201
        iwindow_set_build( IWINDOW( mainw ), 
2173
2202
                (iWindowBuildFn) mainw_build, ws, NULL, NULL );
2174
2203
        iwindow_set_popdown( IWINDOW( mainw ), mainw_popdown, NULL );
 
2204
        filemodel_set_window_hint( FILEMODEL( ws ), IWINDOW( mainw ) );
2175
2205
 
2176
 
        /* If we have a saved size for this workspoace, set that. Otherwise,
 
2206
        /* If we have a saved size for this workspace, set that. Otherwise,
2177
2207
         * default to the default.
2178
2208
         */
2179
2209
        if( !ws->window_width ) {