from PyQt4 import QtCore
import constants
+import maeqt
from util import misc as misc_utils
import unit_data
class Gonvert(object):
- # @todo get subwindows working
- # @todo rotation support
-
_DATA_PATHS = [
os.path.dirname(__file__),
os.path.join(os.path.dirname(__file__), "../data"),
self._window = QtGui.QMainWindow(parent)
self._window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)
+ maeqt.set_autorient(self._window, True)
+ maeqt.set_stackable(self._window, True)
if parent is not None:
self._window.setWindowModality(QtCore.Qt.WindowModal)
self._window.setWindowTitle("%s - Quick Jump" % constants.__pretty_app_name__)
self._window = QtGui.QMainWindow(parent)
self._window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)
+ maeqt.set_autorient(self._window, True)
+ maeqt.set_stackable(self._window, True)
if parent is not None:
self._window.setWindowModality(QtCore.Qt.WindowModal)
self._window.setWindowTitle("%s - Recent" % constants.__pretty_app_name__)
self._window = QtGui.QMainWindow(parent)
self._window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)
+ maeqt.set_autorient(self._window, True)
+ maeqt.set_stackable(self._window, True)
if parent is not None:
self._window.setWindowModality(QtCore.Qt.WindowModal)
self._window.setWindowTitle("%s - Favorites" % constants.__pretty_app_name__)
self._window = QtGui.QMainWindow(parent)
self._window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)
+ maeqt.set_autorient(self._window, True)
+ maeqt.set_stackable(self._window, True)
if parent is not None:
self._window.setWindowModality(QtCore.Qt.WindowModal)
self._window.setWindowTitle("%s - Categories" % constants.__pretty_app_name__)
self._window = QtGui.QMainWindow(parent)
self._window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)
+ maeqt.set_autorient(self._window, True)
+ maeqt.set_stackable(self._window, True)
if parent is not None:
self._window.setWindowModality(QtCore.Qt.WindowModal)
self._window.setWindowTitle("%s - %s" % (constants.__pretty_app_name__, category))
--- /dev/null
+from PyQt4 import QtCore
+
+
+def _null_set_stackable(window, isStackable):
+ pass
+
+
+def _maemo_set_stackable(window, isStackable):
+ window.setAttribute(QtCore.Qt.WA_Maemo5StackedWindow, isStackable)
+
+
+try:
+ QtCore.Qt.WA_Maemo5StackedWindow
+ set_stackable = _maemo_set_stackable
+except AttributeError:
+ set_stackable = _null_set_stackable
+
+
+def _null_set_autorient(window, isStackable):
+ pass
+
+
+def _maemo_set_autorient(window, isStackable):
+ window.setAttribute(QtCore.Qt.WA_Maemo5StackedWindow, isStackable)
+
+
+try:
+ QtCore.Qt.WA_Maemo5AutoOrientation
+ set_autorient = _maemo_set_autorient
+except AttributeError:
+ set_autorient = _null_set_autorient
+
+
+def _null_set_landscape(window, isStackable):
+ pass
+
+
+def _maemo_set_landscape(window, isStackable):
+ window.setAttribute(QtCore.Qt.WA_Maemo5StackedWindow, isStackable)
+
+
+try:
+ QtCore.Qt.WA_Maemo5LandscapeOrientation
+ set_landscape = _maemo_set_landscape
+except AttributeError:
+ set_landscape = _null_set_landscape
+
+
+def _null_set_portrait(window, isStackable):
+ pass
+
+
+def _maemo_set_portrait(window, isStackable):
+ window.setAttribute(QtCore.Qt.WA_Maemo5StackedWindow, isStackable)
+
+
+try:
+ QtCore.Qt.WA_Maemo5PortraitOrientation
+ set_portrait = _maemo_set_portrait
+except AttributeError:
+ set_portrait = _null_set_portrait
+
+
+def _null_show_progress_indicator(window, isStackable):
+ pass
+
+
+def _maemo_show_progress_indicator(window, isStackable):
+ window.setAttribute(QtCore.Qt.WA_Maemo5StackedWindow, isStackable)
+
+
+try:
+ QtCore.Qt.WA_Maemo5ShowProgressIndicator
+ show_progress_indicator = _maemo_show_progress_indicator
+except AttributeError:
+ show_progress_indicator = _null_show_progress_indicator