Commit 4e6d5f24 authored by mbriand's avatar mbriand

Simplification de la connexion

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