浏览代码

Merge branch 'upstream'

Héctor García 10 年之前
父节点
当前提交
c1c33a29cb
共有 4 个文件被更改,包括 23 次插入14 次删除
  1. 10 0
      ChangeLog
  2. 1 1
      src/Makefile.am
  3. 1 1
      src/mssh-pref.c
  4. 11 12
      src/mssh-window.c

+ 10 - 0
ChangeLog

@@ -1,3 +1,13 @@
+2014-12-12 Héctor García  <[email protected]>
+
+	Upgrade deprecated funtions to support GTK 3.14
+
+	Set the focus on the global entry only if the terminal closed has it.
+
+2014-03-17  Héctor García  <[email protected]>
+
+	Release as mssh 2.0
+
 2014-03-14  Héctor García  <[email protected]>
 
 	Added support to defined backscroll lines for terminals. Patch from Balint Deak.

+ 1 - 1
src/Makefile.am

@@ -1,6 +1,6 @@
 AM_CFLAGS = -pedantic-errors -Werror -Wall -Wfatal-errors -Wwrite-strings
 
-INCLUDES = $(MSSH_CFLAGS)
+AM_CPPFLAGS = $(MSSH_CFLAGS)
 
 bin_PROGRAMS = mssh
 

+ 1 - 1
src/mssh-pref.c

@@ -258,7 +258,7 @@ static void mssh_pref_init(MSSHPref* pref)
     GtkWidget *mod_super_check = gtk_check_button_new_with_label("Super");
 
     GtkWidget *close_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-    GtkWidget *close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
+    GtkWidget *close_button = gtk_button_new_with_label("Close");
 
     GtkWidget *dir_focus_check = gtk_check_button_new_with_label(
         "Use directional focus");

+ 11 - 12
src/mssh-window.c

@@ -269,6 +269,11 @@ static gboolean mssh_window_session_close(gpointer data)
     }
     else
     {
+        /* set the focus on the entry only if the terminal closed has it */
+        if ( gtk_window_get_focus(GTK_WINDOW(data_pair->window)) == GTK_WIDGET(data_pair->terminal) ) {
+            gtk_window_set_focus(GTK_WINDOW(data_pair->window), GTK_WIDGET(data_pair->window->global_entry));
+        }
+
         gtk_widget_destroy(data_pair->terminal->menu_item);
 
         gtk_container_remove(GTK_CONTAINER(data_pair->window->grid),
@@ -278,8 +283,6 @@ static gboolean mssh_window_session_close(gpointer data)
 
         mssh_window_relayout(data_pair->window);
 
-        /* set the focus on the entry */
-        gtk_window_set_focus(GTK_WINDOW(data_pair->window), GTK_WIDGET(data_pair->window->global_entry));
     }
 
     if(data_pair->window->terminals->len == 0 &&
@@ -398,8 +401,8 @@ void mssh_window_relayout(MSSHWindow *window)
         }
 
         /* Set margins to terminal widget */
-        gtk_widget_set_margin_left(GTK_WIDGET(terminal), 1);
-        gtk_widget_set_margin_right(GTK_WIDGET(terminal), 1);
+        gtk_widget_set_margin_start(GTK_WIDGET(terminal), 1);
+        gtk_widget_set_margin_end(GTK_WIDGET(terminal), 1);
         gtk_widget_set_margin_top(GTK_WIDGET(terminal), 1);
         gtk_widget_set_margin_bottom(GTK_WIDGET(terminal), 1);
 
@@ -475,15 +478,11 @@ static void mssh_window_init(MSSHWindow* window)
     GtkWidget *server_item = gtk_menu_item_new_with_label("Servers");
     GtkWidget *command_item = gtk_menu_item_new_with_label("Commands");
 
-    GtkWidget *file_quit = gtk_image_menu_item_new_from_stock(
-        GTK_STOCK_QUIT, NULL);
-    GtkWidget *file_sendhost = gtk_image_menu_item_new_with_label(
-        "Send hostname");
-    GtkWidget *file_add = gtk_menu_item_new_with_label(
-        "Add session");
+    GtkWidget *file_quit = gtk_menu_item_new_with_mnemonic("_Quit");
+    GtkWidget *file_sendhost = gtk_menu_item_new_with_label("Send hostname");
+    GtkWidget *file_add = gtk_menu_item_new_with_label("Add session");
 
-    GtkWidget *edit_pref = gtk_image_menu_item_new_from_stock(
-        GTK_STOCK_PREFERENCES, NULL);
+    GtkWidget *edit_pref = gtk_menu_item_new_with_mnemonic("_Preferences");
 
     GtkAccelGroup *accel = gtk_accel_group_new();