Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ZUGFeRD/quba-viewer
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/translation/de.json
  • Loading branch information
jstaerk committed Nov 4, 2021
2 parents b070857 + 025a252 commit 8bf6eb9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
4 changes: 4 additions & 0 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ function createWindow() {
}, 2000);
}

ipcMain.on("open-menu", (event, arg) => {
openFile();
});

app.on("ready", async () => {
const t = await i18next.use(Backend).init(i18nextOptions);
createWindow();
Expand Down
34 changes: 28 additions & 6 deletions src/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,23 @@
:click="onClick"
:class="[tabs?.length ? '' : 'display-none']"
:on-close="onClose"
/>
<div class="btns">
><template v-slot:after>
<button
class="btn"
style="
height: 20px;
line-height: 20px;
padding: 0 10px;
margin-left: 0px;
"
@click="handleAdd"
>
+
</button>
</template>
</vue3-tabs-chrome>
<div class="btns">
</div>
<div v-if="currentTab">
<div v-if="currentTab.isPdf">
<div :class="[currentTab?.isShowXML ? 'left-part' : '']">
Expand Down Expand Up @@ -46,7 +59,7 @@
></iframe>
</div>
</div>
<div v-if="!currentTab" class="center">
<div v-if="!currentTab" class="center" id="drag-box">
<img src="../assets/img/logo_whitetext.svg"><br>
{{ t("welcomeNote1", {}, { locale: lang }) }}<br>
Expand Down Expand Up @@ -119,13 +132,18 @@ export default {
});
tab.value = key;
electron.ipcRenderer.send('open-menu');
};
const handleRemove = () => {
tabRef.value.removeTab(tab.value);
};
electron.ipcRenderer.on("pdf-open", (event, args) => {
const currentTabObj = tabs.filter((item) => item.key === tab.value);
if (currentTabObj.length && currentTabObj[0].label === "New Tab") {
tabRef.value.removeTab(tab.value);
}
window.dispatchEvent(new Event("mousedown"));
const path = args[0].replace(/^.*[\\\/]/, "");
const key = "tab" + Date.now();
Expand All @@ -134,7 +152,7 @@ export default {
label: path,
key,
favico: require("../assets/icons/pdf.svg"),
link: args[0],
link: `lib/pdfjs/web/viewer.html?file=${args[0]}`,
isPdf: true,
isShowXML: !!res,
isShowingXMLSection: false,
Expand All @@ -145,6 +163,10 @@ export default {
});
electron.ipcRenderer.on("xml-open", (event, args) => {
const currentTabObj = tabs.filter((item) => item.key === tab.value);
if (currentTabObj.length && currentTabObj[0].label === "New Tab") {
tabRef.value.removeTab(tab.value);
}
window.dispatchEvent(new Event("mousedown"));
const path = args[0].replace(/^.*[\\\/]/, "");
const key = "tab" + Date.now();
Expand Down Expand Up @@ -237,7 +259,7 @@ export default {
document.addEventListener("drop", (event) => {
event.preventDefault();
event.stopPropagation();
//event.stopPropagation();
for (const f of event.dataTransfer.files) {
electron.ipcRenderer.send("open-dragged-file", f.path);
Expand Down
4 changes: 2 additions & 2 deletions src/translation/de.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"showXML": "Eingebettetes XML anzeigen",
"welcomeNote1": "XML- oder PDF-Dateien über das Menü öffnen, ",
"welcomeNote2": "durch Drücken von Strg + O oder Drag&Drop ",
"welcomeNote1": "XML- oder PDF-Dateien über das Menü öffnen,",
"welcomeNote2": "durch Drücken von Strg + O oder Drag&Drop",
"appName":"E-Rechnungsviewer",
"Examples":"Beispiele"
}
4 changes: 2 additions & 2 deletions src/translation/fr.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"showXML": "Afficher le XML incorporé",
"welcomeNote1": "Ouvrez-les depuis le menu invoice XML- or PDF-file ",
"welcomeNote2": "ou en cliquant Ctrl + O glisser & déposer",
"welcomeNote1": "Ouvrir les fichiers XML ou PDF via le menu,",
"welcomeNote2": "en appuyant sur Ctrl + O ou par glisser-déposer",
"appName": "Visionneuse de factures électroniques",
"Examples":"Exemples"
}

0 comments on commit 8bf6eb9

Please sign in to comment.