summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-16 19:02:27 +0100
committerSimon Rettberg2017-12-16 19:02:27 +0100
commitcd6bfb0ba09294ac6889f257de58de5eeae7eef2 (patch)
tree3da3d2bfe9b73c02414f5076553641962d61ca9f /src
parentApply proper translation at runtime (diff)
downloadbeamergui-cd6bfb0ba09294ac6889f257de58de5eeae7eef2.tar.gz
beamergui-cd6bfb0ba09294ac6889f257de58de5eeae7eef2.tar.xz
beamergui-cd6bfb0ba09294ac6889f257de58de5eeae7eef2.zip
Add --test mode
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp2
-rw-r--r--src/widget.cpp10
-rw-r--r--src/widget.h2
3 files changed, 10 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 801484a..f0c2dba 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -15,7 +15,7 @@ int main(int argc, char *argv[])
QTranslator *translator = new QTranslator(&a);
translator->load(QLocale::system(), ":");
a.installTranslator(translator);
- Widget w;
+ Widget w(argc == 2 && QString(argv[1]) == QString("--test"));
w.show();
return a.exec();
}
diff --git a/src/widget.cpp b/src/widget.cpp
index 887249f..05a8dcb 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -13,7 +13,7 @@
#include "math.h"
//______________________________________________________________________________
-Widget::Widget(QWidget *parent) :
+Widget::Widget(bool testMode, QWidget *parent) :
QWidget(parent),
_ui(new Ui::Widget)
{
@@ -28,6 +28,12 @@ Widget::Widget(QWidget *parent) :
// Get the information about the X elements
updateScreenResources();
+ if (testMode) {
+ while (_connectedOutputList.size() > 2) {
+ _connectedOutputList.pop_front();
+ }
+ }
+
switch ( _connectedOutputList.size() ){
/*************************************************************************/
case 1:// In case of one connected output - xrandr --auto
@@ -39,7 +45,7 @@ Widget::Widget(QWidget *parent) :
qDebug() << "Two connected outputs";
// Check if we are in clone mode
- if (cloneMode()) {
+ if (testMode || cloneMode()) {
qDebug() << "Dual output with cloned screen!";
diff --git a/src/widget.h b/src/widget.h
index 55caa63..6e8d7d6 100644
--- a/src/widget.h
+++ b/src/widget.h
@@ -32,7 +32,7 @@ class Widget : public QWidget
public:
- explicit Widget(QWidget *parent = 0);
+ explicit Widget(bool testMode, QWidget *parent = 0);
~Widget();
private slots: