Skip to content

Commit a6291ab

Browse files
Add an option to disable log window auto show (#2342)
1 parent 059640b commit a6291ab

File tree

12 files changed

+85
-32
lines changed

12 files changed

+85
-32
lines changed

osx/deadbeef.xcodeproj/project.pbxproj

-16
Original file line numberDiff line numberDiff line change
@@ -21592,7 +21592,6 @@
2159221592
CLANG_ENABLE_MODULES = YES;
2159321593
COMBINE_HIDPI_IMAGES = YES;
2159421594
DEAD_CODE_STRIPPING = YES;
21595-
EXCLUDED_ARCHS = arm64;
2159621595
GCC_PRECOMPILE_PREFIX_HEADER = YES;
2159721596
GCC_PREFIX_HEADER = "../plugins/cocoaui/deadbeef-Prefix.pch";
2159821597
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -21640,7 +21639,6 @@
2164021639
CLANG_ENABLE_MODULES = YES;
2164121640
COMBINE_HIDPI_IMAGES = YES;
2164221641
DEAD_CODE_STRIPPING = YES;
21643-
EXCLUDED_ARCHS = arm64;
2164421642
GCC_PRECOMPILE_PREFIX_HEADER = YES;
2164521643
GCC_PREFIX_HEADER = "../plugins/cocoaui/deadbeef-Prefix.pch";
2164621644
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -22468,7 +22466,6 @@
2246822466
DYLIB_CURRENT_VERSION = 1;
2246922467
ENABLE_STRICT_OBJC_MSGSEND = YES;
2247022468
ENABLE_TESTABILITY = YES;
22471-
EXCLUDED_ARCHS = arm64;
2247222469
EXECUTABLE_PREFIX = "";
2247322470
GCC_C_LANGUAGE_STANDARD = gnu11;
2247422471
GCC_NO_COMMON_BLOCKS = YES;
@@ -22515,7 +22512,6 @@
2251522512
DYLIB_COMPATIBILITY_VERSION = 1;
2251622513
DYLIB_CURRENT_VERSION = 1;
2251722514
ENABLE_STRICT_OBJC_MSGSEND = YES;
22518-
EXCLUDED_ARCHS = arm64;
2251922515
EXECUTABLE_PREFIX = "";
2252022516
GCC_C_LANGUAGE_STANDARD = gnu11;
2252122517
GCC_NO_COMMON_BLOCKS = YES;
@@ -22802,7 +22798,6 @@
2280222798
DYLIB_CURRENT_VERSION = 1;
2280322799
ENABLE_STRICT_OBJC_MSGSEND = YES;
2280422800
ENABLE_TESTABILITY = YES;
22805-
EXCLUDED_ARCHS = arm64;
2280622801
EXECUTABLE_PREFIX = "";
2280722802
GCC_C_LANGUAGE_STANDARD = gnu11;
2280822803
GCC_NO_COMMON_BLOCKS = YES;
@@ -22853,7 +22848,6 @@
2285322848
DYLIB_COMPATIBILITY_VERSION = 1;
2285422849
DYLIB_CURRENT_VERSION = 1;
2285522850
ENABLE_STRICT_OBJC_MSGSEND = YES;
22856-
EXCLUDED_ARCHS = arm64;
2285722851
EXECUTABLE_PREFIX = "";
2285822852
GCC_C_LANGUAGE_STANDARD = gnu11;
2285922853
GCC_NO_COMMON_BLOCKS = YES;
@@ -23208,7 +23202,6 @@
2320823202
DYLIB_CURRENT_VERSION = 1;
2320923203
ENABLE_STRICT_OBJC_MSGSEND = YES;
2321023204
ENABLE_TESTABILITY = YES;
23211-
EXCLUDED_ARCHS = arm64;
2321223205
EXECUTABLE_PREFIX = "";
2321323206
GCC_C_LANGUAGE_STANDARD = gnu11;
2321423207
GCC_NO_COMMON_BLOCKS = YES;
@@ -23272,7 +23265,6 @@
2327223265
DYLIB_COMPATIBILITY_VERSION = 1;
2327323266
DYLIB_CURRENT_VERSION = 1;
2327423267
ENABLE_STRICT_OBJC_MSGSEND = YES;
23275-
EXCLUDED_ARCHS = arm64;
2327623268
EXECUTABLE_PREFIX = "";
2327723269
GCC_C_LANGUAGE_STANDARD = gnu11;
2327823270
GCC_NO_COMMON_BLOCKS = YES;
@@ -23318,7 +23310,6 @@
2331823310
CLANG_ENABLE_MODULES = YES;
2331923311
COMBINE_HIDPI_IMAGES = YES;
2332023312
DEAD_CODE_STRIPPING = YES;
23321-
EXCLUDED_ARCHS = arm64;
2332223313
GCC_PRECOMPILE_PREFIX_HEADER = YES;
2332323314
GCC_PREFIX_HEADER = "../plugins/cocoaui/deadbeef-Prefix.pch";
2332423315
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -23367,7 +23358,6 @@
2336723358
CLANG_ENABLE_MODULES = YES;
2336823359
COMBINE_HIDPI_IMAGES = YES;
2336923360
DEAD_CODE_STRIPPING = YES;
23370-
EXCLUDED_ARCHS = arm64;
2337123361
GCC_PRECOMPILE_PREFIX_HEADER = YES;
2337223362
GCC_PREFIX_HEADER = "../plugins/cocoaui/deadbeef-Prefix.pch";
2337323363
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -23533,7 +23523,6 @@
2353323523
DYLIB_CURRENT_VERSION = 1;
2353423524
ENABLE_STRICT_OBJC_MSGSEND = YES;
2353523525
ENABLE_TESTABILITY = YES;
23536-
EXCLUDED_ARCHS = arm64;
2353723526
EXECUTABLE_PREFIX = "";
2353823527
GCC_C_LANGUAGE_STANDARD = gnu11;
2353923528
GCC_NO_COMMON_BLOCKS = YES;
@@ -23597,7 +23586,6 @@
2359723586
DYLIB_COMPATIBILITY_VERSION = 1;
2359823587
DYLIB_CURRENT_VERSION = 1;
2359923588
ENABLE_STRICT_OBJC_MSGSEND = YES;
23600-
EXCLUDED_ARCHS = arm64;
2360123589
EXECUTABLE_PREFIX = "";
2360223590
GCC_C_LANGUAGE_STANDARD = gnu11;
2360323591
GCC_NO_COMMON_BLOCKS = YES;
@@ -23747,7 +23735,6 @@
2374723735
DYLIB_CURRENT_VERSION = 1;
2374823736
ENABLE_STRICT_OBJC_MSGSEND = YES;
2374923737
ENABLE_TESTABILITY = YES;
23750-
EXCLUDED_ARCHS = arm64;
2375123738
EXECUTABLE_PREFIX = "";
2375223739
GCC_C_LANGUAGE_STANDARD = gnu11;
2375323740
GCC_NO_COMMON_BLOCKS = YES;
@@ -23798,7 +23785,6 @@
2379823785
DYLIB_COMPATIBILITY_VERSION = 1;
2379923786
DYLIB_CURRENT_VERSION = 1;
2380023787
ENABLE_STRICT_OBJC_MSGSEND = YES;
23801-
EXCLUDED_ARCHS = arm64;
2380223788
EXECUTABLE_PREFIX = "";
2380323789
GCC_C_LANGUAGE_STANDARD = gnu11;
2380423790
GCC_NO_COMMON_BLOCKS = YES;
@@ -23834,7 +23820,6 @@
2383423820
DEBUG_INFORMATION_FORMAT = dwarf;
2383523821
DYLIB_COMPATIBILITY_VERSION = 1;
2383623822
DYLIB_CURRENT_VERSION = 1;
23837-
EXCLUDED_ARCHS = arm64;
2383823823
GCC_C_LANGUAGE_STANDARD = gnu11;
2383923824
GCC_PREPROCESSOR_DEFINITIONS = (
2384023825
"DEBUG=1",
@@ -23871,7 +23856,6 @@
2387123856
DEAD_CODE_STRIPPING = YES;
2387223857
DYLIB_COMPATIBILITY_VERSION = 1;
2387323858
DYLIB_CURRENT_VERSION = 1;
23874-
EXCLUDED_ARCHS = arm64;
2387523859
GCC_C_LANGUAGE_STANDARD = gnu11;
2387623860
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
2387723861
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../include\"";

osx/xcodeconfig/gtk2.xcconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
// Configuration settings file format documentation can be found at:
1010
// https://help.apple.com/xcode/#/dev745c5c974
1111

12-
GTK2_CFLAGS = -I/usr/local/Cellar/gtk+/2.24.33_2/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.33_2/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.52.2/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/8.4.0/include/harfbuzz -I/usr/local/Cellar/pango/1.52.2/include/pango-1.0 -I/usr/local/Cellar/fribidi/1.0.13/include/fribidi -I/usr/local/Cellar/harfbuzz/8.4.0/include/harfbuzz -I/usr/local/Cellar/graphite2/1.3.14/include -I/usr/local/Cellar/cairo/1.18.0/include -I/usr/local/Cellar/at-spi2-core/2.52.0/include/atk-1.0 -I/usr/local/Cellar/cairo/1.18.0/include/cairo -I/usr/local/Cellar/fontconfig/2.15.0/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/libxext/1.3.6/include -I/usr/local/Cellar/libxrender/0.9.11/include -I/usr/local/Cellar/libx11/1.8.9/include -I/usr/local/Cellar/libxcb/1.17.0/include -I/usr/local/Cellar/libxau/1.0.11/include -I/usr/local/Cellar/libxdmcp/1.1.5/include -I/usr/local/Cellar/pixman/0.42.2/include/pixman-1 -I/usr/local/Cellar/gdk-pixbuf/2.42.11/include/gdk-pixbuf-2.0 -I/usr/local/opt/libpng/include/libpng16 -I/usr/local/Cellar/libtiff/4.6.0/include -I/usr/local/opt/zstd/include -I/usr/local/Cellar/xz/5.4.6/include -I/usr/local/Cellar/jpeg-turbo/3.0.2/include -I/usr/local/Cellar/glib/2.80.0_2/include -I/usr/local/Cellar/glib/2.80.0_2/include/glib-2.0 -I/usr/local/Cellar/glib/2.80.0_2/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.43/include -I/usr/local/Cellar/xorgproto/2024.1/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/ffi
12+
GTK2_CFLAGS = -I/opt/homebrew/Cellar/gtk+/2.24.33_2/include/gtk-2.0 -I/opt/homebrew/Cellar/gtk+/2.24.33_2/lib/gtk-2.0/include -I/opt/homebrew/Cellar/pango/1.54.0/include/pango-1.0 -I/opt/homebrew/Cellar/fribidi/1.0.16/include/fribidi -I/opt/homebrew/Cellar/harfbuzz/10.1.0/include/harfbuzz -I/opt/homebrew/Cellar/graphite2/1.3.14/include -I/opt/homebrew/Cellar/cairo/1.18.2/include -I/opt/homebrew/Cellar/at-spi2-core/2.54.0/include/atk-1.0 -I/opt/homebrew/Cellar/cairo/1.18.2/include/cairo -I/opt/homebrew/Cellar/fontconfig/2.15.0/include -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/Cellar/libxext/1.3.6/include -I/opt/homebrew/Cellar/xorgproto/2024.1/include -I/opt/homebrew/Cellar/libxrender/0.9.11/include -I/opt/homebrew/Cellar/libx11/1.8.10/include -I/opt/homebrew/Cellar/libxcb/1.17.0/include -I/opt/homebrew/Cellar/libxau/1.0.11/include -I/opt/homebrew/Cellar/libxdmcp/1.1.5/include -I/opt/homebrew/Cellar/pixman/0.44.0/include/pixman-1 -I/opt/homebrew/Cellar/gdk-pixbuf/2.42.12/include/gdk-pixbuf-2.0 -I/opt/homebrew/opt/libpng/include/libpng16 -I/opt/homebrew/Cellar/libtiff/4.7.0/include -I/opt/homebrew/opt/zstd/include -I/opt/homebrew/Cellar/xz/5.6.3/include -I/opt/homebrew/Cellar/jpeg-turbo/3.0.4/include -I/opt/homebrew/Cellar/glib/2.82.2/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/ffi -I/opt/homebrew/Cellar/glib/2.82.2/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.82.2/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.44/include
1313

14-
GTK2_LDFLAGS = -L/usr/local/Cellar/gtk+/2.24.33_2/lib -L/usr/local/Cellar/pango/1.52.2/lib -L/usr/local/Cellar/harfbuzz/8.4.0/lib -L/usr/local/Cellar/at-spi2-core/2.52.0/lib -L/usr/local/Cellar/cairo/1.18.0/lib -L/usr/local/Cellar/gdk-pixbuf/2.42.11/lib -L/usr/local/Cellar/glib/2.80.0_2/lib -L/usr/local/opt/gettext/lib -lgtk-quartz-2.0 -lgdk-quartz-2.0 -framework Cocoa -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -framework CoreFoundation -framework ApplicationServices -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
14+
GTK2_LDFLAGS = -L/opt/homebrew/Cellar/gtk+/2.24.33_2/lib -lgtk-quartz-2.0 -lgdk-quartz-2.0 -framework Cocoa -L/opt/homebrew/Cellar/pango/1.54.0/lib -lpangocairo-1.0 -lpango-1.0 -L/opt/homebrew/Cellar/harfbuzz/10.1.0/lib -lharfbuzz -framework CoreFoundation -framework ApplicationServices -L/opt/homebrew/Cellar/at-spi2-core/2.54.0/lib -latk-1.0 -L/opt/homebrew/Cellar/cairo/1.18.2/lib -lcairo -L/opt/homebrew/Cellar/gdk-pixbuf/2.42.12/lib -lgdk_pixbuf-2.0 -L/opt/homebrew/Cellar/glib/2.82.2/lib -lgio-2.0 -lgobject-2.0 -lglib-2.0 -L/opt/homebrew/opt/gettext/lib -lintl

osx/xcodeconfig/gtk3.xcconfig

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// Configuration settings file format documentation can be found at:
1010
// https://help.apple.com/xcode/#/dev745c5c974
1111

12-
GTK3_CFLAGS = -I/usr/local/Cellar/gtk+3/3.24.41/include/gtk-3.0 -I/usr/local/Cellar/glib/2.80.0_2/include/gio-unix-2.0 -I/usr/local/Cellar/cairo/1.18.0/include -I/usr/local/Cellar/libepoxy/1.5.10/include -I/usr/local/Cellar/pango/1.52.2/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/8.4.0/include/harfbuzz -I/usr/local/Cellar/pango/1.52.2/include/pango-1.0 -I/usr/local/Cellar/fribidi/1.0.13/include/fribidi -I/usr/local/Cellar/harfbuzz/8.4.0/include/harfbuzz -I/usr/local/Cellar/graphite2/1.3.14/include -I/usr/local/Cellar/at-spi2-core/2.52.0/include/atk-1.0 -I/usr/local/Cellar/cairo/1.18.0/include/cairo -I/usr/local/Cellar/fontconfig/2.15.0/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/libxext/1.3.6/include -I/usr/local/Cellar/libxrender/0.9.11/include -I/usr/local/Cellar/libx11/1.8.9/include -I/usr/local/Cellar/libxcb/1.17.0/include -I/usr/local/Cellar/libxau/1.0.11/include -I/usr/local/Cellar/libxdmcp/1.1.5/include -I/usr/local/Cellar/pixman/0.42.2/include/pixman-1 -I/usr/local/Cellar/gdk-pixbuf/2.42.11/include/gdk-pixbuf-2.0 -I/usr/local/opt/libpng/include/libpng16 -I/usr/local/Cellar/libtiff/4.6.0/include -I/usr/local/opt/zstd/include -I/usr/local/Cellar/xz/5.4.6/include -I/usr/local/Cellar/jpeg-turbo/3.0.2/include -I/usr/local/Cellar/glib/2.80.0_2/include -I/usr/local/Cellar/glib/2.80.0_2/include/glib-2.0 -I/usr/local/Cellar/glib/2.80.0_2/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.43/include -I/usr/local/Cellar/xorgproto/2024.1/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/ffi
13-
14-
GTK3_LDFLAGS = -L/usr/local/Cellar/gtk+3/3.24.41/lib -L/usr/local/Cellar/pango/1.52.2/lib -L/usr/local/Cellar/harfbuzz/8.4.0/lib -L/usr/local/Cellar/at-spi2-core/2.52.0/lib -L/usr/local/Cellar/cairo/1.18.0/lib -L/usr/local/Cellar/gdk-pixbuf/2.42.11/lib -L/usr/local/Cellar/glib/2.80.0_2/lib -L/usr/local/opt/gettext/lib -lgtk-3 -lgdk-3 -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,CoreGraphics -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
12+
GTK3_CFLAGS = -I/opt/homebrew/Cellar/gtk+3/3.24.43/include/gtk-3.0 -I/opt/homebrew/Cellar/pango/1.54.0/include/pango-1.0 -I/opt/homebrew/Cellar/harfbuzz/10.1.0/include/harfbuzz -I/opt/homebrew/Cellar/graphite2/1.3.14/include -I/opt/homebrew/Cellar/cairo/1.18.2/include -I/opt/homebrew/Cellar/cairo/1.18.2/include/cairo -I/opt/homebrew/Cellar/fontconfig/2.15.0/include -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/Cellar/libxext/1.3.6/include -I/opt/homebrew/Cellar/xorgproto/2024.1/include -I/opt/homebrew/Cellar/libxrender/0.9.11/include -I/opt/homebrew/Cellar/libx11/1.8.10/include -I/opt/homebrew/Cellar/libxcb/1.17.0/include -I/opt/homebrew/Cellar/libxau/1.0.11/include -I/opt/homebrew/Cellar/libxdmcp/1.1.5/include -I/opt/homebrew/Cellar/pixman/0.44.0/include/pixman-1 -I/opt/homebrew/Cellar/gdk-pixbuf/2.42.12/include/gdk-pixbuf-2.0 -I/opt/homebrew/opt/libpng/include/libpng16 -I/opt/homebrew/Cellar/libtiff/4.7.0/include -I/opt/homebrew/opt/zstd/include -I/opt/homebrew/Cellar/xz/5.6.3/include -I/opt/homebrew/Cellar/jpeg-turbo/3.0.4/include -I/opt/homebrew/Cellar/at-spi2-core/2.54.0/include/atk-1.0 -I/opt/homebrew/Cellar/libepoxy/1.5.10/include -I/opt/homebrew/Cellar/fribidi/1.0.16/include/fribidi -I/opt/homebrew/Cellar/glib/2.82.2/include/gio-unix-2.0 -I/opt/homebrew/Cellar/glib/2.82.2/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/ffi -I/opt/homebrew/Cellar/glib/2.82.2/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.82.2/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.44/include
1513

14+
GTK3_LDFLAGS = -L/opt/homebrew/Cellar/gtk+3/3.24.43/lib -lgtk-3 -lgdk-3 -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,CoreGraphics -L/opt/homebrew/Cellar/pango/1.54.0/lib -lpangocairo-1.0 -lpango-1.0 -L/opt/homebrew/Cellar/harfbuzz/10.1.0/lib -lharfbuzz -L/opt/homebrew/Cellar/at-spi2-core/2.54.0/lib -latk-1.0 -L/opt/homebrew/Cellar/cairo/1.18.2/lib -lcairo-gobject -lcairo -L/opt/homebrew/Cellar/gdk-pixbuf/2.42.12/lib -lgdk_pixbuf-2.0 -L/opt/homebrew/Cellar/glib/2.82.2/lib -lgio-2.0 -lgobject-2.0 -lglib-2.0 -L/opt/homebrew/opt/gettext/lib -lintl

plugins/cocoaui/LogWindowController.m

+13-1
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@
2626

2727
extern DB_functions_t *deadbeef;
2828

29+
static const char conf_autoopen_key[] = "cocoaui.log.autoopen";
30+
static const int conf_autoopen_default = 1;
31+
2932
@interface LogWindowController()
3033

3134
@property (nonatomic) BOOL wasShown;
3235
@property (nonatomic) NSDictionary *attributes;
36+
@property (weak) IBOutlet NSButton *autoOpenButton;
3337

3438
@end
3539

@@ -51,6 +55,8 @@ - (void)windowDidLoad {
5155
NSFontAttributeName: font
5256
};
5357

58+
self.autoOpenButton.state = deadbeef->conf_get_int(conf_autoopen_key, conf_autoopen_default) ? NSControlStateValueOn : NSControlStateValueOff;
59+
5460
deadbeef->log_viewer_register (_cocoaui_logger_callback, (__bridge void *)(self));
5561
}
5662

@@ -101,13 +107,19 @@ - (void)appendLoggerText:(const char *)text forPlugin:(DB_plugin_t *)plugin onLa
101107
dispatch_async(dispatch_get_main_queue(), ^{
102108
[self appendText:str];
103109

104-
if (layers == DDB_LOG_LAYER_DEFAULT) {
110+
int autoopen = deadbeef->conf_get_int(conf_autoopen_key, conf_autoopen_default);
111+
112+
if (autoopen && layers == DDB_LOG_LAYER_DEFAULT) {
105113
if (!(self.window).visible) {
106114
[self showWindow:self];
107115
}
108116
}
109117
});
110118
}
111119

120+
- (IBAction)autoOpenButtonAction:(NSButton *)sender {
121+
deadbeef->conf_set_int(conf_autoopen_key, sender.state == NSControlStateValueOn);
122+
deadbeef->conf_save();
123+
}
112124

113125
@end

plugins/cocoaui/XIB/Log.xib

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17505"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<objects>
99
<customObject id="-2" userLabel="File's Owner" customClass="LogWindowController">
1010
<connections>
11+
<outlet property="autoOpenButton" destination="LBo-Zo-3rH" id="i0X-XH-v7U"/>
1112
<outlet property="clipView" destination="07q-Wq-DP9" id="FTH-FN-jyn"/>
1213
<outlet property="textView" destination="UWH-i3-mmQ" id="NBl-wU-bzx"/>
1314
<outlet property="window" destination="QvC-M9-y7g" id="06F-SS-He3"/>
@@ -19,7 +20,7 @@
1920
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
2021
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
2122
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
22-
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="920"/>
23+
<rect key="screenRect" x="0.0" y="0.0" width="2048" height="1127"/>
2324
<value key="minSize" type="size" width="200" height="100"/>
2425
<view key="contentView" id="EiT-Mj-1SZ">
2526
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
@@ -63,6 +64,17 @@
6364
<action selector="clearAction:" target="-2" id="EQJ-zE-Tkg"/>
6465
</connections>
6566
</button>
67+
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LBo-Zo-3rH">
68+
<rect key="frame" x="6" y="8" width="224" height="18"/>
69+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
70+
<buttonCell key="cell" type="check" title="Auto-open this window on errors" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="eKL-81-C8Y">
71+
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
72+
<font key="font" metaFont="system"/>
73+
</buttonCell>
74+
<connections>
75+
<action selector="autoOpenButtonAction:" target="-2" id="boi-X5-DTs"/>
76+
</connections>
77+
</button>
6678
</subviews>
6779
</view>
6880
<connections>

plugins/gtkui/callbacks.c

+11
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
}
7070
#define PL_NEXT(it, iter) (deadbeef->pl_get_next (it, iter))
7171

