From ffb2e06d377851d36cf3cbe09b6a2f566bdfc0cb Mon Sep 17 00:00:00 2001 From: Szymon Tomasz Stefanek Date: Sat, 5 Mar 2011 03:13:09 +0000 Subject: Fix #1102 git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5534 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/kvirc/kernel/KviOptions.cpp | 3 ++- src/kvirc/kernel/KviOptions.h | 3 ++- src/modules/addon/managementdialog.cpp | 13 +++---------- src/modules/addon/managementdialog.h | 1 - src/modules/channelsjoin/ChannelsJoinDialog.cpp | 10 ++++++++-- src/modules/options/OptionsWidgetContainer.cpp | 8 +++++--- src/modules/options/dialog.cpp | 13 +++++++------ src/modules/reguser/dialog.cpp | 11 +++++++---- src/modules/theme/managementdialog.cpp | 6 ++++-- src/modules/toolbareditor/CustomizeToolBarsDialog.cpp | 4 ++-- 10 files changed, 40 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/kvirc/kernel/KviOptions.cpp b/src/kvirc/kernel/KviOptions.cpp index 32bd53fdd..6af9b2a74 100644 --- a/src/kvirc/kernel/KviOptions.cpp +++ b/src/kvirc/kernel/KviOptions.cpp @@ -338,7 +338,8 @@ KviBoolOption g_boolOptionsTable[KVI_NUM_BOOL_OPTIONS]= BOOL_OPTION("UseDBusNotifier",false,KviOption_sectFlagConnection), BOOL_OPTION("UseKDENotifier",false,KviOption_sectFlagConnection), BOOL_OPTION("CaseSensitiveHighlighting",false,KviOption_sectFlagIrcView), - BOOL_OPTION("MinimizeInTray",false,KviOption_sectFlagFrame | KviOption_resetUpdateGui) + BOOL_OPTION("MinimizeInTray",false,KviOption_sectFlagFrame | KviOption_resetUpdateGui), + BOOL_OPTION("DisplayNotifierOnPrimaryScreen",true,KviOption_sectFlagFrame) }; #define STRING_OPTION(_txt,_val,_flags) KviStringOption(KVI_STRING_OPTIONS_PREFIX _txt,_val,_flags) diff --git a/src/kvirc/kernel/KviOptions.h b/src/kvirc/kernel/KviOptions.h index d3d51f1c8..8adee231f 100644 --- a/src/kvirc/kernel/KviOptions.h +++ b/src/kvirc/kernel/KviOptions.h @@ -347,8 +347,9 @@ DECLARE_OPTION_STRUCT(KviStringListOption,QStringList) #define KviOption_boolUseKDENotifier 253 /* notifier */ #define KviOption_boolCaseSensitiveHighlighting 254 /* highlight */ #define KviOption_boolMinimizeInTray 255 /* interface */ +#define KviOption_boolDisplayNotifierOnPrimaryScreen 256 /* notifier */ -#define KVI_NUM_BOOL_OPTIONS 256 +#define KVI_NUM_BOOL_OPTIONS 257 #define KVI_STRING_OPTIONS_PREFIX "string" diff --git a/src/modules/addon/managementdialog.cpp b/src/modules/addon/managementdialog.cpp index 460463cff..d2a70110b 100644 --- a/src/modules/addon/managementdialog.cpp +++ b/src/modules/addon/managementdialog.cpp @@ -182,8 +182,9 @@ AddonManagementDialog::AddonManagementDialog(QWidget * p) } resize(g_rectManagementDialogGeometry.width(), g_rectManagementDialogGeometry.height()); - move(g_rectManagementDialogGeometry.x(), - g_rectManagementDialogGeometry.y()); + + QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); + move(rect.x() + ((rect.width() - g_rectManagementDialogGeometry.width())/2),rect.y() + ((rect.height() - g_rectManagementDialogGeometry.height())/2)); } AddonManagementDialog::~AddonManagementDialog() @@ -319,14 +320,6 @@ void AddonManagementDialog::installScript() //m_pListWidget->triggerUpdate(); } -void AddonManagementDialog::showEvent(QShowEvent * e) -{ - QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); - move((rect.width() - width())/2,(rect.height() - height())/2); - - QWidget::showEvent(e); -} - void AddonManagementDialog::closeClicked() { delete this; diff --git a/src/modules/addon/managementdialog.h b/src/modules/addon/managementdialog.h index dd9fe1780..78190df28 100644 --- a/src/modules/addon/managementdialog.h +++ b/src/modules/addon/managementdialog.h @@ -74,7 +74,6 @@ public: static void cleanup(); protected: void fillListView(); - virtual void showEvent(QShowEvent * e); virtual void closeEvent(QCloseEvent * e); protected slots: void currentChanged(QListWidgetItem * i, QListWidgetItem *); diff --git a/src/modules/channelsjoin/ChannelsJoinDialog.cpp b/src/modules/channelsjoin/ChannelsJoinDialog.cpp index 35a51ff14..a143be59c 100644 --- a/src/modules/channelsjoin/ChannelsJoinDialog.cpp +++ b/src/modules/channelsjoin/ChannelsJoinDialog.cpp @@ -31,6 +31,7 @@ #include "KviCString.h" #include "KviQString.h" #include "KviIconManager.h" +#include "KviMainWindow.h" #include "KviConsoleWindow.h" #include "KviRegisteredChannel.h" #include "KviRegisteredChannelDataBase.h" @@ -46,6 +47,7 @@ #include #include #include +#include extern ChannelsJoinDialog * g_pChannelsWindow; @@ -136,10 +138,14 @@ ChannelsJoinDialog::ChannelsJoinDialog(QWidget * par, const char * name) fillListView(); - if(g_rectChannelsJoinGeometry.y() < 5)g_rectChannelsJoinGeometry.setY(5); + if(g_rectChannelsJoinGeometry.y() < 5) + g_rectChannelsJoinGeometry.setY(5); resize(g_rectChannelsJoinGeometry.width(),g_rectChannelsJoinGeometry.height()); - move(g_rectChannelsJoinGeometry.x(),g_rectChannelsJoinGeometry.y()); + //move(g_rectChannelsJoinGeometry.x(),g_rectChannelsJoinGeometry.y()); + + QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); + move(rect.x() + ((rect.width() - g_rectChannelsJoinGeometry.width())/2),rect.y() + ((rect.height() - g_rectChannelsJoinGeometry.height())/2)); enableJoin(); } diff --git a/src/modules/options/OptionsWidgetContainer.cpp b/src/modules/options/OptionsWidgetContainer.cpp index 53e8e6e87..62cc3d95c 100644 --- a/src/modules/options/OptionsWidgetContainer.cpp +++ b/src/modules/options/OptionsWidgetContainer.cpp @@ -28,6 +28,7 @@ #include "KviLocale.h" #include "KviIconManager.h" #include "KviApplication.h" +#include "KviMainWindow.h" #include "KviTalToolTip.h" #include @@ -136,11 +137,12 @@ void OptionsWidgetContainer::closeEvent(QCloseEvent *e) void OptionsWidgetContainer::showEvent(QShowEvent *e) { - if(parent() == 0) + if(!parent()) { - QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); - move((rect.width() - width())/2,(rect.height() - height())/2); + QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); + move(rect.x() + ((rect.width() - width())/2),rect.y() + ((rect.height() - height())/2)); } + QWidget::showEvent(e); m_pCancel->setFocus(); } diff --git a/src/modules/options/dialog.cpp b/src/modules/options/dialog.cpp index 74e5fe713..94ea8c9bf 100644 --- a/src/modules/options/dialog.cpp +++ b/src/modules/options/dialog.cpp @@ -29,6 +29,7 @@ #include "KviOptions.h" #include "KviLocale.h" #include "KviIconManager.h" +#include "KviMainWindow.h" #include "KviModule.h" #include "KviPointerHashTable.h" #include "KviTalVBox.h" @@ -259,9 +260,8 @@ OptionsDialog::OptionsDialog(QWidget * par,const QString &szGroup) if(!parent()) { if(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).y() < 5) - { KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).setY(5); - } + //setGeometry(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry)); resize(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).width(), KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).height()); @@ -274,15 +274,16 @@ OptionsDialog::OptionsDialog(QWidget * par,const QString &szGroup) OptionsDialog::~OptionsDialog() { - if(!parent())KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry) = QRect(pos().x(),pos().y(), - size().width(),size().height()); + if(!parent()) + KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry) = QRect(pos().x(),pos().y(),size().width(),size().height()); if(g_pOptionsDialogDict) g_pOptionsDialogDict->remove(m_szGroup); } void OptionsDialog::showEvent(QShowEvent *e) { - QRect r = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); + // setup a minimum size and move to the screen the main kvirc window is + QRect r = g_pApp->desktop()->screenGeometry(g_pMainWindow); int w = r.width(); int h = r.height(); @@ -298,7 +299,7 @@ void OptionsDialog::showEvent(QShowEvent *e) if(ww < 770)ww = 770; } - setGeometry((w - ww) / 2,(h - wh) / 2,ww,wh); + setGeometry(r.x() + ((w - ww) / 2),r.y() + ((h - wh) / 2),ww,wh); QWidget::showEvent(e); } diff --git a/src/modules/reguser/dialog.cpp b/src/modules/reguser/dialog.cpp index 4025b93c6..0cf185aea 100644 --- a/src/modules/reguser/dialog.cpp +++ b/src/modules/reguser/dialog.cpp @@ -32,6 +32,7 @@ #include "KviLocale.h" #include "KviIrcMask.h" #include "kvi_debug.h" +#include "KviMainWindow.h" #include "KviIconManager.h" #include "KviApplication.h" #include "KviOptions.h" @@ -52,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -316,14 +318,15 @@ RegisteredUsersDialog::RegisteredUsersDialog(QWidget * par) if(!parent()) { if(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).y() < 5) - { KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).setY(5); - } + //setGeometry(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry)); resize(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).width(), KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).height()); - move(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).x(), - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).y()); + + QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); + move(rect.x() + ((rect.width() - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).width())/2),rect.y() + ((rect.height() - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).height())/2)); + } } diff --git a/src/modules/theme/managementdialog.cpp b/src/modules/theme/managementdialog.cpp index 6f434b7be..0aa1a4d15 100644 --- a/src/modules/theme/managementdialog.cpp +++ b/src/modules/theme/managementdialog.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -207,8 +208,9 @@ ThemeManagementDialog::ThemeManagementDialog(QWidget * parent) } resize(g_rectManagementDialogGeometry.width(), g_rectManagementDialogGeometry.height()); - move(g_rectManagementDialogGeometry.x(), - g_rectManagementDialogGeometry.y()); + + QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); + move(rect.x() + ((rect.width() - g_rectManagementDialogGeometry.width())/2),rect.y() + ((rect.height() - g_rectManagementDialogGeometry.height())/2)); } ThemeManagementDialog::~ThemeManagementDialog() diff --git a/src/modules/toolbareditor/CustomizeToolBarsDialog.cpp b/src/modules/toolbareditor/CustomizeToolBarsDialog.cpp index f5e7aed1e..2d80dba87 100644 --- a/src/modules/toolbareditor/CustomizeToolBarsDialog.cpp +++ b/src/modules/toolbareditor/CustomizeToolBarsDialog.cpp @@ -364,8 +364,8 @@ void CustomizeToolBarsDialog::currentToolBarChanged() void CustomizeToolBarsDialog::showEvent(QShowEvent * e) { - QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); - move((rect.width() - width())/2,(rect.height() - height())/2); + QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); + move(rect.x() + ((rect.width() - width())/2),rect.y() + ((rect.height() - height())/2)); QWidget::showEvent(e); } -- cgit v1.3.1-10-gc9f91