Esempio n. 1
1
LoginDialog::LoginDialog()
        : LoginDlgBase(NULL, "logindlg", false, WDestructiveClose)
{
    SET_WNDPROC("login")
    setCaption(caption());
    setButtonsPict(this);
    setIcon(Pict("licq"));
    bLogin = false;
    bMyInit = false;
    cmbUIN->setEditable(true);
    cmbUIN->lineEdit()->setValidator(new QIntValidator(100000, 0x7FFFFFFF, this));
    loadUins();
    edtPasswd->setEchoMode(QLineEdit::Password);
    connect(cmbUIN->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(uinChanged(const QString&)));
    connect(edtPasswd, SIGNAL(textChanged(const QString&)), this, SLOT(pswdChanged(const QString&)));
    connect(btnClose, SIGNAL(clicked()), this, SLOT(close()));
    connect(btnLogin, SIGNAL(clicked()), this, SLOT(login()));
    connect(btnDelete, SIGNAL(clicked()), this, SLOT(deleteUin()));
    connect(btnProxy, SIGNAL(clicked()), this, SLOT(proxySetup()));
    connect(chkSave, SIGNAL(toggled(bool)), this, SLOT(saveChanged(bool)));
    QSize s = sizeHint();
    QWidget *desktop = QApplication::desktop();
    move((desktop->width() - s.width()) / 2, (desktop->height() - s.height()) / 2);
    chkSave->setChecked(pSplash->isSavePassword());
    chkNoShow->setChecked(pSplash->isNoShowLogin());
    uinChanged("");
    bPswdChanged = true;
    if (pSplash->isSavePassword()){
        unsigned long uin = cmbUIN->lineEdit()->text().toULong();
        if (uin){
            pClient->load(uin);
            QString pswd;
            for (const char *p = pClient->EncryptedPassword.c_str(); *p; p++){
                if (*p == '\\') continue;
                pswd += '*';
            }
            edtPasswd->setText(pswd);
            pswdChanged("");
            if (!pswd.isEmpty()) bPswdChanged = false;
        }
    }
    bCloseMain = true;
};
Esempio n. 2
0
LoginDialog::LoginDialog(bool bInit, Client *client)
        : LoginDialogBase(NULL, "logindlg",
                          client ? false : true,
                          client ? WDestructiveClose : 0)
{
    m_bInit  = bInit;
    m_bProfileChanged = false;
    m_profile = CorePlugin::m_plugin->getProfile();
    m_client = client;
    SET_WNDPROC("login")
    setIcon(Pict("licq"));
    setButtonsPict(this);
    if (m_client){
        setCaption(caption());
    }else{
        setCaption(i18n("Select profile"));
    }
    if (m_client){
        chkSave->hide();
        chkNoShow->hide();
        btnDelete->hide();
        cmbProfile->hide();
        lblProfile->hide();
    }
    chkSave->setChecked(CorePlugin::m_plugin->getSavePasswd());
    chkNoShow->setChecked(CorePlugin::m_plugin->getNoShow());
    connect(buttonOk, SIGNAL(clicked()), this, SLOT(apply()));
    connect(chkSave, SIGNAL(toggled(bool)), this, SLOT(saveToggled(bool)));
    saveToggled(CorePlugin::m_plugin->getSavePasswd());
    fill();
    connect(cmbProfile, SIGNAL(activated(int)), this, SLOT(profileChanged(int)));
    connect(btnDelete, SIGNAL(clicked()), this, SLOT(profileDelete()));
    profileChanged(cmbProfile->currentItem());
}
Esempio n. 3
0
DiscoInfo::DiscoInfo(JabberBrowser *browser)
        : DiscoInfoBase(browser, NULL, false, WDestructiveClose)
{
    m_browser = browser;
    SET_WNDPROC("jbrowser")
    setIcon(Pict("Jabber_online"));
    setTitle();
    setButtonsPict(this);
    connect(buttonApply, SIGNAL(clicked()), this, SLOT(apply()));
    m_bVersion = true;
    m_bTime    = true;
    m_bLast	   = true;
    m_bStat	   = true;
    m_bVCard   = true;
    m_about    = NULL;
    load_data(jabberUserData, &m_data, NULL);
    disableWidget(edtJName);
    disableWidget(edtType);
    disableWidget(edtCategory);
    edtNameSpace->setReadOnly(true);
    disableWidget(edtName);
    disableWidget(edtVersion);
    disableWidget(edtSystem);
    disableWidget(edtTime);
    disableWidget(edtLast);
    lstStat->addColumn(i18n("Name"));
    lstStat->addColumn(i18n("Units"));
    lstStat->addColumn(i18n("Value"));
    lstStat->setExpandingColumn(2);
    btnUrl->setPixmap(Pict("home"));
    connect(btnUrl, SIGNAL(clicked()), this, SLOT(goUrl()));
    connect(edtUrl, SIGNAL(textChanged(const QString&)), this, SLOT(urlChanged(const QString&)));
}
Esempio n. 4
0
UserConfig::UserConfig(Contact *contact, Group *group)
        : QDialog( NULL)
{
    this->setAttribute( Qt::WA_DeleteOnClose);
    setupUi( this);
    m_contact  = contact;
    m_group    = group;
    m_nUpdates = 0;

    SET_WNDPROC("configure")
    setIcon(Pict(contact ? "info" : "configure").pixmap());
    setButtonsPict(this);
    setTitle();
    QIcon iconSet = Icon("webpress");
    if (!iconSet.pixmap(QIcon::Small, QIcon::Normal).isNull())
        btnUpdate->setIconSet(iconSet);
    btnUpdate->hide();

    lstBox->setHScrollBarMode(Q3ScrollView::AlwaysOff);
    lstBox->setSorting(1);
    lstBox->header()->hide();

    fill();

    connect(lstBox, SIGNAL(currentChanged(Q3ListViewItem*)), this, SLOT(itemSelected(Q3ListViewItem*)));
    connect(buttonApply, SIGNAL(clicked()), this, SLOT(apply()));
    connect(btnUpdate, SIGNAL(clicked()), this, SLOT(updateInfo()));

    lstBox->setCurrentItem(lstBox->firstChild());
    itemSelected(lstBox->firstChild());
}
Esempio n. 5
0
UserConfig::UserConfig(Contact *contact, Group *group)
        : ConfigureDialogBase(NULL, "userconfig", false, WDestructiveClose)
{
    m_contact  = contact;
    m_group    = group;
    m_nUpdates = 0;

    SET_WNDPROC("configure")
    setIcon(Pict(contact ? "info" : "configure"));
    setButtonsPict(this);
    setTitle();
    const QIconSet *iconSet = Icon("webpress");
    if (iconSet)
        btnUpdate->setIconSet(*iconSet);
    btnUpdate->hide();

    lstBox->setHScrollBarMode(QScrollView::AlwaysOff);
    lstBox->setSorting(1);
    lstBox->header()->hide();

    fill();

    connect(lstBox, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(itemSelected(QListViewItem*)));
    connect(buttonApply, SIGNAL(clicked()), this, SLOT(apply()));
    connect(btnUpdate, SIGNAL(clicked()), this, SLOT(updateInfo()));

    lstBox->setCurrentItem(lstBox->firstChild());
    itemSelected(lstBox->firstChild());
}
Esempio n. 6
0
FileTransferDlg::FileTransferDlg(FileMessage *msg)
        : FileTransferBase(NULL, "filetransfer", false, WDestructiveClose)
{
    m_msg = msg;
    SET_WNDPROC("filetransfer")
    setIcon(Pict("file"));
    setButtonsPict(this);
    setCaption((msg->getFlags() & MESSAGE_RECEIVED) ? i18n("Receive file") : i18n("Send file"));
    disableWidget(edtTime);
    disableWidget(edtEstimated);
    disableWidget(edtSpeed);
    msg->m_transfer->setNotify(new FileTransferDlgNotify(this));
    sldSpeed->setValue(m_msg->m_transfer->speed());
    connect(sldSpeed, SIGNAL(valueChanged(int)), this, SLOT(speedChanged(int)));
    m_time  = 0;
    m_timer = new QTimer(this);
    connect(m_timer, SIGNAL(timeout()), this, SLOT(timeout()));
    m_timer->start(1000);
    printTime();
    m_bTransfer = false;
    m_transferTime = 0;
    m_speed     = 0;
    m_nAverage  = 0;
    m_files		= 0;
    m_bytes		= 0;
    m_fileSize	= 0;
    m_totalBytes = 0;
    m_totalSize	= 0;
    m_state = FileTransfer::Unknown;
    connect(btnCancel, SIGNAL(clicked()), this, SLOT(close()));
    chkClose->setChecked(CorePlugin::m_plugin->getCloseTransfer());
    connect(chkClose, SIGNAL(toggled(bool)), this, SLOT(closeToggled(bool)));
}
Esempio n. 7
0
GpgGen::GpgGen(GpgCfg *cfg)
        : GpgGenBase(NULL, NULL, true)
{
    SET_WNDPROC("genkey")
    setIcon(Pict("encrypted"));
    setButtonsPict(this);
    setCaption(caption());
    cmbMail->setEditable(true);
    m_exec = NULL;
    m_cfg  = cfg;
    connect(edtName, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&)));
    connect(cmbMail->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&)));
    Contact *owner = getContacts()->owner();
    if (owner){
        QString name;
        name = owner->getFirstName();
        QString firstName = getToken(name, '/');
        name  = owner->getLastName();
        QString lastName  = getToken(name, '/');

        if (firstName.isEmpty() || lastName.isEmpty()){
            name = firstName + lastName;
        }else{
            name = firstName + " " + lastName;
        }
        edtName->setText(name);
        QString mails = owner->getEMails();
        while (!mails.isEmpty()){
            QString item = getToken(mails, ';');
            QString mail = getToken(item, '/');
            cmbMail->insertItem(mail);
        }
    }
}
Esempio n. 8
0
MonitorWindow::MonitorWindow(NetmonitorPlugin *plugin)
        : QMainWindow(NULL, "monitor", WType_TopLevel)
{
    m_plugin = plugin;
    SET_WNDPROC("monitor")
    setCaption(i18n("Network monitor"));
    setIcon(Pict("network"));
    bPause = false;
    edit = new TextShow(this);
    edit->setWordWrap(QTextEdit::NoWrap);
    setCentralWidget(edit);
    QMenuBar *menu = menuBar();
    menuFile = new QPopupMenu(this);
    connect(menuFile, SIGNAL(aboutToShow()), this, SLOT(adjustFile()));
    menuFile->insertItem(Pict("filesave"), i18n("&Save"), this, SLOT(save()), 0, mnuSave);
    menuFile->insertItem(i18n("&Pause"), this, SLOT(pause()), 0, mnuPause);
    menuFile->insertSeparator();
    menuFile->insertItem(Pict("exit"), i18n("E&xit"), this, SLOT(exit()), 0, mnuExit);
    menu->insertItem(i18n("&File"), menuFile);
    menuEdit = new QPopupMenu(this);
    connect(menuEdit, SIGNAL(aboutToShow()), this, SLOT(adjustEdit()));
    menuEdit->insertItem(i18n("&Copy"), this, SLOT(copy()), 0, mnuCopy);
    menuEdit->insertItem(i18n("&Erase"), this, SLOT(erase()), 0, mnuErase);
    menu->insertItem(i18n("&Edit"), menuEdit);
    menuLog = new QPopupMenu(this);
    menuLog->setCheckable(true);
    connect(menuLog, SIGNAL(aboutToShow()), this, SLOT(adjustLog()));
    connect(menuLog, SIGNAL(activated(int)), this, SLOT(toggleType(int)));
    menu->insertItem(i18n("&Log"), menuLog);
}
Esempio n. 9
0
MainWindow::MainWindow()
        : QMainWindow(NULL, "mainwnd",
                      WType_TopLevel | WStyle_Customize |
                      WStyle_Title | WStyle_NormalBorder| WStyle_SysMenu),
        EventReceiver(LowestPriority)
{
    m_grip	 = NULL;
    h_lay	 = NULL;
    m_bNoResize = false;

    SET_WNDPROC("mainwnd");
    m_icon = "ICQ";
    setIcon(Pict(m_icon.c_str()));
    setTitle();

#ifdef WIN32
    pMain = this;
    if (IsWindowUnicode(winId())){
        oldProc = (WNDPROC)SetWindowLongW(winId(), GWL_WNDPROC, (LONG)wndProc);
    }else{
        oldProc = (WNDPROC)SetWindowLongA(winId(), GWL_WNDPROC, (LONG)wndProc);
    }
#endif

    bar = NULL;

    main = new MainWindowWidget(this);
    setCentralWidget(main);

    lay = new QVBoxLayout(main);

    QStatusBar *status = statusBar();
    status->hide();
    status->installEventFilter(this);
}
Esempio n. 10
0
/*
 * RemoveEditSubClass - remove the sub-class of an edit control in a dialog
 */
