"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/src/ui/move-to-applications-folder.tsx" between
desktop-release-2.7.2-linux1.tar.gz and desktop-release-2.8.0-linux1.tar.gz

About: GitHub Desktop (Linux) is an open source Electron-based GitHub app. It is written in TypeScript and uses React. A fork of GitHub Desktop to support various Linux distributions. Release candidate.

move-to-applications-folder.tsx  (desktop-release-2.7.2-linux1):move-to-applications-folder.tsx  (desktop-release-2.8.0-linux1)
import * as React from 'react' import * as React from 'react'
import { sendNonFatalException } from '../lib/helpers/non-fatal-exception' import { sendNonFatalException } from '../lib/helpers/non-fatal-exception'
import { import {
Dialog, Dialog,
DialogContent, DialogContent,
DialogFooter, DialogFooter,
OkCancelButtonGroup, OkCancelButtonGroup,
} from './dialog' } from './dialog'
import { Dispatcher } from './dispatcher' import { Dispatcher } from './dispatcher'
import { Checkbox, CheckboxValue } from './lib/checkbox'
interface IMoveToApplicationsFolderProps { interface IMoveToApplicationsFolderProps {
readonly dispatcher: Dispatcher readonly dispatcher: Dispatcher
/** /**
* Callback to use when the dialog gets closed. * Callback to use when the dialog gets closed.
*/ */
readonly onDismissed: () => void readonly onDismissed: () => void
} }
interface IMoveToApplicationsFolderState {
readonly askToMoveToApplicationsFolder: boolean
}
export class MoveToApplicationsFolder extends React.Component< export class MoveToApplicationsFolder extends React.Component<
IMoveToApplicationsFolderProps IMoveToApplicationsFolderProps,
IMoveToApplicationsFolderState
> { > {
public constructor(props: IMoveToApplicationsFolderProps) {
super(props)
this.state = {
askToMoveToApplicationsFolder: true,
}
}
public render() { public render() {
return ( return (
<Dialog <Dialog
title="Move GitHub Desktop to the Applications folder?" title="Move GitHub Desktop to the Applications folder?"
id="move-to-applications-folder" id="move-to-applications-folder"
dismissable={false}
onDismissed={this.props.onDismissed} onDismissed={this.props.onDismissed}
onSubmit={this.onSubmit} onSubmit={this.onSubmit}
type="warning" type="warning"
> >
<DialogContent> <DialogContent>
<p> <p>
We've detected that you're not running GitHub Desktop from the We've detected that you're not running GitHub Desktop from the
Applications folder of your machine. This could cause problems with Applications folder of your machine. This could cause problems with
the app, including impacting your ability to sign in. the app, including impacting your ability to sign in.
<br /> <br />
<br /> <br />
Do you want to move GitHub Desktop to the Applications folder now? Do you want to move GitHub Desktop to the Applications folder now?
This will also restart the app. This will also restart the app.
</p> </p>
<div>
<Checkbox
label="Do not show this message again"
value={
this.state.askToMoveToApplicationsFolder
? CheckboxValue.Off
: CheckboxValue.On
}
onChange={this.onAskToMoveToApplicationsFolderChanged}
/>
</div>
</DialogContent> </DialogContent>
{this.renderFooter()} {this.renderFooter()}
</Dialog> </Dialog>
) )
} }
private renderFooter() { private renderFooter() {
return ( return (
<DialogFooter> <DialogFooter>
<OkCancelButtonGroup <OkCancelButtonGroup
okButtonText={'Move and Restart'} okButtonText="Move and Restart"
okButtonTitle="This will move GitHub Desktop to the Applications folde r in your machine and restart the app." okButtonTitle="This will move GitHub Desktop to the Applications folde r in your machine and restart the app."
cancelButtonText="Cancel" cancelButtonText="Not Now"
onCancelButtonClick={this.onNotNow}
/> />
</DialogFooter> </DialogFooter>
) )
} }
private onSubmit = async () => { private onAskToMoveToApplicationsFolderChanged = (
event: React.FormEvent<HTMLInputElement>
) => {
const value = !event.currentTarget.checked
this.setState({ askToMoveToApplicationsFolder: value })
}
private onNotNow = () => {
this.props.onDismissed()
this.props.dispatcher.setAskToMoveToApplicationsFolderSetting(
this.state.askToMoveToApplicationsFolder
)
}
private onSubmit = () => {
this.props.onDismissed()
try { try {
this.props.dispatcher.moveToApplicationsFolder() this.props.dispatcher.moveToApplicationsFolder()
} catch (error) { } catch (error) {
sendNonFatalException('moveApplication', error) sendNonFatalException('moveApplication', error)
this.props.dispatcher.postError(error)
} }
this.props.onDismissed()
} }
} }
 End of changes. 11 change blocks. 
6 lines changed or deleted 48 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)