}
// --- Menus -----------------------------------------------
- case LFUN_BUFFER_NEW:
- lyx_view_->newDocument(argument, false);
- updateFlags = Update::None;
- break;
-
- case LFUN_BUFFER_NEW_TEMPLATE:
- lyx_view_->newDocument(argument, true);
- updateFlags = Update::None;
- break;
-
case LFUN_BUFFER_CLOSE:
lyx_view_->closeBuffer();
updateFlags = Update::None;
case LyXRC::RC_SERVERPIPE:
case LyXRC::RC_SET_COLOR:
case LyXRC::RC_SHOW_BANNER:
+ case LyXRC::RC_SINGLE_WINDOW:
case LyXRC::RC_SPELL_COMMAND:
case LyXRC::RC_TEMPDIRPATH:
case LyXRC::RC_TEMPLATEPATH:
///
void setLyXView(frontend::LyXView * lv);
-
+
///
void initKeySequences(KeyMap * kb);
{ "\\serverpipe", LyXRC::RC_SERVERPIPE },
{ "\\set_color", LyXRC::RC_SET_COLOR },
{ "\\show_banner", LyXRC::RC_SHOW_BANNER },
+ { "\\single_window", LyXRC::RC_SINGLE_WINDOW },
{ "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
{ "\\spell_command", LyXRC::RC_SPELL_COMMAND },
{ "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
user_name = to_utf8(support::user_name());
user_email = to_utf8(support::user_email());
+#ifdef __APPLE_CC__
+ single_window = false;
+#else
+ single_window = true;
+#endif
// Fullscreen settings
full_screen_limit = false;
if (lexrc.next())
full_screen_width = lexrc.getInteger();
break;
+ case RC_SINGLE_WINDOW:
+ if (lexrc.next())
+ single_window = lexrc.getBool();
+ break;
case RC_LAST: break; // this is just a dummy
}
}
if (tag != RC_LAST)
break;
-
+ case RC_SINGLE_WINDOW:
+ if (ignore_system_lyxrc ||
+ single_window != system_lyxrc.single_window) {
+ os << "\\single_window "
+ << convert<string>(single_window)
+ << '\n';
+ }
+ if (tag != RC_LAST)
+ break;
os << "\n#\n"
<< "# COLOR SECTION ###################################\n"
RC_SERVERPIPE,
RC_SET_COLOR,
RC_SHOW_BANNER,
+ RC_SINGLE_WINDOW,
RC_SORT_LAYOUTS,
RC_SPELL_COMMAND,
RC_TEMPDIRPATH,
bool completion_popup_text;
///
bool completion_popup_after_complete;
+ /// Open new buffers in the current window as tab.
+ bool single_window;
};
break;
}
+ case LFUN_BUFFER_NEW:
+ if (viewCount() == 0
+ || (!lyxrc.single_window && current_view_->buffer() != 0))
+ createView();
+ current_view_->newDocument(to_utf8(cmd.argument()), false);
+ break;
+
+ case LFUN_BUFFER_NEW_TEMPLATE:
+ if (viewCount() == 0
+ || (!lyxrc.single_window && current_view_->buffer() != 0)) {
+ createView();
+ current_view_->newDocument(to_utf8(cmd.argument()), true);
+ if (!current_view_->buffer())
+ current_view_->close();
+ } else
+ current_view_->newDocument(to_utf8(cmd.argument()), true);
+ break;
+
+ case LFUN_FILE_OPEN:
+ if (viewCount() == 0
+ || (!lyxrc.single_window && current_view_->buffer() != 0)) {
+ createView();
+ current_view_->openDocument(to_utf8(cmd.argument()));
+ if (!current_view_->buffer())
+ current_view_->close();
+ } else
+ current_view_->openDocument(to_utf8(cmd.argument()));
+ break;
+
default:
// Notify the caller that the action has not been dispatched.
return false;
#endif
}
view->setFocus();
-
+ setActiveWindow(view);
setCurrentView(*view);
}
autoSaveSB, SLOT(setEnabled(bool)));
connect(autoSaveCB, SIGNAL(toggled(bool)),
TextLabel1, SLOT(setEnabled(bool)));
+ connect(openDocumentsInTabsCB, SIGNAL(clicked()),
+ this, SIGNAL(changed()));
connect(uiFilePB, SIGNAL(clicked()),
this, SLOT(select_ui()));
connect(uiFileED, SIGNAL(textChanged(QString)),
rc.full_screen_tabbar = toggleTabbarCB->isChecked();
rc.full_screen_width = fullscreenWidthSB->value();
rc.full_screen_limit = fullscreenLimitGB->isChecked();
+ rc.single_window = openDocumentsInTabsCB->isChecked();
}
toggleTabbarCB->setChecked(rc.full_screen_tabbar);
fullscreenWidthSB->setValue(rc.full_screen_width);
fullscreenLimitGB->setChecked(rc.full_screen_limit);
-
+ openDocumentsInTabsCB->setChecked(rc.single_window);
}
bv->cursor().updateFlags(Update::None);
switch(cmd.action) {
- case LFUN_FILE_OPEN:
- openDocument(to_utf8(cmd.argument()));
- break;
-
case LFUN_BUFFER_IMPORT:
importDocument(to_utf8(cmd.argument()));
break;
</property>
</widget>
</item>
+ <item row="2" column="0" colspan="4">
+ <widget class="QCheckBox" name="openDocumentsInTabsCB" >
+ <property name="text" >
+ <string>Open documents in &tabs</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
<tabstop>autoSaveCB</tabstop>
<tabstop>autoSaveSB</tabstop>
<tabstop>lastfilesSB</tabstop>
+ <tabstop>openDocumentsInTabsCB</tabstop>
<tabstop>cursorFollowsCB</tabstop>
<tabstop>sortEnvironmentsCB</tabstop>
<tabstop>groupEnvironmentsCB</tabstop>