[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdesdk/kioslave/svn/svnhelper
From:       Laurent Montel <montel () kde ! org>
Date:       2008-07-10 7:08:44
Message-ID: 1215673724.450496.5740.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 830336 by mlaurent:

Better integration with kde


 M  +22 -9     kio_svn_helper.cpp  
 M  +15 -2     kio_svn_helper.h  
 M  +85 -169   subversionswitch.ui  


--- trunk/KDE/kdesdk/kioslave/svn/svnhelper/kio_svn_helper.cpp #830335:830336
@@ -63,15 +63,28 @@
     return m_checkoutWidget->url->url();
 }
 
+SubversionSwitchDialog::SubversionSwitchDialog( QWidget* parent)
+  : KDialog( parent )
+{
+  setCaption( i18n( "Subversion Switch" ) );
+  setButtons( Ok|Cancel );
+  setDefaultButton( Ok );
+  setModal( true );
+  KVBox *page = new KVBox( this );
+  setMainWidget( page );
+  m_switchWidget = new SubversionSwitch( page );
+}
 
-SubversionSwitch::SubversionSwitch(QWidget *parent )
-: QDialog(parent)
+int SubversionSwitchDialog::revisionValue() const
 {
-   setupUi( this );
-   connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
-   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+    return m_switchWidget->revision->value();
 }
 