void RemoveEditSubClass( HWND hwnd, int id )
{
    HWND    edit;

    edit = GetDlgItem( hwnd, id );
    SET_WNDPROC( edit, (LONG_PTR)oldEditProc );
    (void)FreeProcInstance( editProc );
    FinishFileComplete();

} /* RemoveEditSubClass */
Esempio n. 11
0
NewProtocol::NewProtocol(QWidget *parent)
        : NewProtocolBase(parent, "new_protocol", true)
{
    m_setup  = NULL;
    m_client = NULL;
    m_last   = NULL;
    m_connectWnd = NULL;
    m_bConnected = false;
    m_bConnect = false;
    m_bStart   = (parent == NULL);
    SET_WNDPROC("protocol")
    setIcon(Pict("configure"));
    setButtonsPict(this);
    setCaption(caption());
    helpButton()->hide();
    for (unsigned n = 0;; n++){
        Event e(EventPluginGetInfo, (void*)n);
        pluginInfo *info = (pluginInfo*)e.process();
        if (info == NULL)
            break;
        if (info->info == NULL){
            Event e(EventLoadPlugin, info->name);
            e.process();
            if (info->info && !(info->info->flags & (PLUGIN_PROTOCOL & ~PLUGIN_NOLOAD_DEFAULT))){
                Event e(EventUnloadPlugin, info->name);
                e.process();
            }
        }
        if ((info->info == NULL) || !(info->info->flags & (PLUGIN_PROTOCOL & ~PLUGIN_NOLOAD_DEFAULT)))
            continue;
        info->bDisabled = false;
        Event eApply(EventApplyPlugin, info->name);
        eApply.process();
    }
    Protocol *protocol;
    ContactList::ProtocolIterator it;
    while ((protocol = ++it) != NULL){
        const CommandDef *cmd = protocol->description();
        if (cmd == NULL)
            continue;
        m_protocols.push_back(protocol);
    }
    sort(m_protocols.begin(), m_protocols.end(), cmp_protocol);
    for (unsigned i = 0; i < m_protocols.size(); i++){
        const CommandDef *cmd = m_protocols[i]->description();
        cmbProtocol->insertItem(Pict(cmd->icon), i18n(cmd->text));
    }
    connect(cmbProtocol, SIGNAL(activated(int)), this, SLOT(protocolChanged(int)));
    cmbProtocol->setCurrentItem(0);
    protocolChanged(0);
    connect(this, SIGNAL(selected(const QString&)), this, SLOT(pageChanged(const QString&)));
}
Esempio n. 12
0
Container::Container(unsigned id, const char *cfg)
{
    m_bInit   = false;
    m_bInSize = false;
    m_bStatusSize = false;
    m_bBarChanged = false;
    m_bReceived = false;
    m_bNoSwitch = false;

    SET_WNDPROC("container")
    setWFlags(WDestructiveClose);
    QFrame *frm = new QFrame(this);
    setCentralWidget(frm);

    connect(CorePlugin::m_plugin, SIGNAL(modeChanged()), this, SLOT(modeChanged()));

    QVBoxLayout *lay = new QVBoxLayout(frm);
    m_wnds = new QWidgetStack(frm);
    m_wnds->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
    lay->addWidget(m_wnds);

    m_tabSplitter = new Splitter(frm);
    m_tabSplitter->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
    m_tabBar = new UserTabBar(m_tabSplitter);
    m_tabBar->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding));
    m_tabBar->hide();

    m_status = new ContainerStatus(m_tabSplitter);
    lay->addWidget(m_tabSplitter);

    load_data(containerData, &data, cfg);

    if (cfg == NULL){
        setId(id);
        memcpy(data.barState, CorePlugin::m_plugin->data.containerBar, sizeof(data.barState));
        data.geometry[2] = CorePlugin::m_plugin->data.containerSize[0];
        data.geometry[3] = CorePlugin::m_plugin->data.containerSize[1];
        setStatusSize(CorePlugin::m_plugin->getContainerStatusSize());
        showBar();
        m_bInit = true;
    }
    m_bInSize = true;
    restoreGeometry(this, data.geometry, cfg != NULL, (cfg != NULL) || m_bInit);
    m_bInSize = false;
    connect(m_tabBar, SIGNAL(selected(int)), this, SLOT(contactSelected(int)));
    connect(this, SIGNAL(toolBarPositionChanged(QToolBar*)), this, SLOT(toolbarChanged(QToolBar*)));
    connect(m_status, SIGNAL(sizeChanged(int)), this, SLOT(statusChanged(int)));

    m_accel = new QAccel(this);
    connect(m_accel, SIGNAL(activated(int)), this, SLOT(accelActivated(int)));
    setupAccel();
}
Esempio n. 13
0
GpgFind::GpgFind(EditFile *edt)
        : GpgFindBase(NULL, NULL, false, WDestructiveClose)
{
    SET_WNDPROC("find")
    setIcon(Pict("find"));
    setButtonsPict(this);
    setCaption(caption());
    m_edit = edt;
    connect(btnCancel, SIGNAL(clicked()), this, SLOT(close()));
    m_drives = *QDir::drives();
    m_drive  = m_drives.first();
    QTimer::singleShot(0, this, SLOT(next()));
}
Esempio n. 14
0
/*
 * EditSubClass - sub-class an edit control in a dialog
 */
