Changeset 9c0e71b66a30…
Parent dcfd73d6a5a1…
by
Changes to 43 files · Browse files at 9c0e71b66a30 Showing diff from parent dcfd73d6a5a1 Diff from another changeset...
renamed from tortoisehg/hgqt/hgviewlib/qt4/__init__.py
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/blockmatcher.py
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/filediffviewer.ui
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/fileviewer.ui
|
||
---|---|---|
Change 1 of 1
Show Entire File
tortoisehg/hgqt/hgviewlib/helpviewer.py
Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/helpviewer.py
|
||
---|---|---|
@@ -14,8 +14,8 @@
from PyQt4 import QtCore, QtGui, Qsci
-from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon
-from tortoisehg.hgqt.hgviewlib.qt4.hgdialogmixin import HgDialogMixin
+from tortoisehg.hgqt.hgviewlib import icon as geticon
+from tortoisehg.hgqt.hgviewlib.hgdialogmixin import HgDialogMixin
from tortoisehg.hgqt.hgviewlib.hgviewhelp import help_msg, get_options_helpmsg
Qt = QtCore.Qt
|
renamed from tortoisehg/hgqt/hgviewlib/qt4/helpviewer.ui
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/helpviewer_ui.py
|
||
---|---|---|
Change 1 of 2
Show Changes Only
tortoisehg/hgqt/hgviewlib/hgdialogmixin.py
Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgdialogmixin.py
|
||
---|---|---|
|
|
# -*- coding: utf-8 -*-
# Copyright (c) 2003-2010 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# make sur the Qt rc files are converted into python modules, then load them
# this must be done BEFORE other hgview qt4 modules are loaded.
import os
import os.path as osp
import sys
from PyQt4 import QtCore
from PyQt4 import QtGui, uic
connect = QtCore.QObject.connect
SIGNAL = QtCore.SIGNAL
Qt = QtCore.Qt
from tortoisehg.hgqt.hgviewlib.config import HgConfig
-from tortoisehg.hgqt.hgviewlib.qt4 import should_rebuild
+from tortoisehg.hgqt.hgviewlib import should_rebuild
class HgDialogMixin(object):
"""
Mixin for QDialogs defined from a .ui file, wich automates the
setup of the UI from the ui file, and the loading of user
preferences.
The main class must define a '_ui_file' class attribute.
"""
def __init__(self):
# self.repo must be defined in actual class before calling __init__
assert self.repo is not None
self.load_config()
_path = osp.dirname(__file__)
uifile = osp.join(_path, self._uifile)
pyfile = uifile.replace(".ui", "_ui.py")
if should_rebuild(uifile, pyfile):
os.system('pyuic4 %s -o %s' % (uifile, pyfile))
try:
modname = osp.splitext(osp.basename(uifile))[0] + "_ui"
- modname = "hgviewlib.qt4.%s" % modname
+ modname = "hgviewlib.%s" % modname
mod = __import__(modname, fromlist=['*'])
classnames = [x for x in dir(mod) if x.startswith('Ui_')]
if len(classnames) == 1:
ui_class = getattr(mod, classnames[0])
elif 'Ui_MainWindow' in classnames:
ui_class = getattr(mod, 'Ui_MainWindow')
else:
raise ValueError("Can't determine which main class to use in %s" % modname)
except ImportError:
ui_class, base_class = uic.loadUiType(uifile)
if ui_class not in self.__class__.__bases__:
# hacking by adding the form class from ui file or pyuic4
# generated module because we cannot use metaclass here,
# due to "QObject" not being a subclass of "object"
self.__class__.__bases__ = self.__class__.__bases__ + (ui_class,)
self.setupUi(self)
self.load_ui()
self.disab_shortcuts = []
def load_ui(self):
# we explicitely create a QShortcut so we can disable it
# when a "helper context toolbar" is activated (which can be
# closed hitting the Esc shortcut)
self.esc_shortcut = QtGui.QShortcut(self)
self.esc_shortcut.setKey(Qt.Key_Escape)
connect(self.esc_shortcut, SIGNAL('activated()'),
self.maybeClose)
self._quickbars = []
def attachQuickBar(self, qbar):
qbar.setParent(self)
self._quickbars.append(qbar)
connect(qbar, SIGNAL('escShortcutDisabled(bool)'),
self.setShortcutsEnabled)
self.addToolBar(Qt.BottomToolBarArea, qbar)
connect(qbar, SIGNAL('visible'),
self.ensureOneQuickBar)
def setShortcutsEnabled(self, enabled=True):
for sh in self.disab_shortcuts:
sh.setEnabled(enabled)
def ensureOneQuickBar(self):
tb = self.sender()
for w in self._quickbars:
if w is not tb:
w.hide()
def maybeClose(self):
for w in self._quickbars:
if w.isVisible():
w.cancel()
break
else:
self.close()
def load_config(self):
cfg = HgConfig(self.repo.ui)
fontstr = cfg.getFont()
font = QtGui.QFont()
try:
if not font.fromString(fontstr):
raise Exception
except:
print "bad font name '%s'" % fontstr
font.setFamily("Monospace")
font.setFixedPitch(True)
font.setPointSize(10)
self._font = font
self.rowheight = cfg.getRowHeight()
self.users, self.aliases = cfg.getUsers()
return cfg
def accept(self):
self.close()
def reject(self):
self.close()
|
Change 1 of 2
Show Entire File
tortoisehg/hgqt/hgviewlib/hgfiledialog.py
Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgfiledialog.py
|
||
---|---|---|
@@ -30,12 +30,12 @@
from tortoisehg.util.util import tounicode, rootpath
-from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon
-from tortoisehg.hgqt.hgviewlib.qt4.hgdialogmixin import HgDialogMixin
-from tortoisehg.hgqt.hgviewlib.qt4.hgrepomodel import FileRevModel
-from tortoisehg.hgqt.hgviewlib.qt4.blockmatcher import BlockList, BlockMatch
-from tortoisehg.hgqt.hgviewlib.qt4.lexers import get_lexer
-from tortoisehg.hgqt.hgviewlib.qt4.quickbar import FindInGraphlogQuickBar
+from tortoisehg.hgqt.hgviewlib import icon as geticon
+from tortoisehg.hgqt.hgviewlib.hgdialogmixin import HgDialogMixin
+from tortoisehg.hgqt.hgviewlib.hgrepomodel import FileRevModel
+from tortoisehg.hgqt.hgviewlib.blockmatcher import BlockList, BlockMatch
+from tortoisehg.hgqt.hgviewlib.lexers import get_lexer
+from tortoisehg.hgqt.hgviewlib.quickbar import FindInGraphlogQuickBar
connect = QtCore.QObject.connect
disconnect = QtCore.QObject.disconnect
@@ -104,7 +104,7 @@ """
if self.repoviewer is None:
# prevent recursive import
- from hgviewlib.qt4.hgrepoviewer import HgRepoViewer
+ from hgviewlib.hgrepoviewer import HgRepoViewer
self.repoviewer = HgRepoViewer(self.repo)
self.repoviewer.goto(rev)
self.repoviewer.show()
|
Change 1 of 1
Show Entire File
tortoisehg/hgqt/hgviewlib/hgfileview.py
Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgfileview.py
|
||
---|---|---|
@@ -37,12 +37,12 @@ from tortoisehg.hgqt.hgviewlib.decorators import timeit
from tortoisehg.hgqt.hgviewlib.config import HgConfig
-from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon
-from tortoisehg.hgqt.hgviewlib.qt4.hgfiledialog import FileViewer, FileDiffViewer
-from tortoisehg.hgqt.hgviewlib.qt4.hgmanifestdialog import ManifestViewer
-from tortoisehg.hgqt.hgviewlib.qt4.quickbar import QuickBar
-from tortoisehg.hgqt.hgviewlib.qt4.lexers import get_lexer
-from tortoisehg.hgqt.hgviewlib.qt4.blockmatcher import BlockList
+from tortoisehg.hgqt.hgviewlib import icon as geticon
+from tortoisehg.hgqt.hgviewlib.hgfiledialog import FileViewer, FileDiffViewer
+from tortoisehg.hgqt.hgviewlib.hgmanifestdialog import ManifestViewer
+from tortoisehg.hgqt.hgviewlib.quickbar import QuickBar
+from tortoisehg.hgqt.hgviewlib.lexers import get_lexer
+from tortoisehg.hgqt.hgviewlib.blockmatcher import BlockList
qsci = Qsci.QsciScintilla
|
Change 1 of 1
Show Entire File
tortoisehg/hgqt/hgviewlib/hgmanifestdialog.py
Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgmanifestdialog.py
|
||
---|---|---|
@@ -29,10 +29,10 @@
from tortoisehg.util.util import tounicode
-from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon
-from tortoisehg.hgqt.hgviewlib.qt4.hgdialogmixin import HgDialogMixin
-from tortoisehg.hgqt.hgviewlib.qt4.hgrepomodel import ManifestModel
-from tortoisehg.hgqt.hgviewlib.qt4.lexers import get_lexer
+from tortoisehg.hgqt.hgviewlib import icon as geticon
+from tortoisehg.hgqt.hgviewlib.hgdialogmixin import HgDialogMixin
+from tortoisehg.hgqt.hgviewlib.hgrepomodel import ManifestModel
+from tortoisehg.hgqt.hgviewlib.lexers import get_lexer
connect = QtCore.QObject.connect
disconnect = QtCore.QObject.disconnect
|
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgqv.qrc
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgqv.ui
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgqv_rc.py
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgqv_ui.py
|
||
---|---|---|
Change 1 of 1
Show Entire File
tortoisehg/hgqt/hgviewlib/hgrepomodel.py
Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgrepomodel.py
|
||
---|---|---|
@@ -31,7 +31,7 @@ from tortoisehg.hgqt.hgviewlib.hggraph import Graph, ismerge, diff as revdiff
from tortoisehg.hgqt.hgviewlib.hggraph import revision_grapher, filelog_grapher
from tortoisehg.hgqt.hgviewlib.config import HgConfig
-from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon
+from tortoisehg.hgqt.hgviewlib import icon as geticon
from tortoisehg.hgqt.hgviewlib.decorators import timeit
from PyQt4 import QtCore, QtGui
|
Change 1 of 1
Show Entire File
tortoisehg/hgqt/hgviewlib/hgrepoview.py
Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgrepoview.py
|
||
---|---|---|
@@ -34,9 +34,9 @@
from tortoisehg.hgqt.hgviewlib.decorators import timeit
from tortoisehg.hgqt.hgviewlib.config import HgConfig
-from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon
-from tortoisehg.hgqt.hgviewlib.qt4.hgmanifestdialog import ManifestViewer
-from tortoisehg.hgqt.hgviewlib.qt4.quickbar import QuickBar
+from tortoisehg.hgqt.hgviewlib import icon as geticon
+from tortoisehg.hgqt.hgviewlib.hgmanifestdialog import ManifestViewer
+from tortoisehg.hgqt.hgviewlib.quickbar import QuickBar
class GotoQuickBar(QuickBar):
def __init__(self, parent):
|
Change 1 of 2
Show Entire File
tortoisehg/hgqt/hgviewlib/hgrepoviewer.py
Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/hgrepoviewer.py
|
||
---|---|---|
@@ -23,13 +23,13 @@ from tortoisehg.hgqt.hgviewlib.hggraph import diff as revdiff
from tortoisehg.hgqt.hgviewlib.decorators import timeit
-from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon
-from tortoisehg.hgqt.hgviewlib.qt4.hgrepomodel import HgRepoListModel, HgFileListModel
-from tortoisehg.hgqt.hgviewlib.qt4.hgfiledialog import FileViewer, FileDiffViewer
-from tortoisehg.hgqt.hgviewlib.qt4.hgmanifestdialog import ManifestViewer
-from tortoisehg.hgqt.hgviewlib.qt4.hgdialogmixin import HgDialogMixin
-from tortoisehg.hgqt.hgviewlib.qt4.quickbar import FindInGraphlogQuickBar
-from tortoisehg.hgqt.hgviewlib.qt4.helpviewer import HelpViewer
+from tortoisehg.hgqt.hgviewlib import icon as geticon
+from tortoisehg.hgqt.hgviewlib.hgrepomodel import HgRepoListModel, HgFileListModel
+from tortoisehg.hgqt.hgviewlib.hgfiledialog import FileViewer, FileDiffViewer
+from tortoisehg.hgqt.hgviewlib.hgmanifestdialog import ManifestViewer
+from tortoisehg.hgqt.hgviewlib.hgdialogmixin import HgDialogMixin
+from tortoisehg.hgqt.hgviewlib.quickbar import FindInGraphlogQuickBar
+from tortoisehg.hgqt.hgviewlib.helpviewer import HelpViewer
from tortoisehg.util import paths
@@ -522,7 +522,7 @@ w.activateWindow()
def run(ui, *pats, **opts):
- from tortoisehg.hgqt.hgviewlib.qt4 import setup_font_substitutions
+ from tortoisehg.hgqt.hgviewlib import setup_font_substitutions
setup_font_substitutions()
repo = None
|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/README
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/back.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/clean.svg
|
||
---|---|---|
tortoisehg/hgqt/hgviewlib/icons/close.png
Side by side
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/close.png
|
|||
---|---|---|---|
|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/down.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/find.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/forward.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/goto.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/help.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/left.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/leftright.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/modified.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/mqdiff.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/mqdiff_x.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/mqpatch.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/mqpatch_x.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/quit.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/reload.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/right.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/icons/up.svg
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/lexers.py
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/manifestviewer.ui
|
||
---|---|---|
renamed from tortoisehg/hgqt/hgviewlib/qt4/manifestviewer_ui.py
|
||
---|---|---|
Change 1 of 2
Show Entire File
tortoisehg/hgqt/hgviewlib/quickbar.py
Stacked
renamed from tortoisehg/hgqt/hgviewlib/qt4/quickbar.py
|
||
---|---|---|
@@ -23,7 +23,7 @@
from tortoisehg.util.util import Curry
-from tortoisehg.hgqt.hgviewlib.qt4 import icon as geticon
+from tortoisehg.hgqt.hgviewlib import icon as geticon
Qt = QtCore.Qt
connect = QtCore.QObject.connect
@@ -318,7 +318,7 @@
if __name__ == "__main__":
import sys
- import hgviewlib.qt4 # to force importation of resource module w/ icons
+ import hgviewlib # to force importation of resource module w/ icons
app = QtGui.QApplication(sys.argv)
root = QtGui.QMainWindow()
w = QtGui.QFrame()
|
@@ -361,7 +361,7 @@
def log(ui, *pats, **opts):
"""Repository Explorer (changelog viewer)"""
- from tortoisehg.hgqt.hgviewlib.qt4.hgrepoviewer import run
+ from tortoisehg.hgqt.hgviewlib.hgrepoviewer import run
qtrun(run, ui, *pats, **opts)
### help management, adapted from mercurial.commands.help_()
|
Loading...