Kaynağa Gözat

Move network diagram to System menu in Manager

unman 7 yıl önce
ebeveyn
işleme
4b31b206ef
5 değiştirilmiş dosya ile 19 ekleme ve 15 silme
  1. 0 7
      about.ui
  2. 10 0
      mainwindow.ui
  3. 0 8
      qubesmanager/about.py
  4. 6 0
      qubesmanager/main.py
  5. 3 0
      qubesmanager/networknotes.py

+ 0 - 7
about.ui

@@ -88,13 +88,6 @@
        </property>
       </widget>
      </item>
-     <item>
-      <widget class="QPushButton" name="networkNotes">
-       <property name="text">
-        <string>Qubes Networking</string>
-       </property>
-      </widget>
-     </item>
      <item>
       <widget class="QPushButton" name="ok">
        <property name="text">

+ 10 - 0
mainwindow.ui

@@ -279,6 +279,7 @@
      <string>&amp;System</string>
     </property>
     <addaction name="action_global_settings"/>
+    <addaction name="action_show_network"/>
     <addaction name="action_backup"/>
     <addaction name="action_restore"/>
    </widget>
@@ -697,6 +698,15 @@
     <string>&amp;Global settings</string>
    </property>
   </action>
+  <action name="action_show_network">
+   <property name="icon">
+    <iconset resource="resources.qrc">
+     <normaloff>:/networking.png</normaloff>:/networking.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Qubes Network</string>
+   </property>
+  </action>
   <action name="action_state">
    <property name="checkable">
     <bool>true</bool>

+ 0 - 8
qubesmanager/about.py

@@ -25,7 +25,6 @@ from PyQt4.QtCore import SIGNAL, SLOT
 from PyQt4.QtGui import QDialog, QIcon
 from qubesmanager.releasenotes import ReleaseNotesDialog
 from qubesmanager.informationnotes import InformationNotesDialog
-from qubesmanager.networknotes import NetworkNotesDialog
 
 from ui_about import *
 
@@ -46,8 +45,6 @@ class AboutDialog(Ui_AboutDialog, QDialog):
                      self.on_release_notes_clicked)
         self.connect(self.informationNotes, SIGNAL("clicked()"),
                      self.on_information_notes_clicked)
-        self.connect(self.networkNotes, SIGNAL("clicked()"),
-                     self.on_network_notes_clicked)
 
     def on_release_notes_clicked(self):
         release_notes_dialog = ReleaseNotesDialog()
@@ -58,8 +55,3 @@ class AboutDialog(Ui_AboutDialog, QDialog):
         information_notes_dialog = InformationNotesDialog()
         information_notes_dialog.exec_()
         self.accept()
-
-    def on_network_notes_clicked(self):
-        network_notes_dialog = NetworkNotesDialog()
-        network_notes_dialog.exec_()
-        self.accept()

+ 6 - 0
qubesmanager/main.py

@@ -55,6 +55,7 @@ from settings import VMSettingsWindow
 from restore import RestoreVMsWindow
 from backup import BackupVMsWindow
 from global_settings import GlobalSettingsWindow
+from networknotes import NetworkNotesDialog
 from log_dialog import LogDialog
 from thread_monitor import *
 from clipboard import *
@@ -1560,6 +1561,11 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
         global_settings_window = GlobalSettingsWindow(app, self.qvm_collection)
         global_settings_window.exec_()
 
+    @pyqtSlot(name='on_action_show_network_triggered')
+    def action_show_network_triggered(self):
+        network_notes_dialog = NetworkNotesDialog()
+        network_notes_dialog.exec_()
+
     @pyqtSlot(name='on_action_restore_triggered')
     def action_restore_triggered(self):
         restore_window = RestoreVMsWindow(app, self.qvm_collection,

+ 3 - 0
qubesmanager/networknotes.py

@@ -35,3 +35,6 @@ class NetworkNotesDialog(Ui_NetworkNotesDialog, QDialog):
         self.setupUi(self)
         details = subprocess.check_output(['/usr/libexec/qubes-manager/qvm_net.py'])
         self.networkNotes.setText(details)
+
+    def accept(self):
+        QDialog.accept(self)