Changeset 11083
- Timestamp:
- Aug 1, 2010, 2:51:28 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/rpc-spec.txt
r11059 r11083 277 277 | isBackup | boolean | tr_tracker_stat 278 278 | lastAnnouncePeerCount | number | tr_tracker_stat 279 | lastAnnounceResult | number| tr_tracker_stat279 | lastAnnounceResult | string | tr_tracker_stat 280 280 | lastAnnounceStartTime | number | tr_tracker_stat 281 281 | lastAnnounceSucceeded | boolean | tr_tracker_stat -
trunk/qt/app.cc
r11069 r11083 16 16 17 17 #include <QDBusConnection> 18 #include <QDBusConnectionInterface> 18 19 #include <QDBusError> 19 20 #include <QDBusMessage> … … 168 169 // when the model sees a torrent for the first time, ask the session for full info on it 169 170 connect( myModel, SIGNAL(torrentsAdded(QSet<int>)), mySession, SLOT(initTorrents(QSet<int>)) ); 171 connect( myModel, SIGNAL(torrentsAdded(QSet<int>)), this, SLOT(torrentsAdded(QSet<int>)) ); 170 172 171 173 mySession->initTorrents( ); … … 246 248 247 249 void 250 MyApp :: torrentsAdded( QSet<int> torrents ) 251 { 252 myAddedTorrents += torrents; 253 std::cerr << "added count is " << myAddedTorrents.size() << std::endl; 254 } 255 256 void 248 257 MyApp :: consentGiven( ) 249 258 { … … 355 364 } 356 365 366 /*** 367 **** 368 ***/ 369 357 370 void 358 371 MyApp :: raise( ) 359 372 { 360 373 QApplication :: alert ( myWindow ); 374 } 375 376 bool 377 MyApp :: notify( const QString& title, const QString& body, int timeout_msec ) const 378 { 379 const QString dbusServiceName = "org.freedesktop.Notifications"; 380 const QString dbusInterfaceName = "org.freedesktop.Notifications"; 381 const QString dbusPath = "/org/freedesktop/Notifications"; 382 383 QDBusMessage m = QDBusMessage::createMethodCall(dbusServiceName, dbusPath, dbusInterfaceName, "Notify"); 384 QList<QVariant> args; 385 args.append( "Transmission" ); // app_name 386 args.append( 0U ); // replaces_id 387 args.append( "transmission" ); // icon 388 args.append( title ); // summary 389 args.append( body ); // body 390 args.append( QStringList( ) ); // actions - unused for plain passive popups 391 args.append( QVariantMap( ) ); // hints - unused atm 392 args.append( int32_t(-1) ); // use the default timeout period 393 m.setArguments( args ); 394 QDBusMessage replyMsg = QDBusConnection::sessionBus().call(m); 395 //std::cerr << qPrintable(replyMsg.errorName()) << std::endl; 396 //std::cerr << qPrintable(replyMsg.errorMessage()) << std::endl; 397 return (replyMsg.type() == QDBusMessage::ReplyMessage) && !replyMsg.arguments().isEmpty(); 361 398 } 362 399 … … 403 440 tr_optind = 1; 404 441 MyApp app( argc, argv ); 442 app.notify( "hello world", "this is a test" ); 405 443 return app.exec( ); 406 444 } -
trunk/qt/app.h
r11052 r11083 15 15 16 16 #include <QApplication> 17 #include <QSet> 17 18 #include <QTimer> 18 19 #include "favicon.h" … … 34 35 public: 35 36 void raise( ); 37 bool notify( const QString& title, const QString& body, int timeout_msec=-1 ) const; 36 38 37 39 public: … … 48 50 QTimer mySessionTimer; 49 51 time_t myLastFullUpdateTime; 52 QSet<int> myAddedTorrents; 50 53 51 54 private slots: … … 54 57 void refreshPref( int key ); 55 58 void refreshTorrents( ); 59 void torrentsAdded( QSet<int> ); 56 60 57 61 public slots: -
trunk/qt/torrent.cc
r11080 r11083 587 587 if( tr_bencDictFindInt( child, "lastAnnouncePeerCount", &i ) ) 588 588 trackerStat.lastAnnouncePeerCount = i; 589 if( tr_bencDictFind Int( child, "lastAnnounceResult", &i) )590 trackerStat.lastAnnounceResult = i;589 if( tr_bencDictFindStr( child, "lastAnnounceResult", &str ) ) 590 trackerStat.lastAnnounceResult = str; 591 591 if( tr_bencDictFindInt( child, "lastAnnounceStartTime", &i ) ) 592 592 trackerStat.lastAnnounceStartTime = i; -
trunk/qt/torrent.h
r11072 r11083 72 72 bool isBackup; 73 73 int lastAnnouncePeerCount; 74 intlastAnnounceResult;74 QString lastAnnounceResult; 75 75 int lastAnnounceStartTime; 76 76 bool lastAnnounceSucceeded; -
trunk/qt/tracker-delegate.cc
r11072 r11083 185 185 str += tr( "Got an error %1\"%2\"%3 %4 ago" ) 186 186 .arg( err_markup_begin ) 187 .arg( tstr)187 .arg( inf.st.lastAnnounceResult ) 188 188 .arg( err_markup_end ) 189 189 .arg( tstr );
Note: See TracChangeset
for help on using the changeset viewer.