Skip to content

Commit

Permalink
Merge pull request #370 from ganeshrvel/release/3.2.22
Browse files Browse the repository at this point in the history
Temporarily removing usb hotplug detection feature Notarize issue.
  • Loading branch information
ganeshrvel committed Jun 12, 2024
2 parents 85294e6 + 32080e9 commit 5848704
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 210 deletions.
29 changes: 14 additions & 15 deletions app/containers/HelpFaqsPage/components/HelpPhoneNotRecognized.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import ListItemText from '@material-ui/core/ListItemText';
import DeleteIcon from '@material-ui/icons/Delete';
import CloseIcon from '@material-ui/icons/Close';
import FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord';
import ToggleOffIcon from '@material-ui/icons/ToggleOff';
import CheckIcon from '@material-ui/icons/Check';
import ListAltIcon from '@material-ui/icons/ListAlt';
import SettingsIcon from '@material-ui/icons/Settings';
Expand Down Expand Up @@ -53,7 +52,7 @@ import { imgsrc } from '../../../utils/imgsrc';
import { helpPhoneNotConnecting } from '../../../templates/fileExplorer';
import { isKalamModeSupported } from '../../../helpers/binaries';

const hotplugSettingText = `Check if 'Enable auto device detection (USB Hotplug)' is enabled under Settings > General Tab`;
// const hotplugSettingText = `Check if 'Enable auto device detection (USB Hotplug)' is enabled under Settings > General Tab`;
const deviceLabel = DEVICES_LABEL[DEVICE_TYPE.mtp];

