Commit 42da010d authored by Egmont Koblinger's avatar Egmont Koblinger

prefs: editor: Merge the Preferences and Profile Preferences windows

https://bugzilla.gnome.org/show_bug.cgi?id=722114
parent 7cb0891d
......@@ -62,7 +62,7 @@ case "$with_gtk" in
3.0) GTK_API_VERSION=3.0
GTK_REQUIRED=3.12.0
GTK_MIN_REQUIRED=3.8
GTK_MAX_ALLOWED=3.20
GTK_MAX_ALLOWED=3.22
VTE_API_VERSION=2.91
VTE_REQUIRED=0.51.3
;;
......
......@@ -365,7 +365,6 @@ EXTRA_DIST = \
nautilus.symbols \
search-popover.ui \
preferences.ui \
profile-preferences.ui \
terminal.common.css \
$(about_DATA) \
$(builder_DATA) \
......
......@@ -386,7 +386,7 @@ migrate_profile (TerminalSettingsList *list,
settings = terminal_settings_list_ref_default_child (list);
is_default = TRUE;
} else {
child_name = terminal_settings_list_add_child (list);
child_name = terminal_settings_list_add_child (list, NULL);
settings = terminal_settings_list_ref_child (list, child_name);
g_free (child_name);
is_default = FALSE;
......@@ -539,7 +539,6 @@ migrate_accels (GSettings *global_settings,
static const const struct { const char *gconf_key; const char *settings_key; } const data[] = {
{ "new_tab", "new-tab" },
{ "new_window", "new-window" },
{ "new_profile", "new-profile" },
{ "close_tab", "close-tab" },
{ "close_window", "close-window" },
{ "copy", "copy" },
......
......@@ -413,10 +413,6 @@
<default>'&lt;Ctrl&gt;&lt;Shift&gt;n'</default>
<summary>Keyboard shortcut to open a new window</summary>
</key>
<key name="new-profile" type="s">
<default>'disabled'</default>
<summary>Keyboard shortcut to create a new profile</summary>
</key>
<key name="save-contents" type="s">
<default>'disabled'</default>
<summary>Keyboard shortcut to save the current tab contents to file</summary>
......@@ -457,10 +453,6 @@
<default>'disabled'</default>
<summary>Keyboard shortcut to open the Preferences dialog</summary>
</key>
<key name="profile-preferences" type="s">
<default>'disabled'</default>
<summary>Keyboard shortcut to open the current profile’s Preferences dialog</summary>
</key>
<key name="full-screen" type="s">
<default>'F11'</default>
<summary>Keyboard shortcut to toggle full screen mode</summary>
......
This diff is collapsed.
This diff is collapsed.
......@@ -23,8 +23,14 @@
G_BEGIN_DECLS
void terminal_profile_edit (GSettings *profile,
const char *widget_name);
void profile_prefs_init (void);
void profile_prefs_destroy (void);
void profile_prefs_unload (void);
void profile_prefs_load (const char *uuid,
GSettings *profile);
G_END_DECLS
......
This diff is collapsed.
......@@ -63,7 +63,6 @@
#define KEY_HELP "help"
#define KEY_MOVE_TAB_LEFT "move-tab-left"
#define KEY_MOVE_TAB_RIGHT "move-tab-right"
#define KEY_NEW_PROFILE "new-profile"
#define KEY_NEW_TAB "new-tab"
#define KEY_NEW_WINDOW "new-window"
#define KEY_NEXT_TAB "next-tab"
......@@ -71,7 +70,6 @@
#define KEY_PREFERENCES "preferences"
#define KEY_PREV_TAB "prev-tab"
#define KEY_PRINT "print"
#define KEY_PROFILE_PREFERENCES "profile-preferences"
#define KEY_READ_ONLY "read-only"
#define KEY_RESET_AND_CLEAR "reset-and-clear"
#define KEY_RESET "reset"
......@@ -125,7 +123,6 @@ typedef struct
static KeyEntry file_entries[] = {
ENTRY (N_("New Tab"), KEY_NEW_TAB, "new-terminal", "(ss)", "('tab','current')" ),
ENTRY (N_("New Window"), KEY_NEW_WINDOW, "new-terminal", "(ss)", "('window','current')"),
ENTRY (N_("New Profile"), KEY_NEW_PROFILE, "new-profile", NULL, NULL ),
#ifdef ENABLE_SAVE
ENTRY (N_("Save Contents"), KEY_SAVE_CONTENTS, "save-contents", NULL, NULL ),
#endif
......@@ -145,7 +142,6 @@ static KeyEntry edit_entries[] = {
ENTRY (N_("Paste"), KEY_PASTE, "paste-text", NULL, NULL ),
ENTRY (N_("Select All"), KEY_SELECT_ALL, "select-all", NULL, NULL ),
ENTRY (N_("Preferences"), KEY_PREFERENCES, "edit-preferences", NULL, NULL ),
ENTRY (N_("Profile Preferences"), KEY_PROFILE_PREFERENCES, "edit-profile", NULL, NULL ),
};
static KeyEntry search_entries[] = {
......
......@@ -310,30 +310,23 @@ app_load_css (GApplication *application)
add_css_provider (application, TRUE);
}
void
char *
terminal_app_new_profile (TerminalApp *app,
GSettings *base_profile)
GSettings *base_profile,
const char *name)
{
gs_unref_object GSettings *profile = NULL;
gs_free char *uuid;
char *uuid;
if (base_profile) {
gs_free char *base_uuid;
base_uuid = terminal_settings_list_dup_uuid_from_child (app->profiles_list, base_profile);
uuid = terminal_settings_list_clone_child (app->profiles_list, base_uuid);
uuid = terminal_settings_list_clone_child (app->profiles_list, base_uuid, name);
} else {
uuid = terminal_settings_list_add_child (app->profiles_list);
uuid = terminal_settings_list_add_child (app->profiles_list, name);
}
if (uuid == NULL)
return;
profile = terminal_settings_list_ref_child (app->profiles_list, uuid);
if (profile == NULL)
return;
terminal_profile_edit (profile, "profile-name-entry");
return uuid;
}
void
......@@ -625,7 +618,7 @@ app_menu_preferences_cb (GSimpleAction *action,
{
TerminalApp *app = user_data;
terminal_app_edit_preferences (app);
terminal_app_edit_preferences (app, NULL, NULL);
}
static void
......@@ -1093,17 +1086,11 @@ terminal_app_get_clipboard_targets (TerminalApp *app,
}
void
terminal_app_edit_profile (TerminalApp *app,
GSettings *profile,
const char *widget_name)
{
terminal_profile_edit (profile, widget_name);
}
void
terminal_app_edit_preferences (TerminalApp *app)
terminal_app_edit_preferences (TerminalApp *app,
GSettings *profile,
const char *widget_name)
{
terminal_prefs_show_preferences ("general");
terminal_prefs_show_preferences (profile, widget_name);
}
/**
......
......@@ -56,12 +56,13 @@ GdkAtom *terminal_app_get_clipboard_targets (TerminalApp *app,
GtkClipboard *clipboard,
int *n_targets);
void terminal_app_edit_profile (TerminalApp *app,
GSettings *profile,
const char *widget_name);
void terminal_app_edit_preferences (TerminalApp *app,
GSettings *profile,
const char *widget_name);
void terminal_app_new_profile (TerminalApp *app,
GSettings *default_base_profile);
char *terminal_app_new_profile (TerminalApp *app,
GSettings *default_base_profile,
const char *name);
void terminal_app_remove_profile (TerminalApp *app,
GSettings *profile);
......@@ -94,8 +95,6 @@ void terminal_app_register_screen (TerminalApp *app,
void terminal_app_unregister_screen (TerminalApp *app,
TerminalScreen *screen);
void terminal_app_edit_preferences (TerminalApp *app);
TerminalSettingsList *terminal_app_get_profiles_list (TerminalApp *app);
/* Menus */
......
......@@ -21,10 +21,6 @@
<attribute name="label" translatable="yes">_File</attribute>
<section id="new-terminal-section" />
<section>
<item>
<attribute name="label" translatable="yes">New _Profile</attribute>
<attribute name="action">win.new-profile</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Save Contents…</attribute>
<attribute name="action">win.save-contents</attribute>
......@@ -88,10 +84,6 @@
<attribute name="label" translatable="yes">P_references</attribute>
<attribute name="action">win.edit-preferences</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Pr_ofile Preferences</attribute>
<attribute name="action">win.edit-profile</attribute>
</item>
</section>
</submenu>
<submenu>
......
This diff is collapsed.
......@@ -20,9 +20,35 @@
#include <gtk/gtk.h>
#include "terminal-profiles-list.h"
G_BEGIN_DECLS
void terminal_prefs_show_preferences (const char *page);
/* FIXME move back to the .c file if profile-editor.c is also merged there,
* also remove the terminal-profiles-list.h incude above. */
/* FIXME PrefData is a very bad name, rename to PrefsDialog maybe? */
/* Everything about a preferences dialog */
typedef struct {
TerminalSettingsList *profiles_list;
GSettings *selected_profile;
GtkListBoxRow *selected_list_box_row;
char *selected_profile_uuid; /* a copy thereof, to survive changes to profiles_list */
GtkBuilder *builder;
GtkWidget *dialog;
GtkListBox *listbox;
GtkWidget *new_profile_button;
GtkWidget *stack;
GArray *profile_signals;
GArray *profile_bindings;
} PrefData;
extern PrefData *the_pref_data; /* global */
void terminal_prefs_show_preferences (GSettings *profile, const char *widget_name);
G_END_DECLS
......
......@@ -1253,7 +1253,7 @@ get_child_environment (TerminalScreen *screen,
enum {
RESPONSE_RELAUNCH,
RESPONSE_EDIT_PROFILE
RESPONSE_EDIT_PREFERENCES
};
static void
......@@ -1272,10 +1272,10 @@ info_bar_response_cb (GtkWidget *info_bar,
gtk_widget_destroy (info_bar);
_terminal_screen_launch_child_on_idle (screen);
break;
case RESPONSE_EDIT_PROFILE:
terminal_app_edit_profile (terminal_app_get (),
terminal_screen_get_profile (screen),
"custom-command-entry");
case RESPONSE_EDIT_PREFERENCES:
terminal_app_edit_preferences (terminal_app_get (),
terminal_screen_get_profile (screen),
"custom-command-entry");
break;
default:
gtk_widget_destroy (info_bar);
......@@ -1389,7 +1389,7 @@ spawn_result_cb (VteTerminal *terminal,
vte_terminal_set_pty (terminal, NULL);
info_bar = terminal_info_bar_new (GTK_MESSAGE_ERROR,
_("_Profile Preferences"), RESPONSE_EDIT_PROFILE,
_("_Preferences"), RESPONSE_EDIT_PREFERENCES,
_("_Relaunch"), RESPONSE_RELAUNCH,
NULL);
terminal_info_bar_format_text (TERMINAL_INFO_BAR (info_bar),
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -22,7 +22,6 @@
<file alias="ui/menubar.ui" compressed="true" preprocess="xml-stripblanks">terminal-menubar.ui</file>
<file alias="ui/notebook-menu.ui" compressed="true" preprocess="xml-stripblanks">terminal-notebook-menu.ui</file>
<file alias="ui/preferences.ui" compressed="true" preprocess="xml-stripblanks">preferences.ui</file>
<file alias="ui/profile-preferences.ui" compressed="true" preprocess="xml-stripblanks">profile-preferences.ui</file>
<file alias="ui/search-popover.ui" compressed="true" preprocess="xml-stripblanks">search-popover.ui</file>
<file alias="ui/terminal.about" compressed="true">terminal.about</file>
<file alias="ui/window.ui" compressed="true" preprocess="xml-stripblanks">terminal-window.ui</file>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment