Skip to content

Commit dc24e9c

Browse files
committed
fixes
1 parent 6ea00fa commit dc24e9c

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

auratext/Components/GitCommit.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import subprocess
22
import os
33
from PyQt6.QtCore import Qt
4+
from PyQt6.QtGui import QPixmap
45
from PyQt6.QtWidgets import QListWidget, QVBoxLayout, QWidget, QDockWidget, QPushButton, QListWidgetItem, QCheckBox, \
5-
QMessageBox, QLineEdit
6+
QMessageBox, QLineEdit, QLabel
67

78
local_app_data = os.path.join(os.getenv("LocalAppData"), "AuraText")
89
cpath = open(f"{local_app_data}/data/CPath_Project.txt", "r+").read()
@@ -16,22 +17,31 @@ def __init__(self, parent=None):
1617
self.main_widget = QWidget()
1718
self.layout = QVBoxLayout(self.main_widget)
1819

20+
changed_files = self.list_changed_files()
21+
1922
self.visibilityChanged.connect(
2023
lambda visible: parent.onCommitDockVisibilityChanged(visible)
2124
)
2225

23-
self.file_list_widget = QListWidget()
24-
self.populate_file_list()
25-
self.layout.addWidget(self.file_list_widget)
26+
if changed_files != []:
27+
self.file_list_widget = QListWidget()
28+
self.populate_file_list()
29+
self.layout.addWidget(self.file_list_widget)
2630

27-
self.commit_entry = QLineEdit()
28-
self.commit_entry.setPlaceholderText("Commit message")
31+
self.commit_entry = QLineEdit()
32+
self.commit_entry.setPlaceholderText("Commit message")
2933

30-
self.commit_button = QPushButton('Commit')
31-
self.commit_button.clicked.connect(self.commit_changes)
34+
self.commit_button = QPushButton('Commit')
35+
self.commit_button.clicked.connect(self.commit_changes)
3236

33-
self.layout.addWidget(self.commit_entry)
34-
self.layout.addWidget(self.commit_button)
37+
self.layout.addWidget(self.commit_entry)
38+
self.layout.addWidget(self.commit_button)
39+
else:
40+
self.pic_label = QLabel()
41+
photo = QPixmap(f"{local_app_data}/icons/no_commits.png")
42+
self.pic_label.setPixmap(photo)
43+
self.pic_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
44+
self.layout.addWidget(self.pic_label)
3545

3646
self.setWidget(self.main_widget)
3747

0 commit comments

Comments
 (0)