Skip to content

Commit

Permalink
Merge remote branch 'rm/master'
Browse files Browse the repository at this point in the history
* rm/master:
  Fix passive popup problem that broke screen grab.
  Temporarily disable deletion tracking.
  Fix a memory access bug.
  onety-three's patch for session restore bug.
  Fix 'spacer' is not a widget warning.
  Make KPassivePopup creation consistent.
  Fix insignificant typo in a comment.
  Fix some broken icons.
  Re-enable GPG.
  "Fix" minimize bug.
  Fix big note scrolling bug.
  Fix handle selection bug.
  • Loading branch information
kelvie committed Mar 8, 2010
2 parents 355e777 + a737829 commit e87b76e
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 88 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 2.4)

find_package(KDE4 REQUIRED)
find_package(QImageBlitz REQUIRED)
#find_package(Gpgme)
#find_package(Gpgmepp)
find_package(Gpgme)
find_package(Gpgmepp)

if (BUILD_KPARTS)
find_package(KdepimLibs REQUIRED)
Expand Down
8 changes: 4 additions & 4 deletions links.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dest_files=(
"$LINKS/share/apps/basket/icons/hicolor/16x16/actions/tag_priority_high.png"
"$LINKS/share/apps/basket/icons/hicolor/16x16/actions/tag_important.png"
"$LINKS/share/apps/basket/icons/hicolor/16x16/actions/tag_for_later.png"
"$LINKS/share/apps/basket/icons/hicolor/16x16/actions/tag_preference_excelent.png"
"$LINKS/share/apps/basket/icons/hicolor/16x16/actions/tag_preference_excellent.png"
"$LINKS/share/apps/basket/icons/hicolor/16x16/actions/tag_priority_medium.png"
"$LINKS/share/apps/basket/icons/hicolor/16x16/actions/tag_progress_000.png"
"$LINKS/share/apps/basket/icons/hicolor/16x16/actions/tag_progress_100.png"
Expand Down Expand Up @@ -79,7 +79,7 @@ dest_files=(
"$LINKS/share/icons/hicolor/16x16/actions/tag_priority_high.png"
"$LINKS/share/icons/hicolor/16x16/actions/tag_important.png"
"$LINKS/share/icons/hicolor/16x16/actions/tag_for_later.png"
"$LINKS/share/icons/hicolor/16x16/actions/tag_preference_excelent.png"
"$LINKS/share/icons/hicolor/16x16/actions/tag_preference_excellent.png"
"$LINKS/share/icons/hicolor/16x16/actions/tag_priority_medium.png"
"$LINKS/share/icons/hicolor/16x16/actions/tag_progress_000.png"
"$LINKS/share/icons/hicolor/16x16/actions/tag_progress_100.png"
Expand Down Expand Up @@ -134,7 +134,7 @@ source_files=(
"$TARGET/tags/hi16-action-tag_priority_high.png"
"$TARGET/tags/hi16-action-tag_important.png"
"$TARGET/tags/hi16-action-tag_for_later.png"
"$TARGET/tags/hi16-action-tag_preference_excelent.png"
"$TARGET/tags/hi16-action-tag_preference_excellent.png"
"$TARGET/tags/hi16-action-tag_priority_medium.png"
"$TARGET/tags/hi16-action-tag_progress_000.png"
"$TARGET/tags/hi16-action-tag_progress_100.png"
Expand Down Expand Up @@ -171,7 +171,7 @@ source_files=(
"$TARGET/tags/hi16-action-tag_priority_high.png"
"$TARGET/tags/hi16-action-tag_important.png"
"$TARGET/tags/hi16-action-tag_for_later.png"
"$TARGET/tags/hi16-action-tag_preference_excelent.png"
"$TARGET/tags/hi16-action-tag_preference_excellent.png"
"$TARGET/tags/hi16-action-tag_priority_medium.png"
"$TARGET/tags/hi16-action-tag_progress_000.png"
"$TARGET/tags/hi16-action-tag_progress_100.png"
Expand Down
9 changes: 5 additions & 4 deletions src/basketview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ BasketView::BasketView(QWidget *parent, const QString &folderName)
// File Watcher:
m_watcher = new KDirWatch(this);
connect(m_watcher, SIGNAL(dirty(const QString&)), this, SLOT(watchedFileModified(const QString&)));
connect(m_watcher, SIGNAL(deleted(const QString&)), this, SLOT(watchedFileDeleted(const QString&)));
//connect(m_watcher, SIGNAL(deleted(const QString&)), this, SLOT(watchedFileDeleted(const QString&)));
connect(&m_watcherTimer, SIGNAL(timeout()), this, SLOT(updateModifiedNotes()));

// Various Connections:
Expand Down Expand Up @@ -2005,12 +2005,12 @@ void BasketView::contentsMouseReleaseEvent(QMouseEvent *event)
}
}


/*
if (event->buttons() == 0 && (zone == Note::Group || zone == Note::Handle)) {
closeEditor();
unselectAllBut(clicked);
}

*/

// Do nothing if an action has already been made during mousePressEvent,
// or if user made a selection and canceled it by regressing to a very small rectangle.
Expand Down Expand Up @@ -3661,7 +3661,8 @@ void BasketView::editorCursorPositionChanged()
QPoint cursorPoint = textEdit->viewport()->mapTo(
viewport(), textEdit->cursorRect().center()
);
ensureVisible(cursorPoint.x(), cursorPoint.y());
QPoint contentsCursor = viewportToContents(cursorPoint);
ensureVisible(contentsCursor.x(), contentsCursor.y());
}

void BasketView::closeEditorDelayed()
Expand Down
111 changes: 79 additions & 32 deletions src/bnpview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ BNPView::BNPView(QWidget *parent, const char *name, KXMLGUIClient *aGUIClient,
, m_firstShow(true)
, m_regionGrabber(0)
, m_passiveDroppedSelection(0)
, m_passivePopup(0)
, m_actionCollection(actionCollection)
, m_guiClient(aGUIClient)
, m_statusbar(bar)
Expand Down Expand Up @@ -166,13 +165,15 @@ void BNPView::lateInit()
toolbar->hide();
}
*/
/*
if (!isPart()) {
if (Settings::useSystray() && KCmdLineArgs::parsedArgs() && KCmdLineArgs::parsedArgs()->isSet("start-hidden")) {
if (Global::mainWindow()) Global::mainWindow()->hide();
} else if (Settings::useSystray() && kapp->isSessionRestored()) {
if (Global::mainWindow()) Global::mainWindow()->setShown(!Settings::startDocked());
}
}
*/

// If the main window is hidden when session is saved, Container::queryClose()
// isn't called and the last value would be kept
Expand Down Expand Up @@ -2308,36 +2309,59 @@ void BNPView::showPassiveDroppedDelayed()

QString title = m_passiveDroppedTitle;

delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : this);
QImage contentsImage = NoteDrag::feedbackPixmap(m_passiveDroppedSelection).toImage();
QResource::registerResource(contentsImage.bits(), ":/images/passivepopup_image");
m_passivePopup->setView(

if (Settings::useSystray()){

KPassivePopup::message(KPassivePopup::Boxed,
title.arg(Tools::textToHTMLWithoutP(currentBasket()->basketName())),
(contentsImage.isNull() ? "" : "<img src=\":/images/passivepopup_image\">"),
KIconLoader::global()->loadIcon(
currentBasket()->icon(), KIconLoader::NoGroup, 16,
KIconLoader::DefaultState, QStringList(), 0L, true
)
);
m_passivePopup->show();
),
Global::systemTray);
}
else{
KPassivePopup::message(KPassivePopup::Boxed,
title.arg(Tools::textToHTMLWithoutP(currentBasket()->basketName())),
(contentsImage.isNull() ? "" : "<img src=\":/images/passivepopup_image\">"),
KIconLoader::global()->loadIcon(
currentBasket()->icon(), KIconLoader::NoGroup, 16,
KIconLoader::DefaultState, QStringList(), 0L, true
),
(QWidget*)this);
}
}

