Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit 2152583

Browse files
committed
Anka Version 1.9.7
1 parent ca7e963 commit 2152583

File tree

5 files changed

+47
-29
lines changed

5 files changed

+47
-29
lines changed

README.md

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Anka
44

5-
Anka Browser v1.9.5
5+
Anka Browser v1.9.7
66

77
## What is Anka Browser?
88

@@ -12,33 +12,17 @@ You can download and use Anka Browser in every Python installed device.
1212

1313
---
1414

15-
## Anka v1.9.5:
15+
## Anka v1.9.7:
1616

1717
- ### Better Project Struct
1818

19-
- ### Bookmarks:
20-
Now, bookmars added.
21-
22-
- ### Languages:
23-
Now, Anka Browser is support two language. Türkçe(Turkish) and English. You can change language from settings.
19+
- ### Language Packages Updated
2420

25-
- ### History update:
26-
Your search history is save to /public/browser/history.txt. If you want delete history, you can delete from "Delete History" button from Settings.
27-
28-
- ### PNG buttons:
29-
Now, buttons' icons have ``.png`` extension. Not ``.svg``
30-
31-
- ### Light&Dark Theme:
32-
If you use Linux, and your system theme is light, Anka Browser theme is light or your system theme is dark, Anka Browser theme is dark.
33-
34-
- ### Browser Files Control:
35-
If ``config/config.conf`` file or ``public/browser/history.txt`` file is deleted or not finded, Anka Browser create them with default variables.
36-
37-
- ### Default Tab Color:
38-
Now, default tab color is #2aa1b3 with HEX.
21+
- ### Open Your Files
22+
Now, you can open your files with `Open File` option in menu.
3923

40-
- ### Layout Update:
41-
Now, main layout's margins 0.
24+
- ### View Your PDF's!
25+
Now, you can view your `.pdf`'s with "Open File" button in menu. And you can download them.
4226

4327
---
4428

anka-browser.py

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
with open(en_json, 'x', encoding="utf-8") as jsonn:
6161
json.dump(response.json(), jsonn, ensure_ascii=False, indent=4)
6262

63+
6364
config = configparser.ConfigParser()
6465
config.read(config_path)
6566

@@ -69,7 +70,7 @@
6970
"en-US": "English",
7071
}
7172

72-
with open(f"{config_anka}/public/browser/languages/{language}.json", "r", encoding="UTF-8") as jsonn:
73+
with open(f"public/browser/languages/{language}.json", "r", encoding="UTF-8") as jsonn:
7374
texts = json.load(jsonn)
7475

7576
tab_name = texts["tab-name"]
@@ -109,8 +110,12 @@ def __init__(self):
109110
}}
110111
QTabBar::tab::selected{{
111112
background: {tab_color};
112-
}}
113+
}}
114+
113115
""")
116+
117+
118+
114119
self.setCentralWidget(self.tabs)
115120
self.tabs.setTabsClosable(True)
116121

@@ -119,6 +124,11 @@ def __init__(self):
119124
self.setWindowIcon(QIcon(f"{config_anka}/public/img/logo.ico"))
120125

121126
self.add_new_tab(QUrl(search_engine), tab_name)
127+
128+
current_browser = self.tabs.currentWidget()
129+
current_browser.settings().setAttribute(current_browser.settings().WebAttribute.PluginsEnabled, True)
130+
current_browser.settings().setAttribute(current_browser.settings().WebAttribute.PdfViewerEnabled, True)
131+
122132

123133
self.url_bar = QLineEdit()
124134
self.url_bar.returnPressed.connect(self.load_url)
@@ -220,6 +230,10 @@ def show_settings_menu(self):
220230
settings_action.triggered.connect(self.open_settings)
221231
menu.addAction(settings_action)
222232

233+
file_action = QAction(texts['open_file'], self)
234+
file_action.triggered.connect(self.open_file)
235+
menu.addAction(file_action)
236+
223237
button_position = self.settings_button.mapToGlobal(QPoint(0, self.settings_button.height()))
224238
menu.exec(button_position)
225239

@@ -247,7 +261,20 @@ def show_history(self):
247261
layout.addWidget(close_button)
248262

249263
history_dialog.exec()
250-
264+
265+
def open_file(self):
266+
file_path, _ = QFileDialog.getOpenFileName(
267+
self,
268+
home,
269+
texts['open_file'],
270+
"",
271+
f"{texts['pdf_file']} (*.pdf);; {texts['png_file']};; {texts['html_file']} (*.html);; {texts['webp_file']} (*.webp);; {texts['all_files']} (*)"
272+
)
273+
274+
if file_path:
275+
file_url = QUrl.fromLocalFile(file_path)
276+
current_browser = self.tabs.currentWidget()
277+
current_browser.load(file_url)
251278

252279
def add_new_tab(self, url, label):
253280
new_browser = QWebEngineView()

public/browser/languages/en-US.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"right-click-reload" : "Reload",
1010
"settings": "Settings",
1111
"html_file": "HTML File",
12+
"png_file": "PNG File",
1213
"webp_file": "WEBP File",
13-
"pdf_file": "PDF File",
14-
"docx_file": "DOCX File",
14+
"pdf_file": "PDF File",
1515
"all_files": "All Files",
1616
"settings-title" : "Anka | Settings",
1717
"settings-search-engine" : "Search Engine: ",

public/browser/languages/tr-TR.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"right-click-reload" : "Yeniden Yükle",
1010
"settings": "Ayarlar",
1111
"html_file": "HTML Dosyası",
12+
"png_file" : "PNG Resmi",
1213
"webp_file": "WEBP Dosyası",
1314
"pdf_file": "PDF Dosyası",
14-
"docx_file": "DOCX Dosyası",
1515
"all_files": "Tüm Dosyalar",
1616
"settings-title" : "Anka | Ayarlar",
1717
"settings-search-engine" : "Arama Motoru: ",

requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
PyQt6
22
PyQt6-WebEngine
33
pyinstaller
4+
sys
5+
os
6+
configparser
7+
json
8+
re
9+
requests
10+

0 commit comments

Comments
 (0)