Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0823ec1137 | |||
| 1c4ebcccd1 |
+2
-1
@@ -23,6 +23,7 @@ find_package(KF6 REQUIRED COMPONENTS
|
||||
ConfigWidgets
|
||||
CoreAddons
|
||||
Crash
|
||||
DBusAddons
|
||||
IdleTime
|
||||
I18n
|
||||
IconThemes
|
||||
@@ -55,7 +56,7 @@ else()
|
||||
set(KMESS_DISABLE_LIKEBACK 0)
|
||||
endif()
|
||||
|
||||
set(KMESS_VERSION "6.0_alpha5")
|
||||
set(KMESS_VERSION "6.0_alpha6")
|
||||
set(KMESS_ENABLE_DEBUG_OUTPUT 0)
|
||||
set(KMESS_BUILT_DEBUGFULL FALSE)
|
||||
set(HAVE_LIBISFQT 1)
|
||||
|
||||
@@ -169,6 +169,7 @@ SET(kmess_LIBS
|
||||
KF6::Completion
|
||||
KF6::CoreAddons
|
||||
KF6::Crash
|
||||
KF6::DBusAddons
|
||||
KF6::IdleTime
|
||||
KF6::I18n
|
||||
KF6::IconThemes
|
||||
|
||||
+18
-2
@@ -1672,8 +1672,16 @@ Chat *ChatMaster::createChat( MsnSwitchboardConnection *switchboard, bool reques
|
||||
Chat *newChat;
|
||||
ChatWindow *newChatWindow;
|
||||
|
||||
// If the new chat is a group chat, find existing group chat windows; else find private chats
|
||||
const QStringList partecipants( switchboard->getContactsInChat() );
|
||||
// If the new chat is a group chat, find existing group chat windows; else find private chats.
|
||||
// Escargot can briefly request a chat window while the switchboard has no resolved contact yet.
|
||||
QStringList partecipants( switchboard->getContactsInChat() );
|
||||
partecipants.removeAll( QString() );
|
||||
if( partecipants.isEmpty() )
|
||||
{
|
||||
kmWarning() << "Ignoring chat window request without contacts.";
|
||||
return 0;
|
||||
}
|
||||
|
||||
newChat = getContactsChat( partecipants, true );
|
||||
|
||||
// If the chat was requested by a contact, check if we have a chat request
|
||||
@@ -1728,11 +1736,18 @@ Chat *ChatMaster::createChat( MsnSwitchboardConnection *switchboard, bool reques
|
||||
if( ! newChat->initialize( switchboard ) )
|
||||
{
|
||||
kmDebug() << "Couldn't initialize the chat tab.";
|
||||
delete newChat;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Select the chat window where to open the new tab, or create a new one
|
||||
newChatWindow = createChatWindow( newChat );
|
||||
if( newChatWindow == 0 )
|
||||
{
|
||||
kmWarning() << "Couldn't create the chat window.";
|
||||
delete newChat;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Create the first tab in the chat
|
||||
newChat = newChatWindow->addChatTab( newChat, switchboard->getUserStartedChat() );
|
||||
@@ -1804,6 +1819,7 @@ ChatWindow *ChatMaster::createChatWindow( Chat *chat )
|
||||
if( ! window->initialize() )
|
||||
{
|
||||
kmWarning() << "Couldn't initialize the new chat window!";
|
||||
delete window;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+22
-8
@@ -256,6 +256,10 @@ ChatWindow::~ChatWindow()
|
||||
// Add a new chat tab
|
||||
Chat *ChatWindow::addChatTab( Chat *newChat, bool foreground )
|
||||
{
|
||||
// QTabWidget emits currentChanged() from addTab(). Parent the contacts widget first
|
||||
// so slotTabChanged() never sees a half-attached chat view.
|
||||
newChat->getContactsWidget()->setParent( contactsDock_ );
|
||||
|
||||
// Connect its main signals
|
||||
connect( newChat, SIGNAL( chatInfoChanged() ),
|
||||
this, SLOT ( slotUpdateChatInfo() ) );
|
||||
@@ -276,10 +280,6 @@ Chat *ChatWindow::addChatTab( Chat *newChat, bool foreground )
|
||||
chatTabs_->setCurrentIndex( newTabIndex );
|
||||
}
|
||||
|
||||
// Set the appropriate parent of the contactswidget.
|
||||
// This is needed when a chat is moved to another window.
|
||||
newChat->getContactsWidget()->setParent( contactsDock_ );
|
||||
|
||||
// Apply the window's settings to the tab
|
||||
newChat->getContactsWidget()->setDockWidget( contactsDock_, dockWidgetArea( contactsDock_ ) );
|
||||
newChat->setZoomFactor( zoomLevel_ );
|
||||
@@ -589,11 +589,25 @@ void ChatWindow::createMenus()
|
||||
actionCollection_->addAction( "spellCheck", spellCheckAction_ );
|
||||
|
||||
// Enable some default action shortcuts (preserve the original ones where needed)
|
||||
auto defaultShortcuts = []( const QKeySequence &preferred, const QKeySequence &fallback )
|
||||
{
|
||||
QList<QKeySequence> shortcuts;
|
||||
if( ! preferred.isEmpty() )
|
||||
{
|
||||
shortcuts << preferred;
|
||||
}
|
||||
if( ! fallback.isEmpty() && ! shortcuts.contains( fallback ) )
|
||||
{
|
||||
shortcuts << fallback;
|
||||
}
|
||||
return shortcuts;
|
||||
};
|
||||
|
||||
actionCollection_->setDefaultShortcut( nudgeAction_, QKeySequence( "Alt+Z" ) );
|
||||
actionCollection_->setDefaultShortcuts( closeAction, QList<QKeySequence>() << QKeySequence( "Ctrl+W" ) << closeAction->shortcut() );
|
||||
actionCollection_->setDefaultShortcuts( closeAllAction_, QList<QKeySequence>() << QKeySequence( "Ctrl+Q" ) << closeAllAction_->shortcut() );
|
||||
actionCollection_->setDefaultShortcuts( prevTabAction_, QList<QKeySequence>() << QKeySequence( QKeySequence::PreviousChild ) << prevTabAction_->shortcut() );
|
||||
actionCollection_->setDefaultShortcuts( nextTabAction_, QList<QKeySequence>() << QKeySequence( QKeySequence::NextChild ) << nextTabAction_->shortcut() );
|
||||
actionCollection_->setDefaultShortcut( closeAction, QKeySequence( "Ctrl+W" ) );
|
||||
actionCollection_->setDefaultShortcut( closeAllAction_, QKeySequence( "Ctrl+Q" ) );
|
||||
actionCollection_->setDefaultShortcuts( prevTabAction_, defaultShortcuts( QKeySequence( QKeySequence::PreviousChild ), prevTabAction_->shortcut() ) );
|
||||
actionCollection_->setDefaultShortcuts( nextTabAction_, defaultShortcuts( QKeySequence( QKeySequence::NextChild ), nextTabAction_->shortcut() ) );
|
||||
actionCollection_->setDefaultShortcut( contactsDockAction, QKeySequence( "Ctrl+D" ) );
|
||||
actionCollection_->setDefaultShortcut( standardEmoticonsDockAction, QKeySequence( "Ctrl+E" ) );
|
||||
actionCollection_->setDefaultShortcut( customEmoticonsDockAction, QKeySequence( "Ctrl+Y" ) );
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <QCommandLineParser>
|
||||
#include <KIconLoader>
|
||||
#include <KWindowSystem>
|
||||
#include <kcoreaddons_version.h>
|
||||
|
||||
|
||||
@@ -84,6 +85,24 @@ KMessApplication::~KMessApplication()
|
||||
|
||||
|
||||
|
||||
void KMessApplication::activateRequested( const QStringList &arguments, const QString &workingDirectory )
|
||||
{
|
||||
Q_UNUSED( arguments );
|
||||
Q_UNUSED( workingDirectory );
|
||||
|
||||
if( contactListWindow_ == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
contactListWindow_->show();
|
||||
KWindowSystem::updateStartupId( contactListWindow_->windowHandle() );
|
||||
contactListWindow_->raise();
|
||||
KWindowSystem::activateWindow( contactListWindow_->windowHandle() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the contact list window
|
||||
*/
|
||||
|
||||
@@ -65,6 +65,9 @@ class KMessApplication : public QApplication
|
||||
void setQuitSelected(bool quitSelected);
|
||||
void initialize( const QCommandLineParser &parser );
|
||||
|
||||
public slots:
|
||||
void activateRequested( const QStringList &arguments, const QString &workingDirectory );
|
||||
|
||||
private slots:
|
||||
void slotAboutToQuit();
|
||||
void slotLastWindowClosed();
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "kmessdebug.h"
|
||||
|
||||
#include <KAboutData>
|
||||
#include <KDBusService>
|
||||
#include <KLocalizedString>
|
||||
|
||||
#include <QCommandLineOption>
|
||||
@@ -64,6 +65,7 @@ int main(int argc, char *argv[])
|
||||
"http://www.kmess.org/", // home page
|
||||
"bugs" "@" "kmess" "." "org" // address for bugs
|
||||
);
|
||||
aboutData.setOrganizationDomain( "kmess.org" );
|
||||
|
||||
// Note all email addresses are written in an anti-spam style.
|
||||
|
||||
@@ -243,6 +245,10 @@ int main(int argc, char *argv[])
|
||||
parser.process( kmessApp );
|
||||
aboutData.processCommandLine( &parser );
|
||||
|
||||
KDBusService dbusService( KDBusService::Unique );
|
||||
QObject::connect( &dbusService, &KDBusService::activateRequested,
|
||||
&kmessApp, &KMessApplication::activateRequested );
|
||||
|
||||
kmessApp.initialize( parser );
|
||||
|
||||
return kmessApp.exec();
|
||||
|
||||
Reference in New Issue
Block a user