[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [gluon/creator-distributionsupport-shreya] creator/plugins/docks: Added an Options page to Distribut
From: Shreya Pandit <shreya () shreyapandit ! com>
Date: 2012-08-13 14:05:55
Message-ID: 20120813140555.6238BA60A6 () git ! kde ! org
[Download RAW message or body]
Git commit 1a7cf8387a1960e83b8d3ef1414eb8107361f001 by Shreya Pandit.
Committed on 13/08/2012 at 16:05.
Pushed by pandit into branch 'creator-distributionsupport-shreya'.
Added an Options page to Distribution docker,for post login work.
M +1 -1 creator/plugins/docks/distributiondock/CMakeLists.txt
M +36 -7 creator/plugins/docks/distributiondock/distributiondock.cpp
M +5 -1 creator/plugins/docks/distributiondock/distributiondock.h
M +155 -6 creator/plugins/docks/distributiondock/distributiondock.ui
M +4 -4 creator/plugins/docks/propertiesdock/propertywidgetitems/qfontpropertywidgetitem.cpp
http://commits.kde.org/gluon/1a7cf8387a1960e83b8d3ef1414eb8107361f001
diff --git a/creator/plugins/docks/distributiondock/CMakeLists.txt \
b/creator/plugins/docks/distributiondock/CMakeLists.txt index 6852a5b..080ee9c 100644
--- a/creator/plugins/docks/distributiondock/CMakeLists.txt
+++ b/creator/plugins/docks/distributiondock/CMakeLists.txt
@@ -16,7 +16,7 @@ include_directories(
${GLUON_PLAYER_INCLUDE_DIRS}
)
-target_link_libraries(gluon_creator_dockplugin_distributiondock \
${GLUON_CREATOR_LIBS} ${GLUON_PLAYER_LIBS}) \
+target_link_libraries(gluon_creator_dockplugin_distributiondock \
${GLUON_CREATOR_LIBS} ${GLUON_PLAYER_LIBS} ${QT_QTWEBKIT_LIBRARY})
install(TARGETS gluon_creator_dockplugin_distributiondock DESTINATION \
${PLUGIN_INSTALL_DIR}) install(FILES \
gluon_creator_dockplugin_distributiondock.desktop DESTINATION \
${SERVICES_INSTALL_DIR})
diff --git a/creator/plugins/docks/distributiondock/distributiondock.cpp \
b/creator/plugins/docks/distributiondock/distributiondock.cpp index 69134f4..2f010d5 \
100644
--- a/creator/plugins/docks/distributiondock/distributiondock.cpp
+++ b/creator/plugins/docks/distributiondock/distributiondock.cpp
@@ -1,6 +1,7 @@
/******************************************************************************
* This file is part of the Gluon Development Platform
* Copyright (c) 2011 Shantanu Tushar <shaan7in@gmail.com>
+ * Copyright (c) 2012 Shreya Pandit <shreya@shreyapandit.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -33,7 +34,8 @@
#include <player/lib/archive/archiver.h>
#include <KDE/KLocalizedString>
-
+#include <QWebView>
+#include <QDebug>
#include <QtGui/QPushButton>
#include <QtCore/QStateMachine>
#include <QtCore/QHistoryState>
@@ -58,7 +60,8 @@ class DistributionDock::DistributionDockPrivate
QState* loggedOutState;
QState* loggingInState;
- QState* loggedInState;
+ QState* optionState;
+ QState* loggedInState;
QState* fetchingState;
QState* editingState;
QState* createState;
@@ -223,15 +226,22 @@ void DistributionDock::initEditGameProvider()
connect( d->editGameJob, SIGNAL(failed()), SLOT(editGameFailed()) );
d->editGameJob->start();
}
+void DistributionDock::registerOnline()
+{
+ QWebView *test = new QWebView();
+ test->load(QUrl("http://test.gamingfreedom.org/usermanager/new.php"));
+ test->show();
+}
void DistributionDock::initGuiStates()
{
d->loggedOutState = new QState();
d->loggingInState = new QState();
d->loggedInState = new QState();
+ d->optionState = new QState( d->loggedInState );
d->fetchingState = new QState( d->loggedInState );
- d->editingState = new QState( d->loggedInState );
- d->loggedInState->setInitialState( d->fetchingState );
+ d->editingState = new QState( d->loggedInState);
+ d->loggedInState->setInitialState( d->optionState );
d->createState = new QState( d->editingState );
d->updateState = new QState( d->editingState );
d->editingState->setInitialState( d->createState );
@@ -244,6 +254,7 @@ void DistributionDock::initGuiStates()
d->machine.addState( d->loggedOutState );
d->machine.addState( d->loggingInState );
d->machine.addState( d->loggedInState );
+ d->machine.addState(d->optionState);
d->machine.addState( d->fetchingState );
d->machine.addState( d->editingState );
d->machine.addState( d->createState );
@@ -260,13 +271,19 @@ void DistributionDock::initGuiStates()
d->loggingInState->assignProperty( d->ui.loginButton, "text", i18n( "Logging In" \
) );
d->loggingInState->assignProperty( d->ui.loginPage, "enabled", false );
- d->loggedInState->assignProperty( d->ui.stackedWidget, "currentIndex", \
d->ui.stackedWidget->indexOf( d->ui.gamePage ) ); + \
d->loggedInState->assignProperty( d->ui.stackedWidget, "currentIndex", \
d->ui.stackedWidget->indexOf( d->ui.welcomePage ) );
- d->fetchingState->assignProperty( d->ui.basicGroupBox, "enabled", false );
- d->fetchingState->assignProperty( d->ui.detailsGroupBox, "enabled", false );
+ d->optionState->assignProperty( d->ui.loginChanged, "enabled", true );
+ d->optionState->assignProperty( d->ui.changeDetails, "enabled", true );
+ d->optionState->addTransition(d->ui.loginChanged, SIGNAL(clicked()), \
d->loggedOutState); + d->optionState->addTransition(d->ui.changeDetails, \
SIGNAL(clicked()), d->fetchingState);
d->editingState->assignProperty( d->ui.gamePage, "enabled", true );
+ d->fetchingState->assignProperty( d->ui.detailsGroupBox, "enabled", false );
+ d->fetchingState->assignProperty( d->ui.basicGroupBox, "enabled", false );
+ d->fetchingState->assignProperty( d->ui.detailsGroupBox, "enabled", false );
+
d->createState->assignProperty( d->ui.basicGroupBox, "enabled", true );
d->createState->assignProperty( d->ui.detailsGroupBox, "enabled", false );
d->createState->assignProperty( d->ui.createUpdateButton, "text", i18n( "Create" \
) ); @@ -290,12 +307,24 @@ void DistributionDock::initGuiStates()
d->uploadingState->addTransition( this, SIGNAL(gameUploadFinished()), \
d->uploadFinishedState );
connect( d->loggingInState, SIGNAL(entered()), this, SLOT(doLogin()) );
+ connect( d->optionState, SIGNAL(entered()), this, SLOT(setLoginName()));
connect( d->fetchingState, SIGNAL(entered()), this, \
SLOT(updateUiFromGameProject()) ); + connect( d->fetchingState, SIGNAL(entered()), \
this, SLOT(onFetch()));
connect( d->uploadingState, SIGNAL(entered()), this, SLOT(createOrUpdateGame()) \
);
connect( d->updateState, SIGNAL(entered()), SLOT(initEditGameProvider()) );
d->machine.start();
}
+void DistributionDock::onFetch()
+{
+ d->ui.stackedWidget->setCurrentIndex( d->ui.stackedWidget->indexOf( \
d->ui.gamePage )); + d->fetchingState->addTransition(d->editingState);
+}
+
+void DistributionDock::setLoginName()
+{
+ d->ui.loginName->setText(d->ui.usernameEdit->text());
+}
void DistributionDock::gameDetailsFetched( )
{
diff --git a/creator/plugins/docks/distributiondock/distributiondock.h \
b/creator/plugins/docks/distributiondock/distributiondock.h index 53ef130..07f5ed2 \
100644
--- a/creator/plugins/docks/distributiondock/distributiondock.h
+++ b/creator/plugins/docks/distributiondock/distributiondock.h
@@ -1,6 +1,7 @@
/******************************************************************************
* This file is part of the Gluon Development Platform
* Copyright (c) 2011 Shantanu Tushar <shaan7in@gmail.com>
+ * Copyright (c) 2012 Shreya Pandit <shreya@shreyapandit.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -58,8 +59,11 @@ namespace GluonCreator
void gameDetailsFetched();
void updateLicenses();
void licensesFetched();
- QString createArchive( );
+ void setLoginName();
+ void onFetch();
+ QString createArchive( );
void uploadGameArchive();
+ void registerOnline();
Q_SIGNALS:
void switchToCreateMode();
diff --git a/creator/plugins/docks/distributiondock/distributiondock.ui \
b/creator/plugins/docks/distributiondock/distributiondock.ui index 1d6c748..c6c22df \
100644
--- a/creator/plugins/docks/distributiondock/distributiondock.ui
+++ b/creator/plugins/docks/distributiondock/distributiondock.ui
@@ -2,12 +2,15 @@
<ui version="4.0">
<class>DistributionDock</class>
<widget class="QWidget" name="DistributionDock">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>362</width>
- <height>578</height>
+ <width>445</width>
+ <height>400</height>
</rect>
</property>
<property name="windowTitle">
@@ -17,11 +20,39 @@
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
- <number>0</number>
+ <number>2</number>
</property>
<widget class="QWidget" name="loginPage">
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
+ <widget class="QLabel" name="label_12">
+ <property name="text">
+ <string> If you have account on gamingfreedom.org, you are half way \
through already, else you can create one at the click of a button here. Once \
registered and logged in, you will have option to upload your new game, if it's your \
first time , or change existing game details / do version control in your game +
+</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
@@ -68,6 +99,16 @@
</widget>
</item>
<item>
+ <widget class="QCommandLinkButton" name="registerButton">
+ <property name="text">
+ <string>Register on gamingfreedom.org</string>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -75,7 +116,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
- <height>470</height>
+ <height>40</height>
</size>
</property>
</spacer>
@@ -94,8 +135,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>340</width>
- <height>556</height>
+ <width>305</width>
+ <height>465</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@@ -248,6 +289,114 @@
</item>
</layout>
</widget>
+ <widget class="QWidget" name="welcomePage">
+ <widget class="QPushButton" name="loginChanged">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>50</y>
+ <width>91</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Change</string>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="versionControl">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>80</y>
+ <width>131</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Upload Newer Version</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="checkHistory">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>110</y>
+ <width>131</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Check Revision History</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="uploadNew">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>140</y>
+ <width>111</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Upload a new game</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="changeDetails">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>170</y>
+ <width>121</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Change Game Details</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QWidget" name="horizontalLayoutWidget">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>211</width>
+ <height>31</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <item>
+ <widget class="QLabel" name="label_13">
+ <property name="text">
+ <string>You are logged in as </string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="loginName">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
</widget>
</item>
</layout>
diff --git a/creator/plugins/docks/propertiesdock/propertywidgetitems/qfontpropertywidgetitem.cpp \
b/creator/plugins/docks/propertiesdock/propertywidgetitems/qfontpropertywidgetitem.cpp
index cbaf3e6..bf0926a 100644
--- a/creator/plugins/docks/propertiesdock/propertywidgetitems/qfontpropertywidgetitem.cpp
+++ b/creator/plugins/docks/propertiesdock/propertywidgetitems/qfontpropertywidgetitem.cpp
@@ -60,10 +60,10 @@ QFontPropertyWidgetItem::instantiate()
void
QFontPropertyWidgetItem::setEditValue( const QVariant& value )
{
- theFontReq->setFont(value);
- QFont font = qobject_cast<QFont>(value);
- if (font)
- theFontReq->setFont(font);
+
+// QFont font = qobject_cast<QFont>(value.toString());
+ // if (font)
+ //.. theFontReq->setFont(font);
editWidget()->setProperty( "font", value );
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic