Compare commits

..

4 Commits

Author SHA1 Message Date
Mucahit Bilal GOKER e1308bfa21 legacy connector cosmetic changes (#430)
* replace logo

* change copy
2025-05-22 20:24:00 +03:00
Oğuzhan Koral ed1d1f5b44 Add legacy dialog to v2 (#420) 2025-03-19 11:24:47 +03:00
Oğuzhan Koral aff871baaa Chore(v2): v2 is legacy (#419)
* v2 is legacy

* correct the log
2025-03-19 10:26:54 +03:00
Oğuzhan Koral 0608e7048d fallback to application support for accounts db (#410) 2025-03-11 19:37:57 +03:00
8 changed files with 68 additions and 23 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ module SpeckleConnector
# Run from localhost or from build files
DEV_MODE = false
puts("Loading Speckle Connector v#{CONNECTOR_VERSION} from #{DEV_MODE ? 'dev' : 'build'}")
puts("Loading Speckle (Legacy) Connector v#{CONNECTOR_VERSION} from #{DEV_MODE ? 'dev' : 'build'}")
unless file_loaded?(__FILE__)
ex = SketchupExtension.new('Speckle SketchUp', File.join(PATH, 'bootstrap'))
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 26 KiB

@@ -12,7 +12,7 @@ module SpeckleConnector
# This is the command where we show UI to user.
class InitializeSpeckle < Command
def dialog_title
"Speckle #{CONNECTOR_VERSION}"
"Speckle (Legacy) #{CONNECTOR_VERSION}"
end
private
@@ -30,18 +30,14 @@ module SpeckleConnector
commands[CMD_RESET_WINDOW_LOCATION_SPECKLE] = reset_window_location_command(app)
commands.add_to_menu!(CMD_RESET_WINDOW_LOCATION_SPECKLE, speckle_menu)
# commands[CMD_SEND_TO_SPECKLE] = send_command(app)
# commands.add_to_menu!(CMD_SEND_TO_SPECKLE, speckle_menu)
# commands.add_to_toolbar!(CMD_SEND_TO_SPECKLE, speckle_toolbar)
end
def self.initialize_speckle_command(app)
cmd = MenuCommandHandler.sketchup_command(
InitializeSpeckle.new(app), 'Initialize Speckle'
InitializeSpeckle.new(app), 'Initialize Speckle (Legacy)'
)
cmd.tooltip = 'Launch Connector'
cmd.status_bar_text = 'Opens the Speckle Connector window'
cmd.status_bar_text = 'Opens the Speckle (Legacy) Connector window'
cmd.small_icon = '../../img/s2logo.png'
cmd.large_icon = '../../img/s2logo.png'
cmd
@@ -57,18 +53,6 @@ module SpeckleConnector
cmd.large_icon = '../../img/s2logo.png'
cmd
end
def self.send_command(app)
cmd = MenuCommandHandler.sketchup_command(
ActionCommand.new(app, Actions::OneClickSend), 'Send to Speckle'
)
cmd.tooltip = 'Send to Speckle'
cmd.status_bar_text = 'Send to Speckle'
cmd.small_icon = '../../img/Sender.png'
cmd.large_icon = '../../img/Sender.png'
cmd.set_validation_proc { MenuCommandHandler.speckle_started(app) }
cmd
end
end
end
end
@@ -14,7 +14,9 @@ module SpeckleConnector
path = ENV.fetch('APPDATA')
Pathname.new(File.join(path, 'Speckle')).cleanpath.to_s
when OS_MAC
File.join(Dir.home, '.config/Speckle')
primary_path = File.join(Dir.home, '.config/Speckle')
fallback_path = File.join(Dir.home, 'Library/Application Support/Speckle')
Dir.exist?(primary_path) ? primary_path : fallback_path
else
raise 'Speckle could not determine your Appdata path'
end
+1 -1
View File
@@ -5,7 +5,7 @@ module SpeckleConnector
# An interface to Sketchup user interface. This object controls the menu `Extensions->Speckle` in Sketchup's menu,
# the Speckle toolbar and sending message to the user via Sketchup.
class SketchupUi
MENU_TITLE = 'Speckle'
MENU_TITLE = 'Speckle (Legacy)'
BEFORE_NEVER_SHOWN = -1
# @return [Sketchup::Menu] the menu of the Speckle
+4 -1
View File
@@ -1,6 +1,7 @@
<template>
<v-app>
<v-main>
<legacy-dialog/>
<v-app-bar app flat height="50">
<v-img
class="mx-auto px-0"
@@ -135,6 +136,7 @@ import userQuery from './graphql/user.gql'
import serverInfoQuery from './graphql/serverInfo.gql'
import { onLogin } from './vue-apollo'
import Login from "@/views/Login";
import LegacyDialog from './components/dialogs/LegacyDialog.vue';
global.collectPreferences = function (preferences) {
bus.$emit('update-preferences', preferences)
@@ -178,7 +180,8 @@ export default {
CreateStreamDialog: () => import('@/components/dialogs/CreateStreamDialog'),
SettingsDialog: () => import('@/components/dialogs/SettingsDialog'),
GlobalToast: () => import('@/components/GlobalToast'),
Mapper: () => import('@/components/Mapper')
Mapper: () => import('@/components/Mapper'),
LegacyDialog: () => import('@/components/dialogs/LegacyDialog')
},
props: {
size: {
@@ -0,0 +1,56 @@
<template>
<v-dialog v-model="dialog" max-width="400">
<v-card>
<v-card-title class="headline">Legacy Version</v-card-title>
<v-card-text>
Warning: This is a legacy connector.
<br /><br />
<a
href="https://app.speckle.systems/connectors"
target="_blank"
style="color: #1976D2; text-decoration: none; font-weight: 500;"
>
Download next-gen SketchUp connector
</a>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="grey" text @click="dialog = false">Dismiss</v-btn>
<v-btn color="primary" @click="downloadLatest">Download</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
export default {
data() {
return {
dialog: true
}
},
methods: {
async downloadLatest() {
const response = await fetch(
`https://releases.speckle.dev/manager2/feeds/sketchup-v3.json`,
{
method: 'GET'
}
)
if (!response.ok) {
throw new Error('Failed to fetch versions')
}
const data = await response.json()
const sortedVersions = data.Versions.sort(function (a, b) {
return new Date(b.Date).getTime() - new Date(a.Date).getTime()
})
const latestAvailableVersion = sortedVersions[0]
latestAvailableVersion.value = sortedVersions[0]
window.open(latestAvailableVersion.value?.Url)
}
}
}
</script>