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

List:       kde-commits
Subject:    [kaccounts-providers] /: Added connection page, does nothing atm
From:       Alex Fiestas <afiestas () kde ! org>
Date:       2015-10-15 21:01:19
Message-ID: E1ZmpeJ-0000yK-VI () scm ! kde ! org
[Download RAW message or body]

Git commit ea3674f0b9c0007132712ece35bf98aa66876a08 by Alex Fiestas.
Committed on 17/04/2012 at 15:20.
Pushed by mklapetek into branch 'master'.

Added connection page, does nothing atm

C  +12   -46   connecting.cpp [from: owncloud.cpp - 052% similarity]
C  +16   -51   connecting.h [from: owncloud.cpp - 051% similarity]
A  +93   -0    connecting.ui
M  +3    -0    owncloud.cpp

http://commits.kde.org/kaccounts-providers/ea3674f0b9c0007132712ece35bf98aa66876a08

diff --git a/owncloud.cpp b/connecting.cpp
similarity index 52%
copy from owncloud.cpp
copy to connecting.cpp
index 19841d0..e98b065 100644
--- a/owncloud.cpp
+++ b/connecting.cpp
@@ -16,60 +16,26 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA   \
                *
  *************************************************************************************/
  
+#include "connecting.h"
 #include "owncloud.h"
-#include "basicinfo.h"
+#include <KPixmapSequenceOverlayPainter>
 
-#include <klocalizedstring.h>
-#include <kpushbutton.h>
-#include <kstandardguiitem.h>
-
-OwnCloudWizard::OwnCloudWizard(QWidget* parent, Qt::WindowFlags flags): \
                QWizard(parent, flags)
-{
-    BasicInfo *basicInfo = new BasicInfo(this);
-
-    addPage(basicInfo);
-
-    setButton(QWizard::BackButton, new \
                KPushButton(KStandardGuiItem::back(KStandardGuiItem::UseRTL)));
-    setButton(QWizard::NextButton, new \
                KPushButton(KStandardGuiItem::forward(KStandardGuiItem::UseRTL)));
-    setButton(QWizard::FinishButton, new KPushButton(KStandardGuiItem::apply()));
-    setButton(QWizard::CancelButton, new KPushButton(KStandardGuiItem::cancel()));
-
-    //We do not want "Forward" as text
-    setButtonText(QWizard::NextButton, i18nc("Action to go to the next page on the \
                wizard", "Next"));
-    setButtonText(QWizard::FinishButton, i18nc("Action to finish the wizard", \
                "Finish"));
-}
-
-OwnCloudWizard::~OwnCloudWizard()
-{
-
-}
-
-void OwnCloudWizard::setUsername(const QString& username)
+Connecting::Connecting(OwnCloudWizard* parent)
+ : QWizardPage(parent)
+ , m_wizard(parent)
 {
-    m_username = username;
+    setupUi(this);
+    KPixmapSequenceOverlayPainter *painter = new \
KPixmapSequenceOverlayPainter(this); +    painter->setWidget(working);
+    painter->start();
 }
 
-void OwnCloudWizard::setPassword(const QString& password)
+Connecting::~Connecting()
 {
-    m_password = password;
-}
 
-void OwnCloudWizard::setServer(const KUrl& server)
-{
-    m_server = server;
 }
 
-const QString OwnCloudWizard::username() const
+void Connecting::initializePage()
 {
-    return m_username;
+    server->setText(m_wizard->server().host());
 }
-
-const QString OwnCloudWizard::password() const
-{
-    return m_password;
-}
-
-const KUrl OwnCloudWizard::server() const
-{
-    return m_server;
-}
\ No newline at end of file
diff --git a/owncloud.cpp b/connecting.h
similarity index 51%
copy from owncloud.cpp
copy to connecting.h
index 19841d0..ce94586 100644
--- a/owncloud.cpp
+++ b/connecting.h
@@ -16,60 +16,25 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA   \
                *
  *************************************************************************************/
  
