{"thread":{"id":"3045","subject":"qgit shows wrong popup","startedAt":"2006-01-11T23:21:30Z","lastAt":"2006-01-13T21:06:21Z","messageCount":3,"participants":["Pavel Roskin","Marco Costalba"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"14511","messageId":"1137021690.10975.22.camel@dv","threadId":"3045","inReplyTo":null,"subject":"qgit shows wrong popup","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-01-11T23:21:30Z","receivedAt":"2006-01-11T23:21:30Z","isPatch":false,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello, Marco!\n\nCurrent qgit has a bug that manifests itself on stgit repositories.\nSuppose I have two patches known to stgit, one is applied and the other\nis not.\n\nIf the unapplied patch is selected and I right-click on the applied\npatch below, I get a popup with \"Push patch\" disabled.  If I select the\napplied patch by the left click, then \"Pop patch\" appears in that place,\nand it's enabled.  Also, \"Make Tag\" appears in the menu.\n\nGoing from the applied patch to the unapplied one by the right click\nresults in having disabled \"Pop patch\" instead of the correct enabled\n\"Push patch\".\n\nScreenshots can be found at\nhttp://red-bean.com/proski/qgit/\n\nI found this comment in mainimpl.cpp:\n  // call an async context popup, DO NOT filter out event\n  // we append the event to main event loop queue so Qt can send\n  // currentChanged() signal to listViewLog before our popup is\npopulated\n\nI guess the code doesn't work the way the comment says.\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"14619","messageId":"43C7E645.2050702@yahoo.it","threadId":"3045","inReplyTo":"e5bfff550601120455p1b1654cx43beb684a3fd5dc7@mail.gmail.com","subject":"Re: qgit shows wrong popup","fromName":"Marco Costalba","fromEmail":"mcostalba@yahoo.it","sentAt":"2006-01-13T17:41:25Z","receivedAt":"2006-01-13T17:41:25Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"\n>>I found this comment in mainimpl.cpp:\n>>  // call an async context popup, DO NOT filter out event\n>>  // we append the event to main event loop queue so Qt can send\n>>  // currentChanged() signal to listViewLog before our popup is\n>>populated\n>>\n>>I guess the code doesn't work the way the comment says.\n>>\nHi Pavel,\n\nplease test the following an let me know if it is ok for you.\n\n@@ -1378,9 +1378,21 @@ void MainImpl::customEvent(QCustomEvent*\n  \tif (e->type() == STATS_EV) // archive loading complete\n  \t\tloadComplete(((ThreadStatsEvent*)e)->data());\n\n-\tif (e->type() == POPUP_EV) // deferred popup\n-\t\tdoContexPopup(listViewLog->currentItem());\n-\n+\tif (e->type() == POPUP_EV) { // deferred popup\n+\t\tQListViewItem* item = listViewLog->currentItem();\n+\t\tif (item) {\n+\t\t\t// if mainview is already updated pop-up\n+\t\t\t// context menu, otherwise it means dispatch()\n+\t\t\t// has not been called til now, so resend the event,\n+\t\t\t// it will be queued up after dispatch.\n+\t\t\tif (item->text(COMMIT_COL) == mainViewSha)\n+\t\t\t\tdoContexPopup(listViewLog->currentItem());\n+\t\t\telse {\n+\t\t\t\tDeferredPopupEvent* e = new DeferredPopupEvent();\n+\t\t\t\tQApplication::postEvent(this, e);\n+\t\t\t}\n+\t\t}\n+\t}\n  \tif (e->type() == POPUP_TREE_EV) // deferred tree popup\n  \t\tdoTreeContexPopup(treeView->currentItem());\n\n\n\n\t\n\n\t\n\t\t\n___________________________________ \nYahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB \nhttp://mail.yahoo.it\n"},{"id":"14634","messageId":"1137186381.2480.3.camel@dv","threadId":"3045","inReplyTo":"43C7E645.2050702@yahoo.it","subject":"Re: qgit shows wrong popup","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-01-13T21:06:21Z","receivedAt":"2006-01-13T21:06:21Z","isPatch":false,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hi, Marco!\n\nOn Fri, 2006-01-13 at 18:41 +0100, Marco Costalba wrote:\n> please test the following an let me know if it is ok for you.\n\nIt works, but not the first time.  Suppose I have two unapplied patches\nand one applied.  qgit focuses on the top unapplied patch on startup.\nRight-click on the applied patch shows disabled \"Push Patch\".  Then I\nselect the top line again, right-click on the applied patch, and I see\nenabled \"Pop Patch\".\n\n-- \nRegards,\nPavel Roskin\n"}]}