Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: utilizing the new file create dialog

Ilian Sapundshiev0e32a68201cc
diff --git a/app/components/WelcomePanel.tsx b/app/components/WelcomePanel.tsx
index 1962bde9b..00e7cc38a 100644
--- a/app/components/WelcomePanel.tsx
+++ b/app/components/WelcomePanel.tsx
@@ -60,7 +60,7 @@ import HowToStart from '-/components/HowToStart';
interface Props {
theme: any;
classes: any;
- toggleNewEntryDialog: () => void;
+ toggleNewFileDialog: () => void;
toggleLocationDialog: () => void;
toggleOpenLinkDialog: () => void;
toggleKeysDialog: () => void;
@@ -101,7 +101,7 @@ function WelcomePanel(props: Props) {
openFsEntry,
openURLExternally,
toggleKeysDialog,
- toggleNewEntryDialog,
+ toggleNewFileDialog,
toggleLocationDialog,
toggleOpenLinkDialog,
isDesktopMode
@@ -240,7 +240,7 @@ function WelcomePanel(props: Props) {
className={classes.listItem}
/>
</ListItem> */}
- <ListItem onClick={toggleNewEntryDialog}>
+ <ListItem onClick={toggleNewFileDialog}>
<ListItemIcon>
<CreateFileIcon />
</ListItemIcon>
@@ -460,7 +460,7 @@ function mapActionCreatorsToProps(dispatch) {
return bindActionCreators(
{
setFirstRun: SettingsActions.setFirstRun,
- toggleNewEntryDialog: AppActions.toggleNewEntryDialog,
+ toggleNewFileDialog: AppActions.toggleNewFileDialog,
toggleLocationDialog: AppActions.toggleLocationDialog,
toggleOpenLinkDialog: AppActions.toggleOpenLinkDialog,
openURLExternally: AppActions.openURLExternally,
diff --git a/app/components/dialogs/components/CreateDirectory.tsx b/app/components/dialogs/components/CreateDirectory.tsx
index 2e4f6b44c..83123bfca 100644
--- a/app/components/dialogs/components/CreateDirectory.tsx
+++ b/app/components/dialogs/components/CreateDirectory.tsx
@@ -189,7 +189,7 @@ function CreateDirectory(props: Props) {
return (
<>
- <Grid style={{ marginTop: 20 }} item xs={12}>
+ <Grid item xs={12}>
<Button
variant="outlined"
onClick={() => {
@@ -206,7 +206,7 @@ function CreateDirectory(props: Props) {
</Tooltip>
</Button>
</Grid>
- <Grid item xs={12}>
+ <Grid style={{ marginTop: 20 }} item xs={12}>
<Button
variant="outlined"
onClick={() => {
diff --git a/app/components/menus/DirectoryMenu.tsx b/app/components/menus/DirectoryMenu.tsx
index cc7f8c2b8..3b44d89a1 100644
--- a/app/components/menus/DirectoryMenu.tsx
+++ b/app/components/menus/DirectoryMenu.tsx
@@ -67,7 +67,7 @@ interface Props {
openFsEntry: (fsEntry: TS.FileSystemEntry) => void;
openAddRemoveTagsDialog?: () => void;
reflectCreateEntry?: (path: string, isFile: boolean) => void;
- toggleNewEntryDialog?: () => void;
+ toggleNewFileDialog?: () => void;
uploadFilesAPI: (
files: Array<File>,
destination: string,
@@ -242,7 +242,7 @@ function DirectoryMenu(props: Props) {
}*/
function createNewFile() {
- props.toggleNewEntryDialog();
+ props.toggleNewFileDialog();
}
function showInFileManager() {
@@ -493,7 +493,7 @@ function mapDispatchToProps(dispatch) {
onUploadProgress: AppActions.onUploadProgress,
toggleUploadDialog: AppActions.toggleUploadDialog,
toggleProgressDialog: AppActions.toggleProgressDialog,
- toggleNewEntryDialog: AppActions.toggleNewEntryDialog,
+ toggleNewFileDialog: AppActions.toggleNewFileDialog,
toggleCreateDirectoryDialog: AppActions.toggleCreateDirectoryDialog,
toggleProTeaser: AppActions.toggleProTeaser,
resetProgress: AppActions.resetProgress,
diff --git a/app/containers/RendererListener.ts b/app/containers/RendererListener.ts
index 8f419f4ec..eca0db76e 100644
--- a/app/containers/RendererListener.ts
+++ b/app/containers/RendererListener.ts
@@ -29,7 +29,7 @@ export default function listen(props) {
// console.log('Global events: ' + arg);
switch (arg) {
case 'new-text-file':
- props.toggleNewEntryDialog();
+ props.toggleNewFileDialog();
break;
case 'open-search':
props.setSearchQuery({ textQuery: '' });
diff --git a/app/electron-tray-menu.ts b/app/electron-tray-menu.ts
index 2da6ed5e4..0408c67c9 100644
--- a/app/electron-tray-menu.ts
+++ b/app/electron-tray-menu.ts
@@ -65,7 +65,7 @@ export default function buildTrayIconMenu(mainPageProps: any, i18n, isMacLike) {
},
{
label: i18n.t('newFileNote') + cKey + '+Shift+N',
- click: mainPageProps.toggleNewEntryDialog
+ click: mainPageProps.toggleNewFileDialog
},
{
type: 'separator'
diff --git a/app/main.dev.ts b/app/main.dev.ts
index 6883fcc35..ef15303b3 100644
--- a/app/main.dev.ts
+++ b/app/main.dev.ts
@@ -359,7 +359,7 @@ function buildTrayMenu() {
resumePlayback,
createNewWindowInstance,
openSearch: showSearch,
- toggleNewEntryDialog: newTextFile,
+ toggleNewFileDialog: newTextFile,
openNextFile: getNextFile,
openPrevFile: getPreviousFile,
quitApp: reloadApp
@@ -374,7 +374,7 @@ function buildAppMenu() {
{
showTagSpaces,
openSearch: showSearch,
- toggleNewEntryDialog: newTextFile,
+ toggleNewFileDialog: newTextFile,
openNextFile: getNextFile,
openPrevFile: getPreviousFile,
quitApp: reloadApp,
diff --git a/app/services/electron-menus.ts b/app/services/electron-menus.ts
index 465ee557d..c24a0fa17 100644
--- a/app/services/electron-menus.ts
+++ b/app/services/electron-menus.ts
@@ -39,7 +39,7 @@ export default function buildDesktopMenu(props: any, i18n) {
{
label: i18n.t('newFileNote'),
accelerator: 'CommandOrControl+Shift+n',
- click: props.toggleNewEntryDialog
+ click: props.toggleNewFileDialog
},
{
label: i18n.t('createDirectory'),