fixup: macos log error (#2764)
* fix: assertion failure in MessageWindowController * feat: update messagwindow xib to new log levels
This commit is contained in:
parent
91d5388954
commit
2bd42f8225
|
@ -14,6 +14,8 @@
|
|||
1BB44E07B1B52E28291B4E32 /* file-piece-map.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1BB44E07B1B52E28291B4E30 /* file-piece-map.cc */; };
|
||||
1BB44E07B1B52E28291B4E33 /* file-piece-map.h in Headers */ = {isa = PBXBuildFile; fileRef = 1BB44E07B1B52E28291B4E31 /* file-piece-map.h */; };
|
||||
2856E0656A49F2665D69E760 /* benc.h in Headers */ = {isa = PBXBuildFile; fileRef = 2856E0656A49F2665D69E761 /* benc.h */; };
|
||||
2B9BA6C508B488FE586A0AB0 /* torrents.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2B9BA6C508B488FE586A0AB1 /* torrents.cc */; };
|
||||
2B9BA6C508B488FE586A0AB2 /* torrents.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B9BA6C508B488FE586A0AB3 /* torrents.h */; };
|
||||
35F373030C2DA89000DAA8F2 /* FilePriorityCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35F373010C2DA88F00DAA8F2 /* FilePriorityCell.mm */; };
|
||||
3C7A11970D0B2EE300B5701F /* getgateway.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C7A11910D0B2EE300B5701F /* getgateway.c */; };
|
||||
3C7A11980D0B2EE300B5701F /* getgateway.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C7A11920D0B2EE300B5701F /* getgateway.h */; };
|
||||
|
@ -55,7 +57,6 @@
|
|||
558699602570759F00F77A43 /* libcurl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 55869925257074EC00F77A43 /* libcurl.tbd */; };
|
||||
5586996C2570759F00F77A43 /* libcurl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 55869925257074EC00F77A43 /* libcurl.tbd */; };
|
||||
62F644738FE3D8788EBF73A9 /* block-info.cc in Sources */ = {isa = PBXBuildFile; fileRef = A54D44C6A7AAF131D9AE29F5 /* block-info.cc */; };
|
||||
ACBE7A956ED89682EC4460E0 /* file-info.cc in Sources */ = {isa = PBXBuildFile; fileRef = ACBE7A956ED89682EC4460E1 /* file-info.cc */; };
|
||||
66F977825E65AD498C028BB0 /* announce-list.cc in Sources */ = {isa = PBXBuildFile; fileRef = 66F977825E65AD498C028BB1 /* announce-list.cc */; };
|
||||
66F977825E65AD498C028BB2 /* announce-list.h in Headers */ = {isa = PBXBuildFile; fileRef = 66F977825E65AD498C028BB3 /* announce-list.h */; };
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
|
@ -205,7 +206,6 @@
|
|||
A29DF8B90DB2544C00D04E5A /* resume.cc in Sources */ = {isa = PBXBuildFile; fileRef = A29DF8B60DB2544C00D04E5A /* resume.cc */; };
|
||||
A29DF8BA0DB2544C00D04E5A /* resume.h in Headers */ = {isa = PBXBuildFile; fileRef = A29DF8B70DB2544C00D04E5A /* resume.h */; };
|
||||
A29DF8BB0DB2544C00D04E5A /* torrent.h in Headers */ = {isa = PBXBuildFile; fileRef = A29DF8B80DB2544C00D04E5A /* torrent.h */; };
|
||||
2B9BA6C508B488FE586A0AB2 /* torrents.h in Sources */ = {isa = PBXBuildFile; fileRef = 2B9BA6C508B488FE586A0AB3 /* torrents.h */; };
|
||||
A29DF8BE0DB2545F00D04E5A /* verify.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D22A110D65EED100007D5F /* verify.h */; };
|
||||
A29E653613F1603100048D71 /* evutil_rand.c in Sources */ = {isa = PBXBuildFile; fileRef = A29E653513F1603100048D71 /* evutil_rand.c */; };
|
||||
A2A1CB7A0BF29D5500AE959F /* PeerProgressIndicatorCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = A2A1CB780BF29D5500AE959F /* PeerProgressIndicatorCell.mm */; };
|
||||
|
@ -279,6 +279,8 @@
|
|||
A2F8CD430F3D0F4A00DB356A /* miniupnpcstrings.h in Headers */ = {isa = PBXBuildFile; fileRef = A2F8CD420F3D0F4A00DB356A /* miniupnpcstrings.h */; };
|
||||
A2FB057F0BFEB6800095564D /* DragOverlayView.mm in Sources */ = {isa = PBXBuildFile; fileRef = A2FB057D0BFEB6800095564D /* DragOverlayView.mm */; };
|
||||
A2FB701C0D95CAEA0001F331 /* GroupsController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A2FB701B0D95CAEA0001F331 /* GroupsController.mm */; };
|
||||
ACBE7A956ED89682EC4460E0 /* file-info.cc in Sources */ = {isa = PBXBuildFile; fileRef = ACBE7A956ED89682EC4460E1 /* file-info.cc */; };
|
||||
ACBE7A956ED89682EC4460E2 /* file-info.h in Headers */ = {isa = PBXBuildFile; fileRef = ACBE7A956ED89682EC4460E3 /* file-info.h */; settings = {ATTRIBUTES = (Project, ); }; };
|
||||
BE1183580CE160C50002D0F3 /* miniupnpc_declspec.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11834E0CE160C50002D0F3 /* miniupnpc_declspec.h */; };
|
||||
BE1183590CE160C50002D0F3 /* igd_desc_parse.h in Headers */ = {isa = PBXBuildFile; fileRef = BE11834F0CE160C50002D0F3 /* igd_desc_parse.h */; };
|
||||
BE11835A0CE160C50002D0F3 /* minixml.h in Headers */ = {isa = PBXBuildFile; fileRef = BE1183500CE160C50002D0F3 /* minixml.h */; };
|
||||
|
@ -309,7 +311,6 @@
|
|||
BEFC1E2D0C07861A00B0BB3C /* upnp.cc in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1DF40C07861A00B0BB3C /* upnp.cc */; };
|
||||
BEFC1E2F0C07861A00B0BB3C /* session.cc in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1DF60C07861A00B0BB3C /* session.cc */; };
|
||||
BEFC1E320C07861A00B0BB3C /* torrent.cc in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1DF90C07861A00B0BB3C /* torrent.cc */; };
|
||||
2B9BA6C508B488FE586A0AB0 /* torrents.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2B9BA6C508B488FE586A0AB1 /* torrents.cc */; };
|
||||
BEFC1E350C07861A00B0BB3C /* port-forwarding.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1DFC0C07861A00B0BB3C /* port-forwarding.h */; };
|
||||
BEFC1E360C07861A00B0BB3C /* port-forwarding.cc in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1DFD0C07861A00B0BB3C /* port-forwarding.cc */; };
|
||||
BEFC1E3B0C07861A00B0BB3C /* platform.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1E020C07861A00B0BB3C /* platform.h */; };
|
||||
|
@ -417,7 +418,6 @@
|
|||
ED8A16422735A8AA000D61F9 /* peer-mgr-wishlist.cc in Sources */ = {isa = PBXBuildFile; fileRef = ED8A163E2735A8AA000D61F9 /* peer-mgr-wishlist.cc */; };
|
||||
EDBDFA9E25AFCCA60093D9C1 /* evutil_time.c in Sources */ = {isa = PBXBuildFile; fileRef = EDBDFA9D25AFCCA60093D9C1 /* evutil_time.c */; };
|
||||
F11545ACA7C4D7A464F703AB /* block-info.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A044CBD8C049AFCBD4DB411 /* block-info.h */; settings = {ATTRIBUTES = (Project, ); }; };
|
||||
ACBE7A956ED89682EC4460E2 /* file-info.h in Headers */ = {isa = PBXBuildFile; fileRef = ACBE7A956ED89682EC4460E3 /* file-info.h */; settings = {ATTRIBUTES = (Project, ); }; };
|
||||
F63480631E1D7274005B9E09 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F63480621E1D7274005B9E09 /* Images.xcassets */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
|
@ -566,6 +566,8 @@
|
|||
29B97316FDCFA39411CA2CEA /* main.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
|
||||
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
2B9BA6C508B488FE586A0AB1 /* torrents.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = torrents.cc; sourceTree = "<group>"; };
|
||||
2B9BA6C508B488FE586A0AB3 /* torrents.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = torrents.h; sourceTree = "<group>"; };
|
||||
32CA4F630368D1EE00C91783 /* Transmission_Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Transmission_Prefix.pch; sourceTree = "<group>"; };
|
||||
35F373000C2DA88F00DAA8F2 /* FilePriorityCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilePriorityCell.h; sourceTree = "<group>"; };
|
||||
35F373010C2DA88F00DAA8F2 /* FilePriorityCell.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FilePriorityCell.mm; sourceTree = "<group>"; };
|
||||
|
@ -614,7 +616,6 @@
|
|||
66F977825E65AD498C028BB1 /* announce-list.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "announce-list.cc"; sourceTree = "<group>"; };
|
||||
66F977825E65AD498C028BB3 /* announce-list.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "announce-list.h"; sourceTree = "<group>"; };
|
||||
6A044CBD8C049AFCBD4DB411 /* block-info.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "block-info.h"; sourceTree = SOURCE_ROOT; };
|
||||
ACBE7A956ED89682EC4460E3 /* file-info.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "file-info.h"; sourceTree = SOURCE_ROOT; };
|
||||
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
8D1107320486CEB800E47090 /* Transmission.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Transmission.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A200B8390A2263BA007BBB1E /* InfoWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InfoWindowController.h; sourceTree = "<group>"; };
|
||||
|
@ -888,7 +889,6 @@
|
|||
A29DF8B60DB2544C00D04E5A /* resume.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = resume.cc; sourceTree = "<group>"; };
|
||||
A29DF8B70DB2544C00D04E5A /* resume.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = resume.h; sourceTree = "<group>"; };
|
||||
A29DF8B80DB2544C00D04E5A /* torrent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = torrent.h; sourceTree = "<group>"; };
|
||||
2B9BA6C508B488FE586A0AB3 /* torrents.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = torrents.h; sourceTree = "<group>"; };
|
||||
A29E653513F1603100048D71 /* evutil_rand.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = evutil_rand.c; sourceTree = "<group>"; };
|
||||
A29EBE520DC01FC9006CEE80 /* web.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = web.cc; sourceTree = "<group>"; };
|
||||
A29EBE530DC01FC9006CEE80 /* web.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = web.h; sourceTree = "<group>"; };
|
||||
|
@ -1004,6 +1004,7 @@
|
|||
A2FB701B0D95CAEA0001F331 /* GroupsController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GroupsController.mm; sourceTree = "<group>"; };
|
||||
A54D44C6A7AAF131D9AE29F5 /* block-info.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "block-info.cc"; sourceTree = "<group>"; };
|
||||
ACBE7A956ED89682EC4460E1 /* file-info.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "file-info.cc"; sourceTree = "<group>"; };
|
||||
ACBE7A956ED89682EC4460E3 /* file-info.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "file-info.h"; sourceTree = SOURCE_ROOT; };
|
||||
BE1183480CE160960002D0F3 /* libminiupnp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libminiupnp.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
BE11834E0CE160C50002D0F3 /* miniupnpc_declspec.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = miniupnpc_declspec.h; sourceTree = "<group>"; };
|
||||
BE11834F0CE160C50002D0F3 /* igd_desc_parse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = igd_desc_parse.h; sourceTree = "<group>"; };
|
||||
|
@ -1035,7 +1036,6 @@
|
|||
BEFC1DF50C07861A00B0BB3C /* transmission.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = transmission.h; sourceTree = "<group>"; };
|
||||
BEFC1DF60C07861A00B0BB3C /* session.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = session.cc; sourceTree = "<group>"; };
|
||||
BEFC1DF90C07861A00B0BB3C /* torrent.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = torrent.cc; sourceTree = "<group>"; };
|
||||
2B9BA6C508B488FE586A0AB1 /* torrents.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = torrents.cc; sourceTree = "<group>"; };
|
||||
BEFC1DFC0C07861A00B0BB3C /* port-forwarding.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "port-forwarding.h"; sourceTree = "<group>"; };
|
||||
BEFC1DFD0C07861A00B0BB3C /* port-forwarding.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "port-forwarding.cc"; sourceTree = "<group>"; };
|
||||
BEFC1E020C07861A00B0BB3C /* platform.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = platform.h; sourceTree = "<group>"; };
|
||||
|
|
|
@ -71,7 +71,7 @@ private:
|
|||
Glib::RefPtr<Gtk::ListStore> store_;
|
||||
Glib::RefPtr<Gtk::TreeModelFilter> filter_;
|
||||
Glib::RefPtr<Gtk::TreeModelSort> sort_;
|
||||
tr_log_level maxLevel_ = TR_LOG_OFF;
|
||||
tr_log_level maxLevel_ = TR_LOG_INFO;
|
||||
bool isPaused_ = false;
|
||||
sigc::connection refresh_tag_;
|
||||
};
|
||||
|
@ -187,16 +187,24 @@ void MessageLogWindow::Impl::doSave(Gtk::Window& parent, Glib::ustring const& fi
|
|||
|
||||
switch (node->level)
|
||||
{
|
||||
case TR_LOG_TRACE:
|
||||
levelStr = _("trace");
|
||||
break;
|
||||
|
||||
case TR_LOG_DEBUG:
|
||||
levelStr = "debug";
|
||||
levelStr = _("debug");
|
||||
break;
|
||||
|
||||
case TR_LOG_WARN:
|
||||
levelStr = _("warn");
|
||||
break;
|
||||
|
||||
case TR_LOG_ERROR:
|
||||
levelStr = "error";
|
||||
levelStr = _("error");
|
||||
break;
|
||||
|
||||
default:
|
||||
levelStr = " ";
|
||||
levelStr = _("info");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -248,19 +256,25 @@ void MessageLogWindow::Impl::onPauseToggled(Gtk::ToggleToolButton* w)
|
|||
namespace
|
||||
{
|
||||
|
||||
void setForegroundColor(Gtk::CellRendererText* renderer, int msgLevel)
|
||||
void setForegroundColor(Gtk::CellRendererText* renderer, tr_log_level level)
|
||||
{
|
||||
if (msgLevel == TR_LOG_DEBUG)
|
||||
{
|
||||
renderer->property_foreground() = "forestgreen";
|
||||
}
|
||||
else if (msgLevel == TR_LOG_ERROR)
|
||||
switch (level)
|
||||
{
|
||||
case TR_LOG_CRITICAL:
|
||||
case TR_LOG_ERROR:
|
||||
case TR_LOG_WARN:
|
||||
renderer->property_foreground() = "red";
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
|
||||
case TR_LOG_DEBUG:
|
||||
case TR_LOG_TRACE:
|
||||
renderer->property_foreground() = "forestgreen";
|
||||
break;
|
||||
|
||||
case TR_LOG_INFO:
|
||||
case TR_LOG_OFF:
|
||||
renderer->property_foreground_set() = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -410,8 +424,10 @@ Gtk::ComboBox* debug_level_combo_new()
|
|||
{
|
||||
auto* w = gtr_combo_box_new_enum({
|
||||
{ _("Error"), TR_LOG_ERROR },
|
||||
{ _("Warnings"), TR_LOG_WARN },
|
||||
{ _("Information"), TR_LOG_INFO },
|
||||
{ _("Debug"), TR_LOG_DEBUG },
|
||||
{ _("Trace"), TR_LOG_TRACE },
|
||||
});
|
||||
gtr_combo_box_set_active_enum(*w, gtr_pref_int_get(TR_KEY_message_level));
|
||||
return w;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19162" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19162"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
@ -22,7 +22,7 @@
|
|||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" topStrut="YES"/>
|
||||
<rect key="contentRect" x="320" y="502" width="611" height="328"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1050"/>
|
||||
<value key="minSize" type="size" width="550" height="200"/>
|
||||
<view key="contentView" id="6">
|
||||
<rect key="frame" x="0.0" y="0.0" width="611" height="328"/>
|
||||
|
@ -48,8 +48,10 @@
|
|||
<menu key="menu" title="OtherViews" id="16">
|
||||
<items>
|
||||
<menuItem title="Error" state="on" image="RedDotFlat" id="17"/>
|
||||
<menuItem title="Warn" image="RedDotFlat" id="yoL-9H-kTt"/>
|
||||
<menuItem title="Info" image="YellowDotFlat" id="18"/>
|
||||
<menuItem title="Debug" image="PurpleDotFlat" id="19"/>
|
||||
<menuItem title="Trace" image="PurpleDotFlat" id="2hu-LL-6A5"/>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
|
@ -117,7 +119,7 @@
|
|||
<sortDescriptor key="sortDescriptorPrototype" selector="localizedStandardCompare:" sortKey="Name"/>
|
||||
<tableColumnResizingMask key="resizingMask" userResizable="YES"/>
|
||||
</tableColumn>
|
||||
<tableColumn identifier="Message" editable="NO" width="384" minWidth="10" maxWidth="3.4028229999999999e+38" id="68">
|
||||
<tableColumn identifier="Message" editable="NO" width="355" minWidth="10" maxWidth="3.4028229999999999e+38" id="68">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Message">
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
|
|
|
@ -12,8 +12,10 @@
|
|||
#import "NSStringAdditions.h"
|
||||
|
||||
#define LEVEL_ERROR 0
|
||||
#define LEVEL_INFO 1
|
||||
#define LEVEL_DEBUG 2
|
||||
#define LEVEL_WARN 1
|
||||
#define LEVEL_INFO 2
|
||||
#define LEVEL_DEBUG 3
|
||||
#define LEVEL_TRACE 4
|
||||
|
||||
#define UPDATE_SECONDS 0.75
|
||||
|
||||
|
@ -66,8 +68,10 @@
|
|||
|
||||
//set images and text for popup button items
|
||||
[self.fLevelButton itemAtIndex:LEVEL_ERROR].title = NSLocalizedString(@"Error", "Message window -> level string");
|
||||
[self.fLevelButton itemAtIndex:LEVEL_WARN].title = NSLocalizedString(@"Warn", "Message window -> level string");
|
||||
[self.fLevelButton itemAtIndex:LEVEL_INFO].title = NSLocalizedString(@"Info", "Message window -> level string");
|
||||
[self.fLevelButton itemAtIndex:LEVEL_DEBUG].title = NSLocalizedString(@"Debug", "Message window -> level string");
|
||||
[self.fLevelButton itemAtIndex:LEVEL_TRACE].title = NSLocalizedString(@"Trace", "Message window -> level string");
|
||||
|
||||
CGFloat const levelButtonOldWidth = NSWidth(self.fLevelButton.frame);
|
||||
[self.fLevelButton sizeToFit];
|
||||
|
@ -110,12 +114,18 @@
|
|||
case TR_LOG_ERROR:
|
||||
[self.fLevelButton selectItemAtIndex:LEVEL_ERROR];
|
||||
break;
|
||||
case TR_LOG_WARN:
|
||||
[self.fLevelButton selectItemAtIndex:LEVEL_WARN];
|
||||
break;
|
||||
case TR_LOG_INFO:
|
||||
[self.fLevelButton selectItemAtIndex:LEVEL_INFO];
|
||||
break;
|
||||
case TR_LOG_DEBUG:
|
||||
[self.fLevelButton selectItemAtIndex:LEVEL_DEBUG];
|
||||
break;
|
||||
case TR_LOG_TRACE:
|
||||
[self.fLevelButton selectItemAtIndex:LEVEL_TRACE];
|
||||
break;
|
||||
default: //safety
|
||||
[NSUserDefaults.standardUserDefaults setInteger:TR_LOG_ERROR forKey:@"MessageLevel"];
|
||||
[self.fLevelButton selectItemAtIndex:LEVEL_ERROR];
|
||||
|
@ -256,12 +266,18 @@
|
|||
NSInteger const level = [message[@"Level"] integerValue];
|
||||
switch (level)
|
||||
{
|
||||
case TR_LOG_CRITICAL:
|
||||
case TR_LOG_ERROR:
|
||||
case TR_LOG_WARN:
|
||||
return [NSImage imageNamed:@"RedDotFlat"];
|
||||
|
||||
case TR_LOG_INFO:
|
||||
return [NSImage imageNamed:@"YellowDotFlat"];
|
||||
|
||||
case TR_LOG_DEBUG:
|
||||
case TR_LOG_TRACE:
|
||||
return [NSImage imageNamed:@"PurpleDotFlat"];
|
||||
|
||||
default:
|
||||
NSAssert1(NO, @"Unknown message log level: %ld", level);
|
||||
return nil;
|
||||
|
@ -342,12 +358,18 @@
|
|||
case LEVEL_ERROR:
|
||||
level = TR_LOG_ERROR;
|
||||
break;
|
||||
case LEVEL_WARN:
|
||||
level = TR_LOG_WARN;
|
||||
break;
|
||||
case LEVEL_INFO:
|
||||
level = TR_LOG_INFO;
|
||||
break;
|
||||
case LEVEL_DEBUG:
|
||||
level = TR_LOG_DEBUG;
|
||||
break;
|
||||
case LEVEL_TRACE:
|
||||
level = TR_LOG_TRACE;
|
||||
break;
|
||||
default:
|
||||
NSAssert1(NO, @"Unknown message log level: %ld", [self.fLevelButton indexOfSelectedItem]);
|
||||
level = TR_LOG_INFO;
|
||||
|
|
Loading…
Reference in New Issue