-#include "owncloud.h"
-#include "basicinfo.h"
+#ifndef CONNECTING_H
+#define CONNECTING_H
 
-#include <klocalizedstring.h>
-#include <kpushbutton.h>
-#include <kstandardguiitem.h>
+#include "ui_connecting.h"
 
-OwnCloudWizard::OwnCloudWizard(QWidget* parent, Qt::WindowFlags flags): \
                QWizard(parent, flags)
-{
-    BasicInfo *basicInfo = new BasicInfo(this);
-
-    addPage(basicInfo);
-
-    setButton(QWizard::BackButton, new \
                KPushButton(KStandardGuiItem::back(KStandardGuiItem::UseRTL)));
-    setButton(QWizard::NextButton, new \
                KPushButton(KStandardGuiItem::forward(KStandardGuiItem::UseRTL)));
-    setButton(QWizard::FinishButton, new KPushButton(KStandardGuiItem::apply()));
-    setButton(QWizard::CancelButton, new KPushButton(KStandardGuiItem::cancel()));
-
-    //We do not want "Forward" as text
-    setButtonText(QWizard::NextButton, i18nc("Action to go to the next page on the \
                wizard", "Next"));
-    setButtonText(QWizard::FinishButton, i18nc("Action to finish the wizard", \
                "Finish"));
-}
+#include <QtGui/QWizardPage>
+#include <KJob>
 
-OwnCloudWizard::~OwnCloudWizard()
+class OwnCloudWizard;
+class Connecting : public QWizardPage, Ui::Connecting
 {
+    Q_OBJECT
+    public:
+        explicit Connecting(OwnCloudWizard *parent);
+        virtual ~Connecting();
 
-}
-
-void OwnCloudWizard::setUsername(const QString& username)
-{
-    m_username = username;
-}
-
-void OwnCloudWizard::setPassword(const QString& password)
-{
-    m_password = password;
-}
+        virtual void initializePage();
+    private:
+        OwnCloudWizard *m_wizard;
+};
 
-void OwnCloudWizard::setServer(const KUrl& server)
-{
-    m_server = server;
-}
-
-const QString OwnCloudWizard::username() const
-{
-    return m_username;
-}
-
-const QString OwnCloudWizard::password() const
-{
-    return m_password;
-}
-
-const KUrl OwnCloudWizard::server() const
-{
-    return m_server;
-}
\ No newline at end of file
+#endif //CONNECTING_H
\ No newline at end of file
diff --git a/connecting.ui b/connecting.ui
new file mode 100644
index 0000000..a480422
--- /dev/null
+++ b/connecting.ui
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Connecting</class>
+ <widget class="QWidget" name="Connecting">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QWidget" name="working" native="true">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize">
+        <size>
+         <width>22</width>
+         <height>22</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Fixed</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>10</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QLabel" name="connecting">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Connecting to:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="server">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/owncloud.cpp b/owncloud.cpp
index 19841d0..022f47e 100644
--- a/owncloud.cpp
+++ b/owncloud.cpp
@@ -18,6 +18,7 @@
 
 #include "owncloud.h"
 #include "basicinfo.h"
+#include "connecting.h"
 
 #include <klocalizedstring.h>
 #include <kpushbutton.h>
@@ -26,8 +27,10 @@
 OwnCloudWizard::OwnCloudWizard(QWidget* parent, Qt::WindowFlags flags): \
QWizard(parent, flags)  {
     BasicInfo *basicInfo = new BasicInfo(this);
+    Connecting *connecting = new Connecting(this);
 
     addPage(basicInfo);
+    addPage(connecting);
 
     setButton(QWizard::BackButton, new \
                KPushButton(KStandardGuiItem::back(KStandardGuiItem::UseRTL)));
     setButton(QWizard::NextButton, new \
KPushButton(KStandardGuiItem::forward(KStandardGuiItem::UseRTL)));


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

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