[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/network/kcall
From:       George Kiagiadakis <gkiagiad () csd ! uoc ! gr>
Date:       2009-06-24 14:03:33
Message-ID: 1245852213.931362.13759.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 986304 by gkiagia:

Add a minimal configuration dialog.
The classes are arranged in such a way so that it is possible to use the
configuration dialog pages for kcall_handler inside kcall (but not vice-versa).

 M  +1 -0      CMakeLists.txt  
 M  +1 -0      kcall_handler/CMakeLists.txt  
 M  +15 -1     kcall_handler/callwindow.cpp  
 M  +1 -0      kcall_handler/callwindow.h  
 A             kcall_handler/kcallhandlersettings.kcfg  
 A             kcall_handler/kcallhandlersettings.kcfgc  
 M  +2 -1      libkcallprivate/CMakeLists.txt  
 A             libkcallprivate/callwindowsettingspage.ui  
 A             libkcallprivate/kcallhandlersettingsdialog.cpp   [License: GPL (v2+)]
 A             libkcallprivate/kcallhandlersettingsdialog.h   mainwindow.h#986303 [License: GPL (v2+)]
 M  +13 -0     mainwindow.cpp  
 M  +3 -0      mainwindow.h  


--- trunk/playground/network/kcall/CMakeLists.txt #986303:986304
@@ -23,6 +23,7 @@
     knotifyapprover.cpp
 )
 
+kde4_add_kcfg_files(kcall_SRCS kcall_handler/kcallhandlersettings.kcfgc)
 kde4_add_ui_files(kcall_SRCS mainwindow.ui)
 kde4_add_executable(kcall ${kcall_SRCS})
 target_link_libraries(kcall ${KDE4_KDEUI_LIBS}
--- trunk/playground/network/kcall/kcall_handler/CMakeLists.txt #986303:986304
@@ -64,6 +64,7 @@
         farsight/mediahandler.cpp
     )
 
+    kde4_add_kcfg_files(kcall_handler_SRCS kcallhandlersettings.kcfgc)
     kde4_add_executable(kcall_handler ${kcall_handler_SRCS})
     target_link_libraries(kcall_handler ${KDE4_KDEUI_LIBS}
                                         ${TELEPATHY_QT4_LIBRARIES}
--- trunk/playground/network/kcall/kcall_handler/callwindow.cpp #986303:986304
@@ -20,7 +20,9 @@
 #include "abstractmediahandler.h"
 #include "participantsdock.h"
 #include "dtmfhandler.h"
+#include "kcallhandlersettings.h"
 #include "../libkcallprivate/dtmfwidget.h"
+#include "../libkcallprivate/kcallhandlersettingsdialog.h"
 #include <QtCore/QMetaObject>
 #include <QtGui/QCloseEvent>
 #include <QtGui/QLabel>
@@ -72,6 +74,8 @@
     d->hangupAction = new KAction(KIcon("application-exit"), i18nc("@action", "Hangup"), this);
     connect(d->hangupAction, SIGNAL(triggered()), d->channelHandler, SLOT(hangupCall()));
     actionCollection()->addAction("hangup", d->hangupAction);
+
+    KStandardAction::preferences(this, SLOT(showSettingsDialog()), actionCollection());
 }
 
 void CallWindow::setupUi()
@@ -135,7 +139,10 @@
         setStatus(i18nc("@info:status", "Disconnected."));
         disableUi();
         d->callDurationTimer.stop();
-        QTimer::singleShot(1000, this, SLOT(close()));
+        if ( KCallHandlerSettings::closeOnDisconnect() ) {
+            QTimer::singleShot(KCallHandlerSettings::closeOnDisconnectTimeout() * 1000,
+                               this, SLOT(close()));
+        }
         break;
     case ChannelHandler::Error:
         setStatus(i18nc("@info:status", "Disconnected with error."));
@@ -185,6 +192,13 @@
     statusBar()->changeItem(d->callDuration.toString(), 1);
 }
 
+void CallWindow::showSettingsDialog()
+{
+    if ( !KCallHandlerSettingsDialog::showDialog() ) {
+        new KCallHandlerSettingsDialog(this, KCallHandlerSettings::self());
+    }
+}
+
 void CallWindow::closeEvent(QCloseEvent *event)
 {
     if ( !d->channelHandler->requestClose() ) {
--- trunk/playground/network/kcall/kcall_handler/callwindow.h #986303:986304
@@ -39,6 +39,7 @@
     void onGroupMembersModelCreated(GroupMembersModel *model);
     void onDtmfHandlerCreated(DtmfHandler *handler);
     void onCallDurationTimerTimeout();
+    void showSettingsDialog();
 
 protected:
     virtual void closeEvent(QCloseEvent *event);
--- trunk/playground/network/kcall/libkcallprivate/CMakeLists.txt #986303:986304
@@ -9,9 +9,10 @@
     contactitem.cpp
     groupmembersmodel.cpp
     dtmfwidget.cpp
+    kcallhandlersettingsdialog.cpp
 )
 
-kde4_add_ui_files(libkcallprivate_SRCS dtmfwidget.ui)
+kde4_add_ui_files(libkcallprivate_SRCS dtmfwidget.ui callwindowsettingspage.ui)
 kde4_add_library(kcallprivate SHARED ${libkcallprivate_SRCS})
 target_link_libraries(kcallprivate ${KDE4_KDEUI_LIBS} ${TELEPATHY_QT4_LIBRARIES})
 install(TARGETS kcallprivate ${INSTALL_TARGETS_DEFAULT_ARGS})
--- trunk/playground/network/kcall/mainwindow.cpp #986303:986304
@@ -18,7 +18,9 @@
 #include "ui_mainwindow.h"
 #include "kcallapplication.h"
 #include "contactlistcontroller.h"
+#include "kcallhandlersettings.h"
 #include "libkcallprivate/contactsmodel.h"
+#include "libkcallprivate/kcallhandlersettingsdialog.h"
 #include <KStatusBar>
 #include <KAction>
 #include <KActionCollection>
@@ -48,6 +50,17 @@
 void MainWindow::setupActions()
 {
     KStandardAction::quit(KCallApplication::instance(), SLOT(quit()), actionCollection());
+    KStandardAction::preferences(this, SLOT(showSettingsDialog()), actionCollection());
 }
 
+void MainWindow::showSettingsDialog()
+{
+    if ( !KConfigDialog::showDialog("kcallsettings") ) {
+        //TODO use KCallSettings::self() when there is such a config class
+        KConfigDialog *dialog = new KConfigDialog(this, "kcallsettings", KCallHandlerSettings::self());
+        KCallHandlerSettingsDialog::addHandlerPagesToDialog(dialog, KCallHandlerSettings::self());
+        dialog->show();
+    }
+}
+
 #include "mainwindow.moc"
--- trunk/playground/network/kcall/mainwindow.h #986303:986304
@@ -27,6 +27,9 @@
     MainWindow();
     virtual ~MainWindow();
 
+private slots:
+    void showSettingsDialog();
+
 private:
     void setupActions();
     Ui::MainWindow *ui;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic