Skip to content

Commit

Permalink
UI fix and readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
Martyx00 committed Sep 27, 2021
1 parent b40ab79 commit cc4ffe9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# CollaRE v1.1
# CollaRE v1.2

![CollaRE](./collare/icons/collare-full-white.png)

Expand All @@ -11,7 +11,7 @@ The [back-end](https://github.com/Martyx00/CollaREServer) of the tool is a simpl

## Installation

Grab the latest release from this repository and run `sudo python3 setup.py install` on Linux or use command line on Windows and run `python3 setup.py install`. On Linux this will install the tool to the `PATH` and you will be able to run it simply with `collare` command. On Windows this will put the file into the `C:\Users\<USERNAME>\AppData\Local\Programs\Python\<PYTHON_VERSION>\Scripts\collare.exe` (depending on how you installed Python).
Grab the latest binary release from this repository or clone the repo and run `sudo python3 setup.py install` on Linux or use command line on Windows and run `python3 setup.py install`. On Linux this will install the tool to the `PATH` and you will be able to run it simply with `collare` command. On Windows this will put the file into the `C:\Users\<USERNAME>\AppData\Local\Programs\Python\<PYTHON_VERSION>\Scripts\collare.exe` (depending on how you installed Python).

For Gnome based desktop UIs you can use following desktop file (paths to files may vary):
```
Expand All @@ -25,8 +25,6 @@ Terminal=false
```

Alternatively use one of the binary distributions in the relases (`collare_linux_x64.zip` or `collare_win_x86.zip`).

## Supported Tools

### Cutter (Rizin)
Expand Down
13 changes: 11 additions & 2 deletions collare/collare.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
requests.urllib3.disable_warnings()

class ProjectTree(QTreeWidget):
def __init__(self, parent):
def __init__(self, parent,window):
super(ProjectTree, self).__init__(parent)
self.setMouseTracking(True)
self.setAcceptDrops(True)
self.window = window

def setProjectData(self,server,projectName,username,password,cert,parent):
self.server = server
Expand Down Expand Up @@ -66,6 +67,7 @@ def mimeTypes(self):
return ["*"]

def uploadFile(self,fsPath,remotePath):
self.window.start_task("Uploading file ... ")
with open(fsPath, "rb") as data_file:
encoded_file = base64.b64encode(data_file.read()).decode("utf-8")
values = {'path': remotePath,"project":self.projectName,"file":encoded_file,"file_name":os.path.basename(fsPath)}
Expand All @@ -78,16 +80,22 @@ def uploadFile(self,fsPath,remotePath):
self.parent.refreshProject()
except:
self.showPopupBox("Connection Error","Connection to the server is not working!",QMessageBox.Critical)
self.window.end_task()
return
self.window.end_task()


def uploadDir(self,fs_path,path):
self.window.start_task("Uploading directory ... ")
if not re.match(r'^\w+$',os.path.basename(fs_path)):
self.showPopupBox("Invalid Folder Name",f"Folder name can contain only letters, numbers and '_' (underscores). Failed with: {os.path.basename(fs_path)}",QMessageBox.Critical)
self.window.end_task()
return
for directory, subdirectories, files in os.walk(fs_path):
for d in subdirectories:
if not re.match(r'^\w+$',d):
self.showPopupBox("Invalid Folder Name",f"Folder name can contain only letters, numbers and '_' (underscores). Failed with: {d}",QMessageBox.Critical)
self.window.end_task()
return
# Creates the initial dir
self.mkdir(path,os.path.basename(fs_path))
Expand All @@ -99,6 +107,7 @@ def uploadDir(self,fs_path,path):
self.mkdir(current_path,d)
for f in files:
self.uploadFile(os.path.join(directory,f),current_path)
self.window.end_task()


def mkdir(self,path,dirname):
Expand Down Expand Up @@ -1450,7 +1459,7 @@ def setupUi(self, Dialog):
self.projectTab.setLayout(projectLayout)

#self.projectTreeView = QtWidgets.QTreeWidget(self.projectTab)
self.projectTreeView = ProjectTree(self.projectTab)
self.projectTreeView = ProjectTree(self.projectTab,self)
self.projectTreeView.setGeometry(QtCore.QRect(10, 10, 961, 671))
self.projectTreeView.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.projectTreeView.customContextMenuRequested.connect(self.rightClickMenuHandle)
Expand Down

0 comments on commit cc4ffe9

Please sign in to comment.