gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r5939 - in GNUnet/src/setup/qt: . pixmaps


From: gnunet
Subject: [GNUnet-SVN] r5939 - in GNUnet/src/setup/qt: . pixmaps
Date: Sun, 16 Dec 2007 15:46:09 -0700 (MST)

Author: durner
Date: 2007-12-16 15:46:08 -0700 (Sun, 16 Dec 2007)
New Revision: 5939

Added:
   GNUnet/src/setup/qt/pixmaps/gnunet-net-logo.png
Modified:
   GNUnet/src/setup/qt/Makefile.am
   GNUnet/src/setup/qt/gnunet-setup.ui
   GNUnet/src/setup/qt/pixmaps/pixmaps.qrc
   GNUnet/src/setup/qt/qtconfig.cc
   GNUnet/src/setup/qt/setupWizard.cc
   GNUnet/src/setup/qt/setupWizard.h
Log:
wizard-qt guts

Modified: GNUnet/src/setup/qt/Makefile.am
===================================================================
--- GNUnet/src/setup/qt/Makefile.am     2007-12-16 22:19:01 UTC (rev 5938)
+++ GNUnet/src/setup/qt/Makefile.am     2007-12-16 22:46:08 UTC (rev 5939)
@@ -9,6 +9,7 @@
         qtconfig.cc \
         setupWizard.cc setupWizard.h \
         moc_setupWizard.cpp \
+        resources.cpp \
         ui_enhanced.h ui_gnunet-setup.h
 
 libgnunetsetup_qt_la_LDFLAGS = \
@@ -32,6 +33,9 @@
   enhanced.ui \
   gnunet-setup.ui 
 
+ui_%.h: %.ui
+       uic $< -o $@ 
+
 # This rule lets GNU make create any moc_*.cpp from the equivalent *.h
 moc_%.cpp: %.h
        moc $< -o $@
@@ -40,6 +44,9 @@
 # resources.cpp : resources.qrc octave-gui.png
 #         rcc resources.qrc -o resources.cpp
 
+resources.cpp : pixmaps/pixmaps.qrc
+       rcc pixmaps/pixmaps.qrc -o resources.cpp
+
 # This line ensures that generated moc_*.cpp and resources.cpp files are
 # deleted when we make clean.
 CLEANFILES = $(filter moc_%.cpp,$(libgnunetsetup_qt_la_SOURCES)) resources.cpp

Modified: GNUnet/src/setup/qt/gnunet-setup.ui
===================================================================
--- GNUnet/src/setup/qt/gnunet-setup.ui 2007-12-16 22:19:01 UTC (rev 5938)
+++ GNUnet/src/setup/qt/gnunet-setup.ui 2007-12-16 22:46:08 UTC (rev 5939)
@@ -1,7 +1,4 @@
 <ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
  <class>SetupWizard</class>
  <widget class="QWidget" name="SetupWizard" >
   <property name="geometry" >
@@ -19,12 +16,21 @@
    <iconset resource="pixmaps/pixmaps.qrc" 
>:/pixmaps/gnunet-logo-small.png</iconset>
   </property>
   <layout class="QVBoxLayout" >
-   <property name="margin" >
-    <number>9</number>
-   </property>
    <property name="spacing" >
     <number>6</number>
    </property>
+   <property name="leftMargin" >
+    <number>9</number>
+   </property>
+   <property name="topMargin" >
+    <number>9</number>
+   </property>
+   <property name="rightMargin" >
+    <number>9</number>
+   </property>
+   <property name="bottomMargin" >
+    <number>9</number>
+   </property>
    <item>
     <widget class="QStackedWidget" name="stackedWidget" >
      <property name="currentIndex" >
@@ -32,37 +38,64 @@
      </property>
      <widget class="QWidget" name="page" >
       <layout class="QVBoxLayout" >
-       <property name="margin" >
-        <number>9</number>
-       </property>
        <property name="spacing" >
         <number>6</number>
        </property>
+       <property name="leftMargin" >
+        <number>9</number>
+       </property>
+       <property name="topMargin" >
+        <number>9</number>
+       </property>
+       <property name="rightMargin" >
+        <number>9</number>
+       </property>
+       <property name="bottomMargin" >
+        <number>9</number>
+       </property>
        <item>
-        <widget class="QTextBrowser" name="textBrowser" />
+        <widget class="QTextBrowser" name="htmlWelcome" />
        </item>
       </layout>
      </widget>
      <widget class="QWidget" name="page_2" >
       <layout class="QVBoxLayout" >
-       <property name="margin" >
-        <number>9</number>
-       </property>
        <property name="spacing" >
         <number>6</number>
        </property>
