[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/autostart
From: Stephen Leaf <smileaf () smileaf ! org>
Date: 2007-10-27 22:11:35
Message-ID: 1193523095.628018.26236.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 730088 by smileaf:
No more delegate..
Rename the list items and enable shutdown and env again.
re-connect double click
fix a bug where changing when it starts changes the wrong field.
M +0 -1 CMakeLists.txt
M +12 -16 autostart.cpp
M +1 -2 autostart.h
D listdelegate.cpp
D listdelegate.h
--- trunk/playground/base/autostart/CMakeLists.txt #730087:730088
@@ -10,7 +10,6 @@
SET(kcm_autostart_PART_SRCS
adddialog.cpp
- listdelegate.cpp
autostart.cpp )
KDE4_ADD_UI_FILES(kcm_autostart_PART_SRCS autostartconfig.ui addDialog.ui )
--- trunk/playground/base/autostart/autostart.cpp #730087:730088
@@ -72,15 +72,13 @@
connect( widget->btnAdd, SIGNAL(clicked()), SLOT(addCMD()) );
connect( widget->btnRemove, SIGNAL(clicked()), SLOT(removeCMD()) );
- //connect( widget->listCMD, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), \
SLOT(editCMD(QTreeWidgetItem*)) ); + connect( widget->listCMD, \
SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), SLOT(editCMD(QTreeWidgetItem*)) ); \
connect( widget->btnProperties, SIGNAL(clicked()), SLOT(editCMD()) ); connect( \
widget->cmbStartOn, SIGNAL(activated(int)), SLOT(setStartOn(int)) ); connect( \
widget->listCMD, SIGNAL(itemSelectionChanged()), SLOT(selectionChanged()) );
widget->listCMD->setFocus();
- widget->listCMD->setItemDelegate(new ListDelegate(this));
-
load();
KAboutData* about = new KAboutData("Autostart", 0, ki18n("KDE Autostart Manager"), \
"1.0", @@ -102,16 +100,16 @@
// shutdown and env may *only* contain scripts, links or binaries
// autostart on the otherhand may contain all of the above.
// share/autostart is special as it overrides entries found in \
$KDEDIR/share/autostart
- paths << KGlobalSettings::autostartPath()
-// << componentData().dirs()->localkdedir() + "shutdown/"
-// << componentData().dirs()->localkdedir() + "env/"
- << componentData().dirs()->localkdedir() + "share/autostart"
+ paths << KGlobalSettings::autostartPath() // All new entries sholud go here
+ << componentData().dirs()->localkdedir() + "shutdown/"
+ << componentData().dirs()->localkdedir() + "env/"
+ << componentData().dirs()->localkdedir() + "share/autostart" // For Importing \
purposes ;
// share/autostart shouldn't be an option as this should be reserved for global \
autostart entries
- pathName << i18n("Autostart")
-// << i18n("Shutdown")
-// << i18n("Pre-Desktop")
+ pathName << i18n("Startup")
+ << i18n("Shutdown")
+ << i18n("Pre-KDE startup")
;
widget->cmbStartOn->addItems(pathName);
@@ -143,7 +141,6 @@
item->setText( 1, pathName.value(paths.indexOf((item->fileName.directory()+'/') \
)) ); item->setText( 2, service->exec() );
}
- widget->listCMD->openPersistentEditor(item);
}
}
}
@@ -155,7 +152,6 @@
if (result == QDialog::Rejected) {
return;
} else if (result == 3) {
- // For now Default into the first path, which should be ~/.kde/Autostart
if (addDialog->symLink())
KIO::link(addDialog->importUrl(), paths[0]);
else
@@ -224,10 +220,10 @@
emit changed(true);
}
+void Autostart::editCMD(QTreeWidgetItem* ent) {
+ if (!ent) return;
+ Desktop *entry = (Desktop*)ent;
-void Autostart::editCMD(Desktop* entry) {
- if (!entry) return;
-
const KFileItem kfi = KFileItem( KFileItem::Unknown, KFileItem::Unknown, KUrl( \
entry->fileName ), true ); if (! editCMD( kfi )) return;
@@ -257,7 +253,7 @@
return;
Desktop* entry = (Desktop*)widget->listCMD->selectedItems().first();
entry->setPath(paths.value(index));
- entry->setText(2, entry->fileName.directory() );
+ entry->setText(1, pathName[index]);
}
void Autostart::selectionChanged() {
--- trunk/playground/base/autostart/autostart.h #730087:730088
@@ -33,7 +33,6 @@
#include "ui_autostartconfig.h"
#include "adddialog.h"
-#include "listdelegate.h"
class Desktop;
class Autostart: public KCModule
@@ -53,7 +52,7 @@
public slots:
void addCMD();
void removeCMD();
- void editCMD(Desktop*);
+ void editCMD(QTreeWidgetItem*);
bool editCMD(const KFileItem&);
void editCMD();
void setStartOn(int);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic