1818 clickable
1919 v-close-popup
2020 @click =" startAutoSwitchingTab(props.tabset.id)" >
21- <q-item-section >switching tab</q-item-section >
21+ <q-item-section >switching tab... </q-item-section >
2222 </q-item >
2323 <q-item dense clickable v-close-popup @click =" restoreInNewWindow(props.tabset.id)" >
2424 <q-item-section >new window</q-item-section >
2525 </q-item >
2626 <q-item dense clickable v-close-popup @click =" restoreInGroup(props.tabset.id)" >
27- <q-item-section >this window</q-item-section >
27+ <q-item-section >this window... </q-item-section >
2828 </q-item >
2929 </q-list >
3030 </q-menu >
4141 </template >
4242</template >
4343<script setup lang="ts">
44- import { LocalStorage } from ' quasar'
44+ import { LocalStorage , useQuasar } from ' quasar'
45+ import BrowserApi from ' src/app/BrowserApi'
4546import { FeatureIdent } from ' src/app/models/FeatureIdent'
4647import ContextMenuItem from ' src/core/components/helper/ContextMenuItem.vue'
4748import { useCommandExecutor } from ' src/core/services/CommandExecutor'
@@ -56,6 +57,8 @@ const props = defineProps<ActionProps>()
5657
5758const { inBexMode } = useUtils ()
5859
60+ const $q = useQuasar ()
61+
5962const startAutoSwitchingTab = (tabsetId : string ) => {
6063 const tabset = useTabsetsStore ().getTabset (tabsetId )
6164 if (tabset && tabset .tabs ?.length > 1 && tabset .tabs [0 ]! .url ) {
@@ -87,6 +90,25 @@ const startAutoSwitchingTab = (tabsetId: string) => {
8790const restoreInNewWindow = (tabsetId : string , windowName : string | undefined = undefined ) =>
8891 useCommandExecutor ().execute (new RestoreTabsetCommand (tabsetId , windowName ))
8992
90- const restoreInGroup = (tabsetId : string , windowName : string | undefined = undefined ) =>
91- useCommandExecutor ().execute (new RestoreTabsetCommand (tabsetId , windowName , false ))
93+ const restoreInGroup = (tabsetId : string , windowName : string | undefined = undefined ) => {
94+ $q .dialog ({
95+ title: ' Open tabset in this window' ,
96+ message: ' Should the current tabs be closed? (Pinned tabs will be kept)' ,
97+ options: {
98+ type: ' checkbox' ,
99+ model: [],
100+ items: [{ label: ' close current tabs' , value: ' true' , color: ' secondary' }],
101+ },
102+ cancel: true ,
103+ }).onOk ((data : any ) => {
104+ if (data ! [0 ] === ' true' ) {
105+ console .log (' data' , data )
106+ BrowserApi .closeAllTabs (false ).then (() => {
107+ useCommandExecutor ().execute (new RestoreTabsetCommand (tabsetId , windowName , false ))
108+ })
109+ } else {
110+ useCommandExecutor ().execute (new RestoreTabsetCommand (tabsetId , windowName , false ))
111+ }
112+ })
113+ }
92114 </script >
0 commit comments