diff --git a/config.h.cmake b/config.h.cmake index d0eb046..2fce79f 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -8,5 +8,6 @@ #cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@ // Zlibrary defines -#define BASEDIR "@SHARE_INSTALL_PREFIX@" -#define IMAGEDIR "@SHARE_INSTALL_PREFIX@/pixmaps" +#define BASEDIR "@DATA_INSTALL_DIR@" +#define IMAGEDIR "@DATA_INSTALL_DIR@/tde-ebook-reader/icons" +#define ZLBASEDIR "@ZL_SHARE_INSTALL_PREFIX@" diff --git a/reader/src/reader/Reader.cpp b/reader/src/reader/Reader.cpp index 0c15b9d..22aa527 100644 --- a/reader/src/reader/Reader.cpp +++ b/reader/src/reader/Reader.cpp @@ -85,7 +85,7 @@ Reader &Reader::Instance() { } Reader::Reader(const std::string &bookToOpen) : - ZLApplication("Reader"), + ZLApplication("tde-ebook-reader"), QuitOnCancelOption(ZLCategoryKey::CONFIG, OPTIONS, "QuitOnCancel", false), KeyScrollingDelayOption(ZLCategoryKey::CONFIG, "Scrollings", "Delay", 0, 2000, 100), LinesToScrollOption(ZLCategoryKey::CONFIG, "SmallScrolling", "LinesToScroll", 1, 20, 1), @@ -172,7 +172,7 @@ Reader::Reader(const std::string &bookToOpen) : myOpenFileHandler = new OpenFileHandler(); ZLCommunicationManager::Instance().registerHandler("openFile", myOpenFileHandler); - ZLNetworkManager::Instance().setUserAgent(std::string("Reader/") + VERSION); + //ZLNetworkManager::Instance().setUserAgent(std::string("Reader/") + VERSION); } Reader::~Reader() { diff --git a/zlibrary/core/src/ui/application-desktop/ZLTQtApplicationWindow.cpp b/zlibrary/core/src/ui/application-desktop/ZLTQtApplicationWindow.cpp index 28edab6..ee0b390 100644 --- a/zlibrary/core/src/ui/application-desktop/ZLTQtApplicationWindow.cpp +++ b/zlibrary/core/src/ui/application-desktop/ZLTQtApplicationWindow.cpp @@ -91,6 +91,7 @@ ZLTQtToolButton::ZLTQtToolButton(ZLTQtApplicationWindow &window, ZLToolbar::Abst myWindow.myPopupIdMap[&menuButtonItem] = popupData.isNull() ? (size_t)-1 : (popupData->id() - 1); setPopup(new ZLTQtPopupMenu(this)); + setPopupDelay(0); } TQString text = TQString::fromUtf8(myItem.tooltip().c_str()); setTextLabel(text); diff --git a/zlibrary/core/src/ui/application-desktop/ZLTQtPopupMenu.cpp b/zlibrary/core/src/ui/application-desktop/ZLTQtPopupMenu.cpp index e723204..1588132 100644 --- a/zlibrary/core/src/ui/application-desktop/ZLTQtPopupMenu.cpp +++ b/zlibrary/core/src/ui/application-desktop/ZLTQtPopupMenu.cpp @@ -19,13 +19,20 @@ #include "ZLTQtPopupMenu.h" +#include "tqtimer.h" + ZLTQtPopupMenu::ZLTQtPopupMenu(TQWidget *parent) : TQPopupMenu(parent) { connect(this, TQ_SIGNAL(activated(int)), this, TQ_SLOT(onActivated(int))); } void ZLTQtPopupMenu::onActivated(int itemId) { + myItemId = itemId; + TQTimer::singleShot(0, this, TQ_SLOT(doActivation()) ); +} + +void ZLTQtPopupMenu::doActivation() { if (!myPopupData.isNull()) { - myPopupData->run(myItemIdToIndex[itemId]); + myPopupData->run(myItemIdToIndex[myItemId]); } } diff --git a/zlibrary/core/src/ui/application-desktop/ZLTQtPopupMenu.h b/zlibrary/core/src/ui/application-desktop/ZLTQtPopupMenu.h index 974ed0f..1861192 100644 --- a/zlibrary/core/src/ui/application-desktop/ZLTQtPopupMenu.h +++ b/zlibrary/core/src/ui/application-desktop/ZLTQtPopupMenu.h @@ -36,10 +36,12 @@ public: private slots: void onActivated(int itemId); + void doActivation(); private: shared_ptr myPopupData; std::map myItemIdToIndex; + int myItemId; }; #endif /* __ZLTQTPOPUPMENU_H__ */