1
1
import subprocess
2
2
import os
3
3
from PyQt6 .QtCore import Qt
4
+ from PyQt6 .QtGui import QPixmap
4
5
from PyQt6 .QtWidgets import QListWidget , QVBoxLayout , QWidget , QDockWidget , QPushButton , QListWidgetItem , QCheckBox , \
5
- QMessageBox , QLineEdit
6
+ QMessageBox , QLineEdit , QLabel
6
7
7
8
local_app_data = os .path .join (os .getenv ("LocalAppData" ), "AuraText" )
8
9
cpath = open (f"{ local_app_data } /data/CPath_Project.txt" , "r+" ).read ()
@@ -16,22 +17,31 @@ def __init__(self, parent=None):
16
17
self .main_widget = QWidget ()
17
18
self .layout = QVBoxLayout (self .main_widget )
18
19
20
+ changed_files = self .list_changed_files ()
21
+
19
22
self .visibilityChanged .connect (
20
23
lambda visible : parent .onCommitDockVisibilityChanged (visible )
21
24
)
22
25
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 )
26
30
27
- self .commit_entry = QLineEdit ()
28
- self .commit_entry .setPlaceholderText ("Commit message" )
31
+ self .commit_entry = QLineEdit ()
32
+ self .commit_entry .setPlaceholderText ("Commit message" )
29
33
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 )
32
36
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 )
35
45
36
46
self .setWidget (self .main_widget )
37
47
0 commit comments