class HelpPhoneNotRecognized extends PureComponent {
Expand Down Expand Up @@ -169,7 +168,7 @@ class HelpPhoneNotRecognized extends PureComponent {
</ListItemIcon>
<ListItemText
primary="It should connect automatically"
secondary={hotplugSettingText}
// secondary={hotplugSettingText}
/>
</ListItem>
<ListItem>
Expand All @@ -178,7 +177,7 @@ class HelpPhoneNotRecognized extends PureComponent {
</ListItemIcon>
<ListItemText
primary={`Tap on the 'Refresh' button in the app if the ${deviceLabel.toLowerCase()} doesn't get connected automatically`}
secondary={hotplugSettingText}
// secondary={hotplugSettingText}
/>
</ListItem>

Expand Down Expand Up @@ -237,7 +236,7 @@ class HelpPhoneNotRecognized extends PureComponent {
</ListItemIcon>
<ListItemText
primary="It should connect automatically"
secondary={hotplugSettingText}
// secondary={hotplugSettingText}
/>
</ListItem>
<ListItem>
Expand All @@ -246,7 +245,7 @@ class HelpPhoneNotRecognized extends PureComponent {
</ListItemIcon>
<ListItemText
primary={`Tap on the 'Refresh' button in the app if the ${deviceLabel.toLowerCase()} doesn't get connected automatically`}
secondary={hotplugSettingText}
// secondary={hotplugSettingText}
/>
</ListItem>
</>
Expand Down Expand Up @@ -403,15 +402,15 @@ class HelpPhoneNotRecognized extends PureComponent {
/>
</ListItem>

<ListItem>
<ListItemIcon>
<ToggleOffIcon />
</ListItemIcon>
<ListItemText
primary={`If you face frequent device disconnections, turn off 'USB Hotplug'`}
secondary={`Settings > General Tab`}
/>
</ListItem>
{/* <ListItem> */}
{/* <ListItemIcon> */}
{/* <ToggleOffIcon /> */}
{/* </ListItemIcon> */}
{/* <ListItemText */}
{/* primary={`If you face frequent device disconnections, turn off 'USB Hotplug'`} */}
{/* secondary={`Settings > General Tab`} */}
{/* /> */}
{/* </ListItem> */}

<RenderBasicConnection />
</List>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import TableRow from '@material-ui/core/TableRow';
import Collapse from '@material-ui/core/Collapse';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import ToggleOffIcon from '@material-ui/icons/ToggleOff';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemText from '@material-ui/core/ListItemText';
import Divider from '@material-ui/core/Divider';
Expand Down Expand Up @@ -163,15 +162,15 @@ class FileExplorerTableBodyEmptyRender extends PureComponent {
/>
</ListItem>

<ListItem>
{/* <ListItem>
<ListItemIcon>
<ToggleOffIcon />
</ListItemIcon>
<ListItemText
primary={`If you face frequent device disconnections, turn off 'USB Hotplug'`}
secondary={`Settings > General Tab`}
/>
</ListItem>
</ListItem> */}

<ListItem>
<ListItemIcon>
Expand Down
13 changes: 6 additions & 7 deletions app/containers/Onboarding/components/Features.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import ListItemText from '@material-ui/core/ListItemText';
import UsbIcon from '@material-ui/icons/Usb';
import FileCopyIcon from '@material-ui/icons/FileCopy';
import Brightness4Icon from '@material-ui/icons/Brightness4';
import FlashOnIcon from '@material-ui/icons/FlashOn';
import ViewListIcon from '@material-ui/icons/ViewList';
import SdStorageIcon from '@material-ui/icons/SdStorage';
import FlipToBackIcon from '@material-ui/icons/FlipToBack';
Expand Down Expand Up @@ -167,12 +166,12 @@ class Features extends PureComponent {
<ListItemText primary="Choose between Internal Memory and SD Card" />
</ListItem>

<ListItem>
<ListItemIcon>
<FlashOnIcon />
</ListItemIcon>
<ListItemText primary="Auto device detection (USB Hotplug)" />
</ListItem>
{/* <ListItem> */}
{/* <ListItemIcon> */}
{/* <FlashOnIcon /> */}
{/* </ListItemIcon> */}
{/* <ListItemText primary="Auto device detection (USB Hotplug)" /> */}
{/* </ListItem> */}

<ListItem>
<ListItemIcon>
Expand Down
38 changes: 18 additions & 20 deletions app/containers/Settings/components/SettingsDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ export default class SettingsDialog extends PureComponent {
onShowDirectoriesFirstChange,
onMtpModeChange,
onFilesPreprocessingBeforeTransferChange,
onEnableUsbHotplug,
enableUsbHotplug,
} = this.props;

const { tabIndex } = this.state;
Expand Down Expand Up @@ -215,24 +213,24 @@ export default class SettingsDialog extends PureComponent {
</>
)}

<Typography
variant="subtitle2"
className={`${styles.subtitle} ${styles.fmSettingsStylesFix}`}
>
Enable auto device detection (USB Hotplug)
</Typography>
<FormControlLabel
className={styles.switch}
control={
<Switch
checked={enableUsbHotplug}
onChange={(e) =>
onEnableUsbHotplug(e, !enableUsbHotplug)
}
/>
}
label={enableUsbHotplug ? `Enabled` : `Disabled`}
/>
{/* <Typography */}
{/* variant="subtitle2" */}
{/* className={`${styles.subtitle} ${styles.fmSettingsStylesFix}`} */}
{/* > */}
{/* Enable auto device detection (USB Hotplug) */}
{/* </Typography> */}
{/* <FormControlLabel */}
{/* className={styles.switch} */}
{/* control={ */}
{/* <Switch */}
{/* checked={enableUsbHotplug} */}
{/* onChange={(e) => */}
{/* onEnableUsbHotplug(e, !enableUsbHotplug) */}
{/* } */}
{/* /> */}
{/* } */}
{/* label={enableUsbHotplug ? `Enabled` : `Disabled`} */}
{/* /> */}
</FormGroup>
</div>
</SettingsDialogTabContainer>
Expand Down
57 changes: 25 additions & 32 deletions app/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import './services/sentry/index';

import { app, BrowserWindow, ipcMain, nativeTheme } from 'electron';
import electronIs from 'electron-is';
import usbDetect from 'usb-detection';
import process from 'process';
import MenuBuilder from './menu';
import { log } from './utils/log';
Expand All @@ -19,16 +18,10 @@ import { nonBootableDeviceWindow } from './helpers/createWindows';
import { APP_TITLE } from './constants/meta';
import { isPackaged } from './utils/isPackaged';
import { getWindowBackgroundColor } from './helpers/windowHelper';
import {
APP_THEME_MODE_TYPE,
DEVICE_TYPE,
MTP_MODE,
USB_HOTPLUG_EVENTS,
} from './enums';
import { APP_THEME_MODE_TYPE, DEVICE_TYPE, MTP_MODE } from './enums';
import fileExplorerController from './data/file-explorer/controllers/FileExplorerController';
import { getEnablePrereleaseUpdatesSetting } from './helpers/settings';
import { getRemoteWindow } from './helpers/remoteWindowHelpers';
import { IpcEvents } from './services/ipc-events/IpcEventType';
import IpcEventService from './services/ipc-events/IpcEventHandler';
import { isKalamModeSupported } from './helpers/binaries';
import { fileExistsSync } from './helpers/fileOps';
Expand Down Expand Up @@ -296,29 +289,29 @@ if (!isDeviceBootable) {
}

// send attach and detach events to the renderer
usbDetect.startMonitoring();

usbDetect.on('add', (device) => {
if (!mainWindow) {
return;
}

mainWindow?.webContents?.send(IpcEvents.USB_HOTPLUG, {
device: JSON.stringify(device),
eventName: USB_HOTPLUG_EVENTS.attach,
});
});

usbDetect.on('remove', (device) => {
if (!mainWindow) {
return;
}

mainWindow?.webContents?.send(IpcEvents.USB_HOTPLUG, {
device: JSON.stringify(device),
eventName: USB_HOTPLUG_EVENTS.detach,
});
});
// usbDetect.startMonitoring();

// usbDetect.on('add', (device) => {
// if (!mainWindow) {
// return;
// }
//
// mainWindow?.webContents?.send(IpcEvents.USB_HOTPLUG, {
// device: JSON.stringify(device),
// eventName: USB_HOTPLUG_EVENTS.attach,
// });
// });

// usbDetect.on('remove', (device) => {
// if (!mainWindow) {
// return;
// }
//
// mainWindow?.webContents?.send(IpcEvents.USB_HOTPLUG, {
// device: JSON.stringify(device),
// eventName: USB_HOTPLUG_EVENTS.detach,
// });
// });

process.stdout.on('error', (err) => {
if (err.code === 'EPIPE') {
Expand Down Expand Up @@ -354,7 +347,7 @@ if (!isDeviceBootable) {
log.error(e, `main.dev -> before-quit`);
});

usbDetect.stopMonitoring();
// usbDetect.stopMonitoring();

app.quitting = true;
});
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openmtp",
"productName": "OpenMTP",
"version": "3.2.21",
"version": "3.2.22",
"description": "OpenMTP | Android File Transfer for macOS",
"scripts": {
"build": "yarn lint && concurrently \"yarn build-main\" \"yarn build-renderer\"",
Expand Down Expand Up @@ -124,7 +124,6 @@
"source-map-support": "^0.5.21",
"styled-components": "^4.4.1",
"url": "^0.11.0",
"usb-detection": "^4.14.1",
"util": "^0.12.4",
"zlib": "^1.0.5"
},
Expand Down
Loading

0 comments on commit 5848704

Please sign in to comment.