aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Output/qtmultimedia/settingsdialog.h
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2020-08-12 12:00:24 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2020-08-12 12:00:24 +0000
commit6f301f5880f7efce76ed46e7b502830642b87370 (patch)
tree6e385165d05a0637334bea6e639b21a3c9a696dd /src/plugins/Output/qtmultimedia/settingsdialog.h
parent9ed06405eb90a646e831755939d0b9e3a4d2921d (diff)
downloadqmmp-6f301f5880f7efce76ed46e7b502830642b87370.tar.gz
qmmp-6f301f5880f7efce76ed46e7b502830642b87370.tar.bz2
qmmp-6f301f5880f7efce76ed46e7b502830642b87370.zip
coding style fixes
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9469 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Output/qtmultimedia/settingsdialog.h')
0 files changed, 0 insertions, 0 deletions
286bb06f40f77e0466fa29b179ee0718a'>4d1e1bf28
5ab0f82f0
0102019be

5ab0f82f0

0102019be

11b7655bb
ae75e5707
0102019be

4d1e1bf28
0ffa05b53
68bb7c962

4d1e1bf28








5ab0f82f0


0102019be


ae75e5707
0102019be

5ab0f82f0




0102019be
5ab0f82f0



5ab0f82f0





0102019be
5ab0f82f0

0853e9b69
5ab0f82f0
0102019be

0853e9b69

d87fcd42c

0853e9b69


4d1e1bf28




11b7655bb
0853e9b69

33f5fbf18
0853e9b69
33f5fbf18



4d1e1bf28
33f5fbf18
4d1e1bf28


41b4eec3f
33f5fbf18
d87fcd42c


41b4eec3f
4d1e1bf28
41b4eec3f

5ab0f82f0
4d1e1bf28
5ab0f82f0





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
                                                                            
                                                                            

















                                                                             

                    



                                

                      

                                  
                                 
                              
                      
                         
 

                       

                                                                                    

                                       
                                            
                                                                 

                                                                   
                                             
                                

                                                








                                                                                               


                             


                                         
                                                                 

                                                      




                                                               
                  



                                            





                            
                                              

                                               
                                                           
                                 

                               

                                    

                                      


                                                                            




                                                                                                         
                                             

                       
         
                                                         



                      
                                                     
 


                                                                         
                                                   
     


                                                                        
         
                                                             

                              
     
                         





                                               
/***************************************************************************
 *   Copyright (C) 2006-2010 by Ilya Kotov                                 *
 *   forkotov02@hotmail.ru                                                 *
 *                                                                         *
 *   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.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#include <QSettings>
#include <QDir>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkProxy>
#include <QUrl>
#include <QMessageBox>
#include <qmmpui/playlistparser.h>
#include <qmmpui/playlistformat.h>
#include <qmmpui/playlistmodel.h>
#include <qmmp/qmmpsettings.h>
#include <qmmp/qmmp.h>
#include "addurldialog.h"

#define HISTORY_SIZE 10

AddUrlDialog::AddUrlDialog( QWidget * parent, Qt::WindowFlags f) : QDialog(parent,f)
{
    setupUi(this);
    setAttribute(Qt::WA_DeleteOnClose);
    setAttribute(Qt::WA_QuitOnClose, false);
    QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
    m_history = settings.value("URLDialog/history").toStringList();
    urlComboBox->addItems(m_history);
    m_http = new QNetworkAccessManager(this);
    //load global proxy settings
    QmmpSettings *gs = QmmpSettings::instance();
    if (gs->isProxyEnabled())
    {
        QNetworkProxy proxy(QNetworkProxy::HttpProxy, gs->proxy().host(),  gs->proxy().port());
        if(gs->useProxyAuth())
        {
            proxy.setUser(gs->proxy().userName());
            proxy.setPassword(gs->proxy().password());
        }
        m_http->setProxy(proxy);
    }
}

AddUrlDialog::~AddUrlDialog()
{
    if ( m_history.size() > HISTORY_SIZE)
        m_history.removeLast();
    QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
    settings.setValue("URLDialog/history", m_history);
}

QPointer<AddUrlDialog> AddUrlDialog::instance = 0;

void AddUrlDialog::popup(QWidget* parent,PlayListModel* model )
{
    if (!instance)
    {
        instance = new AddUrlDialog(parent);
        instance->setModel(model);
    }
    instance->show();
    instance->raise();
}

void AddUrlDialog::accept( )
{
    if (!urlComboBox->currentText().isEmpty())
    {
        QString s = urlComboBox->currentText();
        if (!s.startsWith("http://") && !s.contains("://"))