~ubuntu-branches/debian/stretch/psi-plus/stretch

« back to all changes in this revision

Viewing changes to src/plugins/generic/clientswitcherplugin/clientswitcherplugin.cpp

  • Committer: Package Import Robot
  • Author(s): Boris Pek
  • Date: 2013-10-23 02:42:20 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20131023024220-bk2hyoenqkwfhpgw
Tags: 0.16.242-1
* New upstream release:
  fixed the problem of initialization of private conversation when both
  sides use libotr 4.0.x. (Closes: #724880)
* Update debian/watch: sources were moved.
* Delete psi-plus-content-downloader package and update all related files.
  This plugin is in psi-plus-plugins package now.
* Update debian/control:
  - remove all currently unneeded Replaces and Breaks fields
  - add build dependency on libidn11-dev
* Update debian/rules: simplify get-orig-source section.
* Update debian/copyright:
  - update Source field due to changes in sources location
  - remove copyright holders whose code was deleted from source tree
    (bundled libidn library was removed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "clientswitcherplugin.h"
31
31
#include "viewer.h"
32
32
 
 
33
#ifndef HAVE_QT5
33
34
Q_EXPORT_PLUGIN(ClientSwitcherPlugin)
 
35
#endif
34
36
 
35
 
#define cVer                    "0.0.16"
 
37
#define cVer                    "0.0.18"
36
38
#define constPluginShortName    "clientswitcher"
37
39
#define constPluginName         "Client Switcher Plugin"
38
40
#define constForAllAcc          "for_all_acc"
44
46
 
45
47
 
46
48
ClientSwitcherPlugin::ClientSwitcherPlugin() :
47
 
                sender_(0),
48
 
                psiOptions(0),
49
 
                psiPopup(0),
50
 
                psiInfo(0),
51
 
                psiAccount(0),
52
 
                psiAccountCtl(0),
53
 
                psiContactInfo(0),
54
 
                psiIcon(0),
55
 
                enabled(false),
56
 
                for_all_acc(false),
57
 
                def_os_name(""),
58
 
                def_client_name(""),
59
 
                def_client_version(""),
60
 
                def_caps_node(""),
61
 
                def_caps_version(""),
62
 
                heightLogsView(500),
63
 
                widthLogsView(600),
64
 
                lastLogItem(""),
65
 
                popupId(0)
 
49
        sender_(0),
 
50
        psiOptions(0),
 
51
        psiPopup(0),
 
52
        psiInfo(0),
 
53
        psiAccount(0),
 
54
        psiAccountCtl(0),
 
55
        psiContactInfo(0),
 
56
        psiIcon(0),
 
57
        enabled(false),
 
58
        for_all_acc(false),
 
59
        def_os_name(""),
 
60
        def_client_name(""),
 
61
        def_client_version(""),
 
62
        def_caps_node(""),
 
63
        def_caps_version(""),
 
64
        heightLogsView(500),
 
65
        widthLogsView(600),
 
66
        lastLogItem(""),
 
67
        popupId(0)
66
68
 
67
69
{
68
70
        settingsList.clear();
168
170
        if (!enabled) {
169
171
                return 0;
170
172
        }
171
 
        QWidget* optionsWid = new QWidget();
172
 
        ui_options.setupUi(optionsWid);
 
173
        QWidget* optionsWid = new QWidget();
 
174
        ui_options.setupUi(optionsWid);
173
175
        // Заполняем виджет пресетов ОС
174
176
        ui_options.cb_ospreset->addItem("default", "default");
175
177
        ui_options.cb_ospreset->addItem("user defined", "user");
348
350
        restoreOptionsAcc(acc_idx);
349
351
}
350
352
 
 
353
QPixmap ClientSwitcherPlugin::icon() const
 
354
{
 
355
        return QPixmap(":/icons/clientswitcher.png");
 
356
}
 
357
 
351
358
//-- OptionAccessor -------------------------------------------------
352
359
 
353
360
void ClientSwitcherPlugin::setOptionAccessingHost(OptionAccessingHost* host)
665
672
 
666
673
                // Showing popup if it is necessary
667
674
                if (is_version_query && as->show_requ_mode != AccountSettings::LogNever
668
 
                                && (as->show_requ_mode == AccountSettings::LogAlways || is_version_replaced))
 
675
                        && (as->show_requ_mode == AccountSettings::LogAlways || is_version_replaced))
669
676
                        showPopup(jidToNick(account, s_to));
670
677
 
671
678
                // Write log if it is necessary
672
679
                if (is_version_query && as->log_mode != AccountSettings::LogNever
673
 
                                && (as->log_mode == AccountSettings::LogAlways || is_version_replaced))
 
680
                        && (as->log_mode == AccountSettings::LogAlways || is_version_replaced))
674
681
                        saveToLog(account, s_to, send_ver_list.join(", "));
675
682
        }
676
683
        return false;
677
684
}
678
685
 
679
686
QString ClientSwitcherPlugin::pluginInfo() {
680
 
        return tr("Authors: ") +  "Liuch\n\n"
681
 
                        + trUtf8("The plugin is intended for substitution of the client version, his name and operating system type.\n"
682
 
                                "You can specify the version of the client and OS or to select them from the preset list.\n");
 
687
        return tr("Authors: ") +  "Liuch\n\n"
 
688
                 + trUtf8("The plugin is intended for substitution of the client version, his name and operating system type.\n"
 
689
                                  "You can specify the version of the client and OS or to select them from the preset list.\n");
683
690
}
684
691
 
685
692
void ClientSwitcherPlugin::setPopupAccessingHost(PopupAccessingHost* host)
783
790
}
784
791
 
785
792
/**
786
 
  * Отсылка пресентса с новыми капсами от имени указанного аккаунта
787
 
  * Если account == -1, то капсы посылаются всем активным аккаунтам
788
 
  */
 
793
 * Отсылка пресентса с новыми капсами от имени указанного аккаунта
 
794
 * Если account == -1, то капсы посылаются всем активным аккаунтам
 
795
 */
789
796
void ClientSwitcherPlugin::setNewCaps(int account)
790
797
{
791
798
        if (!enabled || !psiAccount || !psiAccountCtl)
825
832
                        }
826
833
                }
827
834
                if (psiContactInfo->isConference(account, to_jid) || psiContactInfo->isPrivate(account, to)) {
828
 
                //if (to.contains("conference.")) {
 
835
                        //if (to.contains("conference.")) {
829
836
                        if (!as->enable_conferences)
830
837
                                return true;
831
838
                } else {