Browse Source

UI quick start guide.

Adam Ierymenko 11 years ago
parent
commit
3a9b0cf132

BIN
ZeroTierUI/ZT1GUI.png


BIN
ZeroTierUI/ZT1GUI.xcf


+ 2 - 1
ZeroTierUI/ZeroTierUI.pro

@@ -104,7 +104,8 @@ FORMS    += mainwindow.ui \
     aboutwindow.ui \
     networkwidget.ui \
     installdialog.ui \
-    licensedialog.ui
+    licensedialog.ui \
+    quickstartdialog.ui
 
 RESOURCES += \
 		resources.qrc

+ 17 - 0
ZeroTierUI/mainwindow.cpp

@@ -51,6 +51,7 @@
 #include "aboutwindow.h"
 #include "networkwidget.h"
 #include "ui_mainwindow.h"
+#include "ui_quickstartdialog.h"
 
 #ifdef __APPLE__
 #include <stdio.h>
@@ -144,6 +145,13 @@ void MainWindow::timerEvent(QTimerEvent *event) // event can be null since code
 	if (this->firstTimerTick) {
 		this->firstTimerTick = false;
 		this->killTimer(this->pollServiceTimerId);
+
+		if (!settings->value("shown_quickStart",false).toBool()) {
+			on_actionQuick_Start_triggered();
+			settings->setValue("shown_quickStart",true);
+			settings->sync();
+		}
+
 		this->pollServiceTimerId = this->startTimer(1500);
 	}
 
@@ -387,3 +395,12 @@ void MainWindow::on_addressButton_clicked()
 {
 	QApplication::clipboard()->setText(this->myAddress);
 }
+
+void MainWindow::on_actionQuick_Start_triggered()
+{
+	Ui::QuickstartDialog qd;
+	QDialog *qdd = new QDialog(this);
+	qd.setupUi(qdd);
+	qdd->setModal(false);
+	qdd->show();
+}

+ 1 - 0
ZeroTierUI/mainwindow.h

@@ -79,6 +79,7 @@ private slots:
 	void on_actionAbout_triggered();
 	void on_networkIdLineEdit_textChanged(const QString &text);
 	void on_addressButton_clicked();
+	void on_actionQuick_Start_triggered();
 
 private:
 	Ui::MainWindow *ui;

+ 5 - 9
ZeroTierUI/mainwindow.ui

@@ -246,6 +246,7 @@
      <string>Help</string>
     </property>
     <addaction name="actionAbout"/>
+    <addaction name="actionQuick_Start"/>
    </widget>
    <widget class="QMenu" name="menuFile">
     <property name="title">
@@ -268,20 +269,15 @@
    <property name="text">
     <string>About</string>
    </property>
-   <property name="font">
-    <font>
-     <pointsize>10</pointsize>
-    </font>
-   </property>
   </action>
   <action name="actionExit">
    <property name="text">
     <string>Exit</string>
    </property>
-   <property name="font">
-    <font>
-     <pointsize>10</pointsize>
-    </font>
+  </action>
+  <action name="actionQuick_Start">
+   <property name="text">
+    <string>Quick Start</string>
    </property>
   </action>
  </widget>

+ 170 - 0
ZeroTierUI/quickstartdialog.ui

@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>QuickstartDialog</class>
+ <widget class="QDialog" name="QuickstartDialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>480</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Quick Start</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <property name="spacing">
+    <number>0</number>
+   </property>
+   <property name="leftMargin">
+    <number>0</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>0</number>
+   </property>
+   <property name="bottomMargin">
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QScrollArea" name="scrollArea">
+     <property name="frameShape">
+      <enum>QFrame::NoFrame</enum>
+     </property>
+     <property name="widgetResizable">
+      <bool>true</bool>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignCenter</set>
+     </property>
+     <widget class="QWidget" name="scrollAreaWidgetContents">
+      <property name="geometry">
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>785</width>
+        <height>800</height>
+       </rect>
+      </property>
+      <layout class="QHBoxLayout" name="horizontalLayout_2">
+       <property name="leftMargin">
+        <number>0</number>
+       </property>
+       <property name="topMargin">
+        <number>0</number>
+       </property>
+       <property name="rightMargin">
+        <number>0</number>
+       </property>
+       <property name="bottomMargin">
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QLabel" name="label">
+         <property name="styleSheet">
+          <string notr="true">background: #000000;</string>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+         <property name="textFormat">
+          <enum>Qt::PlainText</enum>
+         </property>
+         <property name="pixmap">
+          <pixmap resource="resources.qrc">:/img/ZT1GUI.png</pixmap>
+         </property>
+         <property name="scaledContents">
+          <bool>false</bool>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+   <item>
+    <widget class="QWidget" name="widget" native="true">
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <property name="leftMargin">
+       <number>6</number>
+      </property>
+      <property name="topMargin">
+       <number>6</number>
+      </property>
+      <property name="rightMargin">
+       <number>6</number>
+      </property>
+      <property name="bottomMargin">
+       <number>6</number>
+      </property>
+      <item>
+       <widget class="QLabel" name="label_2">
+        <property name="font">
+         <font>
+          <pointsize>10</pointsize>
+         </font>
+        </property>
+        <property name="text">
+         <string>Select Help -&gt; Quick Start to see this screen again.</string>
+        </property>
+        <property name="textFormat">
+         <enum>Qt::PlainText</enum>
+        </property>
+        <property name="textInteractionFlags">
+         <set>Qt::NoTextInteraction</set>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>702</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QPushButton" name="okButton">
+        <property name="text">
+         <string>OK</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="resources.qrc"/>
+ </resources>
+ <connections>
+  <connection>
+   <sender>okButton</sender>
+   <signal>clicked()</signal>
+   <receiver>QuickstartDialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>753</x>
+     <y>457</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>

+ 1 - 0
ZeroTierUI/resources.qrc

@@ -1,6 +1,7 @@
 <RCC>
     <qresource prefix="/img">
         <file>zt1icon.png</file>
+        <file>ZT1GUI.png</file>
     </qresource>
     <qresource prefix="/css">
         <file>stylesheet.css</file>