Skip to content

Commit 99454ac

Browse files
committed
save-selected starting
1 parent 0ec8500 commit 99454ac

File tree

5 files changed

+13
-52
lines changed

5 files changed

+13
-52
lines changed

TODO

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
- workspacegroupview_reorder_tab_cb() is never called?
55

6-
- no longer need to update tab labels? we could remove the set_label stuff
7-
86
- save selected, various duplicate actions need fixing
97

108
- major / minor / micro need to be in workspace, as well as root

src/workspacegroup.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,18 @@ workspacegroup_view_new( Model *model, View *parent )
9292
return( workspacegroupview_new() );
9393
}
9494

95+
void *
96+
workspacegroup_save_workspace( iContainer *icontainer, void *a, void *b )
97+
{
98+
Workspace *ws = WORKSPACE( icontainer );
99+
xmlNode *xnode = (xmlNode *) a;
100+
Workspacegroup *wsg = WORKSPACEGROUP( b );
101+
102+
in save-selected mode, save just the current WS
103+
104+
return( model_save( ws, xnode ) );
105+
}
106+
95107
static xmlNode *
96108
workspacegroup_save( Model *model, xmlNode *xnode )
97109
{
@@ -107,7 +119,7 @@ workspacegroup_save( Model *model, xmlNode *xnode )
107119
*/
108120

109121
if( icontainer_map( ICONTAINER( model ),
110-
(icontainer_map_fn) model_save, xnode, NULL ) )
122+
workspacegroup_save_workspace, xnode, model ) )
111123
return( NULL );
112124

113125
return( xnode );

src/workspacegroupview.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ workspacegroupview_child_add( View *parent, View *child )
9494
label = gtk_label_new( NN( IOBJECT( ws->sym )->name ) );
9595
gtk_container_add( GTK_CONTAINER( ebox ), label );
9696
gtk_widget_show( GTK_WIDGET( label ) );
97-
workspaceview_set_label( wview, label );
9897
popup_attach( ebox, wsgview->tab_menu, wview );
9998

10099
gtk_notebook_insert_page( GTK_NOTEBOOK( wsgview->notebook ),
@@ -219,8 +218,6 @@ workspacegroupview_page_removed_cb( GtkNotebook *notebook,
219218
Workspacegroup *wsg = WORKSPACEGROUP( VOBJECT( wsgview )->iobject );
220219
Mainw *mainw = MAINW( iwindow_get_root( notebook ) );
221220

222-
workspaceview_set_label( wview, NULL );
223-
224221
if( icontainer_get_n_children( ICONTAINER( wsg ) ) == 0 )
225222
iwindow_kill( IWINDOW( mainw ) );
226223
}

src/workspaceview.c

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -685,40 +685,6 @@ workspaceview_refresh( vObject *vobject )
685685

686686
workspace_jump_update( ws, wview->popup_jump );
687687

688-
if( wview->label ) {
689-
char txt[512];
690-
VipsBuf buf = VIPS_BUF_STATIC( txt );
691-
692-
if( FILEMODEL( ws )->modified )
693-
vips_buf_appendf( &buf, "*" );
694-
vips_buf_appendf( &buf, "%s", NN( IOBJECT( ws->sym )->name ) );
695-
gtk_label_set_text( GTK_LABEL( wview->label ),
696-
vips_buf_all( &buf ) );
697-
698-
vips_buf_rewind( &buf );
699-
700-
if( FILEMODEL( ws )->filename )
701-
vips_buf_appendf( &buf, "%s",
702-
FILEMODEL( ws )->filename );
703-
else
704-
vips_buf_appends( &buf, _( "unsaved workspace" ) );
705-
706-
if( FILEMODEL( ws )->modified ) {
707-
vips_buf_appendf( &buf, ", " );
708-
vips_buf_appendf( &buf, _( "modified" ) );
709-
}
710-
711-
if( ws->compat_major ) {
712-
vips_buf_appends( &buf, ", " );
713-
vips_buf_appends( &buf, _( "compatibility mode" ) );
714-
vips_buf_appendf( &buf, " %d.%d",
715-
ws->compat_major,
716-
ws->compat_minor );
717-
}
718-
719-
set_tooltip( wview->label, "%s", vips_buf_all( &buf ) );
720-
}
721-
722688
if( ws->rpane_open && !wview->rpane->open )
723689
pane_animate_open( wview->rpane );
724690
if( !ws->rpane_open && wview->rpane->open )
@@ -1188,10 +1154,3 @@ workspaceview_new( void )
11881154
return( VIEW( wview ) );
11891155
}
11901156

1191-
void
1192-
workspaceview_set_label( Workspaceview *wview, GtkWidget *label )
1193-
{
1194-
g_assert( !label || !wview->label );
1195-
1196-
wview->label = label;
1197-
}

src/workspaceview.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ struct _Workspaceview {
5555
Pane *lpane;
5656
Pane *rpane;
5757

58-
/* Set by our parent: the label we update with the ws name and state.
59-
*/
60-
GtkWidget *label;
61-
6258
GtkWidget *popup;
6359
GtkWidget *popup_jump;
6460

@@ -118,4 +114,3 @@ void workspaceview_set_cursor( Workspaceview *wview, iWindowShape shape );
118114
GtkType workspaceview_get_type( void );
119115
View *workspaceview_new( void );
120116

121-
void workspaceview_set_label( Workspaceview *wview, GtkWidget *label );

0 commit comments

Comments
 (0)