Commit 4e6d5f24 authored by mbriand's avatar mbriand

Simplification de la connexion

parent abe0aa6c
/*
UBPT Transfert 2
Copyright (C) 2005 Julien Etelain. Tous droits réservés.. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Copyright (C) 2005 Julien Etelain. Tous droits réservés.. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef CONNECTDIALOG_H
......@@ -26,13 +26,12 @@ public:
public slots:
void on_okButton_clicked();
void on_cancelButton_clicked();
void connectCurrent(int index=0);
private:
Ui::connectDialog ui;
UbptSession *session;
int connectToUBPT();
};
#endif
\ No newline at end of file
#endif
......
......@@ -4,7 +4,7 @@
<context>
<name>MainWindow</name>
<message>
<location filename="../src/qt/mainwindow.cpp" line="+330"/>
<location filename="../src/qt/mainwindow.cpp" line="+331"/>
<source>Connected to UBPT</source>
<translation>Connecté à UBPT</translation>
</message>
......@@ -388,7 +388,7 @@
<translation>Ajout de photos</translation>
</message>
<message>
<location filename="../src/qt/adddialog.cpp" line="+153"/>
<location filename="../src/qt/adddialog.cpp" line="+154"/>
<source>Select a file</source>
<translation>Selectionner un fichier</translation>
</message>
......@@ -411,12 +411,12 @@
<context>
<name>connectDialog</name>
<message>
<location filename="../src/ui/connect.ui" line="+120"/>
<location filename="../src/ui/connect.ui" line="+61"/>
<source>Password</source>
<translation>Mot de passe</translation>
</message>
<message>
<location line="+67"/>
<location line="+63"/>
<source>Waiting...</source>
<translation>En attente...</translation>
</message>
......@@ -431,8 +431,8 @@
<translation>Annuler</translation>
</message>
<message>
<location filename="../src/qt/connectdialog.cpp" line="+62"/>
<location line="+57"/>
<location filename="../src/qt/connectdialog.cpp" line="+54"/>
<location line="+56"/>
<source>Unable to connect to server.</source>
<translation>impossible de se connecter.</translation>
</message>
......@@ -462,28 +462,28 @@
<translation>Connecté</translation>
</message>
<message>
<location filename="../src/ui/connect.ui" line="-225"/>
<location filename="../src/ui/connect.ui" line="-163"/>
<source>Connection</source>
<translation>Connexion</translation>
</message>
<message>
<location line="+94"/>
<location line="+36"/>
<source>Email adress</source>
<translation>Adresse email</translation>
</message>
<message>
<location filename="../src/qt/connectdialog.cpp" line="-107"/>
<location filename="../src/qt/connectdialog.cpp" line="-106"/>
<source>Connecting to server...</source>
<translation>Connexion au serveur...</translation>
</message>
<message>
<location line="+57"/>
<location line="+56"/>
<source>Opening session...</source>
<translation>Ouvre la session...</translation>
</message>
<message>
<location line="-46"/>
<location line="+59"/>
<location line="-45"/>
<location line="+58"/>
<location line="+12"/>
<location line="+5"/>
<location line="+5"/>
......@@ -492,27 +492,7 @@
<translation>Erreur %1</translation>
</message>
<message>
<location filename="../src/ui/connect.ui" line="-63"/>
<source>Server :</source>
<translation>Serveur :</translation>
</message>
<message>
<location line="+16"/>
<source>AE UTBM</source>
<translation>AE UTBM</translation>
</message>
<message>
<location line="+8"/>
<source>ok</source>
<translation>ok</translation>
</message>
<message>
<location line="+7"/>
<source>+</source>
<translation>+</translation>
</message>
<message>
<location filename="../src/qt/connectdialog.cpp" line="-93"/>
<location line="-92"/>
<source>This server requires you to update this software.</source>
<translation>Ce serveur nécessite une mise à jour de ce logiciel.</translation>
</message>
......
......@@ -412,7 +412,6 @@ int UbptSession::FetchLicences ( )
QDomDocument doc("UBPTExchange");
std::cout << qPrintable(QString::fromUtf8(chunk.memory)) << std::endl;
if (doc.setContent(QString::fromUtf8(chunk.memory))) {
QDomElement root = doc.documentElement();
......
......@@ -33,18 +33,9 @@ connectDialog::connectDialog(UbptSession *targetSession ,QWidget *parent)
ui.setupUi(this);
session = targetSession;
connect(ui.serverToolButton, SIGNAL(clicked()), this, SLOT(connectCurrent()));
connect(ui.serverComboBox, SIGNAL(activated(int)), this, SLOT(connectCurrent(int)));
connectToServer("https://ae.utbm.fr/sas2/autoup.php");
}
void connectDialog::connectCurrent( int index )
{
Q_UNUSED(index);
connectToServer("https://ae.utbm.fr/sas2/autoup.php");
}
void connectDialog::connectToServer( QString Url ) {
......@@ -69,7 +60,7 @@ void connectDialog::connectToServer( QString Url ) {
enableMode(1);
return;
}
ui.connectProgress->setValue(100);
ui.connectProgress->setValue(20);
ui.connectInfo->setText(tr("Connected to %1 - %2").arg(session->Name).arg(session->Url));
ui.userDomainCombo->clear();
......@@ -83,7 +74,6 @@ void connectDialog::connectToServer( QString Url ) {
void connectDialog::enableMode( int mode ) {
ui.serverComboBox->setEnabled( mode != 0 );
ui.infoGroupBox->setEnabled( mode == 0 );
ui.userGroupBox->setEnabled( mode == 2 );
ui.okButton->setEnabled( mode == 2 );
......@@ -109,7 +99,7 @@ int connectDialog::connectToUBPT()
enableMode(0);
ui.connectProgress->setValue(25);
ui.connectProgress->setValue(40);
ui.connectInfo->setText(tr("Opening session..."));
repaint();
QCoreApplication::processEvents();
......@@ -129,7 +119,7 @@ int connectDialog::connectToUBPT()
return 0;
}
ui.connectProgress->setValue(50);
ui.connectProgress->setValue(60);
ui.connectInfo->setText(tr("Loading groups, clubs and licences..."));
repaint();
QCoreApplication::processEvents();
......@@ -149,7 +139,7 @@ int connectDialog::connectToUBPT()
enableMode(2);
return 0;
}
ui.connectProgress->setValue(75);
ui.connectProgress->setValue(80);
ui.connectInfo->setText(tr("Loading categories..."));
repaint();
QCoreApplication::processEvents();
......
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author>Julien Etelain</author>
<comment></comment>
<exportmacro></exportmacro>
<class>connectDialog</class>
<widget class="QDialog" name="connectDialog" >
<property name="geometry" >
<widget class="QDialog" name="connectDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>487</width>
<height>234</height>
<height>237</height>
</rect>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>Connection</string>
</property>
<property name="sizeGripEnabled" >
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>8</number>
</property>
<property name="spacing" >
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>8</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Server :</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="serverComboBox" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text" >
<string>AE UTBM</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QToolButton" name="serverToolButton" >
<property name="text" >
<string>ok</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="addServerToolButton" >
<property name="text" >
<string>+</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="userGroupBox" >
<property name="enabled" >
<widget class="QGroupBox" name="userGroupBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>5</vsizetype>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<property name="title">
<string/>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<layout class="QGridLayout">
<property name="margin">
<number>8</number>
</property>
<property name="spacing" >
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="label_4_2" >
<property name="text" >
<item row="0" column="0">
<widget class="QLabel" name="label_4_2">
<property name="text">
<string>Email adress</string>
</property>
<property name="buddy" >
<property name="buddy">
<cstring>userNameLine</cstring>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2_2_2" >
<property name="text" >
<item row="1" column="0">
<widget class="QLabel" name="label_2_2_2">
<property name="text">
<string>Password</string>
</property>
<property name="buddy" >
<property name="buddy">
<cstring>passWordLine</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="userNameLine" />
<item row="0" column="1">
<widget class="QLineEdit" name="userNameLine"/>
</item>
<item row="0" column="2" >
<widget class="QComboBox" name="userDomainCombo" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<item row="0" column="2">
<widget class="QComboBox" name="userDomainCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="currentIndex" >
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2" >
<widget class="QLineEdit" name="passWordLine" >
<property name="echoMode" >
<item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="passWordLine">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
......@@ -159,44 +98,42 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="infoGroupBox" >
<property name="enabled" >
<widget class="QGroupBox" name="infoGroupBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>5</vsizetype>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<property name="title">
<string/>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>8</number>
</property>
<property name="spacing" >
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>8</number>
</property>
<item>
<widget class="QLabel" name="connectInfo" >
<property name="text" >
<widget class="QLabel" name="connectInfo">
<property name="text">
<string>Waiting...</string>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="connectProgress" >
<property name="value" >
<widget class="QProgressBar" name="connectProgress">
<property name="value">
<number>0</number>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<property name="textVisible" >
<property name="textVisible">
<bool>true</bool>
</property>
</widget>
......@@ -205,19 +142,19 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>131</width>
<height>31</height>
......@@ -226,18 +163,18 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="okButton" >
<property name="enabled" >
<widget class="QPushButton" name="okButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text" >
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
......@@ -246,8 +183,7 @@
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<layoutdefault spacing="6" margin="11"/>
<tabstops>
<tabstop>okButton</tabstop>
<tabstop>cancelButton</tabstop>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment