Example #1
0
ByWeekdayColumnWidget::ByWeekdayColumnWidget(QString weekdayId, bool reverse, QWidget *parent) :
    QWidget(parent),
    weekdayId(weekdayId),
    reverse(reverse)
{
    listLayout = new QVBoxLayout(this);
    listLayout->setContentsMargins(0, 0, 0, 0);
    listLayout->setSpacing(0);

    QPushButton *addButton = new QPushButton(QIcon::fromTheme("general_add"), QString(), this);
    addButton->setMinimumWidth(1);
    listLayout->addWidget(addButton);

    connect(addButton, SIGNAL(clicked()), this, SLOT(showAddDialog()));
}
Example #2
0
void jAccount::createStatusMenu()
{
	m_conference_menu = new QMenu();
	m_conference_menu->setTitle(tr("Conferences"));
	m_join_groupchat = new QAction(tr("Join groupchat"), this);
	connect(m_join_groupchat, SIGNAL(triggered()), m_conference_management_object, SLOT(joinGroupchat()));
	m_conference_menu->addAction(m_join_groupchat);

	m_additional_menu = new QMenu();
	m_additional_menu->setTitle(tr("Additional"));
	m_join_group_chat = new QAction(tr("Join groupchat"), this);
	m_join_group_chat->setVisible(false);
	m_change_resource = new QAction(tr("Change resource"), this);
	m_open_xml_console = new QAction(tr("Open XML console"), this);
	m_add_contact = new QAction(tr("Add new contact"), this);
	m_transport_browser = new QAction(tr("Transports"), this);
	m_other_browser = new QAction(tr("Other Services"), this);

	QAction *bookmark_action = new QAction(jPluginSystem::instance().getIcon("bookmarkstorage"),tr("Bookmarks"),this);
	bookmark_action->setVisible(false);
//	m_jabber_protocol->setBookmarkAction(m_bookmark_action);
//	m_bookmark_action->setEnabled(false);

	QAction *mood_action = new QAction(jPluginSystem::instance().getIcon("mood"),tr("Set mood"),this);
	mood_action->setEnabled(false);
	QAction *activity_action = new QAction(jPluginSystem::instance().getIcon("activity"),tr("Set activity"),this);
	activity_action->setEnabled(false);
	m_jabber_protocol->setActions(bookmark_action, mood_action, activity_action);

	m_join_group_chat->setIcon(QIcon(":/icons/chat"));
	m_additional_menu->addAction(m_join_group_chat);

//	m_change_resource->setIcon(QIcon(":/icons/chat"));
	connect(m_transport_browser, SIGNAL(triggered()),
			this, SLOT(showTransportsBrowser()));
	m_additional_menu->addAction(m_transport_browser);

	connect(m_other_browser, SIGNAL(triggered()),
			this, SLOT(showOtherServicesBrowser()));
	m_additional_menu->addAction(m_other_browser);

	m_additional_menu->addSeparator();

	connect(m_change_resource, SIGNAL(triggered()),
			this, SLOT(showChangeResourceDialog()));
	m_additional_menu->addAction(m_change_resource);

	connect(m_open_xml_console, SIGNAL(triggered()),
			m_jabber_slotsignal, SLOT(createXmlConsole()));
	m_additional_menu->addAction(m_open_xml_console);


	//m_add_contact->setIcon(QIcon(":/icons/servdisco"));
	connect(m_add_contact, SIGNAL(triggered()), this, SLOT(showAddDialog()));
	m_additional_menu->addAction(m_add_contact);

	onlineAction = new QAction(m_jabber_plugin_system.getStatusIcon("online", "jabber"), tr("Online"), this);
	connect(onlineAction, SIGNAL(triggered()), this, SLOT(setStatus()));
	statusMenuActions.insert("online", onlineAction);

	offlineAction = new QAction(m_jabber_plugin_system.getStatusIcon("offline", "jabber"), tr("Offline"), this);
	connect(offlineAction, SIGNAL(triggered()), this, SLOT(setStatus()));
	statusMenuActions.insert("offline", offlineAction);

	ffcAction = new QAction(m_jabber_plugin_system.getStatusIcon("ffc", "jabber"), tr("Free for chat"), this);
	connect(ffcAction, SIGNAL(triggered()), this, SLOT(setStatus()));
	statusMenuActions.insert("ffc", ffcAction);

	awayAction = new QAction(m_jabber_plugin_system.getStatusIcon("away", "jabber"), tr("Away"), this);
	connect(awayAction, SIGNAL(triggered()), this, SLOT(setStatus()));
	statusMenuActions.insert("away", awayAction);

	xaAction = new QAction(m_jabber_plugin_system.getStatusIcon("na", "jabber"), tr("NA"), this);
	connect(xaAction, SIGNAL(triggered()), this, SLOT(setStatus()));
	statusMenuActions.insert("na", xaAction);

	dndAction = new QAction(m_jabber_plugin_system.getStatusIcon("dnd", "jabber"), tr("DND"), this);
	connect(dndAction, SIGNAL(triggered()), this, SLOT(setStatus()));
	statusMenuActions.insert("dnd", dndAction);

	QHashIterator<QString, QAction *> iterator(statusMenuActions);
	while (iterator.hasNext())
	{
		iterator.next();
		iterator.value()->setCheckable(true);
	}

	m_status_menu = new QMenu();
	m_status_menu->setTitle(m_account_name);
	m_status_menu->setIcon(m_jabber_plugin_system.getStatusIcon("offline", "jabber"));

	m_status_menu->addAction(onlineAction);
	m_status_menu->addAction(ffcAction);
	m_status_menu->addAction(awayAction);
	m_status_menu->addAction(xaAction);
	m_status_menu->addAction(dndAction);
	m_status_menu->addSeparator();
	m_status_menu->addAction(mood_action);
	m_status_menu->addAction(activity_action);
	m_status_menu->addAction(bookmark_action);
	m_status_menu->addMenu(m_additional_menu);
	m_status_menu->addMenu(m_conference_menu);
	m_status_menu->addSeparator();
	m_status_menu->addAction(offlineAction);

	offlineAction->setChecked(true);
}