Skip to content
This repository has been archived by the owner on Mar 14, 2020. It is now read-only.

Commit

Permalink
When adding files in a monitored folder, galleries will now be added …
Browse files Browse the repository at this point in the history
…into inbox; #150

Visual tweaks;
  • Loading branch information
twiddli committed May 20, 2016
1 parent b0d4758 commit 29e486d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 39 deletions.
6 changes: 4 additions & 2 deletions res/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ QToolTip {
color: white;
}

NotificationOverlay > * {
color:white;
NotificationOverlay > QLabel {
color: white;
background-color: #3E4249;
border-style: none;
}

TagText {
Expand Down
9 changes: 2 additions & 7 deletions version/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ def remove_gallery(g):
else:
log_e('Could not find gallery to remove from watcher')

def create_gallery(path):
g_dia = gallerydialog.GalleryDialog(self, path)
g_dia.SERIES.connect(self.default_manga_view.add_gallery)
g_dia.show()

def update_gallery(g):
index = gallery.CommonView.find_index(self.get_current_view(), g.id)
if index:
Expand All @@ -124,8 +119,8 @@ def update_gallery(g):
self.default_manga_view.replace_gallery(g, False)

def created(path):
c_popup = io_misc.CreatedPopup(path, self)
c_popup.ADD_SIGNAL.connect(create_gallery)
self.gallery_populate([path])

def modified(path, gallery):
mod_popup = io_misc.ModifiedPopup(path, gallery, self)
def deleted(path, gallery):
Expand Down
4 changes: 2 additions & 2 deletions version/gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def img_too_big(start_x):
clip=clipping)

loaded_image = gallery.get_profile(app_constants.ProfileType.Default)
if loaded_image and self._paint_level > 0 and self.view.scroll_speed < 1000:
if loaded_image and self._paint_level > 0 and self.view.scroll_speed < 600:
# if we can't find a cached image
pix_cache = QPixmapCache.find(self.key(loaded_image.cacheKey()))
if isinstance(pix_cache, QPixmap):
Expand Down Expand Up @@ -1199,7 +1199,7 @@ def _calculate_scroll_speed(self):
self._scroll_zero_once = False

# update view if not scrolling
if new_value < 500 and self._old_scroll_value > 500:
if new_value < 400 and self._old_scroll_value > 400:
self.update()


Expand Down
52 changes: 26 additions & 26 deletions version/io_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,32 +402,32 @@ def __init__(self, path, gallery_id, parent=None):
self.main_widget.setLayout(main_layout)
self.show()

class CreatedPopup(misc.BasePopup):
ADD_SIGNAL = pyqtSignal(str)
def __init__(self, path, parent=None):
super().__init__(parent)
def commit():
self.ADD_SIGNAL.emit(path)
self.close()
main_layout = QVBoxLayout()
inner_layout = QHBoxLayout()
name = os.path.split(path)[1]
cover = QLabel()
img = QPixmap(utils.get_gallery_img(path))
if img:
cover.setPixmap(img.scaled(350, 200, Qt.KeepAspectRatio, Qt.SmoothTransformation))
info_lbl = QLabel('New gallery detected!\n\n{}\n\nDo you want to add it?'.format(name))
info_lbl.setWordWrap(True)
info_lbl.setAlignment(Qt.AlignCenter)
inner_layout.addWidget(cover)
inner_layout.addWidget(info_lbl)
main_layout.addLayout(inner_layout)
main_layout.addLayout(self.generic_buttons)
self.main_widget.setLayout(main_layout)
self.yes_button.clicked.connect(commit)
self.no_button.clicked.connect(self.close)
self.adjustSize()
self.show()
#class CreatedPopup(misc.BasePopup):
# ADD_SIGNAL = pyqtSignal(str)
# def __init__(self, path, parent=None):
# super().__init__(parent)
# def commit():
# self.ADD_SIGNAL.emit(path)
# self.close()
# main_layout = QVBoxLayout()
# inner_layout = QHBoxLayout()
# name = os.path.split(path)[1]
# cover = QLabel()
# img = QPixmap(utils.get_gallery_img(path))
# if img:
# cover.setPixmap(img.scaled(350, 200, Qt.KeepAspectRatio, Qt.SmoothTransformation))
# info_lbl = QLabel('New gallery detected!\n\n{}\n\nDo you want to add it?'.format(name))
# info_lbl.setWordWrap(True)
# info_lbl.setAlignment(Qt.AlignCenter)
# inner_layout.addWidget(cover)
# inner_layout.addWidget(info_lbl)
# main_layout.addLayout(inner_layout)
# main_layout.addLayout(self.generic_buttons)
# self.main_widget.setLayout(main_layout)
# self.yes_button.clicked.connect(commit)
# self.no_button.clicked.connect(self.close)
# self.adjustSize()
# self.show()

class MovedPopup(misc.BasePopup):
UPDATE_SIGNAL = pyqtSignal(object)
Expand Down
2 changes: 0 additions & 2 deletions version/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,8 +1565,6 @@ def __init__(self, parent=None):
self._lbl = QLabel()
self._main_layout.addWidget(self._lbl)
self._lbl.setAlignment(Qt.AlignCenter)
self.setAutoFillBackground(True)
self.setBackgroundRole(self.palette().Shadow)
self.setContentsMargins(-10,-10,-10,-10)
self._click = False
self._override_hide = False
Expand Down

0 comments on commit 29e486d

Please sign in to comment.