Skip to content

Commit

Permalink
GUI style color scheme (#200)
Browse files Browse the repository at this point in the history
* Fix broken browser table --> disable sorting

* Status: create collections and folders

* colour scheme

* cleanup old ui files

* New style

* ruff

* Setup for welcome tab

* logo

* logo

* ruff

* "Welcome class"

* Welcome after close session

* Update README.md

* Light background for treeview

* Update pyproject.toml

* Create pypi_release.yml

* Update README.md

* new screenshots for docs

* Catch Exception and different widget

* add siwqze to sync table[D

* ruff
  • Loading branch information
chStaiger authored Jun 13, 2024
1 parent 223bdd7 commit 8f6ceb7
Show file tree
Hide file tree
Showing 48 changed files with 861 additions and 1,686 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@7eb3b701d11256e583f5b49899c5e7203deab573
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# iBridges

[![Python package](https://github.com/chStaiger/iBridges-Gui/actions/workflows/linter.yml/badge.svg)](https://github.com/chStaiger/iBridges-Gui/actions/workflows/linter.yml)
[![Quarto Publish](https://github.com/chStaiger/iBridges-Gui/actions/workflows/publish.yml/badge.svg)](https://github.com/chStaiger/iBridges-Gui/actions/workflows/publish.yml)
# iBridges <img src="ibridgesgui/icons/logo.png" width="150" align="right">

<p align="center">
<p align="center">
Expand All @@ -11,6 +8,9 @@
</p>
</p>

[![Python package](https://github.com/chStaiger/iBridges-Gui/actions/workflows/linter.yml/badge.svg)](https://github.com/chStaiger/iBridges-Gui/actions/workflows/linter.yml)
[![Quarto Publish](https://github.com/chStaiger/iBridges-Gui/actions/workflows/publish.yml/badge.svg)](https://github.com/chStaiger/iBridges-Gui/actions/workflows/publish.yml)

## About

The git repository contains a generic *iRODS* graphical user interface. The iRODS functionality is based on [ibridges](https://github.com/UtrechtUniversity/iBridges) and works with any *iRODS* instance.
Expand All @@ -33,8 +33,7 @@ The git repository contains a generic *iRODS* graphical user interface. The iRO
- As python package

```bash
pip install ibridges
pip install git+https://github.com/chStaiger/iBridges-Gui.git@main
pip install ibridgesgui
```
- Locally from code (for developers)

Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ When you start iBridges you will find in the upper drop-down menu `Connect` and

Before we start iBridges for the first time let us check and create a valid configuration file; Click on `Configure -> Add Configuration`.

![](screenshots/add_check_config.png){width=50% fig-align="center"}
![](screenshots/add_check_config.png){width=75% fig-align="center"}

If you already stored an `irods_environment.json` in the directory `~/.irods` (Windows `C:\Users\<username>\.irods`) then you can use the drop-down menu (little downward arrow) to load the configuration.

If you do not have an iRODS configuration yet, click on the button `New Config`.

You should see now something like:

![](screenshots/add_new_config.png){width=50% fig-align="center"}
![](screenshots/add_new_config.png){width=75% fig-align="center"}

Click the `Check` button to find out whether you can make a connection to the iRODS server. If you get error messages, adjust the contents accordingly. If you are unsure, please contact your iRODS service provider.

Expand All @@ -38,7 +38,7 @@ Once the check runs through fine click the `Save` or `Save as` button. This will

To start working with data in iRODS select `Connect -> Connect to iRODS`. This will open the pop-up window

![](screenshots/login.png){width=50% fig-align="center"}
![](screenshots/login.png){width=75% fig-align="center"}

Select the file we edited above from the drop-down menu and provide your password. If you already logged into iRODS with this or another iRODS client your password might still be cached. This is indicated by the `******`. Hit `<Enter>` or press the `Connect` button.

Binary file modified docs/screenshots/add_check_config.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 modified docs/screenshots/add_new_config.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 modified docs/screenshots/browser.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 modified docs/screenshots/delete.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 modified docs/screenshots/login.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 modified docs/screenshots/metadata.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 modified docs/screenshots/permissions.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 modified docs/screenshots/replicas.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 modified docs/screenshots/search.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 modified docs/screenshots/start_ibridges.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 modified docs/screenshots/sync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/userdoc.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ In the case you want to download a large collection from iRODS, create the desti

**Note that the wild card is `%`**!

In the example search we are looking for data in a collection called *my_books* which can be located anywhere in the iRODS tree. This is denoted by `%/` and we specify that we want to retrieve data which carries the metadata key *author* where the value ends with *Carroll*.
In the example search we are looking for data in a collection called *my_books* which can be located anywhere in the iRODS tree. This is denoted by `%` and we specify that we want to retrieve data which carries the metadata key *author* where the value ends with *Carroll*.

*Single click* on items in the list and click the `Download` button to open a dialog to select the destination for the data and start the download

Expand Down
15 changes: 10 additions & 5 deletions ibridgesgui/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys
from pathlib import Path

import PyQt6.QtGui
import PyQt6.QtWidgets
import PyQt6.uic
import setproctitle
Expand All @@ -18,6 +19,7 @@
from ibridgesgui.search import Search
from ibridgesgui.sync import Sync
from ibridgesgui.ui_files.MainMenu import Ui_MainWindow
from ibridgesgui.welcome import Welcome

# Global constants
THIS_APPLICATION = "ibridges-gui"
Expand All @@ -38,18 +40,15 @@ def __init__(self, app_name):
PyQt6.uic.loadUi(UI_FILE_DIR / "MainMenu.ui", self)

self.logger = logging.getLogger(app_name)

self.irods_path = Path("~", ".irods").expanduser()
self.app_name = app_name
self.welcome_tab()
self.ui_tabs_lookup = {
"tabBrowser": self.init_browser_tab,
"tabSync": self.init_sync_tab,
"tabSearch": self.init_search_tab,
#'tabDataBundle': self.setupTabDataBundle,
#'tabCreateTicket': self.setupTabCreateTicket,
#'tabELNData': self.setupTabELNData,
#'tabAmberWorkflow': self.setupTabAmberWorkflow,
"tabInfo": self.init_info_tab,
#'tabExample': self.setupTabExample,
}

self.session = None
Expand All @@ -71,6 +70,7 @@ def disconnect(self):
self.session = None
self.session_dict.clear()
self.tab_widget.clear()
self.welcome_tab()

def connect(self):
"""Create iRODS session."""
Expand Down Expand Up @@ -112,6 +112,11 @@ def setup_tabs(self):
tab_fun()
# self.ui_tabs_lookup[tab_name]()

def welcome_tab(self):
"""Create first tab."""
welcome = Welcome()
self.tab_widget.addTab(welcome, "iBridges")

def init_info_tab(self):
"""Create info."""
irods_info = Info(self.session)
Expand Down
3 changes: 2 additions & 1 deletion ibridgesgui/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ def load_browser_table(self):
len(coll.data_objects) + len(coll.subcollections),
coll_data + obj_data,
)
self.browser_table.resizeColumnsToContents()
except Exception:
self.browser_table.setRowCount(0)
self.logger.exception("Cannot load browser.")
Expand Down Expand Up @@ -523,6 +522,8 @@ def _fill_preview_tab(self, irods_path):
]
else:
content = [f"No Preview for: {irods_path}"]
else:
content = [f"No Preview for: {irods_path}"]
populate_textfield(self.preview_browser, content)

def _get_item_path(self, row):
Expand Down
4 changes: 3 additions & 1 deletion ibridgesgui/gui_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@


UI_FILE_DIR = files(__package__) / "ui_files"

LOGO_DIR = files(__package__) / "icons"

# Widget utils
def populate_table(table_widget, rows: int, data_by_row: list):
"""Populate a table-like pyqt widget with data."""
table_widget.setRowCount(0)
table_widget.setRowCount(rows)

for row, data in enumerate(data_by_row):
for col, item in enumerate(data):
table_widget.setItem(row, col, PyQt6.QtWidgets.QTableWidgetItem(str(item)))
Expand Down
Binary file added ibridgesgui/icons/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions ibridgesgui/popup_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def accept(self):
try:
os.makedirs(new_dir_path)
self.done(1)
except FileExistsError:
self.error_label.setText("ERROR: Folder already exists.")
except Exception as error:
if hasattr(error, "message"):
self.error_label.setText(error.message)
Expand Down
6 changes: 4 additions & 2 deletions ibridgesgui/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,10 @@ def _sync_diff_end(self, thread_output: dict):
return

self.error_label.clear()
table_data = thread_output["result"]["upload"] + thread_output["result"]["download"]

table_data = [(ipath, lpath, ipath.size)
for ipath, lpath in thread_output["result"]["download"]] + \
[(lpath, ipath, lpath.stat().st_size)
for lpath, ipath in thread_output["result"]["upload"]]
populate_table(self.diff_table, len(table_data), table_data)
if len(table_data) == 0:
self.error_label.setText("Data is already synchronised.")
Expand Down
2 changes: 2 additions & 0 deletions ibridgesgui/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def run(self):
transfer_out = {}
transfer_out["error"] = ""

emit_string = "Create collections."
for coll in self.diffs["create_collection"]:
try:
IrodsPath.create_collection(self.thread_session, coll)
Expand All @@ -101,6 +102,7 @@ def run(self):
transfer_out["error"] + f"\nTransfer failed Cannot create {coll}: {repr(error)}"
)

emit_string = "Create folders."
for folder in self.diffs["create_dir"]:
print(f"create {folder}")
try:
Expand Down
30 changes: 17 additions & 13 deletions ibridgesgui/ui_files/MainMenu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Form implementation generated from reading ui file 'ibridgesgui/ui_files/MainMenu.ui'
#
# Created by: PyQt6 UI code generator 6.4.2
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
Expand All @@ -16,22 +16,29 @@ def setupUi(self, MainWindow):
MainWindow.setMinimumSize(QtCore.QSize(1300, 850))
MainWindow.setStyleSheet("QWidget\n"
"{\n"
" color: rgb(86, 184, 139);\n"
" background-color: rgb(54, 54, 54);\n"
" selection-background-color: rgb(58, 152, 112);\n"
" font: 16pt;\n"
" background-color: rgb(211,211,211);\n"
" color: rgb(88, 88, 90);\n"
" selection-background-color: rgb(21, 165, 137);\n"
" selection-color: rgb(245, 244, 244);\n"
" \n"
" font: 16pt\n"
"}\n"
"\n"
"QTabBar::tab:top:selected {\n"
" background-color: rgb(58, 152, 112);\n"
" color: rgb(54, 54, 54);\n"
"QLabel\n"
"{\n"
" background-color: rgb(211,211,211);\n"
"}\n"
"\n"
"QLabel#error_label\n"
"{\n"
" color: rgb(217, 174, 23);\n"
" font: 18pt;\n"
" color: rgb(220, 130, 30);\n"
"}\n"
"\n"
"QTabBar::tab:top:selected {\n"
" background-color: rgb(21, 165, 137);\n"
" color: rgb(88, 88, 90);\n"
"}\n"
"\n"
"")
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setStyleSheet("")
Expand All @@ -44,7 +51,6 @@ def setupUi(self, MainWindow):
font.setPointSize(16)
font.setBold(False)
font.setItalic(False)
font.setWeight(50)
self.tab_widget.setFont(font)
self.tab_widget.setObjectName("tab_widget")
self.verticalLayout.addWidget(self.tab_widget)
Expand All @@ -59,15 +65,13 @@ def setupUi(self, MainWindow):
font.setPointSize(16)
font.setBold(False)
font.setItalic(False)
font.setWeight(50)
self.menubar.setFont(font)
self.menubar.setObjectName("menubar")
self.main_menu = QtWidgets.QMenu(parent=self.menubar)
font = QtGui.QFont()
font.setPointSize(16)
font.setBold(False)
font.setItalic(False)
font.setWeight(50)
self.main_menu.setFont(font)
self.main_menu.setObjectName("main_menu")
self.config_menu = QtWidgets.QMenu(parent=self.menubar)
Expand Down
41 changes: 29 additions & 12 deletions ibridgesgui/ui_files/MainMenu.ui
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,44 @@
<property name="windowTitle">
<string>MainWindow</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>../icons/logo.png</normaloff>../icons/logo.png</iconset>
</property>
<property name="styleSheet">
<string notr="true">QWidget
{
color: rgb(86, 184, 139);
background-color: rgb(54, 54, 54);
selection-background-color: rgb(58, 152, 112);
font: 16pt;
background-color: rgb(211,211,211);
color: rgb(88, 88, 90);
selection-background-color: rgb(21, 165, 137);
selection-color: rgb(245, 244, 244);

font: 16pt
}

QTabBar::tab:top:selected {
background-color: rgb(58, 152, 112);
color: rgb(54, 54, 54);
QLabel
{
background-color: rgb(211,211,211);
}

QLabel#error_label
{
color: rgb(217, 174, 23);
font: 18pt;
color: rgb(220, 130, 30);
}

QTabBar::tab:top:selected {
background-color: rgb(21, 165, 137);
color: rgb(88, 88, 90);
}

</string>
</property>
<property name="iconSize">
<size>
<width>400</width>
<height>400</height>
</size>
</property>
<widget class="QWidget" name="centralwidget">
<property name="styleSheet">
<string notr="true"/>
Expand All @@ -56,14 +73,16 @@ QLabel#error_label
<property name="font">
<font>
<pointsize>16</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
</property>
</widget>
</item>
<item>
Expand All @@ -87,7 +106,6 @@ QLabel#error_label
<property name="font">
<font>
<pointsize>16</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
Expand All @@ -96,7 +114,6 @@ QLabel#error_label
<property name="font">
<font>
<pointsize>16</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
Expand Down
Loading

0 comments on commit 8f6ceb7

Please sign in to comment.