+       <property name="leftMargin" >
+        <number>9</number>
+       </property>
+       <property name="topMargin" >
+        <number>9</number>
+       </property>
+       <property name="rightMargin" >
+        <number>9</number>
+       </property>
+       <property name="bottomMargin" >
+        <number>9</number>
+       </property>
        <item>
         <widget class="QGroupBox" name="groupBox" >
          <property name="title" >
           <string>Network connection - enter information about your network 
connection here</string>
          </property>
          <layout class="QVBoxLayout" >
-          <property name="margin" >
-           <number>9</number>
-          </property>
           <property name="spacing" >
            <number>6</number>
           </property>
+          <property name="leftMargin" >
+           <number>9</number>
+          </property>
+          <property name="topMargin" >
+           <number>9</number>
+          </property>
+          <property name="rightMargin" >
+           <number>9</number>
+          </property>
+          <property name="bottomMargin" >
+           <number>9</number>
+          </property>
           <item>
            <widget class="QLabel" name="label" >
             <property name="frameShape" >
@@ -78,12 +111,21 @@
           </item>
           <item>
            <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
             <property name="spacing" >
              <number>6</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="QLabel" name="label_2" >
               <property name="font" >
@@ -119,7 +161,7 @@
              </spacer>
             </item>
             <item>
-             <widget class="QComboBox" name="comboBox" >
+             <widget class="QComboBox" name="cmbIF" >
               <property name="minimumSize" >
                <size>
                 <width>420</width>
@@ -149,7 +191,7 @@
           <item>
            <widget class="QLabel" name="label_3" >
             <property name="text" >
-             <string>If your provider always assigns the same IP-Address to 
you (a "static" IP-Address), enter it into this field. If your IP-Address 
changes every now and then ("dynamic" IP-Address) but there's a hostname that 
always points to your actual IP-Address ("Dynamic DNS"), you can also enter it 
here.
+             <string>If your provider always assigns the same IP-Address to 
you (a "static" IP-Address), enter it into this field. If your IP-Address 
changes every now and then ("dynamic" IP-Address) but there's a hostname that 
always points to your actual IP-Address ("Dynamic DNS"), you can also enter it 
here.&#xd;
 If in doubt, leave the field empty. GNUnet will then try to determine your 
IP-Address.</string>
             </property>
             <property name="wordWrap" >
@@ -159,12 +201,21 @@
           </item>
           <item>
            <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
             <property name="spacing" >
              <number>6</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="QLabel" name="label_4" >
               <property name="font" >
@@ -200,7 +251,7 @@
              </spacer>
             </item>
             <item>
-             <widget class="QLineEdit" name="lineEdit" >
+             <widget class="QLineEdit" name="editIP" >
               <property name="minimumSize" >
                <size>
                 <width>420</width>
@@ -239,14 +290,23 @@
           </item>
           <item>
            <layout class="QHBoxLayout" >
-            <property name="margin" >
+            <property name="spacing" >
              <number>6</number>
             </property>
-            <property name="spacing" >
+            <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="QCheckBox" name="checkBox" >
+             <widget class="QCheckBox" name="cbSNAT" >
               <property name="font" >
                <font>
                 <family>MS Shell Dlg 2</family>
@@ -285,24 +345,42 @@
      </widget>
      <widget class="QWidget" name="page_3" >
       <layout class="QVBoxLayout" >
-       <property name="margin" >
-        <number>9</number>
-       </property>
        <property name="spacing" >
         <number>6</number>
        </property>
+       <property name="leftMargin" >
+        <number>9</number>
+       </property>
+       <property name="topMargin" >
+        <number>9</number>
+       </property>
+       <property name="rightMargin" >
+        <number>9</number>
+       </property>
+       <property name="bottomMargin" >
+        <number>9</number>
+       </property>
        <item>
         <widget class="QGroupBox" name="groupBox_2" >
          <property name="title" >
           <string>Load limitation - limit GNUnet's ressource usage 
here</string>
          </property>
          <layout class="QVBoxLayout" >
-          <property name="margin" >
-           <number>9</number>
-          </property>
           <property name="spacing" >
            <number>6</number>
           </property>
+          <property name="leftMargin" >
+           <number>9</number>
+          </property>
+          <property name="topMargin" >
+           <number>9</number>
+          </property>
+          <property name="rightMargin" >
+           <number>9</number>
+          </property>
+          <property name="bottomMargin" >
+           <number>9</number>
+          </property>
           <item>
            <widget class="QLabel" name="label_6" >
             <property name="text" >
@@ -315,12 +393,21 @@
           </item>
           <item>
            <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
             <property name="spacing" >
              <number>6</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="QLabel" name="label_7" >
               <property name="font" >
@@ -353,7 +440,7 @@
              </spacer>
             </item>
             <item>
-             <widget class="QLineEdit" name="lineEdit_2" >
+             <widget class="QLineEdit" name="editUp" >
               <property name="minimumSize" >
                <size>
                 <width>420</width>
@@ -366,12 +453,21 @@
           </item>
           <item>
            <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
             <property name="spacing" >
              <number>6</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="QLabel" name="label_8" >
               <property name="font" >
