Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,8 @@ dmypy.json
# github pages
Gemfile.lock
_site
.bundle
.bundle

# macOS
.DS_Store
**/.DS_Store
73 changes: 73 additions & 0 deletions GIT_SYNC_FIX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Решение проблемы синхронизации Git

## Проблема
При попытке выполнить `git push origin colorpicker` возникает ошибка:
```
remote: Internal Server Error
! [remote rejected] colorpicker -> colorpicker (Internal Server Error)
```

## Текущий статус
- Локальная ветка опережает удаленную на **2 коммита**
- Все изменения сохранены локально
- Проблема на стороне GitHub сервера

## Решения

### Вариант 1: Повторить попытку позже (рекомендуется)
Это временная проблема GitHub. Попробуйте через 10-15 минут:
```bash
git push origin colorpicker
```

### Вариант 2: Проверить настройки репозитория на GitHub
1. Откройте https://github.com/DSLitvinov/beeref/settings
2. Проверьте раздел "Branches" - возможно ветка `colorpicker` защищена
3. Если ветка защищена, может потребоваться создать Pull Request вместо прямого push

### Вариант 3: Использовать веб-интерфейс GitHub
1. Откройте https://github.com/DSLitvinov/beeref
2. Создайте Pull Request из локальной ветки через веб-интерфейс
3. Или используйте GitHub Desktop приложение

### Вариант 4: Проверить права доступа
Убедитесь, что у вас есть права на запись в репозиторий:
- Проверьте, что вы авторизованы в GitHub
- Проверьте настройки доступа к репозиторию

### Вариант 5: Использовать другой метод аутентификации
Если используете HTTPS, попробуйте настроить SSH ключи:
```bash
# Генерация SSH ключа (если еще нет)
ssh-keygen -t ed25519 -C "your_email@example.com"

# Добавление ключа в ssh-agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

# Копирование публичного ключа для добавления в GitHub
cat ~/.ssh/id_ed25519.pub

# Затем добавьте ключ в GitHub Settings > SSH and GPG keys
# И измените remote URL:
git remote set-url origin git@github.com:DSLitvinov/beeref.git
```

## Текущие локальные коммиты
1. `84c6c5a` - Fix critical code issues: assertions, division by zero, validation
2. `181350a` - Add code review documentation

Все изменения сохранены и будут отправлены при успешном push.

## Проверка статуса
```bash
# Проверить статус
git status

# Посмотреть коммиты, которые нужно отправить
git log origin/colorpicker..HEAD --oneline

# Попробовать push
git push origin colorpicker
```

15 changes: 13 additions & 2 deletions beeref/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ def __init__(self, app):
self.show()

def closeEvent(self, event):
# Check for unsaved changes
confirm = self.view.get_confirmation_unsaved_changes(
'There are unsaved changes. Are you sure you want to quit?')
if not confirm:
# User cancelled closing
event.ignore()
return

# Save window geometry
geom = self.saveGeometry()
self.view.settings.setValue('MainWindow/geometry', geom)
event.accept()
Expand Down Expand Up @@ -109,9 +118,11 @@ def main():
logger.info(f'Logging to: {logfile_name()}')
settings.on_startup()
args = CommandlineArgs(with_check=True) # Force checking
assert not args.debug_raise_error, args.debug_raise_error
if args.debug_raise_error:
raise RuntimeError(args.debug_raise_error)

os.environ["QT_DEBUG_PLUGINS"] = "1"
if args.loglevel == 'DEBUG':
os.environ["QT_DEBUG_PLUGINS"] = "1"
app = BeeRefApplication(sys.argv)
palette = create_palette_from_dict(constants.COLORS)
app.setPalette(palette)
Expand Down
8 changes: 7 additions & 1 deletion beeref/actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ def get_default_shortcut(self, index):
shortcuts=['Ctrl+T'],
callback='on_action_insert_text',
),
Action(
id='insert_draw',
text='&Draw',
shortcuts=['Ctrl+D'],
callback='on_action_insert_draw',
),
Action(
id='undo',
text='&Undo',
Expand Down Expand Up @@ -202,7 +208,7 @@ def get_default_shortcut(self, index):
Action(
id='delete',
text='&Delete',
shortcuts=['Del'],
shortcuts=['Del', 'Backspace'],
callback='on_action_delete_items',
group='active_when_selection',
),
Expand Down
1 change: 1 addition & 0 deletions beeref/actions/menu_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
'items': [
'insert_images',
'insert_text',
'insert_draw',
],
},
{
Expand Down
27 changes: 26 additions & 1 deletion beeref/assets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from importlib.resources import files as rsc_files
import logging

from PyQt6 import QtGui, QtWidgets
from PyQt6 import QtGui, QtWidgets, QtSvg


logger = logging.getLogger(__name__)
Expand All @@ -45,6 +45,8 @@ def on_new(self):
'cursor_flip_h.png', (20, 20))
self.cursor_flip_v = self.cursor_from_image(
'cursor_flip_v.png', (20, 20))
self.cursor_draw_line = self.cursor_from_svg(
'icons/draw-line.svg', (12, 12))

def cursor_from_image(self, filename, hotspot):
app = QtWidgets.QApplication.instance()
Expand All @@ -55,3 +57,26 @@ def cursor_from_image(self, filename, hotspot):
pixmap.setDevicePixelRatio(scaling)
return QtGui.QCursor(
pixmap, int(hotspot[0]/scaling), int(hotspot[1]/scaling))

def cursor_from_svg(self, filename, hotspot, size=24):
"""Creates cursor from SVG file."""
app = QtWidgets.QApplication.instance()
scaling = app.primaryScreen().devicePixelRatio()

# Load SVG
svg_path = str(self.PATH.joinpath(filename))
renderer = QtSvg.QSvgRenderer(svg_path)

# Create pixmap of required size
pixmap_size = int(size * scaling)
pixmap = QtGui.QPixmap(pixmap_size, pixmap_size)
pixmap.fill(QtGui.QColor(0, 0, 0, 0)) # Transparent background

# Render SVG to pixmap
painter = QtGui.QPainter(pixmap)
renderer.render(painter)
painter.end()

pixmap.setDevicePixelRatio(scaling)
return QtGui.QCursor(
pixmap, int(hotspot[0]/scaling), int(hotspot[1]/scaling))
4 changes: 4 additions & 0 deletions beeref/assets/icons/clear.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions beeref/assets/icons/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions beeref/assets/icons/crop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions beeref/assets/icons/drag-and-drop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions beeref/assets/icons/draw-line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions beeref/assets/icons/flip_h.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions beeref/assets/icons/flip_v.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions beeref/assets/icons/fonts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions beeref/assets/icons/format-bold.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions beeref/assets/icons/format-color-text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions beeref/assets/icons/format-italic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions beeref/assets/icons/format-strikethrough.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions beeref/assets/icons/format-underline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions beeref/assets/icons/frames.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions beeref/assets/icons/gamut.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading