Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added auto close setting to close window when that last tab is closed #613

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
removed unecessary changes
  • Loading branch information
tlemy committed Feb 1, 2024
commit 460fcc9182e2bb8174ebe05933d609c0af81e829
21 changes: 0 additions & 21 deletions xed/xed-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,25 +322,6 @@ on_enable_tab_scrolling_changed (GSettings *settings,
}
}

static void
on_auto_close_changed (GSettings *settings,
const gchar *key,
XedSettings *xs)
{
const GList *windows;
gboolean enable;

enable = g_settings_get_boolean (settings, key);
windows = xed_app_get_main_windows (XED_APP (g_application_get_default ()));

while (windows != NULL)
{
xed_window_set_auto_close (windows->data, enable);

windows = g_list_next (windows);
}
}

static void
on_max_recents_changed (GSettings *settings,
const gchar *key,
Expand Down Expand Up @@ -416,8 +397,6 @@ xed_settings_init (XedSettings *xs)
G_CALLBACK (on_draw_whitespace_locations_or_types_changed), xs);
g_signal_connect (xs->priv->editor, "changed::draw-whitespace-newline",
G_CALLBACK (on_draw_whitespace_locations_or_types_changed), xs);
g_signal_connect (xs->priv->editor, "changed::auto-close",
G_CALLBACK (on_auto_close_changed), xs);

/* ui changes */
g_signal_connect (xs->priv->ui, "changed::enable-tab-scrolling",
Expand Down
22 changes: 0 additions & 22 deletions xed/xed-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -4217,28 +4217,6 @@ xed_window_get_tab_from_location (XedWindow *window,
return ret;
}

/**
* xed_window_set_auto_close:
* @window: a #XedWindow
* @gboolean: a #gboolean
*
* Sets the auto_close switch.
* If the switch is set to true,
* the window closes once the last tab is closed.
*
* Return value: none
*/
void
xed_window_set_auto_close (XedWindow *window,
gboolean enable)
{
g_return_if_fail (XED_IS_WINDOW(window));

xed_debug (DEBUG_WINDOW);

g_settings_set_boolean (window->priv->editor_settings, XED_SETTINGS_AUTO_CLOSE, enable);
}

/**
* xed_window_get_message_bus:
* @window: a #XedWindow
Expand Down
1 change: 0 additions & 1 deletion xed/xed-window.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ void xed_window_close_all_tabs (XedWindow *window);
void xed_window_close_tabs (XedWindow *window, const GList *tabs);
XedTab *xed_window_get_active_tab (XedWindow *window);
void xed_window_set_active_tab (XedWindow *window, XedTab *tab);
void xed_window_set_auto_close (XedWindow *window, gboolean enable);

/* Helper functions */
XedView *xed_window_get_active_view (XedWindow *window);
Expand Down
Loading