Пример #1
0
NewTransferDlg::NewTransferDlg(QWidget* parent)
: QDialog(parent), m_bDetails(false), m_bPaused(false), m_nDownLimit(0),
		m_nUpLimit(0), m_nClass(-1), m_mode(Transfer::Download),
		m_nQueue(0)
{
	setupUi(this);

	textURIs->setFocus(Qt::OtherFocusReason);
	spinDown->setRange(0,INT_MAX);
	spinUp->setRange(0,INT_MAX);
	
	connect(toolBrowse, SIGNAL(pressed()), this, SLOT(browse()));
	connect(radioDownload, SIGNAL(clicked()), this, SLOT(switchMode()));
	connect(radioUpload, SIGNAL(clicked()), this, SLOT(switchMode()));
	connect(pushAddFiles, SIGNAL(clicked()), this, SLOT(browse2()));
	connect(toolAuth, SIGNAL(clicked()), this, SLOT(authData()));
	connect(toolAuth2, SIGNAL(clicked()), this, SLOT(authData()));
	
	comboClass->addItem(tr("Auto detect"));
	
	for(int i=0;i<g_enginesDownload.size();i++)
		comboClass->addItem(g_enginesDownload[i].longName);
	
	comboClass2->addItem(tr("Auto detect"));
	
	for(int i=0;i<g_enginesUpload.size();i++)
		comboClass2->addItem(g_enginesUpload[i].longName);
	
	QMenu* menu = new QMenu(toolAddSpecial);
	QAction* act;
	
	act = menu->addAction(tr("Add local files..."));
	connect(act, SIGNAL(triggered()), this, SLOT(browse2()));
	
	act = menu->addAction(tr("Add contents of a text file..."));
	connect(act, SIGNAL(triggered()), this, SLOT(addTextFile()));
	
	act = menu->addAction(tr("Add from clipboard"));
	connect(act, SIGNAL(triggered()), this, SLOT(addClipboard()));
	
	toolAddSpecial->setMenu(menu);
}
Пример #2
0
//! [0]
Window::Window(QWidget *parent)
    : QWidget(parent)
{
    browseButton = createButton(tr("&Browse..."), SLOT(browse()));
    findButton = createButton(tr("&Find"), SLOT(find()));
    tinyAllButton = createButton(tr("&Tiny"), SLOT(tinyAll()));
    outBrowseButton = createButton(tr("&Browse..."), SLOT(browse2()));

    fileComboBox = createComboBox(tr("*"));
    textComboBox = createComboBox();
    directoryComboBox = createComboBox(QDir::currentPath());
    outDirectoryComboBox = createComboBox(QDir::currentPath());
    tokenComboBox = createComboBox(tr("HyDxVk41AiyRezVSYFaycTqq1jwgDmm9"));

    fileLabel = new QLabel(tr("Named:"));
    textLabel = new QLabel(tr("Containing text:"));
    tokenLabel = new QLabel(tr("Token:"));
    directoryLabel = new QLabel(tr("In directory:"));
    outDirecotryLabel = new QLabel(tr("Out Directory"));
    filesFoundLabel = new QLabel;

    createFilesTable();
//! [0]

//! [1]
    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(fileLabel, 0, 0);
    mainLayout->addWidget(fileComboBox, 0, 1, 1, 2);
    mainLayout->addWidget(textLabel, 1, 0);
    mainLayout->addWidget(textComboBox, 1, 1, 1, 2);
    mainLayout->addWidget(tokenLabel, 2, 0);
    mainLayout->addWidget(tokenComboBox, 2, 1, 1, 2);
    mainLayout->addWidget(directoryLabel, 3, 0);
    mainLayout->addWidget(directoryComboBox, 3, 1);
    mainLayout->addWidget(browseButton, 3, 2);
    mainLayout->addWidget(outDirecotryLabel, 4, 0);
    mainLayout->addWidget(outDirectoryComboBox, 4, 1);
    mainLayout->addWidget(outBrowseButton, 4, 2);
    mainLayout->addWidget(filesTable, 5, 0, 1, 3);
    mainLayout->addWidget(filesFoundLabel, 6, 1, 1, 2);
    mainLayout->addWidget(tinyAllButton, 6, 2);
    mainLayout->addWidget(findButton, 6, 0);
    setLayout(mainLayout);

    setWindowTitle(tr("*・゜゚・*:.。..。.:*・'(*゚▽゚*)'・*:.。. .。.:*・゜゚・*"));
    resize(700, 700);
}