@@ -407,7 +503,7 @@
              </spacer>
             </item>
             <item>
-             <widget class="QLineEdit" name="lineEdit_3" >
+             <widget class="QLineEdit" name="editDown" >
               <property name="minimumSize" >
                <size>
                 <width>420</width>
@@ -435,7 +531,7 @@
            </spacer>
           </item>
           <item>
-           <widget class="QRadioButton" name="radioButton" >
+           <widget class="QRadioButton" name="rbFull" >
             <property name="font" >
              <font>
               <family>MS Shell Dlg 2</family>
@@ -453,7 +549,7 @@
            </widget>
           </item>
           <item>
-           <widget class="QRadioButton" name="radioButton_2" >
+           <widget class="QRadioButton" name="rbShared" >
             <property name="font" >
              <font>
               <family>MS Shell Dlg 2</family>
@@ -498,12 +594,21 @@
           </item>
           <item>
            <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
             <property name="spacing" >
              <number>6</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="QLabel" name="label_10" >
               <property name="font" >
@@ -539,13 +644,16 @@
              </spacer>
             </item>
             <item>
-             <widget class="QSpinBox" name="spinBox" >
+             <widget class="QSpinBox" name="spinCPU" >
               <property name="minimumSize" >
                <size>
                 <width>420</width>
                 <height>0</height>
                </size>
               </property>
+              <property name="maximum" >
+               <number>100</number>
+              </property>
              </widget>
             </item>
            </layout>
@@ -570,31 +678,49 @@
      </widget>
      <widget class="QWidget" name="page_4" >
       <layout class="QVBoxLayout" >
-       <property name="margin" >
-        <number>9</number>
-       </property>
        <property name="spacing" >
         <number>6</number>
        </property>
+       <property name="leftMargin" >
+        <number>9</number>
+       </property>
+       <property name="topMargin" >
+        <number>9</number>
+       </property>
+       <property name="rightMargin" >
+        <number>9</number>
+       </property>
+       <property name="bottomMargin" >
+        <number>9</number>
+       </property>
        <item>
         <widget class="QGroupBox" name="groupBox_3" >
          <property name="title" >
           <string>Security settings - specify the user and the group owning 
the GNUnet service here</string>
          </property>
          <layout class="QVBoxLayout" >
-          <property name="margin" >
-           <number>9</number>
-          </property>
           <property name="spacing" >
            <number>6</number>
           </property>
+          <property name="leftMargin" >
+           <number>9</number>
+          </property>
+          <property name="topMargin" >
+           <number>9</number>
+          </property>
+          <property name="rightMargin" >
+           <number>9</number>
+          </property>
+          <property name="bottomMargin" >
+           <number>9</number>
+          </property>
           <item>
            <widget class="QLabel" name="label_11" >
             <property name="text" >
-             <string>For security reasons, it is a good idea to let this setup 
create a new user account and a new group under which the GNUnet service is 
started at system startup.
-
-However, GNUnet may not be able to access files other than its own. This 
includes files you want to publish in GNUnet. You will have to grant read 
permissions to the user specified below.
-
+             <string>For security reasons, it is a good idea to let this setup 
create a new user account and a new group under which the GNUnet service is 
started at system startup.&#xd;
+&#xd;
+However, GNUnet may not be able to access files other than its own. This 
includes files you want to publish in GNUnet. You will have to grant read 
permissions to the user specified below.&#xd;
+&#xd;
 Leave the fields empty to run GNUnet with system privileges.</string>
             </property>
             <property name="wordWrap" >
@@ -604,12 +730,21 @@
           </item>
           <item>
            <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
             <property name="spacing" >
              <number>6</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="QLabel" name="label_12" >
               <property name="font" >
@@ -642,7 +777,7 @@
              </spacer>
             </item>
             <item>
-             <widget class="QLineEdit" name="lineEdit_4" >
+             <widget class="QLineEdit" name="editUser" >
               <property name="minimumSize" >
                <size>
                 <width>440</width>
@@ -655,12 +790,21 @@
           </item>
           <item>
            <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
             <property name="spacing" >
              <number>6</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="QLabel" name="label_13" >
               <property name="font" >
@@ -693,7 +837,7 @@
              </spacer>
             </item>
             <item>
-             <widget class="QLineEdit" name="lineEdit_5" >
+             <widget class="QLineEdit" name="editGroup" >
               <property name="minimumSize" >
                <size>
                 <width>440</width>
@@ -724,28 +868,46 @@
      </widget>
      <widget class="QWidget" name="page_5" >
       <layout class="QVBoxLayout" >
-       <property name="margin" >
-        <number>9</number>
-       </property>
        <property name="spacing" >
         <number>6</number>
        </property>
