import org.apache.log4j.Logger;
import org.h2.tools.ChangeFileEncryption;
+import com.evernote.edam.error.EDAMErrorCode;
import com.evernote.edam.error.EDAMNotFoundException;
import com.evernote.edam.error.EDAMSystemException;
import com.evernote.edam.error.EDAMUserException;
syncRunner.status.message.connect(this, "setMessage(String)");
syncRunner.syncSignal.finished.connect(this, "syncThreadComplete(Boolean)");
syncRunner.syncSignal.errorDisconnect.connect(this, "remoteErrorDisconnect()");
+ syncRunner.limitSignal.rateLimitReached.connect(this, "informRateLimit(Integer)");
syncRunning = false;
if (syncTime > 0) {
automaticSync = true;
logger.log(logger.HIGH, "Entering NeverNote.setupToolBar");
toolBar = addToolBar(tr("Tool Bar"));
toolBar.setObjectName("toolBar");
+ toolBar.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonTextBesideIcon);
menuBar.setupToolBarVisible();
if (!Global.isWindowVisible("toolBar"))
toolBar.setVisible(false);
// toolBar.addWidget(menuBar);
// menuBar.setSizePolicy(Policy.Minimum, Policy.Minimum);
// toolBar.addSeparator();
- prevButton = toolBar.addAction(tr("Previous"));
+ prevButton = toolBar.addAction(tr(""));
+ prevButton.setToolTip(tr("Previous"));
QIcon prevIcon = new QIcon(iconPath+"back.png");
prevButton.setIcon(prevIcon);
prevButton.triggered.connect(this, "previousViewedAction()");
togglePrevArrowButton(Global.isToolbarButtonVisible("prevArrow"));
- nextButton = toolBar.addAction(tr("Next"));
+ nextButton = toolBar.addAction(tr(""));
+ nextButton.setToolTip(tr("Next"));
QIcon nextIcon = new QIcon(iconPath+"forward.png");
nextButton.setIcon(nextIcon);
nextButton.triggered.connect(this, "nextViewedAction()");
toggleNextArrowButton(Global.isToolbarButtonVisible("nextArrow"));
+ toolBar.addSeparator();
+
upButton = toolBar.addAction(tr("Up"));
QIcon upIcon = new QIcon(iconPath+"up.png");
upButton.setIcon(upIcon);
setMessage("EDAMUserException: " +e.getMessage());
return;
} catch (EDAMSystemException e) {
+ if (e.getErrorCode() == EDAMErrorCode.RATE_LIMIT_REACHED) {
+ QMessageBox.warning(this, tr("Rate limit reached"), tr("Rate limit reached.\nRetry your request in " + e.getRateLimitDuration() + " seconds."));
+ }
setMessage("EDAMSystemException: " +e.getMessage());
return;
} catch (EDAMNotFoundException e) {
waitCursor(false);
return null;
} catch (EDAMSystemException e) {
+ if (e.getErrorCode() == EDAMErrorCode.RATE_LIMIT_REACHED) {
+ QMessageBox.warning(this, tr("Rate limit reached"), tr("Rate limit reached.\nRetry your request in " + e.getRateLimitDuration() + " seconds."));
+ }
setMessage("EDAMSystemException: " +e.getMessage());
waitCursor(false);
return null;
setMessage("EDAMUserException: " +e.getMessage());
return;
} catch (EDAMSystemException e) {
+ if (e.getErrorCode() == EDAMErrorCode.RATE_LIMIT_REACHED) {
+ QMessageBox.warning(this, tr("Rate limit reached"), tr("Rate limit reached.\nRetry your request in " + e.getRateLimitDuration() + " seconds."));
+ }
setMessage("EDAMSystemException: " +e.getMessage());
return;
} catch (TException e) {
public RensoNoteList getRensoNoteList() {
return rensoNoteListDock.getRensoNoteList();
}
+
+ // 帯域制限の超過をユーザに通知
+ @SuppressWarnings("unused")
+ private void informRateLimit(Integer rateLimitDuration) {
+ QMessageBox.warning(this, tr("Rate limit reached"), tr("Rate limit reached.\nRetry your request in " + rateLimitDuration + " seconds."));
+ }
}