[Kget] kdenetwork/kget
Pino Toscano
toscano.pino at tiscali.it
Sat Mar 5 17:30:28 CET 2005
CVS commit by pino:
Improved the Show Drop Target action behaviour. Now we have only one action in the Settings menu that behaves like the Show Status Bar / Show Toolbar actions. This made me adding two new strings, so I can't beckport this to the 3_4_BRANCH.
However, in the 3_4_BRANCH I'm going to remove the duplicate 'drop_target' action in the menus.
CCMAIL: kget at kde.org
M +2 -5 kgetui.rc 1.5
M +16 -8 kmainwidget.cpp 1.115
M +5 -5 kmainwidget.h 1.32
--- kdenetwork/kget/kgetui.rc #1.4:1.5
@@ -30,6 +30,4 @@
<Menu noMerge="1" name="view"><text>&View</text>
<Action name="toggle_log"/>
- <Separator/>
- <Action name="drop_target"/>
</Menu>
<Menu name="options"><text>&Options</text>
@@ -44,9 +42,8 @@
<Action name="auto_shutdown"/>
<Action name="auto_paste"/>
- <Separator/>
- <Action name="drop_target"/>
</Menu>
<Menu name="settings"><text>&Settings</text>
- <Action name="show_statusbar" append="show_merge"/>
+ <Action name="show_statusbar"/>
+ <Action name="drop_target" append="show_merge"/>
</Menu>
<Menu name="help"><text>&Help</text>
--- kdenetwork/kget/kmainwidget.cpp #1.114:1.115
@@ -149,4 +149,6 @@ KMainWidget::KMainWidget(bool bStartDock
logWindow = new LogWindow();
+ m_showDropTarget = false;
+
setCaption(KGETVERSION);
@@ -374,6 +376,5 @@ void KMainWidget::setupGUI()
m_paPreferences = KStdAction::preferences(this, SLOT(slotPreferences()), coll);
- KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()),
-actionCollection());
+ KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), coll);
KStdAction::configureToolbars(this, SLOT(slotConfigureToolbars()), coll);
@@ -383,5 +384,5 @@ actionCollection());
m_paShowLog = new KToggleAction(i18n("Show &Log Window"),"tool_logwindow", 0, this, SLOT(slotToggleLogWindow()), coll, "toggle_log");
m_paShowLog->setCheckedState(i18n("Hide &Log Window"));
- m_paDropTarget = new KToggleAction(i18n("Drop &Target"),"tool_drop_target", 0, this, SLOT(slotToggleDropTarget()), coll, "drop_target");
+ m_paDropTarget = new KAction(i18n("Show Drop &Target"),"tool_drop_target", 0, this, SLOT(slotToggleDropTarget()), coll, "drop_target");
menuHelp = new KHelpMenu(this, KGlobal::instance()->aboutData());
@@ -1824,11 +1825,14 @@ void KMainWidget::slotToggleDropTarget()
sDebugIn << endl;
#endif
+ m_showDropTarget = !m_showDropTarget;
- if (m_paDropTarget->isChecked()) {
+ if (m_showDropTarget) {
kdrop->show();
kdrop->updateStickyState();
+ m_paDropTarget->setText(i18n("Hide Drop &Target"));
}
else {
kdrop->hide();
+ m_paDropTarget->setText(i18n("Show Drop &Target"));
}
@@ -2394,5 +2398,5 @@ bool KMainWidget::sanityChecksSuccessful
bool KMainWidget::isDropTargetVisible() const
{
- return m_paDropTarget->isChecked();
+ return m_showDropTarget;
}
@@ -2401,6 +2405,5 @@ void KMainWidget::setDropTargetVisible(
if ( setVisible != isDropTargetVisible() )
{
- m_paDropTarget->setChecked( !m_paDropTarget->isChecked() );
- slotToggleDropTarget();
+ m_paDropTarget->activate();
}
}
@@ -2417,3 +2420,8 @@ bool KMainWidget::isOfflineMode() const
}
+void KMainWidget::activateDropTarget()
+{
+ setDropTargetVisible( true );
+}
+
#include "kmainwidget.moc"
--- kdenetwork/kget/kmainwidget.h #1.31:1.32
@@ -89,4 +89,6 @@ public:
void readTransfersEx(const KURL & url);
+ void activateDropTarget();
+
public slots:
void slotPasteTransfer();
@@ -216,8 +218,6 @@ private:
KToggleAction *m_paAutoDisconnect, *m_paAutoShutdown, *m_paAutoPaste;
- KToggleAction *m_paDropTarget;
-
- public:
- void activateDropTarget(void){if(!m_paDropTarget->isChecked()) m_paDropTarget->activate();};
+ KAction *m_paDropTarget;
+ bool m_showDropTarget;
};
More information about the Kget
mailing list