class Global(object): print 'Global = ' + __file__ ROOT_FOLDER = os.path.expanduser("~") + '/.autosense' RES_FOLDER = folder.get_current_dir(__file__) + '/res' FONT_FOLDER = RES_FOLDER + '/font' ICON_FOLDER = folder.get_current_dir(__file__) + '/icon' PRIVATE_FOLDER = ROOT_FOLDER + '/_data' LOG_FOLDER = folder.get_current_dir(__file__) + '/log' SOUND_FOLDER = folder.get_current_dir(__file__) + '/sound' APK_FOLDER = folder.get_current_dir(__file__) + '/apk' IMAGE_FOLDER = ROOT_FOLDER + '/image' SCRIPT_FOLDER = ROOT_FOLDER + '/script' FONT_FAMILY = 'Open Sans'
def __init__(self): super(SearchBox, self).__init__() self.button = QtGui.QToolButton(self) self.button.setIcon(QtGui.QIcon(folder.get_current_dir(__file__) + '/icon/ic_search.png')) self.button.setStyleSheet('border: 0px; padding: 3px 0px 3px 8px;') # self.button.setCursor(QtCore.Qt.ArrowCursor) # self.button.clicked.connect(self.buttonClicked.emit) frameWidth = self.style().pixelMetric(QtGui.QStyle.PM_DefaultFrameWidth) buttonSize = self.button.sizeHint() self.setStyleSheet('padding-left: %spx; border-radius: 10px; border: 1px solid #979797;' % str(buttonSize.width() + frameWidth + 1)) self.setMinimumSize(max(self.minimumSizeHint().width(), buttonSize.width() + frameWidth * 2 + 2), max(self.minimumSizeHint().height(), buttonSize.height() + frameWidth * 2 + 2)) self.setAttribute(QtCore.Qt.WA_MacShowFocusRect, 0)
import directory as folder import os ROOT_FOLDER = os.path.expanduser("~") + '/.autosense' RES_FOLDER = folder.get_current_dir(__file__) + '/res' FONT_FOLDER = RES_FOLDER + '/font' ICON_FOLDER = folder.get_current_dir(__file__) + '/icon' PRIVATE_FOLDER = ROOT_FOLDER + '/_data' LOG_FOLDER = folder.get_current_dir(__file__) + '/log' SOUND_FOLDER = folder.get_current_dir(__file__) + '/sound' APK_FOLDER = folder.get_current_dir(__file__) + '/apk' IMAGE_FOLDER = folder.get_current_dir(__file__) + '/image' SCRIPT_FOLDER = ROOT_FOLDER + '/script' WIFI = 'wifi' NFC = 'nfc' BLUETOOTH = 'bt' AIRPLANE = 'airplane' DATA_ROAMING = 'data_roaming' GPS = 'gps' AUTO_ROTATE = 'auto_rotate' AUTO_BRIGHTNESS = 'auto_brightness' BRIGHTNESS_SET = 'brightness_set' ALLOW_APP = 'allow_app' NO_KEEP_ACTIVITY = 'no_keep_activity' VIBRATE = 'vibrate' KEEP_WIFI = 'keep_wifi' WINDOW_ANIMATOR = 'window_animator' TRANSITION_ANIMATOR = 'transition_animator' DURATION_ANIMATION = 'duration_animation'