+       <property name="leftMargin" >
+        <number>9</number>
+       </property>
+       <property name="topMargin" >
+        <number>9</number>
+       </property>
+       <property name="rightMargin" >
+        <number>9</number>
+       </property>
+       <property name="bottomMargin" >
+        <number>9</number>
+       </property>
        <item>
         <widget class="QGroupBox" name="groupBox_4" >
          <property name="title" >
           <string>Other settings</string>
          </property>
          <layout class="QVBoxLayout" >
-          <property name="margin" >
-           <number>9</number>
-          </property>
           <property name="spacing" >
            <number>6</number>
           </property>
+          <property name="leftMargin" >
+           <number>9</number>
+          </property>
+          <property name="topMargin" >
+           <number>9</number>
+          </property>
+          <property name="rightMargin" >
+           <number>9</number>
+          </property>
+          <property name="bottomMargin" >
+           <number>9</number>
+          </property>
           <item>
            <widget class="QLabel" name="label_14" >
             <property name="text" >
-             <string>GNUnet is able to store data from other peers in your 
datastore. This is useful if an adversary has access to your inserted content 
and you need to deny that the content is yours. With "content migration" on, 
the content could have "migrated" over the internet to your node without your 
knowledge.
+             <string>GNUnet is able to store data from other peers in your 
datastore. This is useful if an adversary has access to your inserted content 
and you need to deny that the content is yours. With "content migration" on, 
the content could have "migrated" over the internet to your node without your 
knowledge.&#xd;
 It also helps to spread popular content over different peers to enhance 
availability.</string>
             </property>
             <property name="wordWrap" >
@@ -754,7 +916,7 @@
            </widget>
           </item>
           <item>
-           <widget class="QCheckBox" name="checkBox_2" >
+           <widget class="QCheckBox" name="cbMigr" >
             <property name="font" >
              <font>
               <family>MS Shell Dlg 2</family>
@@ -799,12 +961,21 @@
           </item>
           <item>
            <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
             <property name="spacing" >
              <number>6</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="QLabel" name="label_16" >
               <property name="font" >
@@ -824,8 +995,28 @@
              </widget>
             </item>
             <item>
-             <widget class="QLineEdit" name="lineEdit_6" />
+             <spacer>
+              <property name="orientation" >
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" >
+               <size>
+                <width>50</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
             </item>
+            <item>
+             <widget class="QSpinBox" name="spinQuota" >
+              <property name="minimumSize" >
+               <size>
+                <width>370</width>
+                <height>0</height>
+               </size>
+              </property>
+             </widget>
+            </item>
            </layout>
           </item>
           <item>
@@ -845,6 +1036,32 @@
            </spacer>
           </item>
           <item>
+           <widget class="QCheckBox" name="cbAutostart" >
+            <property name="font" >
+             <font>
+              <weight>75</weight>
+              <bold>true</bold>
+             </font>
+            </property>
+            <property name="text" >
+             <string>Start GNUnet background process on computer 
startup</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <spacer>
+            <property name="orientation" >
+             <enum>Qt::Vertical</enum>
+            </property>
+            <property name="sizeHint" >
+             <size>
+              <width>20</width>
+              <height>40</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+          <item>
            <widget class="QLabel" name="label_17" >
             <property name="text" >
              <string>If you are an experienced user, you may want to tweak 
your GNUnet installation using the enhanced configurator.</string>
@@ -855,7 +1072,10 @@
            </widget>
           </item>
           <item>
-           <widget class="QCheckBox" name="checkBox_3" >
+           <widget class="QCheckBox" name="cbEnhConfig" >
+            <property name="enabled" >
+             <bool>false</bool>
+            </property>
             <property name="font" >
              <font>
               <family>MS Shell Dlg 2</family>
@@ -899,7 +1119,7 @@
            </widget>
           </item>
           <item>
-           <widget class="QCheckBox" name="checkBox_4" >
+           <widget class="QCheckBox" name="cbGNUpdate" >
             <property name="font" >
              <font>
               <family>MS Shell Dlg 2</family>
@@ -914,6 +1134,9 @@
             <property name="text" >
              <string>Run gnunet-update</string>
             </property>
+            <property name="checked" >
+             <bool>true</bool>
+            </property>
            </widget>
           </item>
           <item>
@@ -938,12 +1161,21 @@
    </item>
    <item>
     <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
      <property name="spacing" >
       <number>6</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>
       <spacer>
        <property name="orientation" >
@@ -1027,7 +1259,6 @@
    </item>
   </layout>
  </widget>
- <pixmapfunction></pixmapfunction>
  <resources>
   <include location="pixmaps/pixmaps.qrc" />
  </resources>

Added: GNUnet/src/setup/qt/pixmaps/gnunet-net-logo.png
===================================================================
(Binary files differ)