void BNPView::showPassiveImpossible(const QString &message)
{
delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : (QWidget*)this);
m_passivePopup->setView(
QString("<font color=red>%1</font>")
.arg(i18n("Basket <i>%1</i> is locked"))
.arg(Tools::textToHTMLWithoutP(currentBasket()->basketName())),
message,
KIconLoader::global()->loadIcon(
currentBasket()->icon(), KIconLoader::NoGroup, 16,
KIconLoader::DefaultState, QStringList(), 0L, true
)
);
m_passivePopup->show();
if (Settings::useSystray()){
KPassivePopup::message(KPassivePopup::Boxed,
QString("<font color=red>%1</font>")
.arg(i18n("Basket <i>%1</i> is locked"))
.arg(Tools::textToHTMLWithoutP(currentBasket()->basketName())),
message,
KIconLoader::global()->loadIcon(
currentBasket()->icon(), KIconLoader::NoGroup, 16,
KIconLoader::DefaultState, QStringList(), 0L, true
),
Global::systemTray);
}
else{
KPassivePopup::message(KPassivePopup::Boxed,
QString("<font color=red>%1</font>")
.arg(i18n("Basket <i>%1</i> is locked"))
.arg(Tools::textToHTMLWithoutP(currentBasket()->basketName())),
message,
KIconLoader::global()->loadIcon(
currentBasket()->icon(), KIconLoader::NoGroup, 16,
KIconLoader::DefaultState, QStringList(), 0L, true
),
(QWidget*)this);

}
}

void BNPView::showPassiveContentForced()
Expand All @@ -2353,9 +2377,8 @@ void BNPView::showPassiveContent(bool forceShow/* = false*/)
// FIXME: Duplicate code (2 times)
QString message;

delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : (QWidget*)this);
m_passivePopup->setView(
if(Settings::useSystray()){
KPassivePopup::message(KPassivePopup::Boxed,
"<qt>" + KDialog::makeStandardCaption(
currentBasket()->isLocked() ? QString("%1 <font color=gray30>%2</font>")
.arg(Tools::textToHTMLWithoutP(currentBasket()->basketName()), i18n("(Locked)"))
Expand All @@ -2365,27 +2388,51 @@ void BNPView::showPassiveContent(bool forceShow/* = false*/)
KIconLoader::global()->loadIcon(
currentBasket()->icon(), KIconLoader::NoGroup, 16,
KIconLoader::DefaultState, QStringList(), 0L, true
)
);
m_passivePopup->show();
),
Global::systemTray);
}
else{
KPassivePopup::message(KPassivePopup::Boxed,
"<qt>" + KDialog::makeStandardCaption(
currentBasket()->isLocked() ? QString("%1 <font color=gray30>%2</font>")
.arg(Tools::textToHTMLWithoutP(currentBasket()->basketName()), i18n("(Locked)"))
: Tools::textToHTMLWithoutP(currentBasket()->basketName())
),
message,
KIconLoader::global()->loadIcon(
currentBasket()->icon(), KIconLoader::NoGroup, 16,
KIconLoader::DefaultState, QStringList(), 0L, true
),
(QWidget*)this);

}
}

void BNPView::showPassiveLoading(BasketView *basket)
{
if (isMainWindowActive())
return;

delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : (QWidget*)this);
m_passivePopup->setView(
if (Settings::useSystray()){
KPassivePopup::message(KPassivePopup::Boxed,
Tools::textToHTMLWithoutP(basket->basketName()),
i18n("Loading..."),
KIconLoader::global()->loadIcon(
basket->icon(), KIconLoader::NoGroup, 16, KIconLoader::DefaultState,
QStringList(), 0L, true
)
);
m_passivePopup->show();
),
Global::systemTray);
}
else{
KPassivePopup::message(KPassivePopup::Boxed,
Tools::textToHTMLWithoutP(basket->basketName()),
i18n("Loading..."),
KIconLoader::global()->loadIcon(
basket->icon(), KIconLoader::NoGroup, 16, KIconLoader::DefaultState,
QStringList(), 0L, true
),
(QWidget *)this);
}
}

void BNPView::addNoteText()
Expand Down
2 changes: 0 additions & 2 deletions src/bnpview.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class QDomDocument;
class QDomElement;
class KAction;
class KToggleAction;
class KPassivePopup;
class KMenu;
class KTar;

Expand Down Expand Up @@ -355,7 +354,6 @@ private slots:
RegionGrabber *m_regionGrabber;
QString m_passiveDroppedTitle;
NoteSelection *m_passiveDroppedSelection;
KPassivePopup *m_passivePopup;
static const int c_delayTooltipTime;
KActionCollection *m_actionCollection;
KXMLGUIClient *m_guiClient;
Expand Down
6 changes: 4 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ int main(int argc, char *argv[])
if (KCmdLineArgs::parsedArgs() && KCmdLineArgs::parsedArgs()->isSet("start-hidden"))
;
// When the application is restored by KDE session, restore its state:
else if (app.isSessionRestored())
win->setShown(!Settings::startDocked());
else if (app.isSessionRestored()){
if (!Settings::startDocked())
win->show();
}
// Else, the application has been launched explicitely by the user (KMenu, keyboard shortcut...), so he need it, we show it:
else
win->show();
Expand Down
1 change: 1 addition & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ MainWindow::~MainWindow()
KConfigGroup group = KGlobal::config()->group(autoSaveGroup());
saveMainWindowSettings(group);
delete m_settings;
delete m_baskets;
}

void MainWindow::setupActions()
Expand Down
3 changes: 2 additions & 1 deletion src/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1906,6 +1906,7 @@ void Note::draw(QPainter *painter, const QRect &clipRect)

/** Initialise buffer painter: */
m_bufferedPixmap = QPixmap(width(), height());
Q_ASSERT(!m_bufferedPixmap.isNull());
QPainter painter2(&m_bufferedPixmap);

/** Initialise colors: */
Expand Down Expand Up @@ -2073,7 +2074,7 @@ void Note::draw(QPainter *painter, const QRect &clipRect)
}

// Draw content:
// Optimization: do not draw text notes because it is time consuming and should be done nearly at each tetx modification.
// Optimization: do not draw text notes because it is time consuming and should be done nearly at each text modification.
if (basket()->editedNote() != this || basket()->editedNote()->content()->type() != NoteType::Html) {
painter2.translate(contentX(), NOTE_MARGIN);
painter2.setFont(m_computedState.font(painter2.font()));
Expand Down
Loading

0 comments on commit e87b76e

Please sign in to comment.