Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/badges/code_issues.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions code/+nansen/+common/+uiinform/+roimanager/informUser.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function informUser(infoID, mode)
preferenceName = 'HowToAdjustAutodetectionArea';
dialogMessage = {...
'To adjust the active area used for autodetection of rois, use ''alt'' + mousescroll.', ...
'The Crosshairs should resize to indicate the size of the active area' };
'The Crosshairs should resize to indicate the size of the active area.' };
end

dialogTitle = 'Info';
Expand All @@ -39,7 +39,10 @@ function informUser(infoID, mode)
setpref(preferenceGroup, preferenceName, 'ask');

case "default"
[pval, tf] = uigetpref(preferenceGroup, preferenceName, ...
if nansen.util.useModernUiComponents()
dialogMessage = strjoin(dialogMessage);
end
uigetpref(preferenceGroup, preferenceName, ...
dialogTitle, dialogMessage, {'Ok'});
shownThisUserSession(infoID) = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ function notifyUserAboutStrangeAltBehaviorOnWindows(mode)
'time to unfreeze the pointer tool or to use the right ''alt'' button instead.'};
pbtns = {'Ok'};

[pval, tf] = uigetpref(group, pref, title, msg, pbtns);
uigetpref(group, pref, title, msg, pbtns);
end
4 changes: 2 additions & 2 deletions code/+nansen/+config/+addons/@AddonManagerUI/AddonManagerUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function onBrowseAddonPushed(obj, addonName, iRow)
quest = {'Locate the folder where this addon is saved'};
pbtns = {'Ok', 'Cancel'};

[pval, tf] = uigetpref(group,pref,title,quest,pbtns);
[pval, ~] = uigetpref(group,pref,title,quest,pbtns);

switch pval
case 'ok'
Expand Down Expand Up @@ -355,7 +355,7 @@ function onOpenWebsiteButtonPushed(obj, addonName, iRow)
obj.openAddonWebsite(S)
end

function onToolbarButtonPushed(obj, src, evt)
function onToolbarButtonPushed(obj, src, ~)

switch src.Text

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function createUIModules(obj, moduleNumber, varargin)

methods (Access = protected)

function onFigureClosed(obj, src, evt)
function onFigureClosed(obj, ~, ~)
%onFigureClosed Callback for when figure is closed.
wasCanceled = promptSaveChanges(obj);

Expand Down Expand Up @@ -398,7 +398,7 @@ function createMetadataInitializationUI(obj, varargin)

methods (Access = private) % Callbacks

function onTabSelectionChanged(obj, src, evt)
function onTabSelectionChanged(obj, ~, evt)
%onTabSelectionChanged Take care of tab change

currentTitle = obj.TabGroup.SelectedTab.Title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ function onDataLocationRemoved(obj, ~, evt)
obj.updateDefaultDataLocationSelector()
end

function onDataLocationModified(obj, src, evt, varargin)
function onDataLocationModified(obj, ~, evt, varargin)
%onDataLocationModified Modify data location in UI
%
% This method is inherited from the HasDataLocationModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ function subfolderChanged(obj, src, ~)
end
end

function subFolderTypeChanged(obj, src, evt)
function subFolderTypeChanged(obj, src, ~)
iRow = obj.getComponentRowNumber(src);
obj.Data(iRow).Type = src.Value;

Expand All @@ -621,7 +621,7 @@ function subFolderTypeChanged(obj, src, evt)
obj.markDirty()
end

function ignoreListChanged(obj, src, evt)
function ignoreListChanged(obj, src, ~)
iRow = obj.getComponentRowNumber(src);
if isempty(src.Value)
obj.Data(iRow).IgnoreList = {};
Expand All @@ -636,7 +636,7 @@ function ignoreListChanged(obj, src, evt)
obj.updateSubfolderItems(iRow)
end

function expressionChanged(obj, src, evt)
function expressionChanged(obj, src, ~)
iRow = obj.getComponentRowNumber(src);
obj.Data(iRow).Expression = src.Value;
obj.markDirty()
Expand Down Expand Up @@ -889,18 +889,18 @@ function onTemplateSelectionChanged(obj, src, event)
end

% Image clicked function: InfoIcon_2
function onInfoButtonClicked(obj, event)
function onInfoButtonClicked(obj, ~)
obj.FolderHierarchyExampleImage.Visible = 'on';
obj.CloseDialogButton.Visible = 'on';
end

% Image clicked function: CloseDialogButton
function onCloseDialogButtonClicked(app, event)
function onCloseDialogButtonClicked(app, ~)
app.FolderHierarchyExampleImage.Visible = 'off';
app.CloseDialogButton.Visible = 'off';
end

function onFolderPreviewButtonClicked(obj, src, evt)
function onFolderPreviewButtonClicked(obj, ~, ~)
%onFolderPreviewButtonClicked Button callback
%
% This callback toggles visibility a figure that displays all the
Expand All @@ -921,7 +921,7 @@ function onFolderPreviewButtonClicked(obj, src, evt)
end

% Value changed function: ShowFilterOptionsButton
function onShowFilterOptionsButtonPushed(obj, src, event)
function onShowFilterOptionsButtonPushed(obj, src, ~)