Property changes on: GNUnet/src/setup/qt/pixmaps/gnunet-net-logo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: GNUnet/src/setup/qt/pixmaps/pixmaps.qrc
===================================================================
--- GNUnet/src/setup/qt/pixmaps/pixmaps.qrc     2007-12-16 22:19:01 UTC (rev 
5938)
+++ GNUnet/src/setup/qt/pixmaps/pixmaps.qrc     2007-12-16 22:46:08 UTC (rev 
5939)
@@ -4,6 +4,7 @@
         <file>close.png</file>
         <file>exit.png</file>
         <file>gnunet-logo-small.png</file>
+        <file>gnunet-net-logo.png</file>
         <file>go-next.png</file>
         <file>go-previous.png</file>
         <file>media-floppy.png</file>

Modified: GNUnet/src/setup/qt/qtconfig.cc
===================================================================
--- GNUnet/src/setup/qt/qtconfig.cc     2007-12-16 22:19:01 UTC (rev 5938)
+++ GNUnet/src/setup/qt/qtconfig.cc     2007-12-16 22:46:08 UTC (rev 5939)
@@ -83,9 +83,7 @@
 
     app = new QApplication(argc, (char **) argv);
 
-    wiz = new GSetupWizard();
-    wiz->setErrorContext(ectx);
-    wiz->setConfig(cfg);
+    wiz = new GSetupWizard(NULL, ectx, cfg, filename);
     wiz->show();
     
     ret = app->exec();

Modified: GNUnet/src/setup/qt/setupWizard.cc
===================================================================
--- GNUnet/src/setup/qt/setupWizard.cc  2007-12-16 22:19:01 UTC (rev 5938)
+++ GNUnet/src/setup/qt/setupWizard.cc  2007-12-16 22:46:08 UTC (rev 5939)
@@ -1,16 +1,408 @@
+#include <QObject>
+#include <QMessageBox>
+
 #include "setupWizard.h"
+#include "config.h"
+#include "plibc.h"
+#include "gnunet_util.h"
+#include "gnunet_setup_lib.h"
+extern "C" {
+#include "wizard_util.h"
+}
 
