~ubuntu-branches/ubuntu/lucid/kdebase/lucid

« back to all changes in this revision

Viewing changes to apps/konsole/src/MainWindow.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-12-02 13:28:20 UTC
  • mto: This revision was merged to the branch mainline in revision 258.
  • Revision ID: james.westby@ubuntu.com-20091202132820-tpxn348l9frx5zd5
Tags: upstream-4.3.80
ImportĀ upstreamĀ versionĀ 4.3.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <KActionCollection>
31
31
#include <KActionMenu>
32
32
#include <KApplication>
 
33
#include <KCmdLineArgs>
33
34
#include <KShortcutsDialog>
34
35
#include <KLocale>
35
36
#include <KMenu>
41
42
#include <KToolInvocation>
42
43
#include <KStandardAction>
43
44
#include <KStandardGuiItem>
 
45
#include <KWindowSystem>
44
46
#include <KXMLGUIFactory>
45
47
#include <KNotifyConfigWidget>
46
48
 
57
59
 
58
60
using namespace Konsole;
59
61
 
 
62
static bool useTransparency()
 
63
{
 
64
    KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
 
65
    bool compositingAvailable = KWindowSystem::compositingActive() ||
 
66
                                args->isSet("force-transparency");
 
67
    return compositingAvailable && args->isSet("transparency");
 
68
}
 
69
 
60
70
MainWindow::MainWindow()
61
71
 : KXmlGuiWindow() ,
62
72
   _bookmarkHandler(0),
63
73
   _pluggedController(0),
64
74
   _menuBarVisibilitySet(false)
65
75
{
 
76
    if (useTransparency()) {
 
77
        setAttribute(Qt::WA_TranslucentBackground);
 
78
        setAttribute(Qt::WA_NoSystemBackground, false);
 
79
    }
 
80
 
66
81
    // create actions for menus
67
82
    setupActions();
68
83
 
318
333
 
319
334
void MainWindow::openUrls(const QList<KUrl>& urls)
320
335
{
321
 
    // TODO Implement support for SSH bookmarks here
322
336
    foreach( const KUrl& url , urls )
323
337
    {
324
338
        if ( url.isLocalFile() )
325
339
            emit newSessionRequest( _defaultProfile , url.path() , _viewManager );
 
340
 
 
341
        else if ( url.protocol() == "ssh" )
 
342
            emit newSSHSessionRequest( _defaultProfile , url , _viewManager );
326
343
    }
327
344
}
328
345