1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Use the new hscommon.plat unit.

This commit is contained in:
Virgil Dupras
2011-09-22 09:32:09 -04:00
parent 43c4dcb267
commit 1fafe04f19
9 changed files with 26 additions and 23 deletions

View File

@@ -18,6 +18,7 @@ from PyQt4.QtGui import QDesktopServices, QFileDialog, QDialog, QMessageBox, QAp
from jobprogress import job
from jobprogress.qt import Progress
from hscommon.trans import tr, trmsg
from hscommon.plat import ISLINUX
from core.app import JobType
@@ -108,7 +109,7 @@ class DupeGuru(QObject):
]
createActions(ACTIONS, self)
if sys.platform == 'linux2':
if ISLINUX:
self.actionCheckForUpdate.setVisible(False) # This only works on Windows
def _setup_as_registered(self):

View File

@@ -12,6 +12,7 @@ from PyQt4.QtCore import Qt, QUrl, QTimer
from PyQt4.QtGui import (QDialog, QDesktopServices, QApplication, QVBoxLayout, QHBoxLayout, QLabel,
QFont, QSpacerItem, QSizePolicy, QPushButton)
from hscommon.plat import ISLINUX
from hscommon.trans import tr as trbase, trmsg as trmsgbase
tr = lambda s: trbase(s, "ExtraFairwareReminder")
trmsg = lambda s: trmsgbase(s, "ExtraFairwareReminder")
@@ -33,7 +34,7 @@ class ExtraFairwareReminder(QDialog):
def _setupUi(self):
self.setWindowTitle(tr("Sorry, I must insist"))
dlg_height = 410 if sys.platform == 'linux2' else 330
dlg_height = 410 if ISLINUX else 330
self.resize(380, dlg_height)
self.verticalLayout = QVBoxLayout(self)
self.descLabel = QLabel(self)

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Created By: Virgil Dupras
# Created On: 2009-09-27
# Copyright 2011 Hardcoded Software (http://www.hardcoded.net)
@@ -7,14 +6,13 @@
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
import logging
import sys
from hscommon.plat import ISWINDOWS, ISOSX, ISLINUX
if sys.platform == 'win32':
if ISWINDOWS:
from .platform_win import *
elif sys.platform == 'darwin':
elif ISOSX:
from .platform_osx import *
elif sys.platform == 'linux2':
elif ISLINUX:
from .platform_lnx import *
else:
pass # unsupported platform

View File

@@ -6,11 +6,11 @@
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
import sys
from PyQt4.QtCore import SIGNAL, Qt, QSize
from PyQt4.QtGui import (QDialog, QDialogButtonBox, QVBoxLayout, QHBoxLayout, QLabel, QComboBox,
QSlider, QSizePolicy, QSpacerItem, QCheckBox, QLineEdit, QMessageBox)
from hscommon.plat import ISOSX, ISLINUX
from hscommon.trans import tr, trmsg
class PreferencesDialogBase(QDialog):
@@ -124,7 +124,7 @@ class PreferencesDialogBase(QDialog):
self.buttonBox = QDialogButtonBox(self)
self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok|QDialogButtonBox.RestoreDefaults)
self.mainVLayout.addWidget(self.buttonBox)
if sys.platform not in {'darwin', 'linux2'}:
if (not ISOSX) and (not ISLINUX):
self.mainVLayout.removeWidget(self.ignoreHardlinkMatches)
self.ignoreHardlinkMatches.setHidden(True)

View File

@@ -6,13 +6,12 @@
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
import sys
from PyQt4.QtCore import Qt, SIGNAL, QUrl, QRect
from PyQt4.QtGui import (QMainWindow, QMenu, QLabel, QHeaderView, QMessageBox, QInputDialog,
QLineEdit, QDesktopServices, QFileDialog, QMenuBar, QWidget, QVBoxLayout, QAbstractItemView,
QStatusBar, QDialog)
from hscommon.plat import ISOSX, ISLINUX
from hscommon.trans import tr, trmsg
from hscommon.util import nonone
from qtlib.util import moveToScreenCenter
@@ -72,7 +71,7 @@ class ResultWindow(QMainWindow):
self.actionDelta.setCheckable(True)
self.actionPowerMarker.setCheckable(True)
if sys.platform not in {'darwin', 'linux2'}:
if (not ISOSX) and (not ISLINUX):
self.actionHardlinkMarked.setVisible(False)
def _setupMenu(self):