support multiple file opening on launch
parent
8db7adfa74
commit
22f5b0502d
15
notes
15
notes
|
@ -33,16 +33,17 @@ parameters {
|
|||
TODO {
|
||||
immediate frontburner {
|
||||
multi-window accounting {
|
||||
- keep list of active windows
|
||||
- quit (just trigger close on all sequentially)
|
||||
- if opening project already in other window, focus/flash that window
|
||||
- open project from command line
|
||||
- IPC to open/new window in existing instance
|
||||
revert action
|
||||
rewrite signaling using CBOR to support file lists
|
||||
support opening multiple files at once
|
||||
(if no successes, open new project window)
|
||||
|
||||
- xdg mime package + desktop file association
|
||||
change %f to %F once list support is implemented
|
||||
|
||||
array?
|
||||
}
|
||||
|
||||
revert action
|
||||
|
||||
clear song info on loading template?
|
||||
user-defined default template
|
||||
|
||||
|
|
|
@ -78,8 +78,21 @@ int main(int argc, char *argv[]) {
|
|||
Xybrid::Config::PluginRegistry::init();
|
||||
Xybrid::Audio::AudioEngine::init();
|
||||
|
||||
auto* w = new Xybrid::MainWindow(nullptr, fileName);
|
||||
w->show();
|
||||
bool opn = false;
|
||||
|
||||
for (auto& fn : args) {
|
||||
QFileInfo fi(fn);
|
||||
if (!fi.exists()) continue;
|
||||
auto fileName = fi.absoluteFilePath();
|
||||
auto w = new Xybrid::MainWindow(nullptr, fileName);
|
||||
if (w->getProject()) { w->show(); opn = true; }
|
||||
else (w->deleteLater());
|
||||
}
|
||||
|
||||
if (!opn) { // always show one window on launch
|
||||
auto* w = new Xybrid::MainWindow(nullptr);
|
||||
w->show();
|
||||
}
|
||||
|
||||
// hook up exit event
|
||||
QObject::connect(&a, &QCoreApplication::aboutToQuit, [] {
|
||||
|
|
|
@ -502,7 +502,7 @@ MainWindow::MainWindow(QWidget *parent, const QString& fileName) :
|
|||
|
||||
selectSampleForEditing(nullptr); // init blank
|
||||
|
||||
bool isFirst = openWindows.empty();
|
||||
bool isFirst = false;//openWindows.empty();
|
||||
openWindows.insert(this);
|
||||
|
||||
if (fileName.isEmpty()) {
|
||||
|
|
Loading…
Reference in New Issue