-GSetupWizard::GSetupWizard(QDialog *parent) : QDialog(parent)
+QString GSetupWizard::header()
 {
-  setupUi(this);
+  return QString(
+        "<table bgcolor=\"#3F4C6B\" border=\"0\" cellpadding=\"0\" 
cellspacing=\"0\" height=\"62\" width=\"100%\">"
+          "<tr>"
+            "<td colspan=\"3\" height=\"10\" nowrap=\"nowrap\" 
valign=\"middle\" />"
+          "</tr>"
+          "<tr>"
+            "<td width=\"20\" />"
+            "<td>"
+              "<font color=\"white\" face=\"Arial, Helvetica\" 
size=\"6\"><b>GNUnet</b></font>"
+              "<br>"
+              "<font color=\"#d3d3d3\" size=\"4\" face=\"Bitstream Vera Sans, 
Lucida Grande, Trebuchet MS, Lucida Sans Unicode, Luxi Sans, Helvetica, Arial, 
Sans-Serif\">"
+                  + tr("GNU&#8216;s decentralized anonymous and 
censorship-resistant P2P framework.") +
+              "</font>"
+            "<td align=\"right\">"
+                "<img src=\"qrc:/pixmaps/gnunet-net-logo.png\" 
/>&nbsp;&nbsp;&nbsp;&nbsp;"
+            "</td>"
+          "</tr>"
+        "</table>"
+        "<table bgcolor=\"#3F4C6B\" border=\"0\" cellpadding=\"0\" 
cellspacing=\"0\" width=\"100%\">"
+          "<tr>"
+            "<td>&nbsp;</td>"
+          "</tr>"
+        "</table>"
+        "<br>"  
+  );
 }
 
-void GSetupWizard::setErrorContext(struct GNUNET_GE_Context *ectx)
+GSetupWizard::GSetupWizard(QDialog *parent, struct GNUNET_GE_Context *ectx, 
struct GNUNET_GC_Configuration *cfg, const char *cfg_fn) : QDialog(parent)
 {
+  setupUi(this);
+  
+  curPage = 0;
+
   this->ectx = ectx;
+  this->cfg = cfg;
+  this->cfg_fn = cfg_fn;
+  
+  connect(pbNext, SIGNAL(clicked()), this, SLOT(nextClicked()));
+  connect(pbPrev, SIGNAL(clicked()), this, SLOT(prevClicked()));
+  connect(pbClose, SIGNAL(clicked()) , this, SLOT(abortClicked()));
+  
+  htmlWelcome->setHtml(
+    "<html>"
+      "<body>" +
+        header() +
+        "<center>"
+          "<font size=\"5\"><b>" + tr("Welcome to ") + PACKAGE_STRING 
"</b></font>"
+          "<br />"
+          "<br />"
+          "<table width=\"91%\">"
+            "<tr>"
+              "<td>"
+                "<font size=\"4\">" +
+    tr("This assistant will ask you a few basic questions in order to 
configure GNUnet.") +
+                  "<br /><br />" +
+    tr("Please visit our homepage at") +
+                  "<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<a 
href=\"http://gnunet.org\";>http://gnunet.org</a><br /><br />" +
+    tr("and join our community:") +
+                  "<ul>" +
+                    "<li>" +
+    tr("Help, discussion and polls: ") +
+                      "<a 
href=\"http://gnunet.org/drupal/\";>http://gnunet.org/drupal/</a>" +
+                    "</li>" +
+                    "<li>" +
+    tr("IRC chat with users and developers: ") +
+                      "<a 
href=\"http://irc://irc.freenode.net/#gnunet\";>#gnunet</a> " +
+    tr("on Freenode") +
+                    "</li>" +
+                  "</ul>" +
+                  "<br /><br />" +
+                  "</font>"
+              "</td>"
+            "</tr>"
+            "<tr>"
+              "<td>"
+               "<font size=\"4\">" +
+                  tr("Have a lot fun,") +
+                  "<br /><br />"
+                  "&nbsp;&nbsp;&nbsp;&nbsp;" +
+                  tr("The GNUnet team") +
+                "</font>"
+              "</td>"
+            "</tr>"
+          "</table>"
+        "</center>"
+      "</body>"
+    "</html>");
+    
+    loadDefaults();
 }
 
-void GSetupWizard::setConfig(struct GNUNET_GC_Configuration *cfg)
+static int insert_nic (const char *name, int defaultNIC, void *cls)
 {
-  this->cfg = cfg;
+  QString str;
+  QComboBox *cmbIF;
+  
+  cmbIF = (QComboBox *) cls;
+  str = name;
+  if (str.length() == 0)
+    str = QObject::tr("(unknown connection)");
+  
+  cmbIF->addItem(str);
+  if (defaultNIC)
+    cmbIF->setCurrentIndex(cmbIF->count() - 1);
+
+  return GNUNET_OK;
 }
+
+void GSetupWizard::loadDefaults()
+{
+  char *val;
+  unsigned long long num;
+  
+  // page 2
+  GNUNET_list_network_interfaces (ectx, &insert_nic, cmbIF);
+  
+  GNUNET_GC_get_configuration_value_string (cfg, "NETWORK", "IP", "",
+                                            &val);
+  editIP->setText(val);
+  GNUNET_free_non_null(val);
+  
+  cbSNAT->setChecked(GNUNET_GC_get_configuration_value_yesno(cfg, "NAT", 
"LIMITED",
+                                 GNUNET_NO) == GNUNET_YES);
+                                 
+  // page 3
+  GNUNET_GC_get_configuration_value_string (cfg,
+                                            "LOAD",
+                                            "MAXNETUPBPSTOTAL", "50000",
+                                            &val);
+  editUp->setText(val);
+  GNUNET_free_non_null(val);
+  
+  GNUNET_GC_get_configuration_value_string (cfg,
+                                            "LOAD",
+                                            "MAXNETDOWNBPSTOTAL", "50000",
+                                            &val);
+  editDown->setText(val);
+  GNUNET_free_non_null(val);
+
+  if (GNUNET_GC_get_configuration_value_yesno (cfg,
+                                                "LOAD",
+                                                "BASICLIMITING",
+                                                GNUNET_NO) == GNUNET_YES)
+  {
+    rbFull->setChecked(true);
+  }
+  else
+  {
+    rbFull->setChecked(false);
+  }
+  
+  GNUNET_GC_get_configuration_value_string (cfg,
+                                            "LOAD", "MAXCPULOAD", "50", &val);
+  spinCPU->setValue(atoi(val));
+  GNUNET_free_non_null(val);
+  
+  // page 4
+  char *uname = NULL;
+  char *gname = NULL;
+  char *user_name, *group_name;
+  int cap;
+
+  GNUNET_GC_get_configuration_value_string (cfg,
+                                            "GNUNETD", "USER", "gnunet",
+                                            &uname);
+  GNUNET_GC_get_configuration_value_string (cfg,
+                                            "GNUNETD",
+                                            "GROUP", "gnunet", &gname);
+
+#ifndef MINGW
+  if (NULL == uname || strlen (uname) == 0)
+    {
+      if ((geteuid () == 0) || (NULL != getpwnam ("gnunet")))
+        user_name = GNUNET_strdup ("gnunet");
+      else
+        {
+          GNUNET_free_non_null(uname);
+          uname = getenv ("USER");
+          if (uname != NULL)
+            user_name = GNUNET_strdup (uname);
+          else
+            user_name = NULL;
+        }
+    }
+  else
+    {
+      user_name = GNUNET_strdup (uname);
+    }
+  if (NULL == gname || strlen (gname) == 0)
+    {
+      struct group *grp;
+      
+      if ((geteuid () == 0) || (NULL != getgrnam ("gnunet")))
+        group_name = GNUNET_strdup ("gnunet");
+      else
+        {
+          grp = getgrgid (getegid ());
+          if ((grp != NULL) && (grp->gr_name != NULL))
+            group_name = GNUNET_strdup (grp->gr_name);
+          else
+            group_name = NULL;
+        }
+    }
+  else
+    {
+      group_name = GNUNET_strdup (gname);
+    }
+
+#else
+  if (NULL == uname || strlen (uname) == 0)
+    user_name = GNUNET_strdup ("");
+  else
+    user_name = GNUNET_strdup (uname);
+  if (NULL == gname || strlen (gname) == 0)
+    group_name = GNUNET_strdup ("");
+  else
+    group_name = GNUNET_strdup (gname);
+#endif
+
+  if (user_name != NULL)
+    editUser->setText(user_name);
+  if (group_name != NULL)
+    editGroup->setText(group_name);
+  cap = GNUNET_configure_autostart (ectx, 1, 1, NULL, NULL, NULL);
+  cbAutostart->setEnabled(cap);
+  cap = GNUNET_configure_user_account(1, 1, NULL, NULL);
+  editUser->setEnabled(cap);
+#ifdef WINDOWS
+  cap = FALSE;
+#endif
+  editGroup->setEnabled(cap);
+
+  GNUNET_free_non_null(uname);
+  GNUNET_free_non_null(gname);
+  
+  // page 5
+  GNUNET_GC_get_configuration_value_string (cfg, "FS", "QUOTA", "1024",
+                                            &val);
+  GNUNET_GC_get_configuration_value_number(cfg, "FS", "QUOTA", 1, 1000000, 
1024, &num);
+  spinQuota->setValue(num);
+  
+  cbMigr->setChecked(GNUNET_GC_get_configuration_value_yesno
+                                (cfg, "FS", "ACTIVEMIGRATION",
+                                 GNUNET_YES) == GNUNET_YES);
+
+  cbAutostart->setChecked(GNUNET_GC_get_configuration_value_yesno
+                                (cfg, "GNUNETD", "AUTOSTART",
+                                 GNUNET_NO) == GNUNET_YES);
+}
+
+int GSetupWizard::saveConf()
+{
+  QString iface;
+  
+  iface = cmbIF->currentText();
+#ifdef Q_OS_WIN32
+  int idx;
+  
+  idx = iface.lastIndexOf("- ");
+  if (idx == -1)
+  {
+    QMessageBox::critical(this, tr("Error"), tr("Malformed interface name. 
Please report this to address@hidden: ") + iface);
+    return GNUNET_NO;
+  }
+  iface.remove(0, idx + 2);
+  iface.remove(iface.length() - 1, 1);
+#endif
+
+  GNUNET_GC_set_configuration_value_string(cfg, ectx, "NETWORK", "INTERFACE", 
qPrintable(iface));
+  GNUNET_GC_set_configuration_value_string(cfg, ectx, "LOAD", "INTERFACES", 
qPrintable(iface));
+  GNUNET_GC_set_configuration_value_string(cfg, ectx, "NETWORK", "IP", 
qPrintable(editIP->text()));
+  GNUNET_GC_set_configuration_value_choice(cfg, ectx, "NAT", "LIMITED", 
cbSNAT->isChecked() ? "YES" : "NO");
+  GNUNET_GC_set_configuration_value_string(cfg, ectx, "LOAD", 
"MAXNETDOWNBPSTOTAL", qPrintable(editDown->text()));
+  GNUNET_GC_set_configuration_value_string(cfg, ectx, "LOAD", 
"MAXNETUPBPSTOTAL", qPrintable(editUp->text()));  
+  GNUNET_GC_set_configuration_value_choice(cfg, ectx, "LOAD", "BASICLIMITING", 
rbFull->isChecked() ? "YES" : "NO");
+  GNUNET_GC_set_configuration_value_number(cfg, ectx, "LOAD", "MAXCPULOAD", 
spinCPU->value());  
+  GNUNET_GC_set_configuration_value_string(cfg, ectx, "GNUNETD", "USER", 
qPrintable(editUser->text()));  
+  GNUNET_GC_set_configuration_value_string(cfg, ectx, "GNUNETD", "GROUP", 
qPrintable(editGroup->text()));  
+  GNUNET_GC_set_configuration_value_choice(cfg, ectx, "FS", "ACTIVEMIGRATION", 
cbMigr->isChecked() ? "YES" : "NO");
+  GNUNET_GC_set_configuration_value_number(cfg, ectx, "FS", "QUOTA", 
spinQuota->value());  
+  GNUNET_GC_set_configuration_value_choice(cfg, ectx, "GNUNETD", "AUTOSTART", 
cbAutostart->isChecked() ? "YES" : "NO");
+  
+  if (GNUNET_GC_write_configuration (cfg, cfg_fn))
+    {
+      QMessageBox::critical(this, tr("Error"), tr("Unable to save 
configuration file ") +
+        QString(cfg_fn) + ": " + QString(STRERROR(errno)));
+      return GNUNET_SYSERR;
+    }
+  return GNUNET_OK;
+}
+
+void GSetupWizard::abortClicked()
+{
+  QMessageBox::StandardButton ret;
+  int ok;
+  
+  ret = QMessageBox::question(this, tr("Save"), tr("Do you want to save the 
new configuration?"),
+    QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, 
QMessageBox::Yes);
+  switch(ret)
+  {
+    case QMessageBox::Yes:
+      ok = saveConf();
+      break;
+    case QMessageBox::No:
+      ok = GNUNET_OK;
+      break;
+    case QMessageBox::Cancel:
+    default:
+      ok = GNUNET_NO;
+  }
+  
+  if (ok)
+    qApp->quit();
+}
+
+void GSetupWizard::nextClicked()
+{
+  if (curPage == 3)
+  {
+    pbNext->setIcon(QIcon(":/pixmaps/exit.png"));
+    pbNext->setText(tr("Finish"));
+  }
+  else if (curPage == 4)
+  {
+    char *gup, *bin, *user_name, *group_name;
+    
+    group_name = strdup(qPrintable(editUser->text()));
+    user_name = strdup(qPrintable(editGroup->text()));
+    
+    if (cbAutostart->isChecked() && strlen(user_name))
+      if (!GNUNET_GNS_wiz_create_group_user (group_name, user_name))
+        {
+#ifndef MINGW
+          QMessageBox::critical(this, tr("Error"), QString("Unable to create 
user account: ") +
+            STRERROR(errno));
+#endif
+          GNUNET_free(user_name);
+          GNUNET_free(group_name);
+          return;
+        }
+  
+    if (GNUNET_GNS_wiz_autostart_service (cbAutostart->isChecked(), user_name, 
group_name) !=
+        GNUNET_OK)
+      {
+#ifndef MINGW
+          QMessageBox::critical(this, tr("Error"), QString("Unable to change 
startup process: ") +
+            STRERROR(errno));
+#endif
+      }
+
+    GNUNET_free(user_name);
+    GNUNET_free(group_name);
+  
+    if (GNUNET_OK != saveConf ())
+      return;
+    
+    if (cbGNUpdate->isChecked())
+      {
+        bin = GNUNET_get_installation_path (GNUNET_IPK_BINDIR);
+        gup = (char *) GNUNET_malloc (strlen (bin) + 30 + strlen (cfg_fn));
+        strcpy (gup, bin);
+        GNUNET_free (bin);
+        strcat (gup, "/gnunet-update -c ");
+        strcat (gup, cfg_fn);
+        if (system (gup) != 0)
+        {
+          QMessageBox::critical(this, tr("Error"), "Running gnunet-update 
failed.\n"
+                     "This maybe due to insufficient permissions, please check 
your configuration.\n"
+                     "Finally, run gnunet-update manually.");
+        }
+        GNUNET_free (gup);
+      }
+    qApp->quit();
+
+    return;
+  }
+  
+  curPage++;
+  stackedWidget->setCurrentIndex(curPage);
+}
+
+void GSetupWizard::prevClicked()
+{
+  if (curPage == 4)
+  {
+    pbNext->setIcon(QIcon(":/pixmaps/go-next.png"));
+    pbNext->setText(tr("Next"));    
+  }
+  else if (curPage == 0)
+    return;
+  
+  curPage--;
+  stackedWidget->setCurrentIndex(curPage);
+}

Modified: GNUnet/src/setup/qt/setupWizard.h
===================================================================
--- GNUnet/src/setup/qt/setupWizard.h   2007-12-16 22:19:01 UTC (rev 5938)
+++ GNUnet/src/setup/qt/setupWizard.h   2007-12-16 22:46:08 UTC (rev 5939)
@@ -8,13 +8,19 @@
 {
   Q_OBJECT
 public:
-  GSetupWizard (QDialog * parent = NULL);
-  void
-  setErrorContext (struct GNUNET_GE_Context *ectx);
-  void
-  setConfig (struct GNUNET_GC_Configuration *cfg);
+  GSetupWizard (QDialog * parent, struct GNUNET_GE_Context *ectx, struct 
GNUNET_GC_Configuration *cfg, const char *cfg_fn);
 
+protected slots:
+  void nextClicked();
+  void prevClicked();
+  void abortClicked();
 protected:
+  QString header();
+  void loadDefaults();
+  int saveConf();
+
+  unsigned int curPage;
+  const char *cfg_fn;
   struct GNUNET_GE_Context *
     ectx;
   struct GNUNET_GC_Configuration *





reply via email to

[Prev in Thread] Current Thread [Next in Thread]