void EditSubClass( HWND hwnd, int id, history_data *h )
{
    HWND    edit;

    hData = h;
    currHist = h->curr;
    edit = GetDlgItem( hwnd, id );
    oldEditProc = (WNDPROC)GET_WNDPROC( edit );
    editProc = MakeProcInstance( (FARPROC)EditSubClassProc, InstanceHandle );
    SET_WNDPROC( edit, (LONG_PTR)editProc );
    SendMessage( edit, EM_LIMITTEXT, MAX_INPUT_LINE, 0L );

} /* EditSubClass */
Esempio n. 15
0
GpgFind::GpgFind(EditFile *edt)
        : QDialog( NULL, Qt::WA_DeleteOnClose)
{
    setupUi( this);
    SET_WNDPROC("find")
    setIcon(Pict("find"));
    setButtonsPict(this);
    setCaption(caption());
    m_edit = edt;
    connect(btnCancel, SIGNAL(clicked()), this, SLOT(close()));
    m_drives = *QDir::drives();
    m_drive  = m_drives.first();
    QTimer::singleShot(0, this, SLOT(next()));
}
Esempio n. 16
0
SecureDlg::SecureDlg(ICQClient *client, unsigned contact, struct ICQUserData *data)
        : SecureDlgBase(NULL, "securedlg", false, WDestructiveClose)
{
    SET_WNDPROC("secure")
    setIcon(Pict("encrypted"));
    setButtonsPict(this);
    setCaption(caption());
    m_client  = client;
    m_contact = contact;
    m_data    = data;
    m_msg	  = NULL;
    connect(btnCancel, SIGNAL(clicked()), this, SLOT(close()));
    QTimer::singleShot(0, this, SLOT(start()));
}
Esempio n. 17
0
JabberWizard::JabberWizard(QWidget *parent, const QString &title, const char *icon, JabberClient *client, const char *jid, const char *node, const char *type)
        : QWizard(parent, NULL, true)
{
    m_type = type;
    m_search = new JabberSearch(this, client, jid, node, title, m_type == "register");
    addPage(m_search, title);
    m_result = new AddResult(client);
    addPage(m_result, title);
    m_result->setText(i18n("Process"));
    helpButton()->hide();
    SET_WNDPROC("jbrowser")
    setIcon(Pict(icon));
    setCaption(title);
    connect(this, SIGNAL(selected(const QString&)), this, SLOT(slotSelected(const QString&)));
}
ConnectionSettings::ConnectionSettings(Client *client)
        : ConnectionSettingsBase(NULL, NULL, true)
{
    SET_WNDPROC("client")
    setButtonsPict(this);
    m_client = client;
    Protocol *protocol = client->protocol();
    const CommandDef *cmd = protocol->description();
    setIcon(Pict(cmd->icon));
    setCaption(i18n("Configure %1 client") .arg(i18n(cmd->text)));
    QVBoxLayout *lay = new QVBoxLayout(addWnd);
    QWidget *setupWnd = client->setupWnd();
    setupWnd->reparent(addWnd, QPoint());
    lay->addWidget(setupWnd);
    setupWnd->show();
}
Esempio n. 19
0
JabberBrowser::JabberBrowser(JabberClient *client)
        : QMainWindow(NULL, NULL, WDestructiveClose)
{
    m_client = client;
    m_info   = NULL;

    SET_WNDPROC("jbrowser")
    setIcon(Pict("Jabber_online"));
    setTitle();
    m_status = statusBar();
    m_list = new ListView(this);
    m_list->addColumn(i18n("Name"));
    m_list->addColumn(i18n("JID"));
    m_list->addColumn(i18n("Node"));
    m_list->setExpandingColumn(0);
    m_list->setMenu(0);
    connect(m_list, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(currentChanged(QListViewItem*)));
    connect(m_list, SIGNAL(dragStart()), this, SLOT(dragStart()));

    BarShow b;
    b.bar_id = BarBrowser;
    b.parent = this;
    Event e(EventShowBar, &b);
    m_bar = (CToolBar*)e.process();
    m_bar->setParam(this);
    restoreToolbar(m_bar, m_client->data.browser_bar);
    m_bar->show();
    setCentralWidget(m_list);
    m_historyPos = -1;

    Command cmd;
    cmd->id		= CmdUrl;
    cmd->param	= this;
    Event eWidget(EventCommandWidget, cmd);
    CToolCombo *cmbUrl = (CToolCombo*)(eWidget.process());
    if (cmbUrl){
        QString h = m_client->getBrowserHistory();
        while (h.length())
            cmbUrl->insertItem(getToken(h, ';'));
        cmbUrl->setText(QString::null);
    }

    m_search = NULL;
    m_reg    = NULL;
    m_config = NULL;
    m_bInProcess = false;
}
Esempio n. 20
0
SearchDialog::SearchDialog()
{
    SET_WNDPROC("search")
    setIcon(Pict("find"));
    setButtonsPict(this);
    setCaption(i18n("Search"));
    m_current = NULL;
    m_currentResult = NULL;
    m_bAdd = true;
    m_id		= 0;
    m_result_id = 0;
    m_active	= NULL;
    m_search	= new SearchBase(this);
    m_update = new QTimer(this);
    connect(m_update, SIGNAL(timeout()), this, SLOT(update()));
    setCentralWidget(m_search);
    m_status = statusBar();
    m_result = NULL;
    setAdd(false);
    m_search->btnOptions->setIconSet(Icon("1downarrow"));
    m_search->btnAdd->setIconSet(Icon("add"));
    m_search->btnNew->setIconSet(Icon("new"));
    connect(m_search->wndCondition, SIGNAL(aboutToShow(QWidget*)), this, SLOT(aboutToShow(QWidget*)));
    connect(m_search->wndResult, SIGNAL(aboutToShow(QWidget*)), this, SLOT(resultShow(QWidget*)));
    fillClients();
    connect(m_search->cmbClients, SIGNAL(activated(int)), this, SLOT(clientActivated(int)));
    m_result = new ListView(m_search->wndResult);
    m_result->addColumn(i18n("Results"));
    m_result->setShowSortIndicator(true);
    m_result->setExpandingColumn(0);
    m_result->setFrameShadow(QFrame::Sunken);
    m_result->setLineWidth(1);
    addResult(m_result);
    showResult(NULL);
    aboutToShow(m_search->wndCondition->visibleWidget());
    connect(m_search->btnSearch, SIGNAL(clicked()), this, SLOT(searchClick()));
    m_search->cmbClients->setFocus();
    connect(m_search->btnOptions, SIGNAL(clicked()), this, SLOT(optionsClick()));
    connect(m_search->btnAdd, SIGNAL(clicked()), this, SLOT(addClick()));
    m_search->btnOptions->setEnabled(false);
    m_search->btnAdd->setEnabled(false);
    connect(m_result, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
    connect(m_result, SIGNAL(dragStart()), this, SLOT(dragStart()));
    connect(m_search->btnNew, SIGNAL(clicked()), this, SLOT(newSearch()));
    m_result->setMenu(MenuSearchItem);
    resultShow(m_result);
}
Esempio n. 21
0
ConnectionManager::ConnectionManager(bool bModal)
        : ConnectionManagerBase(NULL, "manager", bModal)
{
    SET_WNDPROC("manager")
    setIcon(Pict("configure"));
    setButtonsPict(this);
    setCaption(caption());
    lstConnection->setHScrollBarMode(QScrollView::AlwaysOff);
    lstConnection->header()->hide();
    lstConnection->setSorting(1);
    fill();
    connect(btnAdd, SIGNAL(clicked()), this, SLOT(addClient()));
    connect(btnRemove, SIGNAL(clicked()), this, SLOT(removeClient()));
    connect(btnUp, SIGNAL(clicked()), this, SLOT(upClient()));
    connect(btnDown, SIGNAL(clicked()), this, SLOT(downClient()));
    connect(btnUpdate, SIGNAL(clicked()), this, SLOT(updateClient()));
    connect(lstConnection, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
    m_bModal = bModal;
}
Esempio n. 22
0
EditMail::EditMail(QWidget *parent, const QString &mail, bool bPublish, bool bShowPublish)
        : QDialog( parent)
{
    this->setAttribute( Qt::WA_DeleteOnClose);
    setupUi( this);
    SET_WNDPROC("editmail")
    setIcon(Pict("mail_generic").pixmap());
    setButtonsPict(this);
    setCaption(mail.isEmpty() ? i18n("Add mail address") : i18n("Edit mail address"));
    edtMail->setText(mail);
    connect(edtMail, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&)));
    textChanged(mail);
    edtMail->setFocus();
    publish = bPublish;
    if (bShowPublish){
        chkPublish->setChecked(publish);
    }else{
        chkPublish->hide();
    }
}
Esempio n. 23
0
MigrateDialog::MigrateDialog(const QString &dir, const QStringList &cnvDirs)
        : MigrateDialogBase(NULL, "migrate", true)
{
    SET_WNDPROC("migrate")
    setCaption(caption());
    m_dir      = dir;
    m_cnvDirs  = cnvDirs;
    m_bProcess = false;
    QVBoxLayout *lay = (QVBoxLayout*)(page1->layout());
    for (QStringList::Iterator it = m_cnvDirs.begin(); it != m_cnvDirs.end(); ++it){
        QCheckBox *chk = new QCheckBox(*it, page1);
        lay->insertWidget(1, chk);
        chk->show();
        chk->setChecked(true);
        m_boxes.push_back(chk);
    }
    chkRemove->setChecked(true);
    connect(this, SIGNAL(selected(const QString&)), this, SLOT(pageSelected(const QString&)));
    helpButton()->hide();
}
Esempio n. 24
0
ProxyError::ProxyError(ProxyPlugin *plugin, TCPClient *client, const char *msg)
        : ProxyErrorBase(NULL, NULL, false, WDestructiveClose)
{
    SET_WNDPROC("proxy")
    setIcon(Pict("error"));
    setButtonsPict(this);
    setCaption(caption());
    m_plugin = plugin;
    m_client = client;
    if (msg && *msg)
        lblMessage->setText(i18n(msg));
    if (layout() && layout()->inherits("QBoxLayout")){
        QBoxLayout *lay = static_cast<QBoxLayout*>(layout());
        ProxyConfig *cfg = new ProxyConfig(this, m_plugin, NULL, m_client);
        lay->insertWidget(1, cfg);
        cfg->show();
        setMinimumSize(sizeHint());
        connect(this, SIGNAL(apply()), cfg, SLOT(apply()));
    }
}
Esempio n. 25
0
LoginDialog::LoginDialog(bool bInit, Client *client, const QString &text, const char *loginProfile)
        : LoginDialogBase(NULL, "logindlg",
                          client ? false : true,
                          client ? WDestructiveClose : 0)
{
    m_bInit  = bInit;
    m_bProfileChanged = false;
    m_profile = CorePlugin::m_plugin->getProfile();
    m_client = client;
    m_bLogin = false;
    if (loginProfile && *loginProfile){
        m_loginProfile = loginProfile;
    }else{
        btnDelete->hide();
    }
    SET_WNDPROC("login")
    setButtonsPict(this);
    lblMessage->setText(text);
    if (m_client){
        setCaption(caption() + " " + QString::fromLocal8Bit(client->name().c_str()));
        setIcon(Pict(m_client->protocol()->description()->icon));
    }else{
        setCaption(i18n("Select profile"));
        setIcon(Pict("licq"));
    }
    if (m_client){
        chkSave->hide();
        chkNoShow->hide();
        btnDelete->hide();
        cmbProfile->hide();
        lblProfile->hide();
    }
    chkSave->setChecked(CorePlugin::m_plugin->getSavePasswd());
    chkNoShow->setChecked(CorePlugin::m_plugin->getNoShow());
    connect(chkSave, SIGNAL(toggled(bool)), this, SLOT(saveToggled(bool)));
    saveToggled(CorePlugin::m_plugin->getSavePasswd());
    fill();
    connect(cmbProfile, SIGNAL(activated(int)), this, SLOT(profileChanged(int)));
    connect(btnDelete, SIGNAL(clicked()), this, SLOT(profileDelete()));
    profileChanged(cmbProfile->currentItem());
}
Esempio n. 26
0
HistoryWindow::HistoryWindow(unsigned long id)
{
    m_history_page_count=CorePlugin::m_plugin->getHistoryPage();

    setWFlags(WDestructiveClose);
    m_id = id;
    SET_WNDPROC("history")
    setIcon(Pict("history"));
    setName();
    m_view = new MsgViewBase(this, NULL, id);
    setCentralWidget(m_view);
    BarShow b;
    b.bar_id = BarHistory;
    b.parent = this;
    Event e(EventShowBar, &b);
    m_bar = (CToolBar*)e.process();
    m_bar->setParam((void*)m_id);
    restoreToolbar(m_bar, CorePlugin::m_plugin->data.historyBar);
    connect(this, SIGNAL(toolBarPositionChanged(QToolBar*)), this, SLOT(toolbarChanged(QToolBar*)));
    m_status = statusBar();
    m_progress = NULL;
    m_page = 0;

    Command cmd;
    cmd->id		= CmdHistoryFind;
    cmd->param	= (void*)m_id;
    Event eWidget(EventCommandWidget, cmd);
    CToolCombo *cmbFind = (CToolCombo*)(eWidget.process());
    if (cmbFind){
        QString history = CorePlugin::m_plugin->getHistorySearch();
        while (history.length()){
            cmbFind->insertItem(getToken(history, ';'));
        }
        cmbFind->setText(QString::null);
    }
    m_it	= NULL;
    m_bDirection = CorePlugin::m_plugin->getHistoryDirection();
    m_bar->checkState();
    m_bar->show();
    fill();
}
Esempio n. 27
0
/*
 * CreateContainerWindow
 */
