Skip to content

Commit 9e7893c

Browse files
committed
add an alert icon
1 parent 47e0acd commit 9e7893c

File tree

9 files changed

+33
-13
lines changed

9 files changed

+33
-13
lines changed

TODO

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
- if a tab contains an error, display a red alert in the tab name, cf. the
2+
padlock symbol
3+
4+
workspace needs to track number of rows with errors
5+
6+
workspaceview_refresh() needs to update ->alert, cf. ->padlock
7+
18
- try toolkits / edit, then view def browser, then type "lindet", then click
29
on im_lindetect ... syntax error and a toolkit called "untitled" is created
310

share/nip2/data/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ nipdata_DATA = \
1717
stock-tool-rect-select-22.png \
1818
stock-tool-select-22.png \
1919
stock-padlock-closed-22.png \
20+
stock-alert-22.png \
2021
nip-slider-16.png \
2122
stock-tool-move-22.png \
2223
stock-led-red-18.png \
10.1 KB
Loading

share/nip2/data/stock-alert-22.png

718 Bytes
Loading

src/ip.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ extern int statfs();
216216
#define STOCK_RECT "nip-rect"
217217
#define STOCK_MOVE "nip-move"
218218
#define STOCK_LOCK "nip-lock"
219+
#define STOCK_ALERT "nip-alert"
219220
#define STOCK_SELECT "nip-select"
220221
#define STOCK_LED_RED "nip-led-red"
221222
#define STOCK_LED_GREEN "nip-led-green"

src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ main_register_icons( void )
750750
STOCK_SELECT, "stock-tool-select-22.png" );
751751
main_file_for_stock( main_icon_factory,
752752
STOCK_LOCK, "stock-padlock-closed-22.png" );
753+
main_file_for_stock( main_icon_factory,
754+
STOCK_ALERT, "stock-alert-22.png" );
753755
main_file_for_stock( main_icon_factory,
754756
STOCK_LED_RED, "stock-led-red-18.png" );
755757
main_file_for_stock( main_icon_factory,

src/workspacegroupview.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ workspacegroupview_child_add( View *parent, View *child )
126126
GtkWidget *ebox;
127127
GtkWidget *hbox;
128128
GtkWidget *label;
129-
GtkWidget *image;
129+
GtkWidget *padlock;
130+
GtkWidget *alert;
130131

131132
VIEW_CLASS( parent_class )->child_add( parent, child );
132133

@@ -137,16 +138,21 @@ workspacegroupview_child_add( View *parent, View *child )
137138
gtk_container_add( GTK_CONTAINER( ebox ), hbox );
138139
gtk_widget_show( GTK_WIDGET( hbox ) );
139140

140-
image = gtk_image_new();
141-
gtk_box_pack_start( GTK_BOX( hbox ), image, FALSE, FALSE, 0 );
142-
gtk_widget_show( GTK_WIDGET( image ) );
143-
set_tooltip( image, "%s", _( "unlock from Edit menu" ) );
141+
padlock = gtk_image_new();
142+
gtk_box_pack_start( GTK_BOX( hbox ), padlock, FALSE, FALSE, 0 );
143+
gtk_widget_show( GTK_WIDGET( padlock ) );
144+
set_tooltip( padlock, "%s", _( "unlock from Edit menu" ) );
145+
146+
alert = gtk_image_new();
147+
gtk_box_pack_start( GTK_BOX( hbox ), alert, FALSE, FALSE, 0 );
148+
gtk_widget_show( GTK_WIDGET( alert ) );
149+
set_tooltip( alert, "%s", _( "errors in tab" ) );
144150

145151
label = gtk_label_new( NN( IOBJECT( ws->sym )->name ) );
146152
gtk_box_pack_end( GTK_BOX( hbox ), label, FALSE, FALSE, 0 );
147153
gtk_widget_show( GTK_WIDGET( label ) );
148154

149-
workspaceview_set_label( wview, label, image );
155+
workspaceview_set_label( wview, label, padlock, alert );
150156

151157
popup_attach( ebox, wsgview->tab_menu, wview );
152158

src/workspaceview.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -703,10 +703,10 @@ workspaceview_refresh( vObject *vobject )
703703
"%s", IOBJECT( ws )->caption );
704704

705705
if( ws->locked )
706-
gtk_image_set_from_stock( GTK_IMAGE( wview->image ),
706+
gtk_image_set_from_stock( GTK_IMAGE( wview->padlock ),
707707
STOCK_LOCK, GTK_ICON_SIZE_MENU );
708708
else
709-
gtk_image_clear( GTK_IMAGE( wview->image ) );
709+
gtk_image_clear( GTK_IMAGE( wview->padlock ) );
710710
}
711711

712712
VOBJECT_CLASS( parent_class )->refresh( vobject );
@@ -1235,11 +1235,13 @@ workspaceview_new( void )
12351235

12361236
void
12371237
workspaceview_set_label( Workspaceview *wview,
1238-
GtkWidget *label, GtkWidget *image )
1238+
GtkWidget *label, GtkWidget *padlock, GtkWidget *alert )
12391239
{
12401240
g_assert( !wview->label );
1241-
g_assert( !wview->image );
1241+
g_assert( !wview->padlock );
1242+
g_assert( !wview->alert );
12421243

12431244
wview->label = label;
1244-
wview->image = image;
1245+
wview->padlock = padlock;
1246+
wview->alert = alert;
12451247
}

src/workspaceview.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ struct _Workspaceview {
5050
Toolkitbrowser *toolkitbrowser;
5151
Workspacedefs *workspacedefs;
5252
GtkWidget *label; /* Tab label */
53-
GtkWidget *image; /* And the padlock image */
53+
GtkWidget *padlock; /* The padlock icon */
54+
GtkWidget *alert; /* The alert icon */
5455

5556
/* Left and right panes ... program window and toolkit browser.
5657
*/
@@ -113,4 +114,4 @@ GtkType workspaceview_get_type( void );
113114
View *workspaceview_new( void );
114115

115116
void workspaceview_set_label( Workspaceview *wview,
116-
GtkWidget *label, GtkWidget *image );
117+
GtkWidget *label, GtkWidget *padlock, GtkWidget *alert );

0 commit comments

Comments
 (0)