Commit ddb4b145 authored by Wynn Wilkes's avatar Wynn Wilkes

* readd the Open Recent Files I've been missing...hopefully I did it right. I...

* readd the Open Recent Files I've been missing...hopefully I did it right.  I moved the Sandbox Open actions into the part and added entries in the rc file.

* changed my old hack to open the file to edit- use KRun now so we can open binary files and such

svn path=/trunk/kdesdk/cervisia/; revision=131687
parent 10fe15e2
This diff is collapsed.
......@@ -18,6 +18,7 @@ class QTimer;
class UpdateView;
class ProtocolView;
class KAboutData;
class KRecentFilesAction;
/**
* Factory for instantiating CervisiaParts.
......@@ -32,8 +33,8 @@ public:
virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName,
QObject* parent = 0, const char* name = 0,
const char* classname = "QObject",
const QStringList &args = QStringList() );
const char* classname = "QObject",
const QStringList &args = QStringList() );
static KInstance *instance();
static KAboutData *aboutData();
......@@ -158,6 +159,9 @@ private:
bool opt_hideFiles, opt_hideUpToDate, opt_hideRemoved;
bool opt_createDirs, opt_pruneDirs;
bool opt_updateRecursive, opt_commitRecursive, opt_doCVSEdit;
//for the Open Recent directories
KRecentFilesAction *recent;
};
/**
......
......@@ -46,25 +46,14 @@ CervisiaShell::~CervisiaShell()
void CervisiaShell::setupActions()
{
KAction *action = new KAction( i18n("O&pen Sandbox..."), "fileopen", 0,
this, SLOT( slotOpenSandbox() ),
actionCollection(), "file_open" );
QString hint = i18n("Opens a CVS working directory in the main window");
action->setToolTip( hint );
action->setWhatsThis( hint );
recent = new KRecentFilesAction( i18n("Recent Sandboxes"), 0,
part, SLOT( slotOpenSandbox( const KURL & ) ),
actionCollection(), "file_open_recent" );
recent->loadEntries( kapp->config() );
action = KStdAction::showToolbar( 0, 0, actionCollection() );
connect( action, SIGNAL(toggled(bool)), this, SLOT(slotToggleToolbar( bool )) );
KAction* action = KStdAction::showToolbar( 0, 0, actionCollection() );
connect( action, SIGNAL(toggled(bool)),
this, SLOT(slotToggleToolbar( bool )) );
action = KStdAction::configureToolbars( this, SLOT(slotConfigureToolBars()),
actionCollection() );
actionCollection() );
action = KStdAction::keyBindings( this, SLOT(slotConfigureKeys()),
actionCollection() );
actionCollection() );
(void) KStdAction::quit( this, SLOT( slotExit() ), actionCollection() );
}
......@@ -83,9 +72,9 @@ void CervisiaShell::slotToggleToolbar( bool visible )
{
KToolBar *tb = toolBar( "mainToolBar" );
if ( visible )
tb->show();
tb->show();
else
tb->hide();
tb->hide();
}
void CervisiaShell::slotConfigureKeys()
......@@ -97,7 +86,7 @@ void CervisiaShell::slotConfigureToolBars()
{
KEditToolbar dlg( actionCollection() );
if ( dlg.exec() )
createGUI( part );
createGUI( part );
}
void CervisiaShell::slotExit()
......@@ -110,8 +99,6 @@ bool CervisiaShell::queryExit()
{
KConfig *config = part->config();
recent->saveEntries( config );
config->setGroup("Main window");
config->writeEntry("Customized", true);
config->writeEntry("Size", size());
......@@ -143,8 +130,6 @@ void CervisiaShell::restorePseudo( const QString &dirname )
{
KConfig *config = part->config();
recent->loadEntries( config );
config->setGroup("Main window");
if (config->readBoolEntry("Customized"))
resize(config->readSizeEntry("Size"));
......
......@@ -38,7 +38,7 @@ protected:
private:
CervisiaPart *part;
KRecentFilesAction *recent;
};
#endif // CERVISIASHELL_H
......
......@@ -2,6 +2,9 @@
<kpartgui name="CervisiaPart" version="3">
<MenuBar>
<Menu name="file"><text>&amp;File</text>
<Action name="file_open"/>
<Action name="file_open_recent"/>
<Separator/>
<Action name="insert_changelog_entry"/>
<Separator/>
<Action name="file_update"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment