Browse Source

Add "you have not joined any networks" placeholder if networks list is empty.

Adam Ierymenko 11 years ago
parent
commit
d553555880
2 changed files with 70 additions and 1 deletions
  1. 2 0
      ZeroTierUI/mainwindow.cpp
  2. 68 1
      ZeroTierUI/mainwindow.ui

+ 2 - 0
ZeroTierUI/mainwindow.cpp

@@ -238,6 +238,8 @@ void MainWindow::customEvent(QEvent *event)
 		}
 	}
 
+	ui->noNetworksLabel->setVisible(ui->networkListWidget->count() == 0);
+
 	if (this->myAddress.size())
 		ui->addressButton->setText(this->myAddress);
 	else ui->addressButton->setText("          ");

+ 68 - 1
ZeroTierUI/mainwindow.ui

@@ -34,6 +34,73 @@
     <property name="bottomMargin">
      <number>0</number>
     </property>
+    <item>
+     <widget class="QLabel" name="noNetworksLabel">
+      <property name="palette">
+       <palette>
+        <active>
+         <colorrole role="WindowText">
+          <brush brushstyle="SolidPattern">
+           <color alpha="64">
+            <red>0</red>
+            <green>0</green>
+            <blue>0</blue>
+           </color>
+          </brush>
+         </colorrole>
+        </active>
+        <inactive>
+         <colorrole role="WindowText">
+          <brush brushstyle="SolidPattern">
+           <color alpha="64">
+            <red>0</red>
+            <green>0</green>
+            <blue>0</blue>
+           </color>
+          </brush>
+         </colorrole>
+        </inactive>
+        <disabled>
+         <colorrole role="WindowText">
+          <brush brushstyle="SolidPattern">
+           <color alpha="255">
+            <red>127</red>
+            <green>127</green>
+            <blue>127</blue>
+           </color>
+          </brush>
+         </colorrole>
+        </disabled>
+       </palette>
+      </property>
+      <property name="font">
+       <font>
+        <pointsize>16</pointsize>
+       </font>
+      </property>
+      <property name="frameShape">
+       <enum>QFrame::NoFrame</enum>
+      </property>
+      <property name="text">
+       <string>You Have Not Joined Any Networks</string>
+      </property>
+      <property name="textFormat">
+       <enum>Qt::PlainText</enum>
+      </property>
+      <property name="alignment">
+       <set>Qt::AlignCenter</set>
+      </property>
+      <property name="wordWrap">
+       <bool>true</bool>
+      </property>
+      <property name="margin">
+       <number>25</number>
+      </property>
+      <property name="textInteractionFlags">
+       <set>Qt::NoTextInteraction</set>
+      </property>
+     </widget>
+    </item>
     <item>
      <widget class="QListWidget" name="networkListWidget">
       <property name="focusPolicy">
@@ -135,7 +202,7 @@ QPushButton:pressed {
 s</string>
          </property>
          <property name="text">
-          <string>          </string>
+          <string/>
          </property>
          <property name="flat">
           <bool>true</bool>