switch src.Text
case 'Show Filter Options...'
Expand Down Expand Up @@ -1056,7 +1056,7 @@ function onDataLocationModelSet(obj)
end
end

function onDataLocationAdded(obj, ~, evt)
function onDataLocationAdded(obj, ~, ~)
%onDataLocationAdded Callback for DataLocationModel event
%
% This method is inherited from the HasDataLocationModel
Expand Down Expand Up @@ -1100,7 +1100,7 @@ function onDataLocationModified(obj, ~, evt)
end
end

function onDataLocationRemoved(obj, ~, evt)
function onDataLocationRemoved(obj, ~, ~)
%onDataLocationRemoved Callback for DataLocationModel event
%
% This method is inherited from the HasDataLocationModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function createTableContextMenu(obj)

methods (Access = private) % Uicontrol callbacks

function onTableCellEdited(obj, src, evt)
function onTableCellEdited(obj, ~, evt)

rowIdx = evt.Indices(1); colIdx = evt.Indices(2);

Expand Down
2 changes: 1 addition & 1 deletion code/+nansen/+config/+varmodel/VariableModelApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function showPage(obj, pageName)

methods (Access = protected)

function onFigureClosed(obj, src, evt)
function onFigureClosed(obj, ~, ~)

if isempty(obj.UIModule)
delete(obj.Figure); return
Expand Down
20 changes: 10 additions & 10 deletions code/+nansen/+config/+varmodel/VariableModelUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ function onDataLocationChanged(obj,src, ~)
obj.IsDirty = true;
end

function onDataLocationAdded(obj, ~, evt)
function onDataLocationAdded(obj, ~, ~)
%onDataLocationAdded Callback for DataLocationModel event
%
% This method is inherited from the HasDataLocationModel
Expand All @@ -376,7 +376,7 @@ function onDataLocationAdded(obj, ~, evt)
obj.updateDataLocationDropdownItems()
end

function onDataLocationRemoved(obj, ~, evt)
function onDataLocationRemoved(obj, ~, ~)
%onDataLocationRemoved Callback for DataLocationModel event
%
% This method is inherited from the HasDataLocationModel
Expand All @@ -386,7 +386,7 @@ function onDataLocationRemoved(obj, ~, evt)
obj.updateDataLocationDropdownItems()
end

function onDataLocationNameChanged(obj, src, evt)
function onDataLocationNameChanged(obj, ~, ~)
%onDataLocationNameChanged Callback for VariableModel event

% Todo: This should be on the model, not the UI Level
Expand All @@ -397,13 +397,13 @@ function onDataLocationNameChanged(obj, src, evt)
end
end

function onVariableAdded(obj, src, evtData)
function onVariableAdded(obj, ~, evtData)
% onVariableAdded - Callback for VariableAdded event on Model
variableItem = evtData.VariableInfo;
obj.addVariableToTable(variableItem)
end

function onVariableRemoved(obj, src, evtData)
function onVariableRemoved(obj, ~, evtData)
% onVariableRemoved - Callback for VariableRemoved event on Model

variableName = evtData.VariableName;
Expand Down Expand Up @@ -434,7 +434,7 @@ function onFileNameExpressionChanged(obj,src, ~)
obj.IsDirty = true;
end

function onFileTypeChanged(obj, src, evt)
function onFileTypeChanged(obj, src, ~)
%onFileTypeChanged Callback for filetype selection changed

% Get row number where filetype was changed
Expand Down Expand Up @@ -506,7 +506,7 @@ function onFileAdapterChanged(obj, src, evt)
end
end

function onSubfolderChanged(obj, src, evt)
function onSubfolderChanged(obj, src, ~)

rowNumber = obj.getComponentRowNumber(src);
hRow = obj.RowControls(rowNumber);
Expand Down Expand Up @@ -546,15 +546,15 @@ function onSubfolderChanged(obj, src, evt)
end
end

function openDataFolder(obj, src, evt)
function openDataFolder(obj, src, ~)

rowNumber = obj.getComponentRowNumber(src);
folderPath = obj.getSelectedDataLocationFolderPath(rowNumber);

utility.system.openFolder(folderPath)
end

function onAddNewVariableButtonPushed(obj, src, event)
function onAddNewVariableButtonPushed(obj, ~, ~)
% onAddNewVariableButtonPushed - Callback for table button

newVariableItem = obj.VariableModel.getDefaultItem('');
Expand All @@ -572,7 +572,7 @@ function onRemoveVariableButtonPushed(obj, src, ~)
obj.removeRow(rowNumber)
end

function onShowVariablesToggleButtonValueChanged(obj, src, event)
function onShowVariablesToggleButtonValueChanged(obj, ~, ~)

% Only enable "Add Variable" button when showing custom variables
obj.UIButton_AddVariable.Enable = obj.ToolbarButtons(2).Value;
Expand Down
4 changes: 2 additions & 2 deletions code/+nansen/+dataio/+session/FolderMatcherDialog.m
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ function onAddItemToSetMenuItemClicked(obj, colIdx)
obj.updateListbox()
end

