Merge pull request #48 from flexiondotorg/1.6

Cherry picks from `master` for `mate-terminal` 1.6
Stefano Karapetsas 2014-01-02 11:04:50 -08:00
commit 540ddbef81
7 changed files with 109 additions and 64 deletions

View File

@ -1,31 +0,0 @@
pkgname=mate-terminal
pkgver=1.1.0
pkgrel=1
pkgdesc="The MATE Terminal Emulator"
arch=('i686' 'x86_64')
license=('GPL')
depends=('mate-conf' 'vte' 'libmate' 'libsm')
makedepends=('pkgconfig' 'mate-doc-utils' 'intltool')
options=('!emptydirs' '!libtool')
install=mate-terminal.install
url="http://matsusoft.com.ar/projects"
groups=('mate-extras')
source=()
sha256sums=()
build() {
cd "${srcdir}/../../../"
./autogen.sh --prefix=/usr --sysconfdir=/etc --disable-static \
--localstatedir=/var --disable-scrollkeeper --with-gnu-ld || return 1
make || return 1
}
package() {
cd "${srcdir}/../../../"
make MATECONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR="${pkgdir}" install || return 1
install -m755 -d "${pkgdir}/usr/share/mateconf/schemas"
mateconf-merge-schema "${pkgdir}/usr/share/mateconf/schemas/${pkgname}.schemas" --domain ${pkgname} ${pkgdir}/etc/mateconf/schemas/*.schemas || return 1
rm -f ${pkgdir}/etc/mateconf/schemas/*.schemas
}

View File

@ -1,17 +0,0 @@
pkgname=mate-terminal
post_install() {
usr/sbin/mateconfpkg --install ${pkgname}
}
pre_upgrade() {
pre_remove $1
}
post_upgrade() {
post_install $1
}
pre_remove() {
usr/sbin/mateconfpkg --uninstall ${pkgname}
}

View File

@ -345,6 +345,16 @@
<summary>Keyboard shortcut to switch to the next tab</summary> <summary>Keyboard shortcut to switch to the next tab</summary>
<description>Keyboard shortcut key to switch to the next tab. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action.</description> <description>Keyboard shortcut key to switch to the next tab. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action.</description>
</key> </key>
<key name="prev-profile" type="s">
<default>'&lt;Alt&gt;Page_Up'</default>
<summary>Keyboard shortcut to switch to the previous profile</summary>
<description>Keyboard shortcut key to switch to the previous profile. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action.</description>
</key>
<key name="next-profile" type="s">
<default>'&lt;Alt&gt;Page_Down'</default>
<summary>Keyboard shortcut to switch to the next profile</summary>
<description>Keyboard shortcut key to switch to the next profile. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action.</description>
</key>
<key name="move-tab-left" type="s"> <key name="move-tab-left" type="s">
<default>'&lt;Ctrl&gt;&lt;Shift&gt;Page_Up'</default> <default>'&lt;Ctrl&gt;&lt;Shift&gt;Page_Up'</default>
<summary>Accelerator to move the current tab to the left.</summary> <summary>Accelerator to move the current tab to the left.</summary>

View File

@ -59,6 +59,8 @@
#define ACCEL_PATH_FULL_SCREEN ACCEL_PATH_ROOT "ViewFullscreen" #define ACCEL_PATH_FULL_SCREEN ACCEL_PATH_ROOT "ViewFullscreen"
#define ACCEL_PATH_RESET ACCEL_PATH_ROOT "TerminalReset" #define ACCEL_PATH_RESET ACCEL_PATH_ROOT "TerminalReset"
#define ACCEL_PATH_RESET_AND_CLEAR ACCEL_PATH_ROOT "TerminalResetClear" #define ACCEL_PATH_RESET_AND_CLEAR ACCEL_PATH_ROOT "TerminalResetClear"
#define ACCEL_PATH_PREV_PROFILE ACCEL_PATH_ROOT "ProfilePrevious"
#define ACCEL_PATH_NEXT_PROFILE ACCEL_PATH_ROOT "ProfileNext"
#define ACCEL_PATH_PREV_TAB ACCEL_PATH_ROOT "TabsPrevious" #define ACCEL_PATH_PREV_TAB ACCEL_PATH_ROOT "TabsPrevious"
#define ACCEL_PATH_NEXT_TAB ACCEL_PATH_ROOT "TabsNext" #define ACCEL_PATH_NEXT_TAB ACCEL_PATH_ROOT "TabsNext"
#define ACCEL_PATH_SET_TERMINAL_TITLE ACCEL_PATH_ROOT "TerminalSetTitle" #define ACCEL_PATH_SET_TERMINAL_TITLE ACCEL_PATH_ROOT "TerminalSetTitle"
@ -82,8 +84,10 @@
#define KEY_NEW_PROFILE "new-profile" #define KEY_NEW_PROFILE "new-profile"
#define KEY_NEW_TAB "new-tab" #define KEY_NEW_TAB "new-tab"
#define KEY_NEW_WINDOW "new-window" #define KEY_NEW_WINDOW "new-window"
#define KEY_NEXT_PROFILE "next-profile"
#define KEY_NEXT_TAB "next-tab" #define KEY_NEXT_TAB "next-tab"
#define KEY_PASTE "paste" #define KEY_PASTE "paste"
#define KEY_PREV_PROFILE "prev-profile"
#define KEY_PREV_TAB "prev-tab" #define KEY_PREV_TAB "prev-tab"
#define KEY_RESET_AND_CLEAR "reset-and-clear" #define KEY_RESET_AND_CLEAR "reset-and-clear"
#define KEY_RESET "reset" #define KEY_RESET "reset"
@ -210,6 +214,14 @@ static KeyEntry terminal_entries[] =
N_("Reset and Clear"), N_("Reset and Clear"),
KEY_RESET_AND_CLEAR, ACCEL_PATH_RESET_AND_CLEAR, 0, 0, NULL, FALSE, TRUE KEY_RESET_AND_CLEAR, ACCEL_PATH_RESET_AND_CLEAR, 0, 0, NULL, FALSE, TRUE
}, },
{
N_("Switch to Previous Profile"),
KEY_PREV_PROFILE, ACCEL_PATH_PREV_PROFILE, GDK_MOD1_MASK, GDK_Page_Up, NULL, FALSE, TRUE
},
{
N_("Switch to Next Profile"),
KEY_NEXT_PROFILE, ACCEL_PATH_NEXT_PROFILE, GDK_MOD1_MASK, GDK_Page_Down, NULL, FALSE, TRUE
},
}; };
static KeyEntry tabs_entries[] = static KeyEntry tabs_entries[] =

View File

@ -98,7 +98,7 @@ struct _TerminalWindowPrivate
#define SET_ENCODING_UI_PATH "/menubar/Terminal/TerminalSetEncoding/EncodingsPH" #define SET_ENCODING_UI_PATH "/menubar/Terminal/TerminalSetEncoding/EncodingsPH"
#define SET_ENCODING_ACTION_NAME_PREFIX "TerminalSetEncoding" #define SET_ENCODING_ACTION_NAME_PREFIX "TerminalSetEncoding"
#define PROFILES_UI_PATH "/menubar/Terminal/TerminalProfiles" #define PROFILES_UI_PATH "/menubar/Terminal/TerminalProfiles/ProfilesPH"
#define PROFILES_POPUP_UI_PATH "/Popup/PopupTerminalProfiles/ProfilesPH" #define PROFILES_POPUP_UI_PATH "/Popup/PopupTerminalProfiles/ProfilesPH"
#define SIZE_TO_UI_PATH "/menubar/Terminal/TerminalSizeToPH" #define SIZE_TO_UI_PATH "/menubar/Terminal/TerminalSizeToPH"
@ -197,6 +197,8 @@ static void search_find_prev_callback (GtkAction *action,
TerminalWindow *window); TerminalWindow *window);
static void search_clear_highlight_callback (GtkAction *action, static void search_clear_highlight_callback (GtkAction *action,
TerminalWindow *window); TerminalWindow *window);
static void terminal_next_or_previous_profile_cb (GtkAction *action,
TerminalWindow *window);
static void terminal_set_title_callback (GtkAction *action, static void terminal_set_title_callback (GtkAction *action,
TerminalWindow *window); TerminalWindow *window);
static void terminal_add_encoding_callback (GtkAction *action, static void terminal_add_encoding_callback (GtkAction *action,
@ -1033,10 +1035,8 @@ update_edit_menu_cb (GtkClipboard *clipboard,
} }
static void static void
edit_menu_activate_callback (GtkMenuItem *menuitem, update_edit_menu(TerminalWindow *window)
gpointer user_data)
{ {
TerminalWindow *window = (TerminalWindow *) user_data;
GtkClipboard *clipboard; GtkClipboard *clipboard;
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (window), GDK_SELECTION_CLIPBOARD); clipboard = gtk_widget_get_clipboard (GTK_WIDGET (window), GDK_SELECTION_CLIPBOARD);
@ -1924,6 +1924,16 @@ terminal_window_init (TerminalWindow *window)
/* Terminal menu */ /* Terminal menu */
{ "TerminalProfiles", NULL, N_("Change _Profile") }, { "TerminalProfiles", NULL, N_("Change _Profile") },
{
"ProfilePrevious", NULL, N_("_Previous Profile"), "<alt>Page_Up",
NULL,
G_CALLBACK (terminal_next_or_previous_profile_cb)
},
{
"ProfileNext", NULL, N_("_Next Profile"), "<alt>Page_Down",
NULL,
G_CALLBACK (terminal_next_or_previous_profile_cb)
},
{ {
"TerminalSetTitle", NULL, N_("_Set Title…"), NULL, "TerminalSetTitle", NULL, N_("_Set Title…"), NULL,
NULL, NULL,
@ -2087,6 +2097,7 @@ terminal_window_init (TerminalWindow *window)
GError *error; GError *error;
GtkWindowGroup *window_group; GtkWindowGroup *window_group;
GtkAccelGroup *accel_group; GtkAccelGroup *accel_group;
GtkClipboard *clipboard;
priv = window->priv = G_TYPE_INSTANCE_GET_PRIVATE (window, TERMINAL_TYPE_WINDOW, TerminalWindowPrivate); priv = window->priv = G_TYPE_INSTANCE_GET_PRIVATE (window, TERMINAL_TYPE_WINDOW, TerminalWindowPrivate);
@ -2160,16 +2171,10 @@ terminal_window_init (TerminalWindow *window)
gtk_ui_manager_insert_action_group (manager, action_group, 0); gtk_ui_manager_insert_action_group (manager, action_group, 0);
g_object_unref (action_group); g_object_unref (action_group);
action = gtk_action_group_get_action (action_group, "Edit"); clipboard = gtk_widget_get_clipboard (GTK_WIDGET (window), GDK_SELECTION_CLIPBOARD);
g_signal_connect (action, "activate", g_signal_connect_swapped (clipboard, "owner-change",
G_CALLBACK (edit_menu_activate_callback), window); G_CALLBACK (update_edit_menu), window);
update_edit_menu (window);
/* Set this action invisible so the Edit menu doesn't flash the first
* time it's shown and there's no text/uri-list on the clipboard.
*/
action = gtk_action_group_get_action (priv->action_group, "EditPasteURIPaths");
gtk_action_set_visible (action, FALSE);
/* Idem for this action, since the window is not fullscreen. */ /* Idem for this action, since the window is not fullscreen. */
action = gtk_action_group_get_action (priv->action_group, "PopupLeaveFullscreen"); action = gtk_action_group_get_action (priv->action_group, "PopupLeaveFullscreen");
gtk_action_set_visible (action, FALSE); gtk_action_set_visible (action, FALSE);
@ -2260,6 +2265,7 @@ terminal_window_dispose (GObject *object)
TerminalWindowPrivate *priv = window->priv; TerminalWindowPrivate *priv = window->priv;
TerminalApp *app; TerminalApp *app;
GdkScreen *screen; GdkScreen *screen;
GtkClipboard *clipboard;
remove_popup_info (window); remove_popup_info (window);
@ -2283,6 +2289,10 @@ terminal_window_dispose (GObject *object)
g_signal_handlers_disconnect_by_func (app, g_signal_handlers_disconnect_by_func (app,
G_CALLBACK (terminal_window_encoding_list_changed_cb), G_CALLBACK (terminal_window_encoding_list_changed_cb),
window); window);
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (window), GDK_SELECTION_CLIPBOARD);
g_signal_handlers_disconnect_by_func (clipboard,
G_CALLBACK (update_edit_menu),
window);
screen = gtk_widget_get_screen (GTK_WIDGET (object)); screen = gtk_widget_get_screen (GTK_WIDGET (object));
if (screen) if (screen)
@ -3778,6 +3788,61 @@ search_clear_highlight_callback (GtkAction *action,
vte_terminal_search_set_gregex (VTE_TERMINAL (window->priv->active_screen), NULL); vte_terminal_search_set_gregex (VTE_TERMINAL (window->priv->active_screen), NULL);
} }
static void
terminal_next_or_previous_profile_cb (GtkAction *action,
TerminalWindow *window)
{
TerminalWindowPrivate *priv = window->priv;
TerminalProfile *active_profile, *new_profile;
GList *profiles, *p;
const char *name;
guint backwards = 0;
name = gtk_action_get_name (action);
if (strcmp (name, "ProfilePrevious") == 0)
{
backwards = 1;
}
profiles = terminal_app_get_profile_list (terminal_app_get ());
if (profiles == NULL)
return;
if (priv->active_screen)
active_profile = terminal_screen_get_profile (priv->active_screen);
else
return;
for (p = profiles; p != NULL; p = p->next)
{
TerminalProfile *profile = (TerminalProfile *) p->data;
if (profile == active_profile)
{
if (backwards) {
p = p->prev;
if (p == NULL)
p = g_list_last (profiles);
new_profile = p->data;
break;
}
else
{
p = p->next;
if (p == NULL)
p = g_list_first (profiles);
new_profile = p->data;
break;
}
}
}
if (new_profile)
terminal_screen_set_profile (priv->active_screen, new_profile);
g_list_free (profiles);
}
static void static void
terminal_set_title_dialog_response_cb (GtkWidget *dialog, terminal_set_title_dialog_response_cb (GtkWidget *dialog,
int response, int response,

View File

@ -82,7 +82,8 @@ ay_to_strv (GVariant *variant,
data = g_variant_get_fixed_array (variant, &data_len, sizeof (char)); data = g_variant_get_fixed_array (variant, &data_len, sizeof (char));
if (data_len == 0 || data_len > G_MAXSSIZE) if (data_len == 0 || data_len > G_MAXSSIZE)
{ {
*argc = 0; if (argc != NULL)
*argc = 0;
return NULL; return NULL;
} }

View File

@ -48,7 +48,12 @@
--> -->
</menu> </menu>
<menu action="Terminal"> <menu action="Terminal">
<menu action="TerminalProfiles" /> <menu action="TerminalProfiles">
<placeholder name="ProfilesPH" />
<separator />
<menuitem action="ProfileNext" />
<menuitem action="ProfilePrevious" />
</menu>
<menuitem action="TerminalSetTitle" /> <menuitem action="TerminalSetTitle" />
<menu action="TerminalSetEncoding" > <menu action="TerminalSetEncoding" >
<placeholder name="EncodingsPH" /> <placeholder name="EncodingsPH" />