Esempio n. 1
0
void ChatEditBox::init()
{
	chatEditBoxes.append(this);

	Context = static_cast<BaseActionContext *>(actionContext());

	ChangeNotifierLock lock(Context->changeNotifier());

	RoleSet roles;
	if (CurrentChat.contacts().size() > 1)
		roles.insert(ChatRole);
	else
		roles.insert(BuddyRole);
	Context->setRoles(roles);

	Context->setChat(CurrentChat);
	Context->setContacts(CurrentChat.contacts());
	Context->setBuddies(CurrentChat.contacts().toBuddySet());
	updateContext();

	connect(m_statusConfigurationHolder, SIGNAL(setStatusModeChanged()), this, SLOT(updateContext()));

	InputBox = injectedFactory()->makeInjected<CustomInput>(CurrentChat, this);
	InputBox->setWordWrapMode(QTextOption::WordWrap);

	setCentralWidget(InputBox);

	bool old_top = loadOldToolBarsFromConfig("chatTopDockArea", Qt::TopToolBarArea);
	bool old_middle = loadOldToolBarsFromConfig("chatMiddleDockArea", Qt::TopToolBarArea);
	bool old_bottom = loadOldToolBarsFromConfig("chatBottomDockArea", Qt::BottomToolBarArea);
	bool old_left = loadOldToolBarsFromConfig("chatLeftDockArea", Qt::LeftToolBarArea);
	bool old_right = loadOldToolBarsFromConfig("chatRightDockArea", Qt::RightToolBarArea);

	if (old_top || old_middle || old_bottom || old_left || old_right)
		writeToolBarsToConfig(); // port old config
	else
		loadToolBarsFromConfig(); // load new config

// 	connect(m_chatWidgetActions->colorSelector(), SIGNAL(actionCreated(Action *)),
// 			this, SLOT(colorSelectorActionCreated(Action *)));
	connect(InputBox, SIGNAL(keyPressed(QKeyEvent *,CustomInput *, bool &)),
			this, SIGNAL(keyPressed(QKeyEvent *,CustomInput *,bool &)));
	connect(InputBox, SIGNAL(fontChanged(QFont)), this, SLOT(fontChanged(QFont)));
	connect(InputBox, SIGNAL(cursorPositionChanged()), this, SLOT(cursorPositionChanged()));

	connect(m_chatConfigurationHolder, SIGNAL(chatConfigurationUpdated()), this, SLOT(configurationUpdated()));

	configurationUpdated();
}
Esempio n. 2
0
File: tabs.cpp Progetto: vogel/kadu
void TabsManager::init()
{
    kdebugf();

    setState(StateNotLoaded);

    createDefaultConfiguration();

    connect(m_chatWidgetRepository, SIGNAL(chatWidgetRemoved(ChatWidget*)), this, SLOT(onDestroyingChat(ChatWidget *)));

    TabDialog = m_pluginInjectedFactory->makeInjected<TabWidget>(this);
    TabDialog->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(TabDialog, SIGNAL(currentChanged(int)), this, SLOT(onTabChange(int)));
    connect(TabDialog, SIGNAL(contextMenu(QWidget *, const QPoint &)),
            this, SLOT(onContextMenu(QWidget *, const QPoint &)));

    connect(Title, SIGNAL(titleChanged()), this, SLOT(onTitleChanged()));

    new WindowGeometryManager(new ConfigFileVariantWrapper(m_configuration, "Chat", "TabWindowsGeometry"), QRect(30, 30, 550, 400), TabDialog);

    makePopupMenu();

    // pozycja tabów
    configurationUpdated();

    m_menuInventory
    ->menu("buddy-list")
    ->addAction(m_openInNewTabAction, KaduMenu::SectionChat, 20)
    ->update();

    openStoredChatTabs();

    kdebugf2();
}
Esempio n. 3
0
StandardUrlHandler::StandardUrlHandler()
{
	// TODO: WTF? fix it!!!!!!!!!!!!!!!!!!!!!!!
	UrlRegExp = QRegExp("\\b(http://|https://|www\\.|ftp://|ftp\\.|sftp://|smb://|file:/|rsync://|svn://|svn\\+ssh://)(\\w|[a-zA-Z0-9ąśężźćółń\\*\\-\\._/~?=&#\\+%\\(\\)\\[\\]:;,!@\\\\])*");

	configurationUpdated();
}
void StandardUrlExpanderConfigurator::setStandardUrlExpander(StandardUrlExpander *standardUrlExpander)
{
    ConfigurableStandardUrlExpander = standardUrlExpander;

    createDefaultConfiguration();
    configurationUpdated();
}
Esempio n. 5
0
void ChatWindow::init()
{
	kdebugf();

	setWindowRole("kadu-chat");

	m_chatWidget = m_injectedFactory->makeInjected<ChatWidgetImpl>(m_chat, this);
	connect(m_chatWidget, SIGNAL(closeRequested(ChatWidget*)), this, SLOT(close()));

	if (m_chatWidget && m_chatWidget->chat().details() && m_chatWidget->chat().details()->type())
		setWindowRole(m_chatWidget->chat().details()->type()->windowRole());

	setAttribute(Qt::WA_DeleteOnClose);

	m_chatWidget->edit()->setFocus();
	m_chatWidget->kaduRestoreGeometry();

	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->addWidget(m_chatWidget);
	layout->setContentsMargins(0, 0, 0, 0);
	layout->setSpacing(0);

	configurationUpdated();

	updateTitle();

	CustomPropertiesVariantWrapper *variantWrapper = new CustomPropertiesVariantWrapper(
			m_chatWidget->chat().data()->customProperties(),
			"chat-geometry:WindowGeometry", CustomProperties::Storable);
	new WindowGeometryManager(variantWrapper, defaultGeometry(), this);

	connect(m_chatWidget->title(), SIGNAL(titleChanged(ChatWidget*)), this, SLOT(updateTitle()));
}
BuddiesListViewDelegateConfiguration::BuddiesListViewDelegateConfiguration(QObject *listView) :
		ShowAccountName(true)
{
	ListView = qobject_cast<BuddiesListView *>(listView);

	DefaultAvatarSize = QSize(32, 32);
	MessagePixmap = IconsManager::instance()->iconByPath("protocols/common/message").pixmap(16, 16);

	configurationUpdated();
}
TalkableDelegateConfiguration::TalkableDelegateConfiguration(TalkableTreeView *listView) :
		ListView(listView), AlwaysShowIdentityName(false), ShowIdentityName(true), ShowMessagePixmap(true), UseConfigurationColors(false)
{
	Q_ASSERT(ListView);

	DefaultAvatarSize = QSize(32, 32);
	MessagePixmap = KaduIcon("protocols/common/message").icon().pixmap(16, 16);

	configurationUpdated();
}
Esempio n. 8
0
EmoticonsManager::EmoticonsManager() :
		Aliases(), Selector(), walker(0)

