Skip to content

Commit 1688e99

Browse files
committed
Handle change VLSM Subnet Name by editing value in Column
1 parent 6e4027a commit 1688e99

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

Base.lproj/MainMenu.xib

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@
539539
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
540540
<clipView key="contentView" id="L0l-HJ-flz">
541541
<rect key="frame" x="1" y="1" width="567" height="485"/>
542-
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
542+
<autoresizingMask key="autoresizingMask"/>
543543
<subviews>
544544
<tableView identifier="subnetsTabView" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" headerView="583" id="586">
545545
<rect key="frame" x="0.0" y="0.0" width="567" height="462"/>
@@ -831,7 +831,7 @@
831831
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
832832
<clipView key="contentView" id="rby-ox-fjA">
833833
<rect key="frame" x="1" y="1" width="567" height="485"/>
834-
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
834+
<autoresizingMask key="autoresizingMask"/>
835835
<subviews>
836836
<tableView identifier="tabViewFLSM" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" headerView="ELH-v1-zWW" id="zYs-mh-V7e">
837837
<rect key="frame" x="0.0" y="0.0" width="567" height="457"/>
@@ -1068,7 +1068,7 @@
10681068
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
10691069
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
10701070
</tableHeaderCell>
1071-
<textFieldCell key="dataCell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" alignment="left" id="juC-wO-jPv">
1071+
<textFieldCell key="dataCell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" alignment="left" id="juC-wO-jPv">
10721072
<font key="font" metaFont="system"/>
10731073
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
10741074
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>

SubnetCalcAppDelegate.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,19 @@ class SubnetCalcAppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate,
776776
return 0
777777
}
778778

779+
//edit a value from a TabView - only for VLSM Subnet Name
780+
func tableView(_ tableView: NSTableView, setObjectValue object: Any?, for tableColumn: NSTableColumn?, row: Int)
781+
{
782+
print("edit table View")
783+
if (tableView == viewVLSM) {
784+
print("edit table View VLSM")
785+
if (tableColumn!.identifier.rawValue == "nameVLSMCol") {
786+
print("edit tableView Name VLSM: \(row) \(object as! String)")
787+
subnetsVLSM[row].1 = object as! String
788+
}
789+
}
790+
}
791+
779792
//Display all subnets info in the TableView Subnet/Hosts
780793
func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?,
781794
row: Int) -> Any?
@@ -879,7 +892,7 @@ class SubnetCalcAppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate,
879892
}
880893
return (nil)
881894
}
882-
895+
883896
@IBAction func subnetBitsSlide(_ sender: AnyObject)
884897
{
885898
if (ipsc == nil)

0 commit comments

Comments
 (0)