Subversion Repositories svn1-original

Rev

Rev 300 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 300 Rev 301
Line 18... Line 18...
18
 
18
 
19
#include <QtGui>
19
#include <QtGui>
20
#include <QLineEdit>
20
#include <QLineEdit>
21
#include <QLabel>
21
#include <QLabel>
22
#include "qmhttppath.h"
22
#include "qmhttppath.h"
-
 
23
#include "consts.h"
-
 
24
#include "structs.h"
-
 
25
#include "proto.h"
23
 
26
 
24
#include <QtGui>
27
#include <QtGui>
25
#include <QtNetwork>
28
#include <QtNetwork>
26
 
29
 
27
#include "Qmhttppath.h"
30
#include "Qmhttppath.h"
Line 42... Line 45...
42
 
45
 
43
Qmhttppath::Qmhttppath(QWidget *parent)
46
Qmhttppath::Qmhttppath(QWidget *parent)
44
    : QDialog(parent)
47
    : QDialog(parent)
45
{
48
{
46
    this->resize(500,40);
49
    this->resize(500,40);
47
    urlLineEdit = new QLineEdit("http://www.mccays.com.au/theevent/Essential Content/current_entries.htm");
50
    urlLineEdit = new QLineEdit(config.webUrl);
48
 
51
 
49
    urlLabel = new QLabel(tr("&URL:"));
52
    urlLabel = new QLabel(tr("&URL:"));
50
    urlLabel->setBuddy(urlLineEdit);
53
    urlLabel->setBuddy(urlLineEdit);
51
    statusLabel = new QLabel(tr("Please enter the URL of a file you want to import."));
54
    statusLabel = new QLabel(tr("Please enter the URL of a file you want to import."));
52
 
55
 
53
    downloadButton = new QPushButton(tr("Import"));
56
    downloadButton = new QPushButton(tr("Import"));
54
    downloadButton->setDefault(true);
57
    downloadButton->setDefault(true);
55
    quitButton = new QPushButton(tr("Quit"));
58
    quitButton = new QPushButton(tr("Cancel"));
56
    quitButton->setAutoDefault(false);
59
    quitButton->setAutoDefault(false);
57
 
60
 
58
    buttonBox = new QDialogButtonBox;
61
    buttonBox = new QDialogButtonBox;
59
    buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole);
62
    buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole);
60
    buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
63
    buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
Line 100... Line 103...
100
}
103
}
101
 
104
 
102
void Qmhttppath::downloadFile()
105
void Qmhttppath::downloadFile()
103
{
106
{
104
    url = urlLineEdit->text();
107
    url = urlLineEdit->text();
-
 
108
    strncpy(config.webUrl, (const char *)(url.toString().toAscii()), sizeof(config.webUrl) );
-
 
109
    config.write_config();
105
 
110
 
106
    QFileInfo fileInfo(url.path());
111
    QFileInfo fileInfo(url.path());
107
    QString fileName = fileInfo.fileName();
112
    QString fileName = fileInfo.fileName();
108
    if (fileName.isEmpty())
113
    if (fileName.isEmpty())
109
        fileName = "index.html";
114
        fileName = "index.html";