summaryrefslogtreecommitdiffstats
path: root/mandriva/2010.2/applications/krandr/krandr-0.5.2.1-fix_autostart.patch
blob: 6937687b166d2b0f560a5fa120a7650aa62aff8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--- krandr-0.5.2.1/randr/krandrtray.cpp.run_startup	2007-10-02 20:22:50.000000000 -0300
+++ krandr-0.5.2.1/randr/krandrtray.cpp	2007-10-02 20:29:49.000000000 -0300
@@ -48,6 +48,7 @@ KRandRSystemTray::KRandRSystemTray(RandR
 	KConfig cfg("kcmrandrrc");
 	cfg.setGroup("General");
 
+	m_runStartup = cfg.readBoolEntry("AutoStart", true);
 	KGlobalAccel *accel = new KGlobalAccel(this);
 	accel->insert( "DisplaySwitch", i18n("Switch displays"),
 		   i18n("Switch between active displays."),
@@ -111,6 +112,10 @@ void KRandRSystemTray::contextMenuAboutT
 
 	menu->insertSeparator();
 
+	lastIndex = menu->insertItem(i18n( "Start KRandR when KDE starts" ));
+	menu->connectItem(lastIndex, this, SLOT(slotToggleRunStartup()));
+	menu->setItemChecked( lastIndex, m_runStartup );
+
 	KAction *actPrefs = new KAction( i18n( "Configure Display..." ),
 		SmallIconSet( "configure" ), KShortcut(), this, SLOT( slotPrefs() ),
 		actionCollection() );
@@ -469,6 +474,15 @@ void KRandRSystemTray::slotPrefs()
 	kcm->exec();
 }
 
+void KRandRSystemTray::slotToggleRunStartup()
+{
+	m_runStartup = !m_runStartup;
+	KConfig cfg("kcmrandrrc");
+
+	cfg.setGroup("General");
+	cfg.writeEntry("AutoStart", m_runStartup);
+}
+
 void KRandRSystemTray::slotSwitchDisplay()
 {
     m_display->switchOutput();
--- krandr-0.5.2.1/randr/krandrtray.h.run_startup	2007-10-02 20:22:50.000000000 -0300
+++ krandr-0.5.2.1/randr/krandrtray.h	2007-10-02 20:22:50.000000000 -0300
@@ -46,6 +46,7 @@ protected slots:
 	void slotOrientationChanged(int parameter);
 	void slotRefreshRateChanged(int parameter);
 	void slotPrefs();
+	void slotToggleRunStartup();
 
 protected:
 	void mousePressEvent( QMouseEvent *e );
@@ -62,6 +63,7 @@ private:
 	bool m_popupUp;
 	QValueList<KPopupMenu*> m_screenPopups;
 	RandRDisplay *m_display;
+	bool m_runStartup;
 };
 
 #endif
--- krandr-0.5.2.1/randr/krandrtray.desktop.run_startup	2007-10-02 20:42:22.000000000 -0300
+++ krandr-0.5.2.1/randr/krandrtray.desktop	2007-10-02 20:29:27.000000000 -0300
@@ -116,3 +116,4 @@ Icon=randr
 Type=Application
 OnlyShowIn=KDE;
 Categories=Qt;KDE;System;
+X-KDE-autostart-condition=kcmrandrrc:General:AutoStart:true