Skip to content

Commit 5792603

Browse files
committed
added TabsManager, workflow tests
1 parent cdbf7c2 commit 5792603

File tree

5 files changed

+29
-17
lines changed

5 files changed

+29
-17
lines changed

.github/workflows/push.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ jobs:
3434
git config user.email "github-actions[bot]@users.noreply.github.com"
3535
3636
# save artifact inside virutal machine
37-
cp -r dist ../$(basename $GITHUB_WORKSPACE)/dist/*
37+
# cp -r dist ../$(basename $GITHUB_WORKSPACE)/dist/*
38+
git stash push -m "lel" dist
3839
3940
4041
# Create or switch to artifacts branch
@@ -43,9 +44,10 @@ jobs:
4344
4445
# Copy build output (adjust folder name if needed)
4546
rm -rf *
46-
cp ../$(basename $GITHUB_WORKSPACE)/dist/* .
47+
git stash pop
48+
# cp ../$(basename $GITHUB_WORKSPACE)/dist/* .
4749
4850
# Commit and push
49-
git add .
51+
git add dist
5052
git commit -m "Artifact from PR #${{ github.event.pull_request.number }}"
5153
git push origin artifacts --force

config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102
"default_data":
103103
{
104104
"fullscreen": true,
105-
"autostart": true,
106-
"autorestart": true,
105+
"autostart": false,
106+
"autorestart": false,
107107
"autoreload": false,
108108
"only_one_webpage": true,
109109
"allow_navigation": true,

extensions/window-events/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ class WindowSetup extends require('../../lib/BaseModule')
4040
globalShortcut.register('ctrl+w', () => {
4141
this.window.close();
4242
});
43-
globalShortcut.register('esc', () => {
44-
this.window.close();
45-
});
43+
// globalShortcut.register('esc', () => {
44+
// this.window.close();
45+
// });
4646
}
4747

4848
if (this.getAppData().fullscreen == true) this.window.setFullScreen(true);

lib/TabsManager.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
class TabsManager
44
{
55
static mainWindow = null;
6+
static mainTab = null;
67
static tabs = {};
78
static activeTab = null;
8-
static activeTabName = '';
9+
static activeTabName = 'main';
910

10-
static setup(mainWindow)
11+
static setup(mainWindow, mainTab)
1112
{
1213
TabsManager.mainWindow = mainWindow;
14+
TabsManager.mainTab = mainTab;
1315
}
1416

15-
static addTab(newTab, tabId)
17+
static newTab(newTab, tabId)
1618
{
1719
TabsManager.tabs[tabId] = newTab;
1820
// return newTab;
@@ -32,9 +34,16 @@ class TabsManager
3234
throw('Trying to set a non existing tab');
3335
}
3436

37+
static unsetTab()
38+
{
39+
TabsManager.mainWindow.contentView.addChildView(TabsManager.mainTab);
40+
TabsManager.activeTab = TabsManager.mainTab;
41+
TabsManager.activeTabName = 'main';
42+
}
43+
3544
static setNewTab(newTab, tabId)
3645
{
37-
TabsManager.addTab(newTab, tabId)
46+
TabsManager.newTab(newTab, tabId)
3847
TabsManager.setTab(tabId);
3948
}
4049
}

main.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ const TabsManager = require('./lib/TabsManager');
1111

1212
const DATA_FILE_PATH = path.joinAppData(DATA_CONF_PATH);
1313
const PAGE_URL = url.format({
14-
pathname: path.join(__dirname, "index.html"),
15-
// pathname: path.join("streaming-community.pro"),
16-
// protocol: 'https'
17-
protocol: 'file'
14+
// pathname: path.join(__dirname, "index.html"),
15+
pathname: path.join("streaming-community.pro"),
16+
protocol: 'https'
17+
// protocol: 'file'
1818
});
1919

2020
console.log("I AMS", os.platform(), ", AN", os.arch());
@@ -54,14 +54,15 @@ async function createMainWindow()
5454
fullscreenable: true,
5555
autoHideMenuBar: true
5656
});
57-
TabsManager.setup(mainWindow);
5857
const mainTab = new WebContentsView({
5958
webPreferences: {
6059
preload: path.join(__dirname, 'extensions/preload.js'), // Secure bridge
6160
contextIsolation: true,
6261
nodeIntegration: false,
6362
sandbox: false
6463
}});
64+
TabsManager.setup(mainWindow, mainTab);
65+
6566

6667
mainTab.setBounds({x: 0, y: 0 , height: mainWindow.getContentBounds().height, width: mainWindow.getContentBounds().width});
6768

0 commit comments

Comments
 (0)