diff options
-rw-r--r-- | siv.c | 8 | ||||
-rw-r--r-- | siv.glade | 94 | ||||
-rw-r--r-- | window.c | 19 |
3 files changed, 9 insertions, 112 deletions
@@ -233,6 +233,9 @@ app_new (int argc, char **argv) app->meta_data = load_meta_data (); g_hash_table_new (g_str_hash, g_str_equal); + /* To make sure we don't exit if the window count reaches zero */ + app->n_windows = 1; + if (filenames) { for (list = filenames; list != NULL; list = list->next) @@ -258,6 +261,11 @@ app_new (int argc, char **argv) { window_show (window_new (app)); } + + if (app->n_windows == 1) + exit (1); + else + --app->n_windows; } int @@ -49,24 +49,6 @@ </child> <child> - <widget class="GtkImageMenuItem" id="menu_save"> - <property name="visible">True</property> - <property name="label">gtk-save</property> - <property name="use_stock">True</property> - <signal name="activate" handler="on_save1_activate" last_modification_time="Sat, 08 Mar 2008 14:22:13 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="menu_save_as"> - <property name="visible">True</property> - <property name="label">gtk-save-as</property> - <property name="use_stock">True</property> - <signal name="activate" handler="on_save_as1_activate" last_modification_time="Sat, 08 Mar 2008 14:22:13 GMT"/> - </widget> - </child> - - <child> <widget class="GtkSeparatorMenuItem" id="separatormenuitem1"> <property name="visible">True</property> </widget> @@ -86,37 +68,6 @@ </child> <child> - <widget class="GtkMenuItem" id="menuitem3"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Edit</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuitem3_menu"> - - <child> - <widget class="GtkMenuItem" id="menu_rotate_left"> - <property name="visible">True</property> - <property name="label" translatable="yes">Rotate _Left</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_menu_rotate_left_activate" last_modification_time="Sat, 08 Mar 2008 15:19:40 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menu_rotate_right"> - <property name="visible">True</property> - <property name="label" translatable="yes">Rotate _Right</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_rotate_right1_activate" last_modification_time="Sat, 08 Mar 2008 15:19:40 GMT"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> <widget class="GtkMenuItem" id="view1"> <property name="visible">True</property> <property name="label" translatable="yes">_View</property> @@ -300,51 +251,6 @@ <property name="homogeneous">True</property> </packing> </child> - - <child> - <widget class="GtkSeparatorToolItem" id="separatortoolitem1"> - <property name="visible">True</property> - <property name="draw">True</property> - <property name="visible_horizontal">True</property> - <property name="visible_vertical">True</property> - </widget> - <packing> - <property name="expand">False</property> - <property name="homogeneous">False</property> - </packing> - </child> - - <child> - <widget class="GtkToolButton" id="rotate_left"> - <property name="visible">True</property> - <property name="label" translatable="yes">Rotate _Left</property> - <property name="use_underline">True</property> - <property name="stock_id">gtk-go-back</property> - <property name="visible_horizontal">True</property> - <property name="visible_vertical">True</property> - <property name="is_important">False</property> - </widget> - <packing> - <property name="expand">False</property> - <property name="homogeneous">True</property> - </packing> - </child> - - <child> - <widget class="GtkToolButton" id="rotate_right"> - <property name="visible">True</property> - <property name="label" translatable="yes">Rotate _Right</property> - <property name="use_underline">True</property> - <property name="stock_id">gtk-go-forward</property> - <property name="visible_horizontal">True</property> - <property name="visible_vertical">True</property> - <property name="is_important">False</property> - </widget> - <packing> - <property name="expand">False</property> - <property name="homogeneous">True</property> - </packing> - </child> </widget> <packing> <property name="padding">0</property> @@ -149,9 +149,8 @@ set_sensitivity (Window *window) /* List of widgets that are sensitive if and only if a file is loaded */ const char insensitive[][32] = { - "menu_save", "menu_save_as", "menu_rotate_left", "menu_rotate_right", "menu_white", "menu_checkerboard", "menu_no", "menu_smooth_image", - "menu_zoom_normal", "zoom_normal", "rotate_left", "rotate_right" + "menu_zoom_normal", "zoom_normal" }; for (i = 0; i < G_N_ELEMENTS (insensitive); ++i) @@ -254,18 +253,6 @@ on_zoom_normal (GtkWidget *widget, Window *window) }; static void -on_rotate_left (GtkWidget *widget, Window *window) -{ - g_print ("rotate_left\n"); -}; - -static void -on_rotate_right (GtkWidget *widget, Window *window) -{ - g_print ("rotate_right\n"); -}; - -static void on_various (GtkWidget *widget, Window *window) { rebuild (window); @@ -387,14 +374,10 @@ connect_signals (Window *window) { "zoom_in", "clicked", G_CALLBACK (on_zoom_in) }, { "zoom_out", "clicked", G_CALLBACK (on_zoom_out) }, { "zoom_normal", "clicked", G_CALLBACK (on_zoom_normal) }, - { "rotate_left", "clicked", G_CALLBACK (on_rotate_left) }, - { "rotate_right", "clicked", G_CALLBACK (on_rotate_right) }, { "menu_zoom_in", "activate", G_CALLBACK (on_zoom_in) }, { "menu_zoom_out", "activate", G_CALLBACK (on_zoom_out) }, { "menu_zoom_normal", "activate", G_CALLBACK (on_zoom_normal) }, - { "menu_rotate_left", "activate", G_CALLBACK (on_rotate_left) }, - { "menu_rotate_right", "activate", G_CALLBACK (on_rotate_right) }, { "menu_close", "activate", G_CALLBACK (on_close) }, { "menu_smooth_image", "toggled", G_CALLBACK (on_various) }, |