summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Rettberg2014-05-05 14:10:56 +0200
committerSimon Rettberg2014-05-05 14:10:56 +0200
commit9cb78ede183571984e8b47ac912f7121fb83c975 (patch)
treed81e91a521d67b20be452d9fc987461588b65d7e /src
parentREFRESH!!!! (diff)
downloadvmchooser2-9cb78ede183571984e8b47ac912f7121fb83c975.tar.gz
vmchooser2-9cb78ede183571984e8b47ac912f7121fb83c975.tar.xz
vmchooser2-9cb78ede183571984e8b47ac912f7121fb83c975.zip
Fix layout, give proper name to bug report button, disable button as long as it's not doing anything, add --fullscreen option
Diffstat (limited to 'src')
-rw-r--r--src/command_line_options.cpp5
-rw-r--r--src/dialog.cpp3
-rw-r--r--src/main.cpp45
-rw-r--r--src/ui/dialog.ui14
4 files changed, 44 insertions, 23 deletions
diff --git a/src/command_line_options.cpp b/src/command_line_options.cpp
index fd946bd..cfd5e08 100644
--- a/src/command_line_options.cpp
+++ b/src/command_line_options.cpp
@@ -6,9 +6,11 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) {
// parse command line arguments (please sort by short option for easier handling)
static const struct option longOptions[] = {
{"base", required_argument, NULL, 'b'},
+ {"path", required_argument, NULL, 'b'}, // Compatibility to v1.0
{"config", required_argument, NULL, 'c'},
{"debug", no_argument, NULL, 'D'},
{"default", required_argument, NULL, 'd'},
+ {"fullscreen", no_argument, NULL, 'F'},
{"file", required_argument, NULL, 'f'},
{"help", no_argument, NULL, 'h'},
{"pool", required_argument, NULL, 'P'},
@@ -39,6 +41,9 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) {
case 'd':
options.insert("default", optarg);
break;
+ case 'F':
+ options.insert("fullscreen", "fullscreen");
+ break;
case 'f':
options.insert("file", optarg);
break;
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 6d42491..be8d976 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -53,6 +53,9 @@ Dialog::Dialog(QWidget *parent)
this, SLOT(treeView_selectionChanged(const QModelIndex&, const QModelIndex&)));
this->onTabButtonChanged(2);
+
+ // TODO: Implement bug report dialog :)
+ ui->buttonBugReport->setEnabled(false);
}
Dialog::~Dialog() {
diff --git a/src/main.cpp b/src/main.cpp
index 87f30b9..30e30f3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -145,26 +145,32 @@ int main(int argc, char *argv[]) {
}
QString size;
- if (cmdOptions.contains("size")) {
+ int width, height;
+ if (cmdOptions.contains("fullscreen")) {
+ size = "fullscreen";
+ } else if (settings.contains("fullscreen")) {
+ size = "fullscreen";
+ } else if (cmdOptions.contains("size")) {
size = cmdOptions.value("size");
} else if (settings.contains("size")) {
size = settings.value("size").toString();
}
- int width, height;
- QRegExp rx("^(\\d+)x(\\d+)$");
- if (rx.indexIn(size) != -1) {
- QStringList list = rx.capturedTexts();
- width = list.value(1).toInt();
- height = list.value(2).toInt();
- } else if (!size.isEmpty()) {
- std::cerr
- << a.translate("Console", "vmchooser: invalid size argument").toUtf8().data()
- << std::endl;
- return EXIT_FAILURE;
- } else {
- width = VMCHOOSER_DEFAULT_WIDTH;
- height = VMCHOOSER_DEFAULT_HEIGHT;
+ if (size != "fullscreen") {
+ QRegExp rx("^(\\d+)x(\\d+)$");
+ if (rx.indexIn(size) != -1) {
+ QStringList list = rx.capturedTexts();
+ width = list.value(1).toInt();
+ height = list.value(2).toInt();
+ } else if (!size.isEmpty()) {
+ std::cerr
+ << a.translate("Console", "vmchooser: invalid size argument").toUtf8().data()
+ << std::endl;
+ return EXIT_FAILURE;
+ } else {
+ width = VMCHOOSER_DEFAULT_WIDTH;
+ height = VMCHOOSER_DEFAULT_HEIGHT;
+ }
}
if (cmdOptions.contains("pool")) {
@@ -187,6 +193,8 @@ int main(int argc, char *argv[]) {
basePath = cmdOptions.value("base");
} else if (settings.contains("base")) {
basePath = settings.value("base").toString();
+ } else if (settings.contains("path")) { // Compatibility to v1.0
+ basePath = settings.value("path").toString();
}
/* read session files */
@@ -225,6 +233,12 @@ int main(int argc, char *argv[]) {
if (pvsEnabled)
w.showSettingsPVS();
+ QRect desktopRect = QApplication::desktop()->availableGeometry(&w);
+ if (size == "fullscreen") {
+ width = desktopRect.width();
+ height = desktopRect.height();
+ }
+
w.resize(width, height);
if (xsessions.size()) {
@@ -241,7 +255,6 @@ int main(int argc, char *argv[]) {
w.show();
// center dialog on primary screen
- QRect desktopRect = QApplication::desktop()->availableGeometry(&w);
QPoint center = desktopRect.center();
w.move(center.x() - w.width() * 0.5, center.y() - w.height() * 0.5);
a.setActiveWindow(&w);
diff --git a/src/ui/dialog.ui b/src/ui/dialog.ui
index be55c23..204d486 100644
--- a/src/ui/dialog.ui
+++ b/src/ui/dialog.ui
@@ -23,7 +23,7 @@
<number>0</number>
</property>
<property name="leftMargin">
- <number>4</number>
+ <number>0</number>
</property>
<property name="topMargin">
<number>0</number>
@@ -126,8 +126,8 @@ margin-bottom:0px;}</string>
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Loading...&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Open Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt;&quot;&gt;Loading...&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@@ -152,8 +152,8 @@ p, li { white-space: pre-wrap; }
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Loading...&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Open Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans'; font-size:10pt;&quot;&gt;Loading...&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@@ -422,7 +422,7 @@ border:1px solid #999;
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Open Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:11pt;&quot;&gt;Click on an item on the left side for more infos.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
@@ -538,7 +538,7 @@ p, li { white-space: pre-wrap; }
<number>9</number>
</property>
<item>
- <widget class="QPushButton" name="pushButton_2">
+ <widget class="QPushButton" name="buttonBugReport">
<property name="text">
<string>Report Bug</string>
</property>