72+
static const char conf_autoopen_key[] = "gtkui.log.autoopen";
73+
7274
DdbListview *last_playlist;
7375
extern DB_functions_t *deadbeef; // defined in gtkui.c
7476

@@ -726,3 +728,12 @@ on_mainwin_redo_activate (GtkMenuItem *menuitem,
726728
{
727729
gtkui_undostack_perform_redo ();
728730
}
731+
732+
void
733+
on_autoopen_button_toggled (GtkToggleButton *togglebutton,
734+
gpointer user_data)
735+
{
736+
int active = gtk_toggle_button_get_active (togglebutton);
737+
deadbeef->conf_set_int(conf_autoopen_key, active);
738+
deadbeef->conf_save();
739+
}

plugins/gtkui/callbacks.h

+4
Original file line numberDiff line numberDiff line change
@@ -1519,3 +1519,7 @@ on_mainwin_undo_activate (GtkMenuItem *menuitem,
15191519
void
15201520
on_mainwin_redo_activate (GtkMenuItem *menuitem,
15211521
gpointer user_data);
1522+
1523+
void
1524+
on_autoopen_button_toggled (GtkToggleButton *togglebutton,
1525+
gpointer user_data);

plugins/gtkui/deadbeef.glade

+17-1
Original file line numberDiff line numberDiff line change
@@ -11177,7 +11177,23 @@ Descending</property>
1117711177
<property name="spacing">0</property>
1117811178

1117911179
<child>
11180-
<placeholder/>
11180+
<widget class="GtkCheckButton" id="autoopen_button">
11181+
<property name="visible">True</property>
11182+
<property name="can_focus">True</property>
11183+
<property name="label" translatable="yes">Auto-open this window on errors</property>
11184+
<property name="use_underline">True</property>
11185+
<property name="relief">GTK_RELIEF_NORMAL</property>
11186+
<property name="focus_on_click">True</property>
11187+
<property name="active">False</property>
11188+
<property name="inconsistent">False</property>
11189+
<property name="draw_indicator">True</property>
11190+
<signal name="toggled" handler="on_autoopen_button_toggled" last_modification_time="Sat, 16 Nov 2024 19:30:58 GMT"/>
11191+
</widget>
11192+
<packing>
11193+
<property name="padding">0</property>
11194+
<property name="expand">False</property>
11195+
<property name="fill">False</property>
11196+
</packing>
1118111197
</child>
1118211198

1118311199
<child>

0 commit comments

Comments
 (0)