diff -Nru bmdc-0.0.1/BMDC-Changelog-bzr.txt bmdc-0.0.1/BMDC-Changelog-bzr.txt --- bmdc-0.0.1/BMDC-Changelog-bzr.txt 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/BMDC-Changelog-bzr.txt 2012-11-17 17:28:24.000000000 +0000 @@ -636,6 +636,14 @@ Removed FastAloc class ( for speedup) Add IP Tag to pm too -----r181 -Use Font Chooser - +Use Font Chooser +----r183 +Fix Emot Fav Combobox +Some Fixies +----r184 +Callback to IP's PM's menu +Redone Per-Fav Hub emoticons +----r185 +Some fixes around deprecated functions +Some Fixies around emoticons (mainly on PM) diff -Nru bmdc-0.0.1/dcpp/ConnectionManager.cpp bmdc-0.0.1/dcpp/ConnectionManager.cpp --- bmdc-0.0.1/dcpp/ConnectionManager.cpp 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/dcpp/ConnectionManager.cpp 2012-11-17 17:28:24.000000000 +0000 @@ -417,7 +417,7 @@ } void ConnectionManager::on(AdcCommand::STA, UserConnection* uc, const AdcCommand& cmd) noexcept { - dcdebug("Calllllllllll\n\n\n"); + /*dcdebug("Calllllllllll\n\n\n"); string ref; if(!cmd.getParam("RF", 1, ref)) return; @@ -430,7 +430,7 @@ dcdebug("flip-flop-falp"); cmd.getParam("RF", 1, ref); ou->getIdentity().set("RF", move(ref)); - CMgr->fire(ClientManagerListener::UserUpdated(), dynamic_cast(*ou)); + CMgr->fire(ClientManagerListener::UserUpdated(), dynamic_cast(*ou)); */ } void ConnectionManager::on(UserConnectionListener::Connected, UserConnection* aSource) noexcept { diff -Nru bmdc-0.0.1/dcpp/CryptoManager.cpp bmdc-0.0.1/dcpp/CryptoManager.cpp --- bmdc-0.0.1/dcpp/CryptoManager.cpp 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/dcpp/CryptoManager.cpp 2012-11-17 17:28:24.000000000 +0000 @@ -282,16 +282,6 @@ if(!x509) { return false; } -/* - X509* tmpx509 = NULL; - PEM_read_X509(f, &tmpx509, NULL, NULL); - fclose(f); - - if(!tmpx509) { - return false; - } - ssl::X509 x509(tmpx509); -*/ ASN1_INTEGER* sn = X509_get_serialNumber(x509); if(!sn || !ASN1_INTEGER_get(sn)) { return false; @@ -341,18 +331,6 @@ if(x509) { keyprint = ssl::X509_digest(x509, EVP_sha256()); } -/* - X509* tmpx509 = NULL; - PEM_read_X509(f, &tmpx509, NULL, NULL); - fclose(f); - - if(!tmpx509) { - return; - } - - ssl::X509 x509(tmpx509); - - keyprint = ssl::X509_digest(x509, EVP_sha256());*/ } SSLSocket* CryptoManager::getClientSocket(bool allowUntrusted) { diff -Nru bmdc-0.0.1/dcpp/Socket.cpp bmdc-0.0.1/dcpp/Socket.cpp --- bmdc-0.0.1/dcpp/Socket.cpp 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/dcpp/Socket.cpp 2012-11-17 17:28:24.000000000 +0000 @@ -87,13 +87,13 @@ auto error = getLastError(); - if (error == ENOMEM) return 0; + //if (error == ENOMEM) return 0; if(blockOk && (error == EWOULDBLOCK || error == ENOBUFS || error == EINPROGRESS || error == EAGAIN)) { return -1; } - if(error == EFAULT || error == ECONNRESET || error == EDESTADDRREQ || error == ENOTCONN) - throw SocketException(error); + //if(error == EFAULT || error == ECONNRESET || error == EDESTADDRREQ || error == ENOTCONN) + // throw SocketException(error); if(error != EINTR) { throw SocketException(error); diff -Nru bmdc-0.0.1/debian/bzr-builder.manifest bmdc-0.0.1/debian/bzr-builder.manifest --- bmdc-0.0.1/debian/bzr-builder.manifest 2012-11-16 23:20:20.000000000 +0000 +++ bmdc-0.0.1/debian/bzr-builder.manifest 2012-11-17 17:28:27.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0ubuntu0~182 -lp:bmdc++ revid:mank1@seznam.cz-20121116231655-wawx3rucxhxhb32a +# bzr-builder format 0.3 deb-version {debupstream}-0ubuntu0~185 +lp:bmdc++ revid:mank1@seznam.cz-20121117165842-bb8nl9hrdr790rmb diff -Nru bmdc-0.0.1/debian/changelog bmdc-0.0.1/debian/changelog --- bmdc-0.0.1/debian/changelog 2012-11-16 23:20:20.000000000 +0000 +++ bmdc-0.0.1/debian/changelog 2012-11-17 17:28:27.000000000 +0000 @@ -1,8 +1,8 @@ -bmdc (0.0.1-0ubuntu0~182~oneiric1) oneiric; urgency=low +bmdc (0.0.1-0ubuntu0~185~oneiric1) oneiric; urgency=low * Auto build. - -- Mank Fri, 16 Nov 2012 23:20:20 +0000 + -- Mank Sat, 17 Nov 2012 17:28:27 +0000 bmdc (0.0.1-96~natty) natty; urgency=low diff -Nru bmdc-0.0.1/debian/control bmdc-0.0.1/debian/control --- bmdc-0.0.1/debian/control 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/debian/control 2012-11-17 17:28:24.000000000 +0000 @@ -3,7 +3,7 @@ Version: 0.0.2-162 Priority: optional Maintainer: Mank -Build-Depends: debhelper (>= 4.2.0), scons, libbz2-dev, zlib1g-dev, libgtk-3-dev, libssl-dev, libboost-dev ,libcanberra-dev, libnotify-dev, libgeoip-dev, libtar-dev +Build-Depends: debhelper (>= 4.2.0), scons, libbz2-dev, zlib1g-dev, libgtk-3-dev, libssl-dev, libboost-all-dev ,libcanberra-dev, libnotify-dev, libgeoip-dev, libtar-dev Package: bmdc Architecture: any diff -Nru bmdc-0.0.1/linux/FavoriteHubDialog.hh bmdc-0.0.1/linux/FavoriteHubDialog.hh --- bmdc-0.0.1/linux/FavoriteHubDialog.hh 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/FavoriteHubDialog.hh 2012-11-17 17:28:24.000000000 +0000 @@ -58,7 +58,8 @@ g_signal_connect(actionView.getCellRenderOf(_("Enabled")), "toggled", G_CALLBACK(onToggledClicked_gui), (gpointer)this); } - bool initDialog(FavHubGroupsIter &groups,dcpp::StringMap ¶ms) + + bool initDialog(FavHubGroupsIter &groups, dcpp::StringMap ¶ms) { FavHubGroups favHubGroups = FavoriteManager::getInstance()->getFavHubGroups(); @@ -81,7 +82,7 @@ for(auto fi = files.begin(); fi != files.end();++fi) { string file = Util::getFileName((*fi)); auto nedle = file.find("."); - string text = file.substr(0,nedle-1); + string text = file.substr(0,nedle); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(getWidget("comboboxEmot")), text.c_str() ); } if(init) //Defualt value when adding @@ -164,14 +165,14 @@ gboolean overrideEncoding = !(params["Encoding"].empty() || params["Encoding"] == "Global hub default"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(getWidget("checkbuttonEncoding")), overrideEncoding); - for(auto ii = charsets.begin();ii!=charsets.end();++ii) { + for(auto ii = charsets.begin(); ii!=charsets.end(); ++ii) { if(params["Encoding"] == *ii) { gtk_combo_box_set_active(GTK_COMBO_BOX(getWidget("comboboxCharset")), (ii - charsets.begin())); } } - for(auto fii = files.begin();fii!= files.end();++fii) { + for(auto fii = files.begin(); fii!= files.end(); ++fii) { auto needle = Util::getFileName(*fii).find("."); - string tmp = Util::getFileName(*fii).substr(0,needle-1); + string tmp = Util::getFileName(*fii).substr(0,needle); if(params["PackName"] == tmp) { gtk_combo_box_set_active(GTK_COMBO_BOX(getWidget("comboboxEmot")), (fii - files.begin())); } @@ -253,7 +254,7 @@ } } - gchar *pack = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(getWidget("comboboxCharset"))); + gchar *pack = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(getWidget("comboboxEmot"))); if(pack) { params["PackName"] = string(pack); diff -Nru bmdc-0.0.1/linux/ShellCommand.hh bmdc-0.0.1/linux/ShellCommand.hh --- bmdc-0.0.1/linux/ShellCommand.hh 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/ShellCommand.hh 2012-11-17 17:28:24.000000000 +0000 @@ -46,12 +46,6 @@ bool error; int resultsize; bool thirdPerson; - /*char * substr (const char* string, int start, int end) - { - size_t len = (end - start + 1); - char *output = (char *)malloc (len + 1); - return strncpy (output, &string[start], len); - }*/ }; #else diff -Nru bmdc-0.0.1/linux/System.cc bmdc-0.0.1/linux/System.cc --- bmdc-0.0.1/linux/System.cc 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/System.cc 2012-11-17 17:28:24.000000000 +0000 @@ -104,7 +104,7 @@ // Technically, we might miss a message or two here, but who cares... LogManager::getInstance()->addListener(this); - for(LogManager::List::const_iterator i = oldMessages.begin(); i != oldMessages.end(); ++i) { + for(auto i = oldMessages.begin(); i != oldMessages.end(); ++i) { add_gui(i->first, Text::toT(i->second)); } } diff -Nru bmdc-0.0.1/linux/WulforUtil.cc bmdc-0.0.1/linux/WulforUtil.cc --- bmdc-0.0.1/linux/WulforUtil.cc 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/WulforUtil.cc 2012-11-17 17:28:24.000000000 +0000 @@ -148,8 +148,10 @@ "\r\n-- My client automatically detects the connection, does yours?\r\n" LINE2, "\r\n-- These addies are pretty annoying, aren't they? Get revenge by sending them yourself!\r\n" LINE2, "\r\n-- My client supports grouping favorite hubs, does yours?\r\n" LINE2, - "\r\n-- My client supports segmented downloading, does yours?\r\n" LINE2 }; -#define MSGS 12 + "\r\n-- My client supports segmented downloading, does yours?\r\n" LINE2, + "\r\n-- My client support pack of Emoticons per Fav Hubsm does yours?\r\n" LINE2, + }; +#define MSGS 13 vector WulforUtil::splitString(const string &str, const string &delimiter) { diff -Nru bmdc-0.0.1/linux/cmddebug.cc bmdc-0.0.1/linux/cmddebug.cc --- bmdc-0.0.1/linux/cmddebug.cc 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/cmddebug.cc 2012-11-17 17:28:24.000000000 +0000 @@ -205,9 +205,9 @@ if( gtk_combo_box_get_active_iter( GTK_COMBO_BOX(cmd->getWidget("comboboxadr")), &piter ) ) { model = gtk_combo_box_get_model( GTK_COMBO_BOX(cmd->getWidget("comboboxadr")) ); gtk_tree_model_get( model, &piter, 0, &fUrl, -1 ); - } + } + if(!fUrl) return False; -// string url = iHub->url; string ipPort = (string)iHub->ip + ":" + Util::toString(iHub->port); string msg = message; @@ -232,9 +232,9 @@ if( gtk_combo_box_get_active_iter( GTK_COMBO_BOX(cmd->getWidget("comboboxadr")), &piter ) ) { model = gtk_combo_box_get_model( GTK_COMBO_BOX(cmd->getWidget("comboboxadr")) ); gtk_tree_model_get( model, &piter, 0, &fUrl, -1 ); - } + } + if(!fUrl) return False; -// string url = oHub->url; string ipPort = (string)oHub->ip + ":" + Util::toString(oHub->port); string msg = message; @@ -258,7 +258,8 @@ if( gtk_combo_box_get_active_iter( GTK_COMBO_BOX(cmd->getWidget("comboboxadr")), &piter ) ) { model = gtk_combo_box_get_model( GTK_COMBO_BOX(cmd->getWidget("comboboxadr")) ); gtk_tree_model_get( model, &piter, 0, &fUrl, -1 ); - } + } + if(!fUrl) return False; string ipPort = (string)iConn->ip + ":" + Util::toString(iConn->port); string msg = message; @@ -284,7 +285,8 @@ if( gtk_combo_box_get_active_iter( GTK_COMBO_BOX(cmd->getWidget("comboboxadr")), &piter ) ) { model = gtk_combo_box_get_model( GTK_COMBO_BOX(cmd->getWidget("comboboxadr")) ); gtk_tree_model_get( model, &piter, 0, &fUrl, -1 ); - } + } + if(!fUrl) return False; string ipPort = (string)oConn->ip + ":" + Util::toString(oConn->port); string msg = message; diff -Nru bmdc-0.0.1/linux/emoticons.cc bmdc-0.0.1/linux/emoticons.cc --- bmdc-0.0.1/linux/emoticons.cc 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/emoticons.cc 2012-11-17 17:28:24.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2009-2012 freedcpp, http://code.google.com/p/freedcpp + * Copyright © 2009-2010 freedcpp, http://code.google.com/p/freedcpp * * 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 @@ -23,8 +23,7 @@ #include "wulformanager.hh" #include "WulforUtil.hh" #include -#include -#include +#include //NOTE: core 0.762 #include "emoticons.hh" using namespace std; @@ -32,10 +31,13 @@ Emoticons *Emoticons::emoticons = NULL; -void Emoticons::start() +Emoticons* Emoticons::start(const string &packName, bool global) { - dcassert(!emoticons); - emoticons = new Emoticons(); + //dcassert(!emoticons); + if(global) { + emoticons = new Emoticons(packName); + } + return (new Emoticons(packName)); } void Emoticons::stop() @@ -51,26 +53,26 @@ return emoticons; } -Emoticons::Emoticons() +Emoticons::Emoticons(const std::string &packName) { - //currPackName = SETTING(EMOT_PACK);//WGETS("emoticons-pack"); + currPackName = packName;//WGETS("emoticons-pack"); create(); } Emoticons::~Emoticons() { clean(); -// SettingsManager::getInstance()->set(SettingsManager::EMOT_PACK,currPackName); + //WSET("emoticons-pack", currPackName); } -void Emoticons::create(string address) +void Emoticons::create() { clean(); if (!WGETB("emoticons-use")) return; - string file = getCurrPackName_gui(address); + string file = currPackName; string path = WulforManager::get()->getPath() + G_DIR_SEPARATOR_S + "emoticons" + G_DIR_SEPARATOR_S; string packName = file; @@ -99,7 +101,6 @@ return; } } - dcdebug("%s",file.c_str()); } currPackName = ""; @@ -182,91 +183,9 @@ } catch (const Exception &e) { - dcdebug("bmdc: %s...\n %s", e.getError().c_str(), path.c_str()); + dcdebug("BMDC: %s...\n", e.getError().c_str()); return FALSE; } return !pack.empty(); } - -void Emoticons::rebuildHubEmot(string address) -{ - string path = WulforManager::get()->getPath() + G_DIR_SEPARATOR_S + "emoticons" + G_DIR_SEPARATOR_S; - for(auto i = hubs.begin();i!=hubs.end();++i) - { - dcdebug("%s - %s - %s",i->first.c_str(),address.c_str(),string(path + i->second + ".xml").c_str()); - auto f = load2(path + i->second + ".xml"); - if(f.second == 0) - continue; - hubs2.insert(make_pair(address,f.first)); - hubs3.insert(make_pair(address,f.second)); - } - -} - -pair Emoticons::load2(const string &file) -{ - Emot::List packs; - std::set filt; - if (file.empty()) - return make_pair(vector(),0);; - - string path = WulforManager::get()->getPath() + G_DIR_SEPARATOR_S + "emoticons" + G_DIR_SEPARATOR_S; - int count = 0; - - try - { - SimpleXML xml; - xml.fromXML(File(file, File::READ, File::OPEN).read()); - - if (xml.findChild("emoticons-map")) - { - string map = xml.getChildAttrib("name"); - path += map + G_DIR_SEPARATOR_S; - string emotName, emotPath, emotFile; - - xml.stepIn(); - - while (xml.findChild("emoticon")) - { - GList *list = NULL; - emotFile = xml.getChildAttrib("file"); - emotPath = Text::fromUtf8(path + emotFile); - - if (!g_file_test(emotPath.c_str(), G_FILE_TEST_EXISTS)) - continue; - - xml.stepIn(); - - while (xml.findChild("name")) - { - emotName = xml.getChildAttrib("text"); - - if (emotName.empty() || g_utf8_strlen(emotName.c_str(), -1) > Emot::SIZE_NAME || filt.count(emotName)) - continue; - - list = g_list_append(list, g_strdup(emotName.c_str())); - filt.insert(emotName); - } - - if (list != NULL) - { - Emot *emot = new Emot(list, emotFile, gdk_pixbuf_new_from_file(emotPath.c_str(), NULL)); - packs.push_back(emot); - count++; - } - xml.stepOut(); - } - xml.stepOut(); - } - } - catch (const Exception &e) - { - dcdebug("bmdc: %s...\n %s", e.getError().c_str(), path.c_str()); - return make_pair(vector(),0); - } - dcdebug("%s %d",file.c_str(),count); - return make_pair(packs,count); -} - - diff -Nru bmdc-0.0.1/linux/emoticons.hh bmdc-0.0.1/linux/emoticons.hh --- bmdc-0.0.1/linux/emoticons.hh 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/emoticons.hh 2012-11-17 17:28:24.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright © 2009-2012 freedcpp, http://code.google.com/p/freedcpp + * Copyright © 2009-2010 freedcpp, http://code.google.com/p/freedcpp * * 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 @@ -21,12 +21,9 @@ #ifndef EMOTICONS_HH #define EMOTICONS_HH -#include -#include - -#include -#include #include +#include + #define EMOTICONS_MAX 48 class Emot @@ -40,9 +37,9 @@ names(names), file(file), pixbuf(pixbuf) {} ~Emot() {} - GList* getNames() { return names;} - std::string getFile() const {return file;} - GdkPixbuf* getPixbuf() const { return pixbuf;} + GList* getNames() {return names;} + std::string getFile() {return file;} + GdkPixbuf* getPixbuf() {return pixbuf;} private: GList *names; @@ -53,51 +50,26 @@ class Emoticons { public: - static void start(); + static Emoticons* start(const std::string &packName = WGETS("emoticons-pack"), bool global = true); static void stop(); static Emoticons* get(); - Emoticons(); + Emoticons(const std::string &packName); ~Emoticons(); // GUI functions - Emot::List& getPack_gui(const std::string address = dcpp::Util::emptyString) { - if(address.empty()) - return pack; - else if(hubs2.find(address) != hubs2.end()) - return hubs2.find(address)->second; - else return pack; - } - int getCountFile_gui(const std::string address = dcpp::Util::emptyString) const { - if(address.empty()) - return countfile; - else if(hubs3.find(address)!=hubs3.end()) - return hubs3.find(address)->second; - else return countfile; - } - bool useEmoticons_gui() const {return useEmotions;} - std::string getCurrPackName_gui(const std::string address = dcpp::Util::emptyString) const { - if(address.empty()) { dcdebug("curr"); - return currPackName; } - else if( hubs.find(address) != hubs.end()){ - return hubs.find(address)->second; - } - return currPackName; - } - void setCurrPackName_gui(const std::string &name, const std::string &address = dcpp::Util::emptyString) { - if(address.empty()) - currPackName = name; - hubs.insert(make_pair(address,name)); - } - void reloadPack_gui(std::string address = dcpp::Util::emptyString) {clean();create(address);} - - void rebuildHubEmot(std::string address = dcpp::Util::emptyString); + Emot::List& getPack_gui() {return pack;} + int getCountFile_gui() {return countfile;} + bool useEmoticons_gui() {return useEmotions;} + std::string getCurrPackName_gui() {return currPackName;} + void setCurrPackName_gui(const std::string &name) {currPackName = name;} + void reloadPack_gui() {create();} + private: static Emoticons *emoticons; bool load(const std::string &file); - std::pair load2(const std::string &file); - void create(std::string address = dcpp::Util::emptyString); + void create(); void clean(); bool useEmotions; @@ -105,9 +77,6 @@ Emot::List pack; std::set filter; std::string currPackName; - std::map hubs; - std::map hubs2; - std::map hubs3; }; #else diff -Nru bmdc-0.0.1/linux/emoticonsdialog.cc bmdc-0.0.1/linux/emoticonsdialog.cc --- bmdc-0.0.1/linux/emoticonsdialog.cc 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/emoticonsdialog.cc 2012-11-17 17:28:24.000000000 +0000 @@ -36,7 +36,7 @@ "16x16", "22x22", "24x24", "32x32", "36x36", "48x48", "64x64", "0" }; -EmoticonsDialog::EmoticonsDialog(GtkWidget *chat, GtkWidget *button, GtkWidget *menu, string packName /*Util::emptyString*/, string address /*Util::empty*/) : +EmoticonsDialog::EmoticonsDialog(GtkWidget *chat, GtkWidget *button, GtkWidget *menu, string packName /*Util::emptyString*/, const string& address /*Util::empty*/) : Chat(chat), Button(button), Menu(menu), @@ -49,10 +49,20 @@ g_object_ref_sink(tooltips); #endif g_object_ref_sink(Menu); + if(!address.empty()) { + Emoticons *em = Emoticons::start(packName,false); + hubs.insert(make_pair(address,em)); + } +} + +Emoticons *EmoticonsDialog::getEmot(const std::string &address) +{ + if(address.empty()) return Emoticons::get(); - Emoticons::get()->setCurrPackName_gui(packName,address); - Emoticons::get()->rebuildHubEmot(address); - Emoticons::get()->reloadPack_gui(address); + map::iterator it; + if( (it = hubs.find(address) ) != hubs.end()) + return it->second; + else return Emoticons::get(); } EmoticonsDialog::~EmoticonsDialog() @@ -61,6 +71,12 @@ g_object_unref(tooltips); #endif g_object_unref(Menu); + map::iterator it; + if( (it = hubs.find(address)) != hubs.end() ) + { + it->second->stop(); + hubs.erase(it); + } if (dialog != NULL) gtk_widget_destroy(dialog); @@ -85,7 +101,7 @@ void EmoticonsDialog::addPacksMenu(GtkWidget *item) { - const string currPackName = Emoticons::get()->getCurrPackName_gui(address); + const string currPackName = getEmot(address)->getCurrPackName_gui(); string path = WulforManager::get()->getPath() + G_DIR_SEPARATOR_S + "emoticons" + G_DIR_SEPARATOR_S; GtkWidget *check_item; @@ -205,9 +221,8 @@ //if (currPackName != Emoticons::get()->getCurrPackName_gui(ed->address)) { - Emoticons::get()->setCurrPackName_gui(currPackName,ed->address); - Emoticons::get()->rebuildHubEmot(ed->address); - Emoticons::get()->reloadPack_gui(ed->address); + ed->getEmot(ed->address)->setCurrPackName_gui(currPackName); + ed->getEmot(ed->address)->reloadPack_gui(); } } @@ -233,8 +248,8 @@ top_attach = 0, bottom_attach = 1; - const int sizetable = Emoticons::get()->getCountFile_gui(address); - Emot::List &list = Emoticons::get()->getPack_gui(address); + const int sizetable = getEmot(address)->getCountFile_gui(); + Emot::List &list = getEmot(address)->getPack_gui(); /* rows & columns */ guint rows, columns; rows = columns = (guint)sqrt((double)sizetable); @@ -324,12 +339,12 @@ Bx, By, Bw; GtkAllocation allocation;//@NOTE: GTK3 - gtk_widget_size_request(dialog, &requisition); + gtk_widget_get_preferred_size (dialog,NULL, &requisition); Dw = requisition.width; Dh = requisition.height; - gtk_widget_size_request(Button, &requisition); + gtk_widget_get_preferred_size(Button,NULL, &requisition); Bw = requisition.width; diff -Nru bmdc-0.0.1/linux/emoticonsdialog.hh bmdc-0.0.1/linux/emoticonsdialog.hh --- bmdc-0.0.1/linux/emoticonsdialog.hh 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/emoticonsdialog.hh 2012-11-17 17:28:24.000000000 +0000 @@ -23,18 +23,19 @@ #define EMOTICONS_DIALOG_HH #include #include +#include #include "emoticons.hh" class EmoticonsDialog { public: - EmoticonsDialog(GtkWidget *chat, GtkWidget *button, GtkWidget *menu, std::string packName = dcpp::Util::emptyString, std::string address = dcpp::Util::emptyString); + EmoticonsDialog(GtkWidget *chat, GtkWidget *button, GtkWidget *menu, std::string packName = WGETS("emoticons-pack"), const std::string& address = dcpp::Util::emptyString); ~EmoticonsDialog(); // GUI functions void showEmotDialog_gui(); void buildEmotMenu_gui(); - std::string getCurrent(std::string address) { return Emoticons::get()->getCurrPackName_gui(address);} - + std::string getCurrent(const std::string& address) { return getEmot(address)->getCurrPackName_gui();} + Emoticons *getEmot(const std::string &address = dcpp::Util::emptyString); private: enum {FIRST, x16 = FIRST, x22, x24, x32, x36, x48, x64, DEFAULT, LAST}; @@ -51,6 +52,7 @@ std::string currIconSize; std::string packName; std::string address; + std::map hubs; static const std::string sizeIcon[LAST]; void build(); @@ -65,6 +67,7 @@ static void onCheckPacksMenu(GtkMenuItem *checkItem, gpointer data); static void onCheckIconSizeMenu(GtkMenuItem *checkItem, gpointer data); static gboolean event(GtkWidget *widget /*dialog*/, GdkEvent *event, gpointer data /*this*/); + }; #else diff -Nru bmdc-0.0.1/linux/entry.cc bmdc-0.0.1/linux/entry.cc --- bmdc-0.0.1/linux/entry.cc 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/entry.cc 2012-11-17 17:28:24.000000000 +0000 @@ -42,7 +42,7 @@ gtk_builder_add_from_file(xml, file.c_str(), &error); if(error != NULL) { - g_print("[GTKBUILDER] ERROR file => %s ,\n => %s", file.c_str(), error->message); + g_print("[BMDC][GTKBUILDER] ERROR file => %s , => %s\n", file.c_str(), error->message); } } diff -Nru bmdc-0.0.1/linux/hub.cc bmdc-0.0.1/linux/hub.cc --- bmdc-0.0.1/linux/hub.cc 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/hub.cc 2012-11-17 17:28:24.000000000 +0000 @@ -1480,7 +1480,7 @@ { return; } - else if (!Emoticons::get()->useEmoticons_gui()) + else if (!emotdialog->getEmot(address)->useEmoticons_gui()) { if (WGETB("emoticons-use")) setStatus_gui("statusMain", _(" *** Emoticons not loaded")); @@ -1508,7 +1508,7 @@ Emot::Iter p_it; gint set_start, new_start; - Emot::List &list = Emoticons::get()->getPack_gui(address); + Emot::List &list = emotdialog->getEmot(address)->getPack_gui(); /* set start mark */ gtk_text_buffer_move_mark(chatBuffer, emot_mark, &start_iter); diff -Nru bmdc-0.0.1/linux/mainwindow.cc bmdc-0.0.1/linux/mainwindow.cc --- bmdc-0.0.1/linux/mainwindow.cc 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/mainwindow.cc 2012-11-17 17:28:24.000000000 +0000 @@ -168,7 +168,7 @@ const FavoriteHubEntryList &fh = FavoriteManager::getInstance()->getFavoriteHubs(); gtk_container_foreach(GTK_CONTAINER(menu), (GtkCallback)gtk_widget_destroy, NULL); - for (FavoriteHubEntryList::const_iterator it = fh.begin(); it != fh.end(); ++it) + for (auto it = fh.begin(); it != fh.end(); ++it) { FavoriteHubEntry *entry = *it; string address = entry->getServer(); @@ -616,8 +616,8 @@ } SettingsManager::getInstance()->set(SettingsManager::THROTTLE_ENABLE, false); - mw->setLimitingIcon(false); - mw->setStatRate_gui(); + mw->setLimitingIcon(false); + mw->setStatRate_gui(); } void MainWindow::setInitThrotles() @@ -667,11 +667,11 @@ gtk_notebook_append_page(GTK_NOTEBOOK(getWidget("book")), page, label); g_signal_connect(label, "button-release-event", G_CALLBACK(onButtonReleasePage_gui), (gpointer)entry); - if(WGETB("use-close-button")) - { - g_signal_connect(closeButton, "button-release-event", G_CALLBACK(onButtonReleasePage_gui), (gpointer)entry); - g_signal_connect(closeButton, "clicked", G_CALLBACK(onCloseBookEntry_gui), (gpointer)entry); - } + if(WGETB("use-close-button")) + { + g_signal_connect(closeButton, "button-release-event", G_CALLBACK(onButtonReleasePage_gui), (gpointer)entry); + g_signal_connect(closeButton, "clicked", G_CALLBACK(onCloseBookEntry_gui), (gpointer)entry); + } gtk_widget_set_sensitive(getWidget("closeMenuItem"), TRUE); gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(getWidget("book")), page, TRUE); @@ -786,7 +786,7 @@ break; case Entry::HUB: if(Hubs.empty()) break; - for(vector::const_iterator it = Hubs.begin();it != Hubs.end();++it) + for(auto it = Hubs.begin();it != Hubs.end();++it) { Hub *hub = *it; string hubId = (dynamic_cast(hub))->getID(); @@ -798,7 +798,7 @@ break; case Entry::PRIVATE_MESSAGE: if(privateMessage.empty()) break; - for(vector::const_iterator it = privateMessage.begin();it != privateMessage.end();++it) + for(auto it = privateMessage.begin();it != privateMessage.end();++it) { string pId = (dynamic_cast(*it))->getID(); if(pId == id) @@ -1280,7 +1280,7 @@ GtkWidget *menu = gtk_menu_tool_button_get_menu(GTK_MENU_TOOL_BUTTON(getWidget("favHubs"))); gtk_container_foreach(GTK_CONTAINER(menu), (GtkCallback)gtk_widget_destroy, NULL); - for (ListParamPair::const_iterator it = list.begin(); it != list.end(); ++it) + for (auto it = list.begin(); it != list.end(); ++it) { const ParamPair ¶m = *it; string address = param.first; @@ -2552,7 +2552,7 @@ const FavHubGroups &favHubGroups = FavoriteManager::getInstance()->getFavHubGroups(); const FavoriteHubEntryList &favoriteHubs = FavoriteManager::getInstance()->getFavoriteHubs(); - for (FavoriteHubEntryList::const_iterator i = favoriteHubs.begin(); i != favoriteHubs.end(); ++i) + for (auto i = favoriteHubs.begin(); i != favoriteHubs.end(); ++i) { FavoriteHubEntry *hub = *i; string group = hub->getGroup(); @@ -2928,7 +2928,7 @@ { MainWindow *mw = (MainWindow *)data; - for(vector::const_iterator i= mw->privateMessage.begin(); i != mw->privateMessage.end();++i) + for(auto i= mw->privateMessage.begin(); i != mw->privateMessage.end();++i) { PrivateMessage *pm = *i; typedef Func1 F1; @@ -2943,7 +2943,7 @@ { MainWindow *mw = (MainWindow *)data; - for(vector::const_iterator i= mw->Hubs.begin(); i != mw->Hubs.end();++i) + for(auto i= mw->Hubs.begin(); i != mw->Hubs.end();++i) { Hub *hub = *i; hub->reconnect_p(); @@ -2955,7 +2955,7 @@ MainWindow *mw = (MainWindow *)data; vector noff; - for(vector::const_iterator i= mw->privateMessage.begin(); i != mw->privateMessage.end();++i) + for(auto i= mw->privateMessage.begin(); i != mw->privateMessage.end();++i) { PrivateMessage *pm = dynamic_cast(*i); diff -Nru bmdc-0.0.1/linux/privatemessage.cc bmdc-0.0.1/linux/privatemessage.cc --- bmdc-0.0.1/linux/privatemessage.cc 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/privatemessage.cc 2012-11-17 17:28:24.000000000 +0000 @@ -145,6 +145,9 @@ g_signal_connect(getWidget("downloadBrowseItem"), "activate", G_CALLBACK(onDownloadToClicked_gui), (gpointer)this); g_signal_connect(getWidget("downloadItem"), "activate", G_CALLBACK(onDownloadClicked_gui), (gpointer)this); + g_signal_connect(getWidget("ripeitem"), "activate", G_CALLBACK(onRipeDbItem_gui),(gpointer)this); + g_signal_connect(getWidget("copyipItem"), "activate", G_CALLBACK(onCopyIpItem_gui),(gpointer)this); + gtk_widget_grab_focus(getWidget("entry")); history.push_back(""); OnlineUser* user = ClientManager::getInstance()->findOnlineUser(CID(cid), hubUrl); @@ -669,7 +672,7 @@ { return; } - else if (!Emoticons::get()->useEmoticons_gui()) + else if (!emotdialog->getEmot()->useEmoticons_gui()) { if (WGETB("emoticons-use")) setStatus_gui(_(" *** Emoticons not loaded")); @@ -697,7 +700,7 @@ Emot::Iter p_it; gint set_start, new_start; - Emot::List &list = Emoticons::get()->getPack_gui(); + Emot::List &list = emotdialog->getEmot()->getPack_gui(); /* set start mark */ gtk_text_buffer_move_mark(messageBuffer, emot_mark, &start_iter); @@ -1613,3 +1616,17 @@ pm->addFavoriteUser_client(); } //EnD + +void PrivateMessage::onCopyIpItem_gui(GtkWidget *wid, gpointer data) +{ + PrivateMessage *pm = (PrivateMessage *)data; + gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), pm->ip.c_str(), pm->ip.length()); +} + +void PrivateMessage::onRipeDbItem_gui(GtkWidget *wid, gpointer data) +{ + PrivateMessage *pm = (PrivateMessage *)data; + string error; + WulforUtil::openURI("http://www.db.ripe.net/whois?searchtext=" + pm->ip + "&searchSubmit=search", error); + pm->setStatus_gui(error); +} diff -Nru bmdc-0.0.1/linux/privatemessage.hh bmdc-0.0.1/linux/privatemessage.hh --- bmdc-0.0.1/linux/privatemessage.hh 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/privatemessage.hh 2012-11-17 17:28:24.000000000 +0000 @@ -85,6 +85,8 @@ static void onCommandClicked_gui(GtkWidget *widget, gpointer data); static void onUseEmoticons_gui(GtkWidget *widget, gpointer data); static gboolean onChatCommandButtonRelease_gui(GtkWidget *widget, GdkEventButton *event, gpointer data); + static void onCopyIpItem_gui(GtkWidget *wid, gpointer data); + static void onRipeDbItem_gui(GtkWidget *wid, gpointer data); //BMDC++ static void onCloseItem(gpointer data); static void onCopyCID(gpointer data); diff -Nru bmdc-0.0.1/linux/settingsmanager.cc bmdc-0.0.1/linux/settingsmanager.cc --- bmdc-0.0.1/linux/settingsmanager.cc 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/settingsmanager.cc 2012-11-17 17:28:24.000000000 +0000 @@ -49,7 +49,6 @@ defaultInt.insert(IntMap::value_type("toolbar-style", 5)); defaultInt.insert(IntMap::value_type("sound-pm-open", 0)); defaultInt.insert(IntMap::value_type("sound-pm", 1)); -// TODO: download begins, uncomment when implemented defaultInt.insert(IntMap::value_type("sound-download-begins-use", 0)); defaultInt.insert(IntMap::value_type("sound-download-finished-use", 0)); defaultInt.insert(IntMap::value_type("sound-download-finished-ul-use", 0)); @@ -198,7 +197,6 @@ defaultString.insert(StringMap::value_type("sharebrowser-width", "")); defaultString.insert(StringMap::value_type("sharebrowser-visibility", "")); defaultString.insert(StringMap::value_type("default-charset", WulforUtil::ENCODING_LOCALE)); -// TODO: download begins, uncomment when implemented defaultString.insert(StringMap::value_type("sound-download-begins", "")); defaultString.insert(StringMap::value_type("sound-download-finished", "")); defaultString.insert(StringMap::value_type("sound-download-finished-ul", "")); diff -Nru bmdc-0.0.1/linux/sharebrowser.cc bmdc-0.0.1/linux/sharebrowser.cc --- bmdc-0.0.1/linux/sharebrowser.cc 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/sharebrowser.cc 2012-11-17 17:28:24.000000000 +0000 @@ -121,7 +121,7 @@ addChild(dirUserCommandMenu); //Tab UC TabUserCommandMenu = new UserCommandMenu(BookEntry::createmenu(), ::UserCommand::CONTEXT_FILELIST); - addChild(TabUserCommandMenu); + addChild(TabUserCommandMenu); // Connect the signals to their callback functions. g_signal_connect(fileView.get(), "button-press-event", G_CALLBACK(onButtonPressed_gui), (gpointer)this); diff -Nru bmdc-0.0.1/linux/treeview.cc bmdc-0.0.1/linux/treeview.cc --- bmdc-0.0.1/linux/treeview.cc 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/linux/treeview.cc 2012-11-17 17:28:24.000000000 +0000 @@ -411,7 +411,7 @@ * Breaks GTK+ API, but is the only way to attach a signal to a gtktreeview column header. See GTK bug #141937. * @todo: Replace when GTK adds a way to add a signal to the entire header (remove visibleColumns var, too). */ - g_signal_connect(/*col->button*/gtk_tree_view_column_get_button(col), "button-release-event", G_CALLBACK(popupMenu_gui), (gpointer)this);//TODO + g_signal_connect(gtk_tree_view_column_get_button(col), "button-release-event", G_CALLBACK(popupMenu_gui), (gpointer)this); } void TreeView::setSortColumn_gui(const string &column, const string &sortColumn) @@ -631,8 +631,7 @@ { if (gtk_tree_model_get_iter(GTK_TREE_MODEL(gtk_tree_view_get_model(tv->view)), &iter, path)) { - // GtkTreeModel *m = gtk_tree_view_get_model(tv->view); - data += title + ": "; + data += title + ": "; data += tv->getValueAsText(&iter, title) + "\n"; } } @@ -656,7 +655,7 @@ { TreeView *tv = (TreeView *)data; - string title = (gchar *)g_object_get_data(G_OBJECT(item), "title"); + string title = (gchar *)g_object_get_data(G_OBJECT(item), "title"); if (gtk_tree_selection_count_selected_rows(tv->sel) > 0) { @@ -671,7 +670,6 @@ if (gtk_tree_model_get_iter(GTK_TREE_MODEL(gtk_tree_view_get_model(tv->view)), &iter, path)) { - // GtkTreeModel *m = gtk_tree_view_get_model(tv->view); data += tv->getValueAsText(&iter, title) + G_DIR_SEPARATOR; } @@ -713,7 +711,7 @@ case INT: case EXSIZE: char buf[512]; - size = getValue(i, title); + size = getValue(i, title); snprintf(buf, sizeof(buf), "%.f", (double)(size)); return buf; default: ; diff -Nru bmdc-0.0.1/ui/cmddebug.glade.ui bmdc-0.0.1/ui/cmddebug.glade.ui --- bmdc-0.0.1/ui/cmddebug.glade.ui 2012-11-16 23:20:19.000000000 +0000 +++ bmdc-0.0.1/ui/cmddebug.glade.ui 2012-11-17 17:28:24.000000000 +0000 @@ -125,6 +125,17 @@ + + True + False + + + True + True + 6 + + + Clear False