OSDN Git Service

bluedevil: add success page files missed during the sync with upstream
authorIvailo Monev <xakepa10@gmail.com>
Sun, 26 Apr 2015 17:27:48 +0000 (17:27 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 26 Apr 2015 17:27:48 +0000 (17:27 +0000)
bluedevil/src/wizard/pages/success.cpp [new file with mode: 0644]
bluedevil/src/wizard/pages/success.h [new file with mode: 0644]
bluedevil/src/wizard/pages/success.ui [new file with mode: 0644]

diff --git a/bluedevil/src/wizard/pages/success.cpp b/bluedevil/src/wizard/pages/success.cpp
new file mode 100644 (file)
index 0000000..44b70fa
--- /dev/null
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * This file is part of the KDE project                                      *
+ *                                                                           *
+ * Copyright (C) 2010 Alejandro Fiestas Olivares <afiestas@kde.org>          *
+ * Copyright (C) 2010-2011 UFO Coders <info@ufocoders.com>                   *
+ * Copyright (C) 2014 David Rosca <nowrep@gmail.com>                         *
+ *                                                                           *
+ * This library is free software; you can redistribute it and/or             *
+ * modify it under the terms of the GNU Library General Public               *
+ * License as published by the Free Software Foundation; either              *
+ * version 2 of the License, or (at your option) any later version.          *
+ *                                                                           *
+ * This library is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
+ * Library General Public License for more details.                          *
+ *                                                                           *
+ * You should have received a copy of the GNU Library General Public License *
+ * along with this library; see the file COPYING.LIB.  If not, write to      *
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,      *
+ * Boston, MA 02110-1301, USA.                                               *
+ *****************************************************************************/
+
+#include "success.h"
+#include "bluewizard.h"
+
+#include <KDebug>
+#include <KLocalizedString>
+
+#include <bluedevil/bluedevildevice.h>
+
+SuccessPage::SuccessPage(BlueWizard *parent)
+    : QWizardPage(parent)
+    , m_wizard(parent)
+{
+    setupUi(this);
+
+    successIcon->setPixmap(KIcon("task-complete").pixmap(48));
+}
+
+void SuccessPage::initializePage()
+{
+    kDebug() << "Initialize Success Page";
+
+    QList<QWizard::WizardButton> list;
+    list << QWizard::Stretch;
+    list << QWizard::FinishButton;
+
+    m_wizard->setButtonLayout(list);
+
+    setFinalPage(true);
+
+    QString deviceName = m_wizard->device()->name();
+    if (deviceName.isEmpty()) {
+        successLbl->setText(i18nc("This string is shown when the wizard succeeds", "The setup of the device has succeeded"));
+    } else {
+        successLbl->setText(i18n("The setup of %1 has succeeded", deviceName));
+    }
+}
+
+int SuccessPage::nextId() const
+{
+    return -1;
+}
diff --git a/bluedevil/src/wizard/pages/success.h b/bluedevil/src/wizard/pages/success.h
new file mode 100644 (file)
index 0000000..a41f73e
--- /dev/null
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * This file is part of the KDE project                                      *
+ *                                                                           *
+ * Copyright (C) 2010 Alejandro Fiestas Olivares <afiestas@kde.org>          *
+ * Copyright (C) 2010-2011 UFO Coders <info@ufocoders.com>                   *
+ * Copyright (C) 2014 David Rosca <nowrep@gmail.com>                         *
+ *                                                                           *
+ * This library is free software; you can redistribute it and/or             *
+ * modify it under the terms of the GNU Library General Public               *
+ * License as published by the Free Software Foundation; either              *
+ * version 2 of the License, or (at your option) any later version.          *
+ *                                                                           *
+ * This library is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
+ * Library General Public License for more details.                          *
+ *                                                                           *
+ * You should have received a copy of the GNU Library General Public License *
+ * along with this library; see the file COPYING.LIB.  If not, write to      *
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,      *
+ * Boston, MA 02110-1301, USA.                                               *
+ *****************************************************************************/
+
+#ifndef SUCCESS_H
+#define SUCCESS_H
+
+#include "ui_success.h"
+#include <QWizardPage>
+
+class BlueWizard;
+
+class SuccessPage : public QWizardPage, Ui::Success
+{
+    Q_OBJECT
+
+public:
+    SuccessPage(BlueWizard *parent = 0);
+
+    virtual void initializePage();
+    virtual int nextId() const;
+
+private:
+    BlueWizard *m_wizard;
+};
+
+#endif // SUCCESS_H
diff --git a/bluedevil/src/wizard/pages/success.ui b/bluedevil/src/wizard/pages/success.ui
new file mode 100644 (file)
index 0000000..3630db3
--- /dev/null
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Success</class>
+ <widget class="QWidget" name="Success">
+  <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>
+      <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="successIcon">
+       <property name="maximumSize">
+        <size>
+         <width>48</width>
+         <height>48</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="successLbl">
+       <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>