{
	QStringList iconPaths = config_file.readEntry("Chat", "EmoticonsPaths").split('&', QString::SkipEmptyParts);

	ThemeManager = new EmoticonThemeManager(this);
	ThemeManager->loadThemes(iconPaths);
	configurationUpdated();
}
Esempio n. 9
0
void ShowHistoryAction::init()
{
	setType(ActionDescription::TypeUser);
	setName("showHistoryAction");
	setIcon(KaduIcon("kadu_icons/history"));
	setText(tr("View Chat History"));
	setShortcut("kadu_viewhistory");

	configurationUpdated();
}
Esempio n. 10
0
void DescriptionManager::init()
{
	m_configurationManager->registerStorableObject(this);

	configurationUpdated();

	if (m_configuration->api()->getNode("Descriptions", ConfigurationApi::ModeFind).isNull())
		import();
	else
		setState(StateNotLoaded);
}
Esempio n. 11
0
DescriptionManager::DescriptionManager()
{
	ConfigurationManager::instance()->registerStorableObject(this);

	configurationUpdated();

	if (xml_config_file->getNode("Descriptions", XmlConfigFile::ModeFind).isNull())
		import();
	else
		setState(StateNotLoaded);
}
Esempio n. 12
0
void SmsDialog::init()
{
	createGui();
	validate();

	configurationUpdated();

	new WindowGeometryManager(new ConfigFileVariantWrapper(m_configuration, "Sms", "SmsDialogGeometry"), QRect(200, 200, 400, 250), this);

	RecipientEdit->setFocus();
}
Esempio n. 13
0
DescriptionManager::DescriptionManager()
{
	ConfigurationManager::instance()->registerStorableObject(this);

	configurationUpdated();

	if (Application::instance()->configuration()->api()->getNode("Descriptions", ConfigurationApi::ModeFind).isNull())
		import();
	else
		setState(StateNotLoaded);
}
Esempio n. 14
0
AutoHide::AutoHide(QObject *parent) :
		QObject(parent), IdleTime(0)
{
	kdebugf();

	connect(&Timer, SIGNAL(timeout()), this, SLOT(timerTimeoutSlot()));

	configurationUpdated();

	kdebugf2();
}
Esempio n. 15
0
MainWindow::MainWindow(ActionContext *context, const QString &windowName, QWidget *parent) :
		QMainWindow(parent), DesktopAwareObject(this),  WindowName(windowName), TransparencyEnabled(false), BlurEnabled(false),
		Context(context)
{
	Q_ASSERT(0 != Context);

	connect(ConfigurationManager::instance()->toolbarConfigurationManager(), SIGNAL(configurationUpdated()),
			this, SLOT(refreshToolBars()));
	connect(Actions::instance(), SIGNAL(actionLoaded(ActionDescription*)),
			this, SLOT(actionLoadedOrUnloaded(ActionDescription*)));
	connect(Actions::instance(), SIGNAL(actionUnloaded(ActionDescription*)),
			this, SLOT(actionLoadedOrUnloaded(ActionDescription*)));
}
Esempio n. 16
0
DownloadManager::DownloadManager(QObject *parent) :
    QObject(parent)
    , _pManager(NULL)
    , _pReply(NULL)
    , _pFile(NULL)
    , _configManager()
    , _nDownloadTotal(0)
    , _bAcceptRanges(false)
    , _nDownloadSize(0)
    , _nDownloadSizeAtPause(0)
    , _downloading(false)
{
    _pManager = new QNetworkAccessManager(this);
    connect(&_configManager, SIGNAL(updateCompleted()), this, SLOT(configurationUpdated()));
}
Esempio n. 17
0
ChatWindow::ChatWindow(QWidget *parent)
	: QWidget(parent), currentChatWidget(0), title_timer(new QTimer(this))
{
	kdebugf();

	connect(title_timer, SIGNAL(timeout()), this, SLOT(blinkTitle()));
	connect(this, SIGNAL(chatWidgetActivated(ChatWidget *)),
			ChatWidgetManager::instance(), SIGNAL(chatWidgetActivated(ChatWidget *)));

#ifdef Q_OS_MAC
	setAttribute(Qt::WA_MacBrushedMetal);
#endif
	setAttribute(Qt::WA_DeleteOnClose);

	configurationUpdated();
}
Esempio n. 18
0
History::History() :
		QObject(0), SyncEnabled(true), SaveThread(0), CurrentStorage(0), HistoryDialog(new HistoryWindow())
{
	kdebugf();
	createActionDescriptions();
	connect(AccountManager::instance(), SIGNAL(accountRegistered(Account)),
		this, SLOT(accountRegistered(Account)));
	connect(AccountManager::instance(), SIGNAL(accountUnregistered(Account)),
		this, SLOT(accountUnregistered(Account)));

	connect(ChatWidgetManager::instance(), SIGNAL(chatWidgetCreated(ChatWidget *)), this, SLOT(chatCreated(ChatWidget *)));

	createDefaultConfiguration();
	configurationUpdated();
	kdebugf2();
}
Esempio n. 19
0
ChatWidgetManager::ChatWidgetManager()
{
	kdebugf();
	setState(StateNotLoaded);

	MessageRenderInfo::registerParserTags();

	connect(Core::instance(), SIGNAL(messageReceived(const Message &)),
			this, SLOT(messageReceived(const Message &)));
	connect(Core::instance(), SIGNAL(messageSent(const Message &)),
			this, SLOT(messageSent(const Message &)));

	Actions = new ChatWidgetActions(this);

	configurationUpdated();

	kdebugf2();
}
Esempio n. 20
0
ServerMonitorWindow::ServerMonitorWindow(QWidget *parent) :
		QScrollArea(parent), AvailableServers(0), UnavailableServers(0),
		UnknownStatusServers(0), Layout(0), ScrollBarLayout(0)
{
	ButtonRefresh = new QPushButton(tr("Refresh"), this);
	ButtonRefresh->setGeometry(420, 75, 60, 25);

	connect(ButtonRefresh, SIGNAL (clicked(bool)), this, SLOT (refreshList()));
	connect(&RefreshTimer, SIGNAL (timeout()),  this, SLOT (refreshList()));
	connect(&RefreshTimer, SIGNAL (timeout()), &RefreshTimer, SLOT (start()));

	StatsLabel = new QLabel(tr("No information available"), this);
	StatsLabel->setGeometry(420, 20, 150, 50);

	configurationUpdated();

	setFixedWidth(600);

	setWindowTitle(tr("Server monitor"));
}
Esempio n. 21
0
ToolBar::ToolBar(QWidget *parent) :
		QToolBar(parent), XOffset(0), YOffset(0)
{
	kdebugf();

	connect(&MyChangeNotifier, SIGNAL(changed()), this, SIGNAL(updated()));

	dragging = false;
	dropmarker.visible = false;

	setAcceptDrops(true);
	setIconSize(IconsManager::instance()->getIconsSize());

	if (!watcher)
		watcher = new DisabledActionsWatcher();

	configurationUpdated();

	kdebugf2();
}
Esempio n. 22
0
void MediaPlayer::init()
{
	kdebugf();

	// Initialization
	playerInfo = 0;
	playerCommands = 0;
	statusInterval = CHECK_STATUS_INTERVAL;

	// MediaPlayer menus in chats
	m_menu = new QMenu();
	popups[0] = m_menu->addAction(tr("Put formated string"), this, SLOT(insertFormattedSong()));
	popups[1] = m_menu->addAction(tr("Put song title"), this, SLOT(insertSongTitle()));
	popups[2] = m_menu->addAction(tr("Put song file name"), this, SLOT(insertSongFilename()));
	popups[3] = m_menu->addAction(tr("Send all playlist titles"), this, SLOT(insertPlaylistTitles()));
	popups[4] = m_menu->addAction(tr("Send all playlist files"), this, SLOT(insertPlaylistFilenames()));

	// Title checking timer
	timer = new QTimer(this);
	connect(timer, SIGNAL(timeout()), this, SLOT(checkTitle()));

	DockedMediaplayerStatus = 0;

	// Initial values of some object variables
	winKeyPressed = false;

	Changer = new MediaPlayerStatusChanger(this);
	m_statusChangerManager->registerStatusChanger(Changer);
	connect(m_statusChangerManager, SIGNAL(manualStatusAboutToBeChanged(StatusContainer*,Status)),
			this, SLOT(statusAboutToBeChanged()));

	setControlsEnabled(false);
	isPaused = true;

	Changer->changePositionInStatus((MediaPlayerStatusChanger::ChangeDescriptionTo)m_configuration->deprecatedApi()->readNumEntry("MediaPlayer", "statusPosition"));
	createDefaultConfiguration();
	configurationUpdated();
}
Esempio n. 23
0
Filtering::Filtering(): QWidget(kadu)
{
	kdebugf();
	
	kadu->mainLayout ()->insertWidget (0, this);

	filter = new UserGroup(userlist->toUserListElements());
	
	QHBoxLayout *l = new QHBoxLayout(this, 0, 5);

#ifdef Q_OS_MAC
	setContentsMargins(0, 2, 0, 0);
	
	search = new QMacSearchBox(this);
	search->setMinimumHeight(24);
	l->addWidget(search);

	connect(search, SIGNAL(textChanged(const QString&)), this, SLOT(on_textLE_textChanged(const QString&)));
#else

	l->addWidget (clearPB = new QPushButton(this, "clearPB"));
	clearPB->setPixmap (QPixmap (dataPath ("kadu/modules/data/filtering/clear.png")));
	l->addWidget (new QLabel (tr("Filter") + ":", this, "filterLBL"));
	l->addWidget (textLE = new QLineEdit(this, "textLE"));
	
	connect(clearPB, SIGNAL(clicked()), this, SLOT(on_clearPB_clicked()));
	connect(textLE, SIGNAL(textChanged(const QString&)), this, SLOT(on_textLE_textChanged(const QString&)));
	connect(textLE, SIGNAL(returnPressed()), this, SLOT(on_textLE_returnPressed()));
	connect(kadu, SIGNAL(keyPressed(QKeyEvent*)), this, SLOT(on_kadu_keyPressed(QKeyEvent*)));
#endif

	kadu->userbox ()->installEventFilter (this);

	createDefaultConfiguration();
	configurationUpdated();
	
	kdebugf2();
}
Esempio n. 24
0
Firewall::Firewall() :
    FloodMessages(0)
{
    kdebugf();

    pattern.setCaseSensitivity(Qt::CaseSensitive);

    import_0_6_5_configuration();

    createDefaultConfiguration();

    configurationUpdated();

    LastMsg.start();
    LastNotify.start();

    triggerAllAccountsRegistered();

    connect(ChatWidgetManager::instance(), SIGNAL(chatWidgetDestroying(ChatWidget *)),
            this, SLOT(chatDestroyed(ChatWidget *)));

    kdebugf2();
}
Esempio n. 25
0
ImageLinkConfiguration::ImageLinkConfiguration()
{
	configurationUpdated();
}
void ChatWindowStorageConfigurator::setChatWindowStorage(ChatWindowStorage *chatWindowStorage)
{
	m_chatWindowStorage = chatWindowStorage;
	configurationUpdated();
}
Esempio n. 27
0
AntistringConfiguration::AntistringConfiguration()
{
    createDefaultConfiguration();
    configurationUpdated();
}
Esempio n. 28
0
void ImageLinkConfigurator::configure()
{
	configurationUpdated();
}
Esempio n. 29
0
void TabWidget::init()
{
	setWindowRole("kadu-tabs");

	TabBar *tabbar = new TabBar(this);
	setTabBar(tabbar);

	setAcceptDrops(true);
	setMovable(true);

	setDocumentMode(true);

	connect(tabbar, SIGNAL(contextMenu(int, const QPoint &)),
			SLOT(onContextMenu(int, const QPoint &)));
	connect(tabbar, SIGNAL(tabCloseRequested(int)),
			SLOT(onDeleteTab(int)));
	connect(tabbar,SIGNAL(mouseDoubleClickEventSignal(QMouseEvent *)),
			SLOT(mouseDoubleClickEvent(QMouseEvent *)));
	connect(tabbar, SIGNAL(currentChanged(int)),
			SLOT(currentTabChanged(int)));

	//widget (container) for buttons with opening conversations
	//both buttons are displayed when checking Show "New Tab" button in configurations
	OpenChatButtonsWidget = new QWidget(this);
	QHBoxLayout *horizontalLayout = new QHBoxLayout;

	horizontalLayout->setSpacing(2);
	horizontalLayout->setContentsMargins(3, 0, 2, 3);

	//button for new chat from last conversations
	OpenRecentChatButton = new QToolButton(OpenChatButtonsWidget);
	OpenRecentChatButton->setIcon(m_iconsManager->iconByPath(KaduIcon("internet-group-chat")));
	OpenRecentChatButton->setToolTip(tr("Recent Chats"));
	OpenRecentChatButton->setAutoRaise(true);
	connect(OpenRecentChatButton, SIGNAL(clicked()), SLOT(openRecentChatsMenu()));

	//menu for recent chats
	RecentChatsMenuWidget = m_pluginInjectedFactory->makeInjected<RecentChatsMenu>(OpenRecentChatButton);
	connect(RecentChatsMenuWidget, SIGNAL(triggered(QAction *)), this, SLOT(openRecentChat(QAction *)));
	connect(RecentChatsMenuWidget, SIGNAL(chatsListAvailable(bool)), OpenRecentChatButton, SLOT(setEnabled(bool)));

	//button for opening chat
	QToolButton *openChatButton = new QToolButton(OpenChatButtonsWidget);
	openChatButton->setIcon(m_iconsManager->iconByPath(KaduIcon("mail-message-new")));
	openChatButton->setToolTip(tr("Open Chat with..."));
	openChatButton->setAutoRaise(true);
	connect(openChatButton, SIGNAL(clicked()), SLOT(newChat()));

	horizontalLayout->addWidget(OpenRecentChatButton);
	horizontalLayout->addWidget(openChatButton);

	OpenChatButtonsWidget->setLayout(horizontalLayout);
	OpenChatButtonsWidget->setVisible(false);

	RightCornerWidget = new QWidget(this);
	QHBoxLayout *rightCornerWidgetLayout = new QHBoxLayout;

	rightCornerWidgetLayout->setSpacing(2);
	rightCornerWidgetLayout->setContentsMargins(3, 0, 2, 3);

	TabsMenu = new QMenu(this);
	connect(TabsMenu, SIGNAL(triggered(QAction *)), this, SLOT(tabsMenuSelected(QAction *)));
	TabsListButton = new QToolButton(RightCornerWidget);
	TabsListButton->setIcon(m_iconsManager->iconByPath(KaduIcon("internet-group-chat")));
	TabsListButton->setToolTip(tr("Tabs"));
	TabsListButton->setAutoRaise(true);
	TabsListButton->setVisible(false);
	TabsListButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
	TabsListButton->setMenu(TabsMenu);
	connect(TabsListButton, SIGNAL(clicked()), SLOT(openTabsList()));
	rightCornerWidgetLayout->addWidget(TabsListButton);

	//przycisk zamkniecia aktywnej karty znajdujacy sie w prawym gornym rogu
	CloseChatButton = new QToolButton(this);
	CloseChatButton->setIcon(m_iconsManager->iconByPath(KaduIcon("kadu_icons/tab-remove")));
	CloseChatButton->setToolTip(tr("Close Tab"));
	CloseChatButton->setAutoRaise(true);
	CloseChatButton->setVisible(false);
	connect(CloseChatButton, SIGNAL(clicked()), SLOT(deleteTab()));
	rightCornerWidgetLayout->addWidget(CloseChatButton);

	RightCornerWidget->setLayout(rightCornerWidgetLayout);
	setCornerWidget(RightCornerWidget, Qt::TopRightCorner);

	configurationUpdated();
}
Esempio n. 30
0
void AutostatusConfiguration::init()
{
    configurationUpdated();
}