Changeset 11082
- Timestamp:
- Jul 31, 2010, 11:11:05 PM (12 years ago)
- Location:
- trunk/qt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt/mainwin.cc
r11076 r11082 14 14 #include <iostream> 15 15 16 #include <QCheckBox> 17 #include <QCloseEvent> 18 #include <QDesktopServices> 19 #include <QFileDialog> 20 #include <QHBoxLayout> 21 #include <QInputDialog> 22 #include <QLabel> 23 #include <QMessageBox> 24 #include <QSignalMapper> 25 #include <QSize> 26 #include <QStyle> 27 #include <QSystemTrayIcon> 28 #include <QUrl> 16 #include <QtGui> 29 17 30 18 #include <libtransmission/transmission.h> … … 33 21 34 22 #include "about.h" 23 #include "app.h" 35 24 #include "details.h" 36 25 #include "filterbar.h" … … 104 93 myNetworkTimer( this ) 105 94 { 95 setAcceptDrops( true ); 96 106 97 QAction * sep = new QAction( this ); 107 98 sep->setSeparator( true ); … … 1230 1221 mySessionDialog->show( ); 1231 1222 } 1223 1224 /*** 1225 **** 1226 ***/ 1227 1228 void 1229 TrMainWindow :: dragEnterEvent( QDragEnterEvent * event ) 1230 { 1231 const QMimeData * mime = event->mimeData( ); 1232 1233 if( mime->hasFormat("application/x-bittorrent") 1234 || mime->text().trimmed().endsWith(".torrent", Qt::CaseInsensitive) ) 1235 event->acceptProposedAction(); 1236 } 1237 1238 void 1239 TrMainWindow :: dropEvent( QDropEvent * event ) 1240 { 1241 QString key = event->mimeData()->text().trimmed(); 1242 1243 const QUrl url( key ); 1244 if( url.scheme() == "file" ) 1245 key = QUrl::fromPercentEncoding( url.path().toUtf8( ) ); 1246 1247 dynamic_cast<MyApp*>(QApplication::instance())->addTorrent( key ); 1248 } -
trunk/qt/mainwin.h
r11072 r11082 182 182 TrMainWindow( Session&, Prefs&, TorrentModel&, bool minized ); 183 183 virtual ~TrMainWindow( ); 184 185 protected: 186 virtual void dragEnterEvent( QDragEnterEvent * ); 187 virtual void dropEvent( QDropEvent * ); 184 188 }; 185 189
Note: See TracChangeset
for help on using the changeset viewer.