Esempio n. 1
0
int ConnectDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: currentConnectionTypeChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: updateVisibility(); break;
        case 2: saveAsDefault(); break;
        case 3: saveCurrentAsProfile(); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}
Esempio n. 2
0
bool VideoFilterDialog::Create()
{
    if (!LoadWindowFromXML("video-ui.xml", "filter", this))
        return false;

    bool err = false;
    UIUtilE::Assign(this, m_textfilter, "textfilter_input", &err);
    UIUtilE::Assign(this, m_yearList, "year_select", &err);
    UIUtilE::Assign(this, m_userratingList, "userrating_select", &err);
    UIUtilE::Assign(this, m_categoryList, "category_select", &err);
    UIUtilE::Assign(this, m_countryList, "country_select", &err);
    UIUtilE::Assign(this, m_genreList, "genre_select", &err);
    UIUtilE::Assign(this, m_castList, "cast_select", &err);
    UIUtilE::Assign(this, m_runtimeList, "runtime_select", &err);
    UIUtilE::Assign(this, m_browseList, "browse_select", &err);
    UIUtilE::Assign(this, m_watchedList, "watched_select", &err);
    UIUtilE::Assign(this, m_inetrefList, "inetref_select", &err);
    UIUtilE::Assign(this, m_coverfileList, "coverfile_select", &err);
    UIUtilE::Assign(this, m_orderbyList, "orderby_select", &err);

    UIUtilE::Assign(this, m_doneButton, "done_button", &err);
    UIUtilE::Assign(this, m_saveButton, "save_button", &err);

    UIUtilE::Assign(this, m_numvideosText, "numvideos_text", &err);

    if (err)
    {
        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'filter'");
        return false;
    }

    BuildFocusList();

    fillWidgets();
    update_numvideo();

    connect(m_yearList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetYear(MythUIButtonListItem*)));
    connect(m_userratingList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetUserRating(MythUIButtonListItem*)));
    connect(m_categoryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetCategory(MythUIButtonListItem*)));
    connect(m_countryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(setCountry(MythUIButtonListItem*)));
    connect(m_genreList,SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(setGenre(MythUIButtonListItem*)));
    connect(m_castList,SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetCast(MythUIButtonListItem*)));
    connect(m_runtimeList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(setRunTime(MythUIButtonListItem*)));
    connect(m_browseList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetBrowse(MythUIButtonListItem*)));
    connect(m_watchedList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetWatched(MythUIButtonListItem*)));
    connect(m_inetrefList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetInetRef(MythUIButtonListItem*)));
    connect(m_coverfileList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(SetCoverFile(MythUIButtonListItem*)));
    connect(m_orderbyList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            SLOT(setOrderby(MythUIButtonListItem*)));
    connect(m_textfilter, SIGNAL(valueChanged()),
            SLOT(setTextFilter()));

    connect(m_saveButton, SIGNAL(Clicked()), SLOT(saveAsDefault()));
    connect(m_doneButton, SIGNAL(Clicked()), SLOT(saveAndExit()));

    return true;
}
Esempio n. 3
0
KSSH::KSSH(QWidget *parent)
    : QDialog(parent)
{
    setupUi(this);

    QLayout *lay;
    lay = layout();
    if (lay)
        lay->setSizeConstraint(QLayout::SetFixedSize);

    opt = false;
    mopt = false;

    editorF->hide();

    QSize s = size();

    QPoint p(s.width(), s.height());
    QPoint po = pos();
    QDesktopWidget *d = QApplication::desktop();
    int w = d->width();                   // returns desktop width
    int h = d->height ();                  // returns desktop height
    int x = 0, y = 0;
    if ((p + po).x()>w)
        po.setX(x = w-p.x());
    if ((p + po).y()>h)
        po.setY(y = h-p.y());

    if (x<0)
        po.setX(0);
    if (y<0)
        po.setY(0);

    move(po);
    optionsGB->hide();
    moreF->hide();

    adjustSize();

    compUser = new KCompletion();
    userCB->setCompletionObject(compUser);

    compHost = new KCompletion();

    hostCB->setCompletionObject(compHost);

    hostCB->setFocus();

    connect(hostCB, SIGNAL(editTextChanged(const QString&)), this, SLOT(userFor(const QString&)));

    connect(compHost, SIGNAL(match(const QString&)), this, SLOT(userFor(const QString&)));

    userCB->insertItem(1, "");
    hostCB->insertItem(2, "");

    loadHosts();

    loadOptions("DefaultConfig");

    connect(aboutPB, SIGNAL(clicked()), this, SLOT(about()));
    connect(optionsPB, SIGNAL(clicked()), this, SLOT(options()));
    connect(morePB, SIGNAL(clicked()), this, SLOT(moreOptions()));

    connect(hostTB, SIGNAL(clicked()), this, SLOT(hostEditor()));
    connect(userTB, SIGNAL(clicked()), this, SLOT(userEditor()));
    connect(cancelPB, SIGNAL(clicked()), this, SLOT(cancelEditor()));
    connect(okPB, SIGNAL(clicked()), this, SLOT(okEditor()));

    connect(connectPB, SIGNAL(clicked()), this, SLOT(ssh()));
    connect(savePB, SIGNAL(clicked()), this, SLOT(saveAsDefault()));
    connect(quitPB, SIGNAL(clicked()), this, SLOT(exitHandler()));

    KConfigGroup general_group = KGlobal::config()->group("General");

    int fi = hostCB->findText(general_group.readEntry("LastHost"));
    if (fi)
        hostCB->setCurrentIndex(fi);

    int def = KGlobalSettings::completionMode();
    int mode = general_group.readEntry("HostCompletionMode", def);
    hostCB->setCompletionMode((KGlobalSettings::Completion) mode);

    mode = general_group.readEntry("UserCompletionMode", def);
    userCB->setCompletionMode((KGlobalSettings::Completion)mode);
    setWindowIcon(KIcon("kssh.png"));
}