Fixed searchclients to handle new Google URLs correctly; added GUI
[movie-schedule] / src / ui / uiutils.cpp
index 95a5748..ddee5b9 100644 (file)
@@ -23,6 +23,9 @@
 #include <QMessageBox>
 #endif
 
+#include <QApplication>
+#include <QDesktopWidget>
+
 UiUtils::UiUtils()
 {
 }
@@ -44,3 +47,14 @@ void UiUtils::ShowError(const QString &errormsg)
     QMessageBox::critical(0, "Movie-Schedule", errormsg);
 #endif
 }
+
+bool UiUtils::IsLandscape()
+{
+    QRect screenGeometry = QApplication::desktop()->screenGeometry();
+    return (screenGeometry.width() > screenGeometry.height());
+}
+
+bool UiUtils::IsPortrait()
+{
+    return !IsLandscape();
+}