Skip to content

Commit

Permalink
featuring version v:1.0.2.1 LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
tirtharajsinha committed May 21, 2021
1 parent 73111e5 commit 1e273cd
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 19 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

<img src="static/devsat_x.png" width='100px' height="100px">

# DevSAT_Browser V:1.0.1.4 LTS
# DevSAT_Browser V:1.0.2.1 LTS



DevSAT browser is a webbrowser built with python3 and Pyqt5.<hr>
Expand All @@ -15,6 +16,12 @@ DevSAT browser is a webbrowser built with python3 and Pyqt5.<hr>
<img src="stock/devsatss.JPG">
<hr>

## settings window

<img src="stock/history.JPG">
<hr>


## sign in /sign up page
<img src="stock/login.JPG">

Expand Down
75 changes: 58 additions & 17 deletions devsat.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def savehistory(self, url, title):
# print(url)
# print(title)
date = str(datetime.datetime.now().date())
self.conn.execute("insert into history values('{}','{}','{}')".format(title, url, date))
self.conn.execute("insert into history values(null,'{}','{}','{}')".format(title, url, date))
self.conn.commit()

def print(self):
Expand Down Expand Up @@ -718,7 +718,7 @@ def setupUi(self, Dialog, browser):
self.version = QtWidgets.QLabel(self.about)
self.version.setGeometry(100, 110, 500, 20)
self.version.setObjectName("settings")
self.version.setText("Version V:1.0.1.4 LTS (Official build) (64-bit)")
self.version.setText("Version V:1.0.2.1 LTS (Official build) (64-bit)")
self.version.setObjectName("head")
self.version.setStyleSheet("color:white; letter-spacing:1px; font-size:14px")

Expand Down Expand Up @@ -752,49 +752,70 @@ def setupUi(self, Dialog, browser):
self.hislabel.setText("History")
self.hislabel.setObjectName("head")



# scroll bar
history = self.conn.execute("select * from history;")
result = history.fetchall()
formLayout = QFormLayout()
self.formLayout = QFormLayout()
groupBox = QGroupBox("Your last 7 days history")
result = result[-1::-1]
if len(result) > 1:
result = result[-1::-1]
rowcount = 0
for data in result:
widget = QWidget()
layout_h = QHBoxLayout(widget)
rowcount += 1

his = QPushButton(" " + data[0])
url = data[2]
title = data[1]
if len(title) > 15:
title = title[:15]
his = QPushButton(" " + title)
his.setIcon(QIcon("static/external-link.png"))
his.setStyleSheet("font-size:18px; color:cyan; padding:10px;")
his.setStyleSheet("font-size:18px; color:yellowgreen; padding:10px;")
his.setCursor(QCursor(QtCore.Qt.PointingHandCursor))
his.clicked.connect(lambda x, url=url: self.openhist(url))

url = data[1]
date = QLabel(data[2])
date = QLabel(data[3])
date.setStyleSheet("font-size:18px; color:white; padding-top:10px;")

id = data[0]
delhis = QPushButton(" Clear history ")
delhis.setStyleSheet("font-size:18px; color:yellowgreen; padding:10px;")
delhis.setStyleSheet("font-size:18px; color:red; padding:10px;")
delhis.setIcon(QIcon("static/trash.png"))
delhis.setCursor(QCursor(QtCore.Qt.PointingHandCursor))
delhis.clicked.connect(lambda x, id=id, rowcount=rowcount: self.delhist(id, rowcount))

widget = QWidget()
layout_h = QHBoxLayout(widget)
layout_h.addWidget(his)
layout_h.addWidget(delhis)
self.formLayout.addRow(date, widget)

his.clicked.connect(lambda x, url=url: self.openhist(url))
formLayout.addRow(date, widget)

groupBox.setLayout(formLayout)
groupBox.setLayout(self.formLayout)
scroll = QScrollArea()
scroll.setWidget(groupBox)
scroll.setWidgetResizable(True)
scroll.setFixedHeight(400)
scroll.setFixedHeight(350)
self.frame2 = QtWidgets.QFrame(self.history)
self.frame2.setGeometry(50, 80, 800, 350)
self.frame2.setGeometry(50, 80, 800, 360)
self.frame2.setObjectName("frame2")

layout = QVBoxLayout(self.frame2)

layout.addWidget(scroll)

# adding cleare all butten

self.cls = QPushButton(self.history)
self.cls.setText(" clear all")
self.cls.setIcon(QIcon("static/trash.png"))
self.cls.setGeometry(640, 30, 200, 40)
# self.cls.setStyleSheet("font-size:18px; color:red; padding:10px;")
self.cls.setStyleSheet("QPushButton::hover{background-color:red;color:white;font-size:18px;padding:10px;}")
self.cls.setObjectName("clearall")
self.cls.setCursor(QCursor(QtCore.Qt.PointingHandCursor))
self.cls.clicked.connect(lambda x, rowcount=rowcount: self.clsall(rowcount))

# pushing history to widget
self.tabWidget.addTab(self.history, "history")

Expand All @@ -809,10 +830,30 @@ def setupUi(self, Dialog, browser):
self.tabWidget.setTabIcon(2, QIcon("static/shild.png"))
self.tabWidget.setTabIcon(3, QIcon("static/devsat1.png"))

self.thiswindow = Dialog

def openhist(self, url):

self.browser.add_new_tab(qurl=url)

def delhist(self, id, rowcount):
try:
self.conn.execute("delete from history where id ={}".format(id))
self.conn.commit()
self.formLayout.removeRow(rowcount - 1)
except Exception as e:
pass

def clsall(self, rowcount):
try:
self.conn.execute("delete from history;")
self.conn.commit()
for i in range(rowcount):
self.formLayout.removeRow(i)
print(i)
except:
pass

def settab(self):

if self.db_result[3] == "" and self.radioButton.isChecked():
Expand Down
Binary file modified static/devsat.db
Binary file not shown.
3 changes: 2 additions & 1 deletion static/dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,5 @@ letter-spacing:1px;
}
QPushButton#profile:hover{
border-bottom:2px solid white;
}
}

Binary file added static/external-link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/trash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added stock/history.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1e273cd

Please sign in to comment.