window_id CreateContainerWindow( RECT *size )
{
    HWND    container;
    CLIENTCREATESTRUCT client;

    client.hWindowMenu = (HMENU)NULLHANDLE;
    client.idFirstChild = 3000; // some arbitrary number that doesn't conflict

    container = CreateWindow( className, "Container",
                WS_CHILD | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE,
                size->left, size->top,
                size->right - size->left, size->bottom - size->top,
                root_window_id, (HMENU)NULLHANDLE, InstanceHandle, (LPVOID)&client );
    SET_WNDINFO( container, 0 );
    oldContainerProc = (WNDPROC)GET_WNDPROC( container );
    SET_WNDPROC( container, (LONG_PTR)MakeWndProcInstance( ContainerWindowProc, InstanceHandle ) );
    SetScrollRange( container, SB_VERT, 1, 1, FALSE );
    SetScrollRange( container, SB_HORZ, 1, 1, FALSE );
    return( container );

} /* CreateContainerWindow */
Esempio n. 28
0
JabberBrowser::JabberBrowser(JabberClient *client)
        : QMainWindow(NULL, NULL, WDestructiveClose)
{
    m_client = client;
    m_info   = NULL;

    SET_WNDPROC("jbrowser")
    setIcon(Pict("Jabber_online"));
    setTitle();
    m_status = statusBar();
    m_list = new ListView(this);
    m_list->addColumn(i18n("JID"));
    m_list->addColumn(i18n("Name"));
    m_list->addColumn(i18n("Node"));
    m_list->setExpandingColumn(1);
    connect(m_list, SIGNAL(clickItem(QListViewItem*)), this, SLOT(clickItem(QListViewItem*)));
    connect(m_list, SIGNAL(dragStart()), this, SLOT(dragStart()));

    BarShow b;
    b.bar_id = static_cast<JabberPlugin*>(m_client->protocol()->plugin())->BarBrowser;
    b.parent = this;
    Event e(EventShowBar, &b);
    m_bar = (CToolBar*)e.process();
    m_bar->setParam(this);
    restoreToolbar(m_bar, m_client->data.browser_bar);
    m_bar->show();
    setCentralWidget(m_list);
    m_historyPos = -1;

    Command cmd;
    cmd->id		= static_cast<JabberPlugin*>(m_client->protocol()->plugin())->CmdUrl;
    cmd->param	= this;
    Event eWidget(EventCommandWidget, cmd);
    CToolCombo *cmbFind = (CToolCombo*)(eWidget.process());
    if (cmbFind)
        cmbFind->setText(QString::null);

	m_search = NULL;
	m_reg    = NULL;
}
Esempio n. 29
0
DiscoInfo::DiscoInfo(JabberBrowser *browser, const QString &features,
                     const QString &name, const QString &type, const QString &category)
        : QDialog( NULL)
{
    setAttribute( Qt::WA_DeleteOnClose);
    setupUi( this);
    m_browser = browser;
    SET_WNDPROC("jbrowser")
    setIcon(Pict("Jabber_online").pixmap());
    setTitle();
    setButtonsPict(this);
    connect(buttonApply, SIGNAL(clicked()), this, SLOT(apply()));
    m_bVersion = true;
    m_bTime    = true;
    m_bLast	   = true;
    m_bStat	   = true;
    m_bVCard   = true;
    m_about    = NULL;
    m_features = features;
    m_name	   = name;
    m_type	   = type;
    m_category = category;
    load_data(jabberUserData, &m_data, NULL);
    disableWidget(edtJName);
    disableWidget(edtType);
    disableWidget(edtCategory);
    edtNameSpace->setReadOnly(true);
    disableWidget(edtName);
    disableWidget(edtVersion);
    disableWidget(edtSystem);
    disableWidget(edtTime);
    disableWidget(edtLast);
    lstStat->addColumn(i18n("Name"));
    lstStat->addColumn(i18n("Units"));
    lstStat->addColumn(i18n("Value"));
    lstStat->setExpandingColumn(2);
    btnUrl->setPixmap(Pict("home").pixmap());
    connect(btnUrl, SIGNAL(clicked()), this, SLOT(goUrl()));
    connect(edtUrl, SIGNAL(textChanged(const QString&)), this, SLOT(urlChanged(const QString&)));
}
Esempio n. 30
0
AutoReplyDialog::AutoReplyDialog(unsigned status)
        : AutoReplyBase(NULL, NULL, true)
{
    m_status = status;
    SET_WNDPROC("mainwnd");
    const char *text = NULL;
    const char *icon = NULL;
    for (unsigned i = 0; i < getContacts()->nClients(); i++){
        for (const CommandDef *d = getContacts()->getClient(i)->protocol()->statusList(); d->text; d++){
            if (d->id == status){
                text = d->text;
                icon = d->icon;
                break;
            }
        }
        if (text)
            break;
    }
    if (text == NULL)
        return;
    setCaption(i18n("Autoreply message") + " " + i18n(text));
    setIcon(Pict(icon));
    m_time = 16;
    m_timer = new QTimer(this);
    connect(m_timer, SIGNAL(timeout()), this, SLOT(timeout()));
    m_timer->start(1000);
    ARUserData *ar = (ARUserData*)getContacts()->getUserData(CorePlugin::m_plugin->ar_data_id);
    text = get_str(ar->AutoReply, m_status);
    if ((text == NULL) || (*text == 0))
        text = get_str(ar->AutoReply, m_status);
    if (text)
        edtAutoResponse->setText(QString::fromUtf8(text));
    connect(edtAutoResponse, SIGNAL(textChanged()), this, SLOT(textChanged()));
    connect(chkNoShow, SIGNAL(toggled(bool)), this, SLOT(toggled(bool)));
	connect(btnHelp, SIGNAL(clicked()), this, SLOT(help()));
}