示例#1
0
void MassMessaging::onActionTriggered()
{
	if (!m_dialog) {
		m_dialog = new MessagingDialog();
		centerizeWidget(m_dialog);
	}
#ifdef Q_WS_MAEMO_5
	m_dialog->setParent(QApplication::activeWindow());
	m_dialog->setWindowFlags(m_dialog->windowFlags() | Qt::Window);
	m_dialog->setAttribute(Qt::WA_Maemo5StackedWindow);
#endif
	SystemIntegration::show(m_dialog);
}
示例#2
0
void Module::onSelectTagsTriggered()
{
    QStringList tags = p->model->tags();
    TagsFilterDialog *dialog = new TagsFilterDialog(tags, p->widget);
    if (!p->model->selectedTags().isEmpty())
        tags = p->model->selectedTags().toList();
    dialog->setSelectedTags(tags);
    SystemIntegration::show(dialog);
    centerizeWidget(dialog);
    if (dialog->exec()) {
        p->model->filterList(dialog->selectedTags());
    }
    dialog->deleteLater();
}
示例#3
0
void Module::onSelectTagsTriggered()
{
	QStringList tags = p->model->property("tags").toStringList();
    TagsFilterDialog *dialog = new TagsFilterDialog(tags, p->widget);
	QStringList selectedTags = p->model->property("filterTags").toStringList();
	if (selectedTags.isEmpty())
		selectedTags = tags;
	dialog->setSelectedTags(selectedTags);
    SystemIntegration::show(dialog);
    centerizeWidget(dialog);
    if (dialog->exec()) {
		selectedTags = dialog->selectedTags();
		p->model->setProperty("filterTags", selectedTags);
    }
    dialog->deleteLater();
}
示例#4
0
HistoryWindow::HistoryWindow(const ChatUnit *unit)
{
	ui.setupUi(this);

	ui.historyLog->setHtml("<p align='center'><span style='font-size:36pt;'>"
			+ tr("No History") + "</span></p>");
	ui.label_in->setText( tr( "In: %L1").arg( 0 ) );
	ui.label_out->setText( tr( "Out: %L1").arg( 0 ) );
	ui.label_all->setText( tr( "All: %L1").arg( 0 ) );
	Shortcut *shortcut = new Shortcut("findNext", this);
	connect(shortcut, SIGNAL(activated()), ui.searchButton, SLOT(click()));
	shortcut = new Shortcut("findPrevious", this);
	connect(shortcut, SIGNAL(activated()), SLOT(findPrevious()));

	centerizeWidget(this);
	setAttribute(Qt::WA_QuitOnClose, false);
	setAttribute(Qt::WA_DeleteOnClose, true);
	QList<int> sizes;
	sizes.append(80);
	sizes.append(250);
	ui.splitter->setSizes(sizes);
	ui.splitter->setCollapsible(1,false);
	setIcons();

	m_unitInfo = unit ? History::info(unit) : History::ContactInfo();

	connect(ui.dateTreeWidget, &QTreeWidget::itemExpanded, this, &HistoryWindow::fillMonth);

	fillAccountComboBox();

	setParent(QApplication::activeWindow());
	setWindowFlags(windowFlags() | Qt::Window);

	QAction *action = new QAction(tr("Close"),this);
	connect(action, SIGNAL(triggered()), SLOT(close()));
	addAction(action);
	SystemIntegration::show(this);
}
示例#5
0
XSettingsWindow::XSettingsWindow(const qutim_sdk_0_3::SettingsItemList& settings, QObject* controller, QWidget *parent) :
	QMainWindow(parent),
	p(new XSettingsWindowPrivate)
{
	setAttribute(Qt::WA_DeleteOnClose);
	p->controller = controller;
    setWindowModality(controller ? Qt::WindowModal : Qt::NonModal);
	//setup ui
	QWidget *w = new QWidget(this);
	QVBoxLayout *l = new QVBoxLayout(w);
	Config cfg;
	cfg.beginGroup("xsettings/window");
	QByteArray data;

	p->parent = qobject_cast<XSettingsWindow*>(qApp->activeWindow());
	if(p->parent) {
		QRect geom = p->parent->geometry();
		int width = geom.width()/15;
		int height = geom.height()/15;
		geom.adjust(width,height,-width,-height);
		setGeometry(geom);
	} else {
		data = cfg.value("geometry", QByteArray());
		if (data.isEmpty() || !restoreGeometry(data)) {
			QSize desktopSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
			resize(desktopSize.width() / 2, desktopSize.height() * 2 / 3);
			centerizeWidget(this);
		}
	}
	//init widgets
	p->splitter = new QSplitter(Qt::Horizontal,w);
	p->listWidget = new QListWidget(w);

	p->stackedWidget = new QStackedWidget(w);
	//default widget
	QWidget *empty = new QWidget(this);

	p->stackedWidget->addWidget(empty);
	p->splitter->addWidget(p->listWidget);
	p->splitter->addWidget(p->stackedWidget);
	data = cfg.value("splitterState", QByteArray());
	if (data.isEmpty() || !p->splitter->restoreState(data))
		p->splitter->setSizes(QList<int>() << 80  << 250);
	l->addWidget(p->splitter);

    QDialogButtonBox::StandardButtons buttons;
    if (controller)
        buttons = QDialogButtonBox::Ok;
    else
        buttons = QDialogButtonBox::Save | QDialogButtonBox::Cancel;

    p->buttonBox = new QDialogButtonBox(buttons, Qt::Horizontal, w);
	l->addWidget(p->buttonBox);
    p->buttonBox->setVisible(controller);
	//init actiontoolbar
	setCentralWidget(w);
    setUnifiedTitleAndToolBarOnMac(true);

	p->toolBar = new ActionToolBar(w);
	addToolBar(Qt::TopToolBarArea,p->toolBar);

	int width = style()->pixelMetric(QStyle::PM_IconViewIconSize);
	QSize size = QSize(width, width);

	p->toolBar->setIconSize(size);
	p->toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
	p->toolBar->setObjectName(QLatin1String("SettingsBar"));
	p->toolBar->setMovable(false);

#if defined (Q_WS_WIN32) || defined(Q_WS_MAC)
	width = 22;
#else
	width = style()->pixelMetric(QStyle::PM_ToolBarIconSize);
#endif
	size = QSize(width, width);
	p->listWidget->setIconSize(size);

	p->group = new QActionGroup(w);
	p->group->setExclusive(true);
	//connections
    connect(p->group,SIGNAL(triggered(QAction*)), SLOT(onGroupActionTriggered(QAction*)));
	connect(p->listWidget,
			SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
			SLOT(onCurrentItemChanged(QListWidgetItem*))
			);
    connect(p->buttonBox,SIGNAL(accepted()), SLOT(save()));
    connect(p->buttonBox,SIGNAL(rejected()), SLOT(cancel()));
	loadSettings(settings);
	if (p->group->actions().count())
		p->group->actions().first()->trigger();
}