[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Fri Apr 15 17:23:17 CEST 2005


CVS commit by staikos: 

circumvent the KIO "storm" by adding a "Connect" button for remote URLs.
I won't port this to the vector dialog until I receive feedback.  One of the
nice things about this approach is that autocompletion works.  On the other
hand, it requires extra user interaction.


  M +29 -0     datawizard.ui   1.74
  M +28 -3     datawizard.ui.h   1.136


--- kdeextragear-2/kst/kst/datawizard.ui  #1.73:1.74
@@ -129,4 +129,23 @@
                 <widget class="QPushButton">
                     <property name="name">
+                        <cstring>_testURL</cstring>
+                    </property>
+                    <property name="hidden">
+                        <bool>true</bool>
+                    </property>
+                    <property name="text">
+                        <string>Connec&amp;t</string>
+                    </property>
+                    <property name="sizePolicy">
+                        <sizepolicy>
+                            <hsizetype>5</hsizetype>
+                            <vsizetype>5</vsizetype>
+                            <horstretch>0</horstretch>
+                            <verstretch>0</verstretch>
+                        </sizepolicy>
+                    </property>
+                </widget>
+                <widget class="QPushButton">
+                    <property name="name">
                         <cstring>_configureSource</cstring>
                     </property>
@@ -1238,4 +1257,10 @@
     </connection>
     <connection>
+        <sender>_testURL</sender>
+        <signal>clicked()</signal>
+        <receiver>DataWizard</receiver>
+        <slot>testURL()</slot>
+    </connection>
+    <connection>
         <sender>_plotColumns</sender>
         <signal>valueChanged(int)</signal>
@@ -1246,4 +1271,6 @@
 <tabstops>
     <tabstop>_url</tabstop>
+    <tabstop>_testURL</tabstop>
+    <tabstop>_configureSource</tabstop>
     <tabstop>_vectorReduction</tabstop>
     <tabstop>_vectorSearch</tabstop>
@@ -1318,4 +1345,5 @@
     <variable access="private">static const QString&amp; defaultTag;</variable>
     <variable access="private">QString _file;</variable>
+    <variable access="private">bool _inTest;</variable>
     <variable access="private">QGuardedPtr&lt;QWidget&gt; _configWidget;</variable>
 </variables>
@@ -1344,4 +1372,5 @@
     <slot access="private">plotColsChanged()</slot>
     <slot access="private">markSourceAndSave()</slot>
+    <slot access="private">testURL()</slot>
 </slots>
 <functions>

--- kdeextragear-2/kst/kst/datawizard.ui.h  #1.135:1.136
@@ -12,4 +12,5 @@ void DataWizard::init()
 {
     _configWidget = 0L;
+    _inTest = false;
     KST::vectorDefaults.sync();
     QString default_source = KST::vectorDefaults.dataSource();
@@ -78,5 +81,5 @@ bool DataWizard::yVectorsOk()
 
 
-void DataWizard::xChanged( const QString & txt )
+void DataWizard::xChanged(const QString& txt)
 {
     bool found = false;
@@ -93,5 +96,13 @@ void DataWizard::xChanged( const QString
 
 
-void DataWizard::sourceChanged( const QString &txt )
+void DataWizard::testURL()
+{
+    _inTest = true;
+    sourceChanged(_url->url());
+    _inTest = false;
+}
+
+
+void DataWizard::sourceChanged(const QString& txt)
 {
     delete _configWidget;
@@ -107,4 +118,15 @@ void DataWizard::sourceChanged( const QS
         }
 
+        if (!_inTest && !url.isLocalFile() && url.protocol() != "file" && !url.protocol().isEmpty()) {
+            setNextEnabled(_pageDataSource, false);
+            _fileType->setText(QString::null);
+            _testURL->show();
+            return;
+        }
+
+        if (!_inTest) {
+            _testURL->hide();
+        }
+
         if (!url.isValid()) {
             setNextEnabled(_pageDataSource, false);
@@ -113,5 +135,5 @@ void DataWizard::sourceChanged( const QS
         }
 
-        QString file = url.path();
+        QString file = txt;
         
         KstDataSourcePtr ds = *KST::dataSourceList.findReusableFileName(file);
@@ -183,4 +205,7 @@ void DataWizard::sourceChanged( const QS
     setNextEnabled(_pageVectors, xVectorOk() && yVectorsOk());
     setNextEnabled(_pageDataSource, true);
+    if (_inTest) {
+        _testURL->hide();
+    }
 }
 




More information about the Kst mailing list