+KUrl SubversionSwitchDialog::url() const
+{
+    return m_switchWidget->url->url();
+}
+
 Subversion_Diff::Subversion_Diff(QWidget *parent )
 : QDialog(parent)
 {
@@ -196,7 +209,7 @@
 		KIO::NetAccess::synchronousRun( job, 0 );
 	} else if (args->isSet("s")) {
 		kDebug(7128) << "switch " << list;
-		SubversionSwitch d;
+		SubversionSwitchDialog d;
 		int result = d.exec();
 		if ( result == QDialog::Accepted ) {
 			for ( QList<KUrl>::const_iterator it = list.begin(); it != list.end() ; ++it ) {
@@ -206,15 +219,15 @@
 				QDataStream s( &parms, QIODevice::WriteOnly );
 				int revnumber = -1;
 				QString revkind = "HEAD";
-				if ( d.revision->value() != 0 ) {
-					revnumber = d.revision->value();
+				if ( d.revisionValue() != 0 ) {
+					revnumber = d.revisionValue();
 					revkind = "";
 				}
 				bool recurse=true;
 				int cmd = 12;
 				s << cmd;
 				s << *it;
-				s << KUrl( d.url->url() );
+				s << d.url();
 				s << recurse;
 				s << revnumber;
 				s << revkind;
--- trunk/KDE/kdesdk/kioslave/svn/svnhelper/kio_svn_helper.h #830335:830336
@@ -36,10 +36,12 @@
     }
 };
 
-class SubversionSwitch : public QDialog, public Ui::SubversionSwitch
+class SubversionSwitch : public QWidget, public Ui::SubversionSwitch
 {
 public:
-  SubversionSwitch( QWidget *parent = 0 );
+    SubversionSwitch( QWidget *parent = 0 ) :QWidget( parent ) {
+        setupUi( this );
+    }
 };
 
 class Subversion_Diff : public QDialog, public Ui::Subversion_Diff
@@ -60,7 +62,18 @@
     SubversionCheckout *m_checkoutWidget;
 };
 
+class SubversionSwitchDialog : public KDialog
+{
+    Q_OBJECT
+public:
+    SubversionSwitchDialog( QWidget *parent = 0 );
+    int revisionValue() const;
+    KUrl url() const;
+private:
+    SubversionSwitch *m_switchWidget;
+};
 
+
 class SvnHelper:public KApplication {
 	Q_OBJECT
 
--- trunk/KDE/kdesdk/kioslave/svn/svnhelper/subversionswitch.ui #830335:830336
@@ -1,171 +1,87 @@
-<ui version="4.0" stdsetdef="1" >
-  <author></author>
-  <comment></comment>
-  <exportmacro></exportmacro>
-  <class>SubversionSwitch</class>
-  <widget class="QDialog" name="SubversionSwitch" >
-    <property name="geometry" >
-      <rect>
-        <x>0</x>
-        <y>0</y>
-        <width>498</width>
-        <height>133</height>
-      </rect>
-    </property>
-    <property name="sizePolicy" >
-      <sizepolicy>
-        <hsizetype>1</hsizetype>
-        <vsizetype>1</vsizetype>
-        <horstretch>0</horstretch>
-        <verstretch>0</verstretch>
-      </sizepolicy>
-    </property>
-    <property name="windowTitle" >
-      <string>Subversion Switch</string>
-    </property>
-    <property name="sizeGripEnabled" >
-      <bool>true</bool>
-    </property>
-    <layout class="QVBoxLayout" >
-      <item>
-        <layout class="QGridLayout" >
-          <property name="margin" >
-            <number>0</number>
-          </property>
-          <item row="2" column="0" >
-            <layout class="QHBoxLayout" >
-              <property name="margin" >
-                <number>0</number>
-              </property>
-              <property name="spacing" >
-                <number>6</number>
-              </property>
-              <item>
-                <widget class="QPushButton" name="buttonHelp" >
-                  <property name="text" >
-                    <string>&amp;Help</string>
-                  </property>
-                  <property name="shortcut" >
-                    <string>F1</string>
-                  </property>
-                  <property name="autoDefault" >
-                    <bool>true</bool>
-                  </property>
-                </widget>
-              </item>
-              <item>
-                <spacer name="Horizontal Spacing2" >
-                  <property name="sizeHint" >
-                    <size>
-                      <width>20</width>
-                      <height>20</height>
-                    </size>
-                  </property>
-                  <property name="sizeType" >
-                    <enum>Expanding</enum>
-                  </property>
-                  <property name="orientation" >
-                    <enum>Horizontal</enum>
-                  </property>
-                </spacer>
-              </item>
-              <item>
-                <widget class="QPushButton" name="buttonOk" >
-                  <property name="text" >
-                    <string>&amp;OK</string>
-                  </property>
-                  <property name="shortcut" >
-                    <string/>
-                  </property>
-                  <property name="autoDefault" >
-                    <bool>true</bool>
-                  </property>
-                  <property name="default" >
-                    <bool>true</bool>
-                  </property>
-                </widget>
-              </item>
-              <item>
-                <widget class="QPushButton" name="buttonCancel" >
-                  <property name="text" >
-                    <string>&amp;Cancel</string>
-                  </property>
-                  <property name="shortcut" >
-                    <string/>
-                  </property>
-                  <property name="autoDefault" >
-                    <bool>true</bool>
-                  </property>
-                </widget>
-              </item>
-            </layout>
-          </item>
-          <item row="0" column="0" >
-            <widget class="KUrlRequester" name="url" >
-              <property name="sizePolicy" >
-                <sizepolicy>
-                  <hsizetype>7</hsizetype>
-                  <vsizetype>5</vsizetype>
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                </sizepolicy>
-              </property>
-            </widget>
-          </item>
-          <item row="1" column="0" >
-            <layout class="QHBoxLayout" >
-              <property name="margin" >
-                <number>0</number>
-              </property>
-              <item>
-                <widget class="QLabel" name="textLabel1" >
-                  <property name="text" >
-                    <string>Revision (0 for HEAD) :</string>
-                  </property>
-                  <property name="wordWrap" >
-                    <bool>false</bool>
-                  </property>
-                </widget>
-              </item>
-              <item>
-                <spacer name="spacer2" >
-                  <property name="sizeHint" >
-                    <size>
-                      <width>121</width>
-                      <height>20</height>
-                    </size>
-                  </property>
-                  <property name="sizeType" >
-                    <enum>Expanding</enum>
-                  </property>
-                  <property name="orientation" >
-                    <enum>Horizontal</enum>
-                  </property>
-                </spacer>
-              </item>
-              <item>
-                <widget class="QSpinBox" name="revision" >
-                  <property name="sizePolicy" >
-                    <sizepolicy>
-                      <hsizetype>3</hsizetype>
-                      <vsizetype>0</vsizetype>
-                      <horstretch>0</horstretch>
-                      <verstretch>0</verstretch>
-                    </sizepolicy>
-                  </property>
-                </widget>
-              </item>
-            </layout>
-          </item>
-        </layout>
-      </item>
+<ui version="4.0" >
+ <class>SubversionSwitch</class>
+ <widget class="QWidget" name="SubversionSwitch" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>446</width>
+    <height>103</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout" >
+   <item>
+    <layout class="QGridLayout" >
+     <property name="margin" >
+      <number>0</number>
+     </property>
+     <item row="0" column="0" >
+      <widget class="KUrlRequester" name="url" >
+       <property name="sizePolicy" >
+        <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0" >
+      <layout class="QHBoxLayout" name="_3" >
+       <property name="margin" >
+        <number>0</number>
+       </property>
+       <item>
+        <widget class="QLabel" name="textLabel1" >
+         <property name="text" >
+          <string>Revision (0 for HEAD) :</string>
+         </property>
+         <property name="wordWrap" >
+          <bool>false</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="spacer2" >
+         <property name="orientation" >
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType" >
+          <enum>QSizePolicy::Expanding</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>121</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QSpinBox" name="revision" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
     </layout>
-  </widget>
-  <layoutdefault spacing="6" margin="11" />
-  <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
-  <includes>
-    <include location="local" >kurlrequester.h</include>
-    <include location="local" >klineedit.h</include>
-    <include location="local" >kpushbutton.h</include>
-  </includes>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KUrlRequester</class>
+   <extends>QFrame</extends>
+   <header>kurlrequester.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
 </ui>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic