mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Removed code duplication in qt.base.util.
createActions was also in qtlib.util (it had been moved for reuse in moneyGuru). Also, updated qtlib subrepo which wasn't correctly updated in previous commits.
This commit is contained in:
parent
05552c160c
commit
188aa4bf2e
@ -25,12 +25,12 @@ from core.app import JobType
|
||||
from qtlib.about_box import AboutBox
|
||||
from qtlib.recent import Recent
|
||||
from qtlib.reg import Registration
|
||||
from qtlib.util import createActions
|
||||
|
||||
from . import platform
|
||||
from .result_window import ResultWindow
|
||||
from .directories_dialog import DirectoriesDialog
|
||||
from .problem_dialog import ProblemDialog
|
||||
from .util import createActions
|
||||
|
||||
tr = trget('ui')
|
||||
|
||||
|
@ -13,11 +13,10 @@ from PyQt4.QtGui import (QWidget, QFileDialog, QHeaderView, QVBoxLayout, QHBoxLa
|
||||
|
||||
from hscommon.trans import trget
|
||||
from qtlib.recent import Recent
|
||||
from qtlib.util import moveToScreenCenter
|
||||
from qtlib.util import moveToScreenCenter, createActions
|
||||
|
||||
from . import platform
|
||||
from .directories_model import DirectoriesModel, DirectoriesDelegate
|
||||
from .util import createActions
|
||||
|
||||
tr = trget('ui')
|
||||
|
||||
|
@ -14,12 +14,11 @@ from PyQt4.QtGui import (QMainWindow, QMenu, QLabel, QMessageBox, QInputDialog,
|
||||
from hscommon.plat import ISOSX, ISLINUX
|
||||
from hscommon.trans import trget
|
||||
from hscommon.util import nonone
|
||||
from qtlib.util import moveToScreenCenter, horizontalWrap
|
||||
from qtlib.util import moveToScreenCenter, horizontalWrap, createActions
|
||||
from qtlib.search_edit import SearchEdit
|
||||
|
||||
from .results_model import ResultsView
|
||||
from .stats_label import StatsLabel
|
||||
from .util import createActions
|
||||
from .prioritize_dialog import PrioritizeDialog
|
||||
|
||||
tr = trget('ui')
|
||||
|
@ -1,21 +0,0 @@
|
||||
# Created By: Virgil Dupras
|
||||
# Created On: 2011-01-15
|
||||
# Copyright 2011 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
from PyQt4.QtGui import QPixmap, QIcon, QAction
|
||||
|
||||
def createActions(actions, target):
|
||||
# actions = [(name, shortcut, icon, desc, func)]
|
||||
for name, shortcut, icon, desc, func in actions:
|
||||
action = QAction(target)
|
||||
if icon:
|
||||
action.setIcon(QIcon(QPixmap(':/' + icon)))
|
||||
if shortcut:
|
||||
action.setShortcut(shortcut)
|
||||
action.setText(desc)
|
||||
action.triggered.connect(func)
|
||||
setattr(target, name, action)
|
Loading…
x
Reference in New Issue
Block a user