diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreCreationComp.java b/app/src/main/java/io/xpipe/app/comp/store/StoreCreationComp.java index f9e96ada9..bf9fcfbaa 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreCreationComp.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreCreationComp.java @@ -8,6 +8,7 @@ import io.xpipe.app.comp.base.PopupMenuButtonComp; import io.xpipe.app.core.AppI18n; import io.xpipe.app.core.AppWindowHelper; import io.xpipe.app.ext.DataStoreProvider; +import io.xpipe.app.ext.DataStoreProviders; import io.xpipe.app.fxcomps.Comp; import io.xpipe.app.fxcomps.augment.GrowAugment; import io.xpipe.app.fxcomps.util.PlatformThread; @@ -151,12 +152,16 @@ public class StoreCreationComp extends DialogComp { e); } - public static void showCreation(DataStoreProvider selected, Predicate filter) { + public static void showCreation(DataStoreProvider selected, DataStoreProvider.CreationCategory category) { + showCreation(selected != null ? selected.defaultStore() : null, category); + } + + public static void showCreation(DataStore base, DataStoreProvider.CreationCategory category) { show( null, - selected, - selected != null ? selected.defaultStore() : null, - filter, + base != null ? DataStoreProviders.byStore(base) : null, + base, + dataStoreProvider -> category.equals(dataStoreProvider.getCreationCategory()), e -> { try { DataStorage.get().addStoreEntryIfNotPresent(e); diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreCreationMenu.java b/app/src/main/java/io/xpipe/app/comp/store/StoreCreationMenu.java index e2c7734e5..21d94a1ed 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreCreationMenu.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreCreationMenu.java @@ -39,9 +39,6 @@ public class StoreCreationMenu { menu.getItems().add(category("addTunnel", "mdi2v-vector-polyline-plus", DataStoreProvider.CreationCategory.TUNNEL, null)); - menu.getItems().add(category("addCluster", "mdi2d-domain-plus", - DataStoreProvider.CreationCategory.CLUSTER, null)); - menu.getItems().add(category("addDatabase", "mdi2d-database-plus", DataStoreProvider.CreationCategory.DATABASE, null)); } @@ -53,8 +50,7 @@ public class StoreCreationMenu { item.setGraphic(new FontIcon(graphic)); item.textProperty().bind(AppI18n.observable(name)); item.setOnAction(event -> { - StoreCreationComp.showCreation(defaultProvider != null ? DataStoreProviders.byName(defaultProvider).orElseThrow() : null, - v -> category.equals(v.getCreationCategory())); + StoreCreationComp.showCreation(defaultProvider != null ? DataStoreProviders.byName(defaultProvider).orElseThrow() : null, category); event.consume(); }); return item; @@ -69,7 +65,7 @@ public class StoreCreationMenu { } StoreCreationComp.showCreation(defaultProvider != null ? DataStoreProviders.byName(defaultProvider).orElseThrow() : null, - v -> category.equals(v.getCreationCategory())); + category); event.consume(); }); sub.forEach(dataStoreProvider -> { @@ -77,7 +73,7 @@ public class StoreCreationMenu { item.setGraphic(PrettyImageHelper.ofFixedSmallSquare(dataStoreProvider.getDisplayIconFileName(null)).createRegion()); item.setOnAction(event -> { StoreCreationComp.showCreation(dataStoreProvider, - v -> category.equals(v.getCreationCategory())); + category); event.consume(); }); menu.getItems().add(item); diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreProviderChoiceComp.java b/app/src/main/java/io/xpipe/app/comp/store/StoreProviderChoiceComp.java index c3bee0dff..7831c8526 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreProviderChoiceComp.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreProviderChoiceComp.java @@ -28,7 +28,7 @@ public class StoreProviderChoiceComp extends Comp getProviders() { - return DataStoreProviders.getAll().stream().filter(filter).toList(); + return DataStoreProviders.getAll().stream().filter(val -> filter == null || filter.test(val)).toList(); } private Region createGraphic(DataStoreProvider provider) { diff --git a/app/src/main/java/io/xpipe/app/storage/DataStorage.java b/app/src/main/java/io/xpipe/app/storage/DataStorage.java index 9bc23dc95..b18fc41ce 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStorage.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStorage.java @@ -219,6 +219,7 @@ public abstract class DataStorage { public abstract void save(boolean dispose); public abstract boolean supportsSharing(); + public boolean shouldShare(DataStoreCategory entry) { if (!entry.canShare()) { return false; diff --git a/app/src/main/resources/io/xpipe/app/resources/lang/dscreation_en.properties b/app/src/main/resources/io/xpipe/app/resources/lang/dscreation_en.properties deleted file mode 100644 index fb0c66301..000000000 --- a/app/src/main/resources/io/xpipe/app/resources/lang/dscreation_en.properties +++ /dev/null @@ -1,75 +0,0 @@ -storeForLaterUse=Store for later use -localMachine=Local -localFile=Local File -network=Network -recentFiles=Recent files -newDataSource=New data source -newDataStore=New data store -selectInput=Select Input -configure=Configure -retrieve=Retrieve -internet=Internet -table=Table -update=Update -selectStreamStore=Select Stream Store -openStreamStoreWizard=Open Stream Store Wizard -updateDataSource=Update Data Source -structure=Structure -text=Text -raw=Raw -collection=Collection -anyFile=Any file -anyStream=Any Stream Type -noMatchingStoreFound=No suitable saved store was found -addStore=Add Store -anyStreamDescription=Or choose specific type -restart=Restart XPipe -restartDescription=A restart can often be a quick fix -reportIssue=Report Issue -reportIssueDescription=Open the integrated issue reporter -usefulActions=Useful actions -stored=Saved -troubleshootingOptions=Troubleshooting tools -troubleshoot=Troubleshoot -other=Other -remote=Remote File -addShellStore=Add Shell ... -addShellTitle=Add Shell Connection -savedConnections=Saved Connections -none=None -save=Save -clean=Clean -refresh=Refresh -moveTo=Move to ... -remove=Remove -addDatabase=Database ... -addCluster=Cluster ... -browseInternalStorage=Browse internal storage -addTunnel=Tunnel ... -addScript=Script ... -addHost=Remote Host ... -addShell=Shell Environment ... -addCommand=Custom Command ... -addAutomatically=Search Automatically ... -addOther=Add Other ... -addStreamTitle=Add Stream Store -addConnection=Add Connection -skip=Skip -addConnections=New -selectType=Select Type -selectTypeDescription=Select connection type -selectDatabaseType=Database Type -selectDatabaseTypeDescription=Select Type of the Database -selectShellType=Shell Type -selectShellTypeDescription=Select the Type of the Shell Connection -selectStreamType=Stream Type -selectStreamTypeDescription=Select type of the stream -name=Name -configuration=Configuration -dragAndDropFilesHere=Or just drag and drop a file here -confirmDsCreationAbortTitle=Confirm abort -confirmDsCreationAbortHeader=Do you want to abort the data source creation? -confirmDsCreationAbortContent=Any data source creation progress will be lost. -confirmInvalidStoreTitle=Failed connection -confirmInvalidStoreHeader=Do you want to skip connection validation? -confirmInvalidStoreContent=You can add this connection even if it could not be validated and fix the connection problems later on. \ No newline at end of file diff --git a/app/src/main/resources/io/xpipe/app/resources/lang/intro_en.properties b/app/src/main/resources/io/xpipe/app/resources/lang/intro_en.properties deleted file mode 100644 index e6acb9a6c..000000000 --- a/app/src/main/resources/io/xpipe/app/resources/lang/intro_en.properties +++ /dev/null @@ -1,21 +0,0 @@ -introTitle=Data sources -introDescription=Pipe, manage, and store many different types of data. -introCollection=Data source collections allow you to store and\norganize all your data sources for later use. -introPipe=Pipe data from any origin to any destination\nacross formats while maintaining compatibility. -introDocumentation=In case you prefer a more structured approach to\nfamiliarizing yourself with XPipe, check out the documentation: -introEntry=Once you have done that, you can add a new data source to it.\nThere are different types of data sources to choose from: -introTableDataSource=Tabular data sources, for example a database table, an excel sheet, or a csv file. -dataSourceIntroTitle=Categories of Data Sources -dataSourceIntroDescription=The next step is to add a data sources to this collection (See above). XPipe\ndifferentiates between several categories of data sources for different purposes. -dataSourceIntroTable=Tabular data sources contain data represented by some kind of table.\nExamples are database tables, Excel sheets, or .csv files. -dataSourceIntroStructure=Structure data sources contain some form of object structure.\nExamples are .json files, .xml files, or certain types of NoSQL databases. -dataSourceIntroText=Text data sources contain readable text that can\ncome in a variety of different encodings and simple formats. -dataSourceIntroBinary=Binary data sources contain binary data. They\ncan be used when the data should be handled and preserved byte by byte. -dataSourceIntroCollection=Collection data sources contain multiple sub data sources. \nExamples are zip files or file system directories. -storeIntroTitle=Connection Hub -storeIntroDescription=Here you can manage all your local and remote shell connections in one place. To start off, you can quickly detect available connections automatically and choose which ones to add. -storeStreamDescription=Stream connections produce raw byte data\nthat can be used to construct data sources from. -storeMachineDescription=To start off, here you can quickly detect available\nconnections automatically and choose which ones to add. -detectConnections=Search for connections -storeDatabaseDescription=Database connections allow you to connect to\na database server and interact with its contained data. -storeDocumentation=In case you prefer a more structured approach to\nfamiliarizing yourself with XPipe, check out the documentation: diff --git a/app/src/main/resources/io/xpipe/app/resources/lang/preferences_de.properties b/app/src/main/resources/io/xpipe/app/resources/lang/preferences_de.properties deleted file mode 100644 index 664c695ee..000000000 --- a/app/src/main/resources/io/xpipe/app/resources/lang/preferences_de.properties +++ /dev/null @@ -1,2 +0,0 @@ -appearance=Aussehen -uiOptions=UI Optionen \ No newline at end of file diff --git a/app/src/main/resources/io/xpipe/app/resources/lang/storage_en.properties b/app/src/main/resources/io/xpipe/app/resources/lang/storage_en.properties deleted file mode 100644 index 0ba8675f0..000000000 --- a/app/src/main/resources/io/xpipe/app/resources/lang/storage_en.properties +++ /dev/null @@ -1,35 +0,0 @@ -# Interface -addCollection=Add collection -newCollection=New collection -delete=Delete -rename=Rename -properties=Properties -usedDate=Used $DATE$ -cols=$COLS$ columns -rowsCols=$ROWS$ rows / $COLS$ columns -lines=$LINES$ lines -objects=$OBJECTS$ objects -bytes=$BYTES$ bytes -entries=$ENTRIES$ entries -unknownLength=Unknown length -temporaryCollection=Temporary -entrySettings=Settings -pipe=Pipe -openDir=Open Directory -failedToLoad=Failed to Load -stores=Stores -# Dialogs -confirmCollectionDeletionTitle=Confirm collection deletion -confirmCollectionDeletionHeader=Do you really want to delete the collection $NAME$? -confirmCollectionDeletionContent=This will delete all ($COUNT$) contained data sources as well. -retrieveDataSource=Retrieve Data Source -# Tooltips -addCollectionFolder=Create new collection folder -collectionOptions=Collection options -addStreamDataSource=Add stream data source -addDatabaseDataSource=Add database data source -displayList=Display as list -displayTiles=Display as tiles -sortLastUsed=Sort by last used date -sortAlphabetical=Sort alphabetical by name -temporaryCollectionNote=All data sources inside the temporary collection are only stored while until the next system restart. \ No newline at end of file diff --git a/app/src/main/resources/io/xpipe/app/resources/lang/translations_en.properties b/app/src/main/resources/io/xpipe/app/resources/lang/translations_en.properties index 3f3017a10..a5d6439f1 100644 --- a/app/src/main/resources/io/xpipe/app/resources/lang/translations_en.properties +++ b/app/src/main/resources/io/xpipe/app/resources/lang/translations_en.properties @@ -1,3 +1,111 @@ +# Interface +addCollection=Add collection +newCollection=New collection +delete=Delete +rename=Rename +properties=Properties +usedDate=Used $DATE$ +cols=$COLS$ columns +rowsCols=$ROWS$ rows / $COLS$ columns +lines=$LINES$ lines +objects=$OBJECTS$ objects +bytes=$BYTES$ bytes +entries=$ENTRIES$ entries +unknownLength=Unknown length +temporaryCollection=Temporary +entrySettings=Settings +pipe=Pipe +openDir=Open Directory +failedToLoad=Failed to Load +stores=Stores +# Dialogs +confirmCollectionDeletionTitle=Confirm collection deletion +confirmCollectionDeletionHeader=Do you really want to delete the collection $NAME$? +confirmCollectionDeletionContent=This will delete all ($COUNT$) contained data sources as well. +retrieveDataSource=Retrieve Data Source +# Tooltips +addCollectionFolder=Create new collection folder +collectionOptions=Collection options +addStreamDataSource=Add stream data source +addDatabaseDataSource=Add database data source +displayList=Display as list +displayTiles=Display as tiles +sortLastUsed=Sort by last used date +sortAlphabetical=Sort alphabetical by name +temporaryCollectionNote=All data sources inside the temporary collection are only stored while until the next system restart. +storeForLaterUse=Store for later use +localFile=Local File +network=Network +recentFiles=Recent files +newDataSource=New data source +newDataStore=New data store +selectInput=Select Input +configure=Configure +retrieve=Retrieve +internet=Internet +table=Table +update=Update +selectStreamStore=Select Stream Store +openStreamStoreWizard=Open Stream Store Wizard +updateDataSource=Update Data Source +structure=Structure +text=Text +raw=Raw +collection=Collection +anyFile=Any file +anyStream=Any Stream Type +noMatchingStoreFound=No suitable saved store was found +addStore=Add Store +anyStreamDescription=Or choose specific type +restart=Restart XPipe +restartDescription=A restart can often be a quick fix +reportIssue=Report Issue +reportIssueDescription=Open the integrated issue reporter +usefulActions=Useful actions +stored=Saved +troubleshootingOptions=Troubleshooting tools +troubleshoot=Troubleshoot +remote=Remote File +addShellStore=Add Shell ... +addShellTitle=Add Shell Connection +savedConnections=Saved Connections +save=Save +clean=Clean +refresh=Refresh +moveTo=Move to ... +addDatabase=Database ... +browseInternalStorage=Browse internal storage +addTunnel=Tunnel ... +addScript=Script ... +addHost=Remote Host ... +addShell=Shell Environment ... +addCommand=Custom Command ... +addAutomatically=Search Automatically ... +addOther=Add Other ... +addStreamTitle=Add Stream Store +addConnection=Add Connection +skip=Skip +addConnections=New +selectType=Select Type +selectTypeDescription=Select connection type +selectDatabaseType=Database Type +selectDatabaseTypeDescription=Select Type of the Database +selectShellType=Shell Type +selectShellTypeDescription=Select the Type of the Shell Connection +selectStreamType=Stream Type +selectStreamTypeDescription=Select type of the stream +name=Name +storeIntroTitle=Connection Hub +storeIntroDescription=Here you can manage all your local and remote shell connections in one place. To start off, you can quickly detect available connections automatically and choose which ones to add. +detectConnections=Search for connections +configuration=Configuration +dragAndDropFilesHere=Or just drag and drop a file here +confirmDsCreationAbortTitle=Confirm abort +confirmDsCreationAbortHeader=Do you want to abort the data source creation? +confirmDsCreationAbortContent=Any data source creation progress will be lost. +confirmInvalidStoreTitle=Failed connection +confirmInvalidStoreHeader=Do you want to skip connection validation? +confirmInvalidStoreContent=You can add this connection even if it could not be validated and fix the connection problems later on. charset=Charset newLine=Newline crlf=CRLF (Windows)