Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completely rewrite all core logic using compacting log storage #338

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI/CD

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '17'
cache: 'npm'
- name: Check style
run: npx prettier --check .
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.zip
.idea
node_modules/
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
44 changes: 28 additions & 16 deletions confirmDialog.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,55 @@
const St = imports.gi.St;
const GObject = imports.gi.GObject;
'use strict';

const { St, GObject, Clutter } = imports.gi;
const ModalDialog = imports.ui.modalDialog;
const CheckBox = imports.ui.checkBox;
const Clutter = imports.gi.Clutter;

let _openDialog;

function openConfirmDialog(title, message, sub_message, ok_label, cancel_label, callback) {
if (!_openDialog)
_openDialog = new ConfirmDialog(title, message + "\n" + sub_message, ok_label, cancel_label, callback).open();
function openConfirmDialog(
title,
message,
sub_message,
ok_label,
cancel_label,
callback,
) {
if (!_openDialog) {
_openDialog = new ConfirmDialog(
title,
message + '\n' + sub_message,
ok_label,
cancel_label,
callback,
).open();
}
}

const ConfirmDialog = GObject.registerClass(
class ConfirmDialog extends ModalDialog.ModalDialog {

_init(title, desc, ok_label, cancel_label, callback) {
super._init();

let main_box = new St.BoxLayout({
vertical: false
vertical: false,
});
this.contentLayout.add_child(main_box);

let message_box = new St.BoxLayout({
vertical: true
vertical: true,
});
main_box.add_child(message_box);

let subject_label = new St.Label({
style: 'font-weight: bold',
x_align: Clutter.ActorAlign.CENTER,
text: title
text: title,
});
message_box.add_child(subject_label);

let desc_label = new St.Label({
style: 'padding-top: 12px',
x_align: Clutter.ActorAlign.CENTER,
text: desc
text: desc,
});
message_box.add_child(desc_label);

Expand All @@ -48,17 +60,17 @@ const ConfirmDialog = GObject.registerClass(
this.close();
_openDialog = null;
},
key: Clutter.Escape
key: Clutter.Escape,
},
{
label: ok_label,
action: () => {
this.close();
callback();
_openDialog = null;
}
}
},
},
]);
}
}
},
);
Loading