Skip to content

Commit

Permalink
Removed more leftovers, fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekazakov committed Jan 27, 2024
1 parent 76524d6 commit ee5df1a
Show file tree
Hide file tree
Showing 14 changed files with 182 additions and 363 deletions.
7 changes: 4 additions & 3 deletions Source/Base/source/debug.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2016-2023 Michael G. Kazakov
/* Copyright (c) 2016-2024 Michael G. Kazakov
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
Expand Down Expand Up @@ -49,10 +49,11 @@ bool AmIBeingDebugged() noexcept
return ((info.kp_proc.p_flag & P_TRACED) != 0);
}

static const bool g_IsSandboxed = getenv("APP_SANDBOX_CONTAINER_ID") != nullptr;

bool AmISandboxed() noexcept
{
static const auto is_sandboxed = getenv("APP_SANDBOX_CONTAINER_ID") != nullptr;
return is_sandboxed;
return g_IsSandboxed;
}

} // namespace nc::base
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand Down Expand Up @@ -37,39 +37,6 @@
<action selector="OnMenuSendFeedback:" target="-1" id="893"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="143">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Registration Info..." tag="10120" id="p5z-kC-qPf">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="onMainMenuPerformShowRegistrationInfo:" target="-1" id="NmJ-EJ-5YB"/>
</connections>
</menuItem>
<menuItem title="Purchase License" tag="10090" id="NOq-ty-cHI">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="OnPurchaseExternalLicense:" target="-1" id="mYb-Au-kxf"/>
</connections>
</menuItem>
<menuItem title="Activate License..." tag="10080" id="Obg-B8-YTv">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="OnActivateExternalLicense:" target="-1" id="dEP-2K-I2S"/>
</connections>
</menuItem>
<menuItem title="Purchase Pro Features" tag="10100" id="chd-VR-dSN">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="OnPurchaseProFeaturesInApp:" target="-1" id="uug-QA-Iud"/>
</connections>
</menuItem>
<menuItem title="Restore Purchases" tag="10110" id="0Y5-VP-Vjw">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="OnRestoreInAppPurchases:" target="-1" id="gfV-dI-x37"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="fPr-eP-snC">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2014-2022 Michael Kazakov. Subject to GNU General Public License version 3.
// Copyright (C) 2014-2024 Michael Kazakov. Subject to GNU General Public License version 3.
#include <NimbleCommander/Bootstrap/Config.h>
#include <Config/RapidJSON.h>
#include "ActionsShortcutsManager.h"
Expand All @@ -17,11 +17,11 @@
{"menu.nimble_commander.show_all", 10'040},
{"menu.nimble_commander.quit", 10'050},
{"menu.nimble_commander.toggle_admin_mode", 10'070},
{"menu.nimble_commander.active_license_file", 10'080},
{"menu.nimble_commander.purchase_license", 10'090},
{"menu.nimble_commander.purchase_pro_features", 10'100},
{"menu.nimble_commander.restore_purchases", 10'110},
{"menu.nimble_commander.registration_info", 10'120},
{"menu.nimble_commander.active_license_file", 10'080}, // no longer used
{"menu.nimble_commander.purchase_license", 10'090}, // no longer used
{"menu.nimble_commander.purchase_pro_features", 10'100}, // no longer used
{"menu.nimble_commander.restore_purchases", 10'110}, // no longer used
{"menu.nimble_commander.registration_info", 10'120}, // no longer used

{"menu.file.newwindow", 11'000},
{"menu.file.new_folder", 11'090},
Expand Down
5 changes: 0 additions & 5 deletions Source/NimbleCommander/NimbleCommander/Core/Dock.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ class Dock
void SetAdminBadge(bool _value);
bool IsAdminBadgeSet() const noexcept;

void SetUnregisteredBadge(bool _value); // no-lic remove
bool IsAUnregisteredBadgeSet() const noexcept; // no-lic remove

void SetBaseIcon(NSImage *_icon);

private:
Expand All @@ -29,11 +26,9 @@ class Dock

double m_Progress;
bool m_Admin;
bool m_Unregistered; // no-lic remove
NSDockTile *m_Tile;
NSImageView *m_ContentView;
NSProgressIndicator *m_Indicator;
NSView *m_UnregBadge; // no-lic remove
};

} // namespace nc::core
50 changes: 2 additions & 48 deletions Source/NimbleCommander/NimbleCommander/Core/Dock.mm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2017-2022 Michael Kazakov. Subject to GNU General Public License version 3.
// Copyright (C) 2017-2024 Michael Kazakov. Subject to GNU General Public License version 3.
#include "Dock.h"
#include <Utility/VerticallyCenteredTextFieldCell.h>
#include <cmath>
Expand All @@ -9,11 +9,8 @@ @interface NCCoreDockProgressIndicator : NSProgressIndicator
namespace nc::core {

static const auto g_AdminBadge = @"ADMIN";
static const auto g_Unregistered = @"UNREGISTERED";

static NSView *MakeUnregBadge(NSSize _title_size);

Dock::Dock() : m_Progress{-1.}, m_Admin{false}, m_Unregistered{false}, m_Tile{NSApplication.sharedApplication.dockTile}
Dock::Dock() : m_Progress{-1.}, m_Admin{false}, m_Tile{NSApplication.sharedApplication.dockTile}
{
m_ContentView = [NSImageView new];
m_ContentView.image = NSApplication.sharedApplication.applicationIconImage;
Expand Down Expand Up @@ -69,26 +66,6 @@ @interface NCCoreDockProgressIndicator : NSProgressIndicator
return m_Admin;
}

void Dock::SetUnregisteredBadge(bool _value)
{
if( m_Unregistered == _value )
return;
m_Unregistered = _value;

if( !m_UnregBadge ) {
m_UnregBadge = MakeUnregBadge(m_Tile.size);
[m_ContentView addSubview:m_UnregBadge];
}

m_UnregBadge.hidden = !m_Unregistered;
[m_Tile display];
}

bool Dock::IsAUnregisteredBadgeSet() const noexcept
{
return m_Unregistered;
}

void Dock::UpdateBadge()
{
if( m_Admin )
Expand All @@ -104,29 +81,6 @@ @interface NCCoreDockProgressIndicator : NSProgressIndicator
m_ContentView.image = _icon;
}

static NSView *MakeUnregBadge(NSSize _title_size)
{
const auto height = 30;
const auto rc = NSMakeRect(0, (_title_size.height - height) / 2, _title_size.width, height);
const auto v = [[NSTextField alloc] initWithFrame:rc];
v.cell = [[VerticallyCenteredTextFieldCell alloc] init];
v.font = [NSFont systemFontOfSize:16];
v.textColor = NSColor.whiteColor;
v.stringValue = g_Unregistered;
v.editable = false;
v.bezeled = false;
v.alignment = NSTextAlignmentCenter;
v.usesSingleLineMode = true;
v.lineBreakMode = NSLineBreakByClipping;
v.drawsBackground = false;
v.wantsLayer = true;
v.layer.backgroundColor = [NSColor colorWithRed:0.96 green:0.20 blue:0.18 alpha:1.].CGColor;
v.layer.cornerRadius = rc.size.height / 2;
v.layer.opaque = false;
v.layer.opacity = 0.9f;
return v;
}

}

@implementation NCCoreDockProgressIndicator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@
destinationVFS:opp_uniform ? opp_pc.vfs : nullptr
operationOptions:MakeDefaultFileCopyOptions()];

cd.allowVerification = true;

const auto handler = ^(NSModalResponse returnCode) {
if( returnCode != NSModalResponseOK )
return;
Expand Down Expand Up @@ -152,7 +150,6 @@
initialDestination:item.Filename()
destinationVFS:item.Host()
operationOptions:MakeDefaultFileCopyOptions()];
cd.allowVerification = true;

const auto handler = ^(NSModalResponse returnCode) {
if( returnCode != NSModalResponseOK )
Expand Down Expand Up @@ -237,7 +234,6 @@
initialDestination:opp_uniform ? opp_pc.currentDirectoryPath : ""
destinationVFS:opp_uniform ? opp_pc.vfs : nullptr
operationOptions:MakeDefaultFileMoveOptions()];
cd.allowVerification = true;

const auto handler = ^(NSModalResponse returnCode) {
if( returnCode != NSModalResponseOK )
Expand Down Expand Up @@ -295,7 +291,6 @@
initialDestination:item.Filename()
destinationVFS:item.Host()
operationOptions:MakeDefaultFileMoveOptions()];
cd.allowVerification = true;

const auto handler = ^(NSModalResponse returnCode) {
if( returnCode != NSModalResponseOK )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

namespace nc::panel::actions {

Enter::Enter(const PanelAction &_open_files_action)
: m_OpenFilesAction(_open_files_action), m_GoIntoFolder(true, false)
Enter::Enter(const PanelAction &_open_files_action) : m_OpenFilesAction(_open_files_action), m_GoIntoFolder(false)
{
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2017-2020 Michael Kazakov. Subject to GNU General Public License version 3.
// Copyright (C) 2017-2024 Michael Kazakov. Subject to GNU General Public License version 3.
#pragma once

#include "DefaultAction.h"
Expand All @@ -11,77 +11,63 @@ namespace nc::panel::actions {
// - SanboxManager
// - nc::bootstrap::NativeVFSHostInstance()

struct GoToFolder final : PanelAction
{
void Perform( PanelController *_target, id _sender ) const override;
struct GoToFolder final : PanelAction {
void Perform(PanelController *_target, id _sender) const override;
};

struct GoToHomeFolder final : PanelAction
{
void Perform( PanelController *_target, id _sender ) const override;
struct GoToHomeFolder final : PanelAction {
void Perform(PanelController *_target, id _sender) const override;
};

struct GoToDocumentsFolder final : PanelAction
{
void Perform( PanelController *_target, id _sender ) const override;
struct GoToDocumentsFolder final : PanelAction {
void Perform(PanelController *_target, id _sender) const override;
};

struct GoToDesktopFolder final : PanelAction
{
void Perform( PanelController *_target, id _sender ) const override;
struct GoToDesktopFolder final : PanelAction {
void Perform(PanelController *_target, id _sender) const override;
};

struct GoToDownloadsFolder final : PanelAction
{
void Perform( PanelController *_target, id _sender ) const override;
struct GoToDownloadsFolder final : PanelAction {
void Perform(PanelController *_target, id _sender) const override;
};

struct GoToApplicationsFolder final : PanelAction
{
void Perform( PanelController *_target, id _sender ) const override;
struct GoToApplicationsFolder final : PanelAction {
void Perform(PanelController *_target, id _sender) const override;
};

struct GoToUtilitiesFolder final : PanelAction
{
void Perform( PanelController *_target, id _sender ) const override;
struct GoToUtilitiesFolder final : PanelAction {
void Perform(PanelController *_target, id _sender) const override;
};

struct GoToLibraryFolder final : PanelAction
{
void Perform( PanelController *_target, id _sender ) const override;
struct GoToLibraryFolder final : PanelAction {
void Perform(PanelController *_target, id _sender) const override;
};

struct GoToRootFolder final : PanelAction
{
void Perform( PanelController *_target, id _sender ) const override;
struct GoToRootFolder final : PanelAction {
void Perform(PanelController *_target, id _sender) const override;
};

struct GoToProcessesList final : PanelAction
{
void Perform( PanelController *_target, id _sender ) const override;
struct GoToProcessesList final : PanelAction {
void Perform(PanelController *_target, id _sender) const override;
};

struct GoToFavoriteLocation final : PanelAction
{
void Perform( PanelController *_target, id _sender ) const override;
struct GoToFavoriteLocation final : PanelAction {
void Perform(PanelController *_target, id _sender) const override;
};

struct GoToEnclosingFolder final : PanelAction
{
bool Predicate( PanelController *_target ) const override;
void Perform( PanelController *_target, id _sender ) const override;
struct GoToEnclosingFolder final : PanelAction {
bool Predicate(PanelController *_target) const override;
void Perform(PanelController *_target, id _sender) const override;
};

struct GoIntoFolder final : PanelAction
{
GoIntoFolder(bool _support_archives = false, // no-lic remove me
bool _force_checking_for_archive = false );
bool Predicate( PanelController *_target ) const override;
bool ValidateMenuItem( PanelController *_target, NSMenuItem *_item ) const override;
void Perform( PanelController *_target, id _sender ) const override;
struct GoIntoFolder final : PanelAction {
GoIntoFolder(bool _force_checking_for_archive = false);
bool Predicate(PanelController *_target) const override;
bool ValidateMenuItem(PanelController *_target, NSMenuItem *_item) const override;
void Perform(PanelController *_target, id _sender) const override;

private:
const bool m_SupportArchives;
const bool m_ForceArchivesChecking;
};

};
}; // namespace nc::panel::actions
Loading

0 comments on commit ee5df1a

Please sign in to comment.