function onUnmatchSessionMenuItemClicked(obj, src, evt)
function onUnmatchSessionMenuItemClicked(obj, ~, ~)

% Get row number...
rowIdx = obj.UITable.SelectedRows;
Expand All @@ -371,7 +371,7 @@ function onUnmatchSessionMenuItemClicked(obj, src, evt)
obj.updateListbox()
end

function onTableMousePress(obj, src, evt)
function onTableMousePress(obj, ~, evt)

if evt.Button == 3 || strcmp(evt.SelectionType, 'alt')

Expand Down
4 changes: 2 additions & 2 deletions code/+nansen/+internal/+system/DiskConnectionMonitor.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ function updateDiskList(obj, updatedVolumeList)
% Update volumelist
obj.VolumeList = updatedVolumeList;

[addedNames, idx] = setdiff(newNames, oldNames);
addedNames = setdiff(newNames, oldNames);
if ~isempty(addedNames)
fprintf('Added drives %s\n', addedNames{1});
obj.notify('DiskAdded', event.EventData)
end

% Check if any names were removed
[removedNames, idx] = setdiff(oldNames, newNames);
removedNames = setdiff(oldNames, newNames);
if ~isempty(removedNames)
fprintf('Removed drives %s\n', removedNames{1});
obj.notify('DiskRemoved', event.EventData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function deactivatePreferenceListener(obj, preferenceName)

methods (Access = private) % Callbacks

function onCurrentProjectChangedInPreferences(obj, src, evt)
function onCurrentProjectChangedInPreferences(obj, ~, ~)
% Set new current project in project manager.
if obj.isPreferenceListenerActive('CurrentProjectName')
newProjectName = char(string(obj.Preferences.CurrentProjectName));
Expand All @@ -231,7 +231,7 @@ function onCurrentProjectChangedInPreferences(obj, src, evt)
end
end

function onCurrentProjectChangedInProjectManager(obj, src, evt)
function onCurrentProjectChangedInProjectManager(obj, ~, evt)
% Update value for current project in preferences. Make sure that
% this is not triggering an event, to avoid infinite update loop.
obj.deactivatePreferenceListener('CurrentProjectName')
Expand Down
4 changes: 2 additions & 2 deletions code/+nansen/+manage/OptionsManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ function setOptions(obj, optionsName, options)
if ~isempty(optsName)
optsStruct = obj.getOptions(optsName);
else
optsName = obj.listPresetOptions();
optsStruct = obj.getOptions(optsName);
optsNames = obj.listPresetNames();
optsStruct = obj.getOptions(optsNames{1});
end
elseif nargin == 2
optsStruct = obj.getOptions(optsName);
Expand Down
6 changes: 3 additions & 3 deletions code/+nansen/+notes/UiCreateNote.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function delete(app)
methods (Access = private)

% Callback function
function EnterTextTextAreaValueChanged(app, event)
function EnterTextTextAreaValueChanged(app, ~)
value = app.EnterTextTextArea.Value;
app.TitleEditField.Value = value{1};
end
Expand Down Expand Up @@ -159,7 +159,7 @@ function storeComponentValues(app)
end

methods (Access = protected)
function onSaveButtonPushed(app, src, evt)
function onSaveButtonPushed(app, ~, ~)
app.storeComponentValues()
wasSuccess = app.verifyComponentValues();

Expand All @@ -168,7 +168,7 @@ function onSaveButtonPushed(app, src, evt)
end
end

function onCancelButtonPushed(app, src, evt)
function onCancelButtonPushed(app, ~, ~)
app.delete()
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

methods (Access = protected)

function onFigureClosed(obj, src, evt)
function onFigureClosed(obj, src, ~)

% Check if changes were made to the model.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ function getVariableValueExpression(obj, rowNum)

methods (Access = private) %Callbacks for userinteraction with components

function onPipelineSelectionChanged(obj,src, evt)
function onPipelineSelectionChanged(obj,~, evt)

% Update model data for current pipeline.
pipelineName = evt.PreviousValue;
Expand All @@ -313,7 +313,7 @@ function onPipelineSelectionChanged(obj,src, evt)
obj.createTable()
end

function onAddNewSessionVariableButtonPushed(obj, src, evt)
function onAddNewSessionVariableButtonPushed(obj, ~, ~)

rowData = nansen.pipeline.PipelineCatalog.getSessionMetaVariables();

Expand All @@ -326,7 +326,7 @@ function onAddNewSessionVariableButtonPushed(obj, src, evt)
% If
end

function onRemoveSessionVariableButtonPushed(obj, src, evt)
function onRemoveSessionVariableButtonPushed(obj, src, ~)

i = obj.getComponentRowNumber(src);
obj.removeRow(i)
Expand All @@ -350,7 +350,7 @@ function onVariableNameSelectionChanged(obj, src, ~)
obj.updateVariableNameDropdownItems(1:obj.NumRows)
end

function onSelectionModeButtonGroupValueChanged(obj, src, evt)
function onSelectionModeButtonGroupValueChanged(obj, src, ~)

% Get row which user pushed button from
rowNumber = obj.getComponentRowNumber